@voyant-travel/workflows-orchestrator 0.109.2 → 0.109.4
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/dist/node/entry-loader.d.ts +6 -0
- package/dist/node/entry-loader.d.ts.map +1 -1
- package/dist/node/entry-loader.js +12 -0
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +1 -1
- package/package.json +2 -2
- package/src/node/entry-loader.ts +22 -0
- package/src/node/index.ts +3 -0
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
export interface EntryFile {
|
|
2
2
|
exports: Record<string, unknown>;
|
|
3
3
|
}
|
|
4
|
+
export interface WorkflowBundleBootstrapContext {
|
|
5
|
+
env: NodeJS.ProcessEnv;
|
|
6
|
+
}
|
|
7
|
+
export type WorkflowBundleBootstrap = (ctx: WorkflowBundleBootstrapContext) => void | Promise<void>;
|
|
4
8
|
export interface LoadEntryOptions {
|
|
5
9
|
cacheBust?: boolean;
|
|
10
|
+
runBootstrap?: boolean;
|
|
6
11
|
}
|
|
7
12
|
export declare function loadEntryFile(path: string, options?: LoadEntryOptions): Promise<EntryFile>;
|
|
13
|
+
export declare function runWorkflowBundleBootstrap(mod: Record<string, unknown>, ctx?: WorkflowBundleBootstrapContext): Promise<void>;
|
|
8
14
|
//# sourceMappingURL=entry-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-loader.d.ts","sourceRoot":"","sources":["../../src/node/entry-loader.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACjC;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"entry-loader.d.ts","sourceRoot":"","sources":["../../src/node/entry-loader.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACjC;AAED,MAAM,WAAW,8BAA8B;IAC7C,GAAG,EAAE,MAAM,CAAC,UAAU,CAAA;CACvB;AAED,MAAM,MAAM,uBAAuB,GAAG,CAAC,GAAG,EAAE,8BAA8B,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAEnG,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,SAAS,CAAC,CAmBpB;AAED,wBAAsB,0BAA0B,CAC9C,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,GAAG,GAAE,8BAAqD,GACzD,OAAO,CAAC,IAAI,CAAC,CAOf"}
|
|
@@ -8,6 +8,9 @@ export async function loadEntryFile(path, options = {}) {
|
|
|
8
8
|
const url = options.cacheBust ? `${baseUrl}?t=${Date.now()}` : baseUrl;
|
|
9
9
|
try {
|
|
10
10
|
const mod = (await import(url));
|
|
11
|
+
if (options.runBootstrap !== false) {
|
|
12
|
+
await runWorkflowBundleBootstrap(mod);
|
|
13
|
+
}
|
|
11
14
|
return { exports: mod };
|
|
12
15
|
}
|
|
13
16
|
catch (err) {
|
|
@@ -17,3 +20,12 @@ export async function loadEntryFile(path, options = {}) {
|
|
|
17
20
|
"`voyant dev` on a .ts source to bundle with esbuild first.");
|
|
18
21
|
}
|
|
19
22
|
}
|
|
23
|
+
export async function runWorkflowBundleBootstrap(mod, ctx = { env: process.env }) {
|
|
24
|
+
const bootstrap = mod.bootstrapWorkflowBundle;
|
|
25
|
+
if (bootstrap === undefined)
|
|
26
|
+
return;
|
|
27
|
+
if (typeof bootstrap !== "function") {
|
|
28
|
+
throw new Error("voyant: workflow entry export `bootstrapWorkflowBundle` must be a function");
|
|
29
|
+
}
|
|
30
|
+
await bootstrap(ctx);
|
|
31
|
+
}
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { type ChunkBus, type ChunkEvent, createChunkBus, createSelfHostDeps, createStaticReader, findDashboardDir, type HandlerResponse, handleRequest, handleRunSseStream, handleSseStream, type MetricsSnapshot, type RequestHandlerDeps, renderMetrics, type SelfHostServerOptions, type ServeDeps, type ServeHandle, startSelfHostServer, startServer, } from "./dashboard-server.js";
|
|
2
|
-
export { type EntryFile, type LoadEntryOptions, loadEntryFile, } from "./entry-loader.js";
|
|
2
|
+
export { type EntryFile, type LoadEntryOptions, loadEntryFile, runWorkflowBundleBootstrap, type WorkflowBundleBootstrap, type WorkflowBundleBootstrapContext, } from "./entry-loader.js";
|
|
3
3
|
export { createFsRunRecordStore, type FsRunRecordStoreOptions, filterRunRecords, } from "./fs-run-record-store.js";
|
|
4
4
|
export { durationToMs, generateLocalRunId, } from "./local-runtime.js";
|
|
5
5
|
export { defaultMigrationsDir, loadPostgresMigrations, type PostgresMigration, type RunPostgresMigrationsOptions, runPostgresMigrations, } from "./migrate.js";
|
package/dist/node/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,eAAe,EACpB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,aAAa,EACb,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,mBAAmB,EACnB,WAAW,GACZ,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,eAAe,EACpB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,aAAa,EACb,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,mBAAmB,EACnB,WAAW,GACZ,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,aAAa,EACb,0BAA0B,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,8BAA8B,GACpC,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,sBAAsB,EACtB,KAAK,uBAAuB,EAC5B,gBAAgB,GACjB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,YAAY,EACZ,kBAAkB,GACnB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,iBAAiB,EACtB,KAAK,4BAA4B,EACjC,qBAAqB,GACtB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,sBAAsB,EACtB,KAAK,uBAAuB,GAC7B,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACL,6BAA6B,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,GACjC,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,KAAK,+BAA+B,EACpC,wBAAwB,EACxB,KAAK,kBAAkB,GACxB,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,2BAA2B,EAC3B,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,4BAA4B,GAClC,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,4BAA4B,EAC5B,KAAK,6BAA6B,G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xB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,oBAAoB,EACpB,KAAK,YAAY,EACjB,KAAK,WAAW,GACjB,MAAM,mBAAmB,CAAA"}
|
package/dist/node/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createChunkBus, createSelfHostDeps, createStaticReader, findDashboardDir, handleRequest, handleRunSseStream, handleSseStream, renderMetrics, startSelfHostServer, startServer, } from "./dashboard-server.js";
|
|
2
|
-
export { loadEntryFile, } from "./entry-loader.js";
|
|
2
|
+
export { loadEntryFile, runWorkflowBundleBootstrap, } from "./entry-loader.js";
|
|
3
3
|
export { createFsRunRecordStore, filterRunRecords, } from "./fs-run-record-store.js";
|
|
4
4
|
export { durationToMs, generateLocalRunId, } from "./local-runtime.js";
|
|
5
5
|
export { defaultMigrationsDir, loadPostgresMigrations, runPostgresMigrations, } from "./migrate.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyant-travel/workflows-orchestrator",
|
|
3
|
-
"version": "0.109.
|
|
3
|
+
"version": "0.109.4",
|
|
4
4
|
"description": "Postgres self-host orchestrator runtime for Voyant Workflows — drives runs through the tenant step handler over the v1 wire protocol.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"drizzle-orm": "^0.45.2",
|
|
45
45
|
"pg": "^8.20.0",
|
|
46
|
-
"@voyant-travel/workflows": "^0.109.
|
|
46
|
+
"@voyant-travel/workflows": "^0.109.4"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/node": "^20.12.0",
|
package/src/node/entry-loader.ts
CHANGED
|
@@ -6,8 +6,15 @@ export interface EntryFile {
|
|
|
6
6
|
exports: Record<string, unknown>
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
export interface WorkflowBundleBootstrapContext {
|
|
10
|
+
env: NodeJS.ProcessEnv
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type WorkflowBundleBootstrap = (ctx: WorkflowBundleBootstrapContext) => void | Promise<void>
|
|
14
|
+
|
|
9
15
|
export interface LoadEntryOptions {
|
|
10
16
|
cacheBust?: boolean
|
|
17
|
+
runBootstrap?: boolean
|
|
11
18
|
}
|
|
12
19
|
|
|
13
20
|
export async function loadEntryFile(
|
|
@@ -20,6 +27,9 @@ export async function loadEntryFile(
|
|
|
20
27
|
const url = options.cacheBust ? `${baseUrl}?t=${Date.now()}` : baseUrl
|
|
21
28
|
try {
|
|
22
29
|
const mod = (await import(url)) as Record<string, unknown>
|
|
30
|
+
if (options.runBootstrap !== false) {
|
|
31
|
+
await runWorkflowBundleBootstrap(mod)
|
|
32
|
+
}
|
|
23
33
|
return { exports: mod }
|
|
24
34
|
} catch (err) {
|
|
25
35
|
const message = err instanceof Error ? err.message : String(err)
|
|
@@ -30,3 +40,15 @@ export async function loadEntryFile(
|
|
|
30
40
|
)
|
|
31
41
|
}
|
|
32
42
|
}
|
|
43
|
+
|
|
44
|
+
export async function runWorkflowBundleBootstrap(
|
|
45
|
+
mod: Record<string, unknown>,
|
|
46
|
+
ctx: WorkflowBundleBootstrapContext = { env: process.env },
|
|
47
|
+
): Promise<void> {
|
|
48
|
+
const bootstrap = mod.bootstrapWorkflowBundle
|
|
49
|
+
if (bootstrap === undefined) return
|
|
50
|
+
if (typeof bootstrap !== "function") {
|
|
51
|
+
throw new Error("voyant: workflow entry export `bootstrapWorkflowBundle` must be a function")
|
|
52
|
+
}
|
|
53
|
+
await (bootstrap as WorkflowBundleBootstrap)(ctx)
|
|
54
|
+
}
|
package/src/node/index.ts
CHANGED