@activepieces/piece-freshservice 0.1.2 → 0.1.4
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 +7 -12
- package/src/index.js +14 -99
- package/src/index.d.ts +0 -9
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/add-note-to-change.d.ts +0 -15
- package/src/lib/actions/add-note-to-change.d.ts.map +0 -1
- package/src/lib/actions/add-note-to-change.js +0 -50
- package/src/lib/actions/add-note-to-change.js.map +0 -1
- package/src/lib/actions/add-note-to-ticket.d.ts +0 -15
- package/src/lib/actions/add-note-to-ticket.d.ts.map +0 -1
- package/src/lib/actions/add-note-to-ticket.js +0 -50
- package/src/lib/actions/add-note-to-ticket.js.map +0 -1
- package/src/lib/actions/create-change-task.d.ts +0 -32
- package/src/lib/actions/create-change-task.d.ts.map +0 -1
- package/src/lib/actions/create-change-task.js +0 -75
- package/src/lib/actions/create-change-task.js.map +0 -1
- package/src/lib/actions/create-change.d.ts +0 -47
- package/src/lib/actions/create-change.d.ts.map +0 -1
- package/src/lib/actions/create-change.js +0 -118
- package/src/lib/actions/create-change.js.map +0 -1
- package/src/lib/actions/create-requester.d.ts +0 -20
- package/src/lib/actions/create-requester.d.ts.map +0 -1
- package/src/lib/actions/create-requester.js +0 -87
- package/src/lib/actions/create-requester.js.map +0 -1
- package/src/lib/actions/create-ticket.d.ts +0 -46
- package/src/lib/actions/create-ticket.d.ts.map +0 -1
- package/src/lib/actions/create-ticket.js +0 -110
- package/src/lib/actions/create-ticket.js.map +0 -1
- package/src/lib/actions/delete-change-task.d.ts +0 -14
- package/src/lib/actions/delete-change-task.d.ts.map +0 -1
- package/src/lib/actions/delete-change-task.js +0 -39
- package/src/lib/actions/delete-change-task.js.map +0 -1
- package/src/lib/actions/delete-change.d.ts +0 -13
- package/src/lib/actions/delete-change.d.ts.map +0 -1
- package/src/lib/actions/delete-change.js +0 -34
- package/src/lib/actions/delete-change.js.map +0 -1
- package/src/lib/actions/request-ticket-approval.d.ts +0 -21
- package/src/lib/actions/request-ticket-approval.d.ts.map +0 -1
- package/src/lib/actions/request-ticket-approval.js +0 -52
- package/src/lib/actions/request-ticket-approval.js.map +0 -1
- package/src/lib/actions/update-change-task.d.ts +0 -33
- package/src/lib/actions/update-change-task.d.ts.map +0 -1
- package/src/lib/actions/update-change-task.js +0 -83
- package/src/lib/actions/update-change-task.js.map +0 -1
- package/src/lib/actions/update-change.d.ts +0 -54
- package/src/lib/actions/update-change.d.ts.map +0 -1
- package/src/lib/actions/update-change.js +0 -123
- package/src/lib/actions/update-change.js.map +0 -1
- package/src/lib/common/client.d.ts +0 -14
- package/src/lib/common/client.d.ts.map +0 -1
- package/src/lib/common/client.js +0 -30
- package/src/lib/common/client.js.map +0 -1
- package/src/lib/common/props.d.ts +0 -84
- package/src/lib/common/props.d.ts.map +0 -1
- package/src/lib/common/props.js +0 -292
- package/src/lib/common/props.js.map +0 -1
- package/src/lib/triggers/new-change-task.d.ts +0 -47
- package/src/lib/triggers/new-change-task.d.ts.map +0 -1
- package/src/lib/triggers/new-change-task.js +0 -86
- package/src/lib/triggers/new-change-task.js.map +0 -1
- package/src/lib/triggers/new-change.d.ts +0 -15
- package/src/lib/triggers/new-change.d.ts.map +0 -1
- package/src/lib/triggers/new-change.js +0 -87
- package/src/lib/triggers/new-change.js.map +0 -1
- package/src/lib/triggers/new-requester.d.ts +0 -15
- package/src/lib/triggers/new-requester.d.ts.map +0 -1
- package/src/lib/triggers/new-requester.js +0 -80
- package/src/lib/triggers/new-requester.js.map +0 -1
- package/src/lib/triggers/new-ticket.d.ts +0 -15
- package/src/lib/triggers/new-ticket.d.ts.map +0 -1
- package/src/lib/triggers/new-ticket.js +0 -84
- package/src/lib/triggers/new-ticket.js.map +0 -1
- package/src/lib/triggers/updated-change-task.d.ts +0 -47
- package/src/lib/triggers/updated-change-task.d.ts.map +0 -1
- package/src/lib/triggers/updated-change-task.js +0 -86
- package/src/lib/triggers/updated-change-task.js.map +0 -1
- package/src/lib/triggers/updated-change.d.ts +0 -15
- package/src/lib/triggers/updated-change.d.ts.map +0 -1
- package/src/lib/triggers/updated-change.js +0 -87
- package/src/lib/triggers/updated-change.js.map +0 -1
- package/src/lib/triggers/updated-requester.d.ts +0 -15
- package/src/lib/triggers/updated-requester.d.ts.map +0 -1
- package/src/lib/triggers/updated-requester.js +0 -80
- package/src/lib/triggers/updated-requester.js.map +0 -1
- package/src/lib/triggers/updated-ticket.d.ts +0 -15
- package/src/lib/triggers/updated-ticket.d.ts.map +0 -1
- package/src/lib/triggers/updated-ticket.js +0 -84
- package/src/lib/triggers/updated-ticket.js.map +0 -1
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.newChange = 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: 'changes',
|
|
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.changes.map((change) => ({
|
|
24
|
-
epochMilliSeconds: new Date(change.created_at).getTime(),
|
|
25
|
-
data: change,
|
|
26
|
-
}));
|
|
27
|
-
});
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
exports.newChange = (0, pieces_framework_1.createTrigger)({
|
|
31
|
-
auth: __1.freshserviceAuth,
|
|
32
|
-
name: 'new_change',
|
|
33
|
-
displayName: 'New Change',
|
|
34
|
-
description: 'Triggers when a new change request is created in Freshservice.',
|
|
35
|
-
aiMetadata: {
|
|
36
|
-
description: 'Fires when a new change request is created in Freshservice, representing a freshly proposed IT change entering change management. Polls newest-first by creation time across all changes in the account.',
|
|
37
|
-
},
|
|
38
|
-
props: {},
|
|
39
|
-
sampleData: {
|
|
40
|
-
id: 1,
|
|
41
|
-
subject: 'Upgrade server RAM',
|
|
42
|
-
description: '<div>Upgrade RAM on production server from 16GB to 32GB.</div>',
|
|
43
|
-
status: 1,
|
|
44
|
-
priority: 2,
|
|
45
|
-
impact: 2,
|
|
46
|
-
risk: 2,
|
|
47
|
-
change_type: 2,
|
|
48
|
-
requester_id: 1,
|
|
49
|
-
agent_id: 5,
|
|
50
|
-
department_id: 2,
|
|
51
|
-
group_id: 1,
|
|
52
|
-
planned_start_date: '2025-01-20T08:00:00Z',
|
|
53
|
-
planned_end_date: '2025-01-20T12:00:00Z',
|
|
54
|
-
created_at: '2025-01-15T09:30:00Z',
|
|
55
|
-
updated_at: '2025-01-15T09:30:00Z',
|
|
56
|
-
},
|
|
57
|
-
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
58
|
-
test(context) {
|
|
59
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
return yield pieces_common_1.pollingHelper.test(polling, context);
|
|
61
|
-
});
|
|
62
|
-
},
|
|
63
|
-
onEnable(context) {
|
|
64
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
66
|
-
auth: context.auth,
|
|
67
|
-
store: context.store,
|
|
68
|
-
propsValue: context.propsValue,
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
},
|
|
72
|
-
onDisable(context) {
|
|
73
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
74
|
-
yield pieces_common_1.pollingHelper.onDisable(polling, {
|
|
75
|
-
auth: context.auth,
|
|
76
|
-
store: context.store,
|
|
77
|
-
propsValue: context.propsValue,
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
},
|
|
81
|
-
run(context) {
|
|
82
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
83
|
-
return yield pieces_common_1.pollingHelper.poll(polling, context);
|
|
84
|
-
});
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
//# sourceMappingURL=new-change.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new-change.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-change.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAKqC;AACrC,8BAA0C;AAC1C,6CAAuD;AAGvD,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;a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AAE,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"}
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;;;;;;;;;;;;OA6CvB,CAAC"}
|
|
@@ -1,80 +0,0 @@
|
|
|
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
|
-
aiMetadata: {
|
|
36
|
-
description: 'Fires when a new requester (end-user) record is created in Freshservice, representing a person newly onboarded into the help desk. Polls newest-first by creation time across all requesters in the account.',
|
|
37
|
-
},
|
|
38
|
-
props: {},
|
|
39
|
-
sampleData: {
|
|
40
|
-
id: 1,
|
|
41
|
-
first_name: 'Jane',
|
|
42
|
-
last_name: 'Doe',
|
|
43
|
-
primary_email: 'jane.doe@example.com',
|
|
44
|
-
job_title: 'Software Engineer',
|
|
45
|
-
phone: '+1-555-0100',
|
|
46
|
-
mobile_phone_number: '+1-555-0101',
|
|
47
|
-
created_at: '2025-01-15T09:30:00Z',
|
|
48
|
-
updated_at: '2025-01-15T09:30:00Z',
|
|
49
|
-
},
|
|
50
|
-
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
51
|
-
test(context) {
|
|
52
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
return yield pieces_common_1.pollingHelper.test(polling, context);
|
|
54
|
-
});
|
|
55
|
-
},
|
|
56
|
-
onEnable(context) {
|
|
57
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
58
|
-
yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
59
|
-
auth: context.auth,
|
|
60
|
-
store: context.store,
|
|
61
|
-
propsValue: context.propsValue,
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
},
|
|
65
|
-
onDisable(context) {
|
|
66
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
67
|
-
yield pieces_common_1.pollingHelper.onDisable(polling, {
|
|
68
|
-
auth: context.auth,
|
|
69
|
-
store: context.store,
|
|
70
|
-
propsValue: context.propsValue,
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
},
|
|
74
|
-
run(context) {
|
|
75
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
76
|
-
return yield pieces_common_1.pollingHelper.poll(polling, context);
|
|
77
|
-
});
|
|
78
|
-
},
|
|
79
|
-
});
|
|
80
|
-
//# sourceMappingURL=new-requester.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,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C,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"}
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;;;;;;;;;;;;OAiDpB,CAAC"}
|
|
@@ -1,84 +0,0 @@
|
|
|
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
|
-
aiMetadata: {
|
|
36
|
-
description: 'Fires when a new ticket is created in Freshservice, representing a freshly logged incident or service request. Polls newest-first by creation time across all tickets in the account.',
|
|
37
|
-
},
|
|
38
|
-
props: {},
|
|
39
|
-
sampleData: {
|
|
40
|
-
id: 1,
|
|
41
|
-
subject: 'Unable to access email',
|
|
42
|
-
description: '<div>I cannot log into my email account since this morning.</div>',
|
|
43
|
-
status: 2,
|
|
44
|
-
priority: 2,
|
|
45
|
-
requester_id: 1,
|
|
46
|
-
responder_id: 5,
|
|
47
|
-
department_id: 2,
|
|
48
|
-
group_id: 1,
|
|
49
|
-
type: 'Incident',
|
|
50
|
-
source: 2,
|
|
51
|
-
created_at: '2025-01-15T09:30:00Z',
|
|
52
|
-
updated_at: '2025-01-15T09:30:00Z',
|
|
53
|
-
},
|
|
54
|
-
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
55
|
-
test(context) {
|
|
56
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
return yield pieces_common_1.pollingHelper.test(polling, context);
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
onEnable(context) {
|
|
61
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
63
|
-
auth: context.auth,
|
|
64
|
-
store: context.store,
|
|
65
|
-
propsValue: context.propsValue,
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
},
|
|
69
|
-
onDisable(context) {
|
|
70
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
yield pieces_common_1.pollingHelper.onDisable(polling, {
|
|
72
|
-
auth: context.auth,
|
|
73
|
-
store: context.store,
|
|
74
|
-
propsValue: context.propsValue,
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
},
|
|
78
|
-
run(context) {
|
|
79
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
80
|
-
return yield pieces_common_1.pollingHelper.poll(polling, context);
|
|
81
|
-
});
|
|
82
|
-
},
|
|
83
|
-
});
|
|
84
|
-
//# sourceMappingURL=new-ticket.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,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C,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"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const updatedChangeTask: 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
|
-
}>, {
|
|
6
|
-
change_id: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
7
|
-
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
8
|
-
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
9
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
10
|
-
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
11
|
-
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
12
|
-
}>>;
|
|
13
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
14
|
-
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
15
|
-
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
16
|
-
}>, {
|
|
17
|
-
change_id: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
18
|
-
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
19
|
-
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
20
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
21
|
-
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
22
|
-
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
23
|
-
}>>;
|
|
24
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
25
|
-
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
26
|
-
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
27
|
-
}>, {
|
|
28
|
-
change_id: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
29
|
-
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
30
|
-
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
31
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
32
|
-
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
33
|
-
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
34
|
-
}>>;
|
|
35
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
36
|
-
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
37
|
-
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
38
|
-
}>, {
|
|
39
|
-
change_id: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
40
|
-
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
41
|
-
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
42
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
43
|
-
domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
44
|
-
api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
45
|
-
}>>;
|
|
46
|
-
}>;
|
|
47
|
-
//# sourceMappingURL=updated-change-task.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"updated-change-task.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/updated-change-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAwCxC,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgD5B,CAAC"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updatedChangeTask = 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 props_1 = require("../common/props");
|
|
10
|
-
const polling = {
|
|
11
|
-
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
12
|
-
items(_a) {
|
|
13
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, lastFetchEpochMS, propsValue }) {
|
|
14
|
-
if (!propsValue.change_id)
|
|
15
|
-
return [];
|
|
16
|
-
const response = yield (0, client_1.freshserviceApiCall)({
|
|
17
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
18
|
-
endpoint: `changes/${propsValue.change_id}/tasks`,
|
|
19
|
-
auth,
|
|
20
|
-
queryParams: {
|
|
21
|
-
order_by: 'updated_at',
|
|
22
|
-
order_type: 'desc',
|
|
23
|
-
per_page: lastFetchEpochMS === 0 ? '10' : '100',
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
return response.body.tasks.map((task) => ({
|
|
27
|
-
epochMilliSeconds: new Date(task.updated_at).getTime(),
|
|
28
|
-
data: task,
|
|
29
|
-
}));
|
|
30
|
-
});
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
exports.updatedChangeTask = (0, pieces_framework_1.createTrigger)({
|
|
34
|
-
auth: __1.freshserviceAuth,
|
|
35
|
-
name: 'updated_change_task',
|
|
36
|
-
displayName: 'Updated Change Task',
|
|
37
|
-
description: 'Triggers when a task on a specific change request is updated. Note: newly created tasks may also fire this trigger because their updated_at matches created_at.',
|
|
38
|
-
aiMetadata: {
|
|
39
|
-
description: 'Fires when a task on one specific change request is modified in Freshservice (e.g. status, assignee, or due-date change), representing the latest state of that task. Scoped to a single change id chosen in setup; polls newest-first by last-updated time, and note that newly created tasks can also fire this because their updated time initially equals their creation time.',
|
|
40
|
-
},
|
|
41
|
-
props: {
|
|
42
|
-
change_id: props_1.freshserviceCommon.change(true),
|
|
43
|
-
},
|
|
44
|
-
sampleData: {
|
|
45
|
-
id: 1,
|
|
46
|
-
title: 'Review change impact',
|
|
47
|
-
description: 'Assess the blast radius before proceeding.',
|
|
48
|
-
status: 2,
|
|
49
|
-
agent_id: 5,
|
|
50
|
-
group_id: 1,
|
|
51
|
-
due_date: '2025-01-20T17:00:00Z',
|
|
52
|
-
notify_before: 0,
|
|
53
|
-
created_at: '2025-01-15T09:30:00Z',
|
|
54
|
-
updated_at: '2025-01-15T11:45:00Z',
|
|
55
|
-
},
|
|
56
|
-
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
57
|
-
test(context) {
|
|
58
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
59
|
-
return yield pieces_common_1.pollingHelper.test(polling, context);
|
|
60
|
-
});
|
|
61
|
-
},
|
|
62
|
-
onEnable(context) {
|
|
63
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
64
|
-
yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
65
|
-
auth: context.auth,
|
|
66
|
-
store: context.store,
|
|
67
|
-
propsValue: context.propsValue,
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
},
|
|
71
|
-
onDisable(context) {
|
|
72
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
73
|
-
yield pieces_common_1.pollingHelper.onDisable(polling, {
|
|
74
|
-
auth: context.auth,
|
|
75
|
-
store: context.store,
|
|
76
|
-
propsValue: context.propsValue,
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
},
|
|
80
|
-
run(context) {
|
|
81
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
82
|
-
return yield pieces_common_1.pollingHelper.poll(polling, context);
|
|
83
|
-
});
|
|
84
|
-
},
|
|
85
|
-
});
|
|
86
|
-
//# sourceMappingURL=updated-change-task.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"updated-change-task.js","sourceRoot":"","sources":["../../../../src/lib/triggers/updated-change-task.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAKqC;AACrC,8BAA0C;AAC1C,6CAAuD;AACvD,2CAA6E;AAI7E,MAAM,OAAO,GAGT;IACF,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAC5B,KAAK;qEAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE;YAChD,IAAI,CAAC,UAAU,CAAC,SAAS;gBAAE,OAAO,EAAE,CAAC;YACrC,MAAM,QAAQ,GAAG,MAAM,IAAA,4BAAmB,EAEvC;gBACD,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,QAAQ,EAAE,WAAW,U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,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"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const updatedChange: 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-change.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"updated-change.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/updated-change.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAqCxC,eAAO,MAAM,aAAa;;;;;;;;;;;;OAoDxB,CAAC"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updatedChange = 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: 'changes',
|
|
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.changes.map((change) => ({
|
|
24
|
-
epochMilliSeconds: new Date(change.updated_at).getTime(),
|
|
25
|
-
data: change,
|
|
26
|
-
}));
|
|
27
|
-
});
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
exports.updatedChange = (0, pieces_framework_1.createTrigger)({
|
|
31
|
-
auth: __1.freshserviceAuth,
|
|
32
|
-
name: 'updated_change',
|
|
33
|
-
displayName: 'Updated Change',
|
|
34
|
-
description: 'Triggers when an existing change request is updated in Freshservice. Note: newly created changes may also fire this trigger because their updated_at matches created_at.',
|
|
35
|
-
aiMetadata: {
|
|
36
|
-
description: 'Fires when an existing change request is modified in Freshservice (e.g. status, risk, or schedule change), representing the latest state of that change. Polls newest-first by last-updated time across all changes; note that newly created changes can also fire this because their updated time initially equals their creation time.',
|
|
37
|
-
},
|
|
38
|
-
props: {},
|
|
39
|
-
sampleData: {
|
|
40
|
-
id: 1,
|
|
41
|
-
subject: 'Upgrade server RAM',
|
|
42
|
-
description: '<div>Upgrade RAM on production server from 16GB to 32GB.</div>',
|
|
43
|
-
status: 2,
|
|
44
|
-
priority: 3,
|
|
45
|
-
impact: 2,
|
|
46
|
-
risk: 2,
|
|
47
|
-
change_type: 2,
|
|
48
|
-
requester_id: 1,
|
|
49
|
-
agent_id: 5,
|
|
50
|
-
department_id: 2,
|
|
51
|
-
group_id: 1,
|
|
52
|
-
planned_start_date: '2025-01-20T08:00:00Z',
|
|
53
|
-
planned_end_date: '2025-01-20T12:00:00Z',
|
|
54
|
-
created_at: '2025-01-15T09:30:00Z',
|
|
55
|
-
updated_at: '2025-01-15T11:45:00Z',
|
|
56
|
-
},
|
|
57
|
-
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
58
|
-
test(context) {
|
|
59
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
return yield pieces_common_1.pollingHelper.test(polling, context);
|
|
61
|
-
});
|
|
62
|
-
},
|
|
63
|
-
onEnable(context) {
|
|
64
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
66
|
-
auth: context.auth,
|
|
67
|
-
store: context.store,
|
|
68
|
-
propsValue: context.propsValue,
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
},
|
|
72
|
-
onDisable(context) {
|
|
73
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
74
|
-
yield pieces_common_1.pollingHelper.onDisable(polling, {
|
|
75
|
-
auth: context.auth,
|
|
76
|
-
store: context.store,
|
|
77
|
-
propsValue: context.propsValue,
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
},
|
|
81
|
-
run(context) {
|
|
82
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
83
|
-
return yield pieces_common_1.pollingHelper.poll(polling, context);
|
|
84
|
-
});
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
//# sourceMappingURL=updated-change.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"updated-change.js","sourceRoot":"","sources":["../../../../src/lib/triggers/updated-change.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAKqC;AACrC,8BAA0C;AAC1C,6CAAuD;AAGvD,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,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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"}
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;;;;;;;;;;;;OA6C3B,CAAC"}
|