@pipedream/zendesk 0.12.0 → 0.13.0

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 (33) hide show
  1. package/actions/add-ticket-tags/add-ticket-tags.mjs +1 -1
  2. package/actions/create-ticket/create-ticket.mjs +1 -1
  3. package/actions/delete-ticket/delete-ticket.mjs +1 -1
  4. package/actions/get-article/get-article.mjs +1 -1
  5. package/actions/get-macro/get-macro.mjs +1 -1
  6. package/actions/get-ticket-info/get-ticket-info.mjs +1 -1
  7. package/actions/get-user-info/get-user-info.mjs +1 -1
  8. package/actions/list-active-macros/list-active-macros.mjs +1 -1
  9. package/actions/list-articles/list-articles.mjs +1 -1
  10. package/actions/list-locales/list-locales.mjs +1 -1
  11. package/actions/list-macros/list-macros.mjs +1 -1
  12. package/actions/list-ticket-comments/list-ticket-comments.mjs +1 -1
  13. package/actions/list-tickets/list-tickets.mjs +1 -1
  14. package/actions/remove-ticket-tags/remove-ticket-tags.mjs +1 -1
  15. package/actions/search-articles/search-articles.mjs +206 -0
  16. package/actions/search-community-posts/search-community-posts.mjs +145 -0
  17. package/actions/search-help-center/search-help-center.mjs +145 -0
  18. package/actions/search-macros/search-macros.mjs +1 -1
  19. package/actions/search-tickets/search-tickets.mjs +1 -1
  20. package/actions/set-custom-ticket-fields/set-custom-ticket-fields.mjs +1 -1
  21. package/actions/set-ticket-tags/set-ticket-tags.mjs +1 -1
  22. package/actions/update-ticket/update-ticket.mjs +1 -1
  23. package/common/utils.mjs +17 -0
  24. package/package.json +1 -1
  25. package/sources/locale-updated/locale-updated.mjs +1 -1
  26. package/sources/new-ticket/new-ticket.mjs +1 -1
  27. package/sources/new-ticket-comment-added/new-ticket-comment-added.mjs +1 -1
  28. package/sources/ticket-added-to-view/ticket-added-to-view.mjs +1 -1
  29. package/sources/ticket-closed/ticket-closed.mjs +1 -1
  30. package/sources/ticket-pended/ticket-pended.mjs +1 -1
  31. package/sources/ticket-solved/ticket-solved.mjs +1 -1
  32. package/sources/ticket-updated/ticket-updated.mjs +1 -1
  33. package/zendesk.app.mjs +153 -0
