@aligent/aws-wrappers 0.5.4 → 0.5.6

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.
Files changed (58) hide show
  1. package/README.md +57 -2
  2. package/cjs/index.cjs +226 -48
  3. package/cjs/package.json +3 -1
  4. package/cjs/src/api-gateway/api-gateway.d.ts +45 -0
  5. package/cjs/src/api-gateway/api-gateway.d.ts.map +1 -0
  6. package/cjs/src/api-gateway-v2/api-gateway-v2.d.ts +39 -0
  7. package/cjs/src/api-gateway-v2/api-gateway-v2.d.ts.map +1 -0
  8. package/cjs/src/index.d.ts +4 -0
  9. package/cjs/src/index.d.ts.map +1 -1
  10. package/cjs/src/s3/s3.d.ts.map +1 -1
  11. package/cjs/src/scheduler/scheduler.d.ts.map +1 -1
  12. package/cjs/src/sfn/sfn.d.ts.map +1 -1
  13. package/cjs/src/sns/sns.d.ts.map +1 -1
  14. package/cjs/src/sqs/sqs.d.ts +20 -0
  15. package/cjs/src/sqs/sqs.d.ts.map +1 -1
  16. package/cjs/src/ssm/ssm.d.ts.map +1 -1
  17. package/cjs/src/util/batch-operation-error.d.ts +33 -0
  18. package/cjs/src/util/batch-operation-error.d.ts.map +1 -0
  19. package/cjs/src/util/chunk.d.ts +6 -0
  20. package/cjs/src/util/chunk.d.ts.map +1 -0
  21. package/cjs/src/util/pagination.d.ts +12 -0
  22. package/cjs/src/util/pagination.d.ts.map +1 -0
  23. package/docs/index/classes/APIGatewayService.md +143 -0
  24. package/docs/index/classes/APIGatewayV2Service.md +119 -0
  25. package/docs/index/classes/BatchOperationError.md +261 -0
  26. package/docs/index/classes/DynamoDBService.md +12 -12
  27. package/docs/index/classes/S3Service.md +15 -15
  28. package/docs/index/classes/SNSService.md +4 -4
  29. package/docs/index/classes/SQSService.md +20 -7
  30. package/docs/index/classes/SSMService.md +7 -7
  31. package/docs/index/classes/SchedulerService.md +11 -11
  32. package/docs/index/classes/SecretsManagerService.md +8 -8
  33. package/docs/index/classes/StepFunctionsService.md +6 -6
  34. package/docs/index/interfaces/BatchFailedEntry.md +43 -0
  35. package/docs/index/modules.md +7 -0
  36. package/docs/testing/testing/functions/createMockService.md +1 -1
  37. package/esm/index.mjs +225 -50
  38. package/esm/package.json +3 -1
  39. package/esm/src/api-gateway/api-gateway.d.ts +45 -0
  40. package/esm/src/api-gateway/api-gateway.d.ts.map +1 -0
  41. package/esm/src/api-gateway-v2/api-gateway-v2.d.ts +39 -0
  42. package/esm/src/api-gateway-v2/api-gateway-v2.d.ts.map +1 -0
  43. package/esm/src/index.d.ts +4 -0
  44. package/esm/src/index.d.ts.map +1 -1
  45. package/esm/src/s3/s3.d.ts.map +1 -1
  46. package/esm/src/scheduler/scheduler.d.ts.map +1 -1
  47. package/esm/src/sfn/sfn.d.ts.map +1 -1
  48. package/esm/src/sns/sns.d.ts.map +1 -1
  49. package/esm/src/sqs/sqs.d.ts +20 -0
  50. package/esm/src/sqs/sqs.d.ts.map +1 -1
  51. package/esm/src/ssm/ssm.d.ts.map +1 -1
  52. package/esm/src/util/batch-operation-error.d.ts +33 -0
  53. package/esm/src/util/batch-operation-error.d.ts.map +1 -0
  54. package/esm/src/util/chunk.d.ts +6 -0
  55. package/esm/src/util/chunk.d.ts.map +1 -0
  56. package/esm/src/util/pagination.d.ts +12 -0
  57. package/esm/src/util/pagination.d.ts.map +1 -0
  58. package/package.json +3 -1
