@pipedream/zendesk 0.4.0 → 0.5.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.
- package/actions/create-ticket/create-ticket.mjs +9 -1
- package/actions/delete-ticket/delete-ticket.mjs +14 -2
- package/actions/update-ticket/update-ticket.mjs +9 -1
- package/package.json +1 -1
- package/sources/common/webhook.mjs +16 -1
- package/sources/new-ticket/new-ticket.mjs +1 -1
- package/sources/ticket-closed/ticket-closed.mjs +1 -1
- package/sources/ticket-pended/ticket-pended.mjs +1 -1
- package/sources/ticket-solved/ticket-solved.mjs +1 -1
- package/sources/ticket-updated/ticket-updated.mjs +1 -1
- package/zendesk.app.mjs +13 -4
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
name: "Create Ticket",
|
|
6
6
|
description: "Creates a ticket. [See the docs](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#create-ticket).",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0
|
|
8
|
+
version: "0.1.0",
|
|
9
9
|
props: {
|
|
10
10
|
app,
|
|
11
11
|
ticketCommentBody: {
|
|
@@ -32,6 +32,12 @@ export default {
|
|
|
32
32
|
"ticketStatus",
|
|
33
33
|
],
|
|
34
34
|
},
|
|
35
|
+
customSubdomain: {
|
|
36
|
+
propDefinition: [
|
|
37
|
+
app,
|
|
38
|
+
"customSubdomain",
|
|
39
|
+
],
|
|
40
|
+
},
|
|
35
41
|
},
|
|
36
42
|
methods: {
|
|
37
43
|
createTicket(args = {}) {
|
|
@@ -47,10 +53,12 @@ export default {
|
|
|
47
53
|
ticketPriority,
|
|
48
54
|
ticketSubject,
|
|
49
55
|
ticketStatus,
|
|
56
|
+
customSubdomain,
|
|
50
57
|
} = this;
|
|
51
58
|
|
|
52
59
|
const response = await this.createTicket({
|
|
53
60
|
step,
|
|
61
|
+
customSubdomain,
|
|
54
62
|
data: {
|
|
55
63
|
ticket: {
|
|
56
64
|
comment: {
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
name: "Delete Ticket",
|
|
6
6
|
description: "Deletes a ticket. [See the docs](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#delete-ticket).",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0
|
|
8
|
+
version: "0.1.0",
|
|
9
9
|
props: {
|
|
10
10
|
app,
|
|
11
11
|
ticketId: {
|
|
@@ -14,6 +14,12 @@ export default {
|
|
|
14
14
|
"ticketId",
|
|
15
15
|
],
|
|
16
16
|
},
|
|
17
|
+
customSubdomain: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
app,
|
|
20
|
+
"customSubdomain",
|
|
21
|
+
],
|
|
22
|
+
},
|
|
17
23
|
},
|
|
18
24
|
methods: {
|
|
19
25
|
deleteTicket({
|
|
@@ -26,9 +32,15 @@ export default {
|
|
|
26
32
|
},
|
|
27
33
|
},
|
|
28
34
|
async run({ $: step }) {
|
|
35
|
+
const {
|
|
36
|
+
ticketId,
|
|
37
|
+
customSubdomain,
|
|
38
|
+
} = this;
|
|
39
|
+
|
|
29
40
|
await this.deleteTicket({
|
|
30
41
|
step,
|
|
31
|
-
ticketId
|
|
42
|
+
ticketId,
|
|
43
|
+
customSubdomain,
|
|
32
44
|
});
|
|
33
45
|
|
|
34
46
|
step.export("$summary", "Successfully deleted ticket");
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
name: "Update Ticket",
|
|
6
6
|
description: "Updates a ticket. [See the docs](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#update-ticket).",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0
|
|
8
|
+
version: "0.1.0",
|
|
9
9
|
props: {
|
|
10
10
|
app,
|
|
11
11
|
ticketId: {
|
|
@@ -38,6 +38,12 @@ export default {
|
|
|
38
38
|
"ticketStatus",
|
|
39
39
|
],
|
|
40
40
|
},
|
|
41
|
+
customSubdomain: {
|
|
42
|
+
propDefinition: [
|
|
43
|
+
app,
|
|
44
|
+
"customSubdomain",
|
|
45
|
+
],
|
|
46
|
+
},
|
|
41
47
|
},
|
|
42
48
|
methods: {
|
|
43
49
|
updateTicket({
|
|
@@ -56,11 +62,13 @@ export default {
|
|
|
56
62
|
ticketPriority,
|
|
57
63
|
ticketSubject,
|
|
58
64
|
ticketStatus,
|
|
65
|
+
customSubdomain,
|
|
59
66
|
} = this;
|
|
60
67
|
|
|
61
68
|
const response = await this.updateTicket({
|
|
62
69
|
step,
|
|
63
70
|
ticketId,
|
|
71
|
+
customSubdomain,
|
|
64
72
|
data: {
|
|
65
73
|
ticket: {
|
|
66
74
|
comment: {
|
package/package.json
CHANGED
|
@@ -13,12 +13,22 @@ export default {
|
|
|
13
13
|
"categoryId",
|
|
14
14
|
],
|
|
15
15
|
},
|
|
16
|
+
customSubdomain: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
app,
|
|
19
|
+
"customSubdomain",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
16
22
|
},
|
|
17
23
|
hooks: {
|
|
18
24
|
async activate() {
|
|
19
|
-
const {
|
|
25
|
+
const {
|
|
26
|
+
categoryId,
|
|
27
|
+
customSubdomain,
|
|
28
|
+
} = this;
|
|
20
29
|
|
|
21
30
|
const { webhook } = await this.createWebhook({
|
|
31
|
+
customSubdomain,
|
|
22
32
|
data: this.setupWebhookData(),
|
|
23
33
|
});
|
|
24
34
|
|
|
@@ -26,6 +36,7 @@ export default {
|
|
|
26
36
|
this.setWebhookId(webhookId);
|
|
27
37
|
|
|
28
38
|
const { signing_secret: signingSecret } = await this.showWebhookSigningSecret({
|
|
39
|
+
customSubdomain,
|
|
29
40
|
webhookId,
|
|
30
41
|
});
|
|
31
42
|
|
|
@@ -33,6 +44,7 @@ export default {
|
|
|
33
44
|
this.setSigningSecret(secret);
|
|
34
45
|
|
|
35
46
|
const { trigger } = await this.createTrigger({
|
|
47
|
+
customSubdomain,
|
|
36
48
|
data: this.setupTriggerData({
|
|
37
49
|
webhookId,
|
|
38
50
|
categoryId,
|
|
@@ -43,11 +55,14 @@ export default {
|
|
|
43
55
|
this.setTriggerId(String(triggerId));
|
|
44
56
|
},
|
|
45
57
|
async deactivate() {
|
|
58
|
+
const { customSubdomain } = this;
|
|
46
59
|
await Promise.all([
|
|
47
60
|
this.deleteTrigger({
|
|
61
|
+
customSubdomain,
|
|
48
62
|
triggerId: this.getTriggerId(),
|
|
49
63
|
}),
|
|
50
64
|
this.deleteWebhook({
|
|
65
|
+
customSubdomain,
|
|
51
66
|
webhookId: this.getWebhookId(),
|
|
52
67
|
}),
|
|
53
68
|
]);
|
package/zendesk.app.mjs
CHANGED
|
@@ -94,15 +94,24 @@ export default {
|
|
|
94
94
|
optional: true,
|
|
95
95
|
options: Object.values(constants.TICKET_STATUS_OPTIONS),
|
|
96
96
|
},
|
|
97
|
+
customSubdomain: {
|
|
98
|
+
type: "string",
|
|
99
|
+
label: "Custom Subdomain",
|
|
100
|
+
description: "For Enterprise Zendesk accounts: optionally specify the subdomain to use. This will override the subdomain that was provided when connecting your Zendesk account to Pipedream. For example, if you Zendesk URL is https://examplehelp.zendesk.com, your subdomain is `examplehelp`",
|
|
101
|
+
optional: true,
|
|
102
|
+
},
|
|
97
103
|
},
|
|
98
104
|
methods: {
|
|
99
|
-
getUrl(path) {
|
|
105
|
+
getUrl(path, customSubdomain) {
|
|
100
106
|
const {
|
|
101
107
|
SUBDOMAIN_PLACEHOLDER,
|
|
102
108
|
BASE_URL,
|
|
103
109
|
VERSION_PATH,
|
|
104
110
|
} = constants;
|
|
105
|
-
const baseUrl = BASE_URL.replace(
|
|
111
|
+
const baseUrl = BASE_URL.replace(
|
|
112
|
+
SUBDOMAIN_PLACEHOLDER,
|
|
113
|
+
customSubdomain?.trim() || this.$auth.subdomain,
|
|
114
|
+
);
|
|
106
115
|
return `${baseUrl}${VERSION_PATH}${path}`;
|
|
107
116
|
},
|
|
108
117
|
getHeaders(headers) {
|
|
@@ -112,11 +121,11 @@ export default {
|
|
|
112
121
|
};
|
|
113
122
|
},
|
|
114
123
|
makeRequest({
|
|
115
|
-
step = this, url, path, headers, ...args
|
|
124
|
+
step = this, url, path, headers, customSubdomain, ...args
|
|
116
125
|
}) {
|
|
117
126
|
const config = {
|
|
118
127
|
headers: this.getHeaders(headers),
|
|
119
|
-
url: url ?? this.getUrl(path),
|
|
128
|
+
url: url ?? this.getUrl(path, customSubdomain),
|
|
120
129
|
timeout: constants.DEFAULT_TIMEOUT,
|
|
121
130
|
...args,
|
|
122
131
|
};
|