@pipedream/streak 0.0.1 → 0.0.3
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/actions/create-box/create-box.mjs +96 -0
- package/actions/create-task/create-task.mjs +66 -0
- package/actions/link-boxes/link-boxes.mjs +52 -0
- package/actions/update-box/update-box.mjs +85 -0
- package/actions/update-box-field-value/update-box-field-value.mjs +64 -0
- package/package.json +1 -1
- package/sources/box-changed-pipeline/box-changed-pipeline.mjs +1 -1
- package/sources/box-changed-stage/box-changed-stage.mjs +1 -1
- package/sources/new-box/new-box.mjs +1 -1
- package/sources/new-comment/new-comment.mjs +1 -1
- package/sources/new-contact/new-contact.mjs +1 -1
- package/sources/new-email-on-box/new-email-on-box.mjs +1 -1
- package/sources/new-task/new-task.mjs +1 -1
- package/sources/new-task-due/new-task-due.mjs +1 -1
- package/sources/task-completed/task-completed.mjs +1 -1
- package/sources/updated-box/updated-box.mjs +1 -1
- package/sources/updated-contact/updated-contact.mjs +1 -1
- package/streak.app.mjs +200 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import streak from "../../streak.app.mjs";
|
|
2
|
+
|
|
3
|
+
const docLink = "https://streak.readme.io/reference/create-a-box";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
key: "streak-create-box",
|
|
7
|
+
name: "Create Box",
|
|
8
|
+
description: `Create a new box in Streak. [See the docs](${docLink})`,
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
props: {
|
|
12
|
+
streak,
|
|
13
|
+
pipelineId: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
streak,
|
|
16
|
+
"pipelineId",
|
|
17
|
+
],
|
|
18
|
+
reloadProps: true,
|
|
19
|
+
},
|
|
20
|
+
name: {
|
|
21
|
+
type: "string",
|
|
22
|
+
label: "Name",
|
|
23
|
+
description: "Name of the box",
|
|
24
|
+
},
|
|
25
|
+
stage: {
|
|
26
|
+
propDefinition: [
|
|
27
|
+
streak,
|
|
28
|
+
"stage",
|
|
29
|
+
(c) => ({
|
|
30
|
+
pipelineId: c.pipelineId,
|
|
31
|
+
}),
|
|
32
|
+
],
|
|
33
|
+
optional: true,
|
|
34
|
+
},
|
|
35
|
+
notes: {
|
|
36
|
+
type: "string",
|
|
37
|
+
label: "Notes",
|
|
38
|
+
description: "The notes on the box",
|
|
39
|
+
optional: true,
|
|
40
|
+
},
|
|
41
|
+
teamId: {
|
|
42
|
+
propDefinition: [
|
|
43
|
+
streak,
|
|
44
|
+
"teamId",
|
|
45
|
+
],
|
|
46
|
+
optional: true,
|
|
47
|
+
},
|
|
48
|
+
assignees: {
|
|
49
|
+
propDefinition: [
|
|
50
|
+
streak,
|
|
51
|
+
"teamMembers",
|
|
52
|
+
(c) => ({
|
|
53
|
+
teamId: c.teamId,
|
|
54
|
+
}),
|
|
55
|
+
],
|
|
56
|
+
description: "The member(s) of your team this box will be assigned to",
|
|
57
|
+
optional: true,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
async additionalProps() {
|
|
61
|
+
const props = {};
|
|
62
|
+
const fields = await this.streak.listPipelineFields({
|
|
63
|
+
pipelineId: this.pipelineId,
|
|
64
|
+
});
|
|
65
|
+
for (const field of fields) {
|
|
66
|
+
props[`${this.pipelineId}_${field.key}`] = this.streak.customFieldToProp(field);
|
|
67
|
+
}
|
|
68
|
+
return props;
|
|
69
|
+
},
|
|
70
|
+
async run({ $ }) {
|
|
71
|
+
const response = await this.streak.createBox({
|
|
72
|
+
$,
|
|
73
|
+
pipelineId: this.pipelineId,
|
|
74
|
+
data: {
|
|
75
|
+
name: this.name,
|
|
76
|
+
stageKey: this.stage,
|
|
77
|
+
notes: this.notes,
|
|
78
|
+
assignedToSharingEntries: this.assignees?.map((assignee) => ({
|
|
79
|
+
email: assignee,
|
|
80
|
+
})),
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const updateCustomFields = Object.keys(this)
|
|
85
|
+
.filter((k) => k.includes(`${this.pipelineId}_`))
|
|
86
|
+
.map((k) => this.streak.updateFieldValue({
|
|
87
|
+
boxId: response.boxKey,
|
|
88
|
+
fieldId: k.split(`${this.pipelineId}_`)[1],
|
|
89
|
+
value: this[k],
|
|
90
|
+
}));
|
|
91
|
+
await Promise.all(updateCustomFields);
|
|
92
|
+
|
|
93
|
+
$.export("$summary", "Successfully created box");
|
|
94
|
+
return response;
|
|
95
|
+
},
|
|
96
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import streak from "../../streak.app.mjs";
|
|
2
|
+
|
|
3
|
+
const docLink = "https://streak.readme.io/reference/create-a-task";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
key: "streak-create-task",
|
|
7
|
+
name: "Create Task",
|
|
8
|
+
description: `Create a new task in a box. [See the docs](${docLink})`,
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
props: {
|
|
12
|
+
streak,
|
|
13
|
+
pipelineId: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
streak,
|
|
16
|
+
"pipelineId",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
boxId: {
|
|
20
|
+
propDefinition: [
|
|
21
|
+
streak,
|
|
22
|
+
"boxId",
|
|
23
|
+
(c) => ({
|
|
24
|
+
pipelineId: c.pipelineId,
|
|
25
|
+
}),
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
text: {
|
|
29
|
+
type: "string",
|
|
30
|
+
label: "Text",
|
|
31
|
+
description: "Task description",
|
|
32
|
+
},
|
|
33
|
+
dueDate: {
|
|
34
|
+
type: "integer",
|
|
35
|
+
label: "Due Date",
|
|
36
|
+
description: "Due date in Unix milliseconds timestamp",
|
|
37
|
+
optional: true,
|
|
38
|
+
},
|
|
39
|
+
assignees: {
|
|
40
|
+
propDefinition: [
|
|
41
|
+
streak,
|
|
42
|
+
"teamMembers",
|
|
43
|
+
(c) => ({
|
|
44
|
+
teamId: c.teamId,
|
|
45
|
+
}),
|
|
46
|
+
],
|
|
47
|
+
description: "The member(s) of your team this box will be assigned to",
|
|
48
|
+
optional: true,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
async run({ $ }) {
|
|
52
|
+
const response = await this.streak.createTask({
|
|
53
|
+
$,
|
|
54
|
+
boxId: this.boxId,
|
|
55
|
+
data: {
|
|
56
|
+
text: this.text,
|
|
57
|
+
dueDate: this.dueDate,
|
|
58
|
+
assignedToSharingEntries: this.assignees?.map((assignee) => ({
|
|
59
|
+
email: assignee,
|
|
60
|
+
})),
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
$.export("$summary", "Successfully created task");
|
|
64
|
+
return response;
|
|
65
|
+
},
|
|
66
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import streak from "../../streak.app.mjs";
|
|
2
|
+
|
|
3
|
+
const docLink = "https://streak.readme.io/reference/edit-a-box";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
key: "streak-link-boxes",
|
|
7
|
+
name: "Link Boxes",
|
|
8
|
+
description: `Link boxes to a specific box. [See the docs](${docLink})`,
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
props: {
|
|
12
|
+
streak,
|
|
13
|
+
pipelineId: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
streak,
|
|
16
|
+
"pipelineId",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
boxId: {
|
|
20
|
+
propDefinition: [
|
|
21
|
+
streak,
|
|
22
|
+
"boxId",
|
|
23
|
+
(c) => ({
|
|
24
|
+
pipelineId: c.pipelineId,
|
|
25
|
+
}),
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
boxes: {
|
|
29
|
+
propDefinition: [
|
|
30
|
+
streak,
|
|
31
|
+
"boxId",
|
|
32
|
+
(c) => ({
|
|
33
|
+
pipelineId: c.pipelineId,
|
|
34
|
+
previousBoxId: c.boxId,
|
|
35
|
+
}),
|
|
36
|
+
],
|
|
37
|
+
type: "string[]",
|
|
38
|
+
description: "The list of boxes you would like to link to the selected box",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
async run({ $ }) {
|
|
42
|
+
const response = await this.streak.updateBox({
|
|
43
|
+
$,
|
|
44
|
+
boxId: this.boxId,
|
|
45
|
+
data: {
|
|
46
|
+
linkedBoxKeys: this.boxes,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
$.export("$summary", "Successfully linked boxes");
|
|
50
|
+
return response;
|
|
51
|
+
},
|
|
52
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import streak from "../../streak.app.mjs";
|
|
2
|
+
|
|
3
|
+
const docLink = "https://streak.readme.io/reference/edit-a-box";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
key: "streak-update-box",
|
|
7
|
+
name: "Update Box",
|
|
8
|
+
description: `Update the properties for a box. To update field values use **Update Box Field Value**. [See the docs](${docLink})`,
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
props: {
|
|
12
|
+
streak,
|
|
13
|
+
pipelineId: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
streak,
|
|
16
|
+
"pipelineId",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
boxId: {
|
|
20
|
+
propDefinition: [
|
|
21
|
+
streak,
|
|
22
|
+
"boxId",
|
|
23
|
+
(c) => ({
|
|
24
|
+
pipelineId: c.pipelineId,
|
|
25
|
+
}),
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
name: {
|
|
29
|
+
type: "string",
|
|
30
|
+
label: "Name",
|
|
31
|
+
description: "Name of the box",
|
|
32
|
+
optional: true,
|
|
33
|
+
},
|
|
34
|
+
stage: {
|
|
35
|
+
propDefinition: [
|
|
36
|
+
streak,
|
|
37
|
+
"stage",
|
|
38
|
+
(c) => ({
|
|
39
|
+
pipelineId: c.pipelineId,
|
|
40
|
+
}),
|
|
41
|
+
],
|
|
42
|
+
optional: true,
|
|
43
|
+
},
|
|
44
|
+
notes: {
|
|
45
|
+
type: "string",
|
|
46
|
+
label: "Notes",
|
|
47
|
+
description: "The notes on the box",
|
|
48
|
+
optional: true,
|
|
49
|
+
},
|
|
50
|
+
teamId: {
|
|
51
|
+
propDefinition: [
|
|
52
|
+
streak,
|
|
53
|
+
"teamId",
|
|
54
|
+
],
|
|
55
|
+
optional: true,
|
|
56
|
+
},
|
|
57
|
+
assignees: {
|
|
58
|
+
propDefinition: [
|
|
59
|
+
streak,
|
|
60
|
+
"teamMembers",
|
|
61
|
+
(c) => ({
|
|
62
|
+
teamId: c.teamId,
|
|
63
|
+
}),
|
|
64
|
+
],
|
|
65
|
+
description: "The member(s) of your team this box will be assigned to",
|
|
66
|
+
optional: true,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
async run({ $ }) {
|
|
70
|
+
const response = await this.streak.updateBox({
|
|
71
|
+
$,
|
|
72
|
+
boxId: this.boxId,
|
|
73
|
+
data: {
|
|
74
|
+
name: this.name,
|
|
75
|
+
stageKey: this.stage,
|
|
76
|
+
notes: this.notes,
|
|
77
|
+
assignedToSharingEntries: this.assignees?.map((assignee) => ({
|
|
78
|
+
email: assignee,
|
|
79
|
+
})),
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
$.export("$summary", "Successfully updated box");
|
|
83
|
+
return response;
|
|
84
|
+
},
|
|
85
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import streak from "../../streak.app.mjs";
|
|
2
|
+
|
|
3
|
+
const docLink = "https://streak.readme.io/reference/update-field-value-for-a-box";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
key: "streak-update-box-field-value",
|
|
7
|
+
name: "Update Box Field Value",
|
|
8
|
+
description: `Update the values of the fields for a box. [See the docs](${docLink})`,
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
props: {
|
|
12
|
+
streak,
|
|
13
|
+
pipelineId: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
streak,
|
|
16
|
+
"pipelineId",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
boxId: {
|
|
20
|
+
propDefinition: [
|
|
21
|
+
streak,
|
|
22
|
+
"boxId",
|
|
23
|
+
(c) => ({
|
|
24
|
+
pipelineId: c.pipelineId,
|
|
25
|
+
}),
|
|
26
|
+
],
|
|
27
|
+
reloadProps: true,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
async additionalProps() {
|
|
31
|
+
const props = {};
|
|
32
|
+
const fields = await this.streak.listPipelineFields({
|
|
33
|
+
pipelineId: this.pipelineId,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const fieldValues = (await this.streak.listBoxFields({
|
|
37
|
+
boxId: this.boxId,
|
|
38
|
+
})).reduce((fields, x) => ({
|
|
39
|
+
...fields,
|
|
40
|
+
[x.key]: x.value,
|
|
41
|
+
}), {});
|
|
42
|
+
|
|
43
|
+
for (const field of fields) {
|
|
44
|
+
const prop = this.streak.customFieldToProp(field, fieldValues[field.key]);
|
|
45
|
+
props[`${this.boxId}_${field.key}`] = prop;
|
|
46
|
+
}
|
|
47
|
+
return props;
|
|
48
|
+
},
|
|
49
|
+
async run({ $ }) {
|
|
50
|
+
const updateCustomFields = Object.keys(this)
|
|
51
|
+
.filter((k) => k.includes(`${this.boxId}_`))
|
|
52
|
+
.map((k) => this.streak.updateFieldValue({
|
|
53
|
+
boxId: this.boxId,
|
|
54
|
+
fieldId: k.split(`${this.boxId}_`)[1],
|
|
55
|
+
value: this[k],
|
|
56
|
+
}));
|
|
57
|
+
await Promise.all(updateCustomFields);
|
|
58
|
+
|
|
59
|
+
$.export("$summary", "Successfully updated box fields");
|
|
60
|
+
return this.streak.getBox({
|
|
61
|
+
boxId: this.boxId,
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
};
|
package/package.json
CHANGED
package/streak.app.mjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
axios,
|
|
3
|
+
ConfigurationError,
|
|
4
|
+
} from "@pipedream/platform";
|
|
2
5
|
|
|
3
6
|
export default {
|
|
4
7
|
type: "app",
|
|
@@ -16,6 +19,20 @@ export default {
|
|
|
16
19
|
}));
|
|
17
20
|
},
|
|
18
21
|
},
|
|
22
|
+
pipelineFields: {
|
|
23
|
+
type: "string[]",
|
|
24
|
+
label: "Pipeline Custom Fields",
|
|
25
|
+
description: "Pipeline Custom Fields",
|
|
26
|
+
async options({ pipelineId }) {
|
|
27
|
+
const results = await this.listPipelineFields({
|
|
28
|
+
pipelineId,
|
|
29
|
+
});
|
|
30
|
+
return results.map((field) => ({
|
|
31
|
+
label: field.name,
|
|
32
|
+
value: field.key,
|
|
33
|
+
}));
|
|
34
|
+
},
|
|
35
|
+
},
|
|
19
36
|
teamId: {
|
|
20
37
|
type: "string",
|
|
21
38
|
label: "Team",
|
|
@@ -28,8 +45,111 @@ export default {
|
|
|
28
45
|
}));
|
|
29
46
|
},
|
|
30
47
|
},
|
|
48
|
+
boxId: {
|
|
49
|
+
type: "string",
|
|
50
|
+
label: "Box",
|
|
51
|
+
description: "Select a box",
|
|
52
|
+
async options({
|
|
53
|
+
pipelineId, previousBoxId,
|
|
54
|
+
}) {
|
|
55
|
+
const results = await this.listBoxes({
|
|
56
|
+
pipelineId,
|
|
57
|
+
});
|
|
58
|
+
return results
|
|
59
|
+
.filter((box) => box.key !== previousBoxId)
|
|
60
|
+
.map((box) => ({
|
|
61
|
+
label: box.name,
|
|
62
|
+
value: box.key,
|
|
63
|
+
}));
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
teamMembers: {
|
|
67
|
+
type: "string[]",
|
|
68
|
+
label: "Team Members",
|
|
69
|
+
description: "Team members",
|
|
70
|
+
async options({ teamId }) {
|
|
71
|
+
if (!teamId) {
|
|
72
|
+
throw new ConfigurationError("**Team** prop configuration required");
|
|
73
|
+
}
|
|
74
|
+
const { members } = await this.listTeamMembers({
|
|
75
|
+
teamId,
|
|
76
|
+
});
|
|
77
|
+
return members.map((member) => ({
|
|
78
|
+
label: member.fullName,
|
|
79
|
+
value: member.email,
|
|
80
|
+
}));
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
stage: {
|
|
84
|
+
type: "string",
|
|
85
|
+
label: "Stage",
|
|
86
|
+
description: "Stage of the box",
|
|
87
|
+
async options({ pipelineId }) {
|
|
88
|
+
const results = await this.listStages({
|
|
89
|
+
pipelineId,
|
|
90
|
+
});
|
|
91
|
+
return Object.entries(results).map(([
|
|
92
|
+
key,
|
|
93
|
+
value,
|
|
94
|
+
]) => ({
|
|
95
|
+
label: value.name,
|
|
96
|
+
value: key,
|
|
97
|
+
}));
|
|
98
|
+
},
|
|
99
|
+
},
|
|
31
100
|
},
|
|
32
101
|
methods: {
|
|
102
|
+
customFieldToProp(field, value) {
|
|
103
|
+
if (field.type === "TEXT_INPUT") {
|
|
104
|
+
return {
|
|
105
|
+
type: "string",
|
|
106
|
+
label: field.name,
|
|
107
|
+
default: value,
|
|
108
|
+
optional: true,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
if (field.type === "DATE") {
|
|
112
|
+
return {
|
|
113
|
+
type: "integer",
|
|
114
|
+
label: field.name,
|
|
115
|
+
description: "Date in Unix milliseconds timestamp",
|
|
116
|
+
default: value,
|
|
117
|
+
optional: true,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
if (field.type === "TAG") {
|
|
121
|
+
return {
|
|
122
|
+
type: "string[]",
|
|
123
|
+
label: field.name,
|
|
124
|
+
options: field.tagSettings.tags.map((x) => ({
|
|
125
|
+
label: x.tag,
|
|
126
|
+
value: x.key,
|
|
127
|
+
})),
|
|
128
|
+
default: value,
|
|
129
|
+
optional: true,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
if (field.type === "DROPDOWN") {
|
|
133
|
+
return {
|
|
134
|
+
type: "string",
|
|
135
|
+
label: field.name,
|
|
136
|
+
options: field.dropdownSettings.items.map((x) => ({
|
|
137
|
+
label: x.name,
|
|
138
|
+
value: x.key,
|
|
139
|
+
})),
|
|
140
|
+
default: value,
|
|
141
|
+
optional: true,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
if (field.type === "CHECKBOX") {
|
|
145
|
+
return {
|
|
146
|
+
type: "boolean",
|
|
147
|
+
label: field.name,
|
|
148
|
+
default: value,
|
|
149
|
+
optional: true,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
},
|
|
33
153
|
_getBaseUrl() {
|
|
34
154
|
return "https://www.streak.com/api/";
|
|
35
155
|
},
|
|
@@ -77,18 +197,58 @@ export default {
|
|
|
77
197
|
...args,
|
|
78
198
|
});
|
|
79
199
|
},
|
|
200
|
+
async getBox({
|
|
201
|
+
boxId, ...args
|
|
202
|
+
}) {
|
|
203
|
+
return this._makeRequest({
|
|
204
|
+
path: `v1/boxes/${boxId}`,
|
|
205
|
+
...args,
|
|
206
|
+
});
|
|
207
|
+
},
|
|
80
208
|
async listPipelines(args = {}) {
|
|
81
209
|
return this._makeRequest({
|
|
82
210
|
path: "v1/pipelines",
|
|
83
211
|
...args,
|
|
84
212
|
});
|
|
85
213
|
},
|
|
214
|
+
async listPipelineFields({
|
|
215
|
+
pipelineId, ...args
|
|
216
|
+
}) {
|
|
217
|
+
return this._makeRequest({
|
|
218
|
+
path: `v1/pipelines/${pipelineId}/fields`,
|
|
219
|
+
...args,
|
|
220
|
+
});
|
|
221
|
+
},
|
|
222
|
+
async listBoxFields({
|
|
223
|
+
boxId, ...args
|
|
224
|
+
}) {
|
|
225
|
+
return this._makeRequest({
|
|
226
|
+
path: `v1/boxes/${boxId}/fields`,
|
|
227
|
+
...args,
|
|
228
|
+
});
|
|
229
|
+
},
|
|
230
|
+
async listStages({
|
|
231
|
+
pipelineId, ...args
|
|
232
|
+
}) {
|
|
233
|
+
return this._makeRequest({
|
|
234
|
+
path: `v1/pipelines/${pipelineId}/stages`,
|
|
235
|
+
...args,
|
|
236
|
+
});
|
|
237
|
+
},
|
|
86
238
|
async listTeams(args = {}) {
|
|
87
239
|
return this._makeRequest({
|
|
88
240
|
path: "v2/users/me/teams",
|
|
89
241
|
...args,
|
|
90
242
|
});
|
|
91
243
|
},
|
|
244
|
+
async listTeamMembers({
|
|
245
|
+
teamId, ...args
|
|
246
|
+
}) {
|
|
247
|
+
return this._makeRequest({
|
|
248
|
+
path: `v2/teams/${teamId}`,
|
|
249
|
+
...args,
|
|
250
|
+
});
|
|
251
|
+
},
|
|
92
252
|
async listBoxes({
|
|
93
253
|
pipelineId, ...args
|
|
94
254
|
}) {
|
|
@@ -121,5 +281,44 @@ export default {
|
|
|
121
281
|
...args,
|
|
122
282
|
});
|
|
123
283
|
},
|
|
284
|
+
async createBox({
|
|
285
|
+
pipelineId, ...args
|
|
286
|
+
}) {
|
|
287
|
+
return this._makeRequest({
|
|
288
|
+
path: `v2/pipelines/${pipelineId}/boxes`,
|
|
289
|
+
method: "post",
|
|
290
|
+
...args,
|
|
291
|
+
});
|
|
292
|
+
},
|
|
293
|
+
async updateBox({
|
|
294
|
+
boxId, ...args
|
|
295
|
+
}) {
|
|
296
|
+
return this._makeRequest({
|
|
297
|
+
path: `v1/boxes/${boxId}`,
|
|
298
|
+
method: "post",
|
|
299
|
+
...args,
|
|
300
|
+
});
|
|
301
|
+
},
|
|
302
|
+
async updateFieldValue({
|
|
303
|
+
boxId, fieldId, value, ...args
|
|
304
|
+
}) {
|
|
305
|
+
return this._makeRequest({
|
|
306
|
+
...args,
|
|
307
|
+
path: `v1/boxes/${boxId}/fields/${fieldId}`,
|
|
308
|
+
method: "post",
|
|
309
|
+
data: {
|
|
310
|
+
value,
|
|
311
|
+
},
|
|
312
|
+
});
|
|
313
|
+
},
|
|
314
|
+
async createTask({
|
|
315
|
+
boxId, ...args
|
|
316
|
+
}) {
|
|
317
|
+
return this._makeRequest({
|
|
318
|
+
path: `v2/boxes/${boxId}/tasks`,
|
|
319
|
+
method: "post",
|
|
320
|
+
...args,
|
|
321
|
+
});
|
|
322
|
+
},
|
|
124
323
|
},
|
|
125
324
|
};
|