@shipfox/api-server 7.1.0 → 9.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  $ shipfox-swc
2
- Successfully compiled: 7 files with swc (415.93ms)
2
+ Successfully compiled: 7 files with swc (357.93ms)
package/CHANGELOG.md CHANGED
@@ -1,5 +1,122 @@
1
1
  # @shipfox/api-server
2
2
 
3
+ ## 9.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 475ce59: Republishes all public packages after restoring release authorization.
8
+ - Updated dependencies [067d309]
9
+ - Updated dependencies [8436596]
10
+ - Updated dependencies [44c15c8]
11
+ - Updated dependencies [475ce59]
12
+ - Updated dependencies [a041e25]
13
+ - Updated dependencies [154e03f]
14
+ - Updated dependencies [cd28a05]
15
+ - @shipfox/api-agent@9.0.1
16
+ - @shipfox/api-secrets-dto@9.0.1
17
+ - @shipfox/api-email-challenges@1.1.0
18
+ - @shipfox/annotations@9.0.1
19
+ - @shipfox/annotations-dto@9.0.1
20
+ - @shipfox/api-agent-dto@9.0.1
21
+ - @shipfox/api-auth@9.0.1
22
+ - @shipfox/api-auth-dto@9.0.1
23
+ - @shipfox/api-definitions@9.0.1
24
+ - @shipfox/api-definitions-dto@9.0.1
25
+ - @shipfox/api-dispatcher@9.0.1
26
+ - @shipfox/api-integration-core@9.0.1
27
+ - @shipfox/api-integration-core-dto@9.0.1
28
+ - @shipfox/api-logs@9.0.1
29
+ - @shipfox/api-projects@9.0.1
30
+ - @shipfox/api-projects-dto@9.0.1
31
+ - @shipfox/api-runners@9.0.1
32
+ - @shipfox/api-runners-dto@9.0.1
33
+ - @shipfox/api-secrets@9.0.1
34
+ - @shipfox/api-triggers@9.0.1
35
+ - @shipfox/api-workflows@9.0.1
36
+ - @shipfox/api-workflows-dto@9.0.1
37
+ - @shipfox/api-workspaces@9.0.1
38
+ - @shipfox/api-workspaces-dto@9.0.1
39
+ - @shipfox/config@1.2.3
40
+ - @shipfox/node-error-monitoring@0.2.1
41
+ - @shipfox/node-fastify@0.3.1
42
+ - @shipfox/node-jwt@0.3.1
43
+ - @shipfox/node-module@1.0.0
44
+ - @shipfox/node-opentelemetry@0.6.1
45
+ - @shipfox/node-postgres@0.4.3
46
+
47
+ ## 9.0.0
48
+
49
+ ### Patch Changes
50
+
51
+ - 46aa52f: Closes remaining API package-boundary exceptions and moves model-provider policy behind the Agent implementation boundary.
52
+ - c279061: Improves release verification with owner-defined packed contracts, discovery-driven artifact checks, and an early publication preflight.
53
+ - Updated dependencies [9c9d266]
54
+ - Updated dependencies [074e7b3]
55
+ - Updated dependencies [46aa52f]
56
+ - Updated dependencies [a9f9c57]
57
+ - Updated dependencies [02974d6]
58
+ - Updated dependencies [4a6d124]
59
+ - Updated dependencies [c279061]
60
+ - Updated dependencies [9083d20]
61
+ - @shipfox/api-workspaces-dto@9.0.0
62
+ - @shipfox/api-workspaces@9.0.0
63
+ - @shipfox/api-workflows@9.0.0
64
+ - @shipfox/api-agent-dto@9.0.0
65
+ - @shipfox/api-agent@9.0.0
66
+ - @shipfox/api-definitions@9.0.0
67
+ - @shipfox/api-integration-core-dto@9.0.0
68
+ - @shipfox/api-secrets-dto@9.0.0
69
+ - @shipfox/api-integration-core@9.0.0
70
+ - @shipfox/api-email-challenges@1.0.0
71
+ - @shipfox/api-runners@9.0.0
72
+ - @shipfox/api-auth@9.0.0
73
+ - @shipfox/annotations@9.0.0
74
+ - @shipfox/annotations-dto@6.0.0
75
+ - @shipfox/api-auth-dto@7.1.0
76
+ - @shipfox/api-definitions-dto@6.0.0
77
+ - @shipfox/api-dispatcher@7.1.0
78
+ - @shipfox/api-logs@9.0.0
79
+ - @shipfox/api-projects@9.0.0
80
+ - @shipfox/api-projects-dto@8.0.0
81
+ - @shipfox/api-runners-dto@7.0.1
82
+ - @shipfox/api-secrets@9.0.0
83
+ - @shipfox/api-triggers@9.0.0
84
+ - @shipfox/api-workflows-dto@9.0.0
85
+ - @shipfox/config@1.2.2
86
+ - @shipfox/node-error-monitoring@0.2.0
87
+ - @shipfox/node-fastify@0.3.0
88
+ - @shipfox/node-jwt@0.3.0
89
+ - @shipfox/node-module@0.5.0
90
+ - @shipfox/node-opentelemetry@0.6.0
91
+ - @shipfox/node-postgres@0.4.2
92
+
93
+ ## 8.0.0
94
+
95
+ ### Minor Changes
96
+
97
+ - 74243c0: Adds a default-module extension factory with the composed Workspaces inter-module client.
98
+
99
+ ### Patch Changes
100
+
101
+ - b15f3a7: Removes Auth implementation dependencies from consumer test boundaries.
102
+ - Updated dependencies [de559bb]
103
+ - Updated dependencies [b15f3a7]
104
+ - Updated dependencies [7f227c6]
105
+ - @shipfox/api-agent-dto@8.0.0
106
+ - @shipfox/api-agent@8.0.0
107
+ - @shipfox/api-definitions@8.0.0
108
+ - @shipfox/api-logs@8.0.0
109
+ - @shipfox/api-workflows@8.0.0
110
+ - @shipfox/annotations@8.0.0
111
+ - @shipfox/api-runners@8.0.0
112
+ - @shipfox/api-integration-core-dto@8.0.0
113
+ - @shipfox/api-projects-dto@8.0.0
114
+ - @shipfox/api-integration-core@8.0.0
115
+ - @shipfox/api-workflows-dto@8.0.0
116
+ - @shipfox/api-projects@8.0.0
117
+ - @shipfox/api-triggers@8.0.0
118
+ - @shipfox/api-secrets@8.0.0
119
+
3
120
  ## 7.1.0