@@ -55,16 +55,36 @@ export declare class SQSService {
55
55
  * Delete a single message from an SQS queue.
56
56
  */
57
57
  deleteMessage(input: DeleteMessageCommandInput): Promise<DeleteMessageCommandOutput>;
58
+ /**
59
+ * SQS reports rejected entries under `Failed` on an otherwise successful
60
+ * response, so a resolved chunk does not mean every entry was accepted.
61
+ * Only id, code and message are copied out — never the entry itself — so
62
+ * neither the error nor the warning can leak a payload.
63
+ */
64
+ private throwIfAnyFailed;
58
65
  /**
59
66
  * Send a batch of messages to an SQS queue. The SQS API caps
60
67
  * SendMessageBatch at 10 entries per request, so this method auto-chunks
61
68
  * the caller's entries and sends one request per chunk.
69
+ *
70
+ * Every chunk is sent before the outcome is judged. If SQS rejected any
71
+ * entry, a {@link BatchOperationError} is then thrown carrying the
72
+ * per-chunk results and the failed entries. Request-level SDK exceptions
73
+ * (throttling, access denied) propagate unchanged and immediately, so
74
+ * earlier chunks may already have been sent.
62
75
  */
63
76
  sendMessageBatch(input: SendMessageBatchCommandInput): Promise<SendMessageBatchCommandOutput[]>;
64
77
  /**
65
78
  * Delete a batch of messages from an SQS queue. The SQS API caps
66
79
  * DeleteMessageBatch at 10 entries per request, so this method auto-chunks
67
80
  * the caller's entries and sends one request per chunk.
81
+ *
82
+ * Every chunk is sent before the outcome is judged. If SQS failed to
83
+ * delete any message, a {@link BatchOperationError} is then thrown carrying
84
+ * the per-chunk results and the failed entries; those messages will be
85
+ * redelivered. Request-level SDK exceptions (throttling, access denied)
86
+ * propagate unchanged and immediately, so earlier chunks may already have
87
+ * been deleted.
68
88
  */
69
89
  deleteMessageBatch(input: DeleteMessageBatchCommandInput): Promise<DeleteMessageBatchCommandOutput[]>;
70
90
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sqs.d.ts","sourceRoot":"","sources":["../../../../src/sqs/sqs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAEH,8BAA8B,EAC9B,+BAA+B,EAG/B,yBAAyB,EACzB,0BAA0B,EAC1B,OAAO,EAEP,0BAA0B,EAE1B,4BAA4B,EAC5B,6BAA6B,EAG7B,uBAAuB,EACvB,wBAAwB,EACxB,SAAS,EACZ,MAAM,qBAAqB,CAAC;AAmB7B;;;;;;;GAOG;AACH,qBAAa,UAAU;IACnB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IAEnC;;;;;;;;;OASG;gBACS,IAAI,CAAC,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MAAM,GAAG,SAAS,CAAC;IAQ7D;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,aAAa,CAAC,CAAC,SAAS,MAAM,EAChC,OAAO,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,GAC3B,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAsBzC;;;;;;OAMG;IACG,YAAY,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAOvF;;;;;OAKG;IACG,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKlD;;;;;;;;;;OAUG;IACG,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;CAWhG"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * One entry a batch operation rejected. Deliberately limited to identifier,
3
+ * code and message so the error never carries message bodies, attributes or
4
+ * any other payload the caller sent.
5
+ */
6
+ export interface BatchFailedEntry {
7
+ id: string | undefined;
8
+ code: string | undefined;
9
+ message: string | undefined;
10
+ }
11
+ /**
12
+ * Thrown by the batch methods once every chunk has been sent and at least one
13
+ * entry was rejected.
14
+ *
15
+ * `results` holds the raw SDK output of every chunk, so the outputs of the
16
+ * entries that succeeded (message ids, sequence numbers) stay readable.
17
+ * `failed` is the normalised list of rejected entries across all chunks.
18
+ *
19
+ * Match on `name` rather than `instanceof` if both the CJS and ESM builds of
20
+ * this package may be loaded in one process.
21
+ */
22
+ export declare class BatchOperationError<TResult = unknown> extends Error {
23
+ readonly results: TResult[];
24
+ readonly failed: BatchFailedEntry[];
25
+ readonly name = "BatchOperationError";
26
+ constructor(results: TResult[], failed: BatchFailedEntry[]);
27
+ }
28
+ /**
29
+ * Distinct error codes in first-seen order, for the error message and the
30
+ * warning log line.
31
+ */
32
+ export declare function distinctCodes(failed: readonly BatchFailedEntry[]): string[];
33
+ //# sourceMappingURL=batch-operation-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch-operation-error.d.ts","sourceRoot":"","sources":["../../../../src/util/batch-operation-error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;IACvB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED;;;;;;;;;;GAUG;AACH,qBAAa,mBAAmB,CAAC,OAAO,GAAG,OAAO,CAAE,SAAQ,KAAK;IAIzD,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE;IAC3B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,EAAE;IAJvC,SAAkB,IAAI,yBAAyB;gBAGlC,OAAO,EAAE,OAAO,EAAE,EAClB,MAAM,EAAE,gBAAgB,EAAE;CAM1C;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,gBAAgB,EAAE,GAAG,MAAM,EAAE,CAG3E"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Split a list into consecutive chunks of at most `size` items, mirroring the
3
+ * per-request caps the AWS APIs enforce on batch operations.
4
+ */
5
+ export declare function chunk<T>(items: readonly T[], size: number): T[][];
6
+ //# sourceMappingURL=chunk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk.d.ts","sourceRoot":"","sources":["../../../../src/util/chunk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,EAAE,EAAE,CAMjE"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Flatten the items of every page of an SDK paginator (`paginateXxx`).
3
+ * `getItems` picks the data-bearing field, which differs per operation.
4
+ */
5
+ export declare function collectItems<TPage, TItem>(pages: AsyncIterable<TPage>, getItems: (page: TPage) => TItem[] | undefined): Promise<TItem[]>;
6
+ /**
7
+ * Flatten the items of every page of an operation the SDK ships no paginator
8
+ * for, following its continuation token until the response stops returning one.
9
+ * `fetchPage` receives `undefined` on the first call.
10
+ */
11
+ export declare function collectPages<TPage, TItem>(fetchPage: (token: string | undefined) => Promise<TPage>, getItems: (page: TPage) => TItem[] | undefined, getNextToken: (page: TPage) => string | undefined): Promise<TItem[]>;
12
+ //# sourceMappingURL=pagination.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../../src/util/pagination.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAsB,YAAY,CAAC,KAAK,EAAE,KAAK,EAC3C,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,EAC3B,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,KAAK,EAAE,GAAG,SAAS,GAC/C,OAAO,CAAC,KAAK,EAAE,CAAC,CAMlB;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,KAAK,EAAE,KAAK,EAC3C,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,KAAK,CAAC,EACxD,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,KAAK,EAAE,GAAG,SAAS,EAC9C,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,MAAM,GAAG,SAAS,GAClD,OAAO,CAAC,KAAK,EAAE,CAAC,CASlB"}
@@ -0,0 +1,143 @@
1
+ [**@aligent/aws-wrappers**](../../modules.md)
2
+
3
+ ***
4
+
5
+ [@aligent/aws-wrappers](../../modules.md) / [index](../modules.md) / APIGatewayService
6
+
7
+ # Class: APIGatewayService
8
+
9
+ Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:30](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/api-gateway/api-gateway.ts#L30)
10
+
11
+ Read-only wrapper around the API Gateway (REST API, v1) control-plane client
12
+ providing structured Powertools logging and X-Ray tracing by default.
13
+
14
+ `getApiKeys` and `getApiKey` always request key values (`includeValues` /
15
+ `includeValue` is `true`, with no opt-out) — callers needing metadata only
16
+ should use `APIGatewayClient` directly. Key values appear only in method
17
+ output; the wrapper never logs output, and no input carries secrets.
18
+
19
+ ## Constructors
20
+
21
+ <a id="constructor"></a>
22
+
23
+ ### Constructor
24
+
25
+ > **new APIGatewayService**(`opts?`): `APIGatewayService`
26
+
27
+ Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:40](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/api-gateway/api-gateway.ts#L40)
28
+
29
+ #### Parameters
30
+
31
+ ##### opts?
32
+
33
+ ###### client?
34
+
35
+ `APIGatewayClient`
36
+
37
+ Optional pre-configured `APIGatewayClient`. When
38
+ supplied, the wrapper does not apply X-Ray instrumentation.
39
+
40
+ ###### logger?
41
+
42
+ `LoggerInterface`
43
+
44
+ Optional Powertools logger. Defaults to `new Logger()`,
45
+ which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
46
+
47
+ #### Returns
48
+
49
+ `APIGatewayService`
50
+
51
+ ## Methods
52
+
53
+ <a id="getapikey"></a>
54
+
55
+ ### getApiKey()
56
+
57
+ > **getApiKey**(`input`): `Promise`\<`GetApiKeyCommandOutput`\>
58
+
59
+ Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:71](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/api-gateway/api-gateway.ts#L71)
60
+
61
+ Fetch a single API key, including its secret value.
62
+
63
+ #### Parameters
64
+
65
+ ##### input
66
+
67
+ `Omit`\<`GetApiKeyCommandInput`, `"includeValue"`\>
68
+
69
+ #### Returns
70
+
71
+ `Promise`\<`GetApiKeyCommandOutput`\>
72
+
73
+ #### Throws
74
+
75
+ NotFoundException when the key does not exist.
76
+
77
+ ***
78
+
79
+ <a id="getapikeys"></a>
80
+
81
+ ### getApiKeys()
82
+
83
+ > **getApiKeys**(`input?`): `Promise`\<`ApiKey`[]\>
84
+
85
+ Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:59](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/api-gateway/api-gateway.ts#L59)
86
+
87
+ List API keys, including their secret values. Auto-paginated.
88
+
89
+ #### Parameters
90
+
91
+ ##### input?
92
+
93
+ `Omit`\<`GetApiKeysCommandInput`, `"includeValues"`\> = `{}`
94
+
95
+ #### Returns
96
+
97
+ `Promise`\<`ApiKey`[]\>
98
+
99
+ ***
100
+
101
+ <a id="getresources"></a>
102
+
103
+ ### getResources()
104
+
105
+ > **getResources**(`input`): `Promise`\<`Resource`[]\>
106
+
107
+ Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:83](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/api-gateway/api-gateway.ts#L83)
108
+
109
+ List every resource (path) of a REST API, which is how REST APIs expose
110
+ their routes. Pass `embed: ['methods']` to include each resource's
111
+ methods. Auto-paginated.
112
+
113
+ #### Parameters
114
+
115
+ ##### input
116
+
117
+ `GetResourcesCommandInput`
118
+
119
+ #### Returns
120
+
121
+ `Promise`\<`Resource`[]\>
122
+
123
+ ***
124
+
125
+ <a id="getrestapis"></a>
126
+
127
+ ### getRestApis()
128
+
129
+ > **getRestApis**(`input?`): `Promise`\<`RestApi`[]\>
130
+
131
+ Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:48](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/api-gateway/api-gateway.ts#L48)
132
+
133
+ List every REST API in the account and region. Auto-paginated.
134
+
135
+ #### Parameters
136
+
137
+ ##### input?
138
+
139
+ `GetRestApisCommandInput` = `{}`
140
+
141
+ #### Returns
142
+
143
+ `Promise`\<`RestApi`[]\>
@@ -0,0 +1,119 @@
1
+ [**@aligent/aws-wrappers**](../../modules.md)
2
+
3
+ ***
4
+
5
+ [@aligent/aws-wrappers](../../modules.md) / [index](../modules.md) / APIGatewayV2Service
6
+
7
+ # Class: APIGatewayV2Service
8
+
9
+ Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:26](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts#L26)
10
+
11
+ Read-only wrapper around the API Gateway v2 (HTTP and WebSocket APIs)
12
+ control-plane client providing structured Powertools logging and X-Ray
13
+ tracing by default.
14
+
15
+ The v2 SDK ships no paginators for `GetApis` or `GetRoutes`, so list methods
16
+ follow `NextToken` manually.
17
+
18
+ ## Constructors
19
+
20
+ <a id="constructor"></a>
21
+
22
+ ### Constructor
23
+
24
+ > **new APIGatewayV2Service**(`opts?`): `APIGatewayV2Service`
25
+
26
+ Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:36](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts#L36)
27
+
28
+ #### Parameters
29
+
30
+ ##### opts?
31
+
32
+ ###### client?
33
+
34
+ `ApiGatewayV2Client`
35
+
36
+ Optional pre-configured `ApiGatewayV2Client`. When
37
+ supplied, the wrapper does not apply X-Ray instrumentation.
38
+
39
+ ###### logger?
40
+
41
+ `LoggerInterface`
42
+
43
+ Optional Powertools logger. Defaults to `new Logger()`,
44
+ which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
45
+
46
+ #### Returns
47
+
48
+ `APIGatewayV2Service`
49
+
50
+ ## Methods
51
+
52
+ <a id="getapis"></a>
53
+
54
+ ### getApis()
55
+
56
+ > **getApis**(`input?`): `Promise`\<`Api`[]\>
57
+
58
+ Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:45](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts#L45)
59
+
60
+ List every HTTP and WebSocket API in the account and region.
61
+ Auto-paginated.
62
+
63
+ #### Parameters
64
+
65
+ ##### input?
66
+
67
+ `Omit`\<`GetApisCommandInput`, `"NextToken"`\> = `{}`
68
+
69
+ #### Returns
70
+
71
+ `Promise`\<`Api`[]\>
72
+
73
+ ***
74
+
75
+ <a id="getroute"></a>
76
+
77
+ ### getRoute()
78
+
79
+ > **getRoute**(`input`): `Promise`\<`GetRouteCommandOutput`\>
80
+
81
+ Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:58](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts#L58)
82
+
83
+ Fetch a single route of an HTTP or WebSocket API.
84
+
85
+ #### Parameters
86
+
87
+ ##### input
88
+
89
+ `GetRouteCommandInput`
90
+
91
+ #### Returns
92
+
93
+ `Promise`\<`GetRouteCommandOutput`\>
94
+
95
+ #### Throws
96
+
97
+ NotFoundException when the route does not exist.
98
+
99
+ ***
100
+
101
+ <a id="getroutes"></a>
102
+
103
+ ### getRoutes()
104
+
105
+ > **getRoutes**(`input`): `Promise`\<`Route`[]\>
106
+
107
+ Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:66](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts#L66)
108
+
109
+ List every route of an HTTP or WebSocket API. Auto-paginated.
110
+
111
+ #### Parameters
112
+
113
+ ##### input
114
+
115
+ `Omit`\<`GetRoutesCommandInput`, `"NextToken"`\>
116
+
117
+ #### Returns
118
+
119
+ `Promise`\<`Route`[]\>
@@ -0,0 +1,261 @@
1
+ [**@aligent/aws-wrappers**](../../modules.md)
2
+
3
+ ***
4
+
5
+ [@aligent/aws-wrappers](../../modules.md) / [index](../modules.md) / BatchOperationError
6
+
7
+ # Class: BatchOperationError\<TResult\>
8
+
9
+ Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:23](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/util/batch-operation-error.ts#L23)
10
+
11
+ Thrown by the batch methods once every chunk has been sent and at least one
12
+ entry was rejected.
13
+
14
+ `results` holds the raw SDK output of every chunk, so the outputs of the
15
+ entries that succeeded (message ids, sequence numbers) stay readable.
16
+ `failed` is the normalised list of rejected entries across all chunks.
17
+
18
+ Match on `name` rather than `instanceof` if both the CJS and ESM builds of
19
+ this package may be loaded in one process.
20
+
21
+ ## Extends
22
+
23
+ - `Error`
24
+
25
+ ## Type Parameters
26
+
27
+ ### TResult
28
+
29
+ `TResult` = `unknown`
30
+
31
+ ## Constructors
32
+
33
+ <a id="constructor"></a>
34
+
35
+ ### Constructor
36
+
37
+ > **new BatchOperationError**\<`TResult`\>(`results`, `failed`): `BatchOperationError`\<`TResult`\>
38
+
39
+ Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:26](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/util/batch-operation-error.ts#L26)
40
+
41
+ #### Parameters
42
+
43
+ ##### results
44
+
45
+ `TResult`[]
46
+
47
+ ##### failed
48
+
49
+ [`BatchFailedEntry`](../interfaces/BatchFailedEntry.md)[]
50
+
51
+ #### Returns
52
+
53
+ `BatchOperationError`\<`TResult`\>
54
+
55
+ #### Overrides
56
+
57
+ `Error.constructor`
58
+
59
+ ## Properties
60
+
61
+ <a id="cause"></a>
62
+
63
+ ### cause?
64
+
65
+ > `optional` **cause?**: `unknown`
66
+
67
+ Defined in: node\_modules/typescript/lib/lib.es2022.error.d.ts:24
68
+
69
+ #### Inherited from
70
+
71
+ `Error.cause`
72
+
73
+ ***
74
+
75
+ <a id="failed"></a>
76
+
77
+ ### failed
78
+
79
+ > `readonly` **failed**: [`BatchFailedEntry`](../interfaces/BatchFailedEntry.md)[]
80
+
81
+ Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:28](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/util/batch-operation-error.ts#L28)
82
+
83
+ ***
84
+
85
+ <a id="message"></a>
86
+
87
+ ### message
88
+
89
+ > **message**: `string`
90
+
91
+ Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1075
92
+
93
+ #### Inherited from
94
+
95
+ `Error.message`
96
+
97
+ ***
98
+
99
+ <a id="name"></a>
100
+
101
+ ### name
102
+
103
+ > `readonly` **name**: `"BatchOperationError"` = `'BatchOperationError'`
104
+
105
+ Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:24](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/util/batch-operation-error.ts#L24)
106
+
107
+ #### Overrides
108
+
109
+ `Error.name`
110
+
111
+ ***
112
+
113
+ <a id="results"></a>
114
+
115
+ ### results
116
+
117
+ > `readonly` **results**: `TResult`[]
118
+
119
+ Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:27](https://github.com/aligent/microservice-development-utilities/blob/36323d6a14efbe8673c2a1e7e5c4b742c6b4220a/packages/aws-wrappers/src/util/batch-operation-error.ts#L27)
120
+
121
+ ***
122
+
123
+ <a id="stack"></a>
124
+
125
+ ### stack?
126
+
127
+ > `optional` **stack?**: `string`
128
+
129
+ Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076
130
+
131
+ #### Inherited from
132
+
133
+ `Error.stack`
134
+
135
+ ***
136
+
137
+ <a id="stacktracelimit"></a>
138
+
139
+ ### stackTraceLimit
140
+
141
+ > `static` **stackTraceLimit**: `number`
142
+
143
+ Defined in: node\_modules/@types/node/globals.d.ts:68
144
+
145
+ The `Error.stackTraceLimit` property specifies the number of stack frames
146
+ collected by a stack trace (whether generated by `new Error().stack` or
147
+ `Error.captureStackTrace(obj)`).
148
+
149
+ The default value is `10` but may be set to any valid JavaScript number. Changes
150
+ will affect any stack trace captured _after_ the value has been changed.
151
+
152
+ If set to a non-number value, or set to a negative number, stack traces will
153
+ not capture any frames.
154
+
155
+ #### Inherited from
156
+
157
+ `Error.stackTraceLimit`
158
+
159
+ ## Methods
160
+
161
+ <a id="capturestacktrace"></a>
162
+
163
+ ### captureStackTrace()
164
+
165
+ > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
166
+
167
+ Defined in: node\_modules/@types/node/globals.d.ts:52
168
+
169
+ Creates a `.stack` property on `targetObject`, which when accessed returns
170
+ a string representing the location in the code at which
171
+ `Error.captureStackTrace()` was called.
172
+
173
+ ```js
174
+ const myObject = {};
175
+ Error.captureStackTrace(myObject);
176
+ myObject.stack; // Similar to `new Error().stack`
177
+ ```
178
+
179
+ The first line of the trace will be prefixed with
180
+ `${myObject.name}: ${myObject.message}`.
181
+
182
+ The optional `constructorOpt` argument accepts a function. If given, all frames
183
+ above `constructorOpt`, including `constructorOpt`, will be omitted from the
184
+ generated stack trace.
185
+
186
+ The `constructorOpt` argument is useful for hiding implementation
187
+ details of error generation from the user. For instance:
188
+
189
+ ```js
190
+ function a() {
191
+ b();
192
+ }
193
+
194
+ function b() {
195
+ c();
196
+ }
197
+
198
+ function c() {
199
+ // Create an error without stack trace to avoid calculating the stack trace twice.
200
+ const { stackTraceLimit } = Error;
201
+ Error.stackTraceLimit = 0;
202
+ const error = new Error();
203
+ Error.stackTraceLimit = stackTraceLimit;
204
+
205
+ // Capture the stack trace above function b
206
+ Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
207
+ throw error;
208
+ }
209
+
210
+ a();
211
+ ```
212
+
213
+ #### Parameters
214
+
215
+ ##### targetObject
216
+
217
+ `object`
218
+
219
+ ##### constructorOpt?
220
+
221
+ `Function`
222
+
223
+ #### Returns
224
+
225
+ `void`
226
+
227
+ #### Inherited from
228
+
229
+ `Error.captureStackTrace`
230
+
231
+ ***
232
+
233
+ <a id="preparestacktrace"></a>
234
+
235
+ ### prepareStackTrace()
236
+
237
+ > `static` **prepareStackTrace**(`err`, `stackTraces`): `any`
238
+
239
+ Defined in: node\_modules/@types/node/globals.d.ts:56
240
+
241
+ #### Parameters
242
+
243
+ ##### err
244
+
245
+ `Error`
246
+
247
+ ##### stackTraces
248
+
249
+ `CallSite`[]
250
+
251
+ #### Returns
252
+
253
+ `any`
254
+
255
+ #### See
256
+
257
+ https://v8.dev/docs/stack-trace-api#customizing-stack-traces
258
+
259
+ #### Inherited from
260
+
261
+ `Error.prepareStackTrace`