@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 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=DEBUG` to unlock the full SDK input in those log lines — useful for local development and incident triage. See `packages/aws-wrappers/CLAUDE.md` for the per-method allowlists currently in force.
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