@shipfox/api-workflows 2.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +21 -2
- package/CHANGELOG.md +47 -0
- package/dist/temporal/workflows/index.bundle.js +12491 -0
- package/dist/temporal/workflows/index.bundle.meta.json +1 -0
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +30 -30
- package/src/temporal/workflows/job-execution-orchestration.test.ts +37 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipfox/api-workflows",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/ShipfoxHQ/shipfox.git",
|
|
@@ -32,55 +32,55 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@temporalio/common": "
|
|
36
|
-
"@temporalio/workflow": "
|
|
35
|
+
"@temporalio/common": "1.18.1",
|
|
36
|
+
"@temporalio/workflow": "1.18.1",
|
|
37
37
|
"drizzle-orm": "^0.45.2",
|
|
38
38
|
"zod": "^4.4.3",
|
|
39
|
-
"@shipfox/api-
|
|
40
|
-
"@shipfox/api-auth
|
|
41
|
-
"@shipfox/
|
|
42
|
-
"@shipfox/api-
|
|
43
|
-
"@shipfox/
|
|
44
|
-
"@shipfox/api-
|
|
39
|
+
"@shipfox/api-agent": "4.0.0",
|
|
40
|
+
"@shipfox/api-auth": "4.0.0",
|
|
41
|
+
"@shipfox/api-auth-context": "3.0.0",
|
|
42
|
+
"@shipfox/api-agent-dto": "3.0.0",
|
|
43
|
+
"@shipfox/annotations": "4.0.0",
|
|
44
|
+
"@shipfox/api-definitions": "4.0.0",
|
|
45
|
+
"@shipfox/api-integration-core": "4.0.0",
|
|
46
|
+
"@shipfox/api-projects": "4.0.0",
|
|
47
|
+
"@shipfox/api-runners": "4.0.0",
|
|
45
48
|
"@shipfox/api-runners-dto": "2.0.0",
|
|
46
|
-
"@shipfox/api-
|
|
47
|
-
"@shipfox/api-secrets": "2.0.0",
|
|
49
|
+
"@shipfox/api-secrets": "4.0.0",
|
|
48
50
|
"@shipfox/api-secrets-dto": "2.0.0",
|
|
49
|
-
"@shipfox/expression": "1.1.1",
|
|
50
|
-
"@shipfox/node-error-monitoring": "0.1.2",
|
|
51
51
|
"@shipfox/api-workflows-dto": "2.0.0",
|
|
52
|
-
"@shipfox/
|
|
53
|
-
"@shipfox/node-
|
|
54
|
-
"@shipfox/node-
|
|
55
|
-
"@shipfox/node-
|
|
56
|
-
"@shipfox/node-
|
|
52
|
+
"@shipfox/expression": "1.1.2",
|
|
53
|
+
"@shipfox/node-drizzle": "0.3.0",
|
|
54
|
+
"@shipfox/node-error-monitoring": "0.1.2",
|
|
55
|
+
"@shipfox/node-fastify": "0.2.2",
|
|
56
|
+
"@shipfox/node-module": "0.3.1",
|
|
57
|
+
"@shipfox/node-opentelemetry": "0.5.1",
|
|
58
|
+
"@shipfox/node-outbox": "0.2.2",
|
|
57
59
|
"@shipfox/node-postgres": "0.4.1",
|
|
58
|
-
"@shipfox/node-temporal": "0.
|
|
59
|
-
"@shipfox/runner-labels": "0.1.0"
|
|
60
|
-
"@shipfox/api-agent": "2.0.0",
|
|
61
|
-
"@shipfox/api-definitions": "2.0.0"
|
|
60
|
+
"@shipfox/node-temporal": "0.3.0",
|
|
61
|
+
"@shipfox/runner-labels": "0.1.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@temporalio/activity": "
|
|
65
|
-
"@temporalio/client": "
|
|
66
|
-
"@temporalio/testing": "
|
|
67
|
-
"@temporalio/worker": "
|
|
64
|
+
"@temporalio/activity": "1.18.1",
|
|
65
|
+
"@temporalio/client": "1.18.1",
|
|
66
|
+
"@temporalio/testing": "1.18.1",
|
|
67
|
+
"@temporalio/worker": "1.18.1",
|
|
68
68
|
"@types/pg": "^8.15.5",
|
|
69
69
|
"drizzle-kit": "^0.31.10",
|
|
70
70
|
"fastify": "^5.3.3",
|
|
71
71
|
"fastify-type-provider-zod": "^6.0.0",
|
|
72
|
-
"fishery": "^2.
|
|
72
|
+
"fishery": "^2.4.0",
|
|
73
73
|
"@shipfox/api-auth-dto": "2.0.0",
|
|
74
74
|
"@shipfox/biome": "1.8.1",
|
|
75
75
|
"@shipfox/node-jwt": "0.2.0",
|
|
76
|
+
"@shipfox/node-log": "0.3.3",
|
|
76
77
|
"@shipfox/swc": "1.2.5",
|
|
77
|
-
"@shipfox/vitest": "1.2.2",
|
|
78
78
|
"@shipfox/ts-config": "1.3.8",
|
|
79
79
|
"@shipfox/typescript": "1.1.6",
|
|
80
|
-
"@shipfox/
|
|
80
|
+
"@shipfox/vitest": "1.2.2"
|
|
81
81
|
},
|
|
82
82
|
"scripts": {
|
|
83
|
-
"build": "shipfox-swc",
|
|
83
|
+
"build": "shipfox-swc && shipfox-temporal-bundle dist/temporal/workflows/index.js",
|
|
84
84
|
"check": "shipfox-biome-check",
|
|
85
85
|
"check:fix": "shipfox-biome-check --write",
|
|
86
86
|
"test": "shipfox-vitest-run",
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {mkdtemp, rm, writeFile} from 'node:fs/promises';
|
|
2
|
+
import {tmpdir} from 'node:os';
|
|
3
|
+
import {join, resolve} from 'node:path';
|
|
4
|
+
import {bundleProductionWorkflow} from '@shipfox/node-temporal';
|
|
5
|
+
import {Worker} from '@temporalio/worker';
|
|
1
6
|
import {
|
|
2
7
|
callsNamed,
|
|
3
8
|
dagJob,
|
|
@@ -12,6 +17,9 @@ import {
|
|
|
12
17
|
testEnv,
|
|
13
18
|
} from './test-env.js';
|
|
14
19
|
|
|
20
|
+
const PREBUILT_WORKFLOW_TASK_QUEUE = 'test-prebuilt-workflow-bundle';
|
|
21
|
+
const WORKFLOWS_PATH = resolve(import.meta.dirname, '../../../dist/temporal/workflows/index.js');
|
|
22
|
+
|
|
15
23
|
beforeAll(async () => {
|
|
16
24
|
await setupEnv();
|
|
17
25
|
}, 60_000);
|
|
@@ -309,3 +317,32 @@ describe('jobExecutionOrchestration', () => {
|
|
|
309
317
|
await handle.result();
|
|
310
318
|
}, 15_000);
|
|
311
319
|
});
|
|
320
|
+
|
|
321
|
+
describe('prebuilt workflow bundle', () => {
|
|
322
|
+
it('starts a worker from a prebuilt workflow bundle', async () => {
|
|
323
|
+
const bundleDirectory = await mkdtemp(join(tmpdir(), 'shipfox-prebuilt-workflow-'));
|
|
324
|
+
const codePath = join(bundleDirectory, 'workflows.bundle.js');
|
|
325
|
+
let prebuiltWorker: Worker | undefined;
|
|
326
|
+
let workerRunPromise: Promise<void> | undefined;
|
|
327
|
+
|
|
328
|
+
try {
|
|
329
|
+
const workflowBundle = await bundleProductionWorkflow(WORKFLOWS_PATH);
|
|
330
|
+
await writeFile(codePath, workflowBundle.code);
|
|
331
|
+
prebuiltWorker = await Worker.create({
|
|
332
|
+
connection: testEnv.nativeConnection,
|
|
333
|
+
taskQueue: PREBUILT_WORKFLOW_TASK_QUEUE,
|
|
334
|
+
workflowBundle: {codePath},
|
|
335
|
+
activities: {},
|
|
336
|
+
});
|
|
337
|
+
workerRunPromise = prebuiltWorker.run();
|
|
338
|
+
|
|
339
|
+
await new Promise<void>((resolvePromise) => setImmediate(resolvePromise));
|
|
340
|
+
|
|
341
|
+
expect(prebuiltWorker.getStatus().runState).toBe('RUNNING');
|
|
342
|
+
} finally {
|
|
343
|
+
prebuiltWorker?.shutdown();
|
|
344
|
+
await workerRunPromise;
|
|
345
|
+
await rm(bundleDirectory, {recursive: true, force: true});
|
|
346
|
+
}
|
|
347
|
+
}, 10_000);
|
|
348
|
+
});
|