Skip to content

Commit 1910739

Browse files
authored
Wrike - fix base url to use $auth.host (#14300)
* update base url * pnpm-lock.yaml * fix package.json version * updates
1 parent 1ea52a8 commit 1910739

File tree

8 files changed

+26
-26
lines changed

8 files changed

+26
-26
lines changed

components/wrike/actions/new-task/new-task.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import _ from "lodash";
44
export default {
55
key: "wrike-new-task",
66
name: "New Task",
7-
description: "Create a Wrike task under a specified folder ID. [See the docs](https://developers.wrike.com/api/v4/tasks/#create-task)",
8-
version: "0.3.0",
7+
description: "Create a Wrike task under a specified folder ID. [See the documentation](https://developers.wrike.com/api/v4/tasks/#create-task)",
8+
version: "0.3.1",
99
type: "action",
1010
props: {
1111
wrike,

components/wrike/actions/update-task-custom-fields/update-task-custom-fields.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { ConfigurationError } from "@pipedream/platform";
44
export default {
55
key: "wrike-update-task-custom-fields",
66
name: "Update Task Custom Fields",
7-
description: "Update the custom fields for a task. [See the docs](https://developers.wrike.com/api/v4/tasks/#modify-tasks)",
8-
version: "0.0.1",
7+
description: "Update the custom fields for a task. [See the documentation](https://developers.wrike.com/api/v4/tasks/#modify-tasks)",
8+
version: "0.0.2",
99
type: "action",
1010
props: {
1111
wrike,

components/wrike/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/wrike",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"description": "Pipedream Wrike Components",
55
"main": "wrike.app.mjs",
66
"keywords": [
@@ -14,7 +14,7 @@
1414
"access": "public"
1515
},
1616
"dependencies": {
17-
"@pipedream/platform": "^1.3.0",
17+
"@pipedream/platform": "^3.0.3",
1818
"lodash": "^4.17.21"
1919
}
2020
}

components/wrike/sources/new-folder-created/new-folder-created.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
name: "New Folder Created",
88
description: "Emit new event when a folder is created",
99
type: "source",
10-
version: "0.0.1",
10+
version: "0.0.2",
1111
props: {
1212
...base.props,
1313
folderId: {
@@ -17,7 +17,6 @@ export default {
1717
],
1818
description: "Receive notifications for folders in a folder and, optionally, in its subfolders. Leave blank to receive notifications for all folders in the account",
1919
optional: true,
20-
reloadProps: true,
2120
},
2221
spaceId: {
2322
propDefinition: [
@@ -26,7 +25,6 @@ export default {
2625
],
2726
description: "Receive notifications for changes to folders within a space. Leave blank to receive notifications for all folders in the account",
2827
optional: true,
29-
reloadProps: true,
3028
},
3129
recursive: {
3230
type: "boolean",

components/wrike/sources/new-subtask-created/new-subtask-created.mjs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,32 @@ export default {
77
name: "New Subtask Created",
88
description: "Emit new event when a subtask is created",
99
type: "source",
10-
version: "0.0.1",
10+
version: "0.0.2",
1111
props: {
1212
...base.props,
13-
taskId: {
13+
taskIds: {
1414
propDefinition: [
1515
base.props.wrike,
1616
"taskId",
17-
(c) => ({
18-
folderId: c.folderId,
19-
spaceId: c.spaceId,
20-
}),
2117
],
22-
description: "Receive notifications for subtasks of a task",
18+
type: "string[]",
19+
label: "Task IDs",
20+
description: "Receive notifications for subtasks of the specified task(s)",
21+
optional: true,
2322
},
2423
},
2524
hooks: {
2625
...base.hooks,
2726
async deploy() {
2827
console.log("Retrieving historical events...");
29-
const subtasks = await this.wrike.getSubtasks({
30-
taskId: this.taskId,
31-
});
28+
const taskIds = this.taskIds || (await this.wrike.listTasks({}))?.map(({ id }) => id) || [];
29+
const subtasks = [];
30+
for (const taskId of taskIds) {
31+
const taskSubtasks = await this.wrike.getSubtasks({
32+
taskId,
33+
});
34+
subtasks.push(...taskSubtasks);
35+
}
3236
for (const subtask of subtasks.slice(-constants.DEPLOY_LIMIT)) {
3337
this.emitEvent(subtask);
3438
}
@@ -55,7 +59,7 @@ export default {
5559
const task = await this.wrike.getTask({
5660
taskId: data.taskId,
5761
});
58-
if (task.superTaskIds.includes(this.taskId)) {
62+
if (!this.taskIds || task.superTaskIds.some((id) => this.taskIds.includes(id))) {
5963
this.emitEvent(task);
6064
}
6165
}

components/wrike/sources/new-task-created/new-task-created.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
name: "New Task Created",
88
description: "Emit new event when a task is created",
99
type: "source",
10-
version: "0.0.1",
10+
version: "0.0.2",
1111
props: {
1212
...base.props,
1313
folderId: {
@@ -17,7 +17,6 @@ export default {
1717
],
1818
description: "Receive notifications for tasks in a folder and, optionally, in its subfolders. Leave blank to receive notifications for all tasks in the account",
1919
optional: true,
20-
reloadProps: true,
2120
},
2221
spaceId: {
2322
propDefinition: [
@@ -26,7 +25,6 @@ export default {
2625
],
2726
description: "Receive notifications for changes to tasks, folders, and projects within a space. Leave blank to receive notifications for all tasks in the account",
2827
optional: true,
29-
reloadProps: true,
3028
},
3129
recursive: {
3230
type: "boolean",

components/wrike/wrike.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export default {
7272
},
7373
methods: {
7474
_baseUrl() {
75-
return "https://www.wrike.com/api/v4";
75+
return `https://${this.$auth.host}/api/v4`;
7676
},
7777
_buildPath({
7878
basePath, folderId, spaceId,

pnpm-lock.yaml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)