@@ -12,7 +12,7 @@ interface MockResponse {
1212 status : number
1313 data ?: any
1414 error ?: {
15- statusCode : string
15+ statusCode : number
1616 error : string
1717 message : string
1818 }
@@ -186,7 +186,7 @@ export function createMockFetch(): Fetch {
186186 response = {
187187 status : 500 ,
188188 error : {
189- statusCode : 'InternalError' ,
189+ statusCode : 500 ,
190190 error : 'Internal Server Error' ,
191191 message : error . message ,
192192 } ,
@@ -257,7 +257,7 @@ async function handleRequest(
257257 return {
258258 status : 404 ,
259259 error : {
260- statusCode : 'NotFound' ,
260+ statusCode : 404 ,
261261 error : 'Not Found' ,
262262 message : `Endpoint not found: ${ endpoint } ` ,
263263 } ,
@@ -272,7 +272,7 @@ function handleCreateBucket(body: any): MockResponse {
272272 return {
273273 status : 409 ,
274274 error : {
275- statusCode : 'S3VectorConflictException' ,
275+ statusCode : 409 ,
276276 error : 'Conflict' ,
277277 message : `Bucket '${ vectorBucketName } ' already exists` ,
278278 } ,
@@ -290,7 +290,7 @@ function handleGetBucket(body: any): MockResponse {
290290 return {
291291 status : 404 ,
292292 error : {
293- statusCode : 'S3VectorNotFoundException' ,
293+ statusCode : 404 ,
294294 error : 'Not Found' ,
295295 message : `Bucket '${ vectorBucketName } ' not found` ,
296296 } ,
@@ -328,7 +328,7 @@ function handleDeleteBucket(body: any): MockResponse {
328328 return {
329329 status : 404 ,
330330 error : {
331- statusCode : 'S3VectorNotFoundException' ,
331+ statusCode : 409 ,
332332 error : 'Not Found' ,
333333 message : `Bucket '${ vectorBucketName } ' not found` ,
334334 } ,
@@ -340,7 +340,7 @@ function handleDeleteBucket(body: any): MockResponse {
340340 return {
341341 status : 400 ,
342342 error : {
343- statusCode : 'S3VectorBucketNotEmpty' ,
343+ statusCode : 409 ,
344344 error : 'Bad Request' ,
345345 message : `Bucket '${ vectorBucketName } ' is not empty` ,
346346 } ,
@@ -359,7 +359,7 @@ function handleCreateIndex(body: any): MockResponse {
359359 return {
360360 status : 404 ,
361361 error : {
362- statusCode : 'S3VectorNotFoundException' ,
362+ statusCode : 409 ,
363363 error : 'Not Found' ,
364364 message : `Bucket '${ vectorBucketName } ' not found` ,
365365 } ,
@@ -370,7 +370,7 @@ function handleCreateIndex(body: any): MockResponse {
370370 return {
371371 status : 409 ,
372372 error : {
373- statusCode : 'S3VectorConflictException' ,
373+ statusCode : 409 ,
374374 error : 'Conflict' ,
375375 message : `Index '${ indexName } ' already exists` ,
376376 } ,
@@ -392,7 +392,7 @@ function handleGetIndex(body: any): MockResponse {
392392 return {
393393 status : 404 ,
394394 error : {
395- statusCode : 'S3VectorNotFoundException' ,
395+ statusCode : 409 ,
396396 error : 'Not Found' ,
397397 message : `Bucket '${ vectorBucketName } ' not found` ,
398398 } ,
@@ -404,7 +404,7 @@ function handleGetIndex(body: any): MockResponse {
404404 return {
405405 status : 404 ,
406406 error : {
407- statusCode : 'S3VectorNotFoundException' ,
407+ statusCode : 409 ,
408408 error : 'Not Found' ,
409409 message : `Index '${ indexName } ' not found` ,
410410 } ,
@@ -424,7 +424,7 @@ function handleListIndexes(body: any): MockResponse {
424424 return {
425425 status : 404 ,
426426 error : {
427- statusCode : 'S3VectorNotFoundException' ,
427+ statusCode : 409 ,
428428 error : 'Not Found' ,
429429 message : `Bucket '${ vectorBucketName } ' not found` ,
430430 } ,
@@ -449,7 +449,7 @@ function handleDeleteIndex(body: any): MockResponse {
449449 return {
450450 status : 404 ,
451451 error : {
452- statusCode : 'S3VectorNotFoundException' ,
452+ statusCode : 409 ,
453453 error : 'Not Found' ,
454454 message : `Bucket '${ vectorBucketName } ' not found` ,
455455 } ,
@@ -460,7 +460,7 @@ function handleDeleteIndex(body: any): MockResponse {
460460 return {
461461 status : 404 ,
462462 error : {
463- statusCode : 'S3VectorNotFoundException' ,
463+ statusCode : 409 ,
464464 error : 'Not Found' ,
465465 message : `Index '${ indexName } ' not found` ,
466466 } ,
@@ -479,7 +479,7 @@ function handlePutVectors(body: any): MockResponse {
479479 return {
480480 status : 404 ,
481481 error : {
482- statusCode : 'S3VectorNotFoundException' ,
482+ statusCode : 404 ,
483483 error : 'Not Found' ,
484484 message : `Bucket '${ vectorBucketName } ' not found` ,
485485 } ,
@@ -490,7 +490,7 @@ function handlePutVectors(body: any): MockResponse {
490490 return {
491491 status : 404 ,
492492 error : {
493- statusCode : 'S3VectorNotFoundException' ,
493+ statusCode : 404 ,
494494 error : 'Not Found' ,
495495 message : `Index '${ indexName } ' not found` ,
496496 } ,
@@ -511,7 +511,7 @@ function handleGetVectors(body: any): MockResponse {
511511 return {
512512 status : 404 ,
513513 error : {
514- statusCode : 'S3VectorNotFoundException' ,
514+ statusCode : 404 ,
515515 error : 'Not Found' ,
516516 message : `Bucket '${ vectorBucketName } ' not found` ,
517517 } ,
@@ -522,7 +522,7 @@ function handleGetVectors(body: any): MockResponse {
522522 return {
523523 status : 404 ,
524524 error : {
525- statusCode : 'S3VectorNotFoundException' ,
525+ statusCode : 404 ,
526526 error : 'Not Found' ,
527527 message : `Index '${ indexName } ' not found` ,
528528 } ,
@@ -555,7 +555,7 @@ function handleListVectors(body: any): MockResponse {
555555 return {
556556 status : 404 ,
557557 error : {
558- statusCode : 'S3VectorNotFoundException' ,
558+ statusCode : 404 ,
559559 error : 'Not Found' ,
560560 message : `Bucket '${ vectorBucketName } ' not found` ,
561561 } ,
@@ -566,7 +566,7 @@ function handleListVectors(body: any): MockResponse {
566566 return {
567567 status : 404 ,
568568 error : {
569- statusCode : 'S3VectorNotFoundException' ,
569+ statusCode : 404 ,
570570 error : 'Not Found' ,
571571 message : `Index '${ indexName } ' not found` ,
572572 } ,
@@ -596,7 +596,6 @@ function handleQueryVectors(body: any): MockResponse {
596596 const {
597597 vectorBucketName,
598598 indexName,
599- queryVector,
600599 topK = 10 ,
601600 filter,
602601 returnDistance = false ,
@@ -607,7 +606,7 @@ function handleQueryVectors(body: any): MockResponse {
607606 return {
608607 status : 404 ,
609608 error : {
610- statusCode : 'S3VectorNotFoundException' ,
609+ statusCode : 409 ,
611610 error : 'Not Found' ,
612611 message : `Bucket '${ vectorBucketName } ' not found` ,
613612 } ,
@@ -618,7 +617,7 @@ function handleQueryVectors(body: any): MockResponse {
618617 return {
619618 status : 404 ,
620619 error : {
621- statusCode : 'S3VectorNotFoundException' ,
620+ statusCode : 404 ,
622621 error : 'Not Found' ,
623622 message : `Index '${ indexName } ' not found` ,
624623 } ,
@@ -662,7 +661,7 @@ function handleDeleteVectors(body: any): MockResponse {
662661 return {
663662 status : 404 ,
664663 error : {
665- statusCode : 'S3VectorNotFoundException' ,
664+ statusCode : 404 ,
666665 error : 'Not Found' ,
667666 message : `Bucket '${ vectorBucketName } ' not found` ,
668667 } ,
@@ -673,7 +672,7 @@ function handleDeleteVectors(body: any): MockResponse {
673672 return {
674673 status : 404 ,
675674 error : {
676- statusCode : 'S3VectorNotFoundException' ,
675+ statusCode : 404 ,
677676 error : 'Not Found' ,
678677 message : `Index '${ indexName } ' not found` ,
679678 } ,
0 commit comments