@shipfox/api-integration-jira 4.0.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.
Files changed (73) hide show
  1. package/.turbo/turbo-build.log +2 -0
  2. package/.turbo/turbo-type$colon$emit.log +1 -0
  3. package/.turbo/turbo-type.log +1 -0
  4. package/CHANGELOG.md +11 -0
  5. package/LICENSE +21 -0
  6. package/README.md +5 -0
  7. package/dist/config.d.ts +10 -0
  8. package/dist/config.d.ts.map +1 -0
  9. package/dist/config.js +28 -0
  10. package/dist/config.js.map +1 -0
  11. package/dist/core/errors.d.ts +10 -0
  12. package/dist/core/errors.d.ts.map +1 -0
  13. package/dist/core/errors.js +20 -0
  14. package/dist/core/errors.js.map +1 -0
  15. package/dist/core/tokens.d.ts +36 -0
  16. package/dist/core/tokens.d.ts.map +1 -0
  17. package/dist/core/tokens.js +40 -0
  18. package/dist/core/tokens.js.map +1 -0
  19. package/dist/db/db.d.ts +475 -0
  20. package/dist/db/db.d.ts.map +1 -0
  21. package/dist/db/db.js +18 -0
  22. package/dist/db/db.js.map +1 -0
  23. package/dist/db/installations.d.ts +41 -0
  24. package/dist/db/installations.d.ts.map +1 -0
  25. package/dist/db/installations.js +65 -0
  26. package/dist/db/installations.js.map +1 -0
  27. package/dist/db/migrations.d.ts +2 -0
  28. package/dist/db/migrations.d.ts.map +1 -0
  29. package/dist/db/migrations.js +5 -0
  30. package/dist/db/migrations.js.map +1 -0
  31. package/dist/db/schema/common.d.ts +2 -0
  32. package/dist/db/schema/common.d.ts.map +1 -0
  33. package/dist/db/schema/common.js +4 -0
  34. package/dist/db/schema/common.js.map +1 -0
  35. package/dist/db/schema/installations.d.ts +239 -0
  36. package/dist/db/schema/installations.d.ts.map +1 -0
  37. package/dist/db/schema/installations.js +48 -0
  38. package/dist/db/schema/installations.js.map +1 -0
  39. package/dist/index.d.ts +15 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +16 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/tsconfig.test.tsbuildinfo +1 -0
  44. package/drizzle/0000_whole_master_chief.sql +18 -0
  45. package/drizzle/meta/0000_snapshot.json +145 -0
  46. package/drizzle/meta/_journal.json +13 -0
  47. package/drizzle.config.ts +7 -0
  48. package/package.json +63 -0
  49. package/src/config.test.ts +37 -0
  50. package/src/config.ts +27 -0
  51. package/src/core/errors.ts +22 -0
  52. package/src/core/tokens.test.ts +106 -0
  53. package/src/core/tokens.ts +77 -0
  54. package/src/db/db.ts +16 -0
  55. package/src/db/installations.test.ts +93 -0
  56. package/src/db/installations.ts +125 -0
  57. package/src/db/migrations.ts +4 -0
  58. package/src/db/schema/common.ts +3 -0
  59. package/src/db/schema/installations.ts +48 -0
  60. package/src/index.test.ts +9 -0
  61. package/src/index.ts +36 -0
  62. package/test/api-secrets.d.ts +26 -0
  63. package/test/env.ts +15 -0
  64. package/test/factories/index.ts +1 -0
  65. package/test/factories/jira-installation.ts +35 -0
  66. package/test/globalSetup.ts +23 -0
  67. package/test/index.ts +1 -0
  68. package/test/setup.ts +17 -0
  69. package/tsconfig.build.json +9 -0
  70. package/tsconfig.build.tsbuildinfo +1 -0
  71. package/tsconfig.json +3 -0
  72. package/tsconfig.test.json +9 -0
  73. package/vitest.config.ts +12 -0
