@aligent/aws-wrappers 0.5.8 → 0.5.9
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.
- package/README.md +89 -3
- package/cjs/index.cjs +284 -11
- package/cjs/package.json +3 -1
- package/cjs/src/eventbridge/eventbridge.d.ts +58 -0
- package/cjs/src/eventbridge/eventbridge.d.ts.map +1 -0
- package/cjs/src/index.d.ts +3 -0
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/lambda/lambda.d.ts +54 -0
- package/cjs/src/lambda/lambda.d.ts.map +1 -0
- package/cjs/src/scheduler/scheduler.d.ts +3 -2
- package/cjs/src/scheduler/scheduler.d.ts.map +1 -1
- package/cjs/src/ssm/ssm.d.ts +18 -3
- package/cjs/src/ssm/ssm.d.ts.map +1 -1
- package/cjs/src/util/batch-operation-error.d.ts +13 -7
- package/cjs/src/util/batch-operation-error.d.ts.map +1 -1
- package/cjs/src/util/lambda-function-error.d.ts +36 -0
- package/cjs/src/util/lambda-function-error.d.ts.map +1 -0
- package/docs/index/classes/APIGatewayService.md +6 -6
- package/docs/index/classes/APIGatewayV2Service.md +5 -5
- package/docs/index/classes/BatchOperationError.md +7 -6
- package/docs/index/classes/DynamoDBService.md +12 -12
- package/docs/index/classes/EventBridgeService.md +99 -0
- package/docs/index/classes/LambdaFunctionError.md +283 -0
- package/docs/index/classes/LambdaService.md +95 -0
- package/docs/index/classes/S3Service.md +15 -15
- package/docs/index/classes/SNSService.md +4 -4
- package/docs/index/classes/SQSService.md +7 -7
- package/docs/index/classes/SSMService.md +33 -10
- package/docs/index/classes/SchedulerService.md +14 -13
- package/docs/index/classes/SecretsManagerService.md +8 -8
- package/docs/index/classes/StepFunctionsService.md +6 -6
- package/docs/index/interfaces/BatchFailedEntry.md +6 -5
- package/docs/index/interfaces/EmptyBucketPageResult.md +2 -2
- package/docs/index/modules.md +3 -0
- package/docs/testing/testing/functions/createMockService.md +1 -1
- package/esm/index.mjs +282 -12
- package/esm/package.json +3 -1
- package/esm/src/eventbridge/eventbridge.d.ts +58 -0
- package/esm/src/eventbridge/eventbridge.d.ts.map +1 -0
- package/esm/src/index.d.ts +3 -0
- package/esm/src/index.d.ts.map +1 -1
- package/esm/src/lambda/lambda.d.ts +54 -0
- package/esm/src/lambda/lambda.d.ts.map +1 -0
- package/esm/src/scheduler/scheduler.d.ts +3 -2
- package/esm/src/scheduler/scheduler.d.ts.map +1 -1
- package/esm/src/ssm/ssm.d.ts +18 -3
- package/esm/src/ssm/ssm.d.ts.map +1 -1
- package/esm/src/util/batch-operation-error.d.ts +13 -7
- package/esm/src/util/batch-operation-error.d.ts.map +1 -1
- package/esm/src/util/lambda-function-error.d.ts +36 -0
- package/esm/src/util/lambda-function-error.d.ts.map +1 -0
- package/package.json +3 -1
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
[**@aligent/aws-wrappers**](../../modules.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@aligent/aws-wrappers](../../modules.md) / [index](../modules.md) / LambdaFunctionError
|
|
6
|
+
|
|
7
|
+
# Class: LambdaFunctionError
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:21](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/util/lambda-function-error.ts#L21)
|
|
10
|
+
|
|
11
|
+
Thrown by `LambdaService.invoke` when a synchronous invocation reached the
|
|
12
|
+
function but the function itself failed. Lambda reports that as an HTTP 200
|
|
13
|
+
carrying a function error marker, so the SDK does not throw.
|
|
14
|
+
|
|
15
|
+
`functionError` is the SDK's marker (`Handled` or `Unhandled`).
|
|
16
|
+
`errorType` and `errorMessage` are parsed from the response payload when it
|
|
17
|
+
has the usual `{ errorType, errorMessage }` JSON shape, otherwise undefined.
|
|
18
|
+
|
|
19
|
+
Deliberately excludes the raw SDK output and the stack trace: either can
|
|
20
|
+
contain the caller's payload or PII.
|
|
21
|
+
|
|
22
|
+
Match on `name` rather than `instanceof` if both the CJS and ESM builds of
|
|
23
|
+
this package may be loaded in one process.
|
|
24
|
+
|
|
25
|
+
## Extends
|
|
26
|
+
|
|
27
|
+
- `Error`
|
|
28
|
+
|
|
29
|
+
## Constructors
|
|
30
|
+
|
|
31
|
+
<a id="constructor"></a>
|
|
32
|
+
|
|
33
|
+
### Constructor
|
|
34
|
+
|
|
35
|
+
> **new LambdaFunctionError**(`functionName`, `functionError`, `payload`): `LambdaFunctionError`
|
|
36
|
+
|
|
37
|
+
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:26](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/util/lambda-function-error.ts#L26)
|
|
38
|
+
|
|
39
|
+
#### Parameters
|
|
40
|
+
|
|
41
|
+
##### functionName
|
|
42
|
+
|
|
43
|
+
`string` \| `undefined`
|
|
44
|
+
|
|
45
|
+
##### functionError
|
|
46
|
+
|
|
47
|
+
`string`
|
|
48
|
+
|
|
49
|
+
##### payload
|
|
50
|
+
|
|
51
|
+
`Pick`\<`LambdaFunctionError`, `"errorType"` \| `"errorMessage"`\>
|
|
52
|
+
|
|
53
|
+
#### Returns
|
|
54
|
+
|
|
55
|
+
`LambdaFunctionError`
|
|
56
|
+
|
|
57
|
+
#### Overrides
|
|
58
|
+
|
|
59
|
+
`Error.constructor`
|
|
60
|
+
|
|
61
|
+
## Properties
|
|
62
|
+
|
|
63
|
+
<a id="cause"></a>
|
|
64
|
+
|
|
65
|
+
### cause?
|
|
66
|
+
|
|
67
|
+
> `optional` **cause?**: `unknown`
|
|
68
|
+
|
|
69
|
+
Defined in: node\_modules/typescript/lib/lib.es2022.error.d.ts:24
|
|
70
|
+
|
|
71
|
+
#### Inherited from
|
|
72
|
+
|
|
73
|
+
`Error.cause`
|
|
74
|
+
|
|
75
|
+
***
|
|
76
|
+
|
|
77
|
+
<a id="errormessage"></a>
|
|
78
|
+
|
|
79
|
+
### errorMessage
|
|
80
|
+
|
|
81
|
+
> `readonly` **errorMessage**: `string` \| `undefined`
|
|
82
|
+
|
|
83
|
+
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:24](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/util/lambda-function-error.ts#L24)
|
|
84
|
+
|
|
85
|
+
***
|
|
86
|
+
|
|
87
|
+
<a id="errortype"></a>
|
|
88
|
+
|
|
89
|
+
### errorType
|
|
90
|
+
|
|
91
|
+
> `readonly` **errorType**: `string` \| `undefined`
|
|
92
|
+
|
|
93
|
+
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:23](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/util/lambda-function-error.ts#L23)
|
|
94
|
+
|
|
95
|
+
***
|
|
96
|
+
|
|
97
|
+
<a id="functionerror"></a>
|
|
98
|
+
|
|
99
|
+
### functionError
|
|
100
|
+
|
|
101
|
+
> `readonly` **functionError**: `string`
|
|
102
|
+
|
|
103
|
+
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:28](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/util/lambda-function-error.ts#L28)
|
|
104
|
+
|
|
105
|
+
***
|
|
106
|
+
|
|
107
|
+
<a id="functionname"></a>
|
|
108
|
+
|
|
109
|
+
### functionName
|
|
110
|
+
|
|
111
|
+
> `readonly` **functionName**: `string` \| `undefined`
|
|
112
|
+
|
|
113
|
+
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:27](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/util/lambda-function-error.ts#L27)
|
|
114
|
+
|
|
115
|
+
***
|
|
116
|
+
|
|
117
|
+
<a id="message"></a>
|
|
118
|
+
|
|
119
|
+
### message
|
|
120
|
+
|
|
121
|
+
> **message**: `string`
|
|
122
|
+
|
|
123
|
+
Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1075
|
|
124
|
+
|
|
125
|
+
#### Inherited from
|
|
126
|
+
|
|
127
|
+
`Error.message`
|
|
128
|
+
|
|
129
|
+
***
|
|
130
|
+
|
|
131
|
+
<a id="name"></a>
|
|
132
|
+
|
|
133
|
+
### name
|
|
134
|
+
|
|
135
|
+
> `readonly` **name**: `"LambdaFunctionError"` = `'LambdaFunctionError'`
|
|
136
|
+
|
|
137
|
+
Defined in: [packages/aws-wrappers/src/util/lambda-function-error.ts:22](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/util/lambda-function-error.ts#L22)
|
|
138
|
+
|
|
139
|
+
#### Overrides
|
|
140
|
+
|
|
141
|
+
`Error.name`
|
|
142
|
+
|
|
143
|
+
***
|
|
144
|
+
|
|
145
|
+
<a id="stack"></a>
|
|
146
|
+
|
|
147
|
+
### stack?
|
|
148
|
+
|
|
149
|
+
> `optional` **stack?**: `string`
|
|
150
|
+
|
|
151
|
+
Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076
|
|
152
|
+
|
|
153
|
+
#### Inherited from
|
|
154
|
+
|
|
155
|
+
`Error.stack`
|
|
156
|
+
|
|
157
|
+
***
|
|
158
|
+
|
|
159
|
+
<a id="stacktracelimit"></a>
|
|
160
|
+
|
|
161
|
+
### stackTraceLimit
|
|
162
|
+
|
|
163
|
+
> `static` **stackTraceLimit**: `number`
|
|
164
|
+
|
|
165
|
+
Defined in: node\_modules/@types/node/globals.d.ts:68
|
|
166
|
+
|
|
167
|
+
The `Error.stackTraceLimit` property specifies the number of stack frames
|
|
168
|
+
collected by a stack trace (whether generated by `new Error().stack` or
|
|
169
|
+
`Error.captureStackTrace(obj)`).
|
|
170
|
+
|
|
171
|
+
The default value is `10` but may be set to any valid JavaScript number. Changes
|
|
172
|
+
will affect any stack trace captured _after_ the value has been changed.
|
|
173
|
+
|
|
174
|
+
If set to a non-number value, or set to a negative number, stack traces will
|
|
175
|
+
not capture any frames.
|
|
176
|
+
|
|
177
|
+
#### Inherited from
|
|
178
|
+
|
|
179
|
+
`Error.stackTraceLimit`
|
|
180
|
+
|
|
181
|
+
## Methods
|
|
182
|
+
|
|
183
|
+
<a id="capturestacktrace"></a>
|
|
184
|
+
|
|
185
|
+
### captureStackTrace()
|
|
186
|
+
|
|
187
|
+
> `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
|
|
188
|
+
|
|
189
|
+
Defined in: node\_modules/@types/node/globals.d.ts:52
|
|
190
|
+
|
|
191
|
+
Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
192
|
+
a string representing the location in the code at which
|
|
193
|
+
`Error.captureStackTrace()` was called.
|
|
194
|
+
|
|
195
|
+
```js
|
|
196
|
+
const myObject = {};
|
|
197
|
+
Error.captureStackTrace(myObject);
|
|
198
|
+
myObject.stack; // Similar to `new Error().stack`
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
The first line of the trace will be prefixed with
|
|
202
|
+
`${myObject.name}: ${myObject.message}`.
|
|
203
|
+
|
|
204
|
+
The optional `constructorOpt` argument accepts a function. If given, all frames
|
|
205
|
+
above `constructorOpt`, including `constructorOpt`, will be omitted from the
|
|
206
|
+
generated stack trace.
|
|
207
|
+
|
|
208
|
+
The `constructorOpt` argument is useful for hiding implementation
|
|
209
|
+
details of error generation from the user. For instance:
|
|
210
|
+
|
|
211
|
+
```js
|
|
212
|
+
function a() {
|
|
213
|
+
b();
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function b() {
|
|
217
|
+
c();
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function c() {
|
|
221
|
+
// Create an error without stack trace to avoid calculating the stack trace twice.
|
|
222
|
+
const { stackTraceLimit } = Error;
|
|
223
|
+
Error.stackTraceLimit = 0;
|
|
224
|
+
const error = new Error();
|
|
225
|
+
Error.stackTraceLimit = stackTraceLimit;
|
|
226
|
+
|
|
227
|
+
// Capture the stack trace above function b
|
|
228
|
+
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
|
|
229
|
+
throw error;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
a();
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
#### Parameters
|
|
236
|
+
|
|
237
|
+
##### targetObject
|
|
238
|
+
|
|
239
|
+
`object`
|
|
240
|
+
|
|
241
|
+
##### constructorOpt?
|
|
242
|
+
|
|
243
|
+
`Function`
|
|
244
|
+
|
|
245
|
+
#### Returns
|
|
246
|
+
|
|
247
|
+
`void`
|
|
248
|
+
|
|
249
|
+
#### Inherited from
|
|
250
|
+
|
|
251
|
+
`Error.captureStackTrace`
|
|
252
|
+
|
|
253
|
+
***
|
|
254
|
+
|
|
255
|
+
<a id="preparestacktrace"></a>
|
|
256
|
+
|
|
257
|
+
### prepareStackTrace()
|
|
258
|
+
|
|
259
|
+
> `static` **prepareStackTrace**(`err`, `stackTraces`): `any`
|
|
260
|
+
|
|
261
|
+
Defined in: node\_modules/@types/node/globals.d.ts:56
|
|
262
|
+
|
|
263
|
+
#### Parameters
|
|
264
|
+
|
|
265
|
+
##### err
|
|
266
|
+
|
|
267
|
+
`Error`
|
|
268
|
+
|
|
269
|
+
##### stackTraces
|
|
270
|
+
|
|
271
|
+
`CallSite`[]
|
|
272
|
+
|
|
273
|
+
#### Returns
|
|
274
|
+
|
|
275
|
+
`any`
|
|
276
|
+
|
|
277
|
+
#### See
|
|
278
|
+
|
|
279
|
+
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
280
|
+
|
|
281
|
+
#### Inherited from
|
|
282
|
+
|
|
283
|
+
`Error.prepareStackTrace`
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
[**@aligent/aws-wrappers**](../../modules.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@aligent/aws-wrappers](../../modules.md) / [index](../modules.md) / LambdaService
|
|
6
|
+
|
|
7
|
+
# Class: LambdaService
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/lambda/lambda.ts:36](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/lambda/lambda.ts#L36)
|
|
10
|
+
|
|
11
|
+
Wrapper around the AWS Lambda client providing structured Powertools logging
|
|
12
|
+
and X-Ray tracing by default.
|
|
13
|
+
|
|
14
|
+
Where a method's input carries payloads, secret material or PII, the INFO
|
|
15
|
+
log line omits them; the verbose levels (`POWERTOOLS_LOG_LEVEL=DEBUG` or
|
|
16
|
+
`TRACE`) log full SDK inputs.
|
|
17
|
+
|
|
18
|
+
Covers `invoke` only.
|
|
19
|
+
|
|
20
|
+
## Constructors
|
|
21
|
+
|
|
22
|
+
<a id="constructor"></a>
|
|
23
|
+
|
|
24
|
+
### Constructor
|
|
25
|
+
|
|
26
|
+
> **new LambdaService**(`opts?`): `LambdaService`
|
|
27
|
+
|
|
28
|
+
Defined in: [packages/aws-wrappers/src/lambda/lambda.ts:46](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/lambda/lambda.ts#L46)
|
|
29
|
+
|
|
30
|
+
#### Parameters
|
|
31
|
+
|
|
32
|
+
##### opts?
|
|
33
|
+
|
|
34
|
+
###### client?
|
|
35
|
+
|
|
36
|
+
`LambdaClient`
|
|
37
|
+
|
|
38
|
+
Optional pre-configured `LambdaClient`. When
|
|
39
|
+
supplied, the wrapper does not apply X-Ray instrumentation.
|
|
40
|
+
|
|
41
|
+
###### logger?
|
|
42
|
+
|
|
43
|
+
`LoggerInterface`
|
|
44
|
+
|
|
45
|
+
Optional Powertools logger. Defaults to `new Logger()`,
|
|
46
|
+
which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
47
|
+
|
|
48
|
+
#### Returns
|
|
49
|
+
|
|
50
|
+
`LambdaService`
|
|
51
|
+
|
|
52
|
+
## Methods
|
|
53
|
+
|
|
54
|
+
<a id="invoke"></a>
|
|
55
|
+
|
|
56
|
+
### invoke()
|
|
57
|
+
|
|
58
|
+
> **invoke**(`input`): `Promise`\<`InvokeCommandOutput`\>
|
|
59
|
+
|
|
60
|
+
Defined in: [packages/aws-wrappers/src/lambda/lambda.ts:77](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/lambda/lambda.ts#L77)
|
|
61
|
+
|
|
62
|
+
Invoke a Lambda function. The input is the SDK input unchanged and the
|
|
63
|
+
output is the SDK output unchanged: `Payload` stays a `Uint8Array` you
|
|
64
|
+
decode yourself. Choose synchronous, asynchronous or dry-run invocation
|
|
65
|
+
with `InvocationType`; omitting it means synchronous (`RequestResponse`).
|
|
66
|
+
|
|
67
|
+
Lambda answers HTTP 200 even when the invoked function threw, flagging it
|
|
68
|
+
with `FunctionError` on the response. If that marker is present this
|
|
69
|
+
method warns and throws a [LambdaFunctionError](LambdaFunctionError.md) carrying the
|
|
70
|
+
function name, the marker, and the error type and message parsed from the
|
|
71
|
+
payload when it has the usual JSON shape. The raw output and the stack
|
|
72
|
+
trace are deliberately left off the error.
|
|
73
|
+
|
|
74
|
+
The marker only appears on synchronous responses, so the check is
|
|
75
|
+
unconditional: asynchronous (`Event`) and `DryRun` responses return
|
|
76
|
+
without throwing. Failures of asynchronous invocations are therefore not
|
|
77
|
+
observable here; they belong to dead-letter queues and destinations on
|
|
78
|
+
the invoked function. No status code check is added; service-level
|
|
79
|
+
errors such as throttling are thrown by the SDK and propagate unwrapped.
|
|
80
|
+
|
|
81
|
+
At INFO level the log line includes only the function name, invocation
|
|
82
|
+
type, qualifier, log type and tenant id. `Payload` and `ClientContext` are
|
|
83
|
+
omitted, and responses are never logged.
|
|
84
|
+
|
|
85
|
+
#### Parameters
|
|
86
|
+
|
|
87
|
+
##### input
|
|
88
|
+
|
|
89
|
+
`InvokeCommandInput`
|
|
90
|
+
|
|
91
|
+
InvokeCommandInput including FunctionName.
|
|
92
|
+
|
|
93
|
+
#### Returns
|
|
94
|
+
|
|
95
|
+
`Promise`\<`InvokeCommandOutput`\>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: S3Service
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:86](https://github.com/aligent/microservice-development-utilities/blob/
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:86](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/s3/s3.ts#L86)
|
|
10
10
|
|
|
11
11
|
Wrapper around the AWS S3 client providing structured Powertools logging
|
|
12
12
|
and X-Ray tracing by default.
|
|
@@ -27,7 +27,7 @@ tagging, version IDs) should use `S3Client` directly.
|
|
|
27
27
|
|
|
28
28
|
> **new S3Service**(`opts?`): `S3Service`
|
|
29
29
|
|
|
30
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:96](https://github.com/aligent/microservice-development-utilities/blob/
|
|
30
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:96](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/s3/s3.ts#L96)
|
|
31
31
|
|
|
32
32
|
#### Parameters
|
|
33
33
|
|
|
@@ -59,7 +59,7 @@ which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
|
59
59
|
|
|
60
60
|
> **copyObject**(`input`): `Promise`\<`CopyObjectCommandOutput`\>
|
|
61
61
|
|
|
62
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:191](https://github.com/aligent/microservice-development-utilities/blob/
|
|
62
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:191](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/s3/s3.ts#L191)
|
|
63
63
|
|
|
64
64
|
Copy an object within S3.
|
|
65
65
|
|
|
@@ -81,7 +81,7 @@ Copy an object within S3.
|
|
|
81
81
|
|
|
82
82
|
> **deleteObject**(`input`): `Promise`\<`DeleteObjectCommandOutput`\>
|
|
83
83
|
|
|
84
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:279](https://github.com/aligent/microservice-development-utilities/blob/
|
|
84
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:279](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/s3/s3.ts#L279)
|
|
85
85
|
|
|
86
86
|
Delete a single object from S3.
|
|
87
87
|
|
|
@@ -103,7 +103,7 @@ Delete a single object from S3.
|
|
|
103
103
|
|
|
104
104
|
> **deleteObjects**(`bucket`, `keys`): `Promise`\<`DeleteObjectsCommandOutput`[]\>
|
|
105
105
|
|
|
106
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:297](https://github.com/aligent/microservice-development-utilities/blob/
|
|
106
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:297](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/s3/s3.ts#L297)
|
|
107
107
|
|
|
108
108
|
Delete multiple objects from S3, auto-chunking the request into batches
|
|
109
109
|
of 1000 keys (the S3-enforced DeleteObjects limit). Returns one output
|
|
@@ -137,7 +137,7 @@ immediately, so earlier chunks may already have been deleted.
|
|
|
137
137
|
|
|
138
138
|
> **emptyBucket**(`bucket`): `Promise`\<`string`[]\>
|
|
139
139
|
|
|
140
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:343](https://github.com/aligent/microservice-development-utilities/blob/
|
|
140
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:343](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/s3/s3.ts#L343)
|
|
141
141
|
|
|
142
142
|
Delete every object in an **unversioned** bucket. Streams the listing
|
|
143
143
|
page-by-page and delegates each page's deletion to `deleteObjects`, so no
|
|
@@ -184,7 +184,7 @@ If S3 could not delete one or more keys.
|
|
|
184
184
|
|
|
185
185
|
> **getAllObjects**\<`T`\>(`bucket`, `prefix?`): `Promise`\<`T`[]\>
|
|
186
186
|
|
|
187
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:217](https://github.com/aligent/microservice-development-utilities/blob/
|
|
187
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:217](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/s3/s3.ts#L217)
|
|
188
188
|
|
|
189
189
|
List and JSON-parse every object under a bucket and optional prefix.
|
|
190
190
|
Auto-paginated. Objects without a body are skipped.
|
|
@@ -221,7 +221,7 @@ Expected type of each parsed object.
|
|
|
221
221
|
|
|
222
222
|
> **getJsonObject**\<`T`\>(`input`): `Promise`\<`T` \| `undefined`\>
|
|
223
223
|
|
|
224
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:169](https://github.com/aligent/microservice-development-utilities/blob/
|
|
224
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:169](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/s3/s3.ts#L169)
|
|
225
225
|
|
|
226
226
|
Get an object from S3 and parse it as JSON.
|
|
227
227
|
|
|
@@ -259,7 +259,7 @@ If the body is non-empty and not valid JSON.
|
|
|
259
259
|
|
|
260
260
|
> **getObject**(`input`): `Promise`\<`GetObjectCommandOutput`\>
|
|
261
261
|
|
|
262
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:143](https://github.com/aligent/microservice-development-utilities/blob/
|
|
262
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:143](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/s3/s3.ts#L143)
|
|
263
263
|
|
|
264
264
|
Get an object from S3.
|
|
265
265
|
|
|
@@ -281,7 +281,7 @@ Get an object from S3.
|
|
|
281
281
|
|
|
282
282
|
> **getObjectBody**(`input`): `Promise`\<`string` \| `undefined`\>
|
|
283
283
|
|
|
284
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:155](https://github.com/aligent/microservice-development-utilities/blob/
|
|
284
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:155](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/s3/s3.ts#L155)
|
|
285
285
|
|
|
286
286
|
Get an object from S3 and return its body as a string.
|
|
287
287
|
|
|
@@ -306,7 +306,7 @@ has no body.
|
|
|
306
306
|
|
|
307
307
|
> **getPresignedUrl**(`input`): `Promise`\<`string`\>
|
|
308
308
|
|
|
309
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:255](https://github.com/aligent/microservice-development-utilities/blob/
|
|
309
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:255](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/s3/s3.ts#L255)
|
|
310
310
|
|
|
311
311
|
Generate a presigned URL that callers can use to GET or PUT an S3 object
|
|
312
312
|
directly, without going through the wrapper. The signing happens against
|
|
@@ -360,7 +360,7 @@ The S3 object key.
|
|
|
360
360
|
|
|
361
361
|
> **headObject**(`input`): `Promise`\<`HeadObjectCommandOutput`\>
|
|
362
362
|
|
|
363
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:181](https://github.com/aligent/microservice-development-utilities/blob/
|
|
363
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:181](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/s3/s3.ts#L181)
|
|
364
364
|
|
|
365
365
|
Fetch the metadata for an S3 object without downloading its body.
|
|
366
366
|
|
|
@@ -382,7 +382,7 @@ Fetch the metadata for an S3 object without downloading its body.
|
|
|
382
382
|
|
|
383
383
|
> **listObjects**(`bucket`, `prefix?`): `Promise`\<`string`[]\>
|
|
384
384
|
|
|
385
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:202](https://github.com/aligent/microservice-development-utilities/blob/
|
|
385
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:202](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/s3/s3.ts#L202)
|
|
386
386
|
|
|
387
387
|
List object keys under a bucket and optional prefix, auto-paginating
|
|
388
388
|
across all pages.
|
|
@@ -409,7 +409,7 @@ across all pages.
|
|
|
409
409
|
|
|
410
410
|
> **putJsonObject**\<`T`\>(`input`): `Promise`\<`PutObjectCommandOutput`\>
|
|
411
411
|
|
|
412
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:126](https://github.com/aligent/microservice-development-utilities/blob/
|
|
412
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:126](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/s3/s3.ts#L126)
|
|
413
413
|
|
|
414
414
|
Serialise a value to JSON and store it as an S3 object.
|
|
415
415
|
|
|
@@ -445,7 +445,7 @@ Type of the value being stored.
|
|
|
445
445
|
|
|
446
446
|
> **putObject**(`input`): `Promise`\<`PutObjectCommandOutput`\>
|
|
447
447
|
|
|
448
|
-
Defined in: [packages/aws-wrappers/src/s3/s3.ts:110](https://github.com/aligent/microservice-development-utilities/blob/
|
|
448
|
+
Defined in: [packages/aws-wrappers/src/s3/s3.ts:110](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/s3/s3.ts#L110)
|
|
449
449
|
|
|
450
450
|
Put an object into S3.
|
|
451
451
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: SNSService
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/aws-wrappers/src/sns/sns.ts:45](https://github.com/aligent/microservice-development-utilities/blob/
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/sns/sns.ts:45](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/sns/sns.ts#L45)
|
|
10
10
|
|
|
11
11
|
Wrapper around the AWS SNS client providing structured Powertools logging
|
|
12
12
|
and X-Ray tracing by default.
|
|
@@ -23,7 +23,7 @@ log line omits them; the verbose levels (`POWERTOOLS_LOG_LEVEL=DEBUG` or
|
|
|
23
23
|
|
|
24
24
|
> **new SNSService**(`opts?`): `SNSService`
|
|
25
25
|
|
|
26
|
-
Defined in: [packages/aws-wrappers/src/sns/sns.ts:61](https://github.com/aligent/microservice-development-utilities/blob/
|
|
26
|
+
Defined in: [packages/aws-wrappers/src/sns/sns.ts:61](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/sns/sns.ts#L61)
|
|
27
27
|
|
|
28
28
|
#### Parameters
|
|
29
29
|
|
|
@@ -65,7 +65,7 @@ its own `truncate` option.
|
|
|
65
65
|
|
|
66
66
|
> **publish**(`input`, `opts?`): `Promise`\<`PublishCommandOutput`\>
|
|
67
67
|
|
|
68
|
-
Defined in: [packages/aws-wrappers/src/sns/sns.ts:75](https://github.com/aligent/microservice-development-utilities/blob/
|
|
68
|
+
Defined in: [packages/aws-wrappers/src/sns/sns.ts:75](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/sns/sns.ts#L75)
|
|
69
69
|
|
|
70
70
|
Publish a single message to an SNS topic.
|
|
71
71
|
|
|
@@ -98,7 +98,7 @@ PublishCommandInput including TopicArn and Message.
|
|
|
98
98
|
|
|
99
99
|
> **publishBatch**(`input`): `Promise`\<`PublishBatchCommandOutput`[]\>
|
|
100
100
|
|
|
101
|
-
Defined in: [packages/aws-wrappers/src/sns/sns.ts:134](https://github.com/aligent/microservice-development-utilities/blob/
|
|
101
|
+
Defined in: [packages/aws-wrappers/src/sns/sns.ts:134](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/sns/sns.ts#L134)
|
|
102
102
|
|
|
103
103
|
Publish a batch of messages to an SNS topic. The SNS API caps
|
|
104
104
|
PublishBatch at 10 entries per request, so this method auto-chunks
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: SQSService
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:62](https://github.com/aligent/microservice-development-utilities/blob/
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:62](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/sqs/sqs.ts#L62)
|
|
10
10
|
|
|
11
11
|
Wrapper around the AWS SQS client providing structured Powertools logging
|
|
12
12
|
and X-Ray tracing by default.
|
|
@@ -23,7 +23,7 @@ log line omits them; the verbose levels (`POWERTOOLS_LOG_LEVEL=DEBUG` or
|
|
|
23
23
|
|
|
24
24
|
> **new SQSService**(`opts?`): `SQSService`
|
|
25
25
|
|
|
26
|
-
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:77](https://github.com/aligent/microservice-development-utilities/blob/
|
|
26
|
+
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:77](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/sqs/sqs.ts#L77)
|
|
27
27
|
|
|
28
28
|
#### Parameters
|
|
29
29
|
|
|
@@ -64,7 +64,7 @@ option.
|
|
|
64
64
|
|
|
65
65
|
> **deleteMessage**(`input`): `Promise`\<`DeleteMessageCommandOutput`\>
|
|
66
66
|
|
|
67
|
-
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:141](https://github.com/aligent/microservice-development-utilities/blob/
|
|
67
|
+
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:141](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/sqs/sqs.ts#L141)
|
|
68
68
|
|
|
69
69
|
Delete a single message from an SQS queue.
|
|
70
70
|
|
|
@@ -86,7 +86,7 @@ Delete a single message from an SQS queue.
|
|
|
86
86
|
|
|
87
87
|
> **deleteMessageBatch**(`input`): `Promise`\<`DeleteMessageBatchCommandOutput`[]\>
|
|
88
88
|
|
|
89
|
-
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:185](https://github.com/aligent/microservice-development-utilities/blob/
|
|
89
|
+
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:185](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/sqs/sqs.ts#L185)
|
|
90
90
|
|
|
91
91
|
Delete a batch of messages from an SQS queue. The SQS API caps
|
|
92
92
|
DeleteMessageBatch at 10 entries per request, so this method auto-chunks
|
|
@@ -117,7 +117,7 @@ been deleted.
|
|
|
117
117
|
|
|
118
118
|
> **receiveMessages**(`input`): `Promise`\<`Message`[]\>
|
|
119
119
|
|
|
120
|
-
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:132](https://github.com/aligent/microservice-development-utilities/blob/
|
|
120
|
+
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:132](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/sqs/sqs.ts#L132)
|
|
121
121
|
|
|
122
122
|
Receive messages from an SQS queue. Returns an empty array when no
|
|
123
123
|
messages are available. No automatic deletion is performed — visibility
|
|
@@ -143,7 +143,7 @@ The `Messages` array from the response, or `[]` if absent.
|
|
|
143
143
|
|
|
144
144
|
> **sendMessage**(`input`, `opts?`): `Promise`\<`SendMessageCommandOutput`\>
|
|
145
145
|
|
|
146
|
-
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:89](https://github.com/aligent/microservice-development-utilities/blob/
|
|
146
|
+
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:89](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/sqs/sqs.ts#L89)
|
|
147
147
|
|
|
148
148
|
Send a single message to an SQS queue.
|
|
149
149
|
|
|
@@ -174,7 +174,7 @@ see `SEND_MESSAGE_SAFE_FIELDS`.
|
|
|
174
174
|
|
|
175
175
|
> **sendMessageBatch**(`input`): `Promise`\<`SendMessageBatchCommandOutput`[]\>
|
|
176
176
|
|
|
177
|
-
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:157](https://github.com/aligent/microservice-development-utilities/blob/
|
|
177
|
+
Defined in: [packages/aws-wrappers/src/sqs/sqs.ts:157](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/sqs/sqs.ts#L157)
|
|
178
178
|
|
|
179
179
|
Send a batch of messages to an SQS queue. The SQS API caps
|
|
180
180
|
SendMessageBatch at 10 entries per request, so this method auto-chunks
|