@activepieces/piece-jira-data-center 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.
Files changed (89) hide show
  1. package/package.json +19 -0
  2. package/src/auth.d.ts +7 -0
  3. package/src/auth.d.ts.map +1 -0
  4. package/src/auth.js +59 -0
  5. package/src/auth.js.map +1 -0
  6. package/src/index.d.ts +5 -0
  7. package/src/index.d.ts.map +1 -0
  8. package/src/index.js +64 -0
  9. package/src/index.js.map +1 -0
  10. package/src/lib/actions/add-attachment-to-issue.d.ts +21 -0
  11. package/src/lib/actions/add-attachment-to-issue.d.ts.map +1 -0
  12. package/src/lib/actions/add-attachment-to-issue.js +41 -0
  13. package/src/lib/actions/add-attachment-to-issue.js.map +1 -0
  14. package/src/lib/actions/add-comment-to-issue.d.ts +21 -0
  15. package/src/lib/actions/add-comment-to-issue.d.ts.map +1 -0
  16. package/src/lib/actions/add-comment-to-issue.js +38 -0
  17. package/src/lib/actions/add-comment-to-issue.js.map +1 -0
  18. package/src/lib/actions/add-watcher-to-issue.d.ts +20 -0
  19. package/src/lib/actions/add-watcher-to-issue.d.ts.map +1 -0
  20. package/src/lib/actions/add-watcher-to-issue.js +48 -0
  21. package/src/lib/actions/add-watcher-to-issue.js.map +1 -0
  22. package/src/lib/actions/assign-issue.d.ts +27 -0
  23. package/src/lib/actions/assign-issue.d.ts.map +1 -0
  24. package/src/lib/actions/assign-issue.js +39 -0
  25. package/src/lib/actions/assign-issue.js.map +1 -0
  26. package/src/lib/actions/create-issue.d.ts +24 -0
  27. package/src/lib/actions/create-issue.d.ts.map +1 -0
  28. package/src/lib/actions/create-issue.js +110 -0
  29. package/src/lib/actions/create-issue.js.map +1 -0
  30. package/src/lib/actions/delete-issue-comment.d.ts +24 -0
  31. package/src/lib/actions/delete-issue-comment.d.ts.map +1 -0
  32. package/src/lib/actions/delete-issue-comment.js +64 -0
  33. package/src/lib/actions/delete-issue-comment.js.map +1 -0
  34. package/src/lib/actions/find-user.d.ts +7 -0
  35. package/src/lib/actions/find-user.d.ts.map +1 -0
  36. package/src/lib/actions/find-user.js +37 -0
  37. package/src/lib/actions/find-user.js.map +1 -0
  38. package/src/lib/actions/get-issue-attachment.d.ts +7 -0
  39. package/src/lib/actions/get-issue-attachment.d.ts.map +1 -0
  40. package/src/lib/actions/get-issue-attachment.js +46 -0
  41. package/src/lib/actions/get-issue-attachment.js.map +1 -0
  42. package/src/lib/actions/get-issue.d.ts +23 -0
  43. package/src/lib/actions/get-issue.d.ts.map +1 -0
  44. package/src/lib/actions/get-issue.js +136 -0
  45. package/src/lib/actions/get-issue.js.map +1 -0
  46. package/src/lib/actions/link-issues.d.ts +27 -0
  47. package/src/lib/actions/link-issues.d.ts.map +1 -0
  48. package/src/lib/actions/link-issues.js +52 -0
  49. package/src/lib/actions/link-issues.js.map +1 -0
  50. package/src/lib/actions/list-issue-comments.d.ts +22 -0
  51. package/src/lib/actions/list-issue-comments.d.ts.map +1 -0
  52. package/src/lib/actions/list-issue-comments.js +59 -0
  53. package/src/lib/actions/list-issue-comments.js.map +1 -0
  54. package/src/lib/actions/search-issues.d.ts +8 -0
  55. package/src/lib/actions/search-issues.d.ts.map +1 -0
  56. package/src/lib/actions/search-issues.js +40 -0
  57. package/src/lib/actions/search-issues.js.map +1 -0
  58. package/src/lib/actions/update-issue-comment.d.ts +25 -0
  59. package/src/lib/actions/update-issue-comment.d.ts.map +1 -0
  60. package/src/lib/actions/update-issue-comment.js +71 -0
  61. package/src/lib/actions/update-issue-comment.js.map +1 -0
  62. package/src/lib/actions/update-issue.d.ts +24 -0
  63. package/src/lib/actions/update-issue.d.ts.map +1 -0
  64. package/src/lib/actions/update-issue.js +122 -0
  65. package/src/lib/actions/update-issue.js.map +1 -0
  66. package/src/lib/common/index.d.ts +74 -0
  67. package/src/lib/common/index.d.ts.map +1 -0
  68. package/src/lib/common/index.js +197 -0
  69. package/src/lib/common/index.js.map +1 -0
  70. package/src/lib/common/props.d.ts +80 -0
  71. package/src/lib/common/props.d.ts.map +1 -0
  72. package/src/lib/common/props.js +572 -0
  73. package/src/lib/common/props.js.map +1 -0
  74. package/src/lib/common/types.d.ts +23 -0
  75. package/src/lib/common/types.d.ts.map +1 -0
  76. package/src/lib/common/types.js +25 -0
  77. package/src/lib/common/types.js.map +1 -0
  78. package/src/lib/triggers/new-issue.d.ts +23 -0
  79. package/src/lib/triggers/new-issue.d.ts.map +1 -0
  80. package/src/lib/triggers/new-issue.js +61 -0
  81. package/src/lib/triggers/new-issue.js.map +1 -0
  82. package/src/lib/triggers/updated-issue-status.d.ts +23 -0
  83. package/src/lib/triggers/updated-issue-status.d.ts.map +1 -0
  84. package/src/lib/triggers/updated-issue-status.js +61 -0
  85. package/src/lib/triggers/updated-issue-status.js.map +1 -0
  86. package/src/lib/triggers/updated-issue.d.ts +23 -0
  87. package/src/lib/triggers/updated-issue.d.ts.map +1 -0
  88. package/src/lib/triggers/updated-issue.js +61 -0
  89. package/src/lib/triggers/updated-issue.js.map +1 -0
