@shipfox/api-projects 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.
- package/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +45 -0
- package/dist/core/projects.d.ts +1 -1
- package/dist/core/projects.d.ts.map +1 -1
- package/dist/core/projects.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/presentation/inter-module.d.ts +1 -1
- package/dist/presentation/inter-module.d.ts.map +1 -1
- package/dist/presentation/inter-module.js +1 -1
- package/dist/presentation/inter-module.js.map +1 -1
- package/dist/presentation/routes/create-project.d.ts +1 -1
- package/dist/presentation/routes/create-project.d.ts.map +1 -1
- package/dist/presentation/routes/create-project.js +1 -1
- package/dist/presentation/routes/create-project.js.map +1 -1
- package/dist/presentation/routes/index.d.ts +1 -1
- package/dist/presentation/routes/index.d.ts.map +1 -1
- package/dist/presentation/routes/index.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +15 -16
- package/src/core/projects.test.ts +2 -2
- package/src/core/projects.ts +1 -1
- package/src/index.ts +2 -2
- package/src/presentation/inter-module.ts +1 -1
- package/src/presentation/routes/create-project.ts +1 -1
- package/src/presentation/routes/index.ts +1 -1
- package/src/presentation/routes/projects.test.ts +1 -1
- package/src/presentation/subscribers/on-source-commit-pushed.test.ts +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
$ shipfox-swc && shipfox-temporal-bundle dist/temporal/workflows/index.js
|
|
2
|
-
Successfully compiled: 36 files with swc (
|
|
3
|
-
2026-07-
|
|
2
|
+
Successfully compiled: 36 files with swc (325.52ms)
|
|
3
|
+
2026-07-23T14:12:05.941Z [INFO] asset workflow-bundle-601f98c1048b285735c6.js 3.17 MiB [emitted] [immutable] (name: main)
|
|
4
4
|
orphan modules 33.5 KiB [orphan] 21 modules
|
|
5
5
|
runtime modules 1.13 KiB 5 modules
|
|
6
6
|
modules by path ../../../node_modules/.pnpm/ 970 KiB 196 modules
|
|
@@ -12,6 +12,6 @@ optional modules 30 bytes [optional]
|
|
|
12
12
|
__temporal_custom_payload_converter (ignored) 15 bytes [optional] [built] [code generated]
|
|
13
13
|
__temporal_custom_failure_converter (ignored) 15 bytes [optional] [built] [code generated]
|
|
14
14
|
../../shared/node/temporal/dist/workflow-error-interceptor.js 1.21 KiB [built] [code generated]
|
|
15
|
-
webpack 5.107.2 compiled successfully in
|
|
16
|
-
2026-07-
|
|
15
|
+
webpack 5.107.2 compiled successfully in 6012 ms
|
|
16
|
+
2026-07-23T14:12:05.958Z [INFO] Workflow bundle created { size: '3.17MB' }
|
|
17
17
|
/home/runner/work/shipfox/shipfox/libs/api/projects/dist/temporal/workflows/index.js: 3319553 bytes
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# @shipfox/api-projects
|
|
2
2
|
|
|
3
|
+
## 9.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 475ce59: Republishes all public packages after restoring release authorization.
|
|
8
|
+
- Updated dependencies [475ce59]
|
|
9
|
+
- Updated dependencies [154e03f]
|
|
10
|
+
- @shipfox/api-auth-context@9.0.1
|
|
11
|
+
- @shipfox/api-integration-core-dto@9.0.1
|
|
12
|
+
- @shipfox/api-projects-dto@9.0.1
|
|
13
|
+
- @shipfox/inter-module@0.2.1
|
|
14
|
+
- @shipfox/node-drizzle@0.3.3
|
|
15
|
+
- @shipfox/node-fastify@0.3.1
|
|
16
|
+
- @shipfox/node-module@1.0.0
|
|
17
|
+
- @shipfox/node-opentelemetry@0.6.1
|
|
18
|
+
- @shipfox/node-outbox@0.2.5
|
|
19
|
+
- @shipfox/node-postgres@0.4.3
|
|
20
|
+
- @shipfox/node-temporal@0.4.1
|
|
21
|
+
|
|
22
|
+
## 9.0.0
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [02974d6]
|
|
27
|
+
- Updated dependencies [4a6d124]
|
|
28
|
+
- @shipfox/api-integration-core-dto@9.0.0
|
|
29
|
+
- @shipfox/api-auth-context@9.0.0
|
|
30
|
+
- @shipfox/api-projects-dto@8.0.0
|
|
31
|
+
- @shipfox/inter-module@0.2.0
|
|
32
|
+
- @shipfox/node-drizzle@0.3.2
|
|
33
|
+
- @shipfox/node-fastify@0.3.0
|
|
34
|
+
- @shipfox/node-module@0.5.0
|
|
35
|
+
- @shipfox/node-opentelemetry@0.6.0
|
|
36
|
+
- @shipfox/node-outbox@0.2.4
|
|
37
|
+
- @shipfox/node-postgres@0.4.2
|
|
38
|
+
- @shipfox/node-temporal@0.4.0
|
|
39
|
+
|
|
40
|
+
## 8.0.0
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- Updated dependencies [7f227c6]
|
|
45
|
+
- @shipfox/api-integration-core-dto@8.0.0
|
|
46
|
+
- @shipfox/api-projects-dto@8.0.0
|
|
47
|
+
|
|
3
48
|
## 7.1.0
|
|
4
49
|
|
|
5
50
|
### Patch Changes
|
package/dist/core/projects.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IntegrationsModuleClient } from '@shipfox/api-integration-core-dto';
|
|
1
|
+
import type { IntegrationsModuleClient } from '@shipfox/api-integration-core-dto/inter-module';
|
|
2
2
|
import type { Project } from './entities/project.js';
|
|
3
3
|
export interface CreateProjectFromSourceParams {
|
|
4
4
|
actorId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/core/projects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/core/projects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,gDAAgD,CAAC;AAY7F,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"}
|
|
@@ -1 +1 @@
|
|
|
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"}
|
|
1
|
+
{"version":3,"sources":["../../src/core/projects.ts"],"sourcesContent":["import type {IntegrationsModuleClient} from '@shipfox/api-integration-core-dto/inter-module';\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 { IntegrationsModuleClient } from '@shipfox/api-integration-core-dto';
|
|
1
|
+
import type { IntegrationsModuleClient } from '@shipfox/api-integration-core-dto/inter-module';
|
|
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';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,gDAAgD,CAAC;AAE7F,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
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 {\n INTEGRATION_SOURCE_COMMIT_PUSHED,\n type IntegrationsEventMap,\n} from '@shipfox/api-integration-core-dto';\nimport type {IntegrationsModuleClient} from '@shipfox/api-integration-core-dto/inter-module';\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, databaseNamespace: 'projects'},\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","databaseNamespace","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;AACvC,SACEC,gCAAgC,QAE3B,oCAAoC;AAE3C,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;YAAgB2B,mBAAmB;QAAU;QAC5DC,QAAQxB,oBAAoBoB;QAC5BK,WAAW;YAAC1B;SAAkB;QAC9B2B,SAAS5B;QACT6B,YAAY;YAAC;gBAACN,MAAM;gBAAYO,OAAO/B;gBAAgBF;gBAAIkC,cAAcpC;YAAoB;SAAE;QAC/FqC,0BAA0B;YAAC7B;SAAwC;QACnE8B,aAAa;YAACvB,WAAWhB,kCAAkCU;SAAsB;QACjF8B,SAAS;YACP;gBACEC,WAAW7B;gBACX8B,eAAe3B;gBACf4B,YAAYhC;gBACZiC,WAAW;oBACT;wBACEf,MAAM;wBACNgB,IAAI;wBACJC,cAAc;oBAChB;iBACD;YACH;SACD;IACH;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { projectsInterModuleContract } from '@shipfox/api-projects-dto';
|
|
1
|
+
import { projectsInterModuleContract } from '@shipfox/api-projects-dto/inter-module';
|
|
2
2
|
import { type InterModulePresentation } from '@shipfox/inter-module';
|
|
3
3
|
export declare function createProjectsInterModulePresentation(): InterModulePresentation<typeof projectsInterModuleContract>;
|
|
4
4
|
//# sourceMappingURL=inter-module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inter-module.d.ts","sourceRoot":"","sources":["../../src/presentation/inter-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,2BAA2B,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"inter-module.d.ts","sourceRoot":"","sources":["../../src/presentation/inter-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,2BAA2B,EAAC,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,uBAAuB,CAAC;AAG/B,wBAAgB,qCAAqC,IAAI,uBAAuB,CAC9E,OAAO,2BAA2B,CACnC,CAsBA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { projectsInterModuleContract } from '@shipfox/api-projects-dto';
|
|
1
|
+
import { projectsInterModuleContract } from '@shipfox/api-projects-dto/inter-module';
|
|
2
2
|
import { createInterModuleKnownError, defineInterModulePresentation } from '@shipfox/inter-module';
|
|
3
3
|
import { getProjectById } from '#db/projects.js';
|
|
4
4
|
export function createProjectsInterModulePresentation() {
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"sources":["../../src/presentation/inter-module.ts"],"sourcesContent":["import {projectsInterModuleContract} from '@shipfox/api-projects-dto/inter-module';\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,yCAAyC;AACnF,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 IntegrationsModuleClient } from '@shipfox/api-integration-core-dto';
|
|
1
|
+
import { type IntegrationsModuleClient } from '@shipfox/api-integration-core-dto/inter-module';
|
|
2
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,EACL,KAAK,wBAAwB,EAE9B,MAAM,
|
|
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,gDAAgD,CAAC;AAaxD,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,wBAAwB,mDAoFxE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AUTH_USER, requireUserContext, requireWorkspaceAccess } from '@shipfox/api-auth-context';
|
|
2
|
-
import { integrationsInterModuleContract } from '@shipfox/api-integration-core-dto';
|
|
2
|
+
import { integrationsInterModuleContract } from '@shipfox/api-integration-core-dto/inter-module';
|
|
3
3
|
import { createProjectBodySchema, projectResponseSchema } from '@shipfox/api-projects-dto';
|
|
4
4
|
import { isInterModuleKnownError } from '@shipfox/inter-module';
|
|
5
5
|
import { ClientError, defineRoute } from '@shipfox/node-fastify';
|
|
@@ -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 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,
|
|
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/inter-module';\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,iDAAiD;AACxD,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 { IntegrationsModuleClient } from '@shipfox/api-integration-core-dto';
|
|
1
|
+
import type { IntegrationsModuleClient } from '@shipfox/api-integration-core-dto/inter-module';
|
|
2
2
|
import type { RouteGroup } from '@shipfox/node-fastify';
|
|
3
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,wBAAwB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAKtD,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,wBAAwB,GAAG,UAAU,EAAE,CAOxF"}
|
|
@@ -1 +1 @@
|
|
|
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"}
|
|
1
|
+
{"version":3,"sources":["../../../src/presentation/routes/index.ts"],"sourcesContent":["import type {IntegrationsModuleClient} from '@shipfox/api-integration-core-dto/inter-module';\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"}
|