4
121
 
5
122
  ### Minor Changes
package/README.md CHANGED
@@ -24,6 +24,15 @@ import {defaultModules, runServer} from '@shipfox/api-server';
24
24
  await runServer({modules: await defaultModules()});
25
25
  ```
26
26
 
27
+ To add a module that creates sessions, use the composed Workspaces client rather
28
+ than creating another inter-module transport:
29
+
30
+ ```ts
31
+ const modules = await defaultModules({
32
+ extension: ({workspaces}) => [createCloudModule({workspaces})],
33
+ });
34
+ ```
35
+
27
36
  Load the instrumentation entry before feature modules:
28
37
 
29
38
  ```sh
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { type DefaultModulesOptions, type DefaultRunnersModuleFactory, defaultModules, } from './modules.js';
1
+ export { type DefaultModulesExtension, type DefaultModulesOptions, type DefaultRunnersModuleFactory, defaultModules, } from './modules.js';
2
2
  export { createLoginMethodsRoute } from './routes/login-methods.js';
3
3
  export type { CreateServerOptions, RunServerOptions, ServerHandle } from './server.js';
4
4
  export { createServer, runServer } from './server.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAClE,YAAY,EAAC,mBAAmB,EAAE,gBAAgB,EAAE,YAAY,EAAC,MAAM,aAAa,CAAC;AACrF,OAAO,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAClE,YAAY,EAAC,mBAAmB,EAAE,gBAAgB,EAAE,YAAY,EAAC,MAAM,aAAa,CAAC;AACrF,OAAO,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,aAAa,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n type DefaultModulesOptions,\n type DefaultRunnersModuleFactory,\n defaultModules,\n} from './modules.js';\nexport {createLoginMethodsRoute} from './routes/login-methods.js';\nexport type {CreateServerOptions, RunServerOptions, ServerHandle} from './server.js';\nexport {createServer, runServer} from './server.js';\n"],"names":["defaultModules","createLoginMethodsRoute","createServer","runServer"],"mappings":"AAAA,SAGEA,cAAc,QACT,eAAe;AACtB,SAAQC,uBAAuB,QAAO,4BAA4B;AAElE,SAAQC,YAAY,EAAEC,SAAS,QAAO,cAAc"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n type DefaultModulesExtension,\n type DefaultModulesOptions,\n type DefaultRunnersModuleFactory,\n defaultModules,\n} from './modules.js';\nexport {createLoginMethodsRoute} from './routes/login-methods.js';\nexport type {CreateServerOptions, RunServerOptions, ServerHandle} from './server.js';\nexport {createServer, runServer} from './server.js';\n"],"names":["defaultModules","createLoginMethodsRoute","createServer","runServer"],"mappings":"AAAA,SAIEA,cAAc,QACT,eAAe;AACtB,SAAQC,uBAAuB,QAAO,4BAA4B;AAElE,SAAQC,YAAY,EAAEC,SAAS,QAAO,cAAc"}
