@pipedream/asana 0.3.3 → 0.3.5

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.
Files changed (39) hide show
  1. package/actions/add-task-to-section/add-task-to-section.mjs +79 -0
  2. package/actions/common/common.mjs +26 -0
  3. package/actions/common/constants.mjs +22 -0
  4. package/actions/create-project/create-project.mjs +142 -0
  5. package/actions/create-subtask/create-subtask.mjs +132 -0
  6. package/actions/create-task/create-task.mjs +147 -0
  7. package/actions/create-task-comment/create-task-comment.mjs +66 -0
  8. package/actions/delete-task/delete-task.mjs +34 -0
  9. package/actions/find-task-by-id/find-task-by-id.mjs +32 -0
  10. package/actions/search-projects/search-projects.mjs +50 -0
  11. package/actions/search-sections/search-sections.mjs +25 -0
  12. package/actions/search-tasks/search-tasks.mjs +74 -0
  13. package/actions/search-user-projects/search-user-projects.mjs +47 -0
  14. package/actions/update-task/update-task.mjs +125 -0
  15. package/asana.app.mjs +377 -0
  16. package/package.json +19 -19
  17. package/sources/common/common.mjs +75 -0
  18. package/sources/new-completed-task/new-completed-task.mjs +60 -0
  19. package/sources/new-project/new-project.mjs +50 -0
  20. package/sources/new-story/new-story.mjs +57 -0
  21. package/sources/new-subtask/new-subtask.mjs +72 -0
  22. package/sources/new-tag/new-tag.mjs +45 -0
  23. package/sources/new-task/new-task.mjs +56 -0
  24. package/sources/new-team/new-team.mjs +42 -0
  25. package/sources/new-user/new-user.mjs +50 -0
  26. package/sources/new-workspace/new-workspace.mjs +34 -0
  27. package/sources/tag-added-to-task/tag-added-to-task.mjs +71 -0
  28. package/sources/task-updated-in-project/task-updated-in-project.mjs +72 -0
  29. package/asana.app.js +0 -190
  30. package/sources/completed-task/completed-task.js +0 -76
  31. package/sources/new-project/new-project.js +0 -68
  32. package/sources/new-story/new-story.js +0 -75
  33. package/sources/new-subtask/new-subtask.js +0 -84
  34. package/sources/new-task-in-project/new-task-in-project.js +0 -75
  35. package/sources/new-team/new-team.js +0 -32
  36. package/sources/new-user/new-user.js +0 -68
  37. package/sources/new-workspace/new-workspace.js +0 -31
  38. package/sources/tag-added-to-task/tag-added-to-task.js +0 -84
  39. package/sources/updated-task-in-project/updated-task-in-project.js +0 -83
