@activepieces/piece-freshservice 0.0.1
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/package.json +16 -0
- package/src/index.d.ts +9 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +88 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/add-note-to-ticket.d.ts +15 -0
- package/src/lib/actions/add-note-to-ticket.d.ts.map +1 -0
- package/src/lib/actions/add-note-to-ticket.js +45 -0
- package/src/lib/actions/add-note-to-ticket.js.map +1 -0
- package/src/lib/actions/create-requester.d.ts +20 -0
- package/src/lib/actions/create-requester.d.ts.map +1 -0
- package/src/lib/actions/create-requester.js +82 -0
- package/src/lib/actions/create-requester.js.map +1 -0
- package/src/lib/actions/create-ticket.d.ts +46 -0
- package/src/lib/actions/create-ticket.d.ts.map +1 -0
- package/src/lib/actions/create-ticket.js +105 -0
- package/src/lib/actions/create-ticket.js.map +1 -0
- package/src/lib/actions/request-ticket-approval.d.ts +21 -0
- package/src/lib/actions/request-ticket-approval.d.ts.map +1 -0
- package/src/lib/actions/request-ticket-approval.js +47 -0
- package/src/lib/actions/request-ticket-approval.js.map +1 -0
- package/src/lib/common/client.d.ts +14 -0
- package/src/lib/common/client.d.ts.map +1 -0
- package/src/lib/common/client.js +30 -0
- package/src/lib/common/client.js.map +1 -0
- package/src/lib/common/props.d.ts +43 -0
- package/src/lib/common/props.d.ts.map +1 -0
- package/src/lib/common/props.js +215 -0
- package/src/lib/common/props.js.map +1 -0
- package/src/lib/triggers/new-requester.d.ts +15 -0
- package/src/lib/triggers/new-requester.d.ts.map +1 -0
- package/src/lib/triggers/new-requester.js +77 -0
- package/src/lib/triggers/new-requester.js.map +1 -0
- package/src/lib/triggers/new-ticket.d.ts +15 -0
- package/src/lib/triggers/new-ticket.d.ts.map +1 -0
- package/src/lib/triggers/new-ticket.js +81 -0
- package/src/lib/triggers/new-ticket.js.map +1 -0
- package/src/lib/triggers/updated-requester.d.ts +15 -0
- package/src/lib/triggers/updated-requester.d.ts.map +1 -0
- package/src/lib/triggers/updated-requester.js +77 -0
- package/src/lib/triggers/updated-requester.js.map +1 -0
- package/src/lib/triggers/updated-ticket.d.ts +15 -0
- package/src/lib/triggers/updated-ticket.d.ts.map +1 -0
- package/src/lib/triggers/updated-ticket.js +81 -0
- package/src/lib/triggers/updated-ticket.js.map +1 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const freshserviceCommon: {
|
|
2
|
+
ticket: (required?: boolean) => import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
}>> | import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
+
}>>;
|
|
9
|
+
requester: (required?: boolean) => import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
10
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
11
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
12
|
+
}>> | import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
13
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
14
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
15
|
+
}>>;
|
|
16
|
+
agent: (required?: boolean) => import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
17
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
18
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
19
|
+
}>> | import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
20
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
21
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
22
|
+
}>>;
|
|
23
|
+
department: (required?: boolean) => import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
24
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
25
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
26
|
+
}>> | import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
27
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
28
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
29
|
+
}>>;
|
|
30
|
+
group: (required?: boolean) => import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
31
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
32
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
33
|
+
}>> | import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
34
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
35
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
36
|
+
}>>;
|
|
37
|
+
status: import("@activepieces/pieces-framework").StaticDropdownProperty<number, true>;
|
|
38
|
+
priority: import("@activepieces/pieces-framework").StaticDropdownProperty<number, true>;
|
|
39
|
+
urgency: import("@activepieces/pieces-framework").StaticDropdownProperty<number, false>;
|
|
40
|
+
impact: import("@activepieces/pieces-framework").StaticDropdownProperty<number, false>;
|
|
41
|
+
source: import("@activepieces/pieces-framework").StaticDropdownProperty<number, false>;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/props.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqO9B,CAAC"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.freshserviceCommon = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const __1 = require("../../");
|
|
8
|
+
const client_1 = require("./client");
|
|
9
|
+
exports.freshserviceCommon = {
|
|
10
|
+
ticket: (required = true) => pieces_framework_1.Property.Dropdown({
|
|
11
|
+
auth: __1.freshserviceAuth,
|
|
12
|
+
displayName: 'Ticket',
|
|
13
|
+
required,
|
|
14
|
+
refreshers: [],
|
|
15
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
16
|
+
if (!auth) {
|
|
17
|
+
return {
|
|
18
|
+
disabled: true,
|
|
19
|
+
placeholder: 'Connect your account first',
|
|
20
|
+
options: [],
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const response = yield (0, client_1.freshserviceApiCall)({
|
|
24
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
25
|
+
endpoint: 'tickets',
|
|
26
|
+
auth,
|
|
27
|
+
queryParams: {
|
|
28
|
+
order_by: 'created_at',
|
|
29
|
+
order_type: 'desc',
|
|
30
|
+
per_page: '100',
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
disabled: false,
|
|
35
|
+
options: response.body.tickets.map((ticket) => ({
|
|
36
|
+
label: `#${ticket.id} — ${ticket.subject}`,
|
|
37
|
+
value: ticket.id,
|
|
38
|
+
})),
|
|
39
|
+
};
|
|
40
|
+
}),
|
|
41
|
+
}),
|
|
42
|
+
requester: (required = true) => pieces_framework_1.Property.Dropdown({
|
|
43
|
+
auth: __1.freshserviceAuth,
|
|
44
|
+
displayName: 'Requester',
|
|
45
|
+
required,
|
|
46
|
+
refreshers: [],
|
|
47
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
48
|
+
if (!auth) {
|
|
49
|
+
return {
|
|
50
|
+
disabled: true,
|
|
51
|
+
placeholder: 'Connect your account first',
|
|
52
|
+
options: [],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const response = yield (0, client_1.freshserviceApiCall)({
|
|
56
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
57
|
+
endpoint: 'requesters',
|
|
58
|
+
auth,
|
|
59
|
+
queryParams: { per_page: '100' },
|
|
60
|
+
});
|
|
61
|
+
return {
|
|
62
|
+
disabled: false,
|
|
63
|
+
options: response.body.requesters.map((r) => ({
|
|
64
|
+
label: `${r.first_name} ${r.last_name} (${r.primary_email})`,
|
|
65
|
+
value: r.id,
|
|
66
|
+
})),
|
|
67
|
+
};
|
|
68
|
+
}),
|
|
69
|
+
}),
|
|
70
|
+
agent: (required = true) => pieces_framework_1.Property.Dropdown({
|
|
71
|
+
auth: __1.freshserviceAuth,
|
|
72
|
+
displayName: 'Agent',
|
|
73
|
+
required,
|
|
74
|
+
refreshers: [],
|
|
75
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
76
|
+
if (!auth) {
|
|
77
|
+
return {
|
|
78
|
+
disabled: true,
|
|
79
|
+
placeholder: 'Connect your account first',
|
|
80
|
+
options: [],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
const response = yield (0, client_1.freshserviceApiCall)({
|
|
84
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
85
|
+
endpoint: 'agents',
|
|
86
|
+
auth,
|
|
87
|
+
queryParams: { per_page: '100' },
|
|
88
|
+
});
|
|
89
|
+
return {
|
|
90
|
+
disabled: false,
|
|
91
|
+
options: response.body.agents.map((a) => ({
|
|
92
|
+
label: `${a.first_name} ${a.last_name} (${a.email})`,
|
|
93
|
+
value: a.id,
|
|
94
|
+
})),
|
|
95
|
+
};
|
|
96
|
+
}),
|
|
97
|
+
}),
|
|
98
|
+
department: (required = true) => pieces_framework_1.Property.Dropdown({
|
|
99
|
+
auth: __1.freshserviceAuth,
|
|
100
|
+
displayName: 'Department',
|
|
101
|
+
required,
|
|
102
|
+
refreshers: [],
|
|
103
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
104
|
+
if (!auth) {
|
|
105
|
+
return {
|
|
106
|
+
disabled: true,
|
|
107
|
+
placeholder: 'Connect your account first',
|
|
108
|
+
options: [],
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
const response = yield (0, client_1.freshserviceApiCall)({
|
|
112
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
113
|
+
endpoint: 'departments',
|
|
114
|
+
auth,
|
|
115
|
+
queryParams: { per_page: '100' },
|
|
116
|
+
});
|
|
117
|
+
return {
|
|
118
|
+
disabled: false,
|
|
119
|
+
options: response.body.departments.map((d) => ({
|
|
120
|
+
label: d.name,
|
|
121
|
+
value: d.id,
|
|
122
|
+
})),
|
|
123
|
+
};
|
|
124
|
+
}),
|
|
125
|
+
}),
|
|
126
|
+
group: (required = true) => pieces_framework_1.Property.Dropdown({
|
|
127
|
+
auth: __1.freshserviceAuth,
|
|
128
|
+
displayName: 'Group',
|
|
129
|
+
required,
|
|
130
|
+
refreshers: [],
|
|
131
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
132
|
+
if (!auth) {
|
|
133
|
+
return {
|
|
134
|
+
disabled: true,
|
|
135
|
+
placeholder: 'Connect your account first',
|
|
136
|
+
options: [],
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
const response = yield (0, client_1.freshserviceApiCall)({
|
|
140
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
141
|
+
endpoint: 'groups',
|
|
142
|
+
auth,
|
|
143
|
+
queryParams: { per_page: '100' },
|
|
144
|
+
});
|
|
145
|
+
return {
|
|
146
|
+
disabled: false,
|
|
147
|
+
options: response.body.groups.map((g) => ({
|
|
148
|
+
label: g.name,
|
|
149
|
+
value: g.id,
|
|
150
|
+
})),
|
|
151
|
+
};
|
|
152
|
+
}),
|
|
153
|
+
}),
|
|
154
|
+
status: pieces_framework_1.Property.StaticDropdown({
|
|
155
|
+
displayName: 'Status',
|
|
156
|
+
required: true,
|
|
157
|
+
options: {
|
|
158
|
+
options: [
|
|
159
|
+
{ label: 'Open', value: 2 },
|
|
160
|
+
{ label: 'Pending', value: 3 },
|
|
161
|
+
{ label: 'Resolved', value: 4 },
|
|
162
|
+
{ label: 'Closed', value: 5 },
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
}),
|
|
166
|
+
priority: pieces_framework_1.Property.StaticDropdown({
|
|
167
|
+
displayName: 'Priority',
|
|
168
|
+
required: true,
|
|
169
|
+
options: {
|
|
170
|
+
options: [
|
|
171
|
+
{ label: 'Low', value: 1 },
|
|
172
|
+
{ label: 'Medium', value: 2 },
|
|
173
|
+
{ label: 'High', value: 3 },
|
|
174
|
+
{ label: 'Urgent', value: 4 },
|
|
175
|
+
],
|
|
176
|
+
},
|
|
177
|
+
}),
|
|
178
|
+
urgency: pieces_framework_1.Property.StaticDropdown({
|
|
179
|
+
displayName: 'Urgency',
|
|
180
|
+
required: false,
|
|
181
|
+
options: {
|
|
182
|
+
options: [
|
|
183
|
+
{ label: 'Low', value: 1 },
|
|
184
|
+
{ label: 'Medium', value: 2 },
|
|
185
|
+
{ label: 'High', value: 3 },
|
|
186
|
+
],
|
|
187
|
+
},
|
|
188
|
+
}),
|
|
189
|
+
impact: pieces_framework_1.Property.StaticDropdown({
|
|
190
|
+
displayName: 'Impact',
|
|
191
|
+
required: false,
|
|
192
|
+
options: {
|
|
193
|
+
options: [
|
|
194
|
+
{ label: 'Low', value: 1 },
|
|
195
|
+
{ label: 'Medium', value: 2 },
|
|
196
|
+
{ label: 'High', value: 3 },
|
|
197
|
+
],
|
|
198
|
+
},
|
|
199
|
+
}),
|
|
200
|
+
source: pieces_framework_1.Property.StaticDropdown({
|
|
201
|
+
displayName: 'Source',
|
|
202
|
+
required: false,
|
|
203
|
+
options: {
|
|
204
|
+
options: [
|
|
205
|
+
{ label: 'Email', value: 1 },
|
|
206
|
+
{ label: 'Portal', value: 2 },
|
|
207
|
+
{ label: 'Phone', value: 3 },
|
|
208
|
+
{ label: 'Chat', value: 7 },
|
|
209
|
+
{ label: 'Feedback Widget', value: 9 },
|
|
210
|
+
{ label: 'Outbound Email', value: 10 },
|
|
211
|
+
],
|
|
212
|
+
},
|
|
213
|
+
}),
|
|
214
|
+
};
|
|
215
|
+
//# sourceMappingURL=props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../../../src/lib/common/props.ts"],"names":[],"mappings":";;;;AAAA,qEAA0D;AAC1D,+DAAyD;AACzD,8BAA0C;AAC1C,qCAA+C;AA+BlC,QAAA,kBAAkB,GAAG;IAChC,MAAM,EAAE,CAAC,QAAQ,GAAG,IAAI,EAAE,EAAE,CAC1B,2BAAQ,CAAC,QAAQ,CAAC;QAChB,IAAI,EAAE,oBAAgB;QACtB,WAAW,EAAE,QAAQ;QACrB,QAAQ;QACR,UAAU,EAAE,EAAE;QACd,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;YACtB,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO;oBACL,QAAQ,EAAE,IAAI;oBACd,WAAW,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AAE;aACvC;SACF;KACF,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const newRequester: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
+
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
9
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
11
|
+
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
12
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
13
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
14
|
+
}>, {}>;
|
|
15
|
+
//# sourceMappingURL=new-requester.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-requester.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-requester.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAgDxC,eAAO,MAAM,YAAY;;;;;;;;;;;;OA0CvB,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.newRequester = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const __1 = require("../../");
|
|
8
|
+
const client_1 = require("../common/client");
|
|
9
|
+
const polling = {
|
|
10
|
+
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
11
|
+
items(_a) {
|
|
12
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, lastFetchEpochMS }) {
|
|
13
|
+
const response = yield (0, client_1.freshserviceApiCall)({
|
|
14
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
15
|
+
endpoint: 'requesters',
|
|
16
|
+
auth,
|
|
17
|
+
queryParams: {
|
|
18
|
+
order_by: 'created_at',
|
|
19
|
+
order_type: 'desc',
|
|
20
|
+
per_page: lastFetchEpochMS === 0 ? '10' : '100',
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
return response.body.requesters.map((requester) => ({
|
|
24
|
+
epochMilliSeconds: new Date(requester.created_at).getTime(),
|
|
25
|
+
data: requester,
|
|
26
|
+
}));
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
exports.newRequester = (0, pieces_framework_1.createTrigger)({
|
|
31
|
+
auth: __1.freshserviceAuth,
|
|
32
|
+
name: 'new_requester',
|
|
33
|
+
displayName: 'New Requester',
|
|
34
|
+
description: 'Triggers when a new requester (user) is created in Freshservice.',
|
|
35
|
+
props: {},
|
|
36
|
+
sampleData: {
|
|
37
|
+
id: 1,
|
|
38
|
+
first_name: 'Jane',
|
|
39
|
+
last_name: 'Doe',
|
|
40
|
+
primary_email: 'jane.doe@example.com',
|
|
41
|
+
job_title: 'Software Engineer',
|
|
42
|
+
phone: '+1-555-0100',
|
|
43
|
+
mobile_phone_number: '+1-555-0101',
|
|
44
|
+
created_at: '2025-01-15T09:30:00Z',
|
|
45
|
+
updated_at: '2025-01-15T09:30:00Z',
|
|
46
|
+
},
|
|
47
|
+
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
48
|
+
test(context) {
|
|
49
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
return yield pieces_common_1.pollingHelper.test(polling, context);
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
onEnable(context) {
|
|
54
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
56
|
+
auth: context.auth,
|
|
57
|
+
store: context.store,
|
|
58
|
+
propsValue: context.propsValue,
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
onDisable(context) {
|
|
63
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
yield pieces_common_1.pollingHelper.onDisable(polling, {
|
|
65
|
+
auth: context.auth,
|
|
66
|
+
store: context.store,
|
|
67
|
+
propsValue: context.propsValue,
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
run(context) {
|
|
72
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
return yield pieces_common_1.pollingHelper.poll(polling, context);
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
//# sourceMappingURL=new-requester.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-requester.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-requester.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAKqC;AACrC,8BAA0C;AAC1C,6CAAuD;AAcvD,MAAM,OAAO,GAGT;IACF,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAC5B,KAAK;qEAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE;YACpC,MAAM,QAAQ,GAAG,MAAM,IAA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KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,UAAU,EAAE,OAAO,CAAC,UAAU;aAC/B,CAAC,CAAC;QACL,CAAC;KAAA;IAEK,SAAS,CAAC,OAAO;;YACrB,MAAM,6BAAa,CAAC,SAAS,CAAC,OAAO,EAAE;gBACrC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,UAAU,EAAE,OAAO,CAAC,UAAU;aAC/B,CAAC,CAAC;QACL,CAAC;KAAA;IAEK,GAAG,CAAC,OAAO;;YACf,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const newTicket: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
+
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
9
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
11
|
+
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
12
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
13
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
14
|
+
}>, {}>;
|
|
15
|
+
//# sourceMappingURL=new-ticket.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-ticket.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-ticket.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAoDxC,eAAO,MAAM,SAAS;;;;;;;;;;;;OA8CpB,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.newTicket = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const __1 = require("../../");
|
|
8
|
+
const client_1 = require("../common/client");
|
|
9
|
+
const polling = {
|
|
10
|
+
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
11
|
+
items(_a) {
|
|
12
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, lastFetchEpochMS }) {
|
|
13
|
+
const response = yield (0, client_1.freshserviceApiCall)({
|
|
14
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
15
|
+
endpoint: 'tickets',
|
|
16
|
+
auth,
|
|
17
|
+
queryParams: {
|
|
18
|
+
order_by: 'created_at',
|
|
19
|
+
order_type: 'desc',
|
|
20
|
+
per_page: lastFetchEpochMS === 0 ? '10' : '100',
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
return response.body.tickets.map((ticket) => ({
|
|
24
|
+
epochMilliSeconds: new Date(ticket.created_at).getTime(),
|
|
25
|
+
data: ticket,
|
|
26
|
+
}));
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
exports.newTicket = (0, pieces_framework_1.createTrigger)({
|
|
31
|
+
auth: __1.freshserviceAuth,
|
|
32
|
+
name: 'new_ticket',
|
|
33
|
+
displayName: 'New Ticket',
|
|
34
|
+
description: 'Triggers when a new ticket is created in Freshservice.',
|
|
35
|
+
props: {},
|
|
36
|
+
sampleData: {
|
|
37
|
+
id: 1,
|
|
38
|
+
subject: 'Unable to access email',
|
|
39
|
+
description: '<div>I cannot log into my email account since this morning.</div>',
|
|
40
|
+
status: 2,
|
|
41
|
+
priority: 2,
|
|
42
|
+
requester_id: 1,
|
|
43
|
+
responder_id: 5,
|
|
44
|
+
department_id: 2,
|
|
45
|
+
group_id: 1,
|
|
46
|
+
type: 'Incident',
|
|
47
|
+
source: 2,
|
|
48
|
+
created_at: '2025-01-15T09:30:00Z',
|
|
49
|
+
updated_at: '2025-01-15T09:30:00Z',
|
|
50
|
+
},
|
|
51
|
+
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
52
|
+
test(context) {
|
|
53
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
return yield pieces_common_1.pollingHelper.test(polling, context);
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
onEnable(context) {
|
|
58
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
60
|
+
auth: context.auth,
|
|
61
|
+
store: context.store,
|
|
62
|
+
propsValue: context.propsValue,
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
onDisable(context) {
|
|
67
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
yield pieces_common_1.pollingHelper.onDisable(polling, {
|
|
69
|
+
auth: context.auth,
|
|
70
|
+
store: context.store,
|
|
71
|
+
propsValue: context.propsValue,
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
},
|
|
75
|
+
run(context) {
|
|
76
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
return yield pieces_common_1.pollingHelper.poll(polling, context);
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=new-ticket.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-ticket.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-ticket.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAKqC;AACrC,8BAA0C;AAC1C,6CAAuD;AAkBvD,MAAM,OAAO,GAGT;IACF,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAC5B,KAAK;qEAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE;YACpC,MAAM,QAAQ,GAAG,MAAM,IAAA,4BAAmB,EAEvC;gBACD,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,QAAQ,EAAE,SAAS;gBACnB,IAAI;gBACJ,WAAW,EAAE;oBACX,QAAQ,EAAE,YAAY;oBACtB,UAAU,EAAE,MAAM;oBAClB,QAAQ,EAAE,gBAAgB,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;iBAChD;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;gBAC5C,iBAAiB,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE;gBACxD,IAAI,EAAE,MAAM;aACb,CAAC,CAAC,CAAC;QACN,CAAC;KAAA;CACF,CAAC;AAEW,QAAA,SAAS,GAAG,IAAA,gCAAa,EAAC;IACrC,IAAI,EAAE,oBAAgB;IACtB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,wDAAwD;IACrE,KAAK,EAAE,EAAE;IACT,UAAU,EAAE;QACV,EAAE,EAAE,CAAC;QACL,OAAO,EAAE,wBAAwB;QACjC,WAAW,EAAE,mEAAmE;QAChF,MAAM,EAAE,CAAC;QACT,QAAQ,EAAE,CAAC;QACX,YAAY,EAAE,CAAC;QACf,YAAY,EAAE,CAAC;QACf,aAAa,EAAE,CAAC;QAChB,QAAQ,EAAE,CAAC;QACX,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,CAAC;QACT,UAAU,EAAE,sBAAsB;QAClC,UAAU,EAAE,sBAAsB;KACnC;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IAEvB,IAAI,CAAC,OAAO;;YAChB,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;IAEK,QAAQ,CAAC,OAAO;;YACpB,MAAM,6BAAa,CAAC,QAAQ,CAAC,OAAO,EAAE;gBACpC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,UAAU,EAAE,OAAO,CAAC,UAAU;aAC/B,CAAC,CAAC;QACL,CAAC;KAAA;IAEK,SAAS,CAAC,OAAO;;YACrB,MAAM,6BAAa,CAAC,SAAS,CAAC,OAAO,EAAE;gBACrC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,UAAU,EAAE,OAAO,CAAC,UAAU;aAC/B,CAAC,CAAC;QACL,CAAC;KAAA;IAEK,GAAG,CAAC,OAAO;;YACf,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const updatedRequester: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
+
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
9
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
11
|
+
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
12
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
13
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
14
|
+
}>, {}>;
|
|
15
|
+
//# sourceMappingURL=updated-requester.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updated-requester.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/updated-requester.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAgDxC,eAAO,MAAM,gBAAgB;;;;;;;;;;;;OA0C3B,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updatedRequester = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const __1 = require("../../");
|
|
8
|
+
const client_1 = require("../common/client");
|
|
9
|
+
const polling = {
|
|
10
|
+
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
11
|
+
items(_a) {
|
|
12
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, lastFetchEpochMS }) {
|
|
13
|
+
const response = yield (0, client_1.freshserviceApiCall)({
|
|
14
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
15
|
+
endpoint: 'requesters',
|
|
16
|
+
auth,
|
|
17
|
+
queryParams: {
|
|
18
|
+
order_by: 'updated_at',
|
|
19
|
+
order_type: 'desc',
|
|
20
|
+
per_page: lastFetchEpochMS === 0 ? '10' : '100',
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
return response.body.requesters.map((requester) => ({
|
|
24
|
+
epochMilliSeconds: new Date(requester.updated_at).getTime(),
|
|
25
|
+
data: requester,
|
|
26
|
+
}));
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
exports.updatedRequester = (0, pieces_framework_1.createTrigger)({
|
|
31
|
+
auth: __1.freshserviceAuth,
|
|
32
|
+
name: 'updated_requester',
|
|
33
|
+
displayName: 'Updated Requester',
|
|
34
|
+
description: 'Triggers when an existing requester is updated in Freshservice.',
|
|
35
|
+
props: {},
|
|
36
|
+
sampleData: {
|
|
37
|
+
id: 1,
|
|
38
|
+
first_name: 'Jane',
|
|
39
|
+
last_name: 'Doe',
|
|
40
|
+
primary_email: 'jane.doe@example.com',
|
|
41
|
+
job_title: 'Senior Software Engineer',
|
|
42
|
+
phone: '+1-555-0100',
|
|
43
|
+
mobile_phone_number: '+1-555-0101',
|
|
44
|
+
created_at: '2025-01-15T09:30:00Z',
|
|
45
|
+
updated_at: '2025-01-16T14:20:00Z',
|
|
46
|
+
},
|
|
47
|
+
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
48
|
+
test(context) {
|
|
49
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
return yield pieces_common_1.pollingHelper.test(polling, context);
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
onEnable(context) {
|
|
54
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
56
|
+
auth: context.auth,
|
|
57
|
+
store: context.store,
|
|
58
|
+
propsValue: context.propsValue,
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
onDisable(context) {
|
|
63
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
yield pieces_common_1.pollingHelper.onDisable(polling, {
|
|
65
|
+
auth: context.auth,
|
|
66
|
+
store: context.store,
|
|
67
|
+
propsValue: context.propsValue,
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
run(context) {
|
|
72
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
return yield pieces_common_1.pollingHelper.poll(polling, context);
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
//# sourceMappingURL=updated-requester.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updated-requester.js","sourceRoot":"","sources":["../../../../src/lib/triggers/updated-requester.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAKqC;AACrC,8BAA0C;AAC1C,6CAAuD;AAcvD,MAAM,OAAO,GAGT;IACF,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAC5B,KAAK;qEAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE;YACpC,MAAM,QAAQ,GAAG,MAAM,IAAA,4BAAmB,EAEvC;gBACD,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,QAAQ,EAAE,YAAY;gBACtB,IAAI;gBACJ,WAAW,EAAE;oBACX,QAAQ,EAAE,YAAY;oBACtB,UAAU,EAAE,MAAM;oBAClB,QAAQ,EAAE,gBAAgB,KAAK,CAA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OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,UAAU,EAAE,OAAO,CAAC,UAAU;aAC/B,CAAC,CAAC;QACL,CAAC;KAAA;IAEK,GAAG,CAAC,OAAO;;YACf,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const updatedTicket: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
+
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
9
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
11
|
+
}>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
12
|
+
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
13
|
+
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
14
|
+
}>, {}>;
|
|
15
|
+
//# sourceMappingURL=updated-ticket.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updated-ticket.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/updated-ticket.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAoDxC,eAAO,MAAM,aAAa;;;;;;;;;;;;OA8CxB,CAAC"}
|