@openpome/connector-jira-cloud 0.16.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,158 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and
10
+ distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by the
13
+ copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other
16
+ entities that control, are controlled by, or are under common control with
17
+ that entity. For the purposes of this definition, "control" means (i) the
18
+ power, direct or indirect, to cause the direction or management of such
19
+ entity, whether by contract or otherwise, or (ii) ownership of fifty percent
20
+ (50%) or more of the outstanding shares, or (iii) beneficial ownership of
21
+ such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
24
+ permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation source, and
28
+ configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical transformation
31
+ or translation of a Source form, including but not limited to compiled object
32
+ code, generated documentation, and conversions to other media types.
33
+
34
+ "Work" shall mean the work of authorship, whether in Source or Object form,
35
+ made available under the License, as indicated by a copyright notice that is
36
+ included in or attached to the work.
37
+
38
+ "Derivative Works" shall mean any work, whether in Source or Object form,
39
+ that is based on (or derived from) the Work and for which the editorial
40
+ revisions, annotations, elaborations, or other modifications represent, as a
41
+ whole, an original work of authorship. For the purposes of this License,
42
+ Derivative Works shall not include works that remain separable from, or
43
+ merely link (or bind by name) to the interfaces of, the Work and Derivative
44
+ Works thereof.
45
+
46
+ "Contribution" shall mean any work of authorship, including the original
47
+ version of the Work and any modifications or additions to that Work or
48
+ Derivative Works thereof, that is intentionally submitted to Licensor for
49
+ inclusion in the Work by the copyright owner or by an individual or Legal
50
+ Entity authorized to submit on behalf of the copyright owner. For the purposes
51
+ of this definition, "submitted" means any form of electronic, verbal, or
52
+ written communication sent to the Licensor or its representatives, including
53
+ but not limited to communication on electronic mailing lists, source code
54
+ control systems, and issue tracking systems that are managed by, or on behalf
55
+ of, the Licensor for the purpose of discussing and improving the Work, but
56
+ excluding communication that is conspicuously marked or otherwise designated
57
+ in writing by the copyright owner as "Not a Contribution."
58
+
59
+ "Contributor" shall mean Licensor and any individual or Legal Entity on
60
+ behalf of whom a Contribution has been received by Licensor and subsequently
61
+ incorporated within the Work.
62
+
63
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
64
+ License, each Contributor hereby grants to You a perpetual, worldwide,
65
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
66
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
67
+ sublicense, and distribute the Work and such Derivative Works in Source or
68
+ Object form.
69
+
70
+ 3. Grant of Patent License. Subject to the terms and conditions of this
71
+ License, each Contributor hereby grants to You a perpetual, worldwide,
72
+ non-exclusive, no-charge, royalty-free, irrevocable patent license to make,
73
+ have made, use, offer to sell, sell, import, and otherwise transfer the Work,
74
+ where such license applies only to those patent claims licensable by such
75
+ Contributor that are necessarily infringed by their Contribution alone or by
76
+ combination of their Contribution with the Work to which such Contribution was
77
+ submitted. If You institute patent litigation against any entity alleging that
78
+ the Work or a Contribution incorporated within the Work constitutes direct or
79
+ contributory patent infringement, then any patent licenses granted to You
80
+ under this License for that Work shall terminate as of the date such
81
+ litigation is filed.
82
+
83
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
84
+ Derivative Works thereof in any medium, with or without modifications, and in
85
+ Source or Object form, provided that You meet the following conditions:
86
+
87
+ (a) You must give any other recipients of the Work or Derivative Works a copy
88
+ of this License; and
89
+
90
+ (b) You must cause any modified files to carry prominent notices stating that
91
+ You changed the files; and
92
+
93
+ (c) You must retain, in the Source form of any Derivative Works that You
94
+ distribute, all copyright, patent, trademark, and attribution notices from the
95
+ Source form of the Work, excluding those notices that do not pertain to any
96
+ part of the Derivative Works; and
97
+
98
+ (d) If the Work includes a "NOTICE" text file as part of its distribution,
99
+ then any Derivative Works that You distribute must include a readable copy of
100
+ the attribution notices contained within such NOTICE file, excluding those
101
+ notices that do not pertain to any part of the Derivative Works, in at least
102
+ one of the following places: within a NOTICE text file distributed as part of
103
+ the Derivative Works; within the Source form or documentation, if provided
104
+ along with the Derivative Works; or, within a display generated by the
105
+ Derivative Works, if and wherever such third-party notices normally appear.
106
+ The contents of the NOTICE file are for informational purposes only and do not
107
+ modify the License. You may add Your own attribution notices within Derivative
108
+ Works that You distribute, alongside or as an addendum to the NOTICE text from
109
+ the Work, provided that such additional attribution notices cannot be construed
110
+ as modifying the License.
111
+
112
+ You may add Your own copyright statement to Your modifications and may provide
113
+ additional or different license terms and conditions for use, reproduction, or
114
+ distribution of Your modifications, or for any such Derivative Works as a
115
+ whole, provided Your use, reproduction, and distribution of the Work otherwise
116
+ complies with the conditions stated in this License.
117
+
118
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any
119
+ Contribution intentionally submitted for inclusion in the Work by You to the
120
+ Licensor shall be under the terms and conditions of this License, without any
121
+ additional terms or conditions. Notwithstanding the above, nothing herein shall
122
+ supersede or modify the terms of any separate license agreement you may have
123
+ executed with Licensor regarding such Contributions.
124
+
125
+ 6. Trademarks. This License does not grant permission to use the trade names,
126
+ trademarks, service marks, or product names of the Licensor, except as
127
+ required for reasonable and customary use in describing the origin of the Work
128
+ and reproducing the content of the NOTICE file.
129
+
130
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
131
+ writing, Licensor provides the Work on an "AS IS" BASIS, WITHOUT WARRANTIES OR
132
+ CONDITIONS OF ANY KIND, either express or implied, including, without
133
+ limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
134
+ MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely
135
+ responsible for determining the appropriateness of using or redistributing the
136
+ Work and assume any risks associated with Your exercise of permissions under
137
+ this License.
138
+
139
+ 8. Limitation of Liability. In no event and under no legal theory, whether in
140
+ tort (including negligence), contract, or otherwise, unless required by
141
+ applicable law (such as deliberate and grossly negligent acts) or agreed to in
142
+ writing, shall any Contributor be liable to You for damages, including any
143
+ direct, indirect, special, incidental, or consequential damages of any
144
+ character arising as a result of this License or out of the use or inability
145
+ to use the Work, even if such Contributor has been advised of the possibility
146
+ of such damages.
147
+
148
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work
149
+ or Derivative Works thereof, You may choose to offer, and charge a fee for,
150
+ acceptance of support, warranty, indemnity, or other liability obligations
151
+ and/or rights consistent with this License. However, in accepting such
152
+ obligations, You may act only on Your own behalf and on Your sole
153
+ responsibility, not on behalf of any other Contributor, and only if You agree
154
+ to indemnify, defend, and hold each Contributor harmless for any liability
155
+ incurred by, or claims asserted against, such Contributor by reason of your
156
+ accepting any such warranty or additional liability.
157
+
158
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,105 @@
1
+ import type { WorkItem, WorkItemSource } from "@openpome/work-items";
2
+ export interface JiraCloudConfig {
3
+ readonly baseUrl?: string;
4
+ readonly email?: string;
5
+ readonly apiToken?: string;
6
+ readonly boardId?: string;
7
+ readonly oauthAccessToken?: string;
8
+ readonly oauthRefreshToken?: string;
9
+ readonly oauthCloudId?: string;
10
+ readonly oauthExpiresAt?: string;
11
+ readonly oauthClientId?: string;
12
+ readonly oauthClientSecret?: string;
13
+ readonly oauthRedirectUri?: string;
14
+ readonly fixtureFile?: string;
15
+ }
16
+ export type JiraCloudAuthMode = "api-token" | "oauth-3lo" | "mock";
17
+ export interface JiraCloudAuthStatus {
18
+ readonly mode: JiraCloudAuthMode;
19
+ readonly configured: boolean;
20
+ readonly detail: string;
21
+ readonly expiresAt?: string;
22
+ readonly refreshAvailable?: boolean;
23
+ }
24
+ export interface JiraCloudOAuthLoginRequest {
25
+ readonly clientId: string;
26
+ readonly redirectUri: string;
27
+ readonly scopes?: readonly string[];
28
+ readonly state: string;
29
+ }
30
+ export interface JiraCloudOAuthLogin {
31
+ readonly authorizationUrl: string;
32
+ readonly state: string;
33
+ readonly redirectUri: string;
34
+ readonly scopes: readonly string[];
35
+ }
36
+ export interface JiraCloudOAuthExchangeRequest {
37
+ readonly code: string;
38
+ readonly clientId: string;
39
+ readonly clientSecret: string;
40
+ readonly redirectUri: string;
41
+ }
42
+ export interface JiraCloudOAuthTokenSet {
43
+ readonly accessToken: string;
44
+ readonly refreshToken?: string;
45
+ readonly expiresIn?: number;
46
+ readonly expiresAt?: string;
47
+ readonly scope?: string;
48
+ readonly tokenType: string;
49
+ readonly cloudId?: string;
50
+ readonly siteUrl?: string;
51
+ readonly storedAt: string;
52
+ }
53
+ export interface JiraCloudOAuthRefreshRequest {
54
+ readonly refreshToken: string;
55
+ readonly clientId: string;
56
+ readonly clientSecret: string;
57
+ }
58
+ export type JiraReachabilityStatus = "reachable" | "unauthorized" | "unreachable";
59
+ export interface JiraReachabilityResult {
60
+ readonly status: JiraReachabilityStatus;
61
+ readonly detail: string;
62
+ }
63
+ export interface JiraBoard {
64
+ readonly id: string;
65
+ readonly name: string;
66
+ readonly type?: string;
67
+ readonly projectKey?: string;
68
+ readonly self?: string;
69
+ }
70
+ export declare const jiraCloudConnector: {
71
+ readonly id: "jira-cloud";
72
+ readonly kind: "work_item_source";
73
+ readonly displayName: "Jira Cloud";
74
+ };
75
+ export declare class JiraCloudWorkItemSource implements WorkItemSource {
76
+ private readonly config;
77
+ readonly id: "jira-cloud";
78
+ readonly displayName: "Jira Cloud";
79
+ constructor(config?: JiraCloudConfig);
80
+ listAssigned(): Promise<readonly WorkItem[]>;
81
+ listBoards(): Promise<readonly JiraBoard[]>;
82
+ getWorkItem(key: string): Promise<WorkItem | undefined>;
83
+ getMode(): "live" | "mock";
84
+ getAuthStatus(): JiraCloudAuthStatus;
85
+ private hasApiTokenCredentials;
86
+ private hasOAuthTokenCredentials;
87
+ isOAuthAccessTokenExpired(now?: Date): boolean;
88
+ private hasOAuthConfig;
89
+ private fetchAssignedFromJira;
90
+ private fetchAssignedFromBoard;
91
+ private fetchWorkItemFromJira;
92
+ private searchJiraIssues;
93
+ checkReachability(): Promise<JiraReachabilityResult>;
94
+ private fetchBoardsFromJira;
95
+ private checkApiTokenReachability;
96
+ private checkOAuthReachability;
97
+ private getAuthHeaders;
98
+ }
99
+ export declare function createJiraCloudSourceFromEnv(env?: NodeJS.ProcessEnv): JiraCloudWorkItemSource;
100
+ export declare function exchangeJiraCloudOAuthCode(request: JiraCloudOAuthExchangeRequest): Promise<JiraCloudOAuthTokenSet>;
101
+ export declare function refreshJiraCloudOAuthToken(request: JiraCloudOAuthRefreshRequest): Promise<JiraCloudOAuthTokenSet>;
102
+ export declare function createJiraCloudOAuthLogin(request: JiraCloudOAuthLoginRequest): JiraCloudOAuthLogin;
103
+ export declare function getMockAssignedWorkItems(boardId?: string): readonly WorkItem[];
104
+ export declare function getMockJiraBoards(): readonly JiraBoard[];
105
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAgB,cAAc,EAAgB,MAAM,sBAAsB,CAAC;AAEjG,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,cAAc,C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
5
+ };
6
+ export class JiraCloudWorkItemSource {
7
+ config;
8
+ id = jiraCloudConnector.id;
9
+ displayName = jiraCloudConnector.displayName;
10
+ constructor(config = {}) {
11
+ this.config = config;
12
+ }
13
+ async listAssigned() {
14
+ if (this.hasApiTokenCredentials() || this.hasOAuthTokenCredentials()) {
15
+ return this.fetchAssignedFromJira();
16
+ }
17
+ return getMockAssignedWorkItems(this.config.boardId);
18
+ }
19
+ async listBoards() {
20
+ if (this.hasApiTokenCredentials() || this.hasOAuthTokenCredentials()) {
21
+ return this.fetchBoardsFromJira();
22
+ }
23
+ return getMockJiraBoards();
24
+ }
25
+ async getWorkItem(key) {
26
+ const normalizedKey = key.trim().toUpperCase();
27
+ if (this.hasApiTokenCredentials() || this.hasOAuthTokenCredentials()) {
28
+ return this.fetchWorkItemFromJira(normalizedKey);
29
+ }
30
+ const items = await this.listAssigned();
31
+ return items.find((item) => item.key.toUpperCase() === normalizedKey);
32
+ }
33
+ getMode() {
34
+ return this.hasApiTokenCredentials() || this.hasOAuthTokenCredentials() ? "live" : "mock";
35
+ }
36
+ getAuthStatus() {
37
+ if (this.hasApiTokenCredentials()) {
38
+ return {
39
+ mode: "api-token",
40
+ configured: true,
41
+ detail: "Jira Cloud API-token/basic auth is configured."
42
+ };
43
+ }
44
+ if (this.hasOAuthConfig()) {
45
+ return {
46
+ mode: "oauth-3lo",
47
+ configured: this.hasOAuthTokenCredentials(),
48
+ detail: this.hasOAuthTokenCredentials()
49
+ ? "Jira Cloud OAuth 2.0 3LO token is stored."
50
+ : "Jira Cloud OAuth 2.0 3LO client is configured, but no token is stored.",
51
+ expiresAt: this.config.oauthExpiresAt,
52
+ refreshAvailable: Boolean(this.config.oauthRefreshToken)
53
+ };
54
+ }
55
+ return {
56
+ mode: "mock",
57
+ configured: false,
58
+ detail: "Jira auth is not configured; using mock work items."
59
+ };
60
+ }
61
+ hasApiTokenCredentials() {
62
+ return Boolean(this.config.baseUrl && this.config.email && this.config.apiToken);
63
+ }
64
+ hasOAuthTokenCredentials() {
65
+ return Boolean(this.config.oauthAccessToken && this.config.oauthCloudId);
66
+ }
67
+ isOAuthAccessTokenExpired(now = new Date()) {
68
+ if (!this.config.oauthExpiresAt) {
69
+ return false;
70
+ }
71
+ return new Date(this.config.oauthExpiresAt).getTime() <= now.getTime();
72
+ }
73
+ hasOAuthConfig() {
74
+ return Boolean(this.config.oauthClientId && this.config.oauthRedirectUri);
75
+ }
76
+ async fetchAssignedFromJira() {
77
+ const auth = this.getAuthHeaders();
78
+ if (!auth) {
79
+ return getMockAssignedWorkItems(this.config.boardId);
80
+ }
81
+ if (this.config.boardId) {
82
+ return this.fetchAssignedFromBoard(auth, this.config.boardId);
83
+ }
84
+ return this.searchJiraIssues(auth, {
85
+ jql: "assignee = currentUser() ORDER BY updated DESC",
86
+ maxResults: 50,
87
+ maxPages: 4
88
+ });
89
+ }
90
+ async fetchAssignedFromBoard(auth, boardId) {
91
+ const issues = [];
92
+ let startAt = 0;
93
+ let page = 0;
94
+ const maxResults = 50;
95
+ const maxPages = 4;
96
+ do {
97
+ const boardIssuesUrl = new URL(`${auth.baseUrl}/rest/agile/1.0/board/${encodeURIComponent(boardId)}/issue`);
98
+ boardIssuesUrl.searchParams.set("jql", "assignee = currentUser() ORDER BY updated DESC");
99
+ boardIssuesUrl.searchParams.set("fields", jiraIssueFields.join(","));
100
+ boardIssuesUrl.searchParams.set("startAt", String(startAt));
101
+ boardIssuesUrl.searchParams.set("maxResults", String(maxResults));
102
+ const response = await fetch(boardIssuesUrl, {
103
+ headers: auth.headers
104
+ });
105
+ await assertJiraResponse(response, `list assigned work for board ${boardId}`, auth.mode);
106
+ const payload = (await response.json());
107
+ issues.push(...payload.issues);
108
+ startAt += payload.issues.length;
109
+ page += 1;
110
+ if (payload.isLast || payload.issues.length === 0 || startAt >= (payload.total ?? Number.MAX_SAFE_INTEGER)) {
111
+ break;
112
+ }
113
+ } while (page < maxPages);
114
+ return issues.map(mapJiraIssueToWorkItem);
115
+ }
116
+ async fetchWorkItemFromJira(key) {
117
+ const auth = this.getAuthHeaders();
118
+ if (!auth) {
119
+ return undefined;
120
+ }
121
+ const issueUrl = new URL(`${auth.baseUrl}/rest/api/3/issue/${encodeURIComponent(key)}`);
122
+ issueUrl.searchParams.set("fields", jiraIssueFields.join(","));
123
+ const response = await fetch(issueUrl, {
124
+ headers: auth.headers
125
+ });
126
+ if (response.status === 404) {
127
+ return undefined;
128
+ }
129
+ await assertJiraResponse(response, `load work item ${key}`, auth.mode);
130
+ const issue = (await response.json());
131
+ return mapJiraIssueToWorkItem(issue);
132
+ }
133
+ async searchJiraIssues(auth, options) {
134
+ const issues = [];
135
+ let nextPageToken;
136
+ let page = 0;
137
+ do {
138
+ const searchUrl = new URL(`${auth.baseUrl}/rest/api/3/search/jql`);
139
+ searchUrl.searchParams.set("jql", options.jql);
140
+ searchUrl.searchParams.set("fields", jiraIssueFields.join(","));
141
+ searchUrl.searchParams.set("maxResults", String(options.maxResults));
142
+ if (nextPageToken) {
143
+ searchUrl.searchParams.set("nextPageToken", nextPageToken);
144
+ }
145
+ const response = await fetch(searchUrl, {
146
+ headers: auth.headers
147
+ });
148
+ await assertJiraResponse(response, "list assigned work", auth.mode);
149
+ const payload = (await response.json());
150
+ issues.push(...payload.issues);
151
+ nextPageToken = payload.nextPageToken;
152
+ page += 1;
153
+ } while (nextPageToken && page < options.maxPages);
154
+ return issues.map(mapJiraIssueToWorkItem);
155
+ }
156
+ async checkReachability() {
157
+ try {
158
+ if (this.hasOAuthTokenCredentials()) {
159
+ return this.checkOAuthReachability();
160
+ }
161
+ if (this.hasApiTokenCredentials()) {
162
+ return this.checkApiTokenReachability();
163
+ }
164
+ return {
165
+ status: "unreachable",
166
+ detail: "Jira auth is not configured; live reachability was not checked."
167
+ };
168
+ }
169
+ catch (error) {
170
+ return {
171
+ status: "unreachable",
172
+ detail: error instanceof Error ? error.message : String(error)
173
+ };
174
+ }
175
+ }
176
+ async fetchBoardsFromJira() {
177
+ const auth = this.getAuthHeaders();
178
+ if (!auth) {
179
+ return getMockJiraBoards();
180
+ }
181
+ const boards = [];
182
+ let startAt = 0;
183
+ let page = 0;
184
+ const maxResults = 50;
185
+ const maxPages = 4;
186
+ do {
187
+ const boardUrl = new URL(`${auth.baseUrl}/rest/agile/1.0/board`);
188
+ boardUrl.searchParams.set("startAt", String(startAt));
189
+ boardUrl.searchParams.set("maxResults", String(maxResults));
190
+ const response = await fetch(boardUrl, {
191
+ headers: auth.headers
192
+ });
193
+ await assertJiraResponse(response, "list Jira boards", auth.mode);
194
+ const payload = (await response.json());
195
+ boards.push(...payload.values.map(mapJiraBoard));
196
+ startAt += payload.values.length;
197
+ page += 1;
198
+ if (payload.isLast || payload.values.length === 0 || startAt >= (payload.total ?? Number.MAX_SAFE_INTEGER)) {
199
+ break;
200
+ }
201
+ } while (page < maxPages);
202
+ return boards;
203
+ }
204
+ async checkApiTokenReachability() {
205
+ const auth = this.getAuthHeaders();
206
+ if (!auth || auth.mode !== "api-token") {
207
+ return {
208
+ status: "unreachable",
209
+ detail: "Jira API-token auth is incomplete."
210
+ };
211
+ }
212
+ const url = new URL(`${auth.baseUrl}/rest/api/3/myself`);
213
+ const response = await fetch(url, {
214
+ headers: auth.headers
215
+ });
216
+ return mapReachabilityResponse(response, "Jira Cloud API-token auth is reachable.");
217
+ }
218
+ async checkOAuthReachability() {
219
+ const auth = this.getAuthHeaders();
220
+ if (!auth || auth.mode !== "oauth-3lo") {
221
+ return {
222
+ status: "unreachable",
223
+ detail: "Jira OAuth auth is incomplete."
224
+ };
225
+ }
226
+ const url = new URL(`${auth.baseUrl}/rest/api/3/myself`);
227
+ const response = await fetch(url, {
228
+ headers: auth.headers
229
+ });
230
+ return mapReachabilityResponse(response, "Jira Cloud OAuth auth is reachable.");
231
+ }
232
+ getAuthHeaders() {
233
+ if (this.hasOAuthTokenCredentials()) {
234
+ return {
235
+ mode: "oauth-3lo",
236
+ baseUrl: `https://api.atlassian.com/ex/jira/${this.config.oauthCloudId}`,
237
+ headers: {
238
+ "Authorization": `Bearer ${this.config.oauthAccessToken}`,
239
+ "Accept": "application/json"
240
+ }
241
+ };
242
+ }
243
+ if (this.hasApiTokenCredentials()) {
244
+ return {
245
+ mode: "api-token",
246
+ baseUrl: this.config.baseUrl ?? "",
247
+ headers: {
248
+ "Authorization": `Basic ${Buffer.from(`${this.config.email}:${this.config.apiToken}`).toString("base64")}`,
249
+ "Accept": "application/json"
250
+ }
251
+ };
252
+ }
253
+ return undefined;
254
+ }
255
+ }
256
+ export function createJiraCloudSourceFromEnv(env = process.env) {
257
+ return new JiraCloudWorkItemSource({
258
+ baseUrl: env["OPENPOME_JIRA_BASE_URL"],
259
+ email: env["OPENPOME_JIRA_EMAIL"],
260
+ apiToken: env["OPENPOME_JIRA_API_TOKEN"],
261
+ boardId: env["OPENPOME_JIRA_BOARD_ID"],
262
+ oauthAccessToken: env["OPENPOME_JIRA_OAUTH_ACCESS_TOKEN"],
263
+ oauthRefreshToken: env["OPENPOME_JIRA_OAUTH_REFRESH_TOKEN"],
264
+ oauthCloudId: env["OPENPOME_JIRA_OAUTH_CLOUD_ID"],
265
+ oauthExpiresAt: env["OPENPOME_JIRA_OAUTH_EXPIRES_AT"],
266
+ oauthClientId: env["OPENPOME_JIRA_OAUTH_CLIENT_ID"],
267
+ oauthClientSecret: env["OPENPOME_JIRA_OAUTH_CLIENT_SECRET"],
268
+ oauthRedirectUri: env["OPENPOME_JIRA_OAUTH_REDIRECT_URI"],
269
+ fixtureFile: env["OPENPOME_JIRA_FIXTURE_FILE"]
270
+ });
271
+ }
272
+ export async function exchangeJiraCloudOAuthCode(request) {
273
+ const tokenResponse = await fetch("https://auth.atlassian.com/oauth/token", {
274
+ method: "POST",
275
+ headers: {
276
+ "Accept": "application/json",
277
+ "Content-Type": "application/json"
278
+ },
279
+ body: JSON.stringify({
280
+ grant_type: "authorization_code",
281
+ client_id: request.clientId,
282
+ client_secret: request.clientSecret,
283
+ code: request.code,
284
+ redirect_uri: request.redirectUri
285
+ })
286
+ });
287
+ if (!tokenResponse.ok) {
288
+ throw new Error(`Jira OAuth token exchange failed: ${tokenResponse.status} ${tokenResponse.statusText}`);
289
+ }
290
+ const tokenPayload = (await tokenResponse.json());
291
+ const accessibleResource = await getFirstAccessibleJiraResource(tokenPayload.access_token);
292
+ return {
293
+ accessToken: tokenPayload.access_token,
294
+ refreshToken: tokenPayload.refresh_token,
295
+ expiresIn: tokenPayload.expires_in,
296
+ expiresAt: getExpiresAt(tokenPayload.expires_in),
297
+ scope: tokenPayload.scope,
298
+ tokenType: tokenPayload.token_type,
299
+ cloudId: accessibleResource?.id,
300
+ siteUrl: accessibleResource?.url,
301
+ storedAt: new Date().toISOString()
302
+ };
303
+ }
304
+ export async function refreshJiraCloudOAuthToken(request) {
305
+ const tokenResponse = await fetch("https://auth.atlassian.com/oauth/token", {
306
+ method: "POST",
307
+ headers: {
308
+ "Accept": "application/json",
309
+ "Content-Type": "application/json"
310
+ },
311
+ body: JSON.stringify({
312
+ grant_type: "refresh_token",
313
+ client_id: request.clientId,
314
+ client_secret: request.clientSecret,
315
+ refresh_token: request.refreshToken
316
+ })
317
+ });
318
+ if (!tokenResponse.ok) {
319
+ throw new Error(`Jira OAuth token refresh failed: ${tokenResponse.status} ${tokenResponse.statusText}`);
320
+ }
321
+ const tokenPayload = (await tokenResponse.json());
322
+ const accessibleResource = await getFirstAccessibleJiraResource(tokenPayload.access_token);
323
+ return {
324
+ accessToken: tokenPayload.access_token,
325
+ refreshToken: tokenPayload.refresh_token ?? request.refreshToken,
326
+ expiresIn: tokenPayload.expires_in,
327
+ expiresAt: getExpiresAt(tokenPayload.expires_in),
328
+ scope: tokenPayload.scope,
329
+ tokenType: tokenPayload.token_type,
330
+ cloudId: accessibleResource?.id,
331
+ siteUrl: accessibleResource?.url,
332
+ storedAt: new Date().toISOString()
333
+ };
334
+ }
335
+ function getExpiresAt(expiresInSeconds) {
336
+ if (!expiresInSeconds) {
337
+ return undefined;
338
+ }
339
+ return new Date(Date.now() + expiresInSeconds * 1000).toISOString();
340
+ }
341
+ function mapReachabilityResponse(response, successDetail) {
342
+ if (response.ok) {
343
+ return {
344
+ status: "reachable",
345
+ detail: successDetail
346
+ };
347
+ }
348
+ if (response.status === 401 || response.status === 403) {
349
+ return {
350
+ status: "unauthorized",
351
+ detail: `Jira responded with ${response.status} ${response.statusText}.`
352
+ };
353
+ }
354
+ return {
355
+ status: "unreachable",
356
+ detail: `Jira responded with ${response.status} ${response.statusText}.`
357
+ };
358
+ }
359
+ async function getFirstAccessibleJiraResource(accessToken) {
360
+ const response = await fetch("https://api.atlassian.com/oauth/token/accessible-resources", {
361
+ headers: {
362
+ "Authorization": `Bearer ${accessToken}`,
363
+ "Accept": "application/json"
364
+ }
365
+ });
366
+ if (!response.ok) {
367
+ throw new Error(`Jira accessible resources request failed: ${response.status} ${response.statusText}`);
368
+ }
369
+ const resources = (await response.json());
370
+ return resources[0];
371
+ }
372
+ export function createJiraCloudOAuthLogin(request) {
373
+ const scopes = request.scopes ?? ["read:jira-work", "read:jira-user", "offline_access"];
374
+ const url = new URL("https://auth.atlassian.com/authorize");
375
+ url.searchParams.set("audience", "api.atlassian.com");
376
+ url.searchParams.set("client_id", request.clientId);
377
+ url.searchParams.set("scope", scopes.join(" "));
378
+ url.searchParams.set("redirect_uri", request.redirectUri);
379
+ url.searchParams.set("state", request.state);
380
+ url.searchParams.set("response_type", "code");
381
+ url.searchParams.set("prompt", "consent");
382
+ return {
383
+ authorizationUrl: url.toString(),
384
+ state: request.state,
385
+ redirectUri: request.redirectUri,
386
+ scopes
387
+ };
388
+ }
389
+ export function getMockAssignedWorkItems(boardId) {
390
+ const items = [
391
+ {
392
+ key: "POME-101",
393
+ source: "jira-cloud",
394
+ type: "story",
395
+ title: "Create OpenPome CLI foundation",
396
+ status: "In Progress",
397
+ priority: "High",
398
+ assignee: "You",
399
+ iteration: "MVP Phase 1",
400
+ description: "Build the first CLI commands for init, doctor, and assigned work listing.",
401
+ labels: ["openpome", "cli"],
402
+ components: ["developer-workbench"],
403
+ links: [
404
+ {
405
+ kind: "code",
406
+ url: "https://github.com/openpome/pome",
407
+ title: "OpenPome repository"
408
+ }
409
+ ]
410
+ },
411
+ {
412
+ key: "POME-102",
413
+ source: "jira-cloud",
414
+ type: "bug",
415
+ title: "Show clear connector error when VPN service is unreachable",
416
+ status: "To Do",
417
+ priority: "Medium",
418
+ assignee: "You",
419
+ iteration: "MVP Phase 1",
420
+ description: "Doctor should distinguish missing credentials, unreachable network, and expired credentials.",
421
+ labels: ["vpn", "connectors"],
422
+ components: ["local-gateway"]
423
+ },
424
+ {
425
+ key: "POME-103",
426
+ source: "jira-cloud",
427
+ type: "subtask",
428
+ title: "Map Jira issue fields into provider-neutral WorkItem",
429
+ status: "To Do",
430
+ priority: "Medium",
431
+ assignee: "You",
432
+ parentKey: "POME-101",
433
+ labels: ["jira", "work-items"],
434
+ components: ["connectors"]
435
+ }
436
+ ];
437
+ if (boardId === "200") {
438
+ return items.filter((item) => item.components?.includes("local-gateway") || item.components?.includes("connectors"));
439
+ }
440
+ return items;
441
+ }
442
+ export function getMockJiraBoards() {
443
+ return [
444
+ {
445
+ id: "100",
446
+ name: "OpenPome MVP",
447
+ type: "scrum",
448
+ projectKey: "POME"
449
+ },
450
+ {
451
+ id: "200",
452
+ name: "OpenPome Connectors",
453
+ type: "kanban",
454
+ projectKey: "POME"
455
+ }
456
+ ];
457
+ }
458
+ function mapJiraIssueToWorkItem(issue) {
459
+ const issueType = issue.fields.issuetype?.name ?? "task";
460
+ return {
461
+ key: issue.key,
462
+ source: "jira-cloud",
463
+ type: mapJiraIssueType(issueType, issue.fields.issuetype?.subtask ?? false),
464
+ title: issue.fields.summary ?? issue.key,
465
+ status: issue.fields.status?.name ?? "Unknown",
466
+ description: stringifyDescription(issue.fields.description),
467
+ priority: issue.fields.priority?.name,
468
+ assignee: issue.fields.assignee?.displayName ?? issue.fields.assignee?.emailAddress,
469
+ parentKey: issue.fields.parent?.key,
470
+ labels: issue.fields.labels ?? [],
471
+ components: issue.fields.components?.map((component) => component.name ?? "").filter(Boolean) ?? [],
472
+ links: issue.fields.issuelinks?.flatMap(mapJiraIssueLink) ?? [],
473
+ subtasks: issue.fields.subtasks?.map((subtask) => ({
474
+ key: subtask.key,
475
+ type: mapJiraIssueType(subtask.fields?.issuetype?.name ?? "subtask", true),
476
+ title: subtask.fields?.summary ?? subtask.key,
477
+ status: subtask.fields?.status?.name ?? "Unknown"
478
+ })) ?? []
479
+ };
480
+ }
481
+ function mapJiraBoard(board) {
482
+ return {
483
+ id: String(board.id),
484
+ name: board.name,
485
+ type: board.type,
486
+ projectKey: board.location?.projectKey,
487
+ self: board.self
488
+ };
489
+ }
490
+ function mapJiraIssueType(issueType, isSubtask) {
491
+ const normalized = issueType.toLowerCase();
492
+ if (isSubtask || normalized.includes("sub-task") || normalized.includes("subtask")) {
493
+ return "subtask";
494
+ }
495
+ if (normalized.includes("bug")) {
496
+ return "bug";
497
+ }
498
+ if (normalized.includes("story")) {
499
+ return "story";
500
+ }
501
+ if (normalized.includes("epic")) {
502
+ return "epic";
503
+ }
504
+ return "task";
505
+ }
506
+ function stringifyDescription(description) {
507
+ if (!description) {
508
+ return undefined;
509
+ }
510
+ if (typeof description === "string") {
511
+ return description;
512
+ }
513
+ return JSON.stringify(description);
514
+ }
515
+ function mapJiraIssueLink(link) {
516
+ const linkedIssue = link.outwardIssue ?? link.inwardIssue;
517
+ if (!linkedIssue) {
518
+ return [];
519
+ }
520
+ return [
521
+ {
522
+ kind: "related_work_item",
523
+ url: linkedIssue.key,
524
+ title: linkedIssue.fields?.summary
525
+ }
526
+ ];
527
+ }
528
+ const jiraIssueFields = [
529
+ "summary",
530
+ "status",
531
+ "issuetype",
532
+ "priority",
533
+ "assignee",
534
+ "description",
535
+ "labels",
536
+ "components",
537
+ "parent",
538
+ "subtasks",
539
+ "issuelinks"
540
+ ];
541
+ async function assertJiraResponse(response, action, mode) {
542
+ if (response.ok) {
543
+ return;
544
+ }
545
+ const detail = await readJiraErrorDetail(response);
546
+ const authHint = mode === "oauth-3lo"
547
+ ? "Check OAuth token, scopes, accessible Jira site, and VPN/network access."
548
+ : "Check Jira base URL, email, API token, and VPN/network access.";
549
+ if (response.status === 401 || response.status === 403) {
550
+ throw new Error(`Jira ${action} was unauthorized (${response.status}). ${authHint}${detail}`);
551
+ }
552
+ if (response.status === 404) {
553
+ throw new Error(`Jira ${action} was not found (${response.status}). Check the issue key or Jira site.${detail}`);
554
+ }
555
+ if (response.status === 429) {
556
+ throw new Error(`Jira ${action} was rate limited (429). Retry later.${detail}`);
557
+ }
558
+ throw new Error(`Jira ${action} failed: ${response.status} ${response.statusText}.${detail}`);
559
+ }
560
+ async function readJiraErrorDetail(response) {
561
+ try {
562
+ const payload = (await response.json());
563
+ const messages = [
564
+ ...(payload.errorMessages ?? []),
565
+ ...Object.entries(payload.errors ?? {}).map(([field, message]) => `${field}: ${message}`)
566
+ ];
567
+ return messages.length ? ` Detail: ${messages.join("; ")}` : "";
568
+ }
569
+ catch {
570
+ return "";
571
+ }
572
+ }
573
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuFA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,EAAE,EAAE,YAAY;IAChB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,YAAY;CACjB,CAAC;AAEX,MAAM,OAAO,uBAAuB;IAIL;IAHpB,EAAE,GAAG,kBAAkB,CAAC,EAAE,CAAC;IAC3B,WAAW,GAAG,kBAAkB,CAAC,WAAW,CAAC;IAEtD,YAA6B,SAA0B,EAAE;QAA5B,WAAM,GAAN,MAAM,CAAsB;IAAG,CAAC;IAE7D,KAAK,CAAC,YAAY;QAChB,IAAI,IAAI,CAAC,sBAAsB,EAAE,IAAI,IAAI,CAAC,wBAAwB,EAAE,EAAE,CAAC;YACrE,OAAO,IAAI,CAAC,qBAAqB,EAAE,C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mB,CAAC,QAAkB;IACnD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAuG,CAAC;QAC9I,MAAM,QAAQ,GAAG;YACf,GAAG,CAAC,OAAO,CAAC,aAAa,IAAI,EAAE,CAAC;YAChC,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,KAAK,OAAO,EAAE,CAAC;SAC1F,CAAC;QAEF,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAClE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@openpome/connector-jira-cloud",
3
+ "version": "0.16.0-alpha.0",
4
+ "private": false,
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "license": "Apache-2.0",
9
+ "type": "module",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js"
14
+ }
15
+ },
16
+ "dependencies": {
17
+ "@openpome/work-items": "0.16.0-alpha.0"
18
+ },
19
+ "files": [
20
+ "dist/**/*.js",
21
+ "dist/**/*.js.map",
22
+ "dist/**/*.d.ts",
23
+ "dist/**/*.d.ts.map",
24
+ "package.json",
25
+ "README.md"
26
+ ],
27
+ "scripts": {
28
+ "build": "tsc -p tsconfig.json",
29
+ "typecheck": "tsc -p tsconfig.json --noEmit",
30
+ "test": "vitest run"
31
+ }
32
+ }