package/dist/modules.d.ts CHANGED
@@ -1,12 +1,17 @@
1
1
  import { type AuthInterModuleClient } from '@shipfox/api-auth-dto/inter-module';
2
2
  import { type WebhookDeliverySource } from '@shipfox/api-integration-core';
3
+ import { type WorkspacesInterModuleClient } from '@shipfox/api-workspaces-dto/inter-module';
3
4
  import type { ShipfoxModule } from '@shipfox/node-module';
4
5
  export interface DefaultModulesOptions {
5
6
  webhookDeliverySource?: WebhookDeliverySource | undefined;
6
7
  runnersModule?: DefaultRunnersModuleFactory | undefined;
8
+ extension?: DefaultModulesExtension | undefined;
7
9
  }
8
10
  export type DefaultRunnersModuleFactory = (options: {
9
11
  auth: AuthInterModuleClient;
10
12
  }) => ShipfoxModule;
13
+ export type DefaultModulesExtension = (options: {
14
+ workspaces: WorkspacesInterModuleClient;
15
+ }) => ShipfoxModule[];
11
16
  export declare function defaultModules(options?: DefaultModulesOptions): Promise<ShipfoxModule[]>;
12
17
  //# sourceMappingURL=modules.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,qBAAqB,EAE3B,MAAM,oCAAoC,CAAC;AAK5C,OAAO,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EAAE,CAAC,CAgJ1B"}
package/dist/modules.js CHANGED
@@ -10,10 +10,10 @@ import { definitionsInterModuleContract } from '@shipfox/api-definitions-dto/int
10
10
  import { dispatcherModule } from '@shipfox/api-dispatcher';
11
11
  import { emailChallengesModule } from '@shipfox/api-email-challenges';
12
12
  import { createIntegrationsContext } from '@shipfox/api-integration-core';
13
- import { integrationsInterModuleContract } from '@shipfox/api-integration-core-dto';
13
+ import { integrationsInterModuleContract } from '@shipfox/api-integration-core-dto/inter-module';
14
14
  import { createLogsModule } from '@shipfox/api-logs';
15
15
  import { createProjectsModule } from '@shipfox/api-projects';
16
- import { projectsInterModuleContract } from '@shipfox/api-projects-dto';
16
+ import { projectsInterModuleContract } from '@shipfox/api-projects-dto/inter-module';
17
17
  import { createRunnersModule } from '@shipfox/api-runners';
18
18
  import { runnersInterModuleContract } from '@shipfox/api-runners-dto/inter-module';
19
19
  import { createSecretsModule } from '@shipfox/api-secrets';
@@ -132,8 +132,12 @@ export async function defaultModules(options = {}) {
132
132
  });
133
133
  const definitionsModule = createDefinitionsModule({
134
134
  projects: projectsClient,
135
+ agent: agentClient,
135
136
  integrations: integrationsClient
136
137
  });
