@shipfox/api-projects 5.0.0 → 7.1.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 +11 -14
- package/CHANGELOG.md +42 -0
- package/dist/core/projects.d.ts +2 -2
- package/dist/core/projects.d.ts.map +1 -1
- package/dist/core/projects.js +2 -1
- package/dist/core/projects.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/presentation/inter-module.d.ts +4 -0
- package/dist/presentation/inter-module.d.ts.map +1 -0
- package/dist/presentation/inter-module.js +29 -0
- package/dist/presentation/inter-module.js.map +1 -0
- package/dist/presentation/routes/create-project.d.ts +2 -2
- package/dist/presentation/routes/create-project.d.ts.map +1 -1
- package/dist/presentation/routes/create-project.js +19 -20
- package/dist/presentation/routes/create-project.js.map +1 -1
- package/dist/presentation/routes/index.d.ts +2 -2
- package/dist/presentation/routes/index.d.ts.map +1 -1
- package/dist/presentation/routes/index.js +2 -2
- package/dist/presentation/routes/index.js.map +1 -1
- package/dist/temporal/workflows/index.bundle.js +17164 -3306
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +12 -28
- package/src/core/projects.test.ts +21 -25
- package/src/core/projects.ts +7 -3
- package/src/index.ts +6 -4
- package/src/presentation/inter-module.ts +33 -0
- package/src/presentation/routes/create-project.ts +41 -41
- package/src/presentation/routes/index.ts +3 -3
- package/src/presentation/routes/projects.test.ts +17 -28
- package/src/presentation/subscribers/on-source-commit-pushed.test.ts +2 -1
- package/tsconfig.build.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
$ shipfox-swc && shipfox-temporal-bundle dist/temporal/workflows/index.js
|
|
2
|
-
Successfully compiled:
|
|
3
|
-
2026-07-
|
|
4
|
-
|
|
5
|
-
modules
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
../../../node_modules/.pnpm/long@5.3.2/node_modules/long/index.js 43.2 KiB [built] [code generated]
|
|
10
|
-
../../../node_modules/.pnpm/ms@3.0.0-canary.1/node_modules/ms/dist/index.mjs 3.26 KiB [built] [code generated]
|
|
11
|
-
modules by path ./dist/temporal/workflows/ 1.02 KiB
|
|
12
|
-
./dist/temporal/workflows/index-autogenerated-entrypoint.cjs 527 bytes [built] [code generated]
|
|
2
|
+
Successfully compiled: 36 files with swc (391.85ms)
|
|
3
|
+
2026-07-22T13:11:20.284Z [INFO] asset workflow-bundle-601f98c1048b285735c6.js 3.17 MiB [emitted] [immutable] (name: main)
|
|
4
|
+
orphan modules 33.5 KiB [orphan] 21 modules
|
|
5
|
+
runtime modules 1.13 KiB 5 modules
|
|
6
|
+
modules by path ../../../node_modules/.pnpm/ 970 KiB 196 modules
|
|
7
|
+
modules by path ./dist/temporal/workflows/ 1.41 KiB
|
|
8
|
+
./dist/temporal/workflows/index-autogenerated-entrypoint.cjs 933 bytes [built] [code generated]
|
|
13
9
|
./dist/temporal/workflows/index.js 91 bytes [built] [code generated]
|
|
14
10
|
./dist/temporal/workflows/prune-integration-event-dedup-cron.js 423 bytes [built] [code generated]
|
|
15
11
|
optional modules 30 bytes [optional]
|
|
16
12
|
__temporal_custom_payload_converter (ignored) 15 bytes [optional] [built] [code generated]
|
|
17
13
|
__temporal_custom_failure_converter (ignored) 15 bytes [optional] [built] [code generated]
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
../../shared/node/temporal/dist/workflow-error-interceptor.js 1.21 KiB [built] [code generated]
|
|
15
|
+
webpack 5.107.2 compiled successfully in 8585 ms
|
|
16
|
+
2026-07-22T13:11:20.298Z [INFO] Workflow bundle created { size: '3.17MB' }
|
|
17
|
+
/home/runner/work/shipfox/shipfox/libs/api/projects/dist/temporal/workflows/index.js: 3319553 bytes
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# @shipfox/api-projects
|
|
2
2
|
|
|
3
|
+
## 7.1.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [ac42c96]
|
|
8
|
+
- Updated dependencies [6ce08c0]
|
|
9
|
+
- @shipfox/node-fastify@0.3.0
|
|
10
|
+
- @shipfox/node-module@0.5.0
|
|
11
|
+
- @shipfox/node-temporal@0.4.0
|
|
12
|
+
- @shipfox/node-opentelemetry@0.6.0
|
|
13
|
+
- @shipfox/api-auth-context@7.1.0
|
|
14
|
+
|
|
15
|
+
## 6.0.0
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 0bb82a4: Adds the Agent and Integrations inter-module APIs, moving Workflows agent configuration, runtime credential resolution, and integration consumers behind producer-owned clients.
|
|
20
|
+
- f73da5d: Enforces bounded API context imports and routes inter-module consumers through producer contracts.
|
|
21
|
+
- Updated dependencies [0bb82a4]
|
|
22
|
+
- Updated dependencies [54ce48b]
|
|
23
|
+
- Updated dependencies [f4bc2eb]
|
|
24
|
+
- Updated dependencies [c0162b0]
|
|
25
|
+
- Updated dependencies [7ac43a4]
|
|
26
|
+
- Updated dependencies [f262539]
|
|
27
|
+
- Updated dependencies [a01e917]
|
|
28
|
+
- Updated dependencies [3bb4e26]
|
|
29
|
+
- Updated dependencies [8bdc149]
|
|
30
|
+
- Updated dependencies [3810996]
|
|
31
|
+
- Updated dependencies [b00ed29]
|
|
32
|
+
- Updated dependencies [8aa7cd3]
|
|
33
|
+
- Updated dependencies [81f9544]
|
|
34
|
+
- Updated dependencies [4604a06]
|
|
35
|
+
- @shipfox/api-integration-core-dto@6.0.0
|
|
36
|
+
- @shipfox/node-module@0.4.0
|
|
37
|
+
- @shipfox/node-temporal@0.3.2
|
|
38
|
+
- @shipfox/node-drizzle@0.3.2
|
|
39
|
+
- @shipfox/node-outbox@0.2.4
|
|
40
|
+
- @shipfox/api-auth-context@6.0.0
|
|
41
|
+
- @shipfox/node-fastify@0.2.4
|
|
42
|
+
- @shipfox/inter-module@0.2.0
|
|
43
|
+
- @shipfox/api-projects-dto@6.0.0
|
|
44
|
+
|
|
3
45
|
## 5.0.0
|
|
4
46
|
|
|
5
47
|
### Patch Changes
|
package/dist/core/projects.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IntegrationsModuleClient } from '@shipfox/api-integration-core-dto';
|
|
2
2
|
import type { Project } from './entities/project.js';
|
|
3
3
|
export interface CreateProjectFromSourceParams {
|
|
4
4
|
actorId: string;
|
|
@@ -6,7 +6,7 @@ export interface CreateProjectFromSourceParams {
|
|
|
6
6
|
name: string;
|
|
7
7
|
sourceConnectionId: string;
|
|
8
8
|
sourceExternalRepositoryId: string;
|
|
9
|
-
|
|
9
|
+
integrations: IntegrationsModuleClient;
|
|
10
10
|
}
|
|
11
11
|
export declare function createProjectFromSource(params: CreateProjectFromSourceParams): Promise<Project>;
|
|
12
12
|
//# sourceMappingURL=projects.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/core/projects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/core/projects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,mCAAmC,CAAC;AAYhF,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAGnD,MAAM,WAAW,6BAA6B;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,wBAAwB,CAAC;CACxC;AAED,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,6BAA6B,GACpC,OAAO,CAAC,OAAO,CAAC,CA0ElB"}
|
package/dist/core/projects.js
CHANGED
|
@@ -7,7 +7,8 @@ import { projects, toProject } from '#db/schema/projects.js';
|
|
|
7
7
|
import { recordProjectCreated } from '#metrics/instance.js';
|
|
8
8
|
import { ProjectAlreadyExistsError } from './errors.js';
|
|
9
9
|
export async function createProjectFromSource(params) {
|
|
10
|
-
|
|
10
|
+
let source;
|
|
11
|
+
source = await params.integrations.resolveSourceRepository({
|
|
11
12
|
workspaceId: params.workspaceId,
|
|
12
13
|
connectionId: params.sourceConnectionId,
|
|
13
14
|
externalRepositoryId: params.sourceExternalRepositoryId
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/projects.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../../src/core/projects.ts"],"sourcesContent":["import type {IntegrationsModuleClient} from '@shipfox/api-integration-core-dto';\nimport {\n PROJECT_CREATED,\n PROJECT_SOURCE_BOUND,\n type ProjectsEventMap,\n} from '@shipfox/api-projects-dto';\nimport {writeOutboxEvent} from '@shipfox/node-outbox';\nimport {and, eq} from 'drizzle-orm';\nimport {db} from '#db/db.js';\nimport {projectsOutbox} from '#db/schema/outbox.js';\nimport {projects, toProject} from '#db/schema/projects.js';\nimport {recordProjectCreated} from '#metrics/instance.js';\nimport type {Project} from './entities/project.js';\nimport {ProjectAlreadyExistsError} from './errors.js';\n\nexport interface CreateProjectFromSourceParams {\n actorId: string;\n workspaceId: string;\n name: string;\n sourceConnectionId: string;\n sourceExternalRepositoryId: string;\n integrations: IntegrationsModuleClient;\n}\n\nexport async function createProjectFromSource(\n params: CreateProjectFromSourceParams,\n): Promise<Project> {\n let source: {\n connection: {id: string; provider: string};\n repository: {externalRepositoryId: string};\n };\n source = await params.integrations.resolveSourceRepository({\n workspaceId: params.workspaceId,\n connectionId: params.sourceConnectionId,\n externalRepositoryId: params.sourceExternalRepositoryId,\n });\n\n const project = await db().transaction(async (tx) => {\n const [projectRow] = await tx\n .insert(projects)\n .values({\n workspaceId: params.workspaceId,\n sourceConnectionId: source.connection.id,\n sourceExternalRepositoryId: source.repository.externalRepositoryId,\n name: params.name,\n })\n .onConflictDoNothing({\n target: [projects.sourceConnectionId, projects.sourceExternalRepositoryId],\n })\n .returning();\n\n if (!projectRow) {\n const [existing] = await tx\n .select()\n .from(projects)\n .where(\n and(\n eq(projects.sourceConnectionId, source.connection.id),\n eq(projects.sourceExternalRepositoryId, source.repository.externalRepositoryId),\n ),\n )\n .limit(1);\n if (existing) {\n throw new ProjectAlreadyExistsError(\n existing.id,\n source.connection.id,\n source.repository.externalRepositoryId,\n );\n }\n throw new Error('Project insert returned no rows');\n }\n\n const project = toProject(projectRow);\n\n await writeOutboxEvent<ProjectsEventMap>(tx, projectsOutbox, {\n type: PROJECT_CREATED,\n payload: {\n actorId: params.actorId,\n workspaceId: project.workspaceId,\n projectId: project.id,\n sourceConnectionId: project.sourceConnectionId,\n sourceExternalRepositoryId: project.sourceExternalRepositoryId,\n },\n });\n await writeOutboxEvent<ProjectsEventMap>(tx, projectsOutbox, {\n type: PROJECT_SOURCE_BOUND,\n payload: {\n actorId: params.actorId,\n workspaceId: project.workspaceId,\n projectId: project.id,\n sourceConnectionId: project.sourceConnectionId,\n provider: source.connection.provider,\n externalRepositoryId: project.sourceExternalRepositoryId,\n },\n });\n\n return project;\n });\n recordProjectCreated();\n return project;\n}\n"],"names":["PROJECT_CREATED","PROJECT_SOURCE_BOUND","writeOutboxEvent","and","eq","db","projectsOutbox","projects","toProject","recordProjectCreated","ProjectAlreadyExistsError","createProjectFromSource","params","source","integrations","resolveSourceRepository","workspaceId","connectionId","sourceConnectionId","externalRepositoryId","sourceExternalRepositoryId","project","transaction","tx","projectRow","insert","values","connection","id","repository","name","onConflictDoNothing","target","returning","existing","select","from","where","limit","Error","type","payload","actorId","projectId","provider"],"mappings":"AACA,SACEA,eAAe,EACfC,oBAAoB,QAEf,4BAA4B;AACnC,SAAQC,gBAAgB,QAAO,uBAAuB;AACtD,SAAQC,GAAG,EAAEC,EAAE,QAAO,cAAc;AACpC,SAAQC,EAAE,QAAO,YAAY;AAC7B,SAAQC,cAAc,QAAO,uBAAuB;AACpD,SAAQC,QAAQ,EAAEC,SAAS,QAAO,yBAAyB;AAC3D,SAAQC,oBAAoB,QAAO,uBAAuB;AAE1D,SAAQC,yBAAyB,QAAO,cAAc;AAWtD,OAAO,eAAeC,wBACpBC,MAAqC;IAErC,IAAIC;IAIJA,SAAS,MAAMD,OAAOE,YAAY,CAACC,uBAAuB,CAAC;QACzDC,aAAaJ,OAAOI,WAAW;QAC/BC,cAAcL,OAAOM,kBAAkB;QACvCC,sBAAsBP,OAAOQ,0BAA0B;IACzD;IAEA,MAAMC,UAAU,MAAMhB,KAAKiB,WAAW,CAAC,OAAOC;QAC5C,MAAM,CAACC,WAAW,GAAG,MAAMD,GACxBE,MAAM,CAAClB,UACPmB,MAAM,CAAC;YACNV,aAAaJ,OAAOI,WAAW;YAC/BE,oBAAoBL,OAAOc,UAAU,CAACC,EAAE;YACxCR,4BAA4BP,OAAOgB,UAAU,CAACV,oBAAoB;YAClEW,MAAMlB,OAAOkB,IAAI;QACnB,GACCC,mBAAmB,CAAC;YACnBC,QAAQ;gBAACzB,SAASW,kBAAkB;gBAAEX,SAASa,0BAA0B;aAAC;QAC5E,GACCa,SAAS;QAEZ,IAAI,CAACT,YAAY;YACf,MAAM,CAACU,SAAS,GAAG,MAAMX,GACtBY,MAAM,GACNC,IAAI,CAAC7B,UACL8B,KAAK,CACJlC,IACEC,GAAGG,SAASW,kBAAkB,EAAEL,OAAOc,UAAU,CAACC,EAAE,GACpDxB,GAAGG,SAASa,0BAA0B,EAAEP,OAAOgB,UAAU,CAACV,oBAAoB,IAGjFmB,KAAK,CAAC;YACT,IAAIJ,UAAU;gBACZ,MAAM,IAAIxB,0BACRwB,SAASN,EAAE,EACXf,OAAOc,UAAU,CAACC,EAAE,EACpBf,OAAOgB,UAAU,CAACV,oBAAoB;YAE1C;YACA,MAAM,IAAIoB,MAAM;QAClB;QAEA,MAAMlB,UAAUb,UAAUgB;QAE1B,MAAMtB,iBAAmCqB,IAAIjB,gBAAgB;YAC3DkC,MAAMxC;YACNyC,SAAS;gBACPC,SAAS9B,OAAO8B,OAAO;gBACvB1B,aAAaK,QAAQL,WAAW;gBAChC2B,WAAWtB,QAAQO,EAAE;gBACrBV,oBAAoBG,QAAQH,kBAAkB;gBAC9CE,4BAA4BC,QAAQD,0BAA0B;YAChE;QACF;QACA,MAAMlB,iBAAmCqB,IAAIjB,gBAAgB;YAC3DkC,MAAMvC;YACNwC,SAAS;gBACPC,SAAS9B,OAAO8B,OAAO;gBACvB1B,aAAaK,QAAQL,WAAW;gBAChC2B,WAAWtB,QAAQO,EAAE;gBACrBV,oBAAoBG,QAAQH,kBAAkB;gBAC9C0B,UAAU/B,OAAOc,UAAU,CAACiB,QAAQ;gBACpCzB,sBAAsBE,QAAQD,0BAA0B;YAC1D;QACF;QAEA,OAAOC;IACT;IACAZ;IACA,OAAOY;AACT"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IntegrationsModuleClient } from '@shipfox/api-integration-core-dto';
|
|
2
2
|
import { type ShipfoxModule } from '@shipfox/node-module';
|
|
3
3
|
export type { Project } from '#core/index.js';
|
|
4
4
|
export { createProjectFromSource, ProjectAccessDeniedError, ProjectAlreadyExistsError, ProjectNotFoundError, } from '#core/index.js';
|
|
@@ -6,7 +6,7 @@ export type { GetProjectBySourceParams } from '#db/index.js';
|
|
|
6
6
|
export { createProject, db, getProjectById, getProjectBySource, listProjects, migrationsPath, projectsOutbox, requireProjectForWorkspace, } from '#db/index.js';
|
|
7
7
|
export { createProjectRoutes, requireProjectAccess } from '#presentation/index.js';
|
|
8
8
|
export interface CreateProjectsModuleOptions {
|
|
9
|
-
|
|
9
|
+
integrations: IntegrationsModuleClient;
|
|
10
10
|
}
|
|
11
|
-
export declare function createProjectsModule({
|
|
11
|
+
export declare function createProjectsModule({ integrations }: CreateProjectsModuleOptions): ShipfoxModule;
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,mCAAmC,CAAC;AAMhF,OAAO,EAAC,KAAK,aAAa,EAAoB,MAAM,sBAAsB,CAAC;AAe3E,YAAY,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAC,wBAAwB,EAAC,MAAM,cAAc,CAAC;AAC3D,OAAO,EACL,aAAa,EACb,EAAE,EACF,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,0BAA0B,GAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,mBAAmB,EAAE,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAEjF,MAAM,WAAW,2BAA2B;IAC1C,YAAY,EAAE,wBAAwB,CAAC;CACxC;AAED,wBAAgB,oBAAoB,CAAC,EAAC,YAAY,EAAC,EAAE,2BAA2B,GAAG,aAAa,CAyB/F"}
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { db, migrationsPath, projectsOutbox } from '#db/index.js';
|
|
|
7
7
|
import { registerProjectsServiceMetrics } from '#metrics/index.js';
|
|
8
8
|
import { projectsE2eRoutes } from '#presentation/e2eRoutes/index.js';
|
|
9
9
|
import { createProjectRoutes } from '#presentation/index.js';
|
|
10
|
+
import { createProjectsInterModulePresentation } from '#presentation/inter-module.js';
|
|
10
11
|
import { onSourceCommitPushed } from '#presentation/subscribers/index.js';
|
|
11
12
|
import { createProjectsMaintenanceActivities } from '#temporal/activities/index.js';
|
|
12
13
|
import { PROJECTS_MAINTENANCE_TASK_QUEUE } from '#temporal/constants.js';
|
|
@@ -16,14 +17,14 @@ const subscriber = subscriberFactory();
|
|
|
16
17
|
export { createProjectFromSource, ProjectAccessDeniedError, ProjectAlreadyExistsError, ProjectNotFoundError } from '#core/index.js';
|
|
17
18
|
export { createProject, db, getProjectById, getProjectBySource, listProjects, migrationsPath, projectsOutbox, requireProjectForWorkspace } from '#db/index.js';
|
|
18
19
|
export { createProjectRoutes, requireProjectAccess } from '#presentation/index.js';
|
|
19
|
-
export function createProjectsModule({
|
|
20
|
+
export function createProjectsModule({ integrations }) {
|
|
20
21
|
return {
|
|
21
22
|
name: 'projects',
|
|
22
23
|
database: {
|
|
23
24
|
db,
|
|
24
25
|
migrationsPath
|
|
25
26
|
},
|
|
26
|
-
routes: createProjectRoutes(
|
|
27
|
+
routes: createProjectRoutes(integrations),
|
|
27
28
|
e2eRoutes: [
|
|
28
29
|
projectsE2eRoutes
|
|
29
30
|
],
|
|
@@ -36,6 +37,9 @@ export function createProjectsModule({ sourceControl }) {
|
|
|
36
37
|
eventSchemas: projectsEventSchemas
|
|
37
38
|
}
|
|
38
39
|
],
|
|
40
|
+
interModulePresentations: [
|
|
41
|
+
createProjectsInterModulePresentation()
|
|
42
|
+
],
|
|
39
43
|
subscribers: [
|
|
40
44
|
subscriber(INTEGRATION_SOURCE_COMMIT_PUSHED, onSourceCommitPushed)
|
|
41
45
|
],
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {dirname, resolve} from 'node:path';\nimport {fileURLToPath} from 'node:url';\nimport type {
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {dirname, resolve} from 'node:path';\nimport {fileURLToPath} from 'node:url';\nimport type {IntegrationsModuleClient} from '@shipfox/api-integration-core-dto';\nimport {\n INTEGRATION_SOURCE_COMMIT_PUSHED,\n type IntegrationsEventMap,\n} from '@shipfox/api-integration-core-dto';\nimport {projectsEventSchemas} from '@shipfox/api-projects-dto';\nimport {type ShipfoxModule, subscriberFactory} from '@shipfox/node-module';\nimport {db, migrationsPath, projectsOutbox} from '#db/index.js';\nimport {registerProjectsServiceMetrics} from '#metrics/index.js';\nimport {projectsE2eRoutes} from '#presentation/e2eRoutes/index.js';\nimport {createProjectRoutes} from '#presentation/index.js';\nimport {createProjectsInterModulePresentation} from '#presentation/inter-module.js';\nimport {onSourceCommitPushed} from '#presentation/subscribers/index.js';\nimport {createProjectsMaintenanceActivities} from '#temporal/activities/index.js';\nimport {PROJECTS_MAINTENANCE_TASK_QUEUE} from '#temporal/constants.js';\n\nconst packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');\nconst maintenanceWorkflowsPath = resolve(packageRoot, 'dist/temporal/workflows/index.js');\n\nconst subscriber = subscriberFactory<IntegrationsEventMap>();\n\nexport type {Project} from '#core/index.js';\nexport {\n createProjectFromSource,\n ProjectAccessDeniedError,\n ProjectAlreadyExistsError,\n ProjectNotFoundError,\n} from '#core/index.js';\nexport type {GetProjectBySourceParams} from '#db/index.js';\nexport {\n createProject,\n db,\n getProjectById,\n getProjectBySource,\n listProjects,\n migrationsPath,\n projectsOutbox,\n requireProjectForWorkspace,\n} from '#db/index.js';\nexport {createProjectRoutes, requireProjectAccess} from '#presentation/index.js';\n\nexport interface CreateProjectsModuleOptions {\n integrations: IntegrationsModuleClient;\n}\n\nexport function createProjectsModule({integrations}: CreateProjectsModuleOptions): ShipfoxModule {\n return {\n name: 'projects',\n database: {db, migrationsPath},\n routes: createProjectRoutes(integrations),\n e2eRoutes: [projectsE2eRoutes],\n metrics: registerProjectsServiceMetrics,\n publishers: [{name: 'projects', table: projectsOutbox, db, eventSchemas: projectsEventSchemas}],\n interModulePresentations: [createProjectsInterModulePresentation()],\n subscribers: [subscriber(INTEGRATION_SOURCE_COMMIT_PUSHED, onSourceCommitPushed)],\n workers: [\n {\n taskQueue: PROJECTS_MAINTENANCE_TASK_QUEUE,\n workflowsPath: maintenanceWorkflowsPath,\n activities: createProjectsMaintenanceActivities,\n workflows: [\n {\n name: 'pruneIntegrationEventDedupCron',\n id: 'projects-prune-integration-event-dedup',\n cronSchedule: '0 3 * * *',\n },\n ],\n },\n ],\n };\n}\n"],"names":["dirname","resolve","fileURLToPath","INTEGRATION_SOURCE_COMMIT_PUSHED","projectsEventSchemas","subscriberFactory","db","migrationsPath","projectsOutbox","registerProjectsServiceMetrics","projectsE2eRoutes","createProjectRoutes","createProjectsInterModulePresentation","onSourceCommitPushed","createProjectsMaintenanceActivities","PROJECTS_MAINTENANCE_TASK_QUEUE","packageRoot","url","maintenanceWorkflowsPath","subscriber","createProjectFromSource","ProjectAccessDeniedError","ProjectAlreadyExistsError","ProjectNotFoundError","createProject","getProjectById","getProjectBySource","listProjects","requireProjectForWorkspace","requireProjectAccess","createProjectsModule","integrations","name","database","routes","e2eRoutes","metrics","publishers","table","eventSchemas","interModulePresentations","subscribers","workers","taskQueue","workflowsPath","activities","workflows","id","cronSchedule"],"mappings":"AAAA,SAAQA,OAAO,EAAEC,OAAO,QAAO,YAAY;AAC3C,SAAQC,aAAa,QAAO,WAAW;AAEvC,SACEC,gCAAgC,QAE3B,oCAAoC;AAC3C,SAAQC,oBAAoB,QAAO,4BAA4B;AAC/D,SAA4BC,iBAAiB,QAAO,uBAAuB;AAC3E,SAAQC,EAAE,EAAEC,cAAc,EAAEC,cAAc,QAAO,eAAe;AAChE,SAAQC,8BAA8B,QAAO,oBAAoB;AACjE,SAAQC,iBAAiB,QAAO,mCAAmC;AACnE,SAAQC,mBAAmB,QAAO,yBAAyB;AAC3D,SAAQC,qCAAqC,QAAO,gCAAgC;AACpF,SAAQC,oBAAoB,QAAO,qCAAqC;AACxE,SAAQC,mCAAmC,QAAO,gCAAgC;AAClF,SAAQC,+BAA+B,QAAO,yBAAyB;AAEvE,MAAMC,cAAcf,QAAQD,QAAQE,cAAc,YAAYe,GAAG,IAAI;AACrE,MAAMC,2BAA2BjB,QAAQe,aAAa;AAEtD,MAAMG,aAAad;AAGnB,SACEe,uBAAuB,EACvBC,wBAAwB,EACxBC,yBAAyB,EACzBC,oBAAoB,QACf,iBAAiB;AAExB,SACEC,aAAa,EACblB,EAAE,EACFmB,cAAc,EACdC,kBAAkB,EAClBC,YAAY,EACZpB,cAAc,EACdC,cAAc,EACdoB,0BAA0B,QACrB,eAAe;AACtB,SAAQjB,mBAAmB,EAAEkB,oBAAoB,QAAO,yBAAyB;AAMjF,OAAO,SAASC,qBAAqB,EAACC,YAAY,EAA8B;IAC9E,OAAO;QACLC,MAAM;QACNC,UAAU;YAAC3B;YAAIC;QAAc;QAC7B2B,QAAQvB,oBAAoBoB;QAC5BI,WAAW;YAACzB;SAAkB;QAC9B0B,SAAS3B;QACT4B,YAAY;YAAC;gBAACL,MAAM;gBAAYM,OAAO9B;gBAAgBF;gBAAIiC,cAAcnC;YAAoB;SAAE;QAC/FoC,0BAA0B;YAAC5B;SAAwC;QACnE6B,aAAa;YAACtB,WAAWhB,kCAAkCU;SAAsB;QACjF6B,SAAS;YACP;gBACEC,WAAW5B;gBACX6B,eAAe1B;gBACf2B,YAAY/B;gBACZgC,WAAW;oBACT;wBACEd,MAAM;wBACNe,IAAI;wBACJC,cAAc;oBAChB;iBACD;YACH;SACD;IACH;AACF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { projectsInterModuleContract } from '@shipfox/api-projects-dto';
|
|
2
|
+
import { type InterModulePresentation } from '@shipfox/inter-module';
|
|
3
|
+
export declare function createProjectsInterModulePresentation(): InterModulePresentation<typeof projectsInterModuleContract>;
|
|
4
|
+
//# sourceMappingURL=inter-module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inter-module.d.ts","sourceRoot":"","sources":["../../src/presentation/inter-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,2BAA2B,EAAC,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,uBAAuB,CAAC;AAG/B,wBAAgB,qCAAqC,IAAI,uBAAuB,CAC9E,OAAO,2BAA2B,CACnC,CAsBA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { projectsInterModuleContract } from '@shipfox/api-projects-dto';
|
|
2
|
+
import { createInterModuleKnownError, defineInterModulePresentation } from '@shipfox/inter-module';
|
|
3
|
+
import { getProjectById } from '#db/projects.js';
|
|
4
|
+
export function createProjectsInterModulePresentation() {
|
|
5
|
+
return defineInterModulePresentation(projectsInterModuleContract, {
|
|
6
|
+
getProjectById: async ({ projectId })=>({
|
|
7
|
+
project: await getProjectById(projectId) ?? null
|
|
8
|
+
}),
|
|
9
|
+
requireProjectForWorkspace: async ({ projectId, workspaceId })=>{
|
|
10
|
+
const project = await getProjectById(projectId);
|
|
11
|
+
if (project === undefined) {
|
|
12
|
+
throw createInterModuleKnownError(projectsInterModuleContract.methods.requireProjectForWorkspace, 'project-not-found', {
|
|
13
|
+
projectId
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
if (project.workspaceId !== workspaceId) {
|
|
17
|
+
throw createInterModuleKnownError(projectsInterModuleContract.methods.requireProjectForWorkspace, 'project-workspace-mismatch', {
|
|
18
|
+
projectId,
|
|
19
|
+
workspaceId
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
project
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=inter-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/presentation/inter-module.ts"],"sourcesContent":["import {projectsInterModuleContract} from '@shipfox/api-projects-dto';\nimport {\n createInterModuleKnownError,\n defineInterModulePresentation,\n type InterModulePresentation,\n} from '@shipfox/inter-module';\nimport {getProjectById} from '#db/projects.js';\n\nexport function createProjectsInterModulePresentation(): InterModulePresentation<\n typeof projectsInterModuleContract\n> {\n return defineInterModulePresentation(projectsInterModuleContract, {\n getProjectById: async ({projectId}) => ({project: (await getProjectById(projectId)) ?? null}),\n requireProjectForWorkspace: async ({projectId, workspaceId}) => {\n const project = await getProjectById(projectId);\n if (project === undefined) {\n throw createInterModuleKnownError(\n projectsInterModuleContract.methods.requireProjectForWorkspace,\n 'project-not-found',\n {projectId},\n );\n }\n if (project.workspaceId !== workspaceId) {\n throw createInterModuleKnownError(\n projectsInterModuleContract.methods.requireProjectForWorkspace,\n 'project-workspace-mismatch',\n {projectId, workspaceId},\n );\n }\n return {project};\n },\n });\n}\n"],"names":["projectsInterModuleContract","createInterModuleKnownError","defineInterModulePresentation","getProjectById","createProjectsInterModulePresentation","projectId","project","requireProjectForWorkspace","workspaceId","undefined","methods"],"mappings":"AAAA,SAAQA,2BAA2B,QAAO,4BAA4B;AACtE,SACEC,2BAA2B,EAC3BC,6BAA6B,QAExB,wBAAwB;AAC/B,SAAQC,cAAc,QAAO,kBAAkB;AAE/C,OAAO,SAASC;IAGd,OAAOF,8BAA8BF,6BAA6B;QAChEG,gBAAgB,OAAO,EAACE,SAAS,EAAC,GAAM,CAAA;gBAACC,SAAS,AAAC,MAAMH,eAAeE,cAAe;YAAI,CAAA;QAC3FE,4BAA4B,OAAO,EAACF,SAAS,EAAEG,WAAW,EAAC;YACzD,MAAMF,UAAU,MAAMH,eAAeE;YACrC,IAAIC,YAAYG,WAAW;gBACzB,MAAMR,4BACJD,4BAA4BU,OAAO,CAACH,0BAA0B,EAC9D,qBACA;oBAACF;gBAAS;YAEd;YACA,IAAIC,QAAQE,WAAW,KAAKA,aAAa;gBACvC,MAAMP,4BACJD,4BAA4BU,OAAO,CAACH,0BAA0B,EAC9D,8BACA;oBAACF;oBAAWG;gBAAW;YAE3B;YACA,OAAO;gBAACF;YAAO;QACjB;IACF;AACF"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare function createProjectRoute(
|
|
1
|
+
import { type IntegrationsModuleClient } from '@shipfox/api-integration-core-dto';
|
|
2
|
+
export declare function createProjectRoute(integrations: IntegrationsModuleClient): import("@shipfox/node-fastify").RouteDefinition;
|
|
3
3
|
//# sourceMappingURL=create-project.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-project.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/create-project.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"create-project.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/create-project.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,wBAAwB,EAE9B,MAAM,mCAAmC,CAAC;AAa3C,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,wBAAwB,mDAoFxE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AUTH_USER, requireUserContext, requireWorkspaceAccess } from '@shipfox/api-auth-context';
|
|
2
|
-
import {
|
|
2
|
+
import { integrationsInterModuleContract } from '@shipfox/api-integration-core-dto';
|
|
3
3
|
import { createProjectBodySchema, projectResponseSchema } from '@shipfox/api-projects-dto';
|
|
4
|
+
import { isInterModuleKnownError } from '@shipfox/inter-module';
|
|
4
5
|
import { ClientError, defineRoute } from '@shipfox/node-fastify';
|
|
5
6
|
import { createProjectFromSource, ProjectAlreadyExistsError } from '#core/index.js';
|
|
6
7
|
import { toProjectDto } from '#presentation/dto/index.js';
|
|
@@ -9,10 +10,7 @@ function providerStatus(reason) {
|
|
|
9
10
|
if (reason === 'timeout' || reason === 'provider-unavailable') return 503;
|
|
10
11
|
return 422;
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
-
return error instanceof IntegrationProviderError || error instanceof Error && 'reason' in error && typeof error.reason === 'string' && (error.reason === 'repository-not-found' || error.reason === 'access-denied' || error.reason === 'rate-limited' || error.reason === 'timeout' || error.reason === 'provider-unavailable' || error.reason === 'malformed-provider-response');
|
|
14
|
-
}
|
|
15
|
-
export function createProjectRoute(sourceControl) {
|
|
13
|
+
export function createProjectRoute(integrations) {
|
|
16
14
|
return defineRoute({
|
|
17
15
|
method: 'POST',
|
|
18
16
|
path: '/',
|
|
@@ -25,28 +23,29 @@ export function createProjectRoute(sourceControl) {
|
|
|
25
23
|
}
|
|
26
24
|
},
|
|
27
25
|
errorHandler: (error)=>{
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
const known = isInterModuleKnownError(integrationsInterModuleContract.methods.resolveSourceRepository, error) ? error : undefined;
|
|
27
|
+
if (known?.code === 'connection-not-found') {
|
|
28
|
+
throw new ClientError('Source connection not found', 'source-connection-not-found', {
|
|
30
29
|
status: 404
|
|
31
30
|
});
|
|
32
31
|
}
|
|
33
|
-
if (
|
|
34
|
-
throw new ClientError(
|
|
32
|
+
if (known?.code === 'connection-workspace-mismatch') {
|
|
33
|
+
throw new ClientError('Source connection does not belong to this workspace', 'forbidden', {
|
|
35
34
|
status: 403
|
|
36
35
|
});
|
|
37
36
|
}
|
|
38
|
-
if (
|
|
39
|
-
throw new ClientError(
|
|
37
|
+
if (known?.code === 'connection-inactive') {
|
|
38
|
+
throw new ClientError('Source connection is not active', 'source-connection-inactive', {
|
|
40
39
|
status: 422
|
|
41
40
|
});
|
|
42
41
|
}
|
|
43
|
-
if (
|
|
44
|
-
throw new ClientError(
|
|
42
|
+
if (known?.code === 'provider-unavailable') {
|
|
43
|
+
throw new ClientError('Integration provider is unavailable', 'integration-provider-unavailable', {
|
|
45
44
|
status: 422
|
|
46
45
|
});
|
|
47
46
|
}
|
|
48
|
-
if (
|
|
49
|
-
throw new ClientError(
|
|
47
|
+
if (known?.code === 'capability-unavailable') {
|
|
48
|
+
throw new ClientError('Integration capability is unavailable', 'integration-capability-unavailable', {
|
|
50
49
|
status: 422
|
|
51
50
|
});
|
|
52
51
|
}
|
|
@@ -60,12 +59,12 @@ export function createProjectRoute(sourceControl) {
|
|
|
60
59
|
status: 409
|
|
61
60
|
});
|
|
62
61
|
}
|
|
63
|
-
if (
|
|
64
|
-
throw new ClientError(
|
|
62
|
+
if (known?.code === 'provider-failure') {
|
|
63
|
+
throw new ClientError('Integration provider request failed', known.details.reason, {
|
|
65
64
|
details: {
|
|
66
|
-
retry_after_seconds:
|
|
65
|
+
retry_after_seconds: known.details.retryAfterSeconds
|
|
67
66
|
},
|
|
68
|
-
status: providerStatus(
|
|
67
|
+
status: providerStatus(known.details.reason)
|
|
69
68
|
});
|
|
70
69
|
}
|
|
71
70
|
throw error;
|
|
@@ -83,7 +82,7 @@ export function createProjectRoute(sourceControl) {
|
|
|
83
82
|
name,
|
|
84
83
|
sourceConnectionId: source.connection_id,
|
|
85
84
|
sourceExternalRepositoryId: source.external_repository_id,
|
|
86
|
-
|
|
85
|
+
integrations
|
|
87
86
|
});
|
|
88
87
|
reply.status(201);
|
|
89
88
|
return toProjectDto(project);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/presentation/routes/create-project.ts"],"sourcesContent":["import {AUTH_USER, requireUserContext, requireWorkspaceAccess} from '@shipfox/api-auth-context';\nimport {\n
|
|
1
|
+
{"version":3,"sources":["../../../src/presentation/routes/create-project.ts"],"sourcesContent":["import {AUTH_USER, requireUserContext, requireWorkspaceAccess} from '@shipfox/api-auth-context';\nimport {\n type IntegrationsModuleClient,\n integrationsInterModuleContract,\n} from '@shipfox/api-integration-core-dto';\nimport {createProjectBodySchema, projectResponseSchema} from '@shipfox/api-projects-dto';\nimport {isInterModuleKnownError} from '@shipfox/inter-module';\nimport {ClientError, defineRoute} from '@shipfox/node-fastify';\nimport {createProjectFromSource, ProjectAlreadyExistsError} from '#core/index.js';\nimport {toProjectDto} from '#presentation/dto/index.js';\n\nfunction providerStatus(reason: string): number {\n if (reason === 'rate-limited') return 429;\n if (reason === 'timeout' || reason === 'provider-unavailable') return 503;\n return 422;\n}\n\nexport function createProjectRoute(integrations: IntegrationsModuleClient) {\n return defineRoute({\n method: 'POST',\n path: '/',\n auth: AUTH_USER,\n description: 'Create a project bound to a source repository.',\n schema: {\n body: createProjectBodySchema,\n response: {\n 201: projectResponseSchema,\n },\n },\n errorHandler: (error) => {\n const known = isInterModuleKnownError(\n integrationsInterModuleContract.methods.resolveSourceRepository,\n error,\n )\n ? error\n : undefined;\n if (known?.code === 'connection-not-found') {\n throw new ClientError('Source connection not found', 'source-connection-not-found', {\n status: 404,\n });\n }\n if (known?.code === 'connection-workspace-mismatch') {\n throw new ClientError('Source connection does not belong to this workspace', 'forbidden', {\n status: 403,\n });\n }\n if (known?.code === 'connection-inactive') {\n throw new ClientError('Source connection is not active', 'source-connection-inactive', {\n status: 422,\n });\n }\n if (known?.code === 'provider-unavailable') {\n throw new ClientError(\n 'Integration provider is unavailable',\n 'integration-provider-unavailable',\n {status: 422},\n );\n }\n if (known?.code === 'capability-unavailable') {\n throw new ClientError(\n 'Integration capability is unavailable',\n 'integration-capability-unavailable',\n {status: 422},\n );\n }\n if (error instanceof ProjectAlreadyExistsError) {\n throw new ClientError(error.message, 'project-already-exists', {\n details: {\n existing_project_id: error.existingProjectId,\n source_connection_id: error.sourceConnectionId,\n source_external_repository_id: error.sourceExternalRepositoryId,\n },\n status: 409,\n });\n }\n if (known?.code === 'provider-failure') {\n throw new ClientError('Integration provider request failed', known.details.reason, {\n details: {retry_after_seconds: known.details.retryAfterSeconds},\n status: providerStatus(known.details.reason),\n });\n }\n throw error;\n },\n handler: async (request, reply) => {\n const {workspace_id: workspaceId, name, source} = request.body;\n const actor = requireUserContext(request);\n\n requireWorkspaceAccess({request, workspaceId});\n const project = await createProjectFromSource({\n actorId: actor.userId,\n workspaceId,\n name,\n sourceConnectionId: source.connection_id,\n sourceExternalRepositoryId: source.external_repository_id,\n integrations,\n });\n\n reply.status(201);\n return toProjectDto(project);\n },\n });\n}\n"],"names":["AUTH_USER","requireUserContext","requireWorkspaceAccess","integrationsInterModuleContract","createProjectBodySchema","projectResponseSchema","isInterModuleKnownError","ClientError","defineRoute","createProjectFromSource","ProjectAlreadyExistsError","toProjectDto","providerStatus","reason","createProjectRoute","integrations","method","path","auth","description","schema","body","response","errorHandler","error","known","methods","resolveSourceRepository","undefined","code","status","message","details","existing_project_id","existingProjectId","source_connection_id","sourceConnectionId","source_external_repository_id","sourceExternalRepositoryId","retry_after_seconds","retryAfterSeconds","handler","request","reply","workspace_id","workspaceId","name","source","actor","project","actorId","userId","connection_id","external_repository_id"],"mappings":"AAAA,SAAQA,SAAS,EAAEC,kBAAkB,EAAEC,sBAAsB,QAAO,4BAA4B;AAChG,SAEEC,+BAA+B,QAC1B,oCAAoC;AAC3C,SAAQC,uBAAuB,EAAEC,qBAAqB,QAAO,4BAA4B;AACzF,SAAQC,uBAAuB,QAAO,wBAAwB;AAC9D,SAAQC,WAAW,EAAEC,WAAW,QAAO,wBAAwB;AAC/D,SAAQC,uBAAuB,EAAEC,yBAAyB,QAAO,iBAAiB;AAClF,SAAQC,YAAY,QAAO,6BAA6B;AAExD,SAASC,eAAeC,MAAc;IACpC,IAAIA,WAAW,gBAAgB,OAAO;IACtC,IAAIA,WAAW,aAAaA,WAAW,wBAAwB,OAAO;IACtE,OAAO;AACT;AAEA,OAAO,SAASC,mBAAmBC,YAAsC;IACvE,OAAOP,YAAY;QACjBQ,QAAQ;QACRC,MAAM;QACNC,MAAMlB;QACNmB,aAAa;QACbC,QAAQ;YACNC,MAAMjB;YACNkB,UAAU;gBACR,KAAKjB;YACP;QACF;QACAkB,cAAc,CAACC;YACb,MAAMC,QAAQnB,wBACZH,gCAAgCuB,OAAO,CAACC,uBAAuB,EAC/DH,SAEEA,QACAI;YACJ,IAAIH,OAAOI,SAAS,wBAAwB;gBAC1C,MAAM,IAAItB,YAAY,+BAA+B,+BAA+B;oBAClFuB,QAAQ;gBACV;YACF;YACA,IAAIL,OAAOI,SAAS,iCAAiC;gBACnD,MAAM,IAAItB,YAAY,uDAAuD,aAAa;oBACxFuB,QAAQ;gBACV;YACF;YACA,IAAIL,OAAOI,SAAS,uBAAuB;gBACzC,MAAM,IAAItB,YAAY,mCAAmC,8BAA8B;oBACrFuB,QAAQ;gBACV;YACF;YACA,IAAIL,OAAOI,SAAS,wBAAwB;gBAC1C,MAAM,IAAItB,YACR,uCACA,oCACA;oBAACuB,QAAQ;gBAAG;YAEhB;YACA,IAAIL,OAAOI,SAAS,0BAA0B;gBAC5C,MAAM,IAAItB,YACR,yCACA,sCACA;oBAACuB,QAAQ;gBAAG;YAEhB;YACA,IAAIN,iBAAiBd,2BAA2B;gBAC9C,MAAM,IAAIH,YAAYiB,MAAMO,OAAO,EAAE,0BAA0B;oBAC7DC,SAAS;wBACPC,qBAAqBT,MAAMU,iBAAiB;wBAC5CC,sBAAsBX,MAAMY,kBAAkB;wBAC9CC,+BAA+Bb,MAAMc,0BAA0B;oBACjE;oBACAR,QAAQ;gBACV;YACF;YACA,IAAIL,OAAOI,SAAS,oBAAoB;gBACtC,MAAM,IAAItB,YAAY,uCAAuCkB,MAAMO,OAAO,CAACnB,MAAM,EAAE;oBACjFmB,SAAS;wBAACO,qBAAqBd,MAAMO,OAAO,CAACQ,iBAAiB;oBAAA;oBAC9DV,QAAQlB,eAAea,MAAMO,OAAO,CAACnB,MAAM;gBAC7C;YACF;YACA,MAAMW;QACR;QACAiB,SAAS,OAAOC,SAASC;YACvB,MAAM,EAACC,cAAcC,WAAW,EAAEC,IAAI,EAAEC,MAAM,EAAC,GAAGL,QAAQrB,IAAI;YAC9D,MAAM2B,QAAQ/C,mBAAmByC;YAEjCxC,uBAAuB;gBAACwC;gBAASG;YAAW;YAC5C,MAAMI,UAAU,MAAMxC,wBAAwB;gBAC5CyC,SAASF,MAAMG,MAAM;gBACrBN;gBACAC;gBACAV,oBAAoBW,OAAOK,aAAa;gBACxCd,4BAA4BS,OAAOM,sBAAsB;gBACzDtC;YACF;YAEA4B,MAAMb,MAAM,CAAC;YACb,OAAOnB,aAAasC;QACtB;IACF;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IntegrationsModuleClient } from '@shipfox/api-integration-core-dto';
|
|
2
2
|
import type { RouteGroup } from '@shipfox/node-fastify';
|
|
3
|
-
export declare function createProjectRoutes(
|
|
3
|
+
export declare function createProjectRoutes(integrations: IntegrationsModuleClient): RouteGroup[];
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,mCAAmC,CAAC;AAChF,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAKtD,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,wBAAwB,GAAG,UAAU,EAAE,CAOxF"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createProjectRoute } from './create-project.js';
|
|
2
2
|
import { getProjectRoute } from './get-project.js';
|
|
3
3
|
import { listProjectsRoute } from './list-projects.js';
|
|
4
|
-
export function createProjectRoutes(
|
|
4
|
+
export function createProjectRoutes(integrations) {
|
|
5
5
|
return [
|
|
6
6
|
{
|
|
7
7
|
prefix: '/projects',
|
|
8
8
|
routes: [
|
|
9
|
-
createProjectRoute(
|
|
9
|
+
createProjectRoute(integrations),
|
|
10
10
|
listProjectsRoute,
|
|
11
11
|
getProjectRoute
|
|
12
12
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/presentation/routes/index.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../../../src/presentation/routes/index.ts"],"sourcesContent":["import type {IntegrationsModuleClient} from '@shipfox/api-integration-core-dto';\nimport type {RouteGroup} from '@shipfox/node-fastify';\nimport {createProjectRoute} from './create-project.js';\nimport {getProjectRoute} from './get-project.js';\nimport {listProjectsRoute} from './list-projects.js';\n\nexport function createProjectRoutes(integrations: IntegrationsModuleClient): RouteGroup[] {\n return [\n {\n prefix: '/projects',\n routes: [createProjectRoute(integrations), listProjectsRoute, getProjectRoute],\n },\n ];\n}\n"],"names":["createProjectRoute","getProjectRoute","listProjectsRoute","createProjectRoutes","integrations","prefix","routes"],"mappings":"AAEA,SAAQA,kBAAkB,QAAO,sBAAsB;AACvD,SAAQC,eAAe,QAAO,mBAAmB;AACjD,SAAQC,iBAAiB,QAAO,qBAAqB;AAErD,OAAO,SAASC,oBAAoBC,YAAsC;IACxE,OAAO;QACL;YACEC,QAAQ;YACRC,QAAQ;gBAACN,mBAAmBI;gBAAeF;gBAAmBD;aAAgB;QAChF;KACD;AACH"}
|