@@ -0,0 +1,79 @@
1
+ import asana from "../../asana.app.mjs";
2
+ import common from "../common/common.mjs";
3
+
4
+ export default {
5
+ name: "Add Task To Section",
6
+ description: "Add a task to a specific, existing section. This will remove the task from other sections of the project. [See the docs here](https://developers.asana.com/docs/add-task-to-section)",
7
+ key: "asana-add-task-to-section",
8
+ version: "0.2.0",
9
+ type: "action",
10
+ props: {
11
+ ...common.props,
12
+ task: {
13
+ label: "Task",
14
+ type: "string",
15
+ description: "The task to add to this section.",
16
+ propDefinition: [
17
+ asana,
18
+ "tasks",
19
+ (c) => ({
20
+ project: c.project,
21
+ }),
22
+ ],
23
+ },
24
+ section_gid: {
25
+ label: "Section GID",
26
+ type: "string",
27
+ description: "The globally unique identifier for the section.",
28
+ propDefinition: [
29
+ asana,
30
+ "sections",
31
+ (c) => ({
32
+ project: c.project,
33
+ }),
34
+ ],
35
+ },
36
+ insert_before: {
37
+ label: "Insert Before",
38
+ type: "string",
39
+ description: "An existing task within this section before which the added task should be inserted. Cannot be provided together with insert_after.",
40
+ optional: true,
41
+ propDefinition: [
42
+ asana,
43
+ "tasks",
44
+ (c) => ({
45
+ project: c.project,
46
+ }),
47
+ ],
48
+ },
49
+ insert_after: {
50
+ label: "Insert After",
51
+ type: "string",
52
+ description: "An existing task within this section after which the added task should be inserted. Cannot be provided together with insert_before.",
53
+ optional: true,
54
+ propDefinition: [
55
+ asana,
56
+ "tasks",
57
+ (c) => ({
58
+ project: c.project,
59
+ }),
60
+ ],
61
+ },
62
+ },
63
+ async run({ $ }) {
64
+ const response = await this.asana._makeRequest(`sections/${this.section_gid}/addTask`, {
65
+ method: "post",
66
+ data: {
67
+ data: {
68
+ task: this.task,
69
+ insert_before: this.insert_before,
70
+ insert_after: this.insert_after,
71
+ },
72
+ },
73
+ }, $);
74
+
75
+ $.export("$summary", "Successfully added task to section");
76
+
77
+ return response;
78
+ },
79
+ };
@@ -0,0 +1,26 @@
1
+ import asana from "../../asana.app.mjs";
2
+
3
+ export default {
4
+ props: {
5
+ asana,
6
+ workspace: {
7
+ label: "Workspace",
8
+ description: "Gid of a workspace.",
9
+ type: "string",
10
+ propDefinition: [
11
+ asana,
12
+ "workspaces",
13
+ ],
14
+ optional: true,
15
+ },
16
+ project: {
17
+ label: "Project",
18
+ type: "string",
19
+ propDefinition: [
20
+ asana,
21
+ "projects",
22
+ ],
23
+ optional: true,
24
+ },
25
+ },
26
+ };
@@ -0,0 +1,22 @@
1
+ export default {
2
+ COLORS: [
3
+ "dark-blue",
4
+ "dark-brown",
5
+ "dark-green",
6
+ "dark-orange",
7
+ "dark-pink",
8
+ "dark-purple",
9
+ "dark-red",
10
+ "dark-teal",
11
+ "dark-warm-gray",
12
+ "light-blue",
13
+ "light-green",
14
+ "light-orange",
15
+ "light-pink",
16
+ "light-purple",
17
+ "light-red",
18
+ "light-teal",
19
+ "light-warm-gray",
20
+ "light-yellow",
21
+ ],
22
+ };
@@ -0,0 +1,142 @@
1
+ import asana from "../../asana.app.mjs";
2
+ import constants from "../common/constants.mjs";
3
+
4
+ export default {
5
+ key: "asana-create-project",
6
+ name: "Create Project",
7
+ description: "Create a new project in a workspace or team. [See the docs here](https://developers.asana.com/docs/create-a-project)",
8
+ version: "0.9.0",
9
+ type: "action",
10
+ props: {
11
+ asana,
12
+ workspace: {
13
+ label: "Workspace",
14
+ description: "Gid of a workspace.",
15
+ type: "string",
16
+ propDefinition: [
17
+ asana,
18
+ "workspaces",
19
+ ],
20
+ },
21
+ name: {
22
+ label: "Name",
23
+ description: "Name of the project. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.",
24
+ type: "string",
25
+ },
26
+ notes: {
27
+ label: "Notes",
28
+ description: "Free-form textual information associated with the project (ie., its description).",
29
+ type: "string",
30
+ },
31
+ text: {
32
+ label: "Text",
33
+ description: "The text content of the status update.",
34
+ type: "string",
35
+ },
36
+ color: {
37
+ label: "Color",
38
+ description: "The color associated with the status update.",
39
+ type: "string",
40
+ options: constants.COLORS,
41
+ optional: true,
42
+ },
43
+ title: {
44
+ label: "Title",
45
+ description: "The title of the project status update.",
46
+ type: "string",
47
+ optional: true,
48
+ },
49
+ default_view: {
50
+ label: "Default View",
51
+ description: "The default view (list, board, calendar, or timeline) of a project.",
52
+ type: "string",
53
+ options: [
54
+ "list",
55
+ "board",
56
+ "calendar",
57
+ "timeline",
58
+ ],
59
+ default: "calendar",
60
+ optional: true,
61
+ },
62
+ public: {
63
+ label: "Public",
64
+ description: "True if the project is public to its team.",
65
+ type: "boolean",
66
+ optional: true,
67
+ default: false,
68
+ },
69
+ archived: {
70
+ label: "Archived",
71
+ description: "Archived projects do not show in the UI by default and may be treated differently for queries.",
72
+ type: "boolean",
73
+ optional: true,
74
+ default: false,
75
+ },
76
+ due_on: {
77
+ label: "Due On",
78
+ description: "The day on which this project is due. This takes a date with format YYYY-MM-DD.",
79
+ type: "string",
80
+ optional: true,
81
+ },
82
+ start_on: {
83
+ label: "Start On",
84
+ description: "The day on which work for this project begins. This takes a date with format YYYY-MM-DD. `Due On` must be present in the request when setting or unsetting the `Start On` parameter. Additionally, `Start On` and `Due On` cannot be the same date.",
85
+ type: "string",
86
+ optional: true,
87
+ },
88
+ followers: {
89
+ label: "Followers",
90
+ description: "Comma separated string of users. Followers are a subset of members who have opted in to receive \"tasks added\" notifications for a project.",
91
+ type: "string[]",
92
+ optional: true,
93
+ propDefinition: [
94
+ asana,
95
+ "users",
96
+ ],
97
+ },
98
+ html_notes: {
99
+ label: "HTML Notes",
100
+ description: "The notes of the project with formatting as HTML.",
101
+ type: "string",
102
+ optional: true,
103
+ },
104
+ owner: {
105
+ label: "Owner",
106
+ description: "The current owner of the project.",
107
+ type: "string",
108
+ optional: true,
109
+ propDefinition: [
110
+ asana,
111
+ "users",
112
+ ],
113
+ },
114
+ },
115
+ async run({ $ }) {
116
+ const response = await this.asana._makeRequest("projects", {
117
+ method: "post",
118
+ data: {
119
+ data: {
120
+ name: this.name,
121
+ notes: this.notes,
122
+ text: this.text,
123
+ color: this.color,
124
+ workspace: this.workspace,
125
+ default_view: this.default_view,
126
+ title: this.title,
127
+ public: this.public,
128
+ archived: this.archived,
129
+ due_on: this.due_on,
130
+ start_on: this.start_on,
131
+ followers: this.followers,
132
+ html_notes: this.html_notes,
133
+ owner: this.owner,
134
+ },
135
+ },
136
+ }, $);
137
+
138
+ $.export("$summary", "Successfully created project");
139
+
140
+ return response;
141
+ },
142
+ };
@@ -0,0 +1,132 @@
1
+ import asana from "../../asana.app.mjs";
2
+ import common from "../common/common.mjs";
3
+
4
+ export default {
5
+ key: "asana-create-subtask",
6
+ name: "Create Subtask",
7
+ description: "Creates a new subtask and adds it to the parent task. [See the docs here](https://developers.asana.com/docs/create-a-subtask)",
8
+ version: "0.3.0",
9
+ type: "action",
10
+ props: {
11
+ ...common.props,
12
+ task_gid: {
13
+ label: "Task GID",
14
+ description: "The task GID to operate on.",
15
+ type: "string",
16
+ propDefinition: [
17
+ asana,
18
+ "tasks",
19
+ (c) => ({
20
+ project: c.project,
21
+ }),
22
+ ],
23
+ },
24
+ name: {
25
+ label: "Name",
26
+ description: "Name of the subtask. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.",
27
+ type: "string",
28
+ },
29
+ assignee: {
30
+ label: "Assignee",
31
+ description: "Gid of a user.",
32
+ type: "string",
33
+ optional: true,
34
+ propDefinition: [
35
+ asana,
36
+ "users",
37
+ ],
38
+ },
39
+ assignee_section: {
40
+ label: "Assignee Section",
41
+ description: "The assignee section is a subdivision of a project that groups tasks together in the assignee's \"My Tasks\" list.",
42
+ type: "string",
43
+ optional: true,
44
+ propDefinition: [
45
+ asana,
46
+ "sections",
47
+ (c) => ({
48
+ project: c.project,
49
+ }),
50
+ ],
51
+ },
52
+ completed: {
53
+ label: "Completed",
54
+ description: "True if the task is currently marked complete, false if not.",
55
+ type: "boolean",
56
+ optional: true,
57
+ },
58
+ due_at: {
59
+ label: "Due At",
60
+ description: "The UTC date and time on which this task is due, or null if the task has no due time. This takes an ISO 8601 date string in UTC and should not be used together with due_on.",
61
+ type: "string",
62
+ optional: true,
63
+ },
64
+ due_on: {
65
+ label: "Due On",
66
+ description: "The localized date on which this task is due, or null if the task has no due date. This takes a date with YYYY-MM-DD format and should not be used together with due_at.",
67
+ type: "string",
68
+ optional: true,
69
+ },
70
+ followers: {
71
+ label: "Followers",
72
+ description: "An array of strings identifying users. These can either be the string \"me\", an email, or the gid of a user.",
73
+ type: "string[]",
74
+ optional: true,
75
+ propDefinition: [
76
+ asana,
77
+ "users",
78
+ ],
79
+ },
80
+ html_notes: {
81
+ label: "HTML Notes",
82
+ description: "The notes of the text with formatting as HTML.",
83
+ type: "string",
84
+ optional: true,
85
+ },
86
+ notes: {
87
+ label: "Notes",
88
+ description: "Free-form textual information associated with the task (i.e. its description).",
89
+ type: "string",
90
+ optional: true,
91
+ },
92
+ start_on: {
93
+ label: "Start On",
94
+ description: "The day on which work begins for the task , or null if the task has no start date. This takes a date with YYYY-MM-DD format.",
95
+ type: "string",
96
+ optional: true,
97
+ },
98
+ tags: {
99
+ propDefinition: [
100
+ asana,
101
+ "tags",
102
+ ],
103
+ optional: true,
104
+ },
105
+ },
106
+ async run({ $ }) {
107
+ const response = await this.asana._makeRequest(`tasks/${this.task_gid}/subtasks`, {
108
+ method: "post",
109
+ data: {
110
+ data: {
111
+ name: this.name,
112
+ assignee: this.assignee,
113
+ assignee_section: this.assignee_section,
114
+ completed: this.completed,
115
+ due_at: this.due_at,
116
+ due_on: this.due_on,
117
+ followers: this.followers,
118
+ html_notes: this.html_notes,
119
+ notes: this.notes,
120
+ projects: this.project,
121
+ start_on: this.start_on,
122
+ tags: this.tags,
123
+ workspace: this.workspace,
124
+ },
125
+ },
126
+ }, $);
127
+
128
+ $.export("$summary", "Successfully created subtask");
129
+
130
+ return response;
131
+ },
132
+ };
@@ -0,0 +1,147 @@
1
+ import asana from "../../asana.app.mjs";
2
+ import common from "../common/common.mjs";
3
+
4
+ export default {
5
+ key: "asana-create-task",
6
+ name: "Create Task",
7
+ description: "Creates a new task. [See the docs here](https://developers.asana.com/docs/create-a-task)",
8
+ version: "0.3.0",
9
+ type: "action",
10
+ props: {
11
+ ...common.props,
12
+ name: {
13
+ label: "Name",
14
+ description: "Name of the task. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.",
15
+ type: "string",
16
+ },
17
+ tags: {
18
+ propDefinition: [
19
+ asana,
20
+ "tags",
21
+ ],
22
+ optional: true,
23
+ },
24
+ assignee: {
25
+ label: "Assignee",
26
+ description: "Gid of a user.",
27
+ type: "string",
28
+ optional: true,
29
+ propDefinition: [
30
+ asana,
31
+ "users",
32
+ ],
33
+ },
34
+ assignee_section: {
35
+ label: "Assignee Section",
36
+ description: "The assignee section is a subdivision of a project that groups tasks together in the assignee's \"My Tasks\" list.",
37
+ type: "string",
38
+ optional: true,
39
+ propDefinition: [
40
+ asana,
41
+ "sections",
42
+ (c) => ({
43
+ project: c.project,
44
+ }),
45
+ ],
46
+ },
47
+ completed: {
48
+ label: "Completed",
49
+ description: "True if the task is currently marked complete, false if not.",
50
+ type: "boolean",
51
+ optional: true,
52
+ },
53
+ due_at: {
54
+ label: "Due At",
55
+ description: "The UTC date and time on which this task is due, or null if the task has no due time. This takes an ISO 8601 date string in UTC and should not be used together with due_on.",
56
+ type: "string",
57
+ optional: true,
58
+ },
59
+ due_on: {
60
+ label: "Due On",
61
+ description: "The localized date on which this task is due, or null if the task has no due date. This takes a date with YYYY-MM-DD format and should not be used together with due_at.",
62
+ type: "string",
63
+ optional: true,
64
+ },
65
+ followers: {
66
+ label: "Followers",
67
+ description: "An array of strings identifying users. These can either be the string \"me\", an email, or the gid of a user.",
68
+ type: "string[]",
69
+ optional: true,
70
+ propDefinition: [
71
+ asana,
72
+ "users",
73
+ ],
74
+ },
75
+ html_notes: {
76
+ label: "HTML Notes",
77
+ description: "The notes of the text with formatting as HTML.",
78
+ type: "string",
79
+ optional: true,
80
+ },
81
+ notes: {
82
+ label: "Notes",
83
+ description: "Free-form textual information associated with the task (i.e. its description).",
84
+ type: "string",
85
+ optional: true,
86
+ },
87
+ parent: {
88
+ label: "Parent",
89
+ description: "Gid of a task.",
90
+ type: "string",
91
+ optional: true,
92
+ propDefinition: [
93
+ asana,
94
+ "tasks",
95
+ (c) => ({
96
+ project: c.project,
97
+ }),
98
+ ],
99
+ },
100
+ start_on: {
101
+ label: "Start On",
102
+ description: "The day on which work begins for the task , or null if the task has no start date. This takes a date with YYYY-MM-DD format.",
103
+ type: "string",
104
+ optional: true,
105
+ },
106
+ custom_fields: {
107
+ label: "Custom Fields",
108
+ description: `An object where each key is a Custom Field gid and each value is an enum gid, string, or number: E.g. {
109
+ "4578152156": "Not Started",
110
+ "5678904321": "On Hold"
111
+ }`,
112
+ type: "string",
113
+ optional: true,
114
+ },
115
+ },
116
+ async run({ $ }) {
117
+ let customFields;
118
+ if (this.custom_fields) customFields = JSON.parse(this.custom_fields);
119
+
120
+ const response = await this.asana._makeRequest("tasks", {
121
+ method: "post",
122
+ data: {
123
+ data: {
124
+ name: this.name,
125
+ assignee: this.assignee,
126
+ assignee_section: this.assignee_section,
127
+ completed: this.completed,
128
+ due_at: this.due_at,
129
+ due_on: this.due_on,
130
+ followers: this.followers,
131
+ html_notes: this.html_notes,
132
+ notes: this.notes,
133
+ parent: this.parent,
134
+ projects: this.project,
135
+ start_on: this.start_on,
136
+ tags: this.tags,
137
+ workspace: this.workspace,
138
+ custom_fields: customFields,
139
+ },
140
+ },
141
+ }, $);
142
+
143
+ $.export("$summary", "Successfully created task");
144
+
145
+ return response;
146
+ },
147
+ };
@@ -0,0 +1,66 @@
1
+ import asana from "../../asana.app.mjs";
2
+ import common from "../common/common.mjs";
3
+
4
+ export default {
5
+ key: "asana-create-task-comment",
6
+ name: "Create Task Comment",
7
+ description: "Adds a comment to a task. [See the docs here](https://developers.asana.com/docs/create-a-story-on-a-task)",
8
+ version: "0.2.0",
9
+ type: "action",
10
+ props: {
11
+ ...common.props,
12
+ task_gid: {
13
+ label: "Task GID",
14
+ description: "The task GID to operate on.",
15
+ type: "string",
16
+ propDefinition: [
17
+ asana,
18
+ "tasks",
19
+ (c) => ({
20
+ project: c.project,
21
+ }),
22
+ ],
23
+ },
24
+ text: {
25
+ label: "Text",
26
+ description: "The plain text of the comment to add. Cannot be used with html_text.",
27
+ type: "string",
28
+ optional: true,
29
+ },
30
+ html_text: {
31
+ label: "HTML Text",
32
+ description: "HTML formatted text for a comment. This will not include the name of the creator.",
33
+ type: "string",
34
+ optional: true,
35
+ },
36
+ is_pinned: {
37
+ label: "Is Pinned",
38
+ description: "Conditional. Whether the story should be pinned on the resource.",
39
+ type: "boolean",
40
+ optional: true,
41
+ },
42
+ sticker_name: {
43
+ label: "Sticker Name",
44
+ description: "The name of the sticker in this story. null if there is no sticker.",
45
+ type: "string",
46
+ optional: true,
47
+ },
48
+ },
49
+ async run({ $ }) {
50
+ const response = await this.asana._makeRequest(`tasks/${this.task_gid}/stories`, {
51
+ method: "post",
52
+ data: {
53
+ data: {
54
+ text: this.text,
55
+ html_text: this.html_text,
56
+ is_pinned: this.is_pinned,
57
+ sticker_name: this.sticker_name,
58
+ },
59
+ },
60
+ }, $);
61
+
62
+ $.export("$summary", "Successfully created task comment");
63
+
64
+ return response;
65
+ },
66
+ };
@@ -0,0 +1,34 @@
1
+ import asana from "../../asana.app.mjs";
2
+ import common from "../common/common.mjs";
3
+
4
+ export default {
5
+ key: "asana-delete-task",
6
+ name: "Delete Task",
7
+ description: "Deletes a specific and existing task. [See the docs here](https://developers.asana.com/docs/delete-a-task)",
8
+ version: "0.0.1",
9
+ type: "action",
10
+ props: {
11
+ ...common.props,
12
+ task_gid: {
13
+ label: "Task GID",
14
+ description: "The ID of the task to delete.",
15
+ type: "string",
16
+ propDefinition: [
17
+ asana,
18
+ "tasks",
19
+ (c) => ({
20
+ project: c.project,
21
+ }),
22
+ ],
23
+ },
24
+ },
25
+ async run({ $ }) {
26
+ const response = await this.asana._makeRequest(`tasks/${this.task_gid}`, {
27
+ method: "delete",
28
+ }, $);
29
+
30
+ $.export("$summary", "Successfully deleted task");
31
+
32
+ return response;
33
+ },
34
+ };
@@ -0,0 +1,32 @@
1
+ import asana from "../../asana.app.mjs";
2
+ import common from "../common/common.mjs";
3
+
4
+ export default {
5
+ key: "asana-find-task-by-id",
6
+ name: "Find Task by ID",
7
+ description: "Searches for a task by id. Returns the complete task record for a single task. [See the docs here](https://developers.asana.com/docs/get-a-task)",
8
+ version: "0.2.0",
9
+ type: "action",
10
+ props: {
11
+ ...common.props,
12
+ task_gid: {
13
+ label: "Task GID",
14
+ description: "The ID of the task to update.",
15
+ type: "string",
16
+ propDefinition: [
17
+ asana,
18
+ "tasks",
19
+ (c) => ({
20
+ project: c.project,
21
+ }),
22
+ ],
23
+ },
24
+ },
25
+ async run({ $ }) {
26
+ const response = await this.asana.getTask(this.task_gid, $);
27
+
28
+ $.export("$summary", "Successfully retrieved task");
29
+
30
+ return response;
31
+ },
32
+ };