@shipfox/api-server 9.3.0 → 10.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.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +54 -0
- package/dist/modules.js +6 -2
- package/dist/modules.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +25 -25
- package/src/modules.test.ts +21 -16
- package/src/modules.ts +2 -2
- package/tsconfig.build.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@shipfox/api-server",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "10.0.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/ShipfoxHQ/shipfox.git",
|
|
@@ -22,35 +22,35 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
+
"@shipfox/annotations": "10.0.0",
|
|
25
26
|
"@shipfox/annotations-dto": "9.0.2",
|
|
26
|
-
"@shipfox/
|
|
27
|
-
"@shipfox/api-agent-dto": "
|
|
28
|
-
"@shipfox/api-
|
|
29
|
-
"@shipfox/api-auth": "
|
|
30
|
-
"@shipfox/api-
|
|
31
|
-
"@shipfox/api-definitions": "
|
|
32
|
-
"@shipfox/api-dispatcher": "
|
|
33
|
-
"@shipfox/api-
|
|
34
|
-
"@shipfox/api-integration-core": "
|
|
27
|
+
"@shipfox/api-agent": "10.0.0",
|
|
28
|
+
"@shipfox/api-agent-dto": "10.0.0",
|
|
29
|
+
"@shipfox/api-auth": "10.0.0",
|
|
30
|
+
"@shipfox/api-auth-dto": "10.0.0",
|
|
31
|
+
"@shipfox/api-definitions": "10.0.0",
|
|
32
|
+
"@shipfox/api-definitions-dto": "10.0.0",
|
|
33
|
+
"@shipfox/api-dispatcher": "10.0.0",
|
|
34
|
+
"@shipfox/api-email-challenges": "1.1.6",
|
|
35
|
+
"@shipfox/api-integration-core": "10.0.0",
|
|
35
36
|
"@shipfox/api-integration-core-dto": "9.0.2",
|
|
36
|
-
"@shipfox/api-
|
|
37
|
-
"@shipfox/api-projects": "
|
|
38
|
-
"@shipfox/api-
|
|
39
|
-
"@shipfox/api-
|
|
40
|
-
"@shipfox/api-runners-dto": "
|
|
41
|
-
"@shipfox/api-secrets": "
|
|
37
|
+
"@shipfox/api-logs": "10.0.0",
|
|
38
|
+
"@shipfox/api-projects": "10.0.0",
|
|
39
|
+
"@shipfox/api-projects-dto": "10.0.0",
|
|
40
|
+
"@shipfox/api-runners": "10.0.0",
|
|
41
|
+
"@shipfox/api-runners-dto": "10.0.0",
|
|
42
|
+
"@shipfox/api-secrets": "10.0.0",
|
|
42
43
|
"@shipfox/api-secrets-dto": "9.0.2",
|
|
43
|
-
"@shipfox/api-
|
|
44
|
-
"@shipfox/api-
|
|
45
|
-
"@shipfox/api-workflows": "
|
|
46
|
-
"@shipfox/api-
|
|
47
|
-
"@shipfox/api-workspaces": "
|
|
48
|
-
"@shipfox/api-workspaces-dto": "9.3.0",
|
|
49
|
-
"@shipfox/node-error-monitoring": "0.3.0",
|
|
44
|
+
"@shipfox/api-triggers": "10.0.0",
|
|
45
|
+
"@shipfox/api-workflows": "10.0.0",
|
|
46
|
+
"@shipfox/api-workflows-dto": "10.0.0",
|
|
47
|
+
"@shipfox/api-workspaces-dto": "10.0.0",
|
|
48
|
+
"@shipfox/api-workspaces": "10.0.0",
|
|
50
49
|
"@shipfox/config": "1.2.4",
|
|
51
|
-
"@shipfox/node-
|
|
50
|
+
"@shipfox/node-error-monitoring": "0.3.0",
|
|
51
|
+
"@shipfox/node-fastify": "0.4.0",
|
|
52
52
|
"@shipfox/node-jwt": "0.3.2",
|
|
53
|
-
"@shipfox/node-module": "1.0.
|
|
53
|
+
"@shipfox/node-module": "1.0.4",
|
|
54
54
|
"@shipfox/node-opentelemetry": "0.6.3",
|
|
55
55
|
"@shipfox/node-postgres": "0.4.4"
|
|
56
56
|
},
|
package/src/modules.test.ts
CHANGED
|
@@ -30,6 +30,7 @@ const mocks = vi.hoisted(() => ({
|
|
|
30
30
|
createSecretsModule: vi.fn(),
|
|
31
31
|
createTriggersModule: vi.fn(),
|
|
32
32
|
createWorkflowsModule: vi.fn(),
|
|
33
|
+
createWorkspacesModule: vi.fn(),
|
|
33
34
|
createWorkspaceConnectionSnapshotLoader: vi.fn(),
|
|
34
35
|
deleteSecrets: vi.fn(),
|
|
35
36
|
getIntegrationConnectionById: vi.fn(),
|
|
@@ -86,22 +87,7 @@ vi.mock('@shipfox/api-workflows', () => ({
|
|
|
86
87
|
createWorkflowsModule: mocks.createWorkflowsModule,
|
|
87
88
|
}));
|
|
88
89
|
vi.mock('@shipfox/api-workspaces', () => ({
|
|
89
|
-
|
|
90
|
-
name: 'workspaces',
|
|
91
|
-
interModulePresentations: [
|
|
92
|
-
{
|
|
93
|
-
contract: workspacesInterModuleContract,
|
|
94
|
-
handlers: {
|
|
95
|
-
listMembershipsForTokenClaims: mocks.listMembershipsForTokenClaims,
|
|
96
|
-
getWorkspaceCreator: mocks.getWorkspaceCreator,
|
|
97
|
-
getWorkspaceOperatingState: mocks.getWorkspaceOperatingState,
|
|
98
|
-
preflightInvitationAcceptance: vi.fn(),
|
|
99
|
-
acceptInvitation: vi.fn(),
|
|
100
|
-
requireActiveMembership: vi.fn(),
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
},
|
|
90
|
+
createWorkspacesModule: mocks.createWorkspacesModule,
|
|
105
91
|
}));
|
|
106
92
|
|
|
107
93
|
describe('defaultModules', () => {
|
|
@@ -118,6 +104,7 @@ describe('defaultModules', () => {
|
|
|
118
104
|
mocks.createSecretsModule.mockReset();
|
|
119
105
|
mocks.createTriggersModule.mockReset();
|
|
120
106
|
mocks.createWorkflowsModule.mockReset();
|
|
107
|
+
mocks.createWorkspacesModule.mockReset();
|
|
121
108
|
mocks.createWorkspaceConnectionSnapshotLoader.mockReset();
|
|
122
109
|
mocks.deleteSecrets.mockReset();
|
|
123
110
|
mocks.getIntegrationConnectionById.mockReset();
|
|
@@ -170,6 +157,7 @@ describe('defaultModules', () => {
|
|
|
170
157
|
interModulePresentations: [
|
|
171
158
|
defineInterModulePresentation(projectsInterModuleContract, {
|
|
172
159
|
getProjectById: () => ({project: null}),
|
|
160
|
+
getWorkspaceProjectCounts: () => ({counts: []}),
|
|
173
161
|
requireProjectForWorkspace: () => ({
|
|
174
162
|
project: {
|
|
175
163
|
id: crypto.randomUUID(),
|
|
@@ -216,6 +204,7 @@ describe('defaultModules', () => {
|
|
|
216
204
|
cancelJobs: vi.fn(),
|
|
217
205
|
enqueueJobExecution: vi.fn(),
|
|
218
206
|
getEffectiveRunnerToolCapabilities: vi.fn(),
|
|
207
|
+
getWorkspaceJobCounts: vi.fn(),
|
|
219
208
|
getLeaseState: vi.fn(),
|
|
220
209
|
releaseJobExecution: vi.fn(),
|
|
221
210
|
},
|
|
@@ -246,6 +235,22 @@ describe('defaultModules', () => {
|
|
|
246
235
|
],
|
|
247
236
|
});
|
|
248
237
|
mocks.createTriggersModule.mockReturnValue({name: 'triggers'});
|
|
238
|
+
mocks.createWorkspacesModule.mockReturnValue({
|
|
239
|
+
name: 'workspaces',
|
|
240
|
+
interModulePresentations: [
|
|
241
|
+
{
|
|
242
|
+
contract: workspacesInterModuleContract,
|
|
243
|
+
handlers: {
|
|
244
|
+
listMembershipsForTokenClaims: mocks.listMembershipsForTokenClaims,
|
|
245
|
+
getWorkspaceCreator: mocks.getWorkspaceCreator,
|
|
246
|
+
getWorkspaceOperatingState: mocks.getWorkspaceOperatingState,
|
|
247
|
+
preflightInvitationAcceptance: vi.fn(),
|
|
248
|
+
acceptInvitation: vi.fn(),
|
|
249
|
+
requireActiveMembership: vi.fn(),
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
],
|
|
253
|
+
});
|
|
249
254
|
});
|
|
250
255
|
|
|
251
256
|
it('returns the API modules in lifecycle order', async () => {
|
package/src/modules.ts
CHANGED
|
@@ -24,7 +24,7 @@ import {secretsInterModuleContract} from '@shipfox/api-secrets-dto/inter-module'
|
|
|
24
24
|
import {createTriggersModule} from '@shipfox/api-triggers';
|
|
25
25
|
import {createWorkflowsModule} from '@shipfox/api-workflows';
|
|
26
26
|
import {workflowsInterModuleContract} from '@shipfox/api-workflows-dto/inter-module';
|
|
27
|
-
import {
|
|
27
|
+
import {createWorkspacesModule} from '@shipfox/api-workspaces';
|
|
28
28
|
import {
|
|
29
29
|
type WorkspacesInterModuleClient,
|
|
30
30
|
workspacesInterModuleContract,
|
|
@@ -170,7 +170,7 @@ export async function defaultModules(
|
|
|
170
170
|
const modules = [
|
|
171
171
|
emailChallengesModule,
|
|
172
172
|
(options.authModule ?? createAuthModule)({workspaces: workspacesClient}),
|
|
173
|
-
|
|
173
|
+
createWorkspacesModule({auth: authClient, projects: projectsClient, runners: runnersClient}),
|
|
174
174
|
createSecretsModule(projectsClient),
|
|
175
175
|
createAgentModule({secrets: secretsClient}),
|
|
176
176
|
integrations.module,
|