@voyantjs/workflow-runs 0.21.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/README.md +44 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/recorder.d.ts +75 -0
- package/dist/recorder.d.ts.map +1 -0
- package/dist/recorder.js +217 -0
- package/dist/routes.d.ts +33 -0
- package/dist/routes.d.ts.map +1 -0
- package/dist/routes.js +205 -0
- package/dist/runner.d.ts +103 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +45 -0
- package/dist/schema.d.ts +515 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +96 -0
- package/dist/service.d.ts +32 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +54 -0
- package/package.json +75 -0
package/dist/runner.d.ts
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow runner registry — the missing piece that makes "click to
|
|
3
|
+
* rerun" work in the dashboard. Saga workflows defined in
|
|
4
|
+
* `@voyantjs/core/workflows` are pure logic; running one needs
|
|
5
|
+
* closures over `db`, `eventBus`, and per-bundle services. The
|
|
6
|
+
* recorded `workflow_runs.input` row only captures the workflow
|
|
7
|
+
* payload, not those closures.
|
|
8
|
+
*
|
|
9
|
+
* Bundles that own a workflow register a `WorkflowRunner` on
|
|
10
|
+
* bootstrap. The rerun/resume routes look the runner up by name and
|
|
11
|
+
* call `rerun(input, ctx)` / `resume(input, ctx)`.
|
|
12
|
+
*
|
|
13
|
+
* Idempotency declaration:
|
|
14
|
+
* - "safe" — workflow is idempotent on the same input.
|
|
15
|
+
* Fresh rerun runs without confirmation.
|
|
16
|
+
* - "unsafe" — workflow has side effects that re-fire on rerun
|
|
17
|
+
* (writes a new invoice, charges again, etc.).
|
|
18
|
+
* The dashboard requires `confirm: true` in the
|
|
19
|
+
* request body and a confirm dialog in the UI.
|
|
20
|
+
* - "resume-only" — fresh rerun is rejected; only the resume path
|
|
21
|
+
* (skip past completed steps) is allowed.
|
|
22
|
+
*/
|
|
23
|
+
export type WorkflowIdempotency = "safe" | "unsafe" | "resume-only";
|
|
24
|
+
export interface WorkflowRerunContext {
|
|
25
|
+
/** The original run's id — written to the new run's `parentRunId`. */
|
|
26
|
+
parentRunId: string;
|
|
27
|
+
/** User who clicked "Rerun" / "Resume" in the dashboard. */
|
|
28
|
+
triggeredByUserId: string | null;
|
|
29
|
+
/** The original run's correlationId — copied to the rerun. */
|
|
30
|
+
correlationId: string | null;
|
|
31
|
+
/** The original run's tags — copied (rerun routes augment with `rerun:true` etc.). */
|
|
32
|
+
tags: ReadonlyArray<string>;
|
|
33
|
+
}
|
|
34
|
+
export interface WorkflowResumeContext extends WorkflowRerunContext {
|
|
35
|
+
/**
|
|
36
|
+
* Step name from which to resume. Outputs of all earlier completed
|
|
37
|
+
* steps are passed in `seedResults`; the executor must skip those
|
|
38
|
+
* steps and start at this one.
|
|
39
|
+
*/
|
|
40
|
+
resumeFromStep: string;
|
|
41
|
+
/**
|
|
42
|
+
* Outputs of completed steps from the parent run, keyed by step
|
|
43
|
+
* name. The runner is expected to feed these into the workflow's
|
|
44
|
+
* ctx.results so subsequent steps see prior outputs unchanged.
|
|
45
|
+
*/
|
|
46
|
+
seedResults: Record<string, unknown>;
|
|
47
|
+
}
|
|
48
|
+
export interface WorkflowRunner {
|
|
49
|
+
/** Workflow name — must match `workflow_runs.workflow_name`. */
|
|
50
|
+
name: string;
|
|
51
|
+
/**
|
|
52
|
+
* Idempotency declaration. Drives the dashboard's confirmation
|
|
53
|
+
* behavior and the rerun route's `confirm: true` requirement.
|
|
54
|
+
*/
|
|
55
|
+
idempotency: WorkflowIdempotency;
|
|
56
|
+
/** Human-friendly label shown in the rerun confirm dialog. */
|
|
57
|
+
description?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Run the workflow fresh with the recorded input. Returns the new
|
|
60
|
+
* run's id (the recorder's `runId`).
|
|
61
|
+
*
|
|
62
|
+
* Throws if `idempotency === "resume-only"`.
|
|
63
|
+
*/
|
|
64
|
+
rerun(input: unknown, ctx: WorkflowRerunContext): Promise<{
|
|
65
|
+
runId: string;
|
|
66
|
+
}>;
|
|
67
|
+
/**
|
|
68
|
+
* Resume from `ctx.resumeFromStep`. Steps before that name are
|
|
69
|
+
* skipped (with their outputs hydrated from `ctx.seedResults`); the
|
|
70
|
+
* resume step and everything after it run normally.
|
|
71
|
+
*
|
|
72
|
+
* Returns the new run's id.
|
|
73
|
+
*/
|
|
74
|
+
resume(input: unknown, ctx: WorkflowResumeContext): Promise<{
|
|
75
|
+
runId: string;
|
|
76
|
+
}>;
|
|
77
|
+
/**
|
|
78
|
+
* Optional per-input safety predicate. When supplied, the rerun
|
|
79
|
+
* route calls it with the recorded input and the previous run; a
|
|
80
|
+
* `false` result blocks the rerun (e.g. "don't re-issue an invoice
|
|
81
|
+
* if one already exists for this booking"). Implementations
|
|
82
|
+
* typically return a reason string for the user.
|
|
83
|
+
*/
|
|
84
|
+
canRerun?: (input: unknown) => Promise<{
|
|
85
|
+
ok: true;
|
|
86
|
+
} | {
|
|
87
|
+
ok: false;
|
|
88
|
+
reason: string;
|
|
89
|
+
}>;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Process-wide registry. Templates instantiate one and pass it to
|
|
93
|
+
* `mountWorkflowRunsAdminRoutes(hono, { runners })`. Bundles register
|
|
94
|
+
* their runners on bootstrap.
|
|
95
|
+
*/
|
|
96
|
+
export declare class WorkflowRunnerRegistry {
|
|
97
|
+
private readonly runners;
|
|
98
|
+
register(runner: WorkflowRunner): void;
|
|
99
|
+
get(name: string): WorkflowRunner | null;
|
|
100
|
+
has(name: string): boolean;
|
|
101
|
+
list(): ReadonlyArray<WorkflowRunner>;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,aAAa,CAAA;AAEnE,MAAM,WAAW,oBAAoB;IACnC,sEAAsE;IACtE,WAAW,EAAE,MAAM,CAAA;IACnB,4DAA4D;IAC5D,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,8DAA8D;IAC9D,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,sFAAsF;IACtF,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;CAC5B;AAED,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB;IACjE;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAA;IACtB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACrC;AAED,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,WAAW,EAAE,mBAAmB,CAAA;IAChC,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;OAKG;IACH,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC5E;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,qBAAqB,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC9E;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;QAAE,EAAE,EAAE,IAAI,CAAA;KAAE,GAAG;QAAE,EAAE,EAAE,KAAK,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACrF;AAED;;;;GAIG;AACH,qBAAa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoC;IAE5D,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI;IAOtC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI;IAIxC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1B,IAAI,IAAI,aAAa,CAAC,cAAc,CAAC;CAGtC"}
|
package/dist/runner.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow runner registry — the missing piece that makes "click to
|
|
3
|
+
* rerun" work in the dashboard. Saga workflows defined in
|
|
4
|
+
* `@voyantjs/core/workflows` are pure logic; running one needs
|
|
5
|
+
* closures over `db`, `eventBus`, and per-bundle services. The
|
|
6
|
+
* recorded `workflow_runs.input` row only captures the workflow
|
|
7
|
+
* payload, not those closures.
|
|
8
|
+
*
|
|
9
|
+
* Bundles that own a workflow register a `WorkflowRunner` on
|
|
10
|
+
* bootstrap. The rerun/resume routes look the runner up by name and
|
|
11
|
+
* call `rerun(input, ctx)` / `resume(input, ctx)`.
|
|
12
|
+
*
|
|
13
|
+
* Idempotency declaration:
|
|
14
|
+
* - "safe" — workflow is idempotent on the same input.
|
|
15
|
+
* Fresh rerun runs without confirmation.
|
|
16
|
+
* - "unsafe" — workflow has side effects that re-fire on rerun
|
|
17
|
+
* (writes a new invoice, charges again, etc.).
|
|
18
|
+
* The dashboard requires `confirm: true` in the
|
|
19
|
+
* request body and a confirm dialog in the UI.
|
|
20
|
+
* - "resume-only" — fresh rerun is rejected; only the resume path
|
|
21
|
+
* (skip past completed steps) is allowed.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Process-wide registry. Templates instantiate one and pass it to
|
|
25
|
+
* `mountWorkflowRunsAdminRoutes(hono, { runners })`. Bundles register
|
|
26
|
+
* their runners on bootstrap.
|
|
27
|
+
*/
|
|
28
|
+
export class WorkflowRunnerRegistry {
|
|
29
|
+
runners = new Map();
|
|
30
|
+
register(runner) {
|
|
31
|
+
if (this.runners.has(runner.name)) {
|
|
32
|
+
throw new Error(`WorkflowRunnerRegistry: runner "${runner.name}" already registered`);
|
|
33
|
+
}
|
|
34
|
+
this.runners.set(runner.name, runner);
|
|
35
|
+
}
|
|
36
|
+
get(name) {
|
|
37
|
+
return this.runners.get(name) ?? null;
|
|
38
|
+
}
|
|
39
|
+
has(name) {
|
|
40
|
+
return this.runners.has(name);
|
|
41
|
+
}
|
|
42
|
+
list() {
|
|
43
|
+
return Array.from(this.runners.values());
|
|
44
|
+
}
|
|
45
|
+
}
|
package/dist/schema.d.ts
ADDED
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@voyantjs/workflow-runs` — schema for the lightweight observability
|
|
3
|
+
* surface that records in-process workflow lifecycles (saga steps the
|
|
4
|
+
* `@voyantjs/core/workflows` primitive runs, plus any other "I'm a
|
|
5
|
+
* workflow" code path that opts in via `recordWorkflowRun`).
|
|
6
|
+
*
|
|
7
|
+
* Distinct from the durable `@voyantjs/workflows` SDK's
|
|
8
|
+
* `voyant_snapshot_runs` schema — that one needs an orchestrator
|
|
9
|
+
* process to drive it, which doesn't fit the Cloudflare Workers
|
|
10
|
+
* deployment shape. This schema is edge-compatible (postgres-js or
|
|
11
|
+
* neon-http) so templates can register the routes inside their
|
|
12
|
+
* existing API surface.
|
|
13
|
+
*
|
|
14
|
+
* Tags as JSONB array — lets callers query "all runs for booking X"
|
|
15
|
+
* without hard-coding domain joins. The recorder's convention is to
|
|
16
|
+
* tag with `bookingId:<id>`, `paymentSessionId:<id>`, etc.
|
|
17
|
+
*/
|
|
18
|
+
export declare const workflowRunStatusEnum: import("drizzle-orm/pg-core").PgEnum<["running", "succeeded", "failed", "cancelled"]>;
|
|
19
|
+
export declare const workflowRunStepStatusEnum: import("drizzle-orm/pg-core").PgEnum<["running", "succeeded", "failed", "skipped", "compensated"]>;
|
|
20
|
+
export declare const workflowRuns: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
21
|
+
name: "workflow_runs";
|
|
22
|
+
schema: undefined;
|
|
23
|
+
columns: {
|
|
24
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
25
|
+
name: string;
|
|
26
|
+
tableName: "workflow_runs";
|
|
27
|
+
dataType: "string";
|
|
28
|
+
columnType: "PgText";
|
|
29
|
+
data: string;
|
|
30
|
+
driverParam: string;
|
|
31
|
+
notNull: true;
|
|
32
|
+
hasDefault: true;
|
|
33
|
+
isPrimaryKey: true;
|
|
34
|
+
isAutoincrement: false;
|
|
35
|
+
hasRuntimeDefault: true;
|
|
36
|
+
enumValues: [string, ...string[]];
|
|
37
|
+
baseColumn: never;
|
|
38
|
+
identity: undefined;
|
|
39
|
+
generated: undefined;
|
|
40
|
+
}, {}, {}>;
|
|
41
|
+
workflowName: import("drizzle-orm/pg-core").PgColumn<{
|
|
42
|
+
name: "workflow_name";
|
|
43
|
+
tableName: "workflow_runs";
|
|
44
|
+
dataType: "string";
|
|
45
|
+
columnType: "PgText";
|
|
46
|
+
data: string;
|
|
47
|
+
driverParam: string;
|
|
48
|
+
notNull: true;
|
|
49
|
+
hasDefault: false;
|
|
50
|
+
isPrimaryKey: false;
|
|
51
|
+
isAutoincrement: false;
|
|
52
|
+
hasRuntimeDefault: false;
|
|
53
|
+
enumValues: [string, ...string[]];
|
|
54
|
+
baseColumn: never;
|
|
55
|
+
identity: undefined;
|
|
56
|
+
generated: undefined;
|
|
57
|
+
}, {}, {}>;
|
|
58
|
+
trigger: import("drizzle-orm/pg-core").PgColumn<{
|
|
59
|
+
name: "trigger";
|
|
60
|
+
tableName: "workflow_runs";
|
|
61
|
+
dataType: "string";
|
|
62
|
+
columnType: "PgText";
|
|
63
|
+
data: string;
|
|
64
|
+
driverParam: string;
|
|
65
|
+
notNull: true;
|
|
66
|
+
hasDefault: true;
|
|
67
|
+
isPrimaryKey: false;
|
|
68
|
+
isAutoincrement: false;
|
|
69
|
+
hasRuntimeDefault: false;
|
|
70
|
+
enumValues: [string, ...string[]];
|
|
71
|
+
baseColumn: never;
|
|
72
|
+
identity: undefined;
|
|
73
|
+
generated: undefined;
|
|
74
|
+
}, {}, {}>;
|
|
75
|
+
correlationId: import("drizzle-orm/pg-core").PgColumn<{
|
|
76
|
+
name: "correlation_id";
|
|
77
|
+
tableName: "workflow_runs";
|
|
78
|
+
dataType: "string";
|
|
79
|
+
columnType: "PgText";
|
|
80
|
+
data: string;
|
|
81
|
+
driverParam: string;
|
|
82
|
+
notNull: false;
|
|
83
|
+
hasDefault: false;
|
|
84
|
+
isPrimaryKey: false;
|
|
85
|
+
isAutoincrement: false;
|
|
86
|
+
hasRuntimeDefault: false;
|
|
87
|
+
enumValues: [string, ...string[]];
|
|
88
|
+
baseColumn: never;
|
|
89
|
+
identity: undefined;
|
|
90
|
+
generated: undefined;
|
|
91
|
+
}, {}, {}>;
|
|
92
|
+
tags: import("drizzle-orm/pg-core").PgColumn<{
|
|
93
|
+
name: "tags";
|
|
94
|
+
tableName: "workflow_runs";
|
|
95
|
+
dataType: "json";
|
|
96
|
+
columnType: "PgJsonb";
|
|
97
|
+
data: string[];
|
|
98
|
+
driverParam: unknown;
|
|
99
|
+
notNull: true;
|
|
100
|
+
hasDefault: true;
|
|
101
|
+
isPrimaryKey: false;
|
|
102
|
+
isAutoincrement: false;
|
|
103
|
+
hasRuntimeDefault: false;
|
|
104
|
+
enumValues: undefined;
|
|
105
|
+
baseColumn: never;
|
|
106
|
+
identity: undefined;
|
|
107
|
+
generated: undefined;
|
|
108
|
+
}, {}, {
|
|
109
|
+
$type: string[];
|
|
110
|
+
}>;
|
|
111
|
+
status: import("drizzle-orm/pg-core").PgColumn<{
|
|
112
|
+
name: "status";
|
|
113
|
+
tableName: "workflow_runs";
|
|
114
|
+
dataType: "string";
|
|
115
|
+
columnType: "PgEnumColumn";
|
|
116
|
+
data: "running" | "succeeded" | "failed" | "cancelled";
|
|
117
|
+
driverParam: string;
|
|
118
|
+
notNull: true;
|
|
119
|
+
hasDefault: true;
|
|
120
|
+
isPrimaryKey: false;
|
|
121
|
+
isAutoincrement: false;
|
|
122
|
+
hasRuntimeDefault: false;
|
|
123
|
+
enumValues: ["running", "succeeded", "failed", "cancelled"];
|
|
124
|
+
baseColumn: never;
|
|
125
|
+
identity: undefined;
|
|
126
|
+
generated: undefined;
|
|
127
|
+
}, {}, {}>;
|
|
128
|
+
input: import("drizzle-orm/pg-core").PgColumn<{
|
|
129
|
+
name: "input";
|
|
130
|
+
tableName: "workflow_runs";
|
|
131
|
+
dataType: "json";
|
|
132
|
+
columnType: "PgJsonb";
|
|
133
|
+
data: Record<string, unknown> | null;
|
|
134
|
+
driverParam: unknown;
|
|
135
|
+
notNull: false;
|
|
136
|
+
hasDefault: false;
|
|
137
|
+
isPrimaryKey: false;
|
|
138
|
+
isAutoincrement: false;
|
|
139
|
+
hasRuntimeDefault: false;
|
|
140
|
+
enumValues: undefined;
|
|
141
|
+
baseColumn: never;
|
|
142
|
+
identity: undefined;
|
|
143
|
+
generated: undefined;
|
|
144
|
+
}, {}, {
|
|
145
|
+
$type: Record<string, unknown> | null;
|
|
146
|
+
}>;
|
|
147
|
+
result: import("drizzle-orm/pg-core").PgColumn<{
|
|
148
|
+
name: "result";
|
|
149
|
+
tableName: "workflow_runs";
|
|
150
|
+
dataType: "json";
|
|
151
|
+
columnType: "PgJsonb";
|
|
152
|
+
data: Record<string, unknown> | null;
|
|
153
|
+
driverParam: unknown;
|
|
154
|
+
notNull: false;
|
|
155
|
+
hasDefault: false;
|
|
156
|
+
isPrimaryKey: false;
|
|
157
|
+
isAutoincrement: false;
|
|
158
|
+
hasRuntimeDefault: false;
|
|
159
|
+
enumValues: undefined;
|
|
160
|
+
baseColumn: never;
|
|
161
|
+
identity: undefined;
|
|
162
|
+
generated: undefined;
|
|
163
|
+
}, {}, {
|
|
164
|
+
$type: Record<string, unknown> | null;
|
|
165
|
+
}>;
|
|
166
|
+
error: import("drizzle-orm/pg-core").PgColumn<{
|
|
167
|
+
name: "error";
|
|
168
|
+
tableName: "workflow_runs";
|
|
169
|
+
dataType: "json";
|
|
170
|
+
columnType: "PgJsonb";
|
|
171
|
+
data: WorkflowRunErrorPayload | null;
|
|
172
|
+
driverParam: unknown;
|
|
173
|
+
notNull: false;
|
|
174
|
+
hasDefault: false;
|
|
175
|
+
isPrimaryKey: false;
|
|
176
|
+
isAutoincrement: false;
|
|
177
|
+
hasRuntimeDefault: false;
|
|
178
|
+
enumValues: undefined;
|
|
179
|
+
baseColumn: never;
|
|
180
|
+
identity: undefined;
|
|
181
|
+
generated: undefined;
|
|
182
|
+
}, {}, {
|
|
183
|
+
$type: WorkflowRunErrorPayload | null;
|
|
184
|
+
}>;
|
|
185
|
+
parentRunId: import("drizzle-orm/pg-core").PgColumn<{
|
|
186
|
+
name: "parent_run_id";
|
|
187
|
+
tableName: "workflow_runs";
|
|
188
|
+
dataType: "string";
|
|
189
|
+
columnType: "PgText";
|
|
190
|
+
data: string;
|
|
191
|
+
driverParam: string;
|
|
192
|
+
notNull: false;
|
|
193
|
+
hasDefault: false;
|
|
194
|
+
isPrimaryKey: false;
|
|
195
|
+
isAutoincrement: false;
|
|
196
|
+
hasRuntimeDefault: false;
|
|
197
|
+
enumValues: [string, ...string[]];
|
|
198
|
+
baseColumn: never;
|
|
199
|
+
identity: undefined;
|
|
200
|
+
generated: undefined;
|
|
201
|
+
}, {}, {}>;
|
|
202
|
+
triggeredByUserId: import("drizzle-orm/pg-core").PgColumn<{
|
|
203
|
+
name: "triggered_by_user_id";
|
|
204
|
+
tableName: "workflow_runs";
|
|
205
|
+
dataType: "string";
|
|
206
|
+
columnType: "PgText";
|
|
207
|
+
data: string;
|
|
208
|
+
driverParam: string;
|
|
209
|
+
notNull: false;
|
|
210
|
+
hasDefault: false;
|
|
211
|
+
isPrimaryKey: false;
|
|
212
|
+
isAutoincrement: false;
|
|
213
|
+
hasRuntimeDefault: false;
|
|
214
|
+
enumValues: [string, ...string[]];
|
|
215
|
+
baseColumn: never;
|
|
216
|
+
identity: undefined;
|
|
217
|
+
generated: undefined;
|
|
218
|
+
}, {}, {}>;
|
|
219
|
+
resumeFromStep: import("drizzle-orm/pg-core").PgColumn<{
|
|
220
|
+
name: "resume_from_step";
|
|
221
|
+
tableName: "workflow_runs";
|
|
222
|
+
dataType: "string";
|
|
223
|
+
columnType: "PgText";
|
|
224
|
+
data: string;
|
|
225
|
+
driverParam: string;
|
|
226
|
+
notNull: false;
|
|
227
|
+
hasDefault: false;
|
|
228
|
+
isPrimaryKey: false;
|
|
229
|
+
isAutoincrement: false;
|
|
230
|
+
hasRuntimeDefault: false;
|
|
231
|
+
enumValues: [string, ...string[]];
|
|
232
|
+
baseColumn: never;
|
|
233
|
+
identity: undefined;
|
|
234
|
+
generated: undefined;
|
|
235
|
+
}, {}, {}>;
|
|
236
|
+
startedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
237
|
+
name: "started_at";
|
|
238
|
+
tableName: "workflow_runs";
|
|
239
|
+
dataType: "date";
|
|
240
|
+
columnType: "PgTimestamp";
|
|
241
|
+
data: Date;
|
|
242
|
+
driverParam: string;
|
|
243
|
+
notNull: true;
|
|
244
|
+
hasDefault: true;
|
|
245
|
+
isPrimaryKey: false;
|
|
246
|
+
isAutoincrement: false;
|
|
247
|
+
hasRuntimeDefault: false;
|
|
248
|
+
enumValues: undefined;
|
|
249
|
+
baseColumn: never;
|
|
250
|
+
identity: undefined;
|
|
251
|
+
generated: undefined;
|
|
252
|
+
}, {}, {}>;
|
|
253
|
+
completedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
254
|
+
name: "completed_at";
|
|
255
|
+
tableName: "workflow_runs";
|
|
256
|
+
dataType: "date";
|
|
257
|
+
columnType: "PgTimestamp";
|
|
258
|
+
data: Date;
|
|
259
|
+
driverParam: string;
|
|
260
|
+
notNull: false;
|
|
261
|
+
hasDefault: false;
|
|
262
|
+
isPrimaryKey: false;
|
|
263
|
+
isAutoincrement: false;
|
|
264
|
+
hasRuntimeDefault: false;
|
|
265
|
+
enumValues: undefined;
|
|
266
|
+
baseColumn: never;
|
|
267
|
+
identity: undefined;
|
|
268
|
+
generated: undefined;
|
|
269
|
+
}, {}, {}>;
|
|
270
|
+
durationMs: import("drizzle-orm/pg-core").PgColumn<{
|
|
271
|
+
name: "duration_ms";
|
|
272
|
+
tableName: "workflow_runs";
|
|
273
|
+
dataType: "number";
|
|
274
|
+
columnType: "PgInteger";
|
|
275
|
+
data: number;
|
|
276
|
+
driverParam: string | number;
|
|
277
|
+
notNull: false;
|
|
278
|
+
hasDefault: false;
|
|
279
|
+
isPrimaryKey: false;
|
|
280
|
+
isAutoincrement: false;
|
|
281
|
+
hasRuntimeDefault: false;
|
|
282
|
+
enumValues: undefined;
|
|
283
|
+
baseColumn: never;
|
|
284
|
+
identity: undefined;
|
|
285
|
+
generated: undefined;
|
|
286
|
+
}, {}, {}>;
|
|
287
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
288
|
+
name: "created_at";
|
|
289
|
+
tableName: "workflow_runs";
|
|
290
|
+
dataType: "date";
|
|
291
|
+
columnType: "PgTimestamp";
|
|
292
|
+
data: Date;
|
|
293
|
+
driverParam: string;
|
|
294
|
+
notNull: true;
|
|
295
|
+
hasDefault: true;
|
|
296
|
+
isPrimaryKey: false;
|
|
297
|
+
isAutoincrement: false;
|
|
298
|
+
hasRuntimeDefault: false;
|
|
299
|
+
enumValues: undefined;
|
|
300
|
+
baseColumn: never;
|
|
301
|
+
identity: undefined;
|
|
302
|
+
generated: undefined;
|
|
303
|
+
}, {}, {}>;
|
|
304
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
305
|
+
name: "updated_at";
|
|
306
|
+
tableName: "workflow_runs";
|
|
307
|
+
dataType: "date";
|
|
308
|
+
columnType: "PgTimestamp";
|
|
309
|
+
data: Date;
|
|
310
|
+
driverParam: string;
|
|
311
|
+
notNull: true;
|
|
312
|
+
hasDefault: true;
|
|
313
|
+
isPrimaryKey: false;
|
|
314
|
+
isAutoincrement: false;
|
|
315
|
+
hasRuntimeDefault: false;
|
|
316
|
+
enumValues: undefined;
|
|
317
|
+
baseColumn: never;
|
|
318
|
+
identity: undefined;
|
|
319
|
+
generated: undefined;
|
|
320
|
+
}, {}, {}>;
|
|
321
|
+
};
|
|
322
|
+
dialect: "pg";
|
|
323
|
+
}>;
|
|
324
|
+
export declare const workflowRunSteps: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
325
|
+
name: "workflow_run_steps";
|
|
326
|
+
schema: undefined;
|
|
327
|
+
columns: {
|
|
328
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
329
|
+
name: string;
|
|
330
|
+
tableName: "workflow_run_steps";
|
|
331
|
+
dataType: "string";
|
|
332
|
+
columnType: "PgText";
|
|
333
|
+
data: string;
|
|
334
|
+
driverParam: string;
|
|
335
|
+
notNull: true;
|
|
336
|
+
hasDefault: true;
|
|
337
|
+
isPrimaryKey: true;
|
|
338
|
+
isAutoincrement: false;
|
|
339
|
+
hasRuntimeDefault: true;
|
|
340
|
+
enumValues: [string, ...string[]];
|
|
341
|
+
baseColumn: never;
|
|
342
|
+
identity: undefined;
|
|
343
|
+
generated: undefined;
|
|
344
|
+
}, {}, {}>;
|
|
345
|
+
runId: import("drizzle-orm/pg-core").PgColumn<{
|
|
346
|
+
name: string;
|
|
347
|
+
tableName: "workflow_run_steps";
|
|
348
|
+
dataType: "string";
|
|
349
|
+
columnType: "PgText";
|
|
350
|
+
data: string;
|
|
351
|
+
driverParam: string;
|
|
352
|
+
notNull: true;
|
|
353
|
+
hasDefault: false;
|
|
354
|
+
isPrimaryKey: false;
|
|
355
|
+
isAutoincrement: false;
|
|
356
|
+
hasRuntimeDefault: false;
|
|
357
|
+
enumValues: [string, ...string[]];
|
|
358
|
+
baseColumn: never;
|
|
359
|
+
identity: undefined;
|
|
360
|
+
generated: undefined;
|
|
361
|
+
}, {}, {}>;
|
|
362
|
+
stepName: import("drizzle-orm/pg-core").PgColumn<{
|
|
363
|
+
name: "step_name";
|
|
364
|
+
tableName: "workflow_run_steps";
|
|
365
|
+
dataType: "string";
|
|
366
|
+
columnType: "PgText";
|
|
367
|
+
data: string;
|
|
368
|
+
driverParam: string;
|
|
369
|
+
notNull: true;
|
|
370
|
+
hasDefault: false;
|
|
371
|
+
isPrimaryKey: false;
|
|
372
|
+
isAutoincrement: false;
|
|
373
|
+
hasRuntimeDefault: false;
|
|
374
|
+
enumValues: [string, ...string[]];
|
|
375
|
+
baseColumn: never;
|
|
376
|
+
identity: undefined;
|
|
377
|
+
generated: undefined;
|
|
378
|
+
}, {}, {}>;
|
|
379
|
+
sequence: import("drizzle-orm/pg-core").PgColumn<{
|
|
380
|
+
name: "sequence";
|
|
381
|
+
tableName: "workflow_run_steps";
|
|
382
|
+
dataType: "number";
|
|
383
|
+
columnType: "PgInteger";
|
|
384
|
+
data: number;
|
|
385
|
+
driverParam: string | number;
|
|
386
|
+
notNull: true;
|
|
387
|
+
hasDefault: false;
|
|
388
|
+
isPrimaryKey: false;
|
|
389
|
+
isAutoincrement: false;
|
|
390
|
+
hasRuntimeDefault: false;
|
|
391
|
+
enumValues: undefined;
|
|
392
|
+
baseColumn: never;
|
|
393
|
+
identity: undefined;
|
|
394
|
+
generated: undefined;
|
|
395
|
+
}, {}, {}>;
|
|
396
|
+
status: import("drizzle-orm/pg-core").PgColumn<{
|
|
397
|
+
name: "status";
|
|
398
|
+
tableName: "workflow_run_steps";
|
|
399
|
+
dataType: "string";
|
|
400
|
+
columnType: "PgEnumColumn";
|
|
401
|
+
data: "running" | "succeeded" | "failed" | "skipped" | "compensated";
|
|
402
|
+
driverParam: string;
|
|
403
|
+
notNull: true;
|
|
404
|
+
hasDefault: true;
|
|
405
|
+
isPrimaryKey: false;
|
|
406
|
+
isAutoincrement: false;
|
|
407
|
+
hasRuntimeDefault: false;
|
|
408
|
+
enumValues: ["running", "succeeded", "failed", "skipped", "compensated"];
|
|
409
|
+
baseColumn: never;
|
|
410
|
+
identity: undefined;
|
|
411
|
+
generated: undefined;
|
|
412
|
+
}, {}, {}>;
|
|
413
|
+
output: import("drizzle-orm/pg-core").PgColumn<{
|
|
414
|
+
name: "output";
|
|
415
|
+
tableName: "workflow_run_steps";
|
|
416
|
+
dataType: "json";
|
|
417
|
+
columnType: "PgJsonb";
|
|
418
|
+
data: Record<string, unknown> | null;
|
|
419
|
+
driverParam: unknown;
|
|
420
|
+
notNull: false;
|
|
421
|
+
hasDefault: false;
|
|
422
|
+
isPrimaryKey: false;
|
|
423
|
+
isAutoincrement: false;
|
|
424
|
+
hasRuntimeDefault: false;
|
|
425
|
+
enumValues: undefined;
|
|
426
|
+
baseColumn: never;
|
|
427
|
+
identity: undefined;
|
|
428
|
+
generated: undefined;
|
|
429
|
+
}, {}, {
|
|
430
|
+
$type: Record<string, unknown> | null;
|
|
431
|
+
}>;
|
|
432
|
+
error: import("drizzle-orm/pg-core").PgColumn<{
|
|
433
|
+
name: "error";
|
|
434
|
+
tableName: "workflow_run_steps";
|
|
435
|
+
dataType: "json";
|
|
436
|
+
columnType: "PgJsonb";
|
|
437
|
+
data: WorkflowRunErrorPayload | null;
|
|
438
|
+
driverParam: unknown;
|
|
439
|
+
notNull: false;
|
|
440
|
+
hasDefault: false;
|
|
441
|
+
isPrimaryKey: false;
|
|
442
|
+
isAutoincrement: false;
|
|
443
|
+
hasRuntimeDefault: false;
|
|
444
|
+
enumValues: undefined;
|
|
445
|
+
baseColumn: never;
|
|
446
|
+
identity: undefined;
|
|
447
|
+
generated: undefined;
|
|
448
|
+
}, {}, {
|
|
449
|
+
$type: WorkflowRunErrorPayload | null;
|
|
450
|
+
}>;
|
|
451
|
+
startedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
452
|
+
name: "started_at";
|
|
453
|
+
tableName: "workflow_run_steps";
|
|
454
|
+
dataType: "date";
|
|
455
|
+
columnType: "PgTimestamp";
|
|
456
|
+
data: Date;
|
|
457
|
+
driverParam: string;
|
|
458
|
+
notNull: true;
|
|
459
|
+
hasDefault: true;
|
|
460
|
+
isPrimaryKey: false;
|
|
461
|
+
isAutoincrement: false;
|
|
462
|
+
hasRuntimeDefault: false;
|
|
463
|
+
enumValues: undefined;
|
|
464
|
+
baseColumn: never;
|
|
465
|
+
identity: undefined;
|
|
466
|
+
generated: undefined;
|
|
467
|
+
}, {}, {}>;
|
|
468
|
+
completedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
469
|
+
name: "completed_at";
|
|
470
|
+
tableName: "workflow_run_steps";
|
|
471
|
+
dataType: "date";
|
|
472
|
+
columnType: "PgTimestamp";
|
|
473
|
+
data: Date;
|
|
474
|
+
driverParam: string;
|
|
475
|
+
notNull: false;
|
|
476
|
+
hasDefault: false;
|
|
477
|
+
isPrimaryKey: false;
|
|
478
|
+
isAutoincrement: false;
|
|
479
|
+
hasRuntimeDefault: false;
|
|
480
|
+
enumValues: undefined;
|
|
481
|
+
baseColumn: never;
|
|
482
|
+
identity: undefined;
|
|
483
|
+
generated: undefined;
|
|
484
|
+
}, {}, {}>;
|
|
485
|
+
durationMs: import("drizzle-orm/pg-core").PgColumn<{
|
|
486
|
+
name: "duration_ms";
|
|
487
|
+
tableName: "workflow_run_steps";
|
|
488
|
+
dataType: "number";
|
|
489
|
+
columnType: "PgInteger";
|
|
490
|
+
data: number;
|
|
491
|
+
driverParam: string | number;
|
|
492
|
+
notNull: false;
|
|
493
|
+
hasDefault: false;
|
|
494
|
+
isPrimaryKey: false;
|
|
495
|
+
isAutoincrement: false;
|
|
496
|
+
hasRuntimeDefault: false;
|
|
497
|
+
enumValues: undefined;
|
|
498
|
+
baseColumn: never;
|
|
499
|
+
identity: undefined;
|
|
500
|
+
generated: undefined;
|
|
501
|
+
}, {}, {}>;
|
|
502
|
+
};
|
|
503
|
+
dialect: "pg";
|
|
504
|
+
}>;
|
|
505
|
+
export interface WorkflowRunErrorPayload {
|
|
506
|
+
message: string;
|
|
507
|
+
code?: string;
|
|
508
|
+
stepName?: string;
|
|
509
|
+
stack?: string;
|
|
510
|
+
}
|
|
511
|
+
export type WorkflowRun = typeof workflowRuns.$inferSelect;
|
|
512
|
+
export type NewWorkflowRun = typeof workflowRuns.$inferInsert;
|
|
513
|
+
export type WorkflowRunStep = typeof workflowRunSteps.$inferSelect;
|
|
514
|
+
export type NewWorkflowRunStep = typeof workflowRunSteps.$inferInsert;
|
|
515
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,eAAO,MAAM,qBAAqB,uFAKhC,CAAA;AAEF,eAAO,MAAM,yBAAyB,oGAMpC,CAAA;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmDxB,CAAA;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqB5B,CAAA;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,WAAW,GAAG,OAAO,YAAY,CAAC,YAAY,CAAA;AAC1D,MAAM,MAAM,cAAc,GAAG,OAAO,YAAY,CAAC,YAAY,CAAA;AAC7D,MAAM,MAAM,eAAe,GAAG,OAAO,gBAAgB,CAAC,YAAY,CAAA;AAClE,MAAM,MAAM,kBAAkB,GAAG,OAAO,gBAAgB,CAAC,YAAY,CAAA"}
|