@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
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@activepieces/piece-jira-data-center",
3
+ "version": "0.0.1",
4
+ "main": "./src/index.js",
5
+ "types": "./src/index.d.ts",
6
+ "dependencies": {
7
+ "@activepieces/pieces-common": "0.12.0",
8
+ "@activepieces/pieces-framework": "0.26.0",
9
+ "@activepieces/shared": "0.46.1",
10
+ "dayjs": "1.11.9",
11
+ "form-data": "4.0.4",
12
+ "zod": "4.3.6",
13
+ "tslib": "2.6.2"
14
+ },
15
+ "scripts": {
16
+ "build": "tsc -p tsconfig.lib.json && cp package.json dist/",
17
+ "lint": "eslint 'src/**/*.ts'"
18
+ }
19
+ }
package/src/auth.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { AppConnectionValueForAuthProperty } from '@activepieces/pieces-framework';
2
+ export declare const jiraDataCenterAuth: import("@activepieces/pieces-framework").CustomAuthProperty<{
3
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
+ }>;
6
+ export type JiraDataCenterAuth = AppConnectionValueForAuthProperty<typeof jiraDataCenterAuth>;
7
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,iCAAiC,EAGjC,MAAM,gCAAgC,CAAC;AAOxC,eAAO,MAAM,kBAAkB;;;EA+C7B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,iCAAiC,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
package/src/auth.js ADDED
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.jiraDataCenterAuth = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const common_1 = require("./lib/common");
7
+ const pieces_common_1 = require("@activepieces/pieces-common");
8
+ const zod_1 = require("zod");
9
+ const pieces_common_2 = require("@activepieces/pieces-common");
10
+ const shared_1 = require("@activepieces/shared");
11
+ exports.jiraDataCenterAuth = pieces_framework_1.PieceAuth.CustomAuth({
12
+ description: `
13
+ To generate a Personal Access Token (PAT):
14
+ 1. Log in to your Jira Data Center instance.
15
+ 2. Click your **profile icon** (top-right) → **Profile**.
16
+ 3. Go to **Personal Access Tokens** → **Create token**.
17
+ 4. Set a name and expiry, then copy the generated token.
18
+ `,
19
+ required: true,
20
+ props: {
21
+ instanceUrl: pieces_framework_1.Property.ShortText({
22
+ displayName: 'Instance URL',
23
+ description: 'The URL of your Jira Data Center instance (e.g. https://jira.yourcompany.com)',
24
+ required: true,
25
+ }),
26
+ personalAccessToken: pieces_framework_1.PieceAuth.SecretText({
27
+ displayName: 'Personal Access Token',
28
+ description: 'Your Jira Data Center Personal Access Token (PAT)',
29
+ required: true,
30
+ }),
31
+ },
32
+ validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
33
+ var _b, _c;
34
+ try {
35
+ yield pieces_common_2.propsValidation.validateZod(auth, {
36
+ instanceUrl: zod_1.z.string().url(),
37
+ });
38
+ yield (0, common_1.sendJiraRequest)({
39
+ auth: {
40
+ type: shared_1.AppConnectionType.CUSTOM_AUTH,
41
+ props: auth,
42
+ },
43
+ method: pieces_common_1.HttpMethod.GET,
44
+ url: 'myself',
45
+ });
46
+ return {
47
+ valid: true,
48
+ };
49
+ }
50
+ catch (e) {
51
+ const message = (_c = (_b = e.response) === null || _b === void 0 ? void 0 : _b.body) === null || _c === void 0 ? void 0 : _c.message;
52
+ return {
53
+ valid: false,
54
+ error: message !== null && message !== void 0 ? message : 'Invalid credentials',
55
+ };
56
+ }
57
+ }),
58
+ });
59
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,yCAA+C;AAC/C,+DAAoE;AACpE,6BAAwB;AACxB,+DAA8D;AAC9D,iDAAyD;AAE5C,QAAA,kBAAkB,GAAG,4BAAS,CAAC,UAAU,CAAC;IACtD,WAAW,EAAE;;;;;;KAMT;IACJ,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACN,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,cAAc;YAC3B,WAAW,EACV,+EAA+E;YAChF,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,mBAAmB,EAAE,4BAAS,CAAC,UAAU,CAAC;YACzC,WAAW,EAAE,uBAAuB;YACpC,WAAW,EAAE,mDAAmD;YAChE,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACD,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;;QACxB,IAAI,CAAC;YACJ,MAAM,+BAAe,CAAC,WAAW,CAAC,IAAI,EAAE;gBACvC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;aAC7B,CAAC,CAAC;YAEH,MAAM,IAAA,wBAAe,EAAC;gBACrB,IAAI,EAAE;oBACL,IAAI,EAAE,0BAAiB,CAAC,WAAW;oBACnC,KAAK,EAAE,IAAI;iBACX;gBACD,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,QAAQ;aACb,CAAC,CAAC;YACH,OAAO;gBACN,KAAK,EAAE,IAAI;aACX,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,MAAM,OAAO,GAAG,MAAC,MAAC,CAAe,CAAC,QAAQ,0CAAE,IAAY,0CAAE,OAAO,CAAC;YAClE,OAAO;gBACN,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,qBAAqB;aACvC,CAAC;QACH,CAAC;IACF,CAAC,CAAA;CACD,CAAC,CAAC"}
package/src/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export declare const jiraDataCenter: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
+ }>>;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,cAAc;;;GAsCzB,CAAC"}
package/src/index.js ADDED
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.jiraDataCenter = 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 shared_1 = require("@activepieces/shared");
8
+ const auth_1 = require("./auth");
9
+ const create_issue_1 = require("./lib/actions/create-issue");
10
+ const search_issues_1 = require("./lib/actions/search-issues");
11
+ const new_issue_1 = require("./lib/triggers/new-issue");
12
+ const updated_issue_1 = require("./lib/triggers/updated-issue");
13
+ const updated_issue_status_1 = require("./lib/triggers/updated-issue-status");
14
+ const add_comment_to_issue_1 = require("./lib/actions/add-comment-to-issue");
15
+ const add_attachment_to_issue_1 = require("./lib/actions/add-attachment-to-issue");
16
+ const update_issue_comment_1 = require("./lib/actions/update-issue-comment");
17
+ const delete_issue_comment_1 = require("./lib/actions/delete-issue-comment");
18
+ const update_issue_1 = require("./lib/actions/update-issue");
19
+ const assign_issue_1 = require("./lib/actions/assign-issue");
20
+ const list_issue_comments_1 = require("./lib/actions/list-issue-comments");
21
+ const find_user_1 = require("./lib/actions/find-user");
22
+ const add_watcher_to_issue_1 = require("./lib/actions/add-watcher-to-issue");
23
+ const link_issues_1 = require("./lib/actions/link-issues");
24
+ const get_issue_attachment_1 = require("./lib/actions/get-issue-attachment");
25
+ const get_issue_1 = require("./lib/actions/get-issue");
26
+ exports.jiraDataCenter = (0, pieces_framework_1.createPiece)({
27
+ displayName: 'Jira Data Center',
28
+ description: 'Issue tracking and project management for Jira Data Center and Server',
29
+ auth: auth_1.jiraDataCenterAuth,
30
+ minimumSupportedRelease: '0.36.1',
31
+ logoUrl: 'https://cdn.activepieces.com/pieces/jira.png',
32
+ categories: [shared_1.PieceCategory.PRODUCTIVITY],
33
+ authors: [],
34
+ actions: [
35
+ create_issue_1.createIssueAction,
36
+ update_issue_1.updateIssueAction,
37
+ get_issue_1.getIssueAction,
38
+ find_user_1.findUserAction,
39
+ search_issues_1.searchIssuesAction,
40
+ assign_issue_1.assignIssueAction,
41
+ add_attachment_to_issue_1.addAttachmentToIssueAction,
42
+ get_issue_attachment_1.getIssueAttachmentAction,
43
+ add_watcher_to_issue_1.addWatcherToIssueAction,
44
+ add_comment_to_issue_1.addCommentToIssueAction,
45
+ update_issue_comment_1.updateIssueCommentAction,
46
+ link_issues_1.linkIssuesAction,
47
+ list_issue_comments_1.listIssueCommentsAction,
48
+ delete_issue_comment_1.deleteIssueCommentAction,
49
+ (0, pieces_common_1.createCustomApiCallAction)({
50
+ baseUrl: (auth) => {
51
+ return auth ? `${auth.props.instanceUrl}/rest/api/2` : '';
52
+ },
53
+ auth: auth_1.jiraDataCenterAuth,
54
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
55
+ const typedAuth = auth;
56
+ return {
57
+ Authorization: `Bearer ${typedAuth.props.personalAccessToken}`,
58
+ };
59
+ }),
60
+ }),
61
+ ],
62
+ triggers: [new_issue_1.newIssue, updated_issue_1.updatedIssue, updated_issue_status_1.updatedIssueStatus],
63
+ });
64
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6D;AAE7D,+DAAwE;AACxE,iDAAqD;AACrD,iCAAgE;AAChE,6DAA+D;AAC/D,+DAAiE;AACjE,wDAAoD;AACpD,gEAA4D;AAC5D,8EAAyE;AACzE,6EAA6E;AAC7E,mFAAmF;AACnF,6EAA8E;AAC9E,6EAA8E;AAC9E,6DAA+D;AAC/D,6DAA+D;AAC/D,2EAA4E;AAC5E,uDAAyD;AACzD,6EAA6E;AAC7E,2DAA6D;AAC7D,6EAA8E;AAC9E,uDAAyD;AAE5C,QAAA,cAAc,GAAG,IAAA,8BAAW,EAAC;IACzC,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,uEAAuE;IAEpF,IAAI,EAAE,yBAAkB;IACxB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,8CAA8C;IACvD,UAAU,EAAE,CAAC,sBAAa,CAAC,YAAY,CAAC;IACxC,OAAO,EAAE,EAAE;IACX,OAAO,EAAE;QACR,gCAAiB;QACjB,gCAAiB;QACjB,0BAAc;QACd,0BAAc;QACd,kCAAkB;QAClB,gCAAiB;QACjB,oDAA0B;QAC1B,+CAAwB;QACxB,8CAAuB;QACvB,8CAAuB;QACvB,+CAAwB;QACxB,8BAAgB;QAChB,6CAAuB;QACvB,+CAAwB;QACxB,IAAA,yCAAyB,EAAC;YACzB,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;gBACjB,OAAO,IAAI,CAAC,CAAC,CAAC,GAAI,IAA2B,CAAC,KAAK,CAAC,WAAW,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;YACnF,CAAC;YACD,IAAI,EAAE,yBAAkB;YACxB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC3B,MAAM,SAAS,GAAG,IAA0B,CAAC;gBAC7C,OAAO;oBACN,aAAa,EAAE,UAAU,SAAS,CAAC,KAAK,CAAC,mBAAmB,EAAE;iBAC9D,CAAC;YACH,CAAC,CAAA;SACD,CAAC;KACF;IACD,QAAQ,EAAE,CAAC,oBAAQ,EAAE,4BAAY,EAAE,yCAAkB,CAAC;CACtD,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ export declare const addAttachmentToIssueAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ projectId: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
6
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
8
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
9
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
11
+ }>>;
12
+ issueId: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
13
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
15
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
16
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
17
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
18
+ }>>;
19
+ attachment: import("@activepieces/pieces-framework").FileProperty<true>;
20
+ }>;
21
+ //# sourceMappingURL=add-attachment-to-issue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-attachment-to-issue.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/add-attachment-to-issue.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;EA+BrC,CAAC"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addAttachmentToIssueAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const auth_1 = require("../../auth");
7
+ const pieces_common_1 = require("@activepieces/pieces-common");
8
+ const common_1 = require("../common");
9
+ const form_data_1 = tslib_1.__importDefault(require("form-data"));
10
+ const props_1 = require("../common/props");
11
+ exports.addAttachmentToIssueAction = (0, pieces_framework_1.createAction)({
12
+ auth: auth_1.jiraDataCenterAuth,
13
+ name: 'add_issue_attachment',
14
+ displayName: 'Add Attachment to Issue',
15
+ description: 'Adds an attachment to an issue.',
16
+ props: {
17
+ projectId: (0, props_1.getProjectIdDropdown)(),
18
+ issueId: (0, props_1.getIssueIdDropdown)({ refreshers: ['projectId'] }),
19
+ attachment: pieces_framework_1.Property.File({
20
+ displayName: 'Attachment',
21
+ required: true,
22
+ }),
23
+ },
24
+ run(context) {
25
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
26
+ const { issueId, attachment } = context.propsValue;
27
+ const formData = new form_data_1.default();
28
+ const fileBuffer = Buffer.from(attachment.base64, 'base64');
29
+ formData.append('file', fileBuffer, attachment.filename);
30
+ const response = yield (0, common_1.sendJiraRequest)({
31
+ method: pieces_common_1.HttpMethod.POST,
32
+ url: `issue/${issueId}/attachments`,
33
+ auth: context.auth,
34
+ headers: Object.assign({ 'X-Atlassian-Token': 'no-check' }, formData.getHeaders()),
35
+ body: formData,
36
+ });
37
+ return response.body;
38
+ });
39
+ },
40
+ });
41
+ //# sourceMappingURL=add-attachment-to-issue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-attachment-to-issue.js","sourceRoot":"","sources":["../../../../src/lib/actions/add-attachment-to-issue.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,qCAAgD;AAChD,+DAAyD;AACzD,sCAA4C;AAC5C,kEAAiC;AACjC,2CAA2E;AAE9D,QAAA,0BAA0B,GAAG,IAAA,+BAAY,EAAC;IACtD,IAAI,EAAE,yBAAkB;IACxB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,yBAAyB;IACtC,WAAW,EAAE,iCAAiC;IAC9C,KAAK,EAAE;QACN,SAAS,EAAE,IAAA,4BAAoB,GAAE;QACjC,OAAO,EAAE,IAAA,0BAAkB,EAAC,EAAE,UAAU,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC;QAC1D,UAAU,EAAE,2BAAQ,CAAC,IAAI,CAAC;YACzB,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACnD,MAAM,QAAQ,GAAG,IAAI,mBAAQ,EAAE,CAAC;YAChC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YAC5D,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;YAEzD,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAe,EAAC;gBACtC,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,SAAS,OAAO,cAAc;gBACnC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,OAAO,kBACN,mBAAmB,EAAE,UAAU,IAC5B,QAAQ,CAAC,UAAU,EAAE,CACxB;gBACD,IAAI,EAAE,QAAQ;aACd,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ export declare const addCommentToIssueAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ projectId: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
6
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
8
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
9
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
11
+ }>>;
12
+ issueId: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
13
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
15
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
16
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
17
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
18
+ }>>;
19
+ comment: import("@activepieces/pieces-framework").LongTextProperty<true>;
20
+ }>;
21
+ //# sourceMappingURL=add-comment-to-issue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-comment-to-issue.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/add-comment-to-issue.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;EA0BlC,CAAC"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addCommentToIssueAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const auth_1 = require("../../auth");
7
+ const pieces_common_1 = require("@activepieces/pieces-common");
8
+ const common_1 = require("../common");
9
+ const props_1 = require("../common/props");
10
+ exports.addCommentToIssueAction = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.jiraDataCenterAuth,
12
+ name: 'add_issue_comment',
13
+ displayName: 'Add Issue Comment',
14
+ description: 'Adds a comment to an issue.',
15
+ props: {
16
+ projectId: (0, props_1.getProjectIdDropdown)(),
17
+ issueId: (0, props_1.getIssueIdDropdown)({ refreshers: ['projectId'] }),
18
+ comment: pieces_framework_1.Property.LongText({
19
+ displayName: 'Comment Body',
20
+ required: true,
21
+ }),
22
+ },
23
+ run(context) {
24
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
25
+ const { issueId, comment } = context.propsValue;
26
+ const response = yield (0, common_1.sendJiraRequest)({
27
+ method: pieces_common_1.HttpMethod.POST,
28
+ url: `issue/${issueId}/comment`,
29
+ auth: context.auth,
30
+ body: {
31
+ body: comment,
32
+ },
33
+ });
34
+ return response.body;
35
+ });
36
+ },
37
+ });
38
+ //# sourceMappingURL=add-comment-to-issue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-comment-to-issue.js","sourceRoot":"","sources":["../../../../src/lib/actions/add-comment-to-issue.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,qCAAgD;AAChD,+DAAyD;AACzD,sCAA4C;AAC5C,2CAA2E;AAE9D,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,yBAAkB;IACxB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,6BAA6B;IAC1C,KAAK,EAAE;QACN,SAAS,EAAE,IAAA,4BAAoB,GAAE;QACjC,OAAO,EAAE,IAAA,0BAAkB,EAAC,EAAE,UAAU,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC;QAC1D,OAAO,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC1B,WAAW,EAAE,cAAc;YAC3B,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEhD,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAe,EAAC;gBACtC,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,SAAS,OAAO,UAAU;gBAC/B,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,IAAI,EAAE;oBACL,IAAI,EAAE,OAAO;iBACb;aACD,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ export declare const addWatcherToIssueAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ issueId: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
6
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
8
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
9
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
11
+ }>>;
12
+ userId: import("@activepieces/pieces-framework").DropdownProperty<any, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
13
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
15
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<any, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
16
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
17
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
18
+ }>>;
19
+ }>;
20
+ //# sourceMappingURL=add-watcher-to-issue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-watcher-to-issue.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/add-watcher-to-issue.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;EAmClC,CAAC"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addWatcherToIssueAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const auth_1 = require("../../auth");
7
+ const props_1 = require("../common/props");
8
+ const shared_1 = require("@activepieces/shared");
9
+ const common_1 = require("../common");
10
+ const pieces_common_1 = require("@activepieces/pieces-common");
11
+ exports.addWatcherToIssueAction = (0, pieces_framework_1.createAction)({
12
+ auth: auth_1.jiraDataCenterAuth,
13
+ name: 'add-watcher-to-issue',
14
+ displayName: 'Add Watcher to Issue',
15
+ description: 'Adds a new watcher to an issue.',
16
+ props: {
17
+ issueId: (0, props_1.issueIdOrKeyProp)('Issue ID or Key', true),
18
+ userId: (0, props_1.getUsersDropdown)({
19
+ displayName: 'User',
20
+ refreshers: [],
21
+ required: true,
22
+ }),
23
+ },
24
+ run(context) {
25
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
26
+ const { issueId, userId } = context.propsValue;
27
+ if ((0, shared_1.isNil)(issueId)) {
28
+ throw new Error('Issue ID is required');
29
+ }
30
+ if ((0, shared_1.isNil)(userId)) {
31
+ throw new Error('User ID is required');
32
+ }
33
+ try {
34
+ yield (0, common_1.jiraApiCall)({
35
+ auth: context.auth,
36
+ method: pieces_common_1.HttpMethod.POST,
37
+ resourceUri: `/issue/${issueId}/watchers`,
38
+ body: `"${userId}"`,
39
+ });
40
+ return { success: true };
41
+ }
42
+ catch (e) {
43
+ return { success: false, error: e.message };
44
+ }
45
+ });
46
+ },
47
+ });
48
+ //# sourceMappingURL=add-watcher-to-issue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-watcher-to-issue.js","sourceRoot":"","sources":["../../../../src/lib/actions/add-watcher-to-issue.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,qCAAgD;AAChD,2CAAqE;AACrE,iDAA6C;AAC7C,sCAAwC;AACxC,+DAAoE;AAEvD,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,yBAAkB;IACxB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,iCAAiC;IAC9C,KAAK,EAAE;QACN,OAAO,EAAE,IAAA,wBAAgB,EAAC,iBAAiB,EAAE,IAAI,CAAC;QAClD,MAAM,EAAE,IAAA,wBAAgB,EAAC;YACxB,WAAW,EAAE,MAAM;YACnB,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC/C,IAAI,IAAA,cAAK,EAAC,OAAO,CAAC,EAAE,CAAC;gBACpB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;YACzC,CAAC;YACD,IAAI,IAAA,cAAK,EAAC,MAAM,CAAC,EAAE,CAAC;gBACnB,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;YACxC,CAAC;YAED,IAAI,CAAC;gBACJ,MAAM,IAAA,oBAAW,EAAC;oBACjB,IAAI,EAAE,OAAO,CAAC,IAAI;oBAClB,MAAM,EAAE,0BAAU,CAAC,IAAI;oBACvB,WAAW,EAAE,UAAU,OAAO,WAAW;oBACzC,IAAI,EAAE,IAAI,MAAM,GAAG;iBACnB,CAAC,CAAC;gBAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YAC1B,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACZ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAG,CAAe,CAAC,OAAO,EAAE,CAAC;YAC5D,CAAC;QACF,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ export declare const assignIssueAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ projectId: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
6
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
8
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
9
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
11
+ }>>;
12
+ issueId: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
13
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
15
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
16
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
17
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
18
+ }>>;
19
+ assignee: import("@activepieces/pieces-framework").DropdownProperty<any, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
20
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
21
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
22
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<any, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
23
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
24
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
25
+ }>>;
26
+ }>;
27
+ //# sourceMappingURL=assign-issue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assign-issue.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/assign-issue.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;EA0B5B,CAAC"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assignIssueAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const auth_1 = require("../../auth");
7
+ const pieces_common_1 = require("@activepieces/pieces-common");
8
+ const common_1 = require("../common");
9
+ const props_1 = require("../common/props");
10
+ exports.assignIssueAction = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.jiraDataCenterAuth,
12
+ name: 'assign_issue',
13
+ displayName: 'Assign Issue',
14
+ description: 'Assigns an issue to a user.',
15
+ props: {
16
+ projectId: (0, props_1.getProjectIdDropdown)(),
17
+ issueId: (0, props_1.getIssueIdDropdown)({ refreshers: ['projectId'] }),
18
+ assignee: (0, props_1.getUsersDropdown)({
19
+ displayName: 'Assignee',
20
+ refreshers: ['projectId'],
21
+ required: true,
22
+ }),
23
+ },
24
+ run(context) {
25
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
26
+ const { issueId, assignee } = context.propsValue;
27
+ const response = yield (0, common_1.sendJiraRequest)({
28
+ method: pieces_common_1.HttpMethod.PUT,
29
+ url: `issue/${issueId}/assignee`,
30
+ auth: context.auth,
31
+ body: {
32
+ name: assignee,
33
+ },
34
+ });
35
+ return response.body;
36
+ });
37
+ },
38
+ });
39
+ //# sourceMappingURL=assign-issue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assign-issue.js","sourceRoot":"","sources":["../../../../src/lib/actions/assign-issue.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,qCAAgD;AAChD,+DAAyD;AACzD,sCAA4C;AAC5C,2CAA6F;AAEhF,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,yBAAkB;IACxB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,6BAA6B;IAC1C,KAAK,EAAE;QACN,SAAS,EAAE,IAAA,4BAAoB,GAAE;QACjC,OAAO,EAAE,IAAA,0BAAkB,EAAC,EAAE,UAAU,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC;QAC1D,QAAQ,EAAE,IAAA,wBAAgB,EAAC;YAC1B,WAAW,EAAE,UAAU;YACvB,UAAU,EAAE,CAAC,WAAW,CAAC;YACzB,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACjD,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAe,EAAC;gBACtC,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,SAAS,OAAO,WAAW;gBAChC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,IAAI,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACd;aACD,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ export declare const createIssueAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ projectId: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
6
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
8
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
9
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
11
+ }>>;
12
+ issueTypeId: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
13
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
15
+ }>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
16
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
17
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
18
+ }>>;
19
+ issueFields: import("@activepieces/pieces-framework").DynamicProperties<true, import("@activepieces/pieces-framework").CustomAuthProperty<{
20
+ instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
21
+ personalAccessToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
22
+ }>>;
23
+ }>;
24
+ //# sourceMappingURL=create-issue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-issue.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-issue.ts"],"names":[],"mappings":"AAqCA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;EAkG5B,CAAC"}
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createIssueAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const auth_1 = require("../../auth");
7
+ const props_1 = require("../common/props");
8
+ const common_1 = require("../common");
9
+ const types_1 = require("../common/types");
10
+ const pieces_common_1 = require("@activepieces/pieces-common");
11
+ const shared_1 = require("@activepieces/shared");
12
+ function normalizeFields(fields) {
13
+ return fields.map((field) => {
14
+ var _a, _b;
15
+ return (Object.assign(Object.assign({}, field), { key: (_a = field.key) !== null && _a !== void 0 ? _a : field.fieldId, fieldId: (_b = field.fieldId) !== null && _b !== void 0 ? _b : field.key }));
16
+ });
17
+ }
18
+ function getFields(auth, projectId, issueTypeId) {
19
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
20
+ const fields = yield (0, common_1.jiraPaginatedApiCall)({
21
+ auth,
22
+ method: pieces_common_1.HttpMethod.GET,
23
+ resourceUri: `/issue/createmeta/${projectId}/issuetypes/${issueTypeId}`,
24
+ propertyName: 'values',
25
+ });
26
+ if (!fields || !Array.isArray(fields)) {
27
+ return [];
28
+ }
29
+ return normalizeFields(fields);
30
+ });
31
+ }
32
+ exports.createIssueAction = (0, pieces_framework_1.createAction)({
33
+ name: 'create_issue',
34
+ displayName: 'Create Issue',
35
+ description: 'Creates a new issue in a project.',
36
+ auth: auth_1.jiraDataCenterAuth,
37
+ props: {
38
+ projectId: (0, props_1.getProjectIdDropdown)(),
39
+ issueTypeId: (0, props_1.issueTypeIdProp)('Issue Type'),
40
+ issueFields: pieces_framework_1.Property.DynamicProperties({
41
+ auth: auth_1.jiraDataCenterAuth,
42
+ displayName: 'Fields',
43
+ required: true,
44
+ refreshers: ['projectId', 'issueTypeId'],
45
+ props: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, projectId, issueTypeId }) {
46
+ if (!auth || !issueTypeId || !projectId) {
47
+ return {};
48
+ }
49
+ const props = {};
50
+ const authValue = auth;
51
+ const projectIdValue = projectId;
52
+ const issueTypeIdValue = issueTypeId;
53
+ const fields = yield getFields(authValue, projectIdValue, issueTypeIdValue);
54
+ for (const field of fields) {
55
+ // skip invalid custom fields
56
+ if (field.schema.custom) {
57
+ const customFieldType = field.schema.custom.split(':')[1];
58
+ if (!types_1.VALID_CUSTOM_FIELD_TYPES.includes(customFieldType)) {
59
+ continue;
60
+ }
61
+ }
62
+ if (['project', 'issuetype', 'reporter'].includes(field.key)) {
63
+ continue;
64
+ }
65
+ props[field.key] = yield (0, props_1.createPropertyDefinition)(authValue, field, field.required, projectIdValue);
66
+ }
67
+ // Remove null props
68
+ return Object.fromEntries(Object.entries(props).filter(([_, prop]) => prop !== null));
69
+ }),
70
+ }),
71
+ },
72
+ run(context) {
73
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
74
+ var _a;
75
+ const { projectId, issueTypeId } = context.propsValue;
76
+ const inputIssueFields = (_a = context.propsValue.issueFields) !== null && _a !== void 0 ? _a : {};
77
+ if ((0, shared_1.isNil)(projectId) || (0, shared_1.isNil)(issueTypeId)) {
78
+ throw new Error('Project ID and Issue Type ID are required');
79
+ }
80
+ const rawFields = yield (0, common_1.jiraPaginatedApiCall)({
81
+ auth: context.auth,
82
+ method: pieces_common_1.HttpMethod.GET,
83
+ resourceUri: `/issue/createmeta/${projectId}/issuetypes/${issueTypeId}`,
84
+ propertyName: 'values',
85
+ });
86
+ const issueTypeFields = normalizeFields(rawFields);
87
+ const formattedFields = (0, props_1.formatIssueFields)(issueTypeFields, inputIssueFields);
88
+ const response = yield (0, common_1.jiraApiCall)({
89
+ auth: context.auth,
90
+ method: pieces_common_1.HttpMethod.POST,
91
+ resourceUri: `/issue`,
92
+ body: {
93
+ fields: Object.assign({ issuetype: {
94
+ id: issueTypeId,
95
+ }, project: {
96
+ key: projectId,
97
+ } }, formattedFields),
98
+ },
99
+ });
100
+ const issue = yield (0, common_1.jiraApiCall)({
101
+ auth: context.auth,
102
+ method: pieces_common_1.HttpMethod.GET,
103
+ resourceUri: `/issue/${response.id}`,
104
+ });
105
+ const updatedIssueProperties = (0, props_1.transformCustomFields)(issueTypeFields, issue.fields);
106
+ return Object.assign(Object.assign({}, issue), { fields: updatedIssueProperties });
107
+ });
108
+ },
109
+ });
110
+ //# sourceMappingURL=create-issue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-issue.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-issue.ts"],"names":[],"mappings":";;;;AAAA,qEAA2F;AAC3F,qCAAoE;AACpE,2CAMyB;AACzB,sCAA8D;AAC9D,2CAA+E;AAC/E,+DAAyD;AACzD,iDAA6C;AAE7C,SAAS,eAAe,CAAC,MAAa;IACrC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;;QAAC,OAAA,iCACzB,KAAK,KACR,GAAG,EAAE,MAAA,KAAK,CAAC,GAAG,mCAAI,KAAK,CAAC,OAAO,EAC/B,OAAO,EAAE,MAAA,KAAK,CAAC,OAAO,mCAAI,KAAK,CAAC,GAAG,IAClC,CAAA;KAAA,CAAC,CAAC;AACL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