diff --git a/examples/index.js b/examples/index.js index 064dabb..d92883c 100644 --- a/examples/index.js +++ b/examples/index.js @@ -3,11 +3,13 @@ import path from 'path' import { createExamples } from '@meltwater/examplr' import { invoke } from './invoke.js' +import * as schedule from './schedule.js' process.env.AWS_SDK_LOAD_CONFIG = 'true' const examples = { - invoke + invoke, + ...schedule } const envVars = ['LOG_LEVEL', 'LOG_FILTER', 'LOG_OUTPUT_MODE'] diff --git a/examples/schedule.js b/examples/schedule.js new file mode 100644 index 0000000..109fa28 --- /dev/null +++ b/examples/schedule.js @@ -0,0 +1,37 @@ +import { SchedulerClient } from '../index.js' + +export const createSchedule = + ({ log }) => + async (scheduleName) => { + const client = new SchedulerClient({ + log + }) + return client.createSchedule(scheduleName, {}) + } + +export const deleteSchedule = + ({ log }) => + async (scheduleName) => { + const client = new SchedulerClient({ + log + }) + return client.deleteSchedule(scheduleName) + } + +export const updateSchedule = + ({ log }) => + async (scheduleName) => { + const client = new SchedulerClient({ + log + }) + return client.updateSchedule(scheduleName, {}) + } + +export const getSchedule = + ({ log }) => + async (scheduleName) => { + const client = new SchedulerClient({ + log + }) + return client.getSchedule(scheduleName) + } diff --git a/lib/clients/index.js b/lib/clients/index.js index 9b3d399..1274a32 100644 --- a/lib/clients/index.js +++ b/lib/clients/index.js @@ -2,4 +2,5 @@ export * from './dynamodb-document.js' export * from './eventbridge.js' export * from './lambda.js' export * from './s3.js' +export * from './scheduler.js' export * from './sqs.js'