@@ -5,7 +5,7 @@ export default {
5
5
  name: "Add Ticket Tags",
6
6
  description: "Add tags to a ticket (appends to existing tags). [See the documentation](https://developer.zendesk.com/api-reference/ticketing/ticket-management/tags/#add-tags).",
7
7
  type: "action",
8
- version: "0.0.8",
8
+ version: "0.0.9",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  name: "Create Ticket",
6
6
  description: "Creates a ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#create-ticket).",
7
7
  type: "action",
8
- version: "0.1.12",
8
+ version: "0.1.13",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  name: "Delete Ticket",
6
6
  description: "Deletes a ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#delete-ticket).",
7
7
  type: "action",
8
- version: "0.1.12",
8
+ version: "0.1.13",
9
9
  annotations: {
10
10
  destructiveHint: true,
11
11
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  name: "Get Article",
6
6
  description: "Retrieves an article by its ID. [See the documentation](https://developer.zendesk.com/api-reference/help_center/help-center-api/articles/#show-article).",
7
7
  type: "action",
8
- version: "0.0.2",
8
+ version: "0.0.3",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  name: "Get Macro",
6
6
  description: "Retrieves a macro by its ID. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#show-macro).",
7
7
  type: "action",
8
- version: "0.0.2",
8
+ version: "0.0.3",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  name: "Get Ticket Info",
6
6
  description: "Retrieves information about a specific ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#show-ticket).",
7
7
  type: "action",
8
- version: "0.0.10",
8
+ version: "0.0.11",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "zendesk-get-user-info",
5
5
  name: "Get User Info",
6
6
  description: "Retrieves information about a specific user. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/users/users/#show-user).",
7
- version: "0.0.7",
7
+ version: "0.0.8",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -6,7 +6,7 @@ export default {
6
6
  name: "List Active Macros",
7
7
  description: "Lists all active shared and personal macros available to the current user. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#list-active-macros).",
8
8
  type: "action",
9
- version: "0.0.2",
9
+ version: "0.0.3",
10
10
  annotations: {
11
11
  destructiveHint: false,
12
12
  openWorldHint: true,
@@ -6,7 +6,7 @@ export default {
6
6
  name: "List Articles",
7
7
  description: "Retrieves a list of articles. [See the documentation](https://developer.zendesk.com/api-reference/help_center/help-center-api/articles/#list-articles).",
8
8
  type: "action",
9
- version: "0.0.2",
9
+ version: "0.0.3",
10
10
  annotations: {
11
11
  destructiveHint: false,
12
12
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "zendesk-list-locales",
5
5
  name: "List Locales",
6
6
  description: "Retrieves all locales. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/account-configuration/locales/).",
7
- version: "0.0.7",
7
+ version: "0.0.8",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "zendesk-list-macros",
5
5
  name: "List Macros",
6
6
  description: "Retrieves all macros. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#list-macros).",
7
- version: "0.0.7",
7
+ version: "0.0.8",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "zendesk-list-ticket-comments",
5
5
  name: "List Ticket Comments",
6
6
  description: "Retrieves all comments for a specific ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_comments/#list-comments).",
7
- version: "0.0.7",
7
+ version: "0.0.8",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  name: "List Tickets",
6
6
  description: "Retrieves a list of tickets. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#list-tickets).",
7
7
  type: "action",
8
- version: "0.0.10",
8
+ version: "0.0.11",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  name: "Remove Ticket Tags",
6
6
  description: "Remove specific tags from a ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/ticket-management/tags/#remove-tags).",
7
7
  type: "action",
8
- version: "0.0.8",
8
+ version: "0.0.9",
9
9
  annotations: {
10
10
  destructiveHint: true,
11
11
  openWorldHint: true,
@@ -0,0 +1,206 @@
1
+ import app from "../../zendesk.app.mjs";
2
+ import { toCommaSeparated } from "../../common/utils.mjs";
3
+
4
+ export default {
5
+ key: "zendesk-search-articles",
6
+ name: "Search Articles",
7
+ description: "Searches Help Center articles. [See the documentation](https://developer.zendesk.com/api-reference/help_center/help-center-api/search/).",
8
+ type: "action",
9
+ version: "0.0.1",
10
+ annotations: {
11
+ destructiveHint: false,
12
+ openWorldHint: true,
13
+ readOnlyHint: true,
14
+ },
15
+ props: {
16
+ app,
17
+ // eslint-disable-next-line pipedream/props-label, pipedream/props-description
18
+ alert: {
19
+ type: "alert",
20
+ alertType: "warning",
21
+ content: "At least one of **Query**, **Category**, **Section**, or **Label Names** must be provided.",
22
+ },
23
+ query: {
24
+ type: "string",
25
+ label: "Search Query",
26
+ description: "The search text to match (e.g. `carrot potato`). At least one of this, **Category**, **Section**, or **Label Names** must be provided.",
27
+ optional: true,
28
+ },
29
+ locale: {
30
+ propDefinition: [
31
+ app,
32
+ "locale",
33
+ ],
34
+ description: "Search for articles in the specified locale (e.g. `en-us`). Use `*` to search across all valid locales. Defaults to the Help Center's default locale if omitted or invalid.",
35
+ optional: true,
36
+ },
37
+ articleCategoryId: {
38
+ propDefinition: [
39
+ app,
40
+ "articleCategoryId",
41
+ ],
42
+ type: "string[]",
43
+ label: "Category",
44
+ description: "Limit results to articles in these categories. Accepts one or more category IDs.",
45
+ optional: true,
46
+ },
47
+ sectionId: {
48
+ propDefinition: [
49
+ app,
50
+ "sectionId",
51
+ ],
52
+ type: "string[]",
53
+ label: "Section",
54
+ description: "Limit results to articles in these sections. Accepts one or more section IDs.",
55
+ optional: true,
56
+ },
57
+ labelNames: {
58
+ propDefinition: [
59
+ app,
60
+ "labelName",
61
+ ],
62
+ type: "string[]",
63
+ label: "Label Names",
64
+ description: "Filter articles by label names. An article must have at least one of the labels to match. Matching is case-insensitive. Only available on Professional and Enterprise plans.",
65
+ },
66
+ brandId: {
67
+ propDefinition: [
68
+ app,
69
+ "brandId",
70
+ ],
71
+ description: "Limit results to articles in the specified brand. If **Multibrand** is also set, results are still scoped to this brand.",
72
+ },
73
+ multibrand: {
74
+ type: "boolean",
75
+ label: "Multibrand",
76
+ description: "If `true`, search returns results from all brands. If **Brand ID** is also set, results are scoped to that brand regardless of this setting.",
77
+ optional: true,
78
+ },
79
+ sortBy: {
80
+ type: "string",
81
+ label: "Sort By",
82
+ description: "Sort results by `created_at` or `updated_at`. Defaults to sorting by relevance.",
83
+ optional: true,
84
+ options: [
85
+ "created_at",
86
+ "updated_at",
87
+ ],
88
+ },
89
+ sortOrder: {
90
+ type: "string",
91
+ label: "Sort Order",
92
+ description: "Sort direction. Defaults to `desc`.",
93
+ optional: true,
94
+ options: [
95
+ "asc",
96
+ "desc",
97
+ ],
98
+ },
99
+ createdBefore: {
100
+ type: "string",
101
+ label: "Created Before",
102
+ description: "Limit results to articles created before this date (format `YYYY-MM-DD`).",
103
+ optional: true,
104
+ },
105
+ createdAfter: {
106
+ type: "string",
107
+ label: "Created After",
108
+ description: "Limit results to articles created after this date (format `YYYY-MM-DD`).",
109
+ optional: true,
110
+ },
111
+ createdAt: {
112
+ type: "string",
113
+ label: "Created At",
114
+ description: "Limit results to articles created on this date (format `YYYY-MM-DD`).",
115
+ optional: true,
116
+ },
117
+ updatedBefore: {
118
+ type: "string",
119
+ label: "Updated Before",
120
+ description: "Limit results to articles updated before this date (format `YYYY-MM-DD`). Note: only content-meaningful updates are re-indexed.",
121
+ optional: true,
122
+ },
123
+ updatedAfter: {
124
+ type: "string",
125
+ label: "Updated After",
126
+ description: "Limit results to articles updated after this date (format `YYYY-MM-DD`). Note: only content-meaningful updates are re-indexed.",
127
+ optional: true,
128
+ },
129
+ updatedAt: {
130
+ type: "string",
131
+ label: "Updated At",
132
+ description: "Limit results to articles updated on this date (format `YYYY-MM-DD`).",
133
+ optional: true,
134
+ },
135
+ limit: {
136
+ type: "integer",
137
+ label: "Per Page",
138
+ description: "Number of results per page. Between 1 and 100. Default is 25.",
139
+ optional: true,
140
+ default: 25,
141
+ },
142
+ page: {
143
+ type: "integer",
144
+ label: "Page",
145
+ description: "Page number to retrieve. Must be greater than 0. Default is 1.",
146
+ optional: true,
147
+ default: 1,
148
+ },
149
+ customSubdomain: {
150
+ propDefinition: [
151
+ app,
152
+ "customSubdomain",
153
+ ],
154
+ },
155
+ },
156
+ async run({ $: step }) {
157
+ const {
158
+ query,
159
+ locale,
160
+ articleCategoryId,
161
+ sectionId,
162
+ labelNames,
163
+ brandId,
164
+ multibrand,
165
+ sortBy,
166
+ sortOrder,
167
+ createdBefore,
168
+ createdAfter,
169
+ createdAt,
170
+ updatedBefore,
171
+ updatedAfter,
172
+ updatedAt,
173
+ limit,
174
+ page,
175
+ customSubdomain,
176
+ } = this;
177
+
178
+ const results = await this.app.searchArticles({
179
+ step,
180
+ customSubdomain,
181
+ params: {
182
+ query,
183
+ locale,
184
+ category: toCommaSeparated(articleCategoryId),
185
+ section: toCommaSeparated(sectionId),
186
+ label_names: toCommaSeparated(labelNames),
187
+ brand_id: brandId,
188
+ multibrand,
189
+ sort_by: sortBy,
190
+ sort_order: sortOrder,
191
+ created_before: createdBefore,
192
+ created_after: createdAfter,
193
+ created_at: createdAt,
194
+ updated_before: updatedBefore,
195
+ updated_after: updatedAfter,
196
+ updated_at: updatedAt,
197
+ per_page: limit,
198
+ page,
199
+ },
200
+ });
201
+
202
+ step.export("$summary", `Successfully retrieved ${results.results?.length ?? 0} article(s)`);
203
+
204
+ return results;
205
+ },
206
+ };
@@ -0,0 +1,145 @@
1
+ import app from "../../zendesk.app.mjs";
2
+
3
+ export default {
4
+ key: "zendesk-search-community-posts",
5
+ name: "Search Community Posts",
6
+ description: "Searches Help Center community posts. [See the documentation](https://developer.zendesk.com/api-reference/help_center/help-center-api/search/).",
7
+ type: "action",
8
+ version: "0.0.1",
9
+ annotations: {
10
+ destructiveHint: false,
11
+ openWorldHint: true,
12
+ readOnlyHint: true,
13
+ },
14
+ props: {
15
+ app,
16
+ query: {
17
+ type: "string",
18
+ label: "Search Query",
19
+ description: "The search text to match (e.g. `carrot potato`).",
20
+ },
21
+ topicId: {
22
+ propDefinition: [
23
+ app,
24
+ "topicId",
25
+ ],
26
+ description: "Limit results to posts in the specified community topic.",
27
+ },
28
+ sortBy: {
29
+ type: "string",
30
+ label: "Sort By",
31
+ description: "Sort results by `created_at` or `updated_at`. Defaults to sorting by relevance.",
32
+ optional: true,
33
+ options: [
34
+ "created_at",
35
+ "updated_at",
36
+ ],
37
+ },
38
+ sortOrder: {
39
+ type: "string",
40
+ label: "Sort Order",
41
+ description: "Sort direction. Defaults to `desc`.",
42
+ optional: true,
43
+ options: [
44
+ "asc",
45
+ "desc",
46
+ ],
47
+ },
48
+ createdBefore: {
49
+ type: "string",
50
+ label: "Created Before",
51
+ description: "Limit results to posts created before this date (format `YYYY-MM-DD`).",
52
+ optional: true,
53
+ },
54
+ createdAfter: {
55
+ type: "string",
56
+ label: "Created After",
57
+ description: "Limit results to posts created after this date (format `YYYY-MM-DD`).",
58
+ optional: true,
59
+ },
60
+ createdAt: {
61
+ type: "string",
62
+ label: "Created At",
63
+ description: "Limit results to posts created on this date (format `YYYY-MM-DD`).",
64
+ optional: true,
65
+ },
66
+ updatedBefore: {
67
+ type: "string",
68
+ label: "Updated Before",
69
+ description: "Limit results to posts updated before this date (format `YYYY-MM-DD`).",
70
+ optional: true,
71
+ },
72
+ updatedAfter: {
73
+ type: "string",
74
+ label: "Updated After",
75
+ description: "Limit results to posts updated after this date (format `YYYY-MM-DD`).",
76
+ optional: true,
77
+ },
78
+ updatedAt: {
79
+ type: "string",
80
+ label: "Updated At",
81
+ description: "Limit results to posts updated on this date (format `YYYY-MM-DD`).",
82
+ optional: true,
83
+ },
84
+ limit: {
85
+ type: "integer",
86
+ label: "Per Page",
87
+ description: "Number of results per page. Between 1 and 100. Default is 25.",
88
+ optional: true,
89
+ default: 25,
90
+ },
91
+ page: {
92
+ type: "integer",
93
+ label: "Page",
94
+ description: "Page number to retrieve. Must be greater than 0. Offset pagination is limited to the first 100 pages (10,000 records) — requests beyond this will return a 400 error. Default is 1.",
95
+ optional: true,
96
+ default: 1,
97
+ },
98
+ customSubdomain: {
99
+ propDefinition: [
100
+ app,
101
+ "customSubdomain",
102
+ ],
103
+ },
104
+ },
105
+ async run({ $: step }) {
106
+ const {
107
+ query,
108
+ topicId,
109
+ sortBy,
110
+ sortOrder,
111
+ createdBefore,
112
+ createdAfter,
113
+ createdAt,
114
+ updatedBefore,
115
+ updatedAfter,
116
+ updatedAt,
117
+ limit,
118
+ page,
119
+ customSubdomain,
120
+ } = this;
121
+
122
+ const results = await this.app.searchCommunityPosts({
123
+ step,
124
+ customSubdomain,
125
+ params: {
126
+ query,
127
+ topic: topicId,
128
+ sort_by: sortBy,
129
+ sort_order: sortOrder,
130
+ created_before: createdBefore,
131
+ created_after: createdAfter,
132
+ created_at: createdAt,
133
+ updated_before: updatedBefore,
134
+ updated_after: updatedAfter,
135
+ updated_at: updatedAt,
136
+ per_page: limit,
137
+ page,
138
+ },
139
+ });
140
+
141
+ step.export("$summary", `Successfully retrieved ${results.results?.length ?? 0} community post(s)`);
142
+
143
+ return results;
144
+ },
145
+ };
@@ -0,0 +1,145 @@
1
+ import app from "../../zendesk.app.mjs";
2
+ import { toCommaSeparated } from "../../common/utils.mjs";
3
+
4
+ export default {
5
+ key: "zendesk-search-help-center",
6
+ name: "Search Help Center",
7
+ description: "Searches across knowledge base articles, community posts, and external records using the Zendesk unified Guide search. [See the documentation](https://developer.zendesk.com/api-reference/help_center/help-center-api/search/).",
8
+ type: "action",
9
+ version: "0.0.1",
10
+ annotations: {
11
+ destructiveHint: false,
12
+ openWorldHint: true,
13
+ readOnlyHint: true,
14
+ },
15
+ props: {
16
+ app,
17
+ locales: {
18
+ propDefinition: [
19
+ app,
20
+ "locale",
21
+ ],
22
+ type: "string[]",
23
+ label: "Locales",
24
+ description: "Required. One or more locales to search in (e.g. `en-us`, `en-gb`). If an invalid or disabled locale is specified, no results are returned.",
25
+ },
26
+ query: {
27
+ type: "string",
28
+ label: "Search Query",
29
+ description: "The search text to match. If omitted, results are returned using internal ordering.",
30
+ optional: true,
31
+ },
32
+ contentTypes: {
33
+ type: "string[]",
34
+ label: "Content Types",
35
+ description: "Limit results to one or more content types. Use `ARTICLE` or `POST`. To search external records, use the **External Source IDs** filter instead.",
36
+ optional: true,
37
+ options: [
38
+ "ARTICLE",
39
+ "POST",
40
+ ],
41
+ },
42
+ brandIds: {
43
+ propDefinition: [
44
+ app,
45
+ "brandId",
46
+ ],
47
+ type: "string[]",
48
+ label: "Brand IDs",
49
+ description: "Limit results to articles or posts within these brands. If omitted, results are returned across all brands.",
50
+ },
51
+ categoryIds: {
52
+ propDefinition: [
53
+ app,
54
+ "articleCategoryId",
55
+ ],
56
+ type: "string[]",
57
+ label: "Category IDs",
58
+ description: "Limit results to articles in these categories.",
59
+ optional: true,
60
+ },
61
+ sectionIds: {
62
+ propDefinition: [
63
+ app,
64
+ "sectionId",
65
+ ],
66
+ type: "string[]",
67
+ label: "Section IDs",
68
+ description: "Limit results to articles in these sections.",
69
+ optional: true,
70
+ },
71
+ topicIds: {
72
+ propDefinition: [
73
+ app,
74
+ "topicId",
75
+ ],
76
+ type: "string[]",
77
+ label: "Topic IDs",
78
+ description: "Limit results to posts in these community topics.",
79
+ },
80
+ externalSourceIds: {
81
+ propDefinition: [
82
+ app,
83
+ "externalSourceId",
84
+ ],
85
+ type: "string[]",
86
+ label: "External Source IDs",
87
+ description: "Limit results to specific external sources. If omitted, results are returned across all sources.",
88
+ },
89
+ pageSize: {
90
+ type: "integer",
91
+ label: "Page Size",
92
+ description: "Maximum number of results to return per page. Between 1 and 50. Default is 10.",
93
+ optional: true,
94
+ default: 10,
95
+ },
96
+ pageAfter: {
97
+ type: "string",
98
+ label: "Page After Cursor",
99
+ description: "Cursor string for the next page of results, obtained from a previous response.",
100
+ optional: true,
101
+ },
102
+ customSubdomain: {
103
+ propDefinition: [
104
+ app,
105
+ "customSubdomain",
106
+ ],
107
+ },
108
+ },
109
+ async run({ $: step }) {
110
+ const {
111
+ locales,
112
+ query,
113
+ contentTypes,
114
+ brandIds,
115
+ categoryIds,
116
+ sectionIds,
117
+ topicIds,
118
+ externalSourceIds,
119
+ pageSize,
120
+ pageAfter,
121
+ customSubdomain,
122
+ } = this;
123
+
124
+ const results = await this.app.searchHelpCenter({
125
+ step,
126
+ customSubdomain,
127
+ params: {
128
+ query,
129
+ "filter[locales]": toCommaSeparated(locales),
130
+ "filter[content_types]": toCommaSeparated(contentTypes),
131
+ "filter[brand_ids]": toCommaSeparated(brandIds),
132
+ "filter[category_ids]": toCommaSeparated(categoryIds),
133
+ "filter[section_ids]": toCommaSeparated(sectionIds),
134
+ "filter[topic_ids]": toCommaSeparated(topicIds),
135
+ "filter[external_source_ids]": toCommaSeparated(externalSourceIds),
136
+ "page[size]": pageSize,
137
+ "page[after]": pageAfter,
138
+ },
139
+ });
140
+
141
+ step.export("$summary", `Successfully retrieved ${results.results?.length ?? 0} Help Center result(s)`);
142
+
143
+ return results;
144
+ },
145
+ };
@@ -5,7 +5,7 @@ export default {
5
5
  name: "Search Macros",
6
6
  description: "Search for macros by name. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#search-macros).",
7
7
  type: "action",
8
- version: "0.0.1",
8
+ version: "0.0.2",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  name: "Search Tickets",
6
6
  description: "Searches for tickets using Zendesk's search API. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/ticket-management/search/#search-tickets).",
7
7
  type: "action",
8
- version: "0.0.11",
8
+ version: "0.0.12",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -7,7 +7,7 @@ export default {
7
7
  name: "Set Custom Ticket Fields",
8
8
  description: "Sets one or more custom field values on a ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#update-ticket).",
9
9
  type: "action",
10
- version: "0.0.5",
10
+ version: "0.0.6",
11
11
  annotations: {
12
12
  destructiveHint: false,
13
13
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  name: "Set Ticket Tags",
6
6
  description: "Set tags on a ticket (replaces all existing tags). [See the documentation](https://developer.zendesk.com/api-reference/ticketing/ticket-management/tags/#set-tags).",
7
7
  type: "action",
8
- version: "0.0.8",
8
+ version: "0.0.9",
9
9
  annotations: {
10
10
  destructiveHint: true,
11
11
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  name: "Update Ticket",
6
6
  description: "Updates a ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#update-ticket).",
7
7
  type: "action",
8
- version: "0.2.5",
8
+ version: "0.2.6",
9
9
  annotations: {
10
10
  destructiveHint: true,
11
11
  openWorldHint: true,
package/common/utils.mjs CHANGED
@@ -1,3 +1,20 @@
1
+ export const toCommaSeparated = (value) => {
2
+ if (Array.isArray(value)) {
3
+ return value.join(",");
4
+ }
5
+ if (typeof value === "string") {
6
+ try {
7
+ const parsed = JSON.parse(value);
8
+ if (Array.isArray(parsed)) {
9
+ return parsed.join(",");
10
+ }
11
+ } catch {
12
+ // not a JSON array string, return as-is
13
+ }
14
+ }
15
+ return value;
16
+ };
17
+
1
18
  export const parseObject = (obj) => {
2
19
  if (!obj) {
3
20
  return {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/zendesk",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "Pipedream Zendesk Components",
5
5
  "main": "zendesk.app.mjs",
6
6
  "keywords": [
@@ -6,7 +6,7 @@ export default {
6
6
  name: "Locale Updated",
7
7
  type: "source",
8
8
  description: "Emit new event when a locale has been updated",
9
- version: "0.0.6",
9
+ version: "0.0.7",
10
10
  dedupe: "unique",
11
11
  async run() {
12
12
  const lastTs = this._getLastTs();
@@ -6,7 +6,7 @@ export default {
6
6
  key: "zendesk-new-ticket",
7
7
  type: "source",
8
8
  description: "Emit new event when a ticket is created",
9
- version: "0.2.11",
9
+ version: "0.2.12",
10
10
  dedupe: "unique",
11
11
  methods: {
12
12
  ...common.methods,
@@ -7,7 +7,7 @@ export default {
7
7
  key: "zendesk-new-ticket-comment-added",
8
8
  type: "source",
9
9
  description: "Emit new event when a ticket comment has been added",
10
- version: "0.1.3",
10
+ version: "0.1.4",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  app,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "zendesk-ticket-added-to-view",
6
6
  name: "New Ticket Added to View (Instant)",
7
7
  description: "Emit new event when a ticket is added to the specified view",
8
- version: "0.0.11",
8
+ version: "0.0.12",
9
9
  type: "source",
10
10
  dedupe: "unique",
11
11
  props: {
@@ -6,7 +6,7 @@ export default {
6
6
  key: "zendesk-ticket-closed",
7
7
  type: "source",
8
8
  description: "Emit new event when a ticket has changed to closed status",
9
- version: "0.2.11",
9
+ version: "0.2.12",
10
10
  dedupe: "unique",
11
11
  methods: {
12
12
  ...common.methods,
@@ -6,7 +6,7 @@ export default {
6
6
  key: "zendesk-ticket-pended",
7
7
  type: "source",
8
8
  description: "Emit new event when a ticket has changed to pending status",
9
- version: "0.2.11",
9
+ version: "0.2.12",
10
10
  dedupe: "unique",
11
11
  methods: {
12
12
  ...common.methods,
@@ -6,7 +6,7 @@ export default {
6
6
  key: "zendesk-ticket-solved",
7
7
  type: "source",
8
8
  description: "Emit new event when a ticket has changed to solved status",
9
- version: "0.2.11",
9
+ version: "0.2.12",
10
10
  dedupe: "unique",
11
11
  methods: {
12
12
  ...common.methods,
@@ -6,7 +6,7 @@ export default {
6
6
  key: "zendesk-ticket-updated",
7
7
  type: "source",
8
8
  description: "Emit new event when a ticket has been updated",
9
- version: "0.2.11",
9
+ version: "0.2.12",
10
10
  dedupe: "unique",
11
11
  methods: {
12
12
  ...common.methods,
package/zendesk.app.mjs CHANGED
@@ -442,6 +442,117 @@ export default {
442
442
  description: "The email address of the agent to assign the ticket to",
443
443
  optional: true,
444
444
  },
445
+ brandId: {
446
+ type: "string",
447
+ label: "Brand ID",
448
+ description: "The ID of the brand",
449
+ optional: true,
450
+ async options({ prevContext }) {
451
+ const { afterCursor } = prevContext;
452
+ const {
453
+ brands,
454
+ meta,
455
+ } = await this.listBrands({
456
+ params: {
457
+ [constants.PAGE_SIZE_PARAM]: constants.DEFAULT_LIMIT,
458
+ [constants.PAGE_AFTER_PARAM]: afterCursor,
459
+ },
460
+ });
461
+ return {
462
+ context: {
463
+ afterCursor: meta?.after_cursor,
464
+ },
465
+ options: brands.map(({
466
+ id: value, name: label,
467
+ }) => ({
468
+ value,
469
+ label,
470
+ })),
471
+ };
472
+ },
473
+ },
474
+ topicId: {
475
+ type: "string",
476
+ label: "Topic ID",
477
+ description: "The ID of the community topic",
478
+ optional: true,
479
+ async options({ prevContext }) {
480
+ const { afterCursor } = prevContext;
481
+ const {
482
+ topics,
483
+ meta,
484
+ } = await this.listTopics({
485
+ params: {
486
+ [constants.PAGE_SIZE_PARAM]: constants.DEFAULT_LIMIT,
487
+ [constants.PAGE_AFTER_PARAM]: afterCursor,
488
+ },
489
+ });
490
+ return {
491
+ context: {
492
+ afterCursor: meta?.after_cursor,
493
+ },
494
+ options: topics.map(({
495
+ id: value, name: label,
496
+ }) => ({
497
+ value,
498
+ label,
499
+ })),
500
+ };
501
+ },
502
+ },
503
+ externalSourceId: {
504
+ type: "string",
505
+ label: "External Source ID",
506
+ description: "The ID of the external content source",
507
+ optional: true,
508
+ async options({ prevContext }) {
509
+ const { afterCursor } = prevContext;
510
+ const {
511
+ sources,
512
+ meta,
513
+ } = await this.listExternalContentSources({
514
+ params: {
515
+ [constants.PAGE_SIZE_PARAM]: constants.DEFAULT_LIMIT,
516
+ [constants.PAGE_AFTER_PARAM]: afterCursor,
517
+ },
518
+ });
519
+ return {
520
+ context: {
521
+ afterCursor: meta?.after_cursor,
522
+ },
523
+ options: sources.map(({
524
+ id: value, name: label,
525
+ }) => ({
526
+ value,
527
+ label,
528
+ })),
529
+ };
530
+ },
531
+ },
532
+ labelName: {
533
+ type: "string",
534
+ label: "Label Name",
535
+ description: "The name of an article label",
536
+ optional: true,
537
+ async options({ prevContext }) {
538
+ const { afterCursor } = prevContext;
539
+ const {
540
+ labels,
541
+ meta,
542
+ } = await this.listArticleLabels({
543
+ params: {
544
+ [constants.PAGE_SIZE_PARAM]: constants.DEFAULT_LIMIT,
545
+ [constants.PAGE_AFTER_PARAM]: afterCursor,
546
+ },
547
+ });
548
+ return {
549
+ context: {
550
+ afterCursor: meta?.after_cursor,
551
+ },
552
+ options: labels.map(({ name }) => name),
553
+ };
554
+ },
555
+ },
445
556
  },
446
557
  methods: {
447
558
  getUrl(path, customSubdomain) {
@@ -746,6 +857,48 @@ export default {
746
857
  ...args,
747
858
  });
748
859
  },
860
+ listArticleLabels(args = {}) {
861
+ return this.makeRequest({
862
+ path: "/help_center/articles/labels",
863
+ ...args,
864
+ });
865
+ },
866
+ listBrands(args = {}) {
867
+ return this.makeRequest({
868
+ path: "/brands",
869
+ ...args,
870
+ });
871
+ },
872
+ listTopics(args = {}) {
873
+ return this.makeRequest({
874
+ path: "/community/topics",
875
+ ...args,
876
+ });
877
+ },
878
+ listExternalContentSources(args = {}) {
879
+ return this.makeRequest({
880
+ path: "/guide/external_content/sources",
881
+ ...args,
882
+ });
883
+ },
884
+ searchHelpCenter(args = {}) {
885
+ return this.makeRequest({
886
+ path: "/guide/search",
887
+ ...args,
888
+ });
889
+ },
890
+ searchArticles(args = {}) {
891
+ return this.makeRequest({
892
+ path: "/help_center/articles/search",
893
+ ...args,
894
+ });
895
+ },
896
+ searchCommunityPosts(args = {}) {
897
+ return this.makeRequest({
898
+ path: "/help_center/community_posts/search",
899
+ ...args,
900
+ });
901
+ },
749
902
  getMacro({
750
903
  macroId, ...args
751
904
  }) {