@shipfox/api-integration-core 3.0.0 → 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.
@@ -1,6 +1,6 @@
1
1
  $ shipfox-swc && shipfox-temporal-bundle dist/temporal/workflows/index.js
2
- Successfully compiled: 47 files with swc (201.04ms)
3
- 2026-07-18T08:51:37.226Z [INFO] asset workflow-bundle-fe8baaf5b68e0b2328d8.js 1.45 MiB [emitted] [immutable] (name: main)
2
+ Successfully compiled: 49 files with swc (136.49ms)
3
+ 2026-07-19T08:15:12.003Z [INFO] asset workflow-bundle-fe8baaf5b68e0b2328d8.js 1.45 MiB [emitted] [immutable] (name: main)
4
4
  runtime modules 670 bytes 3 modules
5
5
  modules by path ../../../../node_modules/.pnpm/ 424 KiB
6
6
  modules by path ../../../../node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporal...(truncated) 155 KiB 34 modules
@@ -15,6 +15,6 @@ modules by path ./dist/temporal/workflows/ 1020 bytes
15
15
  optional modules 30 bytes [optional]
16
16
  __temporal_custom_payload_converter (ignored) 15 bytes [optional] [built] [code generated]
17
17
  __temporal_custom_failure_converter (ignored) 15 bytes [optional] [built] [code generated]
18
- webpack 5.107.2 compiled successfully in 943 ms
19
- 2026-07-18T08:51:37.230Z [INFO] Workflow bundle created { size: '1.45MB' }
18
+ webpack 5.107.2 compiled successfully in 1068 ms
19
+ 2026-07-19T08:15:12.007Z [INFO] Workflow bundle created { size: '1.45MB' }
20
20
  /home/runner/work/shipfox/shipfox/libs/api/integration/core/dist/temporal/workflows/index.js: 1516260 bytes
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @shipfox/api-integration-core
2
2
 
3
+ ## 4.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 67176d4: Adds the Slack OAuth connection flow with provider routes, secure bot-token storage, and E2E setup.
8
+
9
+ ### Patch Changes
10
+
11
+ - 5d129d6: Adds the default-off Jira provider scaffold with installation storage and token custody seams.
12
+ - bbba3b7: Adds the Slack integration provider scaffold with installation storage, bot-token custody, and flag-gated registration.
13
+ - 1951293: Adds in-process Slack agent tools for reading conversations and acting on messages through the lease-authenticated gateway.
14
+ - Updated dependencies [0745ee9]
15
+ - Updated dependencies [23c8e4d]
16
+ - Updated dependencies [67176d4]
17
+ - Updated dependencies [7267872]
18
+ - Updated dependencies [bbba3b7]
19
+ - Updated dependencies [1951293]
20
+ - @shipfox/api-integration-slack@4.0.0
21
+ - @shipfox/node-drizzle@0.3.0
22
+ - @shipfox/api-integration-linear@4.0.0
23
+ - @shipfox/api-integration-jira@4.0.0
24
+ - @shipfox/api-integration-gitea@4.0.0
25
+ - @shipfox/api-integration-github@4.0.0
26
+ - @shipfox/api-integration-sentry@4.0.0
27
+ - @shipfox/node-module@0.3.1
28
+ - @shipfox/node-outbox@0.2.2
29
+
3
30
  ## 3.0.0
4
31
 
5
32
  ### Patch Changes
package/dist/config.d.ts CHANGED
@@ -2,8 +2,10 @@ export declare const config: Readonly<{
2
2
  INTEGRATIONS_ENABLE_CRON_PROVIDER: boolean;
3
3
  INTEGRATIONS_ENABLE_GITEA_PROVIDER: boolean;
4
4
  INTEGRATIONS_ENABLE_GITHUB_PROVIDER: boolean;
5
+ INTEGRATIONS_ENABLE_JIRA_PROVIDER: boolean;
5
6
  INTEGRATIONS_ENABLE_LINEAR_PROVIDER: boolean;
6
7
  INTEGRATIONS_ENABLE_SENTRY_PROVIDER: boolean;
8
+ INTEGRATIONS_ENABLE_SLACK_PROVIDER: boolean;
7
9
  INTEGRATIONS_ENABLE_WEBHOOK_PROVIDER: boolean;
8
10
  } & import("@shipfox/config").CleanedEnvAccessors>;
9
11
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;;;;;;;kDAyBjB,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;;;;;;;;;kDAiCjB,CAAC"}
package/dist/config.js CHANGED
@@ -12,6 +12,10 @@ export const config = createConfig({
12
12
  desc: 'Enables the GitHub integration provider so users can connect GitHub.',
13
13
  default: false
14
14
  }),
