diff --git a/components/wrike/actions/new-task/new-task.mjs b/components/wrike/actions/new-task/new-task.mjs index d18320fe19359..6d508001f408c 100644 --- a/components/wrike/actions/new-task/new-task.mjs +++ b/components/wrike/actions/new-task/new-task.mjs @@ -4,8 +4,8 @@ import _ from "lodash"; export default { key: "wrike-new-task", name: "New Task", - description: "Create a Wrike task under a specified folder ID. [See the docs](https://developers.wrike.com/api/v4/tasks/#create-task)", - version: "0.3.0", + description: "Create a Wrike task under a specified folder ID. [See the documentation](https://developers.wrike.com/api/v4/tasks/#create-task)", + version: "0.3.1", type: "action", props: { wrike, diff --git a/components/wrike/actions/update-task-custom-fields/update-task-custom-fields.mjs b/components/wrike/actions/update-task-custom-fields/update-task-custom-fields.mjs index 87805559f7b41..c3937fcca7fd1 100644 --- a/components/wrike/actions/update-task-custom-fields/update-task-custom-fields.mjs +++ b/components/wrike/actions/update-task-custom-fields/update-task-custom-fields.mjs @@ -4,8 +4,8 @@ import { ConfigurationError } from "@pipedream/platform"; export default { key: "wrike-update-task-custom-fields", name: "Update Task Custom Fields", - description: "Update the custom fields for a task. [See the docs](https://developers.wrike.com/api/v4/tasks/#modify-tasks)", - version: "0.0.1", + description: "Update the custom fields for a task. [See the documentation](https://developers.wrike.com/api/v4/tasks/#modify-tasks)", + version: "0.0.2", type: "action", props: { wrike, diff --git a/components/wrike/package.json b/components/wrike/package.json index 2a48749d28e6e..e361eb45ae766 100644 --- a/components/wrike/package.json +++ b/components/wrike/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/wrike", - "version": "0.0.2", + "version": "0.0.3", "description": "Pipedream Wrike Components", "main": "wrike.app.mjs", "keywords": [ @@ -14,7 +14,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^1.3.0", + "@pipedream/platform": "^3.0.3", "lodash": "^4.17.21" } } diff --git a/components/wrike/sources/new-folder-created/new-folder-created.mjs b/components/wrike/sources/new-folder-created/new-folder-created.mjs index 70259569cb16d..886efed7dfd76 100644 --- a/components/wrike/sources/new-folder-created/new-folder-created.mjs +++ b/components/wrike/sources/new-folder-created/new-folder-created.mjs @@ -7,7 +7,7 @@ export default { name: "New Folder Created", description: "Emit new event when a folder is created", type: "source", - version: "0.0.1", + version: "0.0.2", props: { ...base.props, folderId: { @@ -17,7 +17,6 @@ export default { ], description: "Receive notifications for folders in a folder and, optionally, in its subfolders. Leave blank to receive notifications for all folders in the account", optional: true, - reloadProps: true, }, spaceId: { propDefinition: [ @@ -26,7 +25,6 @@ export default { ], description: "Receive notifications for changes to folders within a space. Leave blank to receive notifications for all folders in the account", optional: true, - reloadProps: true, }, recursive: { type: "boolean", diff --git a/components/wrike/sources/new-subtask-created/new-subtask-created.mjs b/components/wrike/sources/new-subtask-created/new-subtask-created.mjs index 1da225a321cd8..0c5a6291fa042 100644 --- a/components/wrike/sources/new-subtask-created/new-subtask-created.mjs +++ b/components/wrike/sources/new-subtask-created/new-subtask-created.mjs @@ -7,28 +7,32 @@ export default { name: "New Subtask Created", description: "Emit new event when a subtask is created", type: "source", - version: "0.0.1", + version: "0.0.2", props: { ...base.props, - taskId: { + taskIds: { propDefinition: [ base.props.wrike, "taskId", - (c) => ({ - folderId: c.folderId, - spaceId: c.spaceId, - }), ], - description: "Receive notifications for subtasks of a task", + type: "string[]", + label: "Task IDs", + description: "Receive notifications for subtasks of the specified task(s)", + optional: true, }, }, hooks: { ...base.hooks, async deploy() { console.log("Retrieving historical events..."); - const subtasks = await this.wrike.getSubtasks({ - taskId: this.taskId, - }); + const taskIds = this.taskIds || (await this.wrike.listTasks({}))?.map(({ id }) => id) || []; + const subtasks = []; + for (const taskId of taskIds) { + const taskSubtasks = await this.wrike.getSubtasks({ + taskId, + }); + subtasks.push(...taskSubtasks); + } for (const subtask of subtasks.slice(-constants.DEPLOY_LIMIT)) { this.emitEvent(subtask); } @@ -55,7 +59,7 @@ export default { const task = await this.wrike.getTask({ taskId: data.taskId, }); - if (task.superTaskIds.includes(this.taskId)) { + if (!this.taskIds || task.superTaskIds.some((id) => this.taskIds.includes(id))) { this.emitEvent(task); } } diff --git a/components/wrike/sources/new-task-created/new-task-created.mjs b/components/wrike/sources/new-task-created/new-task-created.mjs index b9c2416e36457..eb14112ef97ea 100644 --- a/components/wrike/sources/new-task-created/new-task-created.mjs +++ b/components/wrike/sources/new-task-created/new-task-created.mjs @@ -7,7 +7,7 @@ export default { name: "New Task Created", description: "Emit new event when a task is created", type: "source", - version: "0.0.1", + version: "0.0.2", props: { ...base.props, folderId: { @@ -17,7 +17,6 @@ export default { ], description: "Receive notifications for tasks in a folder and, optionally, in its subfolders. Leave blank to receive notifications for all tasks in the account", optional: true, - reloadProps: true, }, spaceId: { propDefinition: [ @@ -26,7 +25,6 @@ export default { ], description: "Receive notifications for changes to tasks, folders, and projects within a space. Leave blank to receive notifications for all tasks in the account", optional: true, - reloadProps: true, }, recursive: { type: "boolean", diff --git a/components/wrike/wrike.app.mjs b/components/wrike/wrike.app.mjs index 05f773aa3a8bc..557475dcca6e0 100644 --- a/components/wrike/wrike.app.mjs +++ b/components/wrike/wrike.app.mjs @@ -72,7 +72,7 @@ export default { }, methods: { _baseUrl() { - return "https://www.wrike.com/api/v4"; + return `https://${this.$auth.host}/api/v4`; }, _buildPath({ basePath, folderId, spaceId, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4001a5109bbf3..255259288b489 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11282,10 +11282,10 @@ importers: components/wrike: specifiers: - '@pipedream/platform': ^1.3.0 + '@pipedream/platform': ^3.0.3 lodash: ^4.17.21 dependencies: - '@pipedream/platform': 1.5.1 + '@pipedream/platform': 3.0.3 lodash: 4.17.21 components/writer: @@ -13036,6 +13036,55 @@ packages: - aws-crt dev: false + /@aws-sdk/client-sso-oidc/3.600.0_tdq3komn4zwyd65w7klbptsu34: + resolution: {integrity: sha512-7+I8RWURGfzvChyNQSyj5/tKrqRbzRl7H+BnTOf/4Vsw1nFOi5ROhlhD4X/Y0QCTacxnaoNcIrqnY7uGGvVRzw==} + engines: {node: '>=16.0.0'} + dependencies: + '@aws-crypto/sha256-browser': 5.2.0 + '@aws-crypto/sha256-js': 5.2.0 + '@aws-sdk/client-sts': 3.600.0 + '@aws-sdk/core': 3.598.0 + '@aws-sdk/credential-provider-node': 3.600.0_f7n47caigsrjd2lr2szmwfuee4 + '@aws-sdk/middleware-host-header': 3.598.0 + '@aws-sdk/middleware-logger': 3.598.0 + '@aws-sdk/middleware-recursion-detection': 3.598.0 + '@aws-sdk/middleware-user-agent': 3.598.0 + '@aws-sdk/region-config-resolver': 3.598.0 + '@aws-sdk/types': 3.598.0 + '@aws-sdk/util-endpoints': 3.598.0 + '@aws-sdk/util-user-agent-browser': 3.598.0 + '@aws-sdk/util-user-agent-node': 3.598.0 + '@smithy/config-resolver': 3.0.3 + '@smithy/core': 2.2.3 + '@smithy/fetch-http-handler': 3.2.1 + '@smithy/hash-node': 3.0.2 + '@smithy/invalid-dependency': 3.0.2 + '@smithy/middleware-content-length': 3.0.2 + '@smithy/middleware-endpoint': 3.0.4 + '@smithy/middleware-retry': 3.0.6 + '@smithy/middleware-serde': 3.0.3 + '@smithy/middleware-stack': 3.0.3 + '@smithy/node-config-provider': 3.1.3 + '@smithy/node-http-handler': 3.1.2 + '@smithy/protocol-http': 4.0.3 + '@smithy/smithy-client': 3.1.6 + '@smithy/types': 3.3.0 + '@smithy/url-parser': 3.0.3 + '@smithy/util-base64': 3.0.0 + '@smithy/util-body-length-browser': 3.0.0 + '@smithy/util-body-length-node': 3.0.0 + '@smithy/util-defaults-mode-browser': 3.0.6 + '@smithy/util-defaults-mode-node': 3.0.6 + '@smithy/util-endpoints': 2.0.3 + '@smithy/util-middleware': 3.0.3 + '@smithy/util-retry': 3.0.2 + '@smithy/util-utf8': 3.0.0 + tslib: 2.6.3 + transitivePeerDependencies: + - '@aws-sdk/client-sts' + - aws-crt + dev: false + /@aws-sdk/client-sso/3.423.0: resolution: {integrity: sha512-znIufHkwhCIePgaYciIs3x/+BpzR57CZzbCKHR9+oOvGyufEPPpUT5bFLvbwTgfiVkTjuk6sG/ES3U5Bc+xtrA==} engines: {node: '>=14.0.0'} @@ -13271,7 +13320,7 @@ packages: dependencies: '@aws-crypto/sha256-browser': 5.2.0 '@aws-crypto/sha256-js': 5.2.0 - '@aws-sdk/client-sso-oidc': 3.600.0 + '@aws-sdk/client-sso-oidc': 3.600.0_tdq3komn4zwyd65w7klbptsu34 '@aws-sdk/core': 3.598.0 '@aws-sdk/credential-provider-node': 3.600.0_f7n47caigsrjd2lr2szmwfuee4 '@aws-sdk/middleware-host-header': 3.598.0 @@ -13313,55 +13362,6 @@ packages: - aws-crt dev: false - /@aws-sdk/client-sts/3.600.0_dseaa2p5u2yk67qiepewcq3hkq: - resolution: {integrity: sha512-KQG97B7LvTtTiGmjlrG1LRAY8wUvCQzrmZVV5bjrJ/1oXAU7DITYwVbSJeX9NWg6hDuSk0VE3MFwIXS2SvfLIA==} - engines: {node: '>=16.0.0'} - dependencies: - '@aws-crypto/sha256-browser': 5.2.0 - '@aws-crypto/sha256-js': 5.2.0 - '@aws-sdk/client-sso-oidc': 3.600.0 - '@aws-sdk/core': 3.598.0 - '@aws-sdk/credential-provider-node': 3.600.0_f7n47caigsrjd2lr2szmwfuee4 - '@aws-sdk/middleware-host-header': 3.598.0 - '@aws-sdk/middleware-logger': 3.598.0 - '@aws-sdk/middleware-recursion-detection': 3.598.0 - '@aws-sdk/middleware-user-agent': 3.598.0 - '@aws-sdk/region-config-resolver': 3.598.0 - '@aws-sdk/types': 3.598.0 - '@aws-sdk/util-endpoints': 3.598.0 - '@aws-sdk/util-user-agent-browser': 3.598.0 - '@aws-sdk/util-user-agent-node': 3.598.0 - '@smithy/config-resolver': 3.0.3 - '@smithy/core': 2.2.3 - '@smithy/fetch-http-handler': 3.2.1 - '@smithy/hash-node': 3.0.2 - '@smithy/invalid-dependency': 3.0.2 - '@smithy/middleware-content-length': 3.0.2 - '@smithy/middleware-endpoint': 3.0.4 - '@smithy/middleware-retry': 3.0.6 - '@smithy/middleware-serde': 3.0.3 - '@smithy/middleware-stack': 3.0.3 - '@smithy/node-config-provider': 3.1.3 - '@smithy/node-http-handler': 3.1.2 - '@smithy/protocol-http': 4.0.3 - '@smithy/smithy-client': 3.1.6 - '@smithy/types': 3.3.0 - '@smithy/url-parser': 3.0.3 - '@smithy/util-base64': 3.0.0 - '@smithy/util-body-length-browser': 3.0.0 - '@smithy/util-body-length-node': 3.0.0 - '@smithy/util-defaults-mode-browser': 3.0.6 - '@smithy/util-defaults-mode-node': 3.0.6 - '@smithy/util-endpoints': 2.0.3 - '@smithy/util-middleware': 3.0.3 - '@smithy/util-retry': 3.0.2 - '@smithy/util-utf8': 3.0.0 - tslib: 2.6.3 - transitivePeerDependencies: - - '@aws-sdk/client-sso-oidc' - - aws-crt - dev: false - /@aws-sdk/core/3.556.0: resolution: {integrity: sha512-vJaSaHw2kPQlo11j/Rzuz0gk1tEaKdz+2ser0f0qZ5vwFlANjt08m/frU17ctnVKC1s58bxpctO/1P894fHLrA==} engines: {node: '>=14.0.0'} @@ -17654,7 +17654,7 @@ packages: '@aws-sdk/client-sns': 3.423.0 '@aws-sdk/client-sqs': 3.423.0 '@aws-sdk/client-ssm': 3.423.0 - '@aws-sdk/client-sts': 3.600.0_dseaa2p5u2yk67qiepewcq3hkq + '@aws-sdk/client-sts': 3.600.0 '@aws-sdk/s3-request-presigner': 3.609.0 '@pipedream/helper_functions': 0.3.12 '@pipedream/platform': 1.6.6