@aws-sdk/client-sqs 3.312.0 → 3.316.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, getArrayIfSingleItem as __getArrayIfSingleItem, getValueFromTextNode as __getValueFromTextNode, parseBoolean as __parseBoolean, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { decorateServiceException as __decorateServiceException, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, getArrayIfSingleItem as __getArrayIfSingleItem, getValueFromTextNode as __getValueFromTextNode, parseBoolean as __parseBoolean, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { XMLParser } from "fast-xml-parser";
4
4
  import { BatchEntryIdsNotDistinct, BatchRequestTooLong, EmptyBatchRequest, InvalidAttributeName, InvalidBatchEntryId, InvalidIdFormat, InvalidMessageContents, MessageNotInflight, OverLimit, PurgeQueueInProgress, QueueDeletedRecently, QueueDoesNotExist, QueueNameExists, ReceiptHandleIsInvalid, TooManyEntriesInBatchRequest, UnsupportedOperation, } from "../models/models_0";
5
5
  import { SQSServiceException as __BaseException } from "../models/SQSServiceException";
@@ -211,7 +211,7 @@ export const de_AddPermissionCommand = async (output, context) => {
211
211
  const response = {
212
212
  $metadata: deserializeMetadata(output),
213
213
  };
214
- return Promise.resolve(response);
214
+ return response;
215
215
  };
216
216
  const de_AddPermissionCommandError = async (output, context) => {
217
217
  const parsedOutput = {
@@ -225,10 +225,9 @@ const de_AddPermissionCommandError = async (output, context) => {
225
225
  throw await de_OverLimitRes(parsedOutput, context);
226
226
  default:
227
227
  const parsedBody = parsedOutput.body;
228
- throwDefaultError({
228
+ return throwDefaultError({
229
229
  output,
230
230
  parsedBody: parsedBody.Error,
231
- exceptionCtor: __BaseException,
232
231
  errorCode,
233
232
  });
234
233
  }
@@ -241,7 +240,7 @@ export const de_ChangeMessageVisibilityCommand = async (output, context) => {
241
240
  const response = {
242
241
  $metadata: deserializeMetadata(output),
243
242
  };
244
- return Promise.resolve(response);
243
+ return response;
245
244
  };
246
245
  const de_ChangeMessageVisibilityCommandError = async (output, context) => {
247
246
  const parsedOutput = {
@@ -258,10 +257,9 @@ const de_ChangeMessageVisibilityCommandError = async (output, context) => {
258
257
  throw await de_ReceiptHandleIsInvalidRes(parsedOutput, context);
259
258
  default:
260
259
  const parsedBody = parsedOutput.body;
261
- throwDefaultError({
260
+ return throwDefaultError({
262
261
  output,
263
262
  parsedBody: parsedBody.Error,
264
- exceptionCtor: __BaseException,
265
263
  errorCode,
266
264
  });
267
265
  }
@@ -277,7 +275,7 @@ export const de_ChangeMessageVisibilityBatchCommand = async (output, context) =>
277
275
  $metadata: deserializeMetadata(output),
278
276
  ...contents,
279
277
  };
280
- return Promise.resolve(response);
278
+ return response;
281
279
  };
282
280
  const de_ChangeMessageVisibilityBatchCommandError = async (output, context) => {
283
281
  const parsedOutput = {
@@ -300,10 +298,9 @@ const de_ChangeMessageVisibilityBatchCommandError = async (output, context) => {
300
298
  throw await de_TooManyEntriesInBatchRequestRes(parsedOutput, context);
301
299
  default:
302
300
  const parsedBody = parsedOutput.body;
303
- throwDefaultError({
301
+ return throwDefaultError({
304
302
  output,
305
303
  parsedBody: parsedBody.Error,
306
- exceptionCtor: __BaseException,
307
304
  errorCode,
308
305
  });
309
306
  }
@@ -319,7 +316,7 @@ export const de_CreateQueueCommand = async (output, context) => {
319
316
  $metadata: deserializeMetadata(output),
320
317
  ...contents,
321
318
  };
322
- return Promise.resolve(response);
319
+ return response;
323
320
  };
324
321
  const de_CreateQueueCommandError = async (output, context) => {
325
322
  const parsedOutput = {
@@ -336,10 +333,9 @@ const de_CreateQueueCommandError = async (output, context) => {
336
333
  throw await de_QueueNameExistsRes(parsedOutput, context);
337
334
  default:
338
335
  const parsedBody = parsedOutput.body;
339
- throwDefaultError({
336
+ return throwDefaultError({
340
337
  output,
341
338
  parsedBody: parsedBody.Error,
342
- exceptionCtor: __BaseException,
343
339
  errorCode,
344
340
  });
345
341
  }
@@ -352,7 +348,7 @@ export const de_DeleteMessageCommand = async (output, context) => {
352
348
  const response = {
353
349
  $metadata: deserializeMetadata(output),
354
350
  };
355
- return Promise.resolve(response);
351
+ return response;
356
352
  };
357
353
  const de_DeleteMessageCommandError = async (output, context) => {
358
354
  const parsedOutput = {
@@ -369,10 +365,9 @@ const de_DeleteMessageCommandError = async (output, context) => {
369
365
  throw await de_ReceiptHandleIsInvalidRes(parsedOutput, context);
370
366
  default:
371
367
  const parsedBody = parsedOutput.body;
372
- throwDefaultError({
368
+ return throwDefaultError({
373
369
  output,
374
370
  parsedBody: parsedBody.Error,
375
- exceptionCtor: __BaseException,
376
371
  errorCode,
377
372
  });
378
373
  }
@@ -388,7 +383,7 @@ export const de_DeleteMessageBatchCommand = async (output, context) => {
388
383
  $metadata: deserializeMetadata(output),
389
384
  ...contents,
390
385
  };
391
- return Promise.resolve(response);
386
+ return response;
392
387
  };
393
388
  const de_DeleteMessageBatchCommandError = async (output, context) => {
394
389
  const parsedOutput = {
@@ -411,10 +406,9 @@ const de_DeleteMessageBatchCommandError = async (output, context) => {
411
406
  throw await de_TooManyEntriesInBatchRequestRes(parsedOutput, context);
412
407
  default:
413
408
  const parsedBody = parsedOutput.body;
414
- throwDefaultError({
409
+ return throwDefaultError({
415
410
  output,
416
411
  parsedBody: parsedBody.Error,
417
- exceptionCtor: __BaseException,
418
412
  errorCode,
419
413
  });
420
414
  }
@@ -427,7 +421,7 @@ export const de_DeleteQueueCommand = async (output, context) => {
427
421
  const response = {
428
422
  $metadata: deserializeMetadata(output),
429
423
  };
430
- return Promise.resolve(response);
424
+ return response;
431
425
  };
432
426
  const de_DeleteQueueCommandError = async (output, context) => {
433
427
  const parsedOutput = {
@@ -436,10 +430,9 @@ const de_DeleteQueueCommandError = async (output, context) => {
436
430
  };
437
431
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
438
432
  const parsedBody = parsedOutput.body;
439
- throwDefaultError({
433
+ return throwDefaultError({
440
434
  output,
441
435
  parsedBody: parsedBody.Error,
442
- exceptionCtor: __BaseException,
443
436
  errorCode,
444
437
  });
445
438
  };
@@ -454,7 +447,7 @@ export const de_GetQueueAttributesCommand = async (output, context) => {
454
447
  $metadata: deserializeMetadata(output),
455
448
  ...contents,
456
449
  };
457
- return Promise.resolve(response);
450
+ return response;
458
451
  };
459
452
  const de_GetQueueAttributesCommandError = async (output, context) => {
460
453
  const parsedOutput = {
@@ -468,10 +461,9 @@ const de_GetQueueAttributesCommandError = async (output, context) => {
468
461
  throw await de_InvalidAttributeNameRes(parsedOutput, context);
469
462
  default:
470
463
  const parsedBody = parsedOutput.body;
471
- throwDefaultError({
464
+ return throwDefaultError({
472
465
  output,
473
466
  parsedBody: parsedBody.Error,
474
- exceptionCtor: __BaseException,
475
467
  errorCode,
476
468
  });
477
469
  }
@@ -487,7 +479,7 @@ export const de_GetQueueUrlCommand = async (output, context) => {
487
479
  $metadata: deserializeMetadata(output),
488
480
  ...contents,
489
481
  };
490
- return Promise.resolve(response);
482
+ return response;
491
483
  };
492
484
  const de_GetQueueUrlCommandError = async (output, context) => {
493
485
  const parsedOutput = {
@@ -501,10 +493,9 @@ const de_GetQueueUrlCommandError = async (output, context) => {
501
493
  throw await de_QueueDoesNotExistRes(parsedOutput, context);
502
494
  default:
503
495
  const parsedBody = parsedOutput.body;
504
- throwDefaultError({
496
+ return throwDefaultError({
505
497
  output,
506
498
  parsedBody: parsedBody.Error,
507
- exceptionCtor: __BaseException,
508
499
  errorCode,
509
500
  });
510
501
  }
@@ -520,7 +511,7 @@ export const de_ListDeadLetterSourceQueuesCommand = async (output, context) => {
520
511
  $metadata: deserializeMetadata(output),
521
512
  ...contents,
522
513
  };
523
- return Promise.resolve(response);
514
+ return response;
524
515
  };
525
516
  const de_ListDeadLetterSourceQueuesCommandError = async (output, context) => {
526
517
  const parsedOutput = {
@@ -534,10 +525,9 @@ const de_ListDeadLetterSourceQueuesCommandError = async (output, context) => {
534
525
  throw await de_QueueDoesNotExistRes(parsedOutput, context);
535
526
  default:
536
527
  const parsedBody = parsedOutput.body;
537
- throwDefaultError({
528
+ return throwDefaultError({
538
529
  output,
539
530
  parsedBody: parsedBody.Error,
540
- exceptionCtor: __BaseException,
541
531
  errorCode,
542
532
  });
543
533
  }
@@ -553,7 +543,7 @@ export const de_ListQueuesCommand = async (output, context) => {
553
543
  $metadata: deserializeMetadata(output),
554
544
  ...contents,
555
545
  };
556
- return Promise.resolve(response);
546
+ return response;
557
547
  };
558
548
  const de_ListQueuesCommandError = async (output, context) => {
559
549
  const parsedOutput = {
@@ -562,10 +552,9 @@ const de_ListQueuesCommandError = async (output, context) => {
562
552
  };
563
553
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
564
554
  const parsedBody = parsedOutput.body;
565
- throwDefaultError({
555
+ return throwDefaultError({
566
556
  output,
567
557
  parsedBody: parsedBody.Error,
568
- exceptionCtor: __BaseException,
569
558
  errorCode,
570
559
  });
571
560
  };
@@ -580,7 +569,7 @@ export const de_ListQueueTagsCommand = async (output, context) => {
580
569
  $metadata: deserializeMetadata(output),
581
570
  ...contents,
582
571
  };
583
- return Promise.resolve(response);
572
+ return response;
584
573
  };
585
574
  const de_ListQueueTagsCommandError = async (output, context) => {
586
575
  const parsedOutput = {
@@ -589,10 +578,9 @@ const de_ListQueueTagsCommandError = async (output, context) => {
589
578
  };
590
579
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
591
580
  const parsedBody = parsedOutput.body;
592
- throwDefaultError({
581
+ return throwDefaultError({
593
582
  output,
594
583
  parsedBody: parsedBody.Error,
595
- exceptionCtor: __BaseException,
596
584
  errorCode,
597
585
  });
598
586
  };
@@ -604,7 +592,7 @@ export const de_PurgeQueueCommand = async (output, context) => {
604
592
  const response = {
605
593
  $metadata: deserializeMetadata(output),
606
594
  };
607
- return Promise.resolve(response);
595
+ return response;
608
596
  };
609
597
  const de_PurgeQueueCommandError = async (output, context) => {
610
598
  const parsedOutput = {
@@ -621,10 +609,9 @@ const de_PurgeQueueCommandError = async (output, context) => {
621
609
  throw await de_PurgeQueueInProgressRes(parsedOutput, context);
622
610
  default:
623
611
  const parsedBody = parsedOutput.body;
624
- throwDefaultError({
612
+ return throwDefaultError({
625
613
  output,
626
614
  parsedBody: parsedBody.Error,
627
- exceptionCtor: __BaseException,
628
615
  errorCode,
629
616
  });
630
617
  }
@@ -640,7 +627,7 @@ export const de_ReceiveMessageCommand = async (output, context) => {
640
627
  $metadata: deserializeMetadata(output),
641
628
  ...contents,
642
629
  };
643
- return Promise.resolve(response);
630
+ return response;
644
631
  };
645
632
  const de_ReceiveMessageCommandError = async (output, context) => {
646
633
  const parsedOutput = {
@@ -654,10 +641,9 @@ const de_ReceiveMessageCommandError = async (output, context) => {
654
641
  throw await de_OverLimitRes(parsedOutput, context);
655
642
  default:
656
643
  const parsedBody = parsedOutput.body;
657
- throwDefaultError({
644
+ return throwDefaultError({
658
645
  output,
659
646
  parsedBody: parsedBody.Error,
660
- exceptionCtor: __BaseException,
661
647
  errorCode,
662
648
  });
663
649
  }
@@ -670,7 +656,7 @@ export const de_RemovePermissionCommand = async (output, context) => {
670
656
  const response = {
671
657
  $metadata: deserializeMetadata(output),
672
658
  };
673
- return Promise.resolve(response);
659
+ return response;
674
660
  };
675
661
  const de_RemovePermissionCommandError = async (output, context) => {
676
662
  const parsedOutput = {
@@ -679,10 +665,9 @@ const de_RemovePermissionCommandError = async (output, context) => {
679
665
  };
680
666
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
681
667
  const parsedBody = parsedOutput.body;
682
- throwDefaultError({
668
+ return throwDefaultError({
683
669
  output,
684
670
  parsedBody: parsedBody.Error,
685
- exceptionCtor: __BaseException,
686
671
  errorCode,
687
672
  });
688
673
  };
@@ -697,7 +682,7 @@ export const de_SendMessageCommand = async (output, context) => {
697
682
  $metadata: deserializeMetadata(output),
698
683
  ...contents,
699
684
  };
700
- return Promise.resolve(response);
685
+ return response;
701
686
  };
702
687
  const de_SendMessageCommandError = async (output, context) => {
703
688
  const parsedOutput = {
@@ -714,10 +699,9 @@ const de_SendMessageCommandError = async (output, context) => {
714
699
  throw await de_InvalidMessageContentsRes(parsedOutput, context);
715
700
  default:
716
701
  const parsedBody = parsedOutput.body;
717
- throwDefaultError({
702
+ return throwDefaultError({
718
703
  output,
719
704
  parsedBody: parsedBody.Error,
720
- exceptionCtor: __BaseException,
721
705
  errorCode,
722
706
  });
723
707
  }
@@ -733,7 +717,7 @@ export const de_SendMessageBatchCommand = async (output, context) => {
733
717
  $metadata: deserializeMetadata(output),
734
718
  ...contents,
735
719
  };
736
- return Promise.resolve(response);
720
+ return response;
737
721
  };
738
722
  const de_SendMessageBatchCommandError = async (output, context) => {
739
723
  const parsedOutput = {
@@ -762,10 +746,9 @@ const de_SendMessageBatchCommandError = async (output, context) => {
762
746
  throw await de_UnsupportedOperationRes(parsedOutput, context);
763
747
  default:
764
748
  const parsedBody = parsedOutput.body;
765
- throwDefaultError({
749
+ return throwDefaultError({
766
750
  output,
767
751
  parsedBody: parsedBody.Error,
768
- exceptionCtor: __BaseException,
769
752
  errorCode,
770
753
  });
771
754
  }
@@ -778,7 +761,7 @@ export const de_SetQueueAttributesCommand = async (output, context) => {
778
761
  const response = {
779
762
  $metadata: deserializeMetadata(output),
780
763
  };
781
- return Promise.resolve(response);
764
+ return response;
782
765
  };
783
766
  const de_SetQueueAttributesCommandError = async (output, context) => {
784
767
  const parsedOutput = {
@@ -792,10 +775,9 @@ const de_SetQueueAttributesCommandError = async (output, context) => {
792
775
  throw await de_InvalidAttributeNameRes(parsedOutput, context);
793
776
  default:
794
777
  const parsedBody = parsedOutput.body;
795
- throwDefaultError({
778
+ return throwDefaultError({
796
779
  output,
797
780
  parsedBody: parsedBody.Error,
798
- exceptionCtor: __BaseException,
799
781
  errorCode,
800
782
  });
801
783
  }
@@ -808,7 +790,7 @@ export const de_TagQueueCommand = async (output, context) => {
808
790
  const response = {
809
791
  $metadata: deserializeMetadata(output),
810
792
  };
811
- return Promise.resolve(response);
793
+ return response;
812
794
  };
813
795
  const de_TagQueueCommandError = async (output, context) => {
814
796
  const parsedOutput = {
@@ -817,10 +799,9 @@ const de_TagQueueCommandError = async (output, context) => {
817
799
  };
818
800
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
819
801
  const parsedBody = parsedOutput.body;
820
- throwDefaultError({
802
+ return throwDefaultError({
821
803
  output,
822
804
  parsedBody: parsedBody.Error,
823
- exceptionCtor: __BaseException,
824
805
  errorCode,
825
806
  });
826
807
  };
@@ -832,7 +813,7 @@ export const de_UntagQueueCommand = async (output, context) => {
832
813
  const response = {
833
814
  $metadata: deserializeMetadata(output),
834
815
  };
835
- return Promise.resolve(response);
816
+ return response;
836
817
  };
837
818
  const de_UntagQueueCommandError = async (output, context) => {
838
819
  const parsedOutput = {
@@ -841,10 +822,9 @@ const de_UntagQueueCommandError = async (output, context) => {
841
822
  };
842
823
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
843
824
  const parsedBody = parsedOutput.body;
844
- throwDefaultError({
825
+ return throwDefaultError({
845
826
  output,
846
827
  parsedBody: parsedBody.Error,
847
- exceptionCtor: __BaseException,
848
828
  errorCode,
849
829
  });
850
830
  };
@@ -2037,6 +2017,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
2037
2017
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2038
2018
  };
2039
2019
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
2020
+ const throwDefaultError = withBaseException(__BaseException);
2040
2021
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
2041
2022
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
2042
2023
  const contents = {