15
+ INTEGRATIONS_ENABLE_JIRA_PROVIDER: bool({
16
+ desc: 'Enables the Jira integration provider so users can connect Jira sites.',
17
+ default: false
18
+ }),
15
19
  INTEGRATIONS_ENABLE_LINEAR_PROVIDER: bool({
16
20
  desc: 'Enables the Linear integration provider so users can connect Linear workspaces.',
17
21
  default: false
@@ -20,6 +24,10 @@ export const config = createConfig({
20
24
  desc: 'Enables the Sentry integration provider so users can connect Sentry.',
21
25
  default: false
22
26
  }),
27
+ INTEGRATIONS_ENABLE_SLACK_PROVIDER: bool({
28
+ desc: 'Enables the Slack integration provider so users can connect Slack workspaces.',
29
+ default: false
30
+ }),
23
31
  INTEGRATIONS_ENABLE_WEBHOOK_PROVIDER: bool({
24
32
  desc: 'Enables the generic webhook integration provider so users can create inbound webhook URLs. It is enabled by default because it does not require provider setup.',
25
33
  default: true
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/config.ts"],"sourcesContent":["import {bool, createConfig} from '@shipfox/config';\n\nexport const config = createConfig({\n INTEGRATIONS_ENABLE_CRON_PROVIDER: bool({\n desc: 'Enables the cron integration provider so workflow schedules can use the built-in cron source. It is enabled by default because it does not require provider setup.',\n default: true,\n }),\n INTEGRATIONS_ENABLE_GITEA_PROVIDER: bool({\n desc: 'Enables the Gitea integration provider so users can connect a Gitea instance.',\n default: false,\n }),\n INTEGRATIONS_ENABLE_GITHUB_PROVIDER: bool({\n desc: 'Enables the GitHub integration provider so users can connect GitHub.',\n default: false,\n }),\n INTEGRATIONS_ENABLE_LINEAR_PROVIDER: bool({\n desc: 'Enables the Linear integration provider so users can connect Linear workspaces.',\n default: false,\n }),\n INTEGRATIONS_ENABLE_SENTRY_PROVIDER: bool({\n desc: 'Enables the Sentry integration provider so users can connect Sentry.',\n default: false,\n }),\n INTEGRATIONS_ENABLE_WEBHOOK_PROVIDER: bool({\n desc: 'Enables the generic webhook integration provider so users can create inbound webhook URLs. It is enabled by default because it does not require provider setup.',\n default: true,\n }),\n});\n"],"names":["bool","createConfig","config","INTEGRATIONS_ENABLE_CRON_PROVIDER","desc","default","INTEGRATIONS_ENABLE_GITEA_PROVIDER","INTEGRATIONS_ENABLE_GITHUB_PROVIDER","INTEGRATIONS_ENABLE_LINEAR_PROVIDER","INTEGRATIONS_ENABLE_SENTRY_PROVIDER","INTEGRATIONS_ENABLE_WEBHOOK_PROVIDER"],"mappings":"AAAA,SAAQA,IAAI,EAAEC,YAAY,QAAO,kBAAkB;AAEnD,OAAO,MAAMC,SAASD,aAAa;IACjCE,mCAAmCH,KAAK;QACtCI,MAAM;QACNC,SAAS;IACX;IACAC,oCAAoCN,KAAK;QACvCI,MAAM;QACNC,SAAS;IACX;IACAE,qCAAqCP,KAAK;QACxCI,MAAM;QACNC,SAAS;IACX;IACAG,qCAAqCR,KAAK;QACxCI,MAAM;QACNC,SAAS;IACX;IACAI,qCAAqCT,KAAK;QACxCI,MAAM;QACNC,SAAS;IACX;IACAK,sCAAsCV,KAAK;QACzCI,MAAM;QACNC,SAAS;IACX;AACF,GAAG"}
1
+ {"version":3,"sources":["../src/config.ts"],"sourcesContent":["import {bool, createConfig} from '@shipfox/config';\n\nexport const config = createConfig({\n INTEGRATIONS_ENABLE_CRON_PROVIDER: bool({\n desc: 'Enables the cron integration provider so workflow schedules can use the built-in cron source. It is enabled by default because it does not require provider setup.',\n default: true,\n }),\n INTEGRATIONS_ENABLE_GITEA_PROVIDER: bool({\n desc: 'Enables the Gitea integration provider so users can connect a Gitea instance.',\n default: false,\n }),\n INTEGRATIONS_ENABLE_GITHUB_PROVIDER: bool({\n desc: 'Enables the GitHub integration provider so users can connect GitHub.',\n default: false,\n }),\n INTEGRATIONS_ENABLE_JIRA_PROVIDER: bool({\n desc: 'Enables the Jira integration provider so users can connect Jira sites.',\n default: false,\n }),\n INTEGRATIONS_ENABLE_LINEAR_PROVIDER: bool({\n desc: 'Enables the Linear integration provider so users can connect Linear workspaces.',\n default: false,\n }),\n INTEGRATIONS_ENABLE_SENTRY_PROVIDER: bool({\n desc: 'Enables the Sentry integration provider so users can connect Sentry.',\n default: false,\n }),\n INTEGRATIONS_ENABLE_SLACK_PROVIDER: bool({\n desc: 'Enables the Slack integration provider so users can connect Slack workspaces.',\n default: false,\n }),\n INTEGRATIONS_ENABLE_WEBHOOK_PROVIDER: bool({\n desc: 'Enables the generic webhook integration provider so users can create inbound webhook URLs. It is enabled by default because it does not require provider setup.',\n default: true,\n }),\n});\n"],"names":["bool","createConfig","config","INTEGRATIONS_ENABLE_CRON_PROVIDER","desc","default","INTEGRATIONS_ENABLE_GITEA_PROVIDER","INTEGRATIONS_ENABLE_GITHUB_PROVIDER","INTEGRATIONS_ENABLE_JIRA_PROVIDER","INTEGRATIONS_ENABLE_LINEAR_PROVIDER","INTEGRATIONS_ENABLE_SENTRY_PROVIDER","INTEGRATIONS_ENABLE_SLACK_PROVIDER","INTEGRATIONS_ENABLE_WEBHOOK_PROVIDER"],"mappings":"AAAA,SAAQA,IAAI,EAAEC,YAAY,QAAO,kBAAkB;AAEnD,OAAO,MAAMC,SAASD,aAAa;IACjCE,mCAAmCH,KAAK;QACtCI,MAAM;QACNC,SAAS;IACX;IACAC,oCAAoCN,KAAK;QACvCI,MAAM;QACNC,SAAS;IACX;IACAE,qCAAqCP,KAAK;QACxCI,MAAM;QACNC,SAAS;IACX;IACAG,mCAAmCR,KAAK;QACtCI,MAAM;QACNC,SAAS;IACX;IACAI,qCAAqCT,KAAK;QACxCI,MAAM;QACNC,SAAS;IACX;IACAK,qCAAqCV,KAAK;QACxCI,MAAM;QACNC,SAAS;IACX;IACAM,oCAAoCX,KAAK;QACvCI,MAAM;QACNC,SAAS;IACX;IACAO,sCAAsCZ,KAAK;QACzCI,MAAM;QACNC,SAAS;IACX;AACF,GAAG"}
@@ -0,0 +1,3 @@
1
+ import type { IntegrationProviderModule } from '#providers/types.js';
2
+ export declare const jiraProviderModule: IntegrationProviderModule;
3
+ //# sourceMappingURL=jira.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jira.d.ts","sourceRoot":"","sources":["../../src/providers/jira.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAyB,yBAAyB,EAAC,MAAM,qBAAqB,CAAC;AAqB3F,eAAO,MAAM,kBAAkB,EAAE,yBAIhC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { config } from '#config.js';
2
+ const JIRA_MIGRATIONS_TABLE = '__drizzle_migrations_integrations_jira';
3
+ async function loadJiraModuleParts() {
4
+ const { createJiraIntegrationProvider, db: jiraDb, migrationsPath } = await import('@shipfox/api-integration-jira');
5
+ return {
6
+ provider: createJiraIntegrationProvider(),
7
+ database: {
8
+ db: jiraDb,
9
+ migrationsPath,
10
+ migrationsTableName: JIRA_MIGRATIONS_TABLE
11
+ }
12
+ };
13
+ }
14
+ export const jiraProviderModule = {
15
+ id: 'jira',
16
+ enabled: config.INTEGRATIONS_ENABLE_JIRA_PROVIDER,
17
+ load: loadJiraModuleParts
18
+ };
19
+
20
+ //# sourceMappingURL=jira.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/providers/jira.ts"],"sourcesContent":["import {config} from '#config.js';\nimport type {IntegrationModuleParts, IntegrationProviderModule} from '#providers/types.js';\n\nconst JIRA_MIGRATIONS_TABLE = '__drizzle_migrations_integrations_jira';\n\nasync function loadJiraModuleParts(): Promise<IntegrationModuleParts> {\n const {\n createJiraIntegrationProvider,\n db: jiraDb,\n migrationsPath,\n } = await import('@shipfox/api-integration-jira');\n\n return {\n provider: createJiraIntegrationProvider(),\n database: {\n db: jiraDb,\n migrationsPath,\n migrationsTableName: JIRA_MIGRATIONS_TABLE,\n },\n };\n}\n\nexport const jiraProviderModule: IntegrationProviderModule = {\n id: 'jira',\n enabled: config.INTEGRATIONS_ENABLE_JIRA_PROVIDER,\n load: loadJiraModuleParts,\n};\n"],"names":["config","JIRA_MIGRATIONS_TABLE","loadJiraModuleParts","createJiraIntegrationProvider","db","jiraDb","migrationsPath","provider","database","migrationsTableName","jiraProviderModule","id","enabled","INTEGRATIONS_ENABLE_JIRA_PROVIDER","load"],"mappings":"AAAA,SAAQA,MAAM,QAAO,aAAa;AAGlC,MAAMC,wBAAwB;AAE9B,eAAeC;IACb,MAAM,EACJC,6BAA6B,EAC7BC,IAAIC,MAAM,EACVC,cAAc,EACf,GAAG,MAAM,MAAM,CAAC;IAEjB,OAAO;QACLC,UAAUJ;QACVK,UAAU;YACRJ,IAAIC;YACJC;YACAG,qBAAqBR;QACvB;IACF;AACF;AAEA,OAAO,MAAMS,qBAAgD;IAC3DC,IAAI;IACJC,SAASZ,OAAOa,iCAAiC;IACjDC,MAAMZ;AACR,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../src/providers/modules.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,sBAAsB,EACtB,oCAAoC,EACrC,MAAM,qBAAqB,CAAC;AAc7B,wBAAsB,0BAA0B,CAC9C,OAAO,GAAE,oCAAyC,GACjD,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAOnC"}
1
+ {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../src/providers/modules.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,sBAAsB,EACtB,oCAAoC,EACrC,MAAM,qBAAqB,CAAC;AAgB7B,wBAAsB,0BAA0B,CAC9C,OAAO,GAAE,oCAAyC,GACjD,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAOnC"}
@@ -1,14 +1,18 @@
1
1
  import { cronProviderModule } from '#providers/cron.js';
2
2
  import { giteaProviderModule } from '#providers/gitea.js';
3
3
  import { githubProviderModule } from '#providers/github.js';
4
+ import { jiraProviderModule } from '#providers/jira.js';
4
5
  import { linearProviderModule } from '#providers/linear.js';
5
6
  import { sentryProviderModule } from '#providers/sentry.js';
7
+ import { slackProviderModule } from '#providers/slack.js';
6
8
  import { webhookProviderModule } from '#providers/webhook.js';
7
9
  // Order is significant: databases are migrated in this order, so list a provider
8
10
  // before any that depend on its tables.
9
11
  const providerModules = [
10
12
  githubProviderModule,
11
13
  linearProviderModule,
14
+ slackProviderModule,
15
+ jiraProviderModule,
12
16
  sentryProviderModule,
13
17
  giteaProviderModule,
14
18
  cronProviderModule,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/providers/modules.ts"],"sourcesContent":["import {cronProviderModule} from '#providers/cron.js';\nimport {giteaProviderModule} from '#providers/gitea.js';\nimport {githubProviderModule} from '#providers/github.js';\nimport {linearProviderModule} from '#providers/linear.js';\nimport {sentryProviderModule} from '#providers/sentry.js';\nimport type {\n IntegrationModuleParts,\n IntegrationProviderModuleLoadOptions,\n} from '#providers/types.js';\nimport {webhookProviderModule} from '#providers/webhook.js';\n\n// Order is significant: databases are migrated in this order, so list a provider\n// before any that depend on its tables.\nconst providerModules = [\n githubProviderModule,\n linearProviderModule,\n sentryProviderModule,\n giteaProviderModule,\n cronProviderModule,\n webhookProviderModule,\n];\n\nexport async function loadEnabledProviderModules(\n options: IntegrationProviderModuleLoadOptions = {},\n): Promise<IntegrationModuleParts[]> {\n const parts: IntegrationModuleParts[] = [];\n for (const module of providerModules) {\n if (!module.enabled) continue;\n parts.push(await module.load(options));\n }\n return parts;\n}\n"],"names":["cronProviderModule","giteaProviderModule","githubProviderModule","linearProviderModule","sentryProviderModule","webhookProviderModule","providerModules","loadEnabledProviderModules","options","parts","module","enabled","push","load"],"mappings":"AAAA,SAAQA,kBAAkB,QAAO,qBAAqB;AACtD,SAAQC,mBAAmB,QAAO,sBAAsB;AACxD,SAAQC,oBAAoB,QAAO,uBAAuB;AAC1D,SAAQC,oBAAoB,QAAO,uBAAuB;AAC1D,SAAQC,oBAAoB,QAAO,uBAAuB;AAK1D,SAAQC,qBAAqB,QAAO,wBAAwB;AAE5D,iFAAiF;AACjF,wCAAwC;AACxC,MAAMC,kBAAkB;IACtBJ;IACAC;IACAC;IACAH;IACAD;IACAK;CACD;AAED,OAAO,eAAeE,2BACpBC,UAAgD,CAAC,CAAC;IAElD,MAAMC,QAAkC,EAAE;IAC1C,KAAK,MAAMC,UAAUJ,gBAAiB;QACpC,IAAI,CAACI,OAAOC,OAAO,EAAE;QACrBF,MAAMG,IAAI,CAAC,MAAMF,OAAOG,IAAI,CAACL;IAC/B;IACA,OAAOC;AACT"}
1
+ {"version":3,"sources":["../../src/providers/modules.ts"],"sourcesContent":["import {cronProviderModule} from '#providers/cron.js';\nimport {giteaProviderModule} from '#providers/gitea.js';\nimport {githubProviderModule} from '#providers/github.js';\nimport {jiraProviderModule} from '#providers/jira.js';\nimport {linearProviderModule} from '#providers/linear.js';\nimport {sentryProviderModule} from '#providers/sentry.js';\nimport {slackProviderModule} from '#providers/slack.js';\nimport type {\n IntegrationModuleParts,\n IntegrationProviderModuleLoadOptions,\n} from '#providers/types.js';\nimport {webhookProviderModule} from '#providers/webhook.js';\n\n// Order is significant: databases are migrated in this order, so list a provider\n// before any that depend on its tables.\nconst providerModules = [\n githubProviderModule,\n linearProviderModule,\n slackProviderModule,\n jiraProviderModule,\n sentryProviderModule,\n giteaProviderModule,\n cronProviderModule,\n webhookProviderModule,\n];\n\nexport async function loadEnabledProviderModules(\n options: IntegrationProviderModuleLoadOptions = {},\n): Promise<IntegrationModuleParts[]> {\n const parts: IntegrationModuleParts[] = [];\n for (const module of providerModules) {\n if (!module.enabled) continue;\n parts.push(await module.load(options));\n }\n return parts;\n}\n"],"names":["cronProviderModule","giteaProviderModule","githubProviderModule","jiraProviderModule","linearProviderModule","sentryProviderModule","slackProviderModule","webhookProviderModule","providerModules","loadEnabledProviderModules","options","parts","module","enabled","push","load"],"mappings":"AAAA,SAAQA,kBAAkB,QAAO,qBAAqB;AACtD,SAAQC,mBAAmB,QAAO,sBAAsB;AACxD,SAAQC,oBAAoB,QAAO,uBAAuB;AAC1D,SAAQC,kBAAkB,QAAO,qBAAqB;AACtD,SAAQC,oBAAoB,QAAO,uBAAuB;AAC1D,SAAQC,oBAAoB,QAAO,uBAAuB;AAC1D,SAAQC,mBAAmB,QAAO,sBAAsB;AAKxD,SAAQC,qBAAqB,QAAO,wBAAwB;AAE5D,iFAAiF;AACjF,wCAAwC;AACxC,MAAMC,kBAAkB;IACtBN;IACAE;IACAE;IACAH;IACAE;IACAJ;IACAD;IACAO;CACD;AAED,OAAO,eAAeE,2BACpBC,UAAgD,CAAC,CAAC;IAElD,MAAMC,QAAkC,EAAE;IAC1C,KAAK,MAAMC,UAAUJ,gBAAiB;QACpC,IAAI,CAACI,OAAOC,OAAO,EAAE;QACrBF,MAAMG,IAAI,CAAC,MAAMF,OAAOG,IAAI,CAACL;IAC/B;IACA,OAAOC;AACT"}
@@ -0,0 +1,3 @@
1
+ import type { IntegrationProviderModule } from '#providers/types.js';
2
+ export declare const slackProviderModule: IntegrationProviderModule;
3
+ //# sourceMappingURL=slack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slack.d.ts","sourceRoot":"","sources":["../../src/providers/slack.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAyB,yBAAyB,EAAC,MAAM,qBAAqB,CAAC;AAmJ3F,eAAO,MAAM,mBAAmB,EAAE,yBAIjC,CAAC"}
@@ -0,0 +1,134 @@
1
+ import { slugifyConnectionSlug } from '@shipfox/api-integration-core-dto';
2
+ import { config } from '#config.js';
3
+ import { deleteIntegrationConnection, getIntegrationConnectionById, resolveUniqueConnectionSlug, upsertIntegrationConnection } from '#db/connections.js';
4
+ import { db } from '#db/db.js';
5
+ import { publishIntegrationEventReceived, recordDeliveryOnly } from '#db/webhook-deliveries.js';
6
+ import { retryConnectionSlugCollision } from '#providers/connection-slug.js';
7
+ const SLACK_MIGRATIONS_TABLE = '__drizzle_migrations_integrations_slack';
8
+ const SLACK_SECRETS_NAMESPACE_PREFIX = 'system/integrations/slack/';
9
+ async function loadSlackModuleParts(options = {}) {
10
+ const { createSlackE2eRoutes, createSlackIntegrationProvider, createSlackTokenStore, db: slackDb, disconnectSlackInstallation: disconnectSlackInstallationRecords, getSlackInstallationByTeamId, migrationsPath: slackMigrationsPath, upsertSlackInstallation } = await import('@shipfox/api-integration-slack');
11
+ async function getExistingSlackConnection(input) {
12
+ const installation = await getSlackInstallationByTeamId(input.teamId);
13
+ if (!installation) return undefined;
14
+ const connection = await getIntegrationConnectionById(installation.connectionId);
15
+ if (!connection) return undefined;
16
+ return connection;
17
+ }
18
+ async function connectSlackInstallation(input) {
19
+ return await retryConnectionSlugCollision(()=>db().transaction(async (tx)=>{
20
+ const baseSlug = slugifyConnectionSlug(`slack_${input.teamName || input.teamId}`, {
21
+ fallback: 'slack'
22
+ });
23
+ const slug = await resolveUniqueConnectionSlug({
24
+ workspaceId: input.workspaceId,
25
+ provider: 'slack',
26
+ externalAccountId: input.teamId,
27
+ baseSlug
28
+ }, {
29
+ tx
30
+ });
31
+ const connection = await upsertIntegrationConnection({
32
+ workspaceId: input.workspaceId,
33
+ provider: 'slack',
34
+ externalAccountId: input.teamId,
35
+ slug,
36
+ displayName: input.displayName,
37
+ lifecycleStatus: 'active'
38
+ }, {
39
+ tx
40
+ });
41
+ await upsertSlackInstallation({
42
+ connectionId: connection.id,
43
+ teamId: input.teamId,
44
+ teamName: input.teamName,
45
+ appId: input.appId,
46
+ botUserId: input.botUserId,
47
+ scopes: input.scopes,
48
+ tokenExpiresAt: input.tokenExpiresAt,
49
+ status: 'installed'
50
+ }, {
51
+ tx
52
+ });
53
+ return connection;
54
+ }));
55
+ }
56
+ async function disconnectSlackInstallation(input) {
57
+ await disconnectSlackInstallationRecords({
58
+ connectionId: input.connectionId,
59
+ getConnection: getIntegrationConnectionById,
60
+ deleteSecrets: (params)=>options.secrets?.slack?.deleteSecrets({
61
+ ...params,
62
+ namespace: slackNamespaceSuffix(params.namespace)
63
+ }) ?? Promise.resolve(0),
64
+ transaction: (fn)=>db().transaction((tx)=>fn(tx)),
65
+ deleteConnection: (params, options)=>deleteIntegrationConnection({
66
+ id: params.connectionId
67
+ }, options)
68
+ });
69
+ }
70
+ const fallbackSecrets = {
71
+ getSecret: ()=>Promise.resolve(null),
72
+ setSecrets: ()=>Promise.reject(new Error('Slack token storage is not configured'))
73
+ };
74
+ const secrets = options.secrets?.slack ? {
75
+ getSecret: (params)=>options.secrets?.slack?.getSecret({
76
+ ...params,
77
+ namespace: slackNamespaceSuffix(params.namespace)
78
+ }) ?? Promise.resolve(null),
79
+ setSecrets: (params)=>options.secrets?.slack?.setSecrets({
80
+ ...params,
81
+ namespace: slackNamespaceSuffix(params.namespace)
82
+ }) ?? Promise.resolve()
83
+ } : fallbackSecrets;
84
+ const tokenStore = createSlackTokenStore({
85
+ resolveConnection: async (connectionId)=>getIntegrationConnectionById(connectionId),
86
+ secrets
87
+ });
88
+ return {
89
+ provider: createSlackIntegrationProvider({
90
+ agentTools: {
91
+ tokenStore
92
+ },
93
+ routes: {
94
+ tokenStore,
95
+ getExistingSlackConnection,
96
+ connectSlackInstallation,
97
+ disconnectSlackInstallation,
98
+ coreDb: db,
99
+ publishIntegrationEventReceived,
100
+ recordDeliveryOnly,
101
+ getIntegrationConnectionById
102
+ }
103
+ }),
104
+ e2eRoutes: [
105
+ createSlackE2eRoutes({
106
+ tokenStore,
107
+ getExistingSlackConnection,
108
+ connectSlackInstallation,
109
+ disconnectSlackInstallation,
110
+ connectionCapabilities: [
111
+ 'agent_tools'
112
+ ]
113
+ })
114
+ ],
115
+ database: {
116
+ db: slackDb,
117
+ migrationsPath: slackMigrationsPath,
118
+ migrationsTableName: SLACK_MIGRATIONS_TABLE
119
+ }
120
+ };
121
+ }
122
+ export const slackProviderModule = {
123
+ id: 'slack',
124
+ enabled: config.INTEGRATIONS_ENABLE_SLACK_PROVIDER,
125
+ load: loadSlackModuleParts
126
+ };
127
+ function slackNamespaceSuffix(namespace) {
128
+ if (!namespace.startsWith(SLACK_SECRETS_NAMESPACE_PREFIX)) {
129
+ throw new Error('Slack provider attempted to access an unscoped secret namespace');
130
+ }
131
+ return namespace.slice(SLACK_SECRETS_NAMESPACE_PREFIX.length);
132
+ }
133
+
134
+ //# sourceMappingURL=slack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/providers/slack.ts"],"sourcesContent":["import {\n type IntegrationConnection as CoreIntegrationConnection,\n slugifyConnectionSlug,\n} from '@shipfox/api-integration-core-dto';\nimport type {\n ConnectSlackInstallationInput,\n SlackSecretsStore,\n} from '@shipfox/api-integration-slack';\nimport {config} from '#config.js';\nimport {\n deleteIntegrationConnection,\n getIntegrationConnectionById,\n resolveUniqueConnectionSlug,\n upsertIntegrationConnection,\n} from '#db/connections.js';\nimport {db} from '#db/db.js';\nimport {publishIntegrationEventReceived, recordDeliveryOnly} from '#db/webhook-deliveries.js';\nimport {retryConnectionSlugCollision} from '#providers/connection-slug.js';\nimport type {IntegrationModuleParts, IntegrationProviderModule} from '#providers/types.js';\n\nconst SLACK_MIGRATIONS_TABLE = '__drizzle_migrations_integrations_slack';\nconst SLACK_SECRETS_NAMESPACE_PREFIX = 'system/integrations/slack/';\n\ntype IntegrationDb = ReturnType<typeof db>;\ntype IntegrationTx = Parameters<Parameters<IntegrationDb['transaction']>[0]>[0];\n\nasync function loadSlackModuleParts(\n options: Parameters<IntegrationProviderModule['load']>[0] = {},\n): Promise<IntegrationModuleParts> {\n const {\n createSlackE2eRoutes,\n createSlackIntegrationProvider,\n createSlackTokenStore,\n db: slackDb,\n disconnectSlackInstallation: disconnectSlackInstallationRecords,\n getSlackInstallationByTeamId,\n migrationsPath: slackMigrationsPath,\n upsertSlackInstallation,\n } = await import('@shipfox/api-integration-slack');\n\n async function getExistingSlackConnection(input: {\n teamId: string;\n }): Promise<CoreIntegrationConnection<'slack'> | undefined> {\n const installation = await getSlackInstallationByTeamId(input.teamId);\n if (!installation) return undefined;\n const connection = await getIntegrationConnectionById(installation.connectionId);\n if (!connection) return undefined;\n return connection as CoreIntegrationConnection<'slack'>;\n }\n\n async function connectSlackInstallation(\n input: ConnectSlackInstallationInput,\n ): Promise<CoreIntegrationConnection<'slack'>> {\n return await retryConnectionSlugCollision(() =>\n db().transaction(async (tx) => {\n const baseSlug = slugifyConnectionSlug(`slack_${input.teamName || input.teamId}`, {\n fallback: 'slack',\n });\n const slug = await resolveUniqueConnectionSlug(\n {\n workspaceId: input.workspaceId,\n provider: 'slack',\n externalAccountId: input.teamId,\n baseSlug,\n },\n {tx},\n );\n const connection = await upsertIntegrationConnection(\n {\n workspaceId: input.workspaceId,\n provider: 'slack',\n externalAccountId: input.teamId,\n slug,\n displayName: input.displayName,\n lifecycleStatus: 'active',\n },\n {tx},\n );\n await upsertSlackInstallation(\n {\n connectionId: connection.id,\n teamId: input.teamId,\n teamName: input.teamName,\n appId: input.appId,\n botUserId: input.botUserId,\n scopes: input.scopes,\n tokenExpiresAt: input.tokenExpiresAt,\n status: 'installed',\n },\n {tx},\n );\n return connection as CoreIntegrationConnection<'slack'>;\n }),\n );\n }\n\n async function disconnectSlackInstallation(input: {connectionId: string}): Promise<void> {\n await disconnectSlackInstallationRecords<IntegrationTx>({\n connectionId: input.connectionId,\n getConnection: getIntegrationConnectionById,\n deleteSecrets: (params) =>\n options.secrets?.slack?.deleteSecrets({\n ...params,\n namespace: slackNamespaceSuffix(params.namespace),\n }) ?? Promise.resolve(0),\n transaction: (fn) => db().transaction((tx) => fn(tx)),\n deleteConnection: (params, options) =>\n deleteIntegrationConnection({id: params.connectionId}, options),\n });\n }\n\n const fallbackSecrets: SlackSecretsStore = {\n getSecret: () => Promise.resolve(null),\n setSecrets: () => Promise.reject(new Error('Slack token storage is not configured')),\n };\n const secrets: SlackSecretsStore = options.secrets?.slack\n ? {\n getSecret: (params: Parameters<SlackSecretsStore['getSecret']>[0]) =>\n options.secrets?.slack?.getSecret({\n ...params,\n namespace: slackNamespaceSuffix(params.namespace),\n }) ?? Promise.resolve(null),\n setSecrets: (params: Parameters<SlackSecretsStore['setSecrets']>[0]) =>\n options.secrets?.slack?.setSecrets({\n ...params,\n namespace: slackNamespaceSuffix(params.namespace),\n }) ?? Promise.resolve(),\n }\n : fallbackSecrets;\n const tokenStore = createSlackTokenStore({\n resolveConnection: async (connectionId) => getIntegrationConnectionById(connectionId),\n secrets,\n });\n\n return {\n provider: createSlackIntegrationProvider({\n agentTools: {tokenStore},\n routes: {\n tokenStore,\n getExistingSlackConnection,\n connectSlackInstallation,\n disconnectSlackInstallation,\n coreDb: db,\n publishIntegrationEventReceived,\n recordDeliveryOnly,\n getIntegrationConnectionById,\n },\n }),\n e2eRoutes: [\n createSlackE2eRoutes({\n tokenStore,\n getExistingSlackConnection,\n connectSlackInstallation,\n disconnectSlackInstallation,\n connectionCapabilities: ['agent_tools'],\n }),\n ],\n database: {\n db: slackDb,\n migrationsPath: slackMigrationsPath,\n migrationsTableName: SLACK_MIGRATIONS_TABLE,\n },\n };\n}\n\nexport const slackProviderModule: IntegrationProviderModule = {\n id: 'slack',\n enabled: config.INTEGRATIONS_ENABLE_SLACK_PROVIDER,\n load: loadSlackModuleParts,\n};\n\nfunction slackNamespaceSuffix(namespace: string): string {\n if (!namespace.startsWith(SLACK_SECRETS_NAMESPACE_PREFIX)) {\n throw new Error('Slack provider attempted to access an unscoped secret namespace');\n }\n return namespace.slice(SLACK_SECRETS_NAMESPACE_PREFIX.length);\n}\n"],"names":["slugifyConnectionSlug","config","deleteIntegrationConnection","getIntegrationConnectionById","resolveUniqueConnectionSlug","upsertIntegrationConnection","db","publishIntegrationEventReceived","recordDeliveryOnly","retryConnectionSlugCollision","SLACK_MIGRATIONS_TABLE","SLACK_SECRETS_NAMESPACE_PREFIX","loadSlackModuleParts","options","createSlackE2eRoutes","createSlackIntegrationProvider","createSlackTokenStore","slackDb","disconnectSlackInstallation","disconnectSlackInstallationRecords","getSlackInstallationByTeamId","migrationsPath","slackMigrationsPath","upsertSlackInstallation","getExistingSlackConnection","input","installation","teamId","undefined","connection","connectionId","connectSlackInstallation","transaction","tx","baseSlug","teamName","fallback","slug","workspaceId","provider","externalAccountId","displayName","lifecycleStatus","id","appId","botUserId","scopes","tokenExpiresAt","status","getConnection","deleteSecrets","params","secrets","slack","namespace","slackNamespaceSuffix","Promise","resolve","fn","deleteConnection","fallbackSecrets","getSecret","setSecrets","reject","Error","tokenStore","resolveConnection","agentTools","routes","coreDb","e2eRoutes","connectionCapabilities","database","migrationsTableName","slackProviderModule","enabled","INTEGRATIONS_ENABLE_SLACK_PROVIDER","load","startsWith","slice","length"],"mappings":"AAAA,SAEEA,qBAAqB,QAChB,oCAAoC;AAK3C,SAAQC,MAAM,QAAO,aAAa;AAClC,SACEC,2BAA2B,EAC3BC,4BAA4B,EAC5BC,2BAA2B,EAC3BC,2BAA2B,QACtB,qBAAqB;AAC5B,SAAQC,EAAE,QAAO,YAAY;AAC7B,SAAQC,+BAA+B,EAAEC,kBAAkB,QAAO,4BAA4B;AAC9F,SAAQC,4BAA4B,QAAO,gCAAgC;AAG3E,MAAMC,yBAAyB;AAC/B,MAAMC,iCAAiC;AAKvC,eAAeC,qBACbC,UAA4D,CAAC,CAAC;IAE9D,MAAM,EACJC,oBAAoB,EACpBC,8BAA8B,EAC9BC,qBAAqB,EACrBV,IAAIW,OAAO,EACXC,6BAA6BC,kCAAkC,EAC/DC,4BAA4B,EAC5BC,gBAAgBC,mBAAmB,EACnCC,uBAAuB,EACxB,GAAG,MAAM,MAAM,CAAC;IAEjB,eAAeC,2BAA2BC,KAEzC;QACC,MAAMC,eAAe,MAAMN,6BAA6BK,MAAME,MAAM;QACpE,IAAI,CAACD,cAAc,OAAOE;QAC1B,MAAMC,aAAa,MAAM1B,6BAA6BuB,aAAaI,YAAY;QAC/E,IAAI,CAACD,YAAY,OAAOD;QACxB,OAAOC;IACT;IAEA,eAAeE,yBACbN,KAAoC;QAEpC,OAAO,MAAMhB,6BAA6B,IACxCH,KAAK0B,WAAW,CAA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AAW,IAAML,QAAQC,OAAO,CAAC;QACjCK,YAAY,IAAMN,QAAQO,MAAM,CAAC,IAAIC,MAAM;IAC7C;IACA,MAAMZ,UAA6BvC,QAAQuC,OAAO,EAAEC,QAChD;QACEQ,WAAW,CAACV,SACVtC,QAAQuC,OAAO,EAAEC,OAAOQ,UAAU;gBAChC,GAAGV,MAAM;gBACTG,WAAWC,qBAAqBJ,OAAOG,SAAS;YAClD,MAAME,QAAQC,OAAO,CAAC;QACxBK,YAAY,CAACX,SACXtC,QAAQuC,OAAO,EAAEC,OAAOS,WAAW;gBACjC,GAAGX,MAAM;gBACTG,WAAWC,qBAAqBJ,OAAOG,SAAS;YAClD,MAAME,QAAQC,OAAO;IACzB,IACAG;IACJ,MAAMK,aAAajD,sBAAsB;QACvCkD,mBAAmB,OAAOpC,eAAiB3B,6BAA6B2B;QACxEsB;IACF;IAEA,OAAO;QACLb,UAAUxB,+BAA+B;YACvCoD,YAAY;gBAACF;YAAU;YACvBG,QAAQ;gBACNH;gBACAzC;gBACAO;gBACAb;gBACAmD,QAAQ/D;gBACRC;gBACAC;gBACAL;YACF;QACF;QACAmE,WAAW;YACTxD,qBAAqB;gBACnBmD;gBACAzC;gBACAO;gBACAb;gBACAqD,wBAAwB;oBAAC;iBAAc;YACzC;SACD;QACDC,UAAU;YACRlE,IAAIW;YACJI,gBAAgBC;YAChBmD,qBAAqB/D;QACvB;IACF;AACF;AAEA,OAAO,MAAMgE,sBAAiD;IAC5D/B,IAAI;IACJgC,SAAS1E,OAAO2E,kCAAkC;IAClDC,MAAMjE;AACR,EAAE;AAEF,SAAS2C,qBAAqBD,SAAiB;IAC7C,IAAI,CAACA,UAAUwB,UAAU,CAACnE,iCAAiC;QACzD,MAAM,IAAIqD,MAAM;IAClB;IACA,OAAOV,UAAUyB,KAAK,CAACpE,+BAA+BqE,MAAM;AAC9D"}
@@ -32,7 +32,9 @@ export interface IntegrationProviderModuleLoadOptions {
32
32
  }
33
33
  export interface IntegrationProviderSecrets {
34
34
  github?: IntegrationProviderScopedSecrets | undefined;
35
+ jira?: IntegrationProviderScopedSecrets | undefined;
35
36
  linear?: IntegrationProviderScopedSecrets | undefined;
37
+ slack?: IntegrationProviderScopedSecrets | undefined;
36
38
  deleteSecrets(params: {
37
39
  workspaceId: string;
38
40
  namespace: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/providers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAC,cAAc,EAAE,YAAY,EAAC,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,4BAA4B,CAAC;AAEpE;;;;;;;;GAQG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,QAAQ,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IACtC,SAAS,CAAC,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC;IACtC,OAAO,CAAC,EAAE,YAAY,EAAE,GAAG,SAAS,CAAC;IACrC,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC;CACvD;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,OAAO,CAAC,EAAE,oCAAoC,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACvF;AAED,MAAM,WAAW,oCAAoC;IACnD,OAAO,CAAC,EAAE,0BAA0B,GAAG,SAAS,CAAC;CAClD;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,CAAC,EAAE,gCAAgC,GAAG,SAAS,CAAC;IACtD,MAAM,CAAC,EAAE,gCAAgC,GAAG,SAAS,CAAC;IACtD,aAAa,CAAC,MAAM,EAAE;QAAC,WAA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A;KAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAClF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/providers/types.ts"],"sourcesContent":["import type {RouteExport} from '@shipfox/node-fastify';\nimport type {ModuleDatabase, ModuleWorker} from '@shipfox/node-module';\nimport type {IntegrationProvider} from '#core/entities/provider.js';\n\n/**\n * Everything one integration contributes to the composed integrations module:\n * a registry provider, plus an optional dedicated database, background workers,\n * and one-shot boot-time tasks. Providers that own none of these simply omit them.\n *\n * A startup task is run once after modules are initialized (migrations done). The\n * provider owns its own wiring — core runs each task generically and isolates\n * failures so a task can never gate API boot.\n */\nexport interface IntegrationModuleParts {\n provider: IntegrationProvider;\n database?: ModuleDatabase | undefined;\n e2eRoutes?: RouteExport[] | undefined;\n workers?: ModuleWorker[] | undefined;\n startupTasks?: Array<() => Promise<void>> | undefined;\n}\n\n/**\n * A config-gated integration, registered once in `providerModules`. `load` is\n * called lazily and only when `enabled`, so a disabled provider never imports\n * its (potentially heavy) implementation package.\n */\nexport interface IntegrationProviderModule {\n id: string;\n enabled: boolean;\n load(options?: IntegrationProviderModuleLoadOptions): Promise<IntegrationModuleParts>;\n}\n\nexport interface IntegrationProviderModuleLoadOptions {\n secrets?: IntegrationProviderSecrets | undefined;\n}\n\nexport interface IntegrationProviderSecrets {\n github?: IntegrationProviderScopedSecrets | undefined;\n linear?: IntegrationProviderScopedSecrets | undefined;\n deleteSecrets(params: {workspaceId: string; namespace: string}): Promise<number>;\n}\n\nexport interface IntegrationProviderScopedSecrets {\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 deleteSecrets(params: {workspaceId: string; namespace: string}): Promise<number>;\n}\n"],"names":[],"mappings":"AA0CA,WASC"}
1
+ {"version":3,"sources":["../../src/providers/types.ts"],"sourcesContent":["import type {RouteExport} from '@shipfox/node-fastify';\nimport type {ModuleDatabase, ModuleWorker} from '@shipfox/node-module';\nimport type {IntegrationProvider} from '#core/entities/provider.js';\n\n/**\n * Everything one integration contributes to the composed integrations module:\n * a registry provider, plus an optional dedicated database, background workers,\n * and one-shot boot-time tasks. Providers that own none of these simply omit them.\n *\n * A startup task is run once after modules are initialized (migrations done). The\n * provider owns its own wiring — core runs each task generically and isolates\n * failures so a task can never gate API boot.\n */\nexport interface IntegrationModuleParts {\n provider: IntegrationProvider;\n database?: ModuleDatabase | undefined;\n e2eRoutes?: RouteExport[] | undefined;\n workers?: ModuleWorker[] | undefined;\n startupTasks?: Array<() => Promise<void>> | undefined;\n}\n\n/**\n * A config-gated integration, registered once in `providerModules`. `load` is\n * called lazily and only when `enabled`, so a disabled provider never imports\n * its (potentially heavy) implementation package.\n */\nexport interface IntegrationProviderModule {\n id: string;\n enabled: boolean;\n load(options?: IntegrationProviderModuleLoadOptions): Promise<IntegrationModuleParts>;\n}\n\nexport interface IntegrationProviderModuleLoadOptions {\n secrets?: IntegrationProviderSecrets | undefined;\n}\n\nexport interface IntegrationProviderSecrets {\n github?: IntegrationProviderScopedSecrets | undefined;\n jira?: IntegrationProviderScopedSecrets | undefined;\n linear?: IntegrationProviderScopedSecrets | undefined;\n slack?: IntegrationProviderScopedSecrets | undefined;\n deleteSecrets(params: {workspaceId: string; namespace: string}): Promise<number>;\n}\n\nexport interface IntegrationProviderScopedSecrets {\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 deleteSecrets(params: {workspaceId: string; namespace: string}): Promise<number>;\n}\n"],"names":[],"mappings":"AA4CA,WASC"}