@activepieces/piece-freshservice 0.1.1 → 0.1.3

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 (89) hide show
  1. package/package.json +7 -12
  2. package/src/index.js +14 -99
  3. package/src/index.d.ts +0 -9
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/add-note-to-change.d.ts +0 -15
  7. package/src/lib/actions/add-note-to-change.d.ts.map +0 -1
  8. package/src/lib/actions/add-note-to-change.js +0 -45
  9. package/src/lib/actions/add-note-to-change.js.map +0 -1
  10. package/src/lib/actions/add-note-to-ticket.d.ts +0 -15
  11. package/src/lib/actions/add-note-to-ticket.d.ts.map +0 -1
  12. package/src/lib/actions/add-note-to-ticket.js +0 -45
  13. package/src/lib/actions/add-note-to-ticket.js.map +0 -1
  14. package/src/lib/actions/create-change-task.d.ts +0 -32
  15. package/src/lib/actions/create-change-task.d.ts.map +0 -1
  16. package/src/lib/actions/create-change-task.js +0 -70
  17. package/src/lib/actions/create-change-task.js.map +0 -1
  18. package/src/lib/actions/create-change.d.ts +0 -47
  19. package/src/lib/actions/create-change.d.ts.map +0 -1
  20. package/src/lib/actions/create-change.js +0 -113
  21. package/src/lib/actions/create-change.js.map +0 -1
  22. package/src/lib/actions/create-requester.d.ts +0 -20
  23. package/src/lib/actions/create-requester.d.ts.map +0 -1
  24. package/src/lib/actions/create-requester.js +0 -82
  25. package/src/lib/actions/create-requester.js.map +0 -1
  26. package/src/lib/actions/create-ticket.d.ts +0 -46
  27. package/src/lib/actions/create-ticket.d.ts.map +0 -1
  28. package/src/lib/actions/create-ticket.js +0 -105
  29. package/src/lib/actions/create-ticket.js.map +0 -1
  30. package/src/lib/actions/delete-change-task.d.ts +0 -14
  31. package/src/lib/actions/delete-change-task.d.ts.map +0 -1
  32. package/src/lib/actions/delete-change-task.js +0 -34
  33. package/src/lib/actions/delete-change-task.js.map +0 -1
  34. package/src/lib/actions/delete-change.d.ts +0 -13
  35. package/src/lib/actions/delete-change.d.ts.map +0 -1
  36. package/src/lib/actions/delete-change.js +0 -29
  37. package/src/lib/actions/delete-change.js.map +0 -1
  38. package/src/lib/actions/request-ticket-approval.d.ts +0 -21
  39. package/src/lib/actions/request-ticket-approval.d.ts.map +0 -1
  40. package/src/lib/actions/request-ticket-approval.js +0 -47
  41. package/src/lib/actions/request-ticket-approval.js.map +0 -1
  42. package/src/lib/actions/update-change-task.d.ts +0 -33
  43. package/src/lib/actions/update-change-task.d.ts.map +0 -1
  44. package/src/lib/actions/update-change-task.js +0 -78
  45. package/src/lib/actions/update-change-task.js.map +0 -1
  46. package/src/lib/actions/update-change.d.ts +0 -54
  47. package/src/lib/actions/update-change.d.ts.map +0 -1
  48. package/src/lib/actions/update-change.js +0 -118
  49. package/src/lib/actions/update-change.js.map +0 -1
  50. package/src/lib/common/client.d.ts +0 -14
  51. package/src/lib/common/client.d.ts.map +0 -1
  52. package/src/lib/common/client.js +0 -30
  53. package/src/lib/common/client.js.map +0 -1
  54. package/src/lib/common/props.d.ts +0 -84
  55. package/src/lib/common/props.d.ts.map +0 -1
  56. package/src/lib/common/props.js +0 -292
  57. package/src/lib/common/props.js.map +0 -1
  58. package/src/lib/triggers/new-change-task.d.ts +0 -47
  59. package/src/lib/triggers/new-change-task.d.ts.map +0 -1
  60. package/src/lib/triggers/new-change-task.js +0 -83
  61. package/src/lib/triggers/new-change-task.js.map +0 -1
  62. package/src/lib/triggers/new-change.d.ts +0 -15
  63. package/src/lib/triggers/new-change.d.ts.map +0 -1
  64. package/src/lib/triggers/new-change.js +0 -84
  65. package/src/lib/triggers/new-change.js.map +0 -1
  66. package/src/lib/triggers/new-requester.d.ts +0 -15
  67. package/src/lib/triggers/new-requester.d.ts.map +0 -1
  68. package/src/lib/triggers/new-requester.js +0 -77
  69. package/src/lib/triggers/new-requester.js.map +0 -1
  70. package/src/lib/triggers/new-ticket.d.ts +0 -15
  71. package/src/lib/triggers/new-ticket.d.ts.map +0 -1
  72. package/src/lib/triggers/new-ticket.js +0 -81
  73. package/src/lib/triggers/new-ticket.js.map +0 -1
  74. package/src/lib/triggers/updated-change-task.d.ts +0 -47
  75. package/src/lib/triggers/updated-change-task.d.ts.map +0 -1
  76. package/src/lib/triggers/updated-change-task.js +0 -83
  77. package/src/lib/triggers/updated-change-task.js.map +0 -1
  78. package/src/lib/triggers/updated-change.d.ts +0 -15
  79. package/src/lib/triggers/updated-change.d.ts.map +0 -1
  80. package/src/lib/triggers/updated-change.js +0 -84
  81. package/src/lib/triggers/updated-change.js.map +0 -1
  82. package/src/lib/triggers/updated-requester.d.ts +0 -15
  83. package/src/lib/triggers/updated-requester.d.ts.map +0 -1
  84. package/src/lib/triggers/updated-requester.js +0 -77
  85. package/src/lib/triggers/updated-requester.js.map +0 -1
  86. package/src/lib/triggers/updated-ticket.d.ts +0 -15
  87. package/src/lib/triggers/updated-ticket.d.ts.map +0 -1
  88. package/src/lib/triggers/updated-ticket.js +0 -81
  89. package/src/lib/triggers/updated-ticket.js.map +0 -1