138
+ const extensionModules = options.extension?.({
139
+ workspaces: workspacesClient
140
+ }) ?? [];
137
141
  const modules = [
138
142
  emailChallengesModule,
139
143
  createAuthModule({
@@ -168,7 +172,8 @@ export async function defaultModules(options = {}) {
168
172
  createTriggersModule({
169
173
  workflows: workflowsClient
170
174
  }),
171
- dispatcherModule
175
+ dispatcherModule,
176
+ ...extensionModules
172
177
  ];
173
178
  registerInterModulePresentations({
174
179
  transport: interModuleTransport,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/modules.ts"],"sourcesContent":["import {annotationsModule} from '@shipfox/annotations';\nimport {annotationsInterModuleContract} from '@shipfox/annotations-dto/inter-module';\nimport {createAgentModule} from '@shipfox/api-agent';\nimport {agentInterModuleContract} from '@shipfox/api-agent-dto/inter-module';\nimport {createAuthModule} from '@shipfox/api-auth';\nimport {config as authConfig} from '@shipfox/api-auth/config';\nimport {\n type AuthInterModuleClient,\n authInterModuleContract,\n} from '@shipfox/api-auth-dto/inter-module';\nimport {createDefinitionsModule} from '@shipfox/api-definitions';\nimport {definitionsInterModuleContract} from '@shipfox/api-definitions-dto/inter-module';\nimport {dispatcherModule} from '@shipfox/api-dispatcher';\nimport {emailChallengesModule} from '@shipfox/api-email-challenges';\nimport {createIntegrationsContext, type WebhookDeliverySource} from '@shipfox/api-integration-core';\nimport {integrationsInterModuleContract} from '@shipfox/api-integration-core-dto';\nimport {createLogsModule} from '@shipfox/api-logs';\nimport {createProjectsModule} from '@shipfox/api-projects';\nimport {projectsInterModuleContract} from '@shipfox/api-projects-dto';\nimport {createRunnersModule} from '@shipfox/api-runners';\nimport {runnersInterModuleContract} from '@shipfox/api-runners-dto/inter-module';\nimport {createSecretsModule} from '@shipfox/api-secrets';\nimport {secretsInterModuleContract} from '@shipfox/api-secrets-dto/inter-module';\nimport {createTriggersModule} from '@shipfox/api-triggers';\nimport {createWorkflowsModule} from '@shipfox/api-workflows';\nimport {workflowsInterModuleContract} from '@shipfox/api-workflows-dto/inter-module';\nimport {workspacesModule} from '@shipfox/api-workspaces';\nimport {workspacesInterModuleContract} from '@shipfox/api-workspaces-dto/inter-module';\nimport {reportError} from '@shipfox/node-error-monitoring';\nimport {durationToSeconds} from '@shipfox/node-jwt';\nimport type {ShipfoxModule} from '@shipfox/node-module';\nimport {\n createInMemoryInterModuleTransport,\n registerInterModulePresentations,\n} from '@shipfox/node-module/inter-module';\nimport {logger} from '@shipfox/node-opentelemetry';\n\nexport interface DefaultModulesOptions {\n webhookDeliverySource?: WebhookDeliverySource | undefined;\n runnersModule?: DefaultRunnersModuleFactory | undefined;\n}\n\nexport type DefaultRunnersModuleFactory = (options: {auth: AuthInterModuleClient}) => ShipfoxModule;\n\nexport async function defaultModules(\n options: DefaultModulesOptions = {},\n): Promise<ShipfoxModule[]> {\n const interModuleTransport = createInMemoryInterModuleTransport({\n reportInternalError: (error, context) => {\n logger().error(\n {err: error, module: context.module, method: context.method, phase: context.phase},\n 'Inter-module call failed unexpectedly',\n );\n reportError(error, {\n boundary: 'inter-module',\n operation: `${context.module}.${context.method}`,\n tags: {module: context.module, method: context.method, phase: context.phase},\n });\n },\n });\n const workflowsClient = interModuleTransport.createClient(workflowsInterModuleContract);\n const authClient = interModuleTransport.createClient(authInterModuleContract);\n const agentClient = interModuleTransport.createClient(agentInterModuleContract);\n const runnersClient = interModuleTransport.createClient(runnersInterModuleContract);\n const projectsClient = interModuleTransport.createClient(projectsInterModuleContract);\n const definitionsClient = interModuleTransport.createClient(definitionsInterModuleContract);\n const annotationsClient = interModuleTransport.createClient(annotationsInterModuleContract);\n const secretsClient = interModuleTransport.createClient(secretsInterModuleContract);\n const workspacesClient = interModuleTransport.createClient(workspacesInterModuleContract);\n const integrationsClient = interModuleTransport.createClient(integrationsInterModuleContract);\n const integrations = await createIntegrationsContext({\n workspaces: workspacesClient,\n secrets: {\n deleteSecrets: async (params) => (await secretsClient.deleteSecrets(params)).deleted,\n linear: {\n getSecret: async (params) =>\n (\n await secretsClient.getSecret({\n ...params,\n namespace: `system/integrations/linear/${params.namespace}`,\n })\n ).value,\n setSecrets: async (params) => {\n const {editedBy, ...secretParams} = params;\n await secretsClient.setSecrets({\n ...secretParams,\n namespace: `system/integrations/linear/${secretParams.namespace}`,\n ...(editedBy === undefined ? {} : {editedBy}),\n });\n },\n deleteSecrets: async (params) =>\n (\n await secretsClient.deleteSecrets({\n ...params,\n namespace: `system/integrations/linear/${params.namespace}`,\n })\n ).deleted,\n },\n jira: {\n getSecret: async (params) =>\n (\n await secretsClient.getSecret({\n ...params,\n namespace: `system/integrations/jira/${params.namespace}`,\n })\n ).value,\n setSecrets: async (params) => {\n const {editedBy, ...secretParams} = params;\n await secretsClient.setSecrets({\n ...secretParams,\n namespace: `system/integrations/jira/${secretParams.namespace}`,\n ...(editedBy === undefined ? {} : {editedBy}),\n });\n },\n deleteSecrets: async (params) =>\n (\n await secretsClient.deleteSecrets({\n ...params,\n namespace: `system/integrations/jira/${params.namespace}`,\n })\n ).deleted,\n },\n slack: {\n getSecret: async (params) =>\n (\n await secretsClient.getSecret({\n ...params,\n namespace: `system/integrations/slack/${params.namespace}`,\n })\n ).value,\n setSecrets: async (params) => {\n const {editedBy, ...secretParams} = params;\n await secretsClient.setSecrets({\n ...secretParams,\n namespace: `system/integrations/slack/${secretParams.namespace}`,\n ...(editedBy === undefined ? {} : {editedBy}),\n });\n },\n deleteSecrets: async (params) =>\n (\n await secretsClient.deleteSecrets({\n ...params,\n namespace: `system/integrations/slack/${params.namespace}`,\n })\n ).deleted,\n },\n },\n agentTools: {workflows: workflowsClient},\n webhookDeliverySource: options.webhookDeliverySource,\n });\n const projectsModule = createProjectsModule({integrations: integrationsClient});\n const definitionsModule = createDefinitionsModule({\n projects: projectsClient,\n integrations: integrationsClient,\n });\n\n const modules = [\n emailChallengesModule,\n createAuthModule({workspaces: workspacesClient}),\n workspacesModule,\n createSecretsModule(projectsClient),\n createAgentModule({secrets: secretsClient}),\n integrations.module,\n projectsModule,\n definitionsModule,\n createWorkflowsModule({\n annotations: annotationsClient,\n agent: agentClient,\n definitions: definitionsClient,\n auth: authClient,\n projects: projectsClient,\n runners: runnersClient,\n secrets: secretsClient,\n integrations: integrationsClient,\n }),\n annotationsModule,\n (options.runnersModule ?? createRunnersModule)({auth: authClient}),\n createLogsModule({\n workflows: workflowsClient,\n jobLeaseTokenTtlSeconds: durationToSeconds(authConfig.AUTH_JOB_LEASE_TOKEN_EXPIRES_IN),\n }),\n createTriggersModule({workflows: workflowsClient}),\n dispatcherModule,\n ];\n registerInterModulePresentations({transport: interModuleTransport, modules});\n interModuleTransport.seal();\n return modules;\n}\n"],"names":["annotationsModule","annotationsInterModuleContract","createAgentModule","agentInterModuleContract","createAuthModule","config","authConfig","authInterModuleContract","createDefinitionsModule","definitionsInterModuleContract","dispatcherModule","emailChallengesModule","createIntegrationsContext","integrationsInterModuleContract","createLogsModule","createProjectsModule","projectsInterModuleContract","createRunnersModule","runnersInterModuleContract","createSecretsModule","secretsInterModuleContract","createTriggersModule","createWorkflowsModule","workflowsInterModuleContract","workspacesModule","workspacesInterModuleContract","reportError","durationToSeconds","createInMemoryInterModuleTransport","registerInterModulePresentations","logger","defaultModules","options","interModuleTransport","reportInternalError","error","context","err","module","method","phase","boundary","operation","tags","workflowsClient","createClient","authClient","agentClient","runnersClient","projectsClient","definitionsClient","annotationsClient","secretsClient","workspacesClient","integrationsClient","integrations","workspaces","secrets","deleteSecrets","params","deleted","linear","getSecret","namespace","value","setSecrets","editedBy","secretParams","undefined","jira","slack","agentTools","workflows","webhookDeliverySource","projectsModule","definitionsModule","projects","modules","annotations","agent","definitions","auth","runners","runnersModule","jobLeaseTokenTtlSeconds","AUTH_JOB_LEASE_TOKEN_EXPIRES_IN","transport","seal"],"mappings":"AAAA,SAAQA,iBAAiB,QAAO,uBAAuB;AACvD,SAAQC,8BAA8B,QAAO,wCAAwC;AACrF,SAAQC,iBAAiB,QAAO,qBAAqB;AACrD,SAAQC,wBAAwB,QAAO,sCAAsC;AAC7E,SAAQC,gBAAgB,QAAO,oBAAoB;AACnD,SAAQC,UAAUC,UAAU,QAAO,2BAA2B;AAC9D,SAEEC,uBAAuB,QAClB,qCAAqC;AAC5C,SAAQC,uBAAuB,QAAO,2BAA2B;AACjE,SAAQC,8BAA8B,QAAO,4CAA4C;AACzF,SAAQC,gBAAgB,QAAO,0BAA0B;AACzD,SAAQC,qBAAqB,QAAO,gCAAgC;AACpE,SAAQC,yBAAyB,QAAmC,gCAAgC;AACpG,SAAQC,+BAA+B,QAAO,oCAAoC;AAClF,SAAQC,gBAAgB,QAAO,oBAAoB;AACnD,SAAQC,oBAAoB,QAAO,wBAAwB;AAC3D,SAAQC,2BAA2B,QAAO,4BAA4B;AACtE,SAAQC,mBAAmB,QAAO,uBAAuB;AACzD,SAAQC,0BAA0B,QAAO,wCAAwC;AACjF,SAAQC,mBAAmB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QACArD,sBAAsB;YACpBwD,aAAa3B;YACb4B,OAAOhC;YACPiC,aAAa9B;YACb+B,MAAMnC;YACN8B,UAAU3B;YACViC,SAASlC;YACTS,SAASL;YACTG,cAAcD;QAChB;QACAtD;QACCgC,CAAAA,QAAQmD,aAAa,IAAIlE,mBAAkB,EAAG;YAACgE,MAAMnC;QAAU;QAChEhC,iBAAiB;YACf0D,WAAW5B;YACXwC,yBAAyBzD,kBAAkBrB,WAAW+E,+BAA+B;QACvF;QACAhE,qBAAqB;YAACmD,WAAW5B;QAAe;QAChDlC;KACD;IACDmB,iCAAiC;QAACyD,WAAWrD;QAAsB4C;IAAO;IAC1E5C,qBAAqBsD,IAAI;IACzB,OAAOV;AACT"}
1
+ {"version":3,"sources":["../src/modules.ts"],"sourcesContent":["import {annotationsModule} from '@shipfox/annotations';\nimport {annotationsInterModuleContract} from '@shipfox/annotations-dto/inter-module';\nimport {createAgentModule} from '@shipfox/api-agent';\nimport {agentInterModuleContract} from '@shipfox/api-agent-dto/inter-module';\nimport {createAuthModule} from '@shipfox/api-auth';\nimport {config as authConfig} from '@shipfox/api-auth/config';\nimport {\n type AuthInterModuleClient,\n authInterModuleContract,\n} from '@shipfox/api-auth-dto/inter-module';\nimport {createDefinitionsModule} from '@shipfox/api-definitions';\nimport {definitionsInterModuleContract} from '@shipfox/api-definitions-dto/inter-module';\nimport {dispatcherModule} from '@shipfox/api-dispatcher';\nimport {emailChallengesModule} from '@shipfox/api-email-challenges';\nimport {createIntegrationsContext, type WebhookDeliverySource} from '@shipfox/api-integration-core';\nimport {integrationsInterModuleContract} from '@shipfox/api-integration-core-dto/inter-module';\nimport {createLogsModule} from '@shipfox/api-logs';\nimport {createProjectsModule} from '@shipfox/api-projects';\nimport {projectsInterModuleContract} from '@shipfox/api-projects-dto/inter-module';\nimport {createRunnersModule} from '@shipfox/api-runners';\nimport {runnersInterModuleContract} from '@shipfox/api-runners-dto/inter-module';\nimport {createSecretsModule} from '@shipfox/api-secrets';\nimport {secretsInterModuleContract} from '@shipfox/api-secrets-dto/inter-module';\nimport {createTriggersModule} from '@shipfox/api-triggers';\nimport {createWorkflowsModule} from '@shipfox/api-workflows';\nimport {workflowsInterModuleContract} from '@shipfox/api-workflows-dto/inter-module';\nimport {workspacesModule} from '@shipfox/api-workspaces';\nimport {\n type WorkspacesInterModuleClient,\n workspacesInterModuleContract,\n} from '@shipfox/api-workspaces-dto/inter-module';\nimport {reportError} from '@shipfox/node-error-monitoring';\nimport {durationToSeconds} from '@shipfox/node-jwt';\nimport type {ShipfoxModule} from '@shipfox/node-module';\nimport {\n createInMemoryInterModuleTransport,\n registerInterModulePresentations,\n} from '@shipfox/node-module/inter-module';\nimport {logger} from '@shipfox/node-opentelemetry';\n\nexport interface DefaultModulesOptions {\n webhookDeliverySource?: WebhookDeliverySource | undefined;\n runnersModule?: DefaultRunnersModuleFactory | undefined;\n extension?: DefaultModulesExtension | undefined;\n}\n\nexport type DefaultRunnersModuleFactory = (options: {auth: AuthInterModuleClient}) => ShipfoxModule;\nexport type DefaultModulesExtension = (options: {\n workspaces: WorkspacesInterModuleClient;\n}) => ShipfoxModule[];\n\nexport async function defaultModules(\n options: DefaultModulesOptions = {},\n): Promise<ShipfoxModule[]> {\n const interModuleTransport = createInMemoryInterModuleTransport({\n reportInternalError: (error, context) => {\n logger().error(\n {err: error, module: context.module, method: context.method, phase: context.phase},\n 'Inter-module call failed unexpectedly',\n );\n reportError(error, {\n boundary: 'inter-module',\n operation: `${context.module}.${context.method}`,\n tags: {module: context.module, method: context.method, phase: context.phase},\n });\n },\n });\n const workflowsClient = interModuleTransport.createClient(workflowsInterModuleContract);\n const authClient = interModuleTransport.createClient(authInterModuleContract);\n const agentClient = interModuleTransport.createClient(agentInterModuleContract);\n const runnersClient = interModuleTransport.createClient(runnersInterModuleContract);\n const projectsClient = interModuleTransport.createClient(projectsInterModuleContract);\n const definitionsClient = interModuleTransport.createClient(definitionsInterModuleContract);\n const annotationsClient = interModuleTransport.createClient(annotationsInterModuleContract);\n const secretsClient = interModuleTransport.createClient(secretsInterModuleContract);\n const workspacesClient = interModuleTransport.createClient(workspacesInterModuleContract);\n const integrationsClient = interModuleTransport.createClient(integrationsInterModuleContract);\n const integrations = await createIntegrationsContext({\n workspaces: workspacesClient,\n secrets: {\n deleteSecrets: async (params) => (await secretsClient.deleteSecrets(params)).deleted,\n linear: {\n getSecret: async (params) =>\n (\n await secretsClient.getSecret({\n ...params,\n namespace: `system/integrations/linear/${params.namespace}`,\n })\n ).value,\n setSecrets: async (params) => {\n const {editedBy, ...secretParams} = params;\n await secretsClient.setSecrets({\n ...secretParams,\n namespace: `system/integrations/linear/${secretParams.namespace}`,\n ...(editedBy === undefined ? {} : {editedBy}),\n });\n },\n deleteSecrets: async (params) =>\n (\n await secretsClient.deleteSecrets({\n ...params,\n namespace: `system/integrations/linear/${params.namespace}`,\n })\n ).deleted,\n },\n jira: {\n getSecret: async (params) =>\n (\n await secretsClient.getSecret({\n ...params,\n namespace: `system/integrations/jira/${params.namespace}`,\n })\n ).value,\n setSecrets: async (params) => {\n const {editedBy, ...secretParams} = params;\n await secretsClient.setSecrets({\n ...secretParams,\n namespace: `system/integrations/jira/${secretParams.namespace}`,\n ...(editedBy === undefined ? {} : {editedBy}),\n });\n },\n deleteSecrets: async (params) =>\n (\n await secretsClient.deleteSecrets({\n ...params,\n namespace: `system/integrations/jira/${params.namespace}`,\n })\n ).deleted,\n },\n slack: {\n getSecret: async (params) =>\n (\n await secretsClient.getSecret({\n ...params,\n namespace: `system/integrations/slack/${params.namespace}`,\n })\n ).value,\n setSecrets: async (params) => {\n const {editedBy, ...secretParams} = params;\n await secretsClient.setSecrets({\n ...secretParams,\n namespace: `system/integrations/slack/${secretParams.namespace}`,\n ...(editedBy === undefined ? {} : {editedBy}),\n });\n },\n deleteSecrets: async (params) =>\n (\n await secretsClient.deleteSecrets({\n ...params,\n namespace: `system/integrations/slack/${params.namespace}`,\n })\n ).deleted,\n },\n },\n agentTools: {workflows: workflowsClient},\n webhookDeliverySource: options.webhookDeliverySource,\n });\n const projectsModule = createProjectsModule({integrations: integrationsClient});\n const definitionsModule = createDefinitionsModule({\n projects: projectsClient,\n agent: agentClient,\n integrations: integrationsClient,\n });\n const extensionModules = options.extension?.({workspaces: workspacesClient}) ?? [];\n\n const modules = [\n emailChallengesModule,\n createAuthModule({workspaces: workspacesClient}),\n workspacesModule,\n createSecretsModule(projectsClient),\n createAgentModule({secrets: secretsClient}),\n integrations.module,\n projectsModule,\n definitionsModule,\n createWorkflowsModule({\n annotations: annotationsClient,\n agent: agentClient,\n definitions: definitionsClient,\n auth: authClient,\n projects: projectsClient,\n runners: runnersClient,\n secrets: secretsClient,\n integrations: integrationsClient,\n }),\n annotationsModule,\n (options.runnersModule ?? createRunnersModule)({auth: authClient}),\n createLogsModule({\n workflows: workflowsClient,\n jobLeaseTokenTtlSeconds: durationToSeconds(authConfig.AUTH_JOB_LEASE_TOKEN_EXPIRES_IN),\n }),\n createTriggersModule({workflows: workflowsClient}),\n dispatcherModule,\n ...extensionModules,\n ];\n registerInterModulePresentations({transport: interModuleTransport, modules});\n interModuleTransport.seal();\n return modules;\n}\n"],"names":["annotationsModule","annotationsInterModuleContract","createAgentModule","agentInterModuleContract","createAuthModule","config","authConfig","authInterModuleContract","createDefinitionsModule","definitionsInterModuleContract","dispatcherModule","emailChallengesModule","createIntegrationsContext","integrationsInterModuleContract","createLogsModule","createProjectsModule","projectsInterModuleContract","createRunnersModule","runnersInterModuleContract","createSecretsModule","secretsInterModuleContract","createTriggersModule","createWorkflowsModule","workflowsInterModuleContract","workspacesModule","workspacesInterModuleContract","reportError","durationToSeconds","createInMemoryInterModuleTransport","registerInterModulePresentations","logger","defaultModules","options","interModuleTransport","reportInternalError","error","context","err","module","method","phase","boundary","operation","tags","workflowsClient","createClient","authClient","agentClient","runnersClient","projectsClient","definitionsClient","annotationsClient","secretsClient","workspacesClient","integrationsClient","integrations","workspaces","secrets","deleteSecrets","params","deleted","linear","getSecret","namespace","value","setSecrets","editedBy","secretParams","undefined","jira","slack","agentTools","workflows","webhookDeliverySource","projectsModule","definitionsModule","projects","agent","extensionModules","extension","modules","annotations","definitions","auth","runners","runnersModule","jobLeaseTokenTtlSeconds","AUTH_JOB_LEASE_TOKEN_EXPIRES_IN","transport","seal"],"mappings":"AAAA,SAAQA,iBAAiB,QAAO,uBAAuB;AACvD,SAAQC,8BAA8B,QAAO,wCAAwC;AACrF,SAAQC,iBAAiB,QAAO,qBAAqB;AACrD,SAAQC,wBAAwB,QAAO,sCAAsC;AAC7E,SAAQC,gBAAgB,QAAO,oBAAoB;AACnD,SAAQC,UAAUC,UAAU,QAAO,2BAA2B;AAC9D,SAEEC,uBAAuB,QAClB,qCAAqC;AAC5C,SAAQC,uBAAuB,QAAO,2BAA2B;AACjE,SAAQC,8BAA8B,QAAO,4CAA4C;AACzF,SAAQC,gBAAgB,QAAO,0BAA0B;AACzD,SAAQC,qBAAqB,QAAO,gCAAgC;AACpE,SAAQC,yBAAyB,QAAmC,gCAAgC;AACpG,SAAQC,+BAA+B,QAAO,iDAAiD;AAC/F,SAAQC,gBAAgB,QAAO,oBAAoB;AACnD,SAAQC,oBAAoB,QAAO,wBAAwB;AAC3D,SAAQC,2BAA2B,QAAO,yCAAyC;AACnF,SAAQC,mBAAmB,QAAO,uBAAuB;AACzD,SAAQC,0BAA0B,QAAO,wCAAwC;AACjF,SAAQC,mBAAmB,QAAO,uBAAuB;AACzD,SAAQC,0BAA0B,QAAO,wCAAwC;AACjF,SAAQC,oBAAoB,QAAO,wBAAwB;AAC3D,SAAQC,qBAAqB,QAAO,yBAAyB;AAC7D,SAAQC,4BAA4B,QAAO,0CAA0C;AACrF,SAAQC,gBAAgB,QAAO,0BAA0B;AACzD,SAEEC,6BAA6B,QACxB,2CAA2C;AAClD,SAAQC,WAAW,QAAO,iCAAiC;AAC3D,SAAQC,iBAAiB,QAAO,oBAAoB;AAEpD,SACEC,kCAAkC,EAClCC,gCAAgC,QAC3B,oCAAoC;AAC3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