diff --git a/components/motion/actions/get-schedules/get-schedules.mjs b/components/motion/actions/get-schedules/get-schedules.mjs new file mode 100644 index 0000000000000..acb237a8b737d --- /dev/null +++ b/components/motion/actions/get-schedules/get-schedules.mjs @@ -0,0 +1,25 @@ +import motion from "../../motion.app.mjs"; + +export default { + key: "motion-get-schedules", + name: "Retrieve Schedules", + version: "0.0.1", + description: "Get a list of schedules for your user. [See the documentation](https://docs.usemotion.com/docs/motion-rest-api/f9fec7bb61c6f-get-schedules)", + type: "action", + props: { + motion, + }, + methods: { + getSchedules($) { + return this.motion._makeRequest({ + $, + path: "schedules", + }); + }, + }, + async run({ $ }) { + const response = await this.getSchedules($); + $.export("$summary", `Successfully fetched ${response?.length} schedules`); + return response; + }, +}; diff --git a/components/motion/package.json b/components/motion/package.json index 7eaedfc5ddd1d..e0b19c52c9866 100644 --- a/components/motion/package.json +++ b/components/motion/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/motion", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream Motion Components", "main": "motion.app.mjs", "keywords": [ @@ -13,6 +13,6 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^1.5.1" + "@pipedream/platform": "^3.0.3" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ed825eed80aef..f4f6fe4f33cd7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6254,9 +6254,9 @@ importers: components/motion: specifiers: - '@pipedream/platform': ^1.5.1 + '@pipedream/platform': ^3.0.3 dependencies: - '@pipedream/platform': 1.5.1 + '@pipedream/platform': 3.0.3 components/moxie: specifiers: