Skip to content

Commit 54b31a6

Browse files
authored
New Components - zendesk (#17748)
* new components * pnpm-lock.yaml * versions * fix props
1 parent 30f8000 commit 54b31a6

File tree

25 files changed

+510
-24
lines changed

25 files changed

+510
-24
lines changed

components/zendesk/actions/add-ticket-tags/add-ticket-tags.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Add Ticket Tags",
66
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).",
77
type: "action",
8-
version: "0.0.1",
8+
version: "0.0.2",
99
props: {
1010
app,
1111
ticketId: {

components/zendesk/actions/create-ticket/create-ticket.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Create Ticket",
66
description: "Creates a ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#create-ticket).",
77
type: "action",
8-
version: "0.1.5",
8+
version: "0.1.6",
99
props: {
1010
app,
1111
ticketCommentBody: {

components/zendesk/actions/delete-ticket/delete-ticket.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Delete Ticket",
66
description: "Deletes a ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#delete-ticket).",
77
type: "action",
8-
version: "0.1.5",
8+
version: "0.1.6",
99
props: {
1010
app,
1111
ticketId: {

components/zendesk/actions/get-ticket-info/get-ticket-info.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Get Ticket Info",
66
description: "Retrieves information about a specific ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#show-ticket).",
77
type: "action",
8-
version: "0.0.3",
8+
version: "0.0.4",
99
props: {
1010
app,
1111
ticketId: {
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import zendesk from "../../zendesk.app.mjs";
2+
3+
export default {
4+
key: "zendesk-get-user-info",
5+
name: "Get User Info",
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.1",
8+
type: "action",
9+
props: {
10+
zendesk,
11+
userId: {
12+
propDefinition: [
13+
zendesk,
14+
"userId",
15+
],
16+
},
17+
},
18+
async run({ $: step }) {
19+
const response = await this.zendesk.getUserInfo({
20+
step,
21+
userId: this.userId,
22+
});
23+
24+
step.export("$summary", `Successfully retrieved user info for ${response.user.name}`);
25+
26+
return response;
27+
},
28+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import zendesk from "../../zendesk.app.mjs";
2+
3+
export default {
4+
key: "zendesk-list-locales",
5+
name: "List Locales",
6+
description: "Retrieves all locales. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/account-configuration/locales/).",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
zendesk,
11+
},
12+
async run({ $: step }) {
13+
const { locales } = await this.zendesk.listLocales();
14+
15+
step.export("$summary", `Successfully retrieved ${locales.length} locale${locales.length === 1
16+
? ""
17+
: "s"}`);
18+
19+
return locales;
20+
},
21+
};
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
import zendesk from "../../zendesk.app.mjs";
2+
3+
export default {
4+
key: "zendesk-list-macros",
5+
name: "List Macros",
6+
description: "Retrieves all macros. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#list-macros).",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
zendesk,
11+
access: {
12+
type: "string",
13+
label: "Access",
14+
description: "The access level of the macros to return",
15+
options: [
16+
"personal",
17+
"agents",
18+
"shared",
19+
"account",
20+
],
21+
optional: true,
22+
},
23+
active: {
24+
type: "boolean",
25+
label: "Active",
26+
description: "Filter by active macros if `true` or inactive macros if `false`",
27+
optional: true,
28+
},
29+
macroCategory: {
30+
propDefinition: [
31+
zendesk,
32+
"macroCategory",
33+
],
34+
},
35+
groupId: {
36+
propDefinition: [
37+
zendesk,
38+
"groupId",
39+
],
40+
},
41+
sortBy: {
42+
type: "string",
43+
label: "Sort By",
44+
description: "The field to sort the results by",
45+
options: [
46+
"alphabetical",
47+
"created_at",
48+
"updated_at",
49+
"usage_1h",
50+
"usage_24h",
51+
"usage_7d",
52+
"usage_30d",
53+
],
54+
optional: true,
55+
},
56+
sortOrder: {
57+
propDefinition: [
58+
zendesk,
59+
"sortOrder",
60+
],
61+
},
62+
limit: {
63+
propDefinition: [
64+
zendesk,
65+
"limit",
66+
],
67+
description: "Maximum number of macros to return",
68+
},
69+
},
70+
async run({ $: step }) {
71+
const results = this.zendesk.paginate({
72+
fn: this.zendesk.listMacros,
73+
args: {
74+
step,
75+
params: {
76+
access: this.access,
77+
active: this.active,
78+
category: this.macroCategory,
79+
group_id: this.groupId,
80+
sort_by: this.sortBy,
81+
sort_order: this.sortOrder,
82+
},
83+
},
84+
resourceKey: "macros",
85+
max: this.limit,
86+
});
87+
88+
const macros = [];
89+
for await (const macro of results) {
90+
macros.push(macro);
91+
}
92+
93+
step.export("$summary", `Successfully retrieved ${macros.length} macro${macros.length === 1
94+
? ""
95+
: "s"}`);
96+
97+
return macros;
98+
},
99+
};
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import zendesk from "../../zendesk.app.mjs";
2+
3+
export default {
4+
key: "zendesk-list-ticket-comments",
5+
name: "List Ticket Comments",
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.1",
8+
type: "action",
9+
props: {
10+
zendesk,
11+
ticketId: {
12+
propDefinition: [
13+
zendesk,
14+
"ticketId",
15+
],
16+
},
17+
sortOrder: {
18+
propDefinition: [
19+
zendesk,
20+
"sortOrder",
21+
],
22+
},
23+
limit: {
24+
propDefinition: [
25+
zendesk,
26+
"limit",
27+
],
28+
description: "Maximum number of comments to return",
29+
},
30+
},
31+
async run({ $: step }) {
32+
const results = this.zendesk.paginate({
33+
fn: this.zendesk.listTicketComments,
34+
args: {
35+
step,
36+
ticketId: this.ticketId,
37+
params: {
38+
sort_order: this.sortOrder,
39+
},
40+
},
41+
resourceKey: "comments",
42+
max: this.limit,
43+
});
44+
45+
const comments = [];
46+
for await (const comment of results) {
47+
comments.push(comment);
48+
}
49+
50+
step.export("$summary", `Successfully retrieved ${comments.length} comment${comments.length === 1
51+
? ""
52+
: "s"}`);
53+
54+
return comments;
55+
},
56+
};

components/zendesk/actions/list-tickets/list-tickets.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "List Tickets",
66
description: "Retrieves a list of tickets. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#list-tickets).",
77
type: "action",
8-
version: "0.0.3",
8+
version: "0.0.4",
99
props: {
1010
app,
1111
sortBy: {

components/zendesk/actions/remove-ticket-tags/remove-ticket-tags.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Remove Ticket Tags",
66
description: "Remove specific tags from a ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/ticket-management/tags/#remove-tags).",
77
type: "action",
8-
version: "0.0.1",
8+
version: "0.0.2",
99
props: {
1010
app,
1111
ticketId: {

0 commit comments

Comments
 (0)