@aligent/aws-wrappers 0.1.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -1
- package/cjs/index.cjs +343 -49
- package/cjs/package.json +2 -1
- package/cjs/src/dynamodb/dynamodb.d.ts +4 -0
- package/cjs/src/index.d.ts +1 -0
- package/cjs/src/s3/s3.d.ts +4 -0
- package/cjs/src/scheduler/scheduler.d.ts +85 -0
- package/cjs/src/secrets-manager/secrets-manager.d.ts +7 -6
- package/cjs/src/sfn/sfn.d.ts +4 -0
- package/cjs/src/sns/sns.d.ts +5 -2
- package/cjs/src/sqs/sqs.d.ts +5 -2
- package/cjs/src/ssm/ssm.d.ts +4 -0
- package/cjs/src/util/redact.d.ts +14 -4
- package/docs/classes/DynamoDBService.md +69 -34
- package/docs/classes/S3Service.md +77 -33
- package/docs/classes/SNSService.md +31 -8
- package/docs/classes/SQSService.md +33 -11
- package/docs/classes/SSMService.md +70 -9
- package/docs/classes/SchedulerService.md +271 -0
- package/docs/classes/SecretsManagerService.md +120 -7
- package/docs/classes/StepFunctionsService.md +13 -9
- package/docs/modules.md +1 -0
- package/esm/index.mjs +344 -51
- package/esm/package.json +2 -1
- package/esm/src/dynamodb/dynamodb.d.ts +4 -0
- package/esm/src/index.d.ts +1 -0
- package/esm/src/s3/s3.d.ts +4 -0
- package/esm/src/scheduler/scheduler.d.ts +85 -0
- package/esm/src/secrets-manager/secrets-manager.d.ts +7 -6
- package/esm/src/sfn/sfn.d.ts +4 -0
- package/esm/src/sns/sns.d.ts +5 -2
- package/esm/src/sqs/sqs.d.ts +5 -2
- package/esm/src/ssm/ssm.d.ts +4 -0
- package/esm/src/util/redact.d.ts +14 -4
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ new XService({ logger?, client? })
|
|
|
21
21
|
|
|
22
22
|
### Log redaction
|
|
23
23
|
|
|
24
|
-
Every wrapper emits one `logger.info` line per SDK call with a per-method safe-field allowlist (omitting payloads, secret material, and PII recipient identifiers). Set `POWERTOOLS_LOG_LEVEL
|
|
24
|
+
Every wrapper emits one `logger.info` line per SDK call with a per-method safe-field allowlist (omitting payloads, secret material, and PII recipient identifiers). Set `POWERTOOLS_LOG_LEVEL` to either `DEBUG` or `TRACE` to unlock the full SDK input in those log lines — useful for local development and incident triage. Both levels unlock because Powertools orders `TRACE` as more verbose than `DEBUG`; every level from `INFO` upwards redacts. See `packages/aws-wrappers/CLAUDE.md` for the per-method allowlists currently in force.
|
|
25
25
|
|
|
26
26
|
### X-Ray outside Lambda
|
|
27
27
|
|
|
@@ -187,6 +187,62 @@ const description = await sfn.describeExecution({ executionArn });
|
|
|
187
187
|
await sfn.stopExecution({ executionArn });
|
|
188
188
|
```
|
|
189
189
|
|
|
190
|
+
## EventBridge Scheduler
|
|
191
|
+
|
|
192
|
+
```ts
|
|
193
|
+
import { SchedulerService } from '@aligent/aws-wrappers';
|
|
194
|
+
|
|
195
|
+
const scheduler = new SchedulerService();
|
|
196
|
+
|
|
197
|
+
// FlexibleTimeWindow is required — pass { Mode: 'OFF' } for a fixed-time
|
|
198
|
+
// schedule. The wrapper bakes in no default.
|
|
199
|
+
await scheduler.createSchedule({
|
|
200
|
+
Name: 'nightly-sync',
|
|
201
|
+
GroupName: 'default',
|
|
202
|
+
ScheduleExpression: 'rate(1 day)',
|
|
203
|
+
FlexibleTimeWindow: { Mode: 'OFF' },
|
|
204
|
+
Target: {
|
|
205
|
+
Arn: 'arn:aws:lambda:us-east-1:0:function:my-fn',
|
|
206
|
+
RoleArn: 'arn:aws:iam::0:role/scheduler-invoke',
|
|
207
|
+
Input: JSON.stringify({ job: 'sync' }),
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
const schedule = await scheduler.getSchedule({ Name: 'nightly-sync' });
|
|
212
|
+
|
|
213
|
+
// UpdateSchedule is a FULL REPLACEMENT, not a patch. Any omitted field is
|
|
214
|
+
// reset to its default, so resend the complete configuration and override
|
|
215
|
+
// only what changes. GetSchedule types every field as optional, so the
|
|
216
|
+
// required fields (Name, ScheduleExpression, FlexibleTimeWindow, Target) must
|
|
217
|
+
// be re-asserted after the spread.
|
|
218
|
+
await scheduler.updateSchedule({
|
|
219
|
+
...schedule,
|
|
220
|
+
Name: 'nightly-sync',
|
|
221
|
+
ScheduleExpression: 'rate(12 hours)', // the change
|
|
222
|
+
FlexibleTimeWindow: schedule.FlexibleTimeWindow ?? { Mode: 'OFF' },
|
|
223
|
+
Target: schedule.Target ?? {
|
|
224
|
+
Arn: 'arn:aws:lambda:us-east-1:0:function:my-fn',
|
|
225
|
+
RoleArn: 'arn:aws:iam::0:role/scheduler-invoke',
|
|
226
|
+
},
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
// Auto-paginated — returns every summary across all pages.
|
|
230
|
+
const schedules = await scheduler.listSchedules({ GroupName: 'default' });
|
|
231
|
+
|
|
232
|
+
await scheduler.deleteSchedule({ Name: 'nightly-sync' });
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
`Target.Input` is the payload handed to the target and is omitted from INFO logs (it routinely carries PII). See [Log redaction](#log-redaction) for how to unlock it.
|
|
236
|
+
|
|
237
|
+
```ts
|
|
238
|
+
// Schedule groups. Groups have no update operation — only create, get,
|
|
239
|
+
// delete, and list. Deleting a group deletes every schedule it contains.
|
|
240
|
+
await scheduler.createScheduleGroup({ Name: 'integrations' });
|
|
241
|
+
const group = await scheduler.getScheduleGroup({ Name: 'integrations' });
|
|
242
|
+
const groups = await scheduler.listScheduleGroups();
|
|
243
|
+
await scheduler.deleteScheduleGroup({ Name: 'integrations' });
|
|
244
|
+
```
|
|
245
|
+
|
|
190
246
|
## SSM Parameter Store
|
|
191
247
|
|
|
192
248
|
```ts
|