@shipfox/api-triggers 6.0.0 → 7.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 +12 -0
- package/dist/db/job-listener-subscriptions.d.ts +1 -0
- package/dist/db/job-listener-subscriptions.d.ts.map +1 -1
- package/dist/db/job-listener-subscriptions.js +6 -0
- package/dist/db/job-listener-subscriptions.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/presentation/e2e-routes.d.ts +3 -0
- package/dist/presentation/e2e-routes.d.ts.map +1 -0
- package/dist/presentation/e2e-routes.js +31 -0
- package/dist/presentation/e2e-routes.js.map +1 -0
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/db/job-listener-subscriptions.ts +9 -0
- package/src/index.ts +2 -0
- package/src/presentation/e2e-routes.test.ts +44 -0
- package/src/presentation/e2e-routes.ts +24 -0
- 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:
|
|
3
|
-
2026-07-
|
|
2
|
+
Successfully compiled: 58 files with swc (578.62ms)
|
|
3
|
+
2026-07-22T08:00:04.460Z [INFO] asset workflow-bundle-c6357fb5676e5edf087a.js 1.45 MiB [emitted] [immutable] (name: main)
|
|
4
4
|
runtime modules 670 bytes 3 modules
|
|
5
5
|
modules by path ../../../node_modules/.pnpm/ 424 KiB
|
|
6
6
|
modules by path ../../../node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporal...(truncated) 155 KiB 34 modules
|
|
@@ -16,6 +16,6 @@ modules by path ./dist/temporal/workflows/ 3.72 KiB
|
|
|
16
16
|
optional modules 30 bytes [optional]
|
|
17
17
|
__temporal_custom_payload_converter (ignored) 15 bytes [optional] [built] [code generated]
|
|
18
18
|
__temporal_custom_failure_converter (ignored) 15 bytes [optional] [built] [code generated]
|
|
19
|
-
webpack 5.107.2 compiled successfully in
|
|
20
|
-
2026-07-
|
|
19
|
+
webpack 5.107.2 compiled successfully in 3677 ms
|
|
20
|
+
2026-07-22T08:00:04.477Z [INFO] Workflow bundle created { size: '1.45MB' }
|
|
21
21
|
/home/runner/work/shipfox/shipfox/libs/api/triggers/dist/temporal/workflows/index.js: 1524360 bytes
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @shipfox/api-triggers
|
|
2
2
|
|
|
3
|
+
## 7.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ffc7fc9: Republishes the affected release set after recovering package publication.
|
|
8
|
+
|
|
9
|
+
## 7.0.0
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 10d60f6: Adds deterministic E2E listener-subscription readiness checks for workflow batching tests.
|
|
14
|
+
|
|
3
15
|
## 6.0.0
|
|
4
16
|
|
|
5
17
|
### Major Changes
|
|
@@ -21,4 +21,5 @@ export interface FindMatchingJobListenerSubscriptionsParams {
|
|
|
21
21
|
event: string;
|
|
22
22
|
}
|
|
23
23
|
export declare function findMatchingJobListenerSubscriptions(params: FindMatchingJobListenerSubscriptionsParams): Promise<JobListenerSubscription[]>;
|
|
24
|
+
export declare function hasJobListenerSubscriptions(jobId: string): Promise<boolean>;
|
|
24
25
|
//# sourceMappingURL=job-listener-subscriptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job-listener-subscriptions.d.ts","sourceRoot":"","sources":["../../src/db/job-listener-subscriptions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,uBAAuB,EACxB,MAAM,6CAA6C,CAAC;AASrD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;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IACvD,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,eAAe,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;CACjE;AAED,MAAM,WAAW,qCAAqC;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,SAAS,eAAe,EAAE,GAAG,IAAI,CAAC;IACtC,KAAK,EAAE,SAAS,eAAe,EAAE,GAAG,IAAI,CAAC;CAC1C;AAED,wBAAsB,+BAA+B,CACnD,MAAM,EAAE,qCAAqC,GAC5C,OAAO,CAAC,IAAI,CAAC,CA4Cf;AA6BD,wBAAsB,oCAAoC,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAMzF;AAED,MAAM,WAAW,0CAA0C;IACzD,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,oCAAoC,CACxD,MAAM,EAAE,0CAA0C,GACjD,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAYpC;AAED,wBAAsB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOjF"}
|
|
@@ -65,5 +65,11 @@ export async function findMatchingJobListenerSubscriptions(params) {
|
|
|
65
65
|
const rows = await db().select().from(jobListenerSubscriptions).where(and(eq(jobListenerSubscriptions.workspaceId, params.workspaceId), eq(jobListenerSubscriptions.source, params.source), eq(jobListenerSubscriptions.event, params.event)));
|
|
66
66
|
return rows.map(toJobListenerSubscription);
|
|
67
67
|
}
|
|
68
|
+
export async function hasJobListenerSubscriptions(jobId) {
|
|
69
|
+
const [subscription] = await db().select({
|
|
70
|
+
id: jobListenerSubscriptions.id
|
|
71
|
+
}).from(jobListenerSubscriptions).where(eq(jobListenerSubscriptions.jobId, jobId)).limit(1);
|
|
72
|
+
return subscription !== undefined;
|
|
73
|
+
}
|
|
68
74
|
|
|
69
75
|
//# sourceMappingURL=job-listener-subscriptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/db/job-listener-subscriptions.ts"],"sourcesContent":["import {and, eq, notInArray} from 'drizzle-orm';\nimport type {\n JobListenerMatcherKind,\n JobListenerSubscription,\n} from '#core/entities/job-listener-subscription.js';\nimport {db} from './db.js';\nimport {\n jobListenerSubscriptions,\n toJobListenerSubscription,\n} from './schema/job-listener-subscriptions.js';\n\ntype Tx = Parameters<Parameters<ReturnType<typeof db>['transaction']>[0]>[0];\n\nexport interface ListenerMatcher {\n source: string;\n event: string;\n inputs?: Readonly<Record<string, unknown>> | undefined;\n filter?: string | undefined;\n filter_snapshot?: Readonly<Record<string, unknown>> | undefined;\n}\n\nexport interface ProjectJobListenerSubscriptionsParams {\n workspaceId: string;\n workflowRunId: string;\n jobId: string;\n on: readonly ListenerMatcher[] | null;\n until: readonly ListenerMatcher[] | null;\n}\n\nexport async function projectJobListenerSubscriptions(\n params: ProjectJobListenerSubscriptionsParams,\n): Promise<void> {\n await db().transaction(async (tx) => {\n await pruneStaleMatchers(tx, params.jobId, 'on', params.on ?? []);\n await pruneStaleMatchers(tx, params.jobId, 'until', params.until ?? []);\n\n for (const [kind, matchers] of [\n ['on', params.on ?? []],\n ['until', params.until ?? []],\n ] as const) {\n for (const [matcherOrdinal, matcher] of matchers.entries()) {\n const config: Record<string, unknown> = {};\n if (matcher.inputs !== undefined) config.inputs = matcher.inputs;\n if (matcher.filter !== undefined) config.filter = matcher.filter;\n if (matcher.filter_snapshot !== undefined) config.filter_snapshot = matcher.filter_snapshot;\n\n await tx\n .insert(jobListenerSubscriptions)\n .values({\n workspaceId: params.workspaceId,\n workflowRunId: params.workflowRunId,\n jobId: params.jobId,\n kind,\n matcherOrdinal,\n source: matcher.source,\n event: matcher.event,\n config,\n })\n .onConflictDoUpdate({\n target: [\n jobListenerSubscriptions.jobId,\n jobListenerSubscriptions.kind,\n jobListenerSubscriptions.matcherOrdinal,\n ],\n set: {\n workspaceId: params.workspaceId,\n workflowRunId: params.workflowRunId,\n source: matcher.source,\n event: matcher.event,\n config,\n },\n });\n }\n }\n });\n}\n\nasync function pruneStaleMatchers(\n tx: Tx,\n jobId: string,\n kind: JobListenerMatcherKind,\n matchers: readonly ListenerMatcher[],\n): Promise<void> {\n const base = and(\n eq(jobListenerSubscriptions.jobId, jobId),\n eq(jobListenerSubscriptions.kind, kind),\n );\n\n if (matchers.length === 0) {\n await tx.delete(jobListenerSubscriptions).where(base);\n return;\n }\n\n await tx.delete(jobListenerSubscriptions).where(\n and(\n base,\n notInArray(\n jobListenerSubscriptions.matcherOrdinal,\n matchers.map((_matcher, index) => index),\n ),\n ),\n );\n}\n\nexport async function removeJobListenerSubscriptionsForJob(jobId: string): Promise<number> {\n const rows = await db()\n .delete(jobListenerSubscriptions)\n .where(eq(jobListenerSubscriptions.jobId, jobId))\n .returning({id: jobListenerSubscriptions.id});\n return rows.length;\n}\n\nexport interface FindMatchingJobListenerSubscriptionsParams {\n workspaceId: string;\n source: string;\n event: string;\n}\n\nexport async function findMatchingJobListenerSubscriptions(\n params: FindMatchingJobListenerSubscriptionsParams,\n): Promise<JobListenerSubscription[]> {\n const rows = await db()\n .select()\n .from(jobListenerSubscriptions)\n .where(\n and(\n eq(jobListenerSubscriptions.workspaceId, params.workspaceId),\n eq(jobListenerSubscriptions.source, params.source),\n eq(jobListenerSubscriptions.event, params.event),\n ),\n );\n return rows.map(toJobListenerSubscription);\n}\n"],"names":["and","eq","notInArray","db","jobListenerSubscriptions","toJobListenerSubscription","projectJobListenerSubscriptions","params","transaction","tx","pruneStaleMatchers","jobId","on","until","kind","matchers","matcherOrdinal","matcher","entries","config","inputs","undefined","filter","filter_snapshot","insert","values","workspaceId","workflowRunId","source","event","onConflictDoUpdate","target","set","base","length","delete","where","map","_matcher","index","removeJob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3,"sources":["../../src/db/job-listener-subscriptions.ts"],"sourcesContent":["import {and, eq, notInArray} from 'drizzle-orm';\nimport type {\n JobListenerMatcherKind,\n JobListenerSubscription,\n} from '#core/entities/job-listener-subscription.js';\nimport {db} from './db.js';\nimport {\n jobListenerSubscriptions,\n toJobListenerSubscription,\n} from './schema/job-listener-subscriptions.js';\n\ntype Tx = Parameters<Parameters<ReturnType<typeof db>['transaction']>[0]>[0];\n\nexport interface ListenerMatcher {\n source: string;\n event: string;\n inputs?: Readonly<Record<string, unknown>> | undefined;\n filter?: string | undefined;\n filter_snapshot?: Readonly<Record<string, unknown>> | undefined;\n}\n\nexport interface ProjectJobListenerSubscriptionsParams {\n workspaceId: string;\n workflowRunId: string;\n jobId: string;\n on: readonly ListenerMatcher[] | null;\n until: readonly ListenerMatcher[] | null;\n}\n\nexport async function projectJobListenerSubscriptions(\n params: ProjectJobListenerSubscriptionsParams,\n): Promise<void> {\n await db().transaction(async (tx) => {\n await pruneStaleMatchers(tx, params.jobId, 'on', params.on ?? []);\n await pruneStaleMatchers(tx, params.jobId, 'until', params.until ?? []);\n\n for (const [kind, matchers] of [\n ['on', params.on ?? []],\n ['until', params.until ?? []],\n ] as const) {\n for (const [matcherOrdinal, matcher] of matchers.entries()) {\n const config: Record<string, unknown> = {};\n if (matcher.inputs !== undefined) config.inputs = matcher.inputs;\n if (matcher.filter !== undefined) config.filter = matcher.filter;\n if (matcher.filter_snapshot !== undefined) config.filter_snapshot = matcher.filter_snapshot;\n\n await tx\n .insert(jobListenerSubscriptions)\n .values({\n workspaceId: params.workspaceId,\n workflowRunId: params.workflowRunId,\n jobId: params.jobId,\n kind,\n matcherOrdinal,\n source: matcher.source,\n event: matcher.event,\n config,\n })\n .onConflictDoUpdate({\n target: [\n jobListenerSubscriptions.jobId,\n jobListenerSubscriptions.kind,\n jobListenerSubscriptions.matcherOrdinal,\n ],\n set: {\n workspaceId: params.workspaceId,\n workflowRunId: params.workflowRunId,\n source: matcher.source,\n event: matcher.event,\n config,\n },\n });\n }\n }\n });\n}\n\nasync function pruneStaleMatchers(\n tx: Tx,\n jobId: string,\n kind: JobListenerMatcherKind,\n matchers: readonly ListenerMatcher[],\n): Promise<void> {\n const base = and(\n eq(jobListenerSubscriptions.jobId, jobId),\n eq(jobListenerSubscriptions.kind, kind),\n );\n\n if (matchers.length === 0) {\n await tx.delete(jobListenerSubscriptions).where(base);\n return;\n }\n\n await tx.delete(jobListenerSubscriptions).where(\n and(\n base,\n notInArray(\n jobListenerSubscriptions.matcherOrdinal,\n matchers.map((_matcher, index) => index),\n ),\n ),\n );\n}\n\nexport async function removeJobListenerSubscriptionsForJob(jobId: string): Promise<number> {\n const rows = await db()\n .delete(jobListenerSubscriptions)\n .where(eq(jobListenerSubscriptions.jobId, jobId))\n .returning({id: jobListenerSubscriptions.id});\n return rows.length;\n}\n\nexport interface FindMatchingJobListenerSubscriptionsParams {\n workspaceId: string;\n source: string;\n event: string;\n}\n\nexport async function findMatchingJobListenerSubscriptions(\n params: FindMatchingJobListenerSubscriptionsParams,\n): Promise<JobListenerSubscription[]> {\n const rows = await db()\n .select()\n .from(jobListenerSubscriptions)\n .where(\n and(\n eq(jobListenerSubscriptions.workspaceId, params.workspaceId),\n eq(jobListenerSubscriptions.source, params.source),\n eq(jobListenerSubscriptions.event, params.event),\n ),\n );\n return rows.map(toJobListenerSubscription);\n}\n\nexport async function hasJobListenerSubscriptions(jobId: string): Promise<boolean> {\n const [subscription] = await db()\n .select({id: jobListenerSubscriptions.id})\n .from(jobListenerSubscriptions)\n .where(eq(jobListenerSubscriptions.jobId, jobId))\n .limit(1);\n return subscription !== undefined;\n}\n"],"names":["and","eq","notInArray","db","jobListenerSubscriptions","toJobListenerSubscription","projectJobListenerSubscriptions","params","transaction","tx","pruneStaleMatchers","jobId","on","until","kind","matchers","matcherOrdinal","matcher","entries","config","inputs","undefined","filter","filter_snapshot","insert","values","workspaceId","workflowRunId","source","event","onConflictDoUpdate","target","set","base","length","delete","where","map","_matcher","index","removeJobListenerSubscriptionsForJob","rows","returning","id","findMatchingJobListenerSubscriptions","select","from","hasJobListenerSubscriptions","subscription","limit"],"mappings":"AAAA,SAAQA,GAAG,EAAEC,EAAE,EAAEC,UAAU,QAAO,cAAc;AAKhD,SAAQC,EAAE,QAAO,UAAU;AAC3B,SACEC,wBAAwB,EACxBC,yBAAyB,QACpB,yCAAyC;AAoBhD,OAAO,eAAeC,gCACpBC,MAA6C;IAE7C,MAAMJ,KAAKK,WAAW,CAAC,OAAOC;QAC5B,MAAMC,mBAAmBD,IAAIF,OAAOI,KAAK,EAAE,MAAMJ,OAAOK,EAAE,IAAI,EAAE;QAChE,MAAMF,mBAAmBD,IAAIF,OAAOI,KAAK,EAAE,SAASJ,OAAOM,KAAK,IAAI,EAAE;QAEtE,KAAK,MAAM,CAACC,MAAMC,SAAS,IAAI;YAC7B;gBAAC;gBAAMR,OAAOK,EAAE,IAAI,EAAE;aAAC;YACvB;gBAAC;gBAASL,OAAOM,KAAK,IAAI,EAAE;aAAC;SAC9B,CAAW;YACV,KAAK,MAAM,CAACG,gBAAgBC,QAAQ,IAAIF,SAASG,OAAO,GAAI;gBAC1D,MAAMC,SAAkC,CAAC;gBACzC,IAAIF,QAAQG,MAAM,KAAKC,WAAWF,OAAOC,MAAM,GAAGH,QAAQG,MAAM;gBAChE,IAAIH,QAAQK,MAAM,KAAKD,WAAWF,OAAOG,MAAM,GAAGL,QAAQK,MAAM;gBAChE,IAAIL,QAAQM,eAAe,KAAKF,WAAWF,OAAOI,eAAe,GAAGN,QAAQM,eAAe;gBAE3F,MAAMd,GACHe,MAAM,CAACpB,0BACPqB,MAAM,CAAC;oBACNC,aAAanB,OAAOmB,WAAW;oBAC/BC,eAAepB,OAAOoB,aAAa;oBACnChB,OAAOJ,OAAOI,KAAK;oBACnBG;oBACAE;oBACAY,QAAQX,QAAQW,MAAM;oBACtBC,OAAOZ,QAAQY,KAAK;oBACpBV;gBACF,GACCW,kBAAkB,CAAC;oBAClBC,QAAQ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AAChC;AAClB;AAEA,OAAO,eAAe0C,4BAA4BpC,KAAa;IAC7D,MAAM,CAACqC,aAAa,GAAG,MAAM7C,KAC1B0C,MAAM,CAAC;QAACF,IAAIvC,yBAAyBuC,EAAE;IAAA,GACvCG,IAAI,CAAC1C,0BACLgC,KAAK,CAACnC,GAAGG,yBAAyBO,KAAK,EAAEA,QACzCsC,KAAK,CAAC;IACT,OAAOD,iBAAiB3B;AAC1B"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAC,KAAK,aAAa,EAAoB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAC,KAAK,aAAa,EAAoB,MAAM,sBAAsB,CAAC;AAkB3E,YAAY,EACV,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,6CAA6C,CAAC;AACrD,YAAY,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AACxE,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,0BAA0B,EAC1B,+BAA+B,EAC/B,gCAAgC,EAChC,iCAAiC,EACjC,6BAA6B,GAC9B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,EAAE,EACF,oCAAoC,EACpC,yBAAyB,EACzB,mCAAmC,EACnC,0BAA0B,EAC1B,wBAAwB,EACxB,wCAAwC,EACxC,cAAc,EACd,+BAA+B,EAC/B,oCAAoC,EACpC,cAAc,GACf,MAAM,cAAc,CAAC;AAStB,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,qBAAqB,CAAC;CAClC;AAED,wBAAgB,oBAAoB,CAAC,EAAC,SAAS,EAAC,EAAE,2BAA2B,GAAG,aAAa,CA0C5F"}
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { WORKFLOWS_JOB_ACTIVATED, WORKFLOWS_JOB_TERMINATED } from '@shipfox/api-
|
|
|
6
6
|
import { subscriberFactory } from '@shipfox/node-module';
|
|
7
7
|
import { db, migrationsPath, triggersOutbox } from '#db/index.js';
|
|
8
8
|
import { registerTriggersServiceMetrics } from '#metrics/index.js';
|
|
9
|
+
import { triggersE2eRoutes } from '#presentation/e2e-routes.js';
|
|
9
10
|
import { createTriggerRoutes } from '#presentation/index.js';
|
|
10
11
|
import { createOnIntegrationEventReceived, onDefinitionDeleted, onDefinitionResolved, onJobActivated, onJobTerminated } from '#presentation/subscribers/index.js';
|
|
11
12
|
import { createTriggersCronActivities, createTriggersMaintenanceActivities } from '#temporal/activities/index.js';
|
|
@@ -23,6 +24,9 @@ export function createTriggersModule({ workflows }) {
|
|
|
23
24
|
migrationsPath
|
|
24
25
|
},
|
|
25
26
|
routes: createTriggerRoutes(workflows),
|
|
27
|
+
e2eRoutes: [
|
|
28
|
+
triggersE2eRoutes
|
|
29
|
+
],
|
|
26
30
|
metrics: registerTriggersServiceMetrics,
|
|
27
31
|
publishers: [
|
|
28
32
|
{
|
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 {\n DEFINITION_DELETED,\n DEFINITION_RESOLVED,\n type DefinitionsEventMap,\n} from '@shipfox/api-definitions-dto';\nimport {\n INTEGRATION_EVENT_RECEIVED,\n type IntegrationsEventMap,\n} from '@shipfox/api-integration-core-dto';\nimport {\n WORKFLOWS_JOB_ACTIVATED,\n WORKFLOWS_JOB_TERMINATED,\n type WorkflowsEventMapDto,\n} from '@shipfox/api-workflows-dto';\nimport type {WorkflowsModuleClient} from '@shipfox/api-workflows-dto/inter-module';\nimport {type ShipfoxModule, subscriberFactory} from '@shipfox/node-module';\nimport {db, migrationsPath, triggersOutbox} from '#db/index.js';\nimport {registerTriggersServiceMetrics} from '#metrics/index.js';\nimport {createTriggerRoutes} from '#presentation/index.js';\nimport {\n createOnIntegrationEventReceived,\n onDefinitionDeleted,\n onDefinitionResolved,\n onJobActivated,\n onJobTerminated,\n} from '#presentation/subscribers/index.js';\nimport {\n createTriggersCronActivities,\n createTriggersMaintenanceActivities,\n} from '#temporal/activities/index.js';\nimport {TRIGGERS_CRON_TASK_QUEUE, TRIGGERS_MAINTENANCE_TASK_QUEUE} from '#temporal/constants.js';\n\nexport type {\n JobListenerMatcherKind,\n JobListenerSubscription,\n} from '#core/entities/job-listener-subscription.js';\nexport type {TriggerSubscription} from '#core/entities/subscription.js';\nexport {\n fireCronSubscription,\n fireManualSubscription,\n ManualTriggerNotFoundError,\n TriggerSubscriptionNotCronError,\n TriggerSubscriptionNotFoundError,\n TriggerSubscriptionNotManualError,\n TriggerWorkspaceMismatchError,\n} from '#core/index.js';\nexport {\n db,\n findMatchingJobListenerSubscriptions,\n findMatchingSubscriptions,\n getManualSubscriptionByDefinitionId,\n getTriggerSubscriptionById,\n jobListenerSubscriptions,\n listSubscriptionsByWorkflowDefinitionIds,\n migrationsPath,\n projectJobListenerSubscriptions,\n removeJobListenerSubscriptionsForJob,\n triggersOutbox,\n} from '#db/index.js';\n\nconst packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');\nconst temporalWorkflowsPath = resolve(packageRoot, 'dist/temporal/workflows/index.js');\n\nconst subscriber = subscriberFactory<\n DefinitionsEventMap & IntegrationsEventMap & WorkflowsEventMapDto\n>();\n\nexport interface CreateTriggersModuleOptions {\n workflows: WorkflowsModuleClient;\n}\n\nexport function createTriggersModule({workflows}: CreateTriggersModuleOptions): ShipfoxModule {\n return {\n name: 'triggers',\n database: {db, migrationsPath},\n routes: createTriggerRoutes(workflows),\n metrics: registerTriggersServiceMetrics,\n publishers: [{name: 'triggers', table: triggersOutbox, db}],\n subscribers: [\n subscriber(DEFINITION_RESOLVED, onDefinitionResolved),\n subscriber(DEFINITION_DELETED, onDefinitionDeleted),\n subscriber(INTEGRATION_EVENT_RECEIVED, createOnIntegrationEventReceived(workflows)),\n subscriber(WORKFLOWS_JOB_ACTIVATED, onJobActivated),\n subscriber(WORKFLOWS_JOB_TERMINATED, onJobTerminated),\n ],\n workers: [\n {\n taskQueue: TRIGGERS_MAINTENANCE_TASK_QUEUE,\n workflowsPath: temporalWorkflowsPath,\n activities: createTriggersMaintenanceActivities,\n workflows: [\n {\n name: 'pruneTriggerEventsCron',\n id: 'triggers-prune-trigger-events',\n cronSchedule: '0 * * * *',\n },\n ],\n },\n {\n taskQueue: TRIGGERS_CRON_TASK_QUEUE,\n workflowsPath: temporalWorkflowsPath,\n activities: () => createTriggersCronActivities(workflows),\n workflows: [\n {\n name: 'cronTickCron',\n id: 'triggers-cron-tick',\n cronSchedule: '* * * * *',\n },\n ],\n },\n ],\n };\n}\n"],"names":["dirname","resolve","fileURLToPath","DEFINITION_DELETED","DEFINITION_RESOLVED","INTEGRATION_EVENT_RECEIVED","WORKFLOWS_JOB_ACTIVATED","WORKFLOWS_JOB_TERMINATED","subscriberFactory","db","migrationsPath","triggersOutbox","registerTriggersServiceMetrics","createTriggerRoutes","createOnIntegrationEventReceived","onDefinitionDeleted","onDefinitionResolved","onJobActivated","onJobTerminated","createTriggersCronActivities","createTriggersMaintenanceActivities","TRIGGERS_CRON_TASK_QUEUE","TRIGGERS_MAINTENANCE_TASK_QUEUE","fireCronSubscription","fireManualSubscription","ManualTriggerNotFoundError","TriggerSubscriptionNotCronError","TriggerSubscriptionNotFoundError","TriggerSubscriptionNotManualError","TriggerWorkspaceMismatchError","findMatchingJobListenerSubscriptions","findMatchingSubscriptions","getManualSubscriptionByDefinitionId","getTriggerSubscriptionById","jobListenerSubscriptions","listSubscriptionsByWorkflowDefinitionIds","projectJobListenerSubscriptions","removeJobListenerSubscriptionsForJob","packageRoot","url","temporalWorkflowsPath","subscriber","createTriggersModule","workflows","name","database","routes","metrics","publishers","table","subscribers","workers","taskQueue","workflowsPath","activities","id","cronSchedule"],"mappings":"AAAA,SAAQA,OAAO,EAAEC,OAAO,QAAO,YAAY;AAC3C,SAAQC,aAAa,QAAO,WAAW;AACvC,SACEC,kBAAkB,EAClBC,mBAAmB,QAEd,+BAA+B;AACtC,SACEC,0BAA0B,QAErB,oCAAoC;AAC3C,SACEC,uBAAuB,EACvBC,wBAAwB,QAEnB,6BAA6B;AAEpC,SAA4BC,iBAAiB,QAAO,uBAAuB;AAC3E,SAAQC,EAAE,EAAEC,cAAc,EAAEC,cAAc,QAAO,eAAe;AAChE,SAAQC,8BAA8B,QAAO,oBAAoB;AACjE,SAAQC,mBAAmB,QAAO,yBAAyB;AAC3D,SACEC,gCAAgC,EAChCC,mBAAmB,EACnBC,oBAAoB,EACpBC,cAAc,EACdC,eAAe,QACV,qCAAqC;AAC5C,SACEC,4BAA4B,EAC5BC,mCAAmC,QAC9B,gCAAgC;AACvC,SAAQC,wBAAwB,EAAEC,+BAA+B,QAAO,yBAAyB;AAOjG,SACEC,oBAAoB,EACpBC,sBAAsB,EACtBC,0BAA0B,EAC1BC,+BAA+B,EAC/BC,gCAAgC,EAChCC,iCAAiC,EACjCC,6BAA6B,QACxB,iBAAiB;AACxB,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {dirname, resolve} from 'node:path';\nimport {fileURLToPath} from 'node:url';\nimport {\n DEFINITION_DELETED,\n DEFINITION_RESOLVED,\n type DefinitionsEventMap,\n} from '@shipfox/api-definitions-dto';\nimport {\n INTEGRATION_EVENT_RECEIVED,\n type IntegrationsEventMap,\n} from '@shipfox/api-integration-core-dto';\nimport {\n WORKFLOWS_JOB_ACTIVATED,\n WORKFLOWS_JOB_TERMINATED,\n type WorkflowsEventMapDto,\n} from '@shipfox/api-workflows-dto';\nimport type {WorkflowsModuleClient} from '@shipfox/api-workflows-dto/inter-module';\nimport {type ShipfoxModule, subscriberFactory} from '@shipfox/node-module';\nimport {db, migrationsPath, triggersOutbox} from '#db/index.js';\nimport {registerTriggersServiceMetrics} from '#metrics/index.js';\nimport {triggersE2eRoutes} from '#presentation/e2e-routes.js';\nimport {createTriggerRoutes} from '#presentation/index.js';\nimport {\n createOnIntegrationEventReceived,\n onDefinitionDeleted,\n onDefinitionResolved,\n onJobActivated,\n onJobTerminated,\n} from '#presentation/subscribers/index.js';\nimport {\n createTriggersCronActivities,\n createTriggersMaintenanceActivities,\n} from '#temporal/activities/index.js';\nimport {TRIGGERS_CRON_TASK_QUEUE, TRIGGERS_MAINTENANCE_TASK_QUEUE} from '#temporal/constants.js';\n\nexport type {\n JobListenerMatcherKind,\n JobListenerSubscription,\n} from '#core/entities/job-listener-subscription.js';\nexport type {TriggerSubscription} from '#core/entities/subscription.js';\nexport {\n fireCronSubscription,\n fireManualSubscription,\n ManualTriggerNotFoundError,\n TriggerSubscriptionNotCronError,\n TriggerSubscriptionNotFoundError,\n TriggerSubscriptionNotManualError,\n TriggerWorkspaceMismatchError,\n} from '#core/index.js';\nexport {\n db,\n findMatchingJobListenerSubscriptions,\n findMatchingSubscriptions,\n getManualSubscriptionByDefinitionId,\n getTriggerSubscriptionById,\n jobListenerSubscriptions,\n listSubscriptionsByWorkflowDefinitionIds,\n migrationsPath,\n projectJobListenerSubscriptions,\n removeJobListenerSubscriptionsForJob,\n triggersOutbox,\n} from '#db/index.js';\n\nconst packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');\nconst temporalWorkflowsPath = resolve(packageRoot, 'dist/temporal/workflows/index.js');\n\nconst subscriber = subscriberFactory<\n DefinitionsEventMap & IntegrationsEventMap & WorkflowsEventMapDto\n>();\n\nexport interface CreateTriggersModuleOptions {\n workflows: WorkflowsModuleClient;\n}\n\nexport function createTriggersModule({workflows}: CreateTriggersModuleOptions): ShipfoxModule {\n return {\n name: 'triggers',\n database: {db, migrationsPath},\n routes: createTriggerRoutes(workflows),\n e2eRoutes: [triggersE2eRoutes],\n metrics: registerTriggersServiceMetrics,\n publishers: [{name: 'triggers', table: triggersOutbox, db}],\n subscribers: [\n subscriber(DEFINITION_RESOLVED, onDefinitionResolved),\n subscriber(DEFINITION_DELETED, onDefinitionDeleted),\n subscriber(INTEGRATION_EVENT_RECEIVED, createOnIntegrationEventReceived(workflows)),\n subscriber(WORKFLOWS_JOB_ACTIVATED, onJobActivated),\n subscriber(WORKFLOWS_JOB_TERMINATED, onJobTerminated),\n ],\n workers: [\n {\n taskQueue: TRIGGERS_MAINTENANCE_TASK_QUEUE,\n workflowsPath: temporalWorkflowsPath,\n activities: createTriggersMaintenanceActivities,\n workflows: [\n {\n name: 'pruneTriggerEventsCron',\n id: 'triggers-prune-trigger-events',\n cronSchedule: '0 * * * *',\n },\n ],\n },\n {\n taskQueue: TRIGGERS_CRON_TASK_QUEUE,\n workflowsPath: temporalWorkflowsPath,\n activities: () => createTriggersCronActivities(workflows),\n workflows: [\n {\n name: 'cronTickCron',\n id: 'triggers-cron-tick',\n cronSchedule: '* * * * *',\n },\n ],\n },\n ],\n };\n}\n"],"names":["dirname","resolve","fileURLToPath","DEFINITION_DELETED","DEFINITION_RESOLVED","INTEGRATION_EVENT_RECEIVED","WORKFLOWS_JOB_ACTIVATED","WORKFLOWS_JOB_TERMINATED","subscriberFactory","db","migrationsPath","triggersOutbox","registerTriggersServiceMetrics","triggersE2eRoutes","createTriggerRoutes","createOnIntegrationEventReceived","onDefinitionDeleted","onDefinitionResolved","onJobActivated","onJobTerminated","createTriggersCronActivities","createTriggersMaintenanceActivities","TRIGGERS_CRON_TASK_QUEUE","TRIGGERS_MAINTENANCE_TASK_QUEUE","fireCronSubscription","fireManualSubscription","ManualTriggerNotFoundError","TriggerSubscriptionNotCronError","TriggerSubscriptionNotFoundError","TriggerSubscriptionNotManualError","TriggerWorkspaceMismatchError","findMatchingJobListenerSubscriptions","findMatchingSubscriptions","getManualSubscriptionByDefinitionId","getTriggerSubscriptionById","jobListenerSubscriptions","listSubscriptionsByWorkflowDefinitionIds","projectJobListenerSubscriptions","removeJobListenerSubscriptionsForJob","packageRoot","url","temporalWorkflowsPath","subscriber","createTriggersModule","workflows","name","database","routes","e2eRoutes","metrics","publishers","table","subscribers","workers","taskQueue","workflowsPath","activities","id","cronSchedule"],"mappings":"AAAA,SAAQA,OAAO,EAAEC,OAAO,QAAO,YAAY;AAC3C,SAAQC,aAAa,QAAO,WAAW;AACvC,SACEC,kBAAkB,EAClBC,mBAAmB,QAEd,+BAA+B;AACtC,SACEC,0BAA0B,QAErB,oCAAoC;AAC3C,SACEC,uBAAuB,EACvBC,wBAAwB,QAEnB,6BAA6B;AAEpC,SAA4BC,iBAAiB,QAAO,uBAAuB;AAC3E,SAAQC,EAAE,EAAEC,cAAc,EAAEC,cAAc,QAAO,eAAe;AAChE,SAAQC,8BAA8B,QAAO,oBAAoB;AACjE,SAAQC,iBAAiB,QAAO,8BAA8B;AAC9D,SAAQC,mBAAmB,QAAO,yBAAyB;AAC3D,SACEC,gCAAgC,EAChCC,mBAAmB,EACnBC,oBAAoB,EACpBC,cAAc,EACdC,eAAe,QACV,qCAAqC;AAC5C,SACEC,4BAA4B,EAC5BC,mCAAmC,QAC9B,gCAAgC;AACvC,SAAQC,wBAAwB,EAAEC,+BAA+B,QAAO,yBAAyB;AAOjG,SACEC,oBAAoB,EACpBC,sBAAsB,EACtBC,0BAA0B,EAC1BC,+BAA+B,EAC/BC,gCAAgC,EAChCC,iCAAiC,EACjCC,6BAA6B,QACxB,iBAAiB;AACxB,SACErB,EAAE,EACFsB,oCAAoC,EACpCC,yBAAyB,EACzBC,mCAAmC,EACnCC,0BAA0B,EAC1BC,wBAAwB,EACxBC,wCAAwC,EACxC1B,cAAc,EACd2B,+BAA+B,EAC/BC,oCAAoC,EACpC3B,cAAc,QACT,eAAe;AAEtB,MAAM4B,cAActC,QAAQD,QAAQE,cAAc,YAAYsC,GAAG,IAAI;AACrE,MAAMC,wBAAwBxC,QAAQsC,aAAa;AAEnD,MAAMG,aAAalC;AAQnB,OAAO,SAASmC,qBAAqB,EAACC,SAAS,EAA8B;IAC3E,OAAO;QACLC,MAAM;QACNC,UAAU;YAACrC;YAAIC;QAAc;QAC7BqC,QAAQjC,oBAAoB8B;QAC5BI,WAAW;YAACnC;SAAkB;QAC9BoC,SAASrC;QACTsC,YAAY;YAAC;gBAACL,MAAM;gBAAYM,OAAOxC;gBAAgBF;YAAE;SAAE;QAC3D2C,aAAa;YACXV,WAAWtC,qBAAqBa;YAChCyB,WAAWvC,oBAAoBa;YAC/B0B,WAAWrC,4BAA4BU,iCAAiC6B;YACxEF,WAAWpC,yBAAyBY;YACpCwB,WAAWnC,0BAA0BY;SACtC;QACDkC,SAAS;YACP;gBACEC,WAAW/B;gBACXgC,eAAed;gBACfe,YAAYnC;gBACZuB,WAAW;oBACT;wBACEC,MAAM;wBACNY,IAAI;wBACJC,cAAc;oBAChB;iBACD;YACH;YACA;gBACEJ,WAAWhC;gBACXiC,eAAed;gBACfe,YAAY,IAAMpC,6BAA6BwB;gBAC/CA,WAAW;oBACT;wBACEC,MAAM;wBACNY,IAAI;wBACJC,cAAc;oBAChB;iBACD;YACH;SACD;IACH;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e2e-routes.d.ts","sourceRoot":"","sources":["../../src/presentation/e2e-routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAoBnE,eAAO,MAAM,iBAAiB,EAAE,UAG/B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineRoute } from '@shipfox/node-fastify';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { hasJobListenerSubscriptions } from '#db/job-listener-subscriptions.js';
|
|
4
|
+
const listenerReadinessParamsSchema = z.object({
|
|
5
|
+
jobId: z.string().uuid()
|
|
6
|
+
});
|
|
7
|
+
const listenerReadinessResponseSchema = z.object({
|
|
8
|
+
ready: z.boolean()
|
|
9
|
+
});
|
|
10
|
+
const listenerReadinessRoute = defineRoute({
|
|
11
|
+
method: 'GET',
|
|
12
|
+
path: '/listeners/:jobId/readiness',
|
|
13
|
+
description: 'Report whether trigger subscriptions for a listener job are ready in E2E tests.',
|
|
14
|
+
schema: {
|
|
15
|
+
params: listenerReadinessParamsSchema,
|
|
16
|
+
response: {
|
|
17
|
+
200: listenerReadinessResponseSchema
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
handler: async (request)=>({
|
|
21
|
+
ready: await hasJobListenerSubscriptions(request.params.jobId)
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
export const triggersE2eRoutes = {
|
|
25
|
+
prefix: '/triggers',
|
|
26
|
+
routes: [
|
|
27
|
+
listenerReadinessRoute
|
|
28
|
+
]
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=e2e-routes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/presentation/e2e-routes.ts"],"sourcesContent":["import {defineRoute, type RouteGroup} from '@shipfox/node-fastify';\nimport {z} from 'zod';\nimport {hasJobListenerSubscriptions} from '#db/job-listener-subscriptions.js';\n\nconst listenerReadinessParamsSchema = z.object({jobId: z.string().uuid()});\nconst listenerReadinessResponseSchema = z.object({ready: z.boolean()});\n\nconst listenerReadinessRoute = defineRoute({\n method: 'GET',\n path: '/listeners/:jobId/readiness',\n description: 'Report whether trigger subscriptions for a listener job are ready in E2E tests.',\n schema: {\n params: listenerReadinessParamsSchema,\n response: {200: listenerReadinessResponseSchema},\n },\n handler: async (request) => ({\n ready: await hasJobListenerSubscriptions(request.params.jobId),\n }),\n});\n\nexport const triggersE2eRoutes: RouteGroup = {\n prefix: '/triggers',\n routes: [listenerReadinessRoute],\n};\n"],"names":["defineRoute","z","hasJobListenerSubscriptions","listenerReadinessParamsSchema","object","jobId","string","uuid","listenerReadinessResponseSchema","ready","boolean","listenerReadinessRoute","method","path","description","schema","params","response","handler","request","triggersE2eRoutes","prefix","routes"],"mappings":"AAAA,SAAQA,WAAW,QAAwB,wBAAwB;AACnE,SAAQC,CAAC,QAAO,MAAM;AACtB,SAAQC,2BAA2B,QAAO,oCAAoC;AAE9E,MAAMC,gCAAgCF,EAAEG,MAAM,CAAC;IAACC,OAAOJ,EAAEK,MAAM,GAAGC,IAAI;AAAE;AACxE,MAAMC,kCAAkCP,EAAEG,MAAM,CAAC;IAACK,OAAOR,EAAES,OAAO;AAAE;AAEpE,MAAMC,yBAAyBX,YAAY;IACzCY,QAAQ;IACRC,MAAM;IACNC,aAAa;IACbC,QAAQ;QACNC,QAAQb;QACRc,UAAU;YAAC,KAAKT;QAA+B;IACjD;IACAU,SAAS,OAAOC,UAAa,CAAA;YAC3BV,OAAO,MAAMP,4BAA4BiB,QAAQH,MAAM,CAACX,KAAK;QAC/D,CAAA;AACF;AAEA,OAAO,MAAMe,oBAAgC;IAC3CC,QAAQ;IACRC,QAAQ;QAACX;KAAuB;AAClC,EAAE"}
|