@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
|
@@ -9,8 +9,9 @@ import { CreateScheduleCommandInput, CreateScheduleCommandOutput, CreateSchedule
|
|
|
9
9
|
* `TRACE`) log full SDK inputs.
|
|
10
10
|
*
|
|
11
11
|
* Covers CRUD on schedules and their groups. Named `SchedulerService` (not
|
|
12
|
-
* `EventBridgeSchedulerService`) so it doesn't collide with
|
|
13
|
-
* over the separate EventBridge bus/rules API
|
|
12
|
+
* `EventBridgeSchedulerService`) so it doesn't collide with `EventBridgeService`,
|
|
13
|
+
* the wrapper over the separate EventBridge bus/rules API
|
|
14
|
+
* (`@aws-sdk/client-eventbridge`).
|
|
14
15
|
*
|
|
15
16
|
* `FlexibleTimeWindow` is required by `CreateSchedule` and is passed through
|
|
16
17
|
* untouched — the wrapper bakes in no default, so the caller must state their
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../../../src/scheduler/scheduler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAEH,0BAA0B,EAC1B,2BAA2B,EAE3B,+BAA+B,EAC/B,gCAAgC,EAEhC,0BAA0B,EAC1B,2BAA2B,EAE3B,+BAA+B,EAC/B,gCAAgC,EAEhC,uBAAuB,EACvB,wBAAwB,EAExB,4BAA4B,EAC5B,6BAA6B,EAC7B,8BAA8B,EAC9B,yBAAyB,EAGzB,oBAAoB,EACpB,eAAe,EACf,eAAe,EAGf,0BAA0B,EAC1B,2BAA2B,EAC9B,MAAM,2BAA2B,CAAC;AAwBnC
|
|
1
|
+
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../../../src/scheduler/scheduler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAEH,0BAA0B,EAC1B,2BAA2B,EAE3B,+BAA+B,EAC/B,gCAAgC,EAEhC,0BAA0B,EAC1B,2BAA2B,EAE3B,+BAA+B,EAC/B,gCAAgC,EAEhC,uBAAuB,EACvB,wBAAwB,EAExB,4BAA4B,EAC5B,6BAA6B,EAC7B,8BAA8B,EAC9B,yBAAyB,EAGzB,oBAAoB,EACpB,eAAe,EACf,eAAe,EAGf,0BAA0B,EAC1B,2BAA2B,EAC9B,MAAM,2BAA2B,CAAC;AAwBnC;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,gBAAgB;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IAEzC;;;;;OAKG;gBACS,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,eAAe,CAAC;QAAC,MAAM,CAAC,EAAE,eAAe,CAAA;KAAE;IAKzE;;;OAGG;IACG,cAAc,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAO7F;;OAEG;IACG,WAAW,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAKpF;;;;;;;;;;;;OAYG;IACG,cAAc,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAO7F;;OAEG;IACG,cAAc,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAK7F;;;;OAIG;IACG,aAAa,CAAC,KAAK,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAMlF;;;OAGG;IACG,mBAAmB,CACrB,KAAK,EAAE,+BAA+B,GACvC,OAAO,CAAC,gCAAgC,CAAC;IAK5C;;OAEG;IACG,gBAAgB,CAClB,KAAK,EAAE,4BAA4B,GACpC,OAAO,CAAC,6BAA6B,CAAC;IAKzC;;;;OAIG;IACG,mBAAmB,CACrB,KAAK,EAAE,+BAA+B,GACvC,OAAO,CAAC,gCAAgC,CAAC;IAK5C;;;OAGG;IACG,kBAAkB,CACpB,KAAK,CAAC,EAAE,8BAA8B,GACvC,OAAO,CAAC,oBAAoB,EAAE,CAAC;CAKrC"}
|
package/cjs/src/ssm/ssm.d.ts
CHANGED
|
@@ -34,6 +34,9 @@ export declare class SSMService {
|
|
|
34
34
|
* @param name - The parameter name (or ARN).
|
|
35
35
|
* @returns The parameter value, or `undefined` if the parameter has no
|
|
36
36
|
* value set.
|
|
37
|
+
* @throws When the parameter does not exist (the SDK's
|
|
38
|
+
* `ParameterNotFound`). {@link SSMService.getParameters} instead returns
|
|
39
|
+
* `undefined` for a missing parameter unless `required` is set.
|
|
37
40
|
*/
|
|
38
41
|
getParameter(name: string): Promise<string | undefined>;
|
|
39
42
|
/**
|
|
@@ -54,13 +57,25 @@ export declare class SSMService {
|
|
|
54
57
|
* the underlying parameter names and sends one request per chunk,
|
|
55
58
|
* merging the results before building the alias-keyed return value.
|
|
56
59
|
*
|
|
60
|
+
* Unlike {@link SSMService.getParameter}, which throws when the parameter
|
|
61
|
+
* does not exist, a missing parameter here maps to `undefined` — so a
|
|
62
|
+
* typo'd path surfaces later as an undefined value. Pass
|
|
63
|
+
* `{ required: true }` to fail fast instead: every chunk is still sent,
|
|
64
|
+
* then a {@link BatchOperationError} is thrown whose `failed` entries
|
|
65
|
+
* carry each missing path as `id`, the code `ParameterNotFound`, and the
|
|
66
|
+
* alias in `message`. Request-level SDK exceptions are not wrapped.
|
|
67
|
+
*
|
|
57
68
|
* @param aliases - Record mapping each desired local alias to its SSM
|
|
58
69
|
* parameter name (or ARN).
|
|
70
|
+
* @param opts.required - Throw when any requested parameter does not
|
|
71
|
+
* exist. Defaults to `false`.
|
|
59
72
|
* @returns A record keyed by the same aliases, mapping each to the
|
|
60
|
-
* parameter's value, or `undefined` when the parameter is missing
|
|
61
|
-
* no value.
|
|
73
|
+
* parameter's value, or `undefined` when the parameter is missing (unless
|
|
74
|
+
* `required` is set) or has no value.
|
|
62
75
|
*/
|
|
63
|
-
getParameters<K extends string>(aliases: Record<K, string
|
|
76
|
+
getParameters<K extends string>(aliases: Record<K, string>, opts?: {
|
|
77
|
+
required?: boolean;
|
|
78
|
+
}): Promise<Record<K, string | undefined>>;
|
|
64
79
|
/**
|
|
65
80
|
* Create or update an SSM parameter. The log line omits `Value` to avoid
|
|
66
81
|
* leaking secret material.
|
package/cjs/src/ssm/ssm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssm.d.ts","sourceRoot":"","sources":["../../../../src/ssm/ssm.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAKH,SAAS,EAET,wBAAwB,EACxB,yBAAyB,EACzB,SAAS,EACZ,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ssm.d.ts","sourceRoot":"","sources":["../../../../src/ssm/ssm.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAKH,SAAS,EAET,wBAAwB,EACxB,yBAAyB,EACzB,SAAS,EACZ,MAAM,qBAAqB,CAAC;AA2C7B;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,UAAU;IACnB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IAEzC;;;;;OAKG;gBACS,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,eAAe,CAAC;QAAC,MAAM,CAAC,EAAE,SAAS,CAAA;KAAE;IAKnE;;;;;;;;OAQG;IACG,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAQ7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACG,aAAa,CAAC,CAAC,SAAS,MAAM,EAChC,OAAO,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,EAC1B,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAC9B,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAiCzC;;;;;;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"}
|
|
@@ -2,7 +2,8 @@ import type { LoggerInterface } from '@aws-lambda-powertools/logger/types';
|
|
|
2
2
|
/**
|
|
3
3
|
* One entry a batch operation rejected. Deliberately limited to identifier,
|
|
4
4
|
* code and message so the error never carries message bodies, attributes or
|
|
5
|
-
* any other payload the caller sent. For S3 the identifier is the object key
|
|
5
|
+
* any other payload the caller sent. For S3 the identifier is the object key;
|
|
6
|
+
* for SSM it is the parameter path.
|
|
6
7
|
*/
|
|
7
8
|
export interface BatchFailedEntry {
|
|
8
9
|
id: string | undefined;
|
|
@@ -15,7 +16,8 @@ export interface BatchFailedEntry {
|
|
|
15
16
|
*
|
|
16
17
|
* `results` holds the raw SDK output of every chunk, so the outputs of the
|
|
17
18
|
* entries that succeeded (message ids, sequence numbers) stay readable. The
|
|
18
|
-
*
|
|
19
|
+
* exceptions are `S3.emptyBucket`, whose `results` are per-page deleted keys,
|
|
20
|
+
* and `SSM.getParameters`, whose `results` are empty.
|
|
19
21
|
* `failed` is the normalised list of rejected entries across all chunks.
|
|
20
22
|
*
|
|
21
23
|
* Match on `name` rather than `instanceof` if both the CJS and ESM builds of
|
|
@@ -38,8 +40,7 @@ interface RejectedEntry {
|
|
|
38
40
|
/**
|
|
39
41
|
* SQS and SNS report rejected entries under `Failed` on an otherwise
|
|
40
42
|
* successful response, so a resolved chunk does not mean every entry was
|
|
41
|
-
* accepted.
|
|
42
|
-
* and throws a {@link BatchOperationError}.
|
|
43
|
+
* accepted. Extracts those entries and delegates to {@link throwIfAny}.
|
|
43
44
|
*
|
|
44
45
|
* Only id, code and message are copied out — never the entry itself — so
|
|
45
46
|
* neither the error nor the warning can leak a payload.
|
|
@@ -64,9 +65,14 @@ export declare function throwIfAnyDeleteErrors<TResult extends {
|
|
|
64
65
|
Errors?: DeleteError[] | undefined;
|
|
65
66
|
}>(logger: LoggerInterface, operation: string, results: TResult[]): TResult[];
|
|
66
67
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
68
|
+
* Warn-and-throw step for services whose responses don't use the SQS/SNS
|
|
69
|
+
* `Failed` shape and so extract their own rejected entries (`EventBridge.putEvents`),
|
|
70
|
+
* or whose `results` aren't a plain list of SDK outputs (`S3.emptyBucket`).
|
|
71
|
+
* Returns `results` untouched when `failed` is empty.
|
|
72
|
+
*
|
|
73
|
+
* Callers must build `failed` by copying id, code and message explicitly —
|
|
74
|
+
* never by spreading the SDK entry — because it goes straight into the error
|
|
75
|
+
* and the warning.
|
|
70
76
|
*/
|
|
71
77
|
export declare function throwIfAny<TResult>(logger: LoggerInterface, operation: string, results: TResult[], failed: BatchFailedEntry[]): TResult[];
|
|
72
78
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch-operation-error.d.ts","sourceRoot":"","sources":["../../../../src/util/batch-operation-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE3E
|
|
1
|
+
{"version":3,"file":"batch-operation-error.d.ts","sourceRoot":"","sources":["../../../../src/util/batch-operation-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE3E;;;;;GAKG;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;;;;;;;;;;;;GAYG;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;;GAEG;AACH,UAAU,aAAa;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,SAAS;IAAE,MAAM,CAAC,EAAE,aAAa,EAAE,GAAG,SAAS,CAAA;CAAE,EACrF,MAAM,EAAE,eAAe,EACvB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,OAAO,EAAE,GACnB,OAAO,EAAE,CASX;AAED;;GAEG;AACH,UAAU,WAAW;IACjB,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,SAAS;IAAE,MAAM,CAAC,EAAE,WAAW,EAAE,GAAG,SAAS,CAAA;CAAE,EACzF,MAAM,EAAE,eAAe,EACvB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,OAAO,EAAE,GACnB,OAAO,EAAE,CASX;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAC9B,MAAM,EAAE,eAAe,EACvB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,OAAO,EAAE,EAClB,MAAM,EAAE,gBAAgB,EAAE,GAC3B,OAAO,EAAE,CAQX"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
interface ParsedErrorPayload {
|
|
2
|
+
errorType: string | undefined;
|
|
3
|
+
errorMessage: string | undefined;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Thrown by `LambdaService.invoke` when a synchronous invocation reached the
|
|
7
|
+
* function but the function itself failed. Lambda reports that as an HTTP 200
|
|
8
|
+
* carrying a function error marker, so the SDK does not throw.
|
|
9
|
+
*
|
|
10
|
+
* `functionError` is the SDK's marker (`Handled` or `Unhandled`).
|
|
11
|
+
* `errorType` and `errorMessage` are parsed from the response payload when it
|
|
12
|
+
* has the usual `{ errorType, errorMessage }` JSON shape, otherwise undefined.
|
|
13
|
+
*
|
|
14
|
+
* Deliberately excludes the raw SDK output and the stack trace: either can
|
|
15
|
+
* contain the caller's payload or PII.
|
|
16
|
+
*
|
|
17
|
+
* Match on `name` rather than `instanceof` if both the CJS and ESM builds of
|
|
18
|
+
* this package may be loaded in one process.
|
|
19
|
+
*/
|
|
20
|
+
export declare class LambdaFunctionError extends Error {
|
|
21
|
+
readonly functionName: string | undefined;
|
|
22
|
+
readonly functionError: string;
|
|
23
|
+
readonly name = "LambdaFunctionError";
|
|
24
|
+
readonly errorType: string | undefined;
|
|
25
|
+
readonly errorMessage: string | undefined;
|
|
26
|
+
constructor(functionName: string | undefined, functionError: string, payload: Pick<LambdaFunctionError, 'errorType' | 'errorMessage'>);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Reads `errorType` and `errorMessage` out of a function error payload.
|
|
30
|
+
* Anything that is not a JSON object with string fields yields undefined for
|
|
31
|
+
* that field rather than failing, because the payload is whatever the invoked
|
|
32
|
+
* function (or runtime) chose to return.
|
|
33
|
+
*/
|
|
34
|
+
export declare function parseFunctionErrorPayload(payload: Uint8Array | undefined): ParsedErrorPayload;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=lambda-function-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lambda-function-error.d.ts","sourceRoot":"","sources":["../../../../src/util/lambda-function-error.ts"],"names":[],"mappings":"AAAA,UAAU,kBAAkB;IACxB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED;;;;;;;;;;;;;;GAcG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAMtC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS;IACzC,QAAQ,CAAC,aAAa,EAAE,MAAM;IANlC,SAAkB,IAAI,yBAAyB;IAC/C,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;gBAG7B,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,aAAa,EAAE,MAAM,EAC9B,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,WAAW,GAAG,cAAc,CAAC;CAMvE;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,kBAAkB,CAiB7F"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: APIGatewayService
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:30](https://github.com/aligent/microservice-development-utilities/blob/
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:30](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/api-gateway/api-gateway.ts#L30)
|
|
10
10
|
|
|
11
11
|
Read-only wrapper around the API Gateway (REST API, v1) control-plane client
|
|
12
12
|
providing structured Powertools logging and X-Ray tracing by default.
|
|
@@ -24,7 +24,7 @@ output; the wrapper never logs output, and no input carries secrets.
|
|
|
24
24
|
|
|
25
25
|
> **new APIGatewayService**(`opts?`): `APIGatewayService`
|
|
26
26
|
|
|
27
|
-
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:40](https://github.com/aligent/microservice-development-utilities/blob/
|
|
27
|
+
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:40](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/api-gateway/api-gateway.ts#L40)
|
|
28
28
|
|
|
29
29
|
#### Parameters
|
|
30
30
|
|
|
@@ -56,7 +56,7 @@ which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
|
56
56
|
|
|
57
57
|
> **getApiKey**(`input`): `Promise`\<`GetApiKeyCommandOutput`\>
|
|
58
58
|
|
|
59
|
-
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:71](https://github.com/aligent/microservice-development-utilities/blob/
|
|
59
|
+
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:71](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/api-gateway/api-gateway.ts#L71)
|
|
60
60
|
|
|
61
61
|
Fetch a single API key, including its secret value.
|
|
62
62
|
|
|
@@ -82,7 +82,7 @@ NotFoundException when the key does not exist.
|
|
|
82
82
|
|
|
83
83
|
> **getApiKeys**(`input?`): `Promise`\<`ApiKey`[]\>
|
|
84
84
|
|
|
85
|
-
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:59](https://github.com/aligent/microservice-development-utilities/blob/
|
|
85
|
+
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:59](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/api-gateway/api-gateway.ts#L59)
|
|
86
86
|
|
|
87
87
|
List API keys, including their secret values. Auto-paginated.
|
|
88
88
|
|
|
@@ -104,7 +104,7 @@ List API keys, including their secret values. Auto-paginated.
|
|
|
104
104
|
|
|
105
105
|
> **getResources**(`input`): `Promise`\<`Resource`[]\>
|
|
106
106
|
|
|
107
|
-
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:83](https://github.com/aligent/microservice-development-utilities/blob/
|
|
107
|
+
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:83](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/api-gateway/api-gateway.ts#L83)
|
|
108
108
|
|
|
109
109
|
List every resource (path) of a REST API, which is how REST APIs expose
|
|
110
110
|
their routes. Pass `embed: ['methods']` to include each resource's
|
|
@@ -128,7 +128,7 @@ methods. Auto-paginated.
|
|
|
128
128
|
|
|
129
129
|
> **getRestApis**(`input?`): `Promise`\<`RestApi`[]\>
|
|
130
130
|
|
|
131
|
-
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:48](https://github.com/aligent/microservice-development-utilities/blob/
|
|
131
|
+
Defined in: [packages/aws-wrappers/src/api-gateway/api-gateway.ts:48](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/api-gateway/api-gateway.ts#L48)
|
|
132
132
|
|
|
133
133
|
List every REST API in the account and region. Auto-paginated.
|
|
134
134
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: APIGatewayV2Service
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:26](https://github.com/aligent/microservice-development-utilities/blob/
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:26](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts#L26)
|
|
10
10
|
|
|
11
11
|
Read-only wrapper around the API Gateway v2 (HTTP and WebSocket APIs)
|
|
12
12
|
control-plane client providing structured Powertools logging and X-Ray
|
|
@@ -23,7 +23,7 @@ follow `NextToken` manually.
|
|
|
23
23
|
|
|
24
24
|
> **new APIGatewayV2Service**(`opts?`): `APIGatewayV2Service`
|
|
25
25
|
|
|
26
|
-
Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:36](https://github.com/aligent/microservice-development-utilities/blob/
|
|
26
|
+
Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:36](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts#L36)
|
|
27
27
|
|
|
28
28
|
#### Parameters
|
|
29
29
|
|
|
@@ -55,7 +55,7 @@ which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
|
55
55
|
|
|
56
56
|
> **getApis**(`input?`): `Promise`\<`Api`[]\>
|
|
57
57
|
|
|
58
|
-
Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:45](https://github.com/aligent/microservice-development-utilities/blob/
|
|
58
|
+
Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:45](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts#L45)
|
|
59
59
|
|
|
60
60
|
List every HTTP and WebSocket API in the account and region.
|
|
61
61
|
Auto-paginated.
|
|
@@ -78,7 +78,7 @@ Auto-paginated.
|
|
|
78
78
|
|
|
79
79
|
> **getRoute**(`input`): `Promise`\<`GetRouteCommandOutput`\>
|
|
80
80
|
|
|
81
|
-
Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:58](https://github.com/aligent/microservice-development-utilities/blob/
|
|
81
|
+
Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:58](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts#L58)
|
|
82
82
|
|
|
83
83
|
Fetch a single route of an HTTP or WebSocket API.
|
|
84
84
|
|
|
@@ -104,7 +104,7 @@ NotFoundException when the route does not exist.
|
|
|
104
104
|
|
|
105
105
|
> **getRoutes**(`input`): `Promise`\<`Route`[]\>
|
|
106
106
|
|
|
107
|
-
Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:66](https://github.com/aligent/microservice-development-utilities/blob/
|
|
107
|
+
Defined in: [packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts:66](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/api-gateway-v2/api-gateway-v2.ts#L66)
|
|
108
108
|
|
|
109
109
|
List every route of an HTTP or WebSocket API. Auto-paginated.
|
|
110
110
|
|
|
@@ -6,14 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: BatchOperationError\<TResult\>
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:28](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/util/batch-operation-error.ts#L28)
|
|
10
10
|
|
|
11
11
|
Thrown by the batch methods once every chunk has been sent and at least one
|
|
12
12
|
entry was rejected.
|
|
13
13
|
|
|
14
14
|
`results` holds the raw SDK output of every chunk, so the outputs of the
|
|
15
15
|
entries that succeeded (message ids, sequence numbers) stay readable. The
|
|
16
|
-
|
|
16
|
+
exceptions are `S3.emptyBucket`, whose `results` are per-page deleted keys,
|
|
17
|
+
and `SSM.getParameters`, whose `results` are empty.
|
|
17
18
|
`failed` is the normalised list of rejected entries across all chunks.
|
|
18
19
|
|
|
19
20
|
Match on `name` rather than `instanceof` if both the CJS and ESM builds of
|
|
@@ -39,7 +40,7 @@ this package may be loaded in one process.
|
|
|
39
40
|
|
|
40
41
|
> **new BatchOperationError**\<`TResult`\>(`results`, `failed`): `BatchOperationError`\<`TResult`\>
|
|
41
42
|
|
|
42
|
-
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:
|
|
43
|
+
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:31](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/util/batch-operation-error.ts#L31)
|
|
43
44
|
|
|
44
45
|
#### Parameters
|
|
45
46
|
|
|
@@ -81,7 +82,7 @@ Defined in: node\_modules/typescript/lib/lib.es2022.error.d.ts:24
|
|
|
81
82
|
|
|
82
83
|
> `readonly` **failed**: [`BatchFailedEntry`](../interfaces/BatchFailedEntry.md)[]
|
|
83
84
|
|
|
84
|
-
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:
|
|
85
|
+
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:33](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/util/batch-operation-error.ts#L33)
|
|
85
86
|
|
|
86
87
|
***
|
|
87
88
|
|
|
@@ -105,7 +106,7 @@ Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1075
|
|
|
105
106
|
|
|
106
107
|
> `readonly` **name**: `"BatchOperationError"` = `'BatchOperationError'`
|
|
107
108
|
|
|
108
|
-
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:
|
|
109
|
+
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:29](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/util/batch-operation-error.ts#L29)
|
|
109
110
|
|
|
110
111
|
#### Overrides
|
|
111
112
|
|
|
@@ -119,7 +120,7 @@ Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:27](https:/
|
|
|
119
120
|
|
|
120
121
|
> `readonly` **results**: `TResult`[]
|
|
121
122
|
|
|
122
|
-
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:
|
|
123
|
+
Defined in: [packages/aws-wrappers/src/util/batch-operation-error.ts:32](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/util/batch-operation-error.ts#L32)
|
|
123
124
|
|
|
124
125
|
***
|
|
125
126
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: DynamoDBService
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:166](https://github.com/aligent/microservice-development-utilities/blob/
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:166](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L166)
|
|
10
10
|
|
|
11
11
|
Wrapper around the AWS DynamoDB Document client providing structured
|
|
12
12
|
Powertools logging and X-Ray tracing by default.
|
|
@@ -26,7 +26,7 @@ callers work with plain TypeScript objects in both directions.
|
|
|
26
26
|
|
|
27
27
|
> **new DynamoDBService**(`opts?`): `DynamoDBService`
|
|
28
28
|
|
|
29
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:179](https://github.com/aligent/microservice-development-utilities/blob/
|
|
29
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:179](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L179)
|
|
30
30
|
|
|
31
31
|
#### Parameters
|
|
32
32
|
|
|
@@ -61,7 +61,7 @@ which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
|
61
61
|
|
|
62
62
|
> **batchGet**(`input`): `Promise`\<`BatchGetCommandOutput`\>
|
|
63
63
|
|
|
64
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:317](https://github.com/aligent/microservice-development-utilities/blob/
|
|
64
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:317](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L317)
|
|
65
65
|
|
|
66
66
|
Batch-get items from one or more DynamoDB tables, retrying
|
|
67
67
|
`UnprocessedKeys` with jittered exponential backoff. Up to 5 attempts
|
|
@@ -91,7 +91,7 @@ Callers should narrow the result type at the call site.
|
|
|
91
91
|
|
|
92
92
|
> **batchWrite**(`input`): `Promise`\<`BatchWriteCommandOutput`\>
|
|
93
93
|
|
|
94
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:349](https://github.com/aligent/microservice-development-utilities/blob/
|
|
94
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:349](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L349)
|
|
95
95
|
|
|
96
96
|
Batch-write items to DynamoDB, retrying `UnprocessedItems` with jittered
|
|
97
97
|
exponential backoff. Up to 5 attempts (200ms base delay). Throws when
|
|
@@ -115,7 +115,7 @@ items remain unprocessed after the final attempt.
|
|
|
115
115
|
|
|
116
116
|
> **deleteItem**\<`K`, `R`\>(`input`): `Promise`\<`Omit`\<`DeleteCommandOutput`, `"Attributes"`\> & `object`\>
|
|
117
117
|
|
|
118
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:248](https://github.com/aligent/microservice-development-utilities/blob/
|
|
118
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:248](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L248)
|
|
119
119
|
|
|
120
120
|
Delete an item from DynamoDB. The `Attributes` field on the response is
|
|
121
121
|
typed as `R` — relevant when `ReturnValues: 'ALL_OLD'` is set.
|
|
@@ -156,7 +156,7 @@ Expected shape of the returned `Attributes`.
|
|
|
156
156
|
|
|
157
157
|
> **getItem**\<`K`, `R`\>(`input`): `Promise`\<`R` \| `undefined`\>
|
|
158
158
|
|
|
159
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:194](https://github.com/aligent/microservice-development-utilities/blob/
|
|
159
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:194](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L194)
|
|
160
160
|
|
|
161
161
|
Get an item from DynamoDB.
|
|
162
162
|
|
|
@@ -198,7 +198,7 @@ The item, or `undefined` if not found.
|
|
|
198
198
|
|
|
199
199
|
> **paginateItems**\<`T`\>(`input`): `AsyncGenerator`\<`T`\>
|
|
200
200
|
|
|
201
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:395](https://github.com/aligent/microservice-development-utilities/blob/
|
|
201
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:395](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L395)
|
|
202
202
|
|
|
203
203
|
Paginate over Query results, yielding one unmarshalled item at a time.
|
|
204
204
|
|
|
@@ -251,7 +251,7 @@ Expected shape of each yielded item.
|
|
|
251
251
|
|
|
252
252
|
> **paginateScan**\<`T`\>(`input`): `AsyncGenerator`\<`T`\>
|
|
253
253
|
|
|
254
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:417](https://github.com/aligent/microservice-development-utilities/blob/
|
|
254
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:417](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L417)
|
|
255
255
|
|
|
256
256
|
Paginate over Scan results, yielding one unmarshalled item at a time.
|
|
257
257
|
|
|
@@ -287,7 +287,7 @@ Expected shape of each yielded item.
|
|
|
287
287
|
|
|
288
288
|
> **putItem**\<`T`\>(`input`): `Promise`\<`PutCommandOutput`\>
|
|
289
289
|
|
|
290
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:210](https://github.com/aligent/microservice-development-utilities/blob/
|
|
290
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:210](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L210)
|
|
291
291
|
|
|
292
292
|
Put an item into DynamoDB. The caller's `Item` is typed as `T`, which
|
|
293
293
|
the document client marshalls automatically.
|
|
@@ -320,7 +320,7 @@ Type of the item being stored.
|
|
|
320
320
|
|
|
321
321
|
> **query**\<`T`\>(`input`): `Promise`\<`Omit`\<`QueryCommandOutput`, `"Items"`\> & `object`\>
|
|
322
322
|
|
|
323
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:267](https://github.com/aligent/microservice-development-utilities/blob/
|
|
323
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:267](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L267)
|
|
324
324
|
|
|
325
325
|
Execute a DynamoDB Query. The full `QueryCommandOutput` is returned with
|
|
326
326
|
`Items` typed as `T[]` so callers retain pagination metadata
|
|
@@ -354,7 +354,7 @@ Expected shape of each unmarshalled item.
|
|
|
354
354
|
|
|
355
355
|
> **scan**\<`T`\>(`input`): `Promise`\<`Omit`\<`ScanCommandOutput`, `"Items"`\> & `object`\>
|
|
356
356
|
|
|
357
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:296](https://github.com/aligent/microservice-development-utilities/blob/
|
|
357
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:296](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L296)
|
|
358
358
|
|
|
359
359
|
Scan a DynamoDB table. The full `ScanCommandOutput` is returned with
|
|
360
360
|
`Items` typed as `T[]` so callers retain pagination metadata.
|
|
@@ -400,7 +400,7 @@ Expected shape of each unmarshalled item.
|
|
|
400
400
|
|
|
401
401
|
> **updateItem**\<`K`, `R`\>(`input`): `Promise`\<`Omit`\<`UpdateCommandOutput`, `"Attributes"`\> & `object`\>
|
|
402
402
|
|
|
403
|
-
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:229](https://github.com/aligent/microservice-development-utilities/blob/
|
|
403
|
+
Defined in: [packages/aws-wrappers/src/dynamodb/dynamodb.ts:229](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/dynamodb/dynamodb.ts#L229)
|
|
404
404
|
|
|
405
405
|
Update an item in DynamoDB. The `Attributes` field on the response is
|
|
406
406
|
typed as `R` — the caller should choose `R` to match their
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
[**@aligent/aws-wrappers**](../../modules.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@aligent/aws-wrappers](../../modules.md) / [index](../modules.md) / EventBridgeService
|
|
6
|
+
|
|
7
|
+
# Class: EventBridgeService
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/aws-wrappers/src/eventbridge/eventbridge.ts:64](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/eventbridge/eventbridge.ts#L64)
|
|
10
|
+
|
|
11
|
+
Wrapper around the AWS EventBridge client providing structured Powertools
|
|
12
|
+
logging 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 `putEvents` only. Named `EventBridgeService` for the event bus API;
|
|
19
|
+
schedules live in `SchedulerService`.
|
|
20
|
+
|
|
21
|
+
## Constructors
|
|
22
|
+
|
|
23
|
+
<a id="constructor"></a>
|
|
24
|
+
|
|
25
|
+
### Constructor
|
|
26
|
+
|
|
27
|
+
> **new EventBridgeService**(`opts?`): `EventBridgeService`
|
|
28
|
+
|
|
29
|
+
Defined in: [packages/aws-wrappers/src/eventbridge/eventbridge.ts:74](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/eventbridge/eventbridge.ts#L74)
|
|
30
|
+
|
|
31
|
+
#### Parameters
|
|
32
|
+
|
|
33
|
+
##### opts?
|
|
34
|
+
|
|
35
|
+
###### client?
|
|
36
|
+
|
|
37
|
+
`EventBridgeClient`
|
|
38
|
+
|
|
39
|
+
Optional pre-configured `EventBridgeClient`. When
|
|
40
|
+
supplied, the wrapper does not apply X-Ray instrumentation.
|
|
41
|
+
|
|
42
|
+
###### logger?
|
|
43
|
+
|
|
44
|
+
`LoggerInterface`
|
|
45
|
+
|
|
46
|
+
Optional Powertools logger. Defaults to `new Logger()`,
|
|
47
|
+
which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
48
|
+
|
|
49
|
+
#### Returns
|
|
50
|
+
|
|
51
|
+
`EventBridgeService`
|
|
52
|
+
|
|
53
|
+
## Methods
|
|
54
|
+
|
|
55
|
+
<a id="putevents"></a>
|
|
56
|
+
|
|
57
|
+
### putEvents()
|
|
58
|
+
|
|
59
|
+
> **putEvents**(`input`): `Promise`\<`PutEventsCommandOutput`[]\>
|
|
60
|
+
|
|
61
|
+
Defined in: [packages/aws-wrappers/src/eventbridge/eventbridge.ts:108](https://github.com/aligent/microservice-development-utilities/blob/3822f761bcc8572b495cfd407e000d4fed44d0ba/packages/aws-wrappers/src/eventbridge/eventbridge.ts#L108)
|
|
62
|
+
|
|
63
|
+
Publish events to an event bus. The EventBridge API caps `PutEvents` at
|
|
64
|
+
10 entries per request, so this method auto-chunks the caller's `Entries`
|
|
65
|
+
and sends one request per chunk, returning the array of outputs. The
|
|
66
|
+
remaining request fields (such as `EndpointId`) are carried onto every
|
|
67
|
+
chunk.
|
|
68
|
+
|
|
69
|
+
Chunking is by count only. The 256 KB request size limit is not enforced
|
|
70
|
+
here: a chunk that exceeds it fails at the SDK as a request-level error.
|
|
71
|
+
|
|
72
|
+
Every chunk is sent before the outcome is judged. If EventBridge rejected
|
|
73
|
+
any entry (it reports an error code on the result entry), a
|
|
74
|
+
[BatchOperationError](BatchOperationError.md) is then thrown carrying the per-chunk results
|
|
75
|
+
and the failed entries. For this method each failed entry's `id` is
|
|
76
|
+
always set, to the entry's index in the caller's original `Entries` list
|
|
77
|
+
across all chunks, as a string. Only `id`, `code` and `message` are
|
|
78
|
+
copied out, so event detail never reaches the error.
|
|
79
|
+
|
|
80
|
+
No retries are performed. Request-level SDK exceptions (throttling,
|
|
81
|
+
access denied, oversize request) are not wrapped: they propagate
|
|
82
|
+
unchanged and immediately, so earlier chunks may already have been
|
|
83
|
+
published.
|
|
84
|
+
|
|
85
|
+
At INFO level the log line includes only the endpoint id and the entry
|
|
86
|
+
count, because `Detail`, `Resources` and the entries themselves are
|
|
87
|
+
payload carriers.
|
|
88
|
+
|
|
89
|
+
#### Parameters
|
|
90
|
+
|
|
91
|
+
##### input
|
|
92
|
+
|
|
93
|
+
`PutEventsCommandInput`
|
|
94
|
+
|
|
95
|
+
PutEventsCommandInput including Entries.
|
|
96
|
+
|
|
97
|
+
#### Returns
|
|
98
|
+
|
|
99
|
+
`Promise`\<`PutEventsCommandOutput`[]\>
|