@@ -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;;;;;;;;;;;;OA0CvB,CAAC"}
@@ -1,77 +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
- 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
@@ -1 +0,0 @@
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,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,CAAC,CA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,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;;;;;;;;;;;;OA8CpB,CAAC"}
@@ -1,81 +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
- 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
@@ -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,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,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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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6C5B,CAAC"}
@@ -1,83 +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
- props: {
39
- change_id: props_1.freshserviceCommon.change(true),
40
- },
41
- sampleData: {
42
- id: 1,
43
- title: 'Review change impact',
44
- description: 'Assess the blast radius before proceeding.',
45
- status: 2,
46
- agent_id: 5,
47
- group_id: 1,
48
- due_date: '2025-01-20T17:00:00Z',
49
- notify_before: 0,
50
- created_at: '2025-01-15T09:30:00Z',
51
- updated_at: '2025-01-15T11:45:00Z',
52
- },
53
- type: pieces_framework_1.TriggerStrategy.POLLING,
54
- test(context) {
55
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
56
- return yield pieces_common_1.pollingHelper.test(polling, context);
57
- });
58
- },
59
- onEnable(context) {
60
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
61
- yield pieces_common_1.pollingHelper.onEnable(polling, {
62
- auth: context.auth,
63
- store: context.store,
64
- propsValue: context.propsValue,
65
- });
66
- });
67
- },
68
- onDisable(context) {
69
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
70
- yield pieces_common_1.pollingHelper.onDisable(polling, {
71
- auth: context.auth,
72
- store: context.store,
73
- propsValue: context.propsValue,
74
- });
75
- });
76
- },
77
- run(context) {
78
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
79
- return yield pieces_common_1.pollingHelper.poll(polling, context);
80
- });
81
- },
82
- });
83
- //# 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,UAAU,CAAC,SAAS,QAAQ;gBACjD,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,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBACxC,iBAAiB,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE;gBACtD,IAAI,EAAE,I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C,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;;;;;;;;;;;;OAiDxB,CAAC"}
@@ -1,84 +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
- props: {},
36
- sampleData: {
37
- id: 1,
38
- subject: 'Upgrade server RAM',
39
- description: '<div>Upgrade RAM on production server from 16GB to 32GB.</div>',
40
- status: 2,
41
- priority: 3,
42
- impact: 2,
43
- risk: 2,
44
- change_type: 2,
45
- requester_id: 1,
46
- agent_id: 5,
47
- department_id: 2,
48
- group_id: 1,
49
- planned_start_date: '2025-01-20T08:00:00Z',
50
- planned_end_date: '2025-01-20T12:00:00Z',
51
- created_at: '2025-01-15T09:30:00Z',
52
- updated_at: '2025-01-15T11:45: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=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,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,aAAa,GAAG,IAAA,gCAAa,EAAC;IACzC,IAAI,EAAE,oBAAgB;IACtB,IAAI,EAAE,gBAAgB;IACtB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@@ -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;;;;;;;;;;;;OA0C3B,CAAC"}
@@ -1,77 +0,0 @@
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
@@ -1 +0,0 @@
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,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;iBAChD;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;gBAClD,iBAAiB,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE;gBAC3D,IAAI,EAAE,SAAS;aAChB,CAAC,CAAC,CAAC;QACN,CAAC;KAAA;CACF,CAAC;AAEW,QAAA,gBAAgB,GAAG,IAAA,gCAAa,EAAC;IAC5C,IAAI,EAAE,oBAAgB;IACtB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,iEAAiE;IAC9E,KAAK,EAAE,EAAE;IACT,UAAU,EAAE;QACV,EAAE,EAAE,CAAC;QACL,UAAU,EAAE,MAAM;QAClB,SAAS,EAAE,KAAK;QAChB,aAAa,EAAE,sBAAsB;QACrC,SAAS,EAAE,0BAA0B;QACrC,KAAK,EAAE,aAAa;QACpB,mBAAmB,EAAE,aAAa;QAClC,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 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
@@ -1 +0,0 @@
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"}