@@ -0,0 +1,2 @@
1
+ $ shipfox-swc
2
+ Successfully compiled: 9 files with swc (49.37ms)
@@ -0,0 +1 @@
1
+ $ shipfox-tsc-emit
@@ -0,0 +1 @@
1
+ $ shipfox-tsc-check
package/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # @shipfox/api-integration-jira
2
+
3
+ ## 4.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [15c5f84]
8
+ - Updated dependencies [bbba3b7]
9
+ - @shipfox/api-integration-jira-dto@4.0.0
10
+ - @shipfox/node-drizzle@0.3.0
11
+ - @shipfox/api-secrets@4.0.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shipfox
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # Jira integration
2
+
3
+ This package owns Jira provider persistence and token storage. The provider is non-functional until ENG-1001 adds the OAuth install flow.
4
+
5
+ Connect Jira with a dedicated Shipfox service account. Jira 3LO actions are authored by the authorizing account, so events from that account are dropped to prevent agent actions from triggering themselves.
@@ -0,0 +1,10 @@
1
+ export declare const config: Readonly<{
2
+ JIRA_OAUTH_CLIENT_ID: string;
3
+ JIRA_OAUTH_CLIENT_SECRET: string;
4
+ JIRA_OAUTH_REDIRECT_URL: string;
5
+ JIRA_WEBHOOK_SIGNING_SECRET: string;
6
+ JIRA_WEBHOOK_BASE_URL: string;
7
+ JIRA_API_BASE_URL: string;
8
+ JIRA_AUTH_BASE_URL: string;
9
+ } & import("@shipfox/config").CleanedEnvAccessors>;
10
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;;;;;;;;kDAwBjB,CAAC"}
package/dist/config.js ADDED
@@ -0,0 +1,28 @@
1
+ import { createConfig, str, url } from '@shipfox/config';
2
+ export const config = createConfig({
3
+ JIRA_OAUTH_CLIENT_ID: str({
4
+ desc: 'OAuth client ID of the Jira app, used to start and complete the Jira connect flow. Required.'
5
+ }),
6
+ JIRA_OAUTH_CLIENT_SECRET: str({
7
+ desc: 'OAuth client secret of the Jira app, used to exchange authorization codes for access and refresh tokens. Required.'
8
+ }),
9
+ JIRA_OAUTH_REDIRECT_URL: url({
10
+ desc: 'Public client callback URL Jira redirects to after OAuth authorization, such as https://shipfox.example.com/integrations/jira/callback. Required.'
11
+ }),
12
+ JIRA_WEBHOOK_SIGNING_SECRET: str({
13
+ desc: 'Secret used to verify incoming Jira webhooks. It must match the webhook signing secret configured for the Jira app. Required.'
14
+ }),
15
+ JIRA_WEBHOOK_BASE_URL: url({
16
+ desc: 'Public base URL Jira sends webhooks to. Its origin must be added to the Jira app webhook allowlist. Required.'
17
+ }),
18
+ JIRA_API_BASE_URL: url({
19
+ desc: 'Jira API base URL. Override this only when routing Jira API requests through a proxy or test server.',
20
+ default: 'https://api.atlassian.com'
21
+ }),
22
+ JIRA_AUTH_BASE_URL: url({
23
+ desc: 'Jira OAuth base URL. Override this only when routing OAuth requests through a proxy or test server.',
24
+ default: 'https://auth.atlassian.com'
25
+ })
26
+ });
27
+
28
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/config.ts"],"sourcesContent":["import {createConfig, str, url} from '@shipfox/config';\n\nexport const config = createConfig({\n JIRA_OAUTH_CLIENT_ID: str({\n desc: 'OAuth client ID of the Jira app, used to start and complete the Jira connect flow. Required.',\n }),\n JIRA_OAUTH_CLIENT_SECRET: str({\n desc: 'OAuth client secret of the Jira app, used to exchange authorization codes for access and refresh tokens. Required.',\n }),\n JIRA_OAUTH_REDIRECT_URL: url({\n desc: 'Public client callback URL Jira redirects to after OAuth authorization, such as https://shipfox.example.com/integrations/jira/callback. Required.',\n }),\n JIRA_WEBHOOK_SIGNING_SECRET: str({\n desc: 'Secret used to verify incoming Jira webhooks. It must match the webhook signing secret configured for the Jira app. Required.',\n }),\n JIRA_WEBHOOK_BASE_URL: url({\n desc: 'Public base URL Jira sends webhooks to. Its origin must be added to the Jira app webhook allowlist. Required.',\n }),\n JIRA_API_BASE_URL: url({\n desc: 'Jira API base URL. Override this only when routing Jira API requests through a proxy or test server.',\n default: 'https://api.atlassian.com',\n }),\n JIRA_AUTH_BASE_URL: url({\n desc: 'Jira OAuth base URL. Override this only when routing OAuth requests through a proxy or test server.',\n default: 'https://auth.atlassian.com',\n }),\n});\n"],"names":["createConfig","str","url","config","JIRA_OAUTH_CLIENT_ID","desc","JIRA_OAUTH_CLIENT_SECRET","JIRA_OAUTH_REDIRECT_URL","JIRA_WEBHOOK_SIGNING_SECRET","JIRA_WEBHOOK_BASE_URL","JIRA_API_BASE_URL","default","JIRA_AUTH_BASE_URL"],"mappings":"AAAA,SAAQA,YAAY,EAAEC,GAAG,EAAEC,GAAG,QAAO,kBAAkB;AAEvD,OAAO,MAAMC,SAASH,aAAa;IACjCI,sBAAsBH,IAAI;QACxBI,MAAM;IACR;IACAC,0BAA0BL,IAAI;QAC5BI,MAAM;IACR;IACAE,yBAAyBL,IAAI;QAC3BG,MAAM;IACR;IACAG,6BAA6BP,IAAI;QAC/BI,MAAM;IACR;IACAI,uBAAuBP,IAAI;QACzBG,MAAM;IACR;IACAK,mBAAmBR,IAAI;QACrBG,MAAM;QACNM,SAAS;IACX;IACAC,oBAAoBV,IAAI;QACtBG,MAAM;QACNM,SAAS;IACX;AACF,GAAG"}
@@ -0,0 +1,10 @@
1
+ export declare class JiraConnectionNotFoundError extends Error {
2
+ constructor(connectionId: string);
3
+ }
4
+ export declare class JiraAccessTokenMissingError extends Error {
5
+ constructor(connectionId: string);
6
+ }
7
+ export declare class JiraInstallationSiteMismatchError extends Error {
8
+ constructor(connectionId: string, cloudId: string);
9
+ }
10
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,2BAA4B,SAAQ,KAAK;gBACxC,YAAY,EAAE,MAAM;CAIjC;AAED,qBAAa,2BAA4B,SAAQ,KAAK;gBACxC,YAAY,EAAE,MAAM;CAIjC;AAED,qBAAa,iCAAkC,SAAQ,KAAK;gBAC9C,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAMlD"}
@@ -0,0 +1,20 @@
1
+ export class JiraConnectionNotFoundError extends Error {
2
+ constructor(connectionId){
3
+ super(`Jira integration connection was not found: ${connectionId}`);
4
+ this.name = 'JiraConnectionNotFoundError';
5
+ }
6
+ }
7
+ export class JiraAccessTokenMissingError extends Error {
8
+ constructor(connectionId){
9
+ super(`Jira access token is missing for connection: ${connectionId}`);
10
+ this.name = 'JiraAccessTokenMissingError';
11
+ }
12
+ }
13
+ export class JiraInstallationSiteMismatchError extends Error {
14
+ constructor(connectionId, cloudId){
15
+ super(`Jira connection is already linked to a different site: ${connectionId} (attempted ${cloudId})`);
16
+ this.name = 'JiraInstallationSiteMismatchError';
17
+ }
18
+ }
19
+
20
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/errors.ts"],"sourcesContent":["export class JiraConnectionNotFoundError extends Error {\n constructor(connectionId: string) {\n super(`Jira integration connection was not found: ${connectionId}`);\n this.name = 'JiraConnectionNotFoundError';\n }\n}\n\nexport class JiraAccessTokenMissingError extends Error {\n constructor(connectionId: string) {\n super(`Jira access token is missing for connection: ${connectionId}`);\n this.name = 'JiraAccessTokenMissingError';\n }\n}\n\nexport class JiraInstallationSiteMismatchError extends Error {\n constructor(connectionId: string, cloudId: string) {\n super(\n `Jira connection is already linked to a different site: ${connectionId} (attempted ${cloudId})`,\n );\n this.name = 'JiraInstallationSiteMismatchError';\n }\n}\n"],"names":["JiraConnectionNotFoundError","Error","connectionId","name","JiraAccessTokenMissingError","JiraInstallationSiteMismatchError","cloudId"],"mappings":"AAAA,OAAO,MAAMA,oCAAoCC;IAC/C,YAAYC,YAAoB,CAAE;QAChC,KAAK,CAAC,CAAC,2CAA2C,EAAEA,cAAc;QAClE,IAAI,CAACC,IAAI,GAAG;IACd;AACF;AAEA,OAAO,MAAMC,oCAAoCH;IAC/C,YAAYC,YAAoB,CAAE;QAChC,KAAK,CAAC,CAAC,6CAA6C,EAAEA,cAAc;QACpE,IAAI,CAACC,IAAI,GAAG;IACd;AACF;AAEA,OAAO,MAAME,0CAA0CJ;IACrD,YAAYC,YAAoB,EAAEI,OAAe,CAAE;QACjD,KAAK,CACH,CAAC,uDAAuD,EAAEJ,aAAa,YAAY,EAAEI,QAAQ,CAAC,CAAC;QAEjG,IAAI,CAACH,IAAI,GAAG;IACd;AACF"}
@@ -0,0 +1,36 @@
1
+ export interface JiraConnectionResolverResult {
2
+ workspaceId: string;
3
+ }
4
+ export interface JiraSecretsStore {
5
+ getSecret(params: {
6
+ workspaceId: string;
7
+ namespace: string;
8
+ key: string;
9
+ }): Promise<string | null>;
10
+ setSecrets(params: {
11
+ workspaceId: string;
12
+ namespace: string;
13
+ values: Record<string, string>;
14
+ editedBy?: string | null | undefined;
15
+ }): Promise<void>;
16
+ }
17
+ export interface CreateJiraTokenStoreParams {
18
+ resolveConnection(connectionId: string): Promise<JiraConnectionResolverResult | undefined>;
19
+ secrets: JiraSecretsStore;
20
+ }
21
+ export interface StoreJiraTokensParams {
22
+ connectionId: string;
23
+ accessToken: string;
24
+ refreshToken?: string | undefined;
25
+ editedBy?: string | null | undefined;
26
+ }
27
+ export interface GetJiraAccessTokenParams {
28
+ connectionId: string;
29
+ }
30
+ export interface JiraTokenStore {
31
+ storeTokens(params: StoreJiraTokensParams): Promise<void>;
32
+ getAccessToken(params: GetJiraAccessTokenParams): Promise<string>;
33
+ }
34
+ export declare function jiraSecretsNamespace(connectionId: string): string;
35
+ export declare function createJiraTokenStore(params: CreateJiraTokenStoreParams): JiraTokenStore;
36
+ //# sourceMappingURL=tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/core/tokens.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,4BAA4B;IAC3C,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,MAAM,EAAE;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAC,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACjG,UAAU,CAAC,MAAM,EAAE;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC/B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;KACtC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnB;AAED,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,4BAA4B,GAAG,SAAS,CAAC,CAAC;IAC3F,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAED,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACtC;AAED,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,cAAc,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACnE;AAED,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,0BAA0B,GAAG,cAAc,CAgCvF"}
@@ -0,0 +1,40 @@
1
+ import { JiraAccessTokenMissingError, JiraConnectionNotFoundError } from '#core/errors.js';
2
+ const ACCESS_TOKEN_KEY = 'ACCESS_TOKEN';
3
+ const REFRESH_TOKEN_KEY = 'REFRESH_TOKEN';
4
+ export function jiraSecretsNamespace(connectionId) {
5
+ return `system/integrations/jira/${connectionId}`;
6
+ }
7
+ export function createJiraTokenStore(params) {
8
+ async function resolveWorkspaceId(connectionId) {
9
+ const connection = await params.resolveConnection(connectionId);
10
+ if (!connection) throw new JiraConnectionNotFoundError(connectionId);
11
+ return connection.workspaceId;
12
+ }
13
+ return {
14
+ async storeTokens (input) {
15
+ const workspaceId = await resolveWorkspaceId(input.connectionId);
16
+ const values = {
17
+ [ACCESS_TOKEN_KEY]: input.accessToken
18
+ };
19
+ if (input.refreshToken) values[REFRESH_TOKEN_KEY] = input.refreshToken;
20
+ await params.secrets.setSecrets({
21
+ workspaceId,
22
+ namespace: jiraSecretsNamespace(input.connectionId),
23
+ values,
24
+ editedBy: input.editedBy
25
+ });
26
+ },
27
+ async getAccessToken (input) {
28
+ const workspaceId = await resolveWorkspaceId(input.connectionId);
29
+ const token = await params.secrets.getSecret({
30
+ workspaceId,
31
+ namespace: jiraSecretsNamespace(input.connectionId),
32
+ key: ACCESS_TOKEN_KEY
33
+ });
34
+ if (!token) throw new JiraAccessTokenMissingError(input.connectionId);
35
+ return token;
36
+ }
37
+ };
38
+ }
39
+
40
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/tokens.ts"],"sourcesContent":["import {JiraAccessTokenMissingError, JiraConnectionNotFoundError} from '#core/errors.js';\n\nconst ACCESS_TOKEN_KEY = 'ACCESS_TOKEN';\nconst REFRESH_TOKEN_KEY = 'REFRESH_TOKEN';\n\nexport interface JiraConnectionResolverResult {\n workspaceId: string;\n}\n\nexport interface JiraSecretsStore {\n getSecret(params: {workspaceId: string; namespace: string; key: string}): Promise<string | null>;\n setSecrets(params: {\n workspaceId: string;\n namespace: string;\n values: Record<string, string>;\n editedBy?: string | null | undefined;\n }): Promise<void>;\n}\n\nexport interface CreateJiraTokenStoreParams {\n resolveConnection(connectionId: string): Promise<JiraConnectionResolverResult | undefined>;\n secrets: JiraSecretsStore;\n}\n\nexport interface StoreJiraTokensParams {\n connectionId: string;\n accessToken: string;\n refreshToken?: string | undefined;\n editedBy?: string | null | undefined;\n}\n\nexport interface GetJiraAccessTokenParams {\n connectionId: string;\n}\n\nexport interface JiraTokenStore {\n storeTokens(params: StoreJiraTokensParams): Promise<void>;\n getAccessToken(params: GetJiraAccessTokenParams): Promise<string>;\n}\n\nexport function jiraSecretsNamespace(connectionId: string): string {\n return `system/integrations/jira/${connectionId}`;\n}\n\nexport function createJiraTokenStore(params: CreateJiraTokenStoreParams): JiraTokenStore {\n async function resolveWorkspaceId(connectionId: string): Promise<string> {\n const connection = await params.resolveConnection(connectionId);\n if (!connection) throw new JiraConnectionNotFoundError(connectionId);\n return connection.workspaceId;\n }\n\n return {\n async storeTokens(input) {\n const workspaceId = await resolveWorkspaceId(input.connectionId);\n const values: Record<string, string> = {[ACCESS_TOKEN_KEY]: input.accessToken};\n if (input.refreshToken) values[REFRESH_TOKEN_KEY] = input.refreshToken;\n\n await params.secrets.setSecrets({\n workspaceId,\n namespace: jiraSecretsNamespace(input.connectionId),\n values,\n editedBy: input.editedBy,\n });\n },\n\n async getAccessToken(input) {\n const workspaceId = await resolveWorkspaceId(input.connectionId);\n const token = await params.secrets.getSecret({\n workspaceId,\n namespace: jiraSecretsNamespace(input.connectionId),\n key: ACCESS_TOKEN_KEY,\n });\n if (!token) throw new JiraAccessTokenMissingError(input.connectionId);\n return token;\n },\n };\n}\n"],"names":["JiraAccessTokenMissingError","JiraConnectionNotFoundError","ACCESS_TOKEN_KEY","REFRESH_TOKEN_KEY","jiraSecretsNamespace","connectionId","createJiraTokenStore","params","resolveWorkspaceId","connection","resolveConnection","workspaceId","storeTokens","input","values","accessToken","refreshToken","secrets","setSecrets","namespace","editedBy","getAccessToken","token","getSecret","key"],"mappings":"AAAA,SAAQA,2BAA2B,EAAEC,2BAA2B,QAAO,kBAAkB;AAEzF,MAAMC,mBAAmB;AACzB,MAAMC,oBAAoB;AAqC1B,OAAO,SAASC,qBAAqBC,YAAoB;IACvD,OAAO,CAAC,yBAAyB,EAAEA,cAAc;AACnD;AAEA,OAAO,SAASC,qBAAqBC,MAAkC;IACrE,eAAeC,mBAAmBH,YAAoB;QACpD,MAAMI,aAAa,MAAMF,OAAOG,iBAAiB,CAACL;QAClD,IAAI,CAACI,YAAY,MAAM,IAAIR,4BAA4BI;QACvD,OAAOI,WAAWE,WAAW;IAC/B;IAEA,OAAO;QACL,MAAMC,aAAYC,KAAK;YACrB,MAAMF,cAAc,MAAMH,mBAAmBK,MAAMR,YAAY;YAC/D,MAAMS,SAAiC;gBAAC,CAACZ,iBAAiB,EAAEW,MAAME,WAAW;YAAA;YAC7E,IAAIF,MAAMG,YAAY,EAAEF,MAAM,CAACX,kBAAkB,GAAGU,MAAMG,YAAY;YAEtE,MAAMT,OAAOU,OAAO,CAACC,UAAU,CAAC;gBAC9BP;gBACAQ,WAAWf,qBAAqBS,MAAMR,YAAY;gBAClDS;gBACAM,UAAUP,MAAMO,QAAQ;YAC1B;QACF;QAEA,MAAMC,gBAAeR,KAAK;YACxB,MAAMF,cAAc,MAAMH,mBAAmBK,MAAMR,YAAY;YAC/D,MAAMiB,QAAQ,MAAMf,OAAOU,OAAO,CAACM,SAAS,CAAC;gBAC3CZ;gBACAQ,WAAWf,qBAAqBS,MAAMR,YAAY;gBAClDmB,KAAKtB;YACP;YACA,IAAI,CAACoB,OAAO,MAAM,IAAItB,4BAA4Ba,MAAMR,YAAY;YACpE,OAAOiB;QACT;IACF;AACF"}