@@ -0,0 +1,23 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const newIssue: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
+ }>, {
6
+ jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
7
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
8
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
10
+ }>, {
11
+ jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
12
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
13
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
15
+ }>, {
16
+ jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
17
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
18
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
19
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
20
+ }>, {
21
+ jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
22
+ }>;
23
+ //# sourceMappingURL=new-issue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-issue.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-issue.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,eAAe,EAEf,MAAM,gCAAgC,CAAC;AAgCxC,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;EA0BnB,CAAC"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.newIssue = 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 auth_1 = require("../../auth");
8
+ const common_1 = require("../common");
9
+ const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
10
+ const polling = {
11
+ strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
12
+ items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, lastFetchEpochMS, propsValue }) {
13
+ const { jql } = propsValue;
14
+ const searchQuery = `${jql ? jql + ' AND ' : ''}created > '${(0, dayjs_1.default)(lastFetchEpochMS).format('YYYY-MM-DD HH:mm')}'`;
15
+ const issues = yield (0, common_1.searchIssuesByJql)({
16
+ auth,
17
+ jql: searchQuery,
18
+ maxResults: 50,
19
+ });
20
+ return issues.map((issue) => ({
21
+ epochMilliSeconds: Date.parse(issue.fields.created),
22
+ data: issue,
23
+ }));
24
+ }),
25
+ };
26
+ exports.newIssue = (0, pieces_framework_1.createTrigger)({
27
+ name: 'new_issue',
28
+ displayName: 'New Issue',
29
+ description: 'Triggers when a new issue is created',
30
+ auth: auth_1.jiraDataCenterAuth,
31
+ type: pieces_framework_1.TriggerStrategy.POLLING,
32
+ props: {
33
+ jql: pieces_framework_1.Property.LongText({
34
+ displayName: 'JQL',
35
+ description: 'Use to filter issues watched',
36
+ required: false,
37
+ }),
38
+ },
39
+ sampleData: {},
40
+ onEnable(context) {
41
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
42
+ yield pieces_common_1.pollingHelper.onEnable(polling, context);
43
+ });
44
+ },
45
+ onDisable(context) {
46
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
47
+ yield pieces_common_1.pollingHelper.onDisable(polling, context);
48
+ });
49
+ },
50
+ run(context) {
51
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
52
+ return yield pieces_common_1.pollingHelper.poll(polling, context);
53
+ });
54
+ },
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
+ });
61
+ //# sourceMappingURL=new-issue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-issue.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-issue.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAIqC;AACrC,qCAAoE;AACpE,sCAA8C;AAC9C,0DAA0B;AAE1B,MAAM,OAAO,GAGT;IACH,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAA+C,EAAE,oDAA1C,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE;QACnD,MAAM,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC;QAC3B,MAAM,WAA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C,OAAO;;YACjB,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACnD,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const updatedIssueStatus: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
+ }>, {
6
+ jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
7
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
8
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
10
+ }>, {
11
+ jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
12
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
13
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
15
+ }>, {
16
+ jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
17
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
18
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
19
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
20
+ }>, {
21
+ jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
22
+ }>;
23
+ //# sourceMappingURL=updated-issue-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updated-issue-status.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/updated-issue-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,eAAe,EAEf,MAAM,gCAAgC,CAAC;AAgCxC,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;EA0B7B,CAAC"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updatedIssueStatus = 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 auth_1 = require("../../auth");
8
+ const common_1 = require("../common");
9
+ const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
10
+ const polling = {
11
+ strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
12
+ items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, lastFetchEpochMS, propsValue }) {
13
+ const { jql } = propsValue;
14
+ const searchQuery = `${jql ? jql + ' AND ' : ''}status CHANGED AFTER '${(0, dayjs_1.default)(lastFetchEpochMS).format('YYYY-MM-DD HH:mm')}'`;
15
+ const issues = yield (0, common_1.searchIssuesByJql)({
16
+ auth,
17
+ jql: searchQuery,
18
+ maxResults: 50,
19
+ });
20
+ return issues.map((issue) => ({
21
+ epochMilliSeconds: Date.parse(issue.fields.updated),
22
+ data: issue,
23
+ }));
24
+ }),
25
+ };
26
+ exports.updatedIssueStatus = (0, pieces_framework_1.createTrigger)({
27
+ name: 'updated_issue_status',
28
+ displayName: 'Updated Issue Status',
29
+ description: 'Triggers when an issue status is updated',
30
+ auth: auth_1.jiraDataCenterAuth,
31
+ type: pieces_framework_1.TriggerStrategy.POLLING,
32
+ props: {
33
+ jql: pieces_framework_1.Property.LongText({
34
+ displayName: 'JQL',
35
+ description: 'Use to filter issues watched',
36
+ required: false,
37
+ }),
38
+ },
39
+ sampleData: {},
40
+ onEnable(context) {
41
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
42
+ yield pieces_common_1.pollingHelper.onEnable(polling, context);
43
+ });
44
+ },
45
+ onDisable(context) {
46
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
47
+ yield pieces_common_1.pollingHelper.onDisable(polling, context);
48
+ });
49
+ },
50
+ run(context) {
51
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
52
+ return yield pieces_common_1.pollingHelper.poll(polling, context);
53
+ });
54
+ },
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
+ });
61
+ //# sourceMappingURL=updated-issue-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updated-issue-status.js","sourceRoot":"","sources":["../../../../src/lib/triggers/updated-issue-status.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAIqC;AACrC,qCAAoE;AACpE,sCAA8C;AAC9C,0DAA0B;AAE1B,MAAM,OAAO,GAGT;IACH,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAA+C,EAAE,oDAA1C,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE;QACnD,MAAM,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC;QAC3B,MAAM,WAAW,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,yBAAyB,IAAA,eAAK,EAC5E,gBAAgB,CAChB,CAAC,MAAM,CAAC,kBAAkB,CAAC,GAAG,CAAC;QAChC,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAiB,EAAC;YACtC,IAAI;YACJ,GAAG,EAAE,WAAW;YAChB,UAAU,EAAE,EAAE;SACd,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAC7B,iBAAiB,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;YACnD,IAAI,EAAE,KAAK;SACX,CAAC,CAAC,CAAC;IACL,CAAC,CAAA;CACD,CAAC;AAEW,QAAA,kBAAkB,GAAG,IAAA,gCAAa,EAAC;IAC/C,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,0CAA0C;IACvD,IAAI,EAAE,yBAAkB;IACxB,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,KAAK,EAAE;QACN,GAAG,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,KAAK;YAClB,WAAW,EAAE,8BAA8B;YAC3C,QAAQ,EAAE,KAAK;SACf,CAAC;KACF;IACD,UAAU,EAAE,EAAE;IACR,QAAQ,CAAC,OAAO;;YACrB,MAAM,6BAAa,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAChD,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACtB,MAAM,6BAAa,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjD,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YAChB,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACnD,CAAC;KAAA;IACK,IAAI,CAAC,OAAO;;YACjB,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACnD,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const updatedIssue: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
+ }>, {
6
+ jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
7
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
8
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
10
+ }>, {
11
+ jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
12
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
13
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
15
+ }>, {
16
+ jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
17
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
18
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
19
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
20
+ }>, {
21
+ jql: import("@activepieces/pieces-framework").LongTextProperty<false>;
22
+ }>;
23
+ //# sourceMappingURL=updated-issue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updated-issue.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/updated-issue.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,eAAe,EAEf,MAAM,gCAAgC,CAAC;AAgCxC,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;EA0BvB,CAAC"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updatedIssue = 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 auth_1 = require("../../auth");
8
+ const common_1 = require("../common");
9
+ const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
10
+ const polling = {
11
+ strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
12
+ items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, lastFetchEpochMS, propsValue }) {
13
+ const { jql } = propsValue;
14
+ const searchQuery = `${jql ? jql + ' AND ' : ''}updated > '${(0, dayjs_1.default)(lastFetchEpochMS).format('YYYY-MM-DD HH:mm')}'`;
15
+ const issues = yield (0, common_1.searchIssuesByJql)({
16
+ auth,
17
+ jql: searchQuery,
18
+ maxResults: 50,
19
+ });
20
+ return issues.map((issue) => ({
21
+ epochMilliSeconds: Date.parse(issue.fields.updated),
22
+ data: issue,
23
+ }));
24
+ }),
25
+ };
26
+ exports.updatedIssue = (0, pieces_framework_1.createTrigger)({
27
+ name: 'updated_issue',
28
+ displayName: 'Updated Issue',
29
+ description: 'Triggers when an issue is updated',
30
+ auth: auth_1.jiraDataCenterAuth,
31
+ type: pieces_framework_1.TriggerStrategy.POLLING,
32
+ props: {
33
+ jql: pieces_framework_1.Property.LongText({
34
+ displayName: 'JQL',
35
+ description: 'Use to filter issues watched',
36
+ required: false,
37
+ }),
38
+ },
39
+ sampleData: {},
40
+ onEnable(context) {
41
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
42
+ yield pieces_common_1.pollingHelper.onEnable(polling, context);
43
+ });
44
+ },
45
+ onDisable(context) {
46
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
47
+ yield pieces_common_1.pollingHelper.onDisable(polling, context);
48
+ });
49
+ },
50
+ run(context) {
51
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
52
+ return yield pieces_common_1.pollingHelper.poll(polling, context);
53
+ });
54
+ },
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
+ });
61
+ //# sourceMappingURL=updated-issue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updated-issue.js","sourceRoot":"","sources":["../../../../src/lib/triggers/updated-issue.ts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