@hazeljs/flow 0.2.0-alpha.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.
Files changed (117) hide show
  1. package/LICENSE +192 -0
  2. package/README.md +111 -0
  3. package/dist/decorators/flow.decorators.d.ts +32 -0
  4. package/dist/decorators/flow.decorators.d.ts.map +1 -0
  5. package/dist/decorators/flow.decorators.js +100 -0
  6. package/dist/dsl/flow.d.ts +19 -0
  7. package/dist/dsl/flow.d.ts.map +1 -0
  8. package/dist/dsl/flow.js +46 -0
  9. package/dist/dsl/types.d.ts +5 -0
  10. package/dist/dsl/types.d.ts.map +1 -0
  11. package/dist/dsl/types.js +2 -0
  12. package/dist/engine/Executor.d.ts +11 -0
  13. package/dist/engine/Executor.d.ts.map +1 -0
  14. package/dist/engine/Executor.js +113 -0
  15. package/dist/engine/FlowEngine.d.ts +46 -0
  16. package/dist/engine/FlowEngine.d.ts.map +1 -0
  17. package/dist/engine/FlowEngine.js +237 -0
  18. package/dist/engine/Idempotency.d.ts +10 -0
  19. package/dist/engine/Idempotency.d.ts.map +1 -0
  20. package/dist/engine/Idempotency.js +16 -0
  21. package/dist/engine/Locks.d.ts +11 -0
  22. package/dist/engine/Locks.d.ts.map +1 -0
  23. package/dist/engine/Locks.js +68 -0
  24. package/dist/engine/Retry.d.ts +7 -0
  25. package/dist/engine/Retry.d.ts.map +1 -0
  26. package/dist/engine/Retry.js +22 -0
  27. package/dist/engine/Timeout.d.ts +10 -0
  28. package/dist/engine/Timeout.d.ts.map +1 -0
  29. package/dist/engine/Timeout.js +25 -0
  30. package/dist/engine/Transition.d.ts +6 -0
  31. package/dist/engine/Transition.d.ts.map +1 -0
  32. package/dist/engine/Transition.js +19 -0
  33. package/dist/engine/utils.d.ts +5 -0
  34. package/dist/engine/utils.d.ts.map +1 -0
  35. package/dist/engine/utils.js +25 -0
  36. package/dist/examples/branching.d.ts +2 -0
  37. package/dist/examples/branching.d.ts.map +1 -0
  38. package/dist/examples/branching.js +72 -0
  39. package/dist/examples/simple.d.ts +2 -0
  40. package/dist/examples/simple.d.ts.map +1 -0
  41. package/dist/examples/simple.js +65 -0
  42. package/dist/examples/wait_resume.d.ts +2 -0
  43. package/dist/examples/wait_resume.d.ts.map +1 -0
  44. package/dist/examples/wait_resume.js +75 -0
  45. package/dist/generated/prisma/client.d.ts +1 -0
  46. package/dist/generated/prisma/client.js +5 -0
  47. package/dist/generated/prisma/default.d.ts +1 -0
  48. package/dist/generated/prisma/default.js +5 -0
  49. package/dist/generated/prisma/edge.d.ts +1 -0
  50. package/dist/generated/prisma/edge.js +250 -0
  51. package/dist/generated/prisma/index-browser.js +236 -0
  52. package/dist/generated/prisma/index.d.ts +6577 -0
  53. package/dist/generated/prisma/index.js +271 -0
  54. package/dist/generated/prisma/libquery_engine-debian-openssl-3.0.x.so.node +0 -0
  55. package/dist/generated/prisma/package.json +183 -0
  56. package/dist/generated/prisma/query_engine_bg.js +2 -0
  57. package/dist/generated/prisma/query_engine_bg.wasm +0 -0
  58. package/dist/generated/prisma/runtime/edge-esm.js +35 -0
  59. package/dist/generated/prisma/runtime/edge.js +35 -0
  60. package/dist/generated/prisma/runtime/index-browser.d.ts +370 -0
  61. package/dist/generated/prisma/runtime/index-browser.js +17 -0
  62. package/dist/generated/prisma/runtime/library.d.ts +3982 -0
  63. package/dist/generated/prisma/runtime/library.js +147 -0
  64. package/dist/generated/prisma/runtime/react-native.js +84 -0
  65. package/dist/generated/prisma/runtime/wasm-compiler-edge.js +85 -0
  66. package/dist/generated/prisma/runtime/wasm-engine-edge.js +38 -0
  67. package/dist/generated/prisma/schema.prisma +70 -0
  68. package/dist/generated/prisma/wasm-edge-light-loader.mjs +5 -0
  69. package/dist/generated/prisma/wasm-worker-loader.mjs +5 -0
  70. package/dist/generated/prisma/wasm.d.ts +1 -0
  71. package/dist/generated/prisma/wasm.js +257 -0
  72. package/dist/index.d.ts +14 -0
  73. package/dist/index.d.ts.map +1 -0
  74. package/dist/index.js +25 -0
  75. package/dist/persistence/FlowDefinitionRepo.d.ts +14 -0
  76. package/dist/persistence/FlowDefinitionRepo.d.ts.map +1 -0
  77. package/dist/persistence/FlowDefinitionRepo.js +44 -0
  78. package/dist/persistence/FlowEventRepo.d.ts +15 -0
  79. package/dist/persistence/FlowEventRepo.d.ts.map +1 -0
  80. package/dist/persistence/FlowEventRepo.js +33 -0
  81. package/dist/persistence/FlowRunRepo.d.ts +12 -0
  82. package/dist/persistence/FlowRunRepo.d.ts.map +1 -0
  83. package/dist/persistence/FlowRunRepo.js +50 -0
  84. package/dist/persistence/IdempotencyRepo.d.ts +15 -0
  85. package/dist/persistence/IdempotencyRepo.d.ts.map +1 -0
  86. package/dist/persistence/IdempotencyRepo.js +39 -0
  87. package/dist/persistence/memory.d.ts +9 -0
  88. package/dist/persistence/memory.d.ts.map +1 -0
  89. package/dist/persistence/memory.js +154 -0
  90. package/dist/persistence/prisma.d.ts +5 -0
  91. package/dist/persistence/prisma.d.ts.map +1 -0
  92. package/dist/persistence/prisma.js +9 -0
  93. package/dist/persistence/prismaClient.d.ts +21 -0
  94. package/dist/persistence/prismaClient.d.ts.map +1 -0
  95. package/dist/persistence/prismaClient.js +47 -0
  96. package/dist/persistence/prismaStorage.d.ts +11 -0
  97. package/dist/persistence/prismaStorage.d.ts.map +1 -0
  98. package/dist/persistence/prismaStorage.js +24 -0
  99. package/dist/persistence/serialize.d.ts +6 -0
  100. package/dist/persistence/serialize.d.ts.map +1 -0
  101. package/dist/persistence/serialize.js +28 -0
  102. package/dist/persistence/storage.d.ts +75 -0
  103. package/dist/persistence/storage.d.ts.map +1 -0
  104. package/dist/persistence/storage.js +6 -0
  105. package/dist/prisma.d.ts +14 -0
  106. package/dist/prisma.d.ts.map +1 -0
  107. package/dist/prisma.js +25 -0
  108. package/dist/types/Errors.d.ts +21 -0
  109. package/dist/types/Errors.d.ts.map +1 -0
  110. package/dist/types/Errors.js +44 -0
  111. package/dist/types/Events.d.ts +17 -0
  112. package/dist/types/Events.d.ts.map +1 -0
  113. package/dist/types/Events.js +5 -0
  114. package/dist/types/FlowTypes.d.ts +66 -0
  115. package/dist/types/FlowTypes.d.ts.map +1 -0
  116. package/dist/types/FlowTypes.js +5 -0
  117. package/package.json +72 -0
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ /**
13
+ * Simple linear flow example (decorator-based)
14
+ * Run with: npm run example:simple (or: npm run build && node dist/examples/simple.js)
15
+ */
16
+ const index_js_1 = require("../index.js");
17
+ let SimpleFlow = class SimpleFlow {
18
+ async a(ctx) {
19
+ const input = ctx.input;
20
+ return { status: 'ok', output: { value: input + 1 }, patch: { step: 'a' } };
21
+ }
22
+ async b(ctx) {
23
+ return { status: 'ok', output: { value: ctx.state.step + '-done' } };
24
+ }
25
+ };
26
+ __decorate([
27
+ (0, index_js_1.Entry)(),
28
+ (0, index_js_1.Node)('a'),
29
+ (0, index_js_1.Edge)('b'),
30
+ __metadata("design:type", Function),
31
+ __metadata("design:paramtypes", [Object]),
32
+ __metadata("design:returntype", Promise)
33
+ ], SimpleFlow.prototype, "a", null);
34
+ __decorate([
35
+ (0, index_js_1.Node)('b'),
36
+ __metadata("design:type", Function),
37
+ __metadata("design:paramtypes", [Object]),
38
+ __metadata("design:returntype", Promise)
39
+ ], SimpleFlow.prototype, "b", null);
40
+ SimpleFlow = __decorate([
41
+ (0, index_js_1.Flow)('simple-flow', '1.0.0')
42
+ ], SimpleFlow);
43
+ async function main() {
44
+ const engine = new index_js_1.FlowEngine();
45
+ const def = (0, index_js_1.buildFlowDefinition)(SimpleFlow);
46
+ await engine.registerDefinition(def);
47
+ const { runId } = await engine.startRun({
48
+ flowId: 'simple-flow',
49
+ version: '1.0.0',
50
+ input: 42,
51
+ });
52
+ let run = await engine.getRun(runId);
53
+ while (run?.status === 'RUNNING') {
54
+ run = await engine.tick(runId);
55
+ }
56
+ const timeline = await engine.getTimeline(runId);
57
+ // eslint-disable-next-line no-console
58
+ console.log('Run:', run);
59
+ // eslint-disable-next-line no-console
60
+ console.log('Timeline:', JSON.stringify(timeline, null, 2));
61
+ }
62
+ main().catch((err) => {
63
+ // eslint-disable-next-line no-console
64
+ console.error(err);
65
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=wait_resume.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wait_resume.d.ts","sourceRoot":"","sources":["../../src/examples/wait_resume.ts"],"names":[],"mappings":""}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ /**
13
+ * Wait/resume flow example (decorator-based)
14
+ * Node returns WAIT, then we resume with payload
15
+ * Run with: npm run example:wait_resume (or: npm run build && node dist/examples/wait_resume.js)
16
+ */
17
+ const index_js_1 = require("../index.js");
18
+ let WaitResumeFlow = class WaitResumeFlow {
19
+ async request(ctx) {
20
+ if (ctx.state._resumePayload) {
21
+ const payload = ctx.state._resumePayload;
22
+ return { status: 'ok', output: payload, patch: { approved: payload.approved } };
23
+ }
24
+ return { status: 'wait', reason: 'awaiting_approval', until: 'manual' };
25
+ }
26
+ async complete(ctx) {
27
+ return {
28
+ status: 'ok',
29
+ output: { final: ctx.outputs.request },
30
+ };
31
+ }
32
+ };
33
+ __decorate([
34
+ (0, index_js_1.Entry)(),
35
+ (0, index_js_1.Node)('request'),
36
+ (0, index_js_1.Edge)('complete'),
37
+ __metadata("design:type", Function),
38
+ __metadata("design:paramtypes", [Object]),
39
+ __metadata("design:returntype", Promise)
40
+ ], WaitResumeFlow.prototype, "request", null);
41
+ __decorate([
42
+ (0, index_js_1.Node)('complete'),
43
+ __metadata("design:type", Function),
44
+ __metadata("design:paramtypes", [Object]),
45
+ __metadata("design:returntype", Promise)
46
+ ], WaitResumeFlow.prototype, "complete", null);
47
+ WaitResumeFlow = __decorate([
48
+ (0, index_js_1.Flow)('wait-resume-flow', '1.0.0')
49
+ ], WaitResumeFlow);
50
+ async function main() {
51
+ const engine = new index_js_1.FlowEngine();
52
+ const def = (0, index_js_1.buildFlowDefinition)(WaitResumeFlow);
53
+ await engine.registerDefinition(def);
54
+ const { runId } = await engine.startRun({
55
+ flowId: 'wait-resume-flow',
56
+ version: '1.0.0',
57
+ input: {},
58
+ });
59
+ let run = await engine.getRun(runId);
60
+ while (run?.status === 'RUNNING') {
61
+ run = await engine.tick(runId);
62
+ }
63
+ // eslint-disable-next-line no-console
64
+ console.log('After first tick (should be WAITING):', run?.status);
65
+ run = await engine.resumeRun(runId, { approved: true });
66
+ while (run?.status === 'RUNNING') {
67
+ run = await engine.tick(runId);
68
+ }
69
+ // eslint-disable-next-line no-console
70
+ console.log('After resume:', run?.status, run?.outputsJson);
71
+ }
72
+ main().catch((err) => {
73
+ // eslint-disable-next-line no-console
74
+ console.error(err);
75
+ });
@@ -0,0 +1 @@
1
+ export * from "./index"
@@ -0,0 +1,5 @@
1
+
2
+ /* !!! This is code generated by Prisma. Do not edit directly. !!!
3
+ /* eslint-disable */
4
+ // biome-ignore-all lint: generated file
5
+ module.exports = { ...require('.') }
@@ -0,0 +1 @@
1
+ export * from "./index"
@@ -0,0 +1,5 @@
1
+
2
+ /* !!! This is code generated by Prisma. Do not edit directly. !!!
3
+ /* eslint-disable */
4
+ // biome-ignore-all lint: generated file
5
+ module.exports = { ...require('#main-entry-point') }
@@ -0,0 +1 @@
1
+ export * from "./default"
@@ -0,0 +1,250 @@
1
+
2
+ /* !!! This is code generated by Prisma. Do not edit directly. !!!
3
+ /* eslint-disable */
4
+ // biome-ignore-all lint: generated file
5
+
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+
8
+ const {
9
+ PrismaClientKnownRequestError,
10
+ PrismaClientUnknownRequestError,
11
+ PrismaClientRustPanicError,
12
+ PrismaClientInitializationError,
13
+ PrismaClientValidationError,
14
+ getPrismaClient,
15
+ sqltag,
16
+ empty,
17
+ join,
18
+ raw,
19
+ skip,
20
+ Decimal,
21
+ Debug,
22
+ objectEnumValues,
23
+ makeStrictEnum,
24
+ Extensions,
25
+ warnOnce,
26
+ defineDmmfProperty,
27
+ Public,
28
+ getRuntime,
29
+ createParam,
30
+ } = require('./runtime/edge.js')
31
+
32
+
33
+ const Prisma = {}
34
+
35
+ exports.Prisma = Prisma
36
+ exports.$Enums = {}
37
+
38
+ /**
39
+ * Prisma Client JS version: 6.19.2
40
+ * Query Engine version: c2990dca591cba766e3b7ef5d9e8a84796e47ab7
41
+ */
42
+ Prisma.prismaVersion = {
43
+ client: "6.19.2",
44
+ engine: "c2990dca591cba766e3b7ef5d9e8a84796e47ab7"
45
+ }
46
+
47
+ Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError;
48
+ Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError
49
+ Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError
50
+ Prisma.PrismaClientInitializationError = PrismaClientInitializationError
51
+ Prisma.PrismaClientValidationError = PrismaClientValidationError
52
+ Prisma.Decimal = Decimal
53
+
54
+ /**
55
+ * Re-export of sql-template-tag
56
+ */
57
+ Prisma.sql = sqltag
58
+ Prisma.empty = empty
59
+ Prisma.join = join
60
+ Prisma.raw = raw
61
+ Prisma.validator = Public.validator
62
+
63
+ /**
64
+ * Extensions
65
+ */
66
+ Prisma.getExtensionContext = Extensions.getExtensionContext
67
+ Prisma.defineExtension = Extensions.defineExtension
68
+
69
+ /**
70
+ * Shorthand utilities for JSON filtering
71
+ */
72
+ Prisma.DbNull = objectEnumValues.instances.DbNull
73
+ Prisma.JsonNull = objectEnumValues.instances.JsonNull
74
+ Prisma.AnyNull = objectEnumValues.instances.AnyNull
75
+
76
+ Prisma.NullTypes = {
77
+ DbNull: objectEnumValues.classes.DbNull,
78
+ JsonNull: objectEnumValues.classes.JsonNull,
79
+ AnyNull: objectEnumValues.classes.AnyNull
80
+ }
81
+
82
+
83
+
84
+
85
+
86
+ /**
87
+ * Enums
88
+ */
89
+ exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
90
+ ReadUncommitted: 'ReadUncommitted',
91
+ ReadCommitted: 'ReadCommitted',
92
+ RepeatableRead: 'RepeatableRead',
93
+ Serializable: 'Serializable'
94
+ });
95
+
96
+ exports.Prisma.FlowDefinitionScalarFieldEnum = {
97
+ flowId: 'flowId',
98
+ version: 'version',
99
+ definitionJson: 'definitionJson',
100
+ createdAt: 'createdAt'
101
+ };
102
+
103
+ exports.Prisma.FlowRunScalarFieldEnum = {
104
+ runId: 'runId',
105
+ flowId: 'flowId',
106
+ flowVersion: 'flowVersion',
107
+ tenantId: 'tenantId',
108
+ status: 'status',
109
+ currentNodeId: 'currentNodeId',
110
+ inputJson: 'inputJson',
111
+ stateJson: 'stateJson',
112
+ outputsJson: 'outputsJson',
113
+ createdAt: 'createdAt',
114
+ updatedAt: 'updatedAt'
115
+ };
116
+
117
+ exports.Prisma.FlowRunEventScalarFieldEnum = {
118
+ id: 'id',
119
+ runId: 'runId',
120
+ at: 'at',
121
+ type: 'type',
122
+ nodeId: 'nodeId',
123
+ attempt: 'attempt',
124
+ payloadJson: 'payloadJson'
125
+ };
126
+
127
+ exports.Prisma.FlowIdempotencyScalarFieldEnum = {
128
+ key: 'key',
129
+ runId: 'runId',
130
+ nodeId: 'nodeId',
131
+ outputJson: 'outputJson',
132
+ patchJson: 'patchJson',
133
+ createdAt: 'createdAt'
134
+ };
135
+
136
+ exports.Prisma.SortOrder = {
137
+ asc: 'asc',
138
+ desc: 'desc'
139
+ };
140
+
141
+ exports.Prisma.JsonNullValueInput = {
142
+ JsonNull: Prisma.JsonNull
143
+ };
144
+
145
+ exports.Prisma.NullableJsonNullValueInput = {
146
+ DbNull: Prisma.DbNull,
147
+ JsonNull: Prisma.JsonNull
148
+ };
149
+
150
+ exports.Prisma.QueryMode = {
151
+ default: 'default',
152
+ insensitive: 'insensitive'
153
+ };
154
+
155
+ exports.Prisma.JsonNullValueFilter = {
156
+ DbNull: Prisma.DbNull,
157
+ JsonNull: Prisma.JsonNull,
158
+ AnyNull: Prisma.AnyNull
159
+ };
160
+
161
+ exports.Prisma.NullsOrder = {
162
+ first: 'first',
163
+ last: 'last'
164
+ };
165
+ exports.FlowRunStatus = exports.$Enums.FlowRunStatus = {
166
+ RUNNING: 'RUNNING',
167
+ WAITING: 'WAITING',
168
+ COMPLETED: 'COMPLETED',
169
+ FAILED: 'FAILED'
170
+ };
171
+
172
+ exports.Prisma.ModelName = {
173
+ FlowDefinition: 'FlowDefinition',
174
+ FlowRun: 'FlowRun',
175
+ FlowRunEvent: 'FlowRunEvent',
176
+ FlowIdempotency: 'FlowIdempotency'
177
+ };
178
+ /**
179
+ * Create the Client
180
+ */
181
+ const config = {
182
+ "generator": {
183
+ "name": "client",
184
+ "provider": {
185
+ "fromEnvVar": null,
186
+ "value": "prisma-client-js"
187
+ },
188
+ "output": {
189
+ "value": "/home/runner/work/hazeljs/hazeljs/packages/flow/src/generated/prisma",
190
+ "fromEnvVar": null
191
+ },
192
+ "config": {
193
+ "engineType": "library"
194
+ },
195
+ "binaryTargets": [
196
+ {
197
+ "fromEnvVar": null,
198
+ "value": "debian-openssl-3.0.x",
199
+ "native": true
200
+ }
201
+ ],
202
+ "previewFeatures": [],
203
+ "sourceFilePath": "/home/runner/work/hazeljs/hazeljs/packages/flow/prisma/schema.prisma",
204
+ "isCustomOutput": true
205
+ },
206
+ "relativeEnvPaths": {
207
+ "rootEnvPath": null
208
+ },
209
+ "relativePath": "../../../prisma",
210
+ "clientVersion": "6.19.2",
211
+ "engineVersion": "c2990dca591cba766e3b7ef5d9e8a84796e47ab7",
212
+ "datasourceNames": [
213
+ "db"
214
+ ],
215
+ "activeProvider": "postgresql",
216
+ "postinstall": false,
217
+ "ciName": "GitHub Actions",
218
+ "inlineDatasources": {
219
+ "db": {
220
+ "url": {
221
+ "fromEnvVar": "DATABASE_URL",
222
+ "value": null
223
+ }
224
+ }
225
+ },
226
+ "inlineSchema": "// @hazeljs/flow - Flow engine Prisma schema\n// Uses its own database/schema - independent of Hazel core\n\ngenerator client {\n provider = \"prisma-client-js\"\n output = \"../src/generated/prisma\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\nmodel FlowDefinition {\n flowId String\n version String\n definitionJson Json\n createdAt DateTime @default(now())\n\n @@id([flowId, version])\n}\n\nenum FlowRunStatus {\n RUNNING\n WAITING\n COMPLETED\n FAILED\n}\n\nmodel FlowRun {\n runId String @id @default(uuid())\n flowId String\n flowVersion String\n tenantId String?\n status FlowRunStatus\n currentNodeId String?\n inputJson Json\n stateJson Json\n outputsJson Json\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([flowId, flowVersion])\n @@index([tenantId])\n @@index([status])\n}\n\nmodel FlowRunEvent {\n id String @id @default(uuid())\n runId String\n at DateTime @default(now())\n type String\n nodeId String?\n attempt Int?\n payloadJson Json\n\n @@index([runId])\n @@index([runId, at])\n}\n\nmodel FlowIdempotency {\n key String @id\n runId String\n nodeId String\n outputJson Json?\n patchJson Json?\n createdAt DateTime @default(now())\n\n @@index([runId])\n}\n",
227
+ "inlineSchemaHash": "4fac31978e869618c9606b5e6e4a3f3b2b61de867e68f57dd91ec56b009f7e5f",
228
+ "copyEngine": true
229
+ }
230
+ config.dirname = '/'
231
+
232
+ config.runtimeDataModel = JSON.parse("{\"models\":{\"FlowDefinition\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"flowId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"version\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"definitionJson\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":{\"name\":null,\"fields\":[\"flowId\",\"version\"]},\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"FlowRun\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"runId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":{\"name\":\"uuid\",\"args\":[4]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"flowId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"flowVersion\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"tenantId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"FlowRunStatus\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"currentNodeId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"inputJson\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"stateJson\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"outputsJson\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"FlowRunEvent\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":{\"name\":\"uuid\",\"args\":[4]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"runId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"at\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"type\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nodeId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"attempt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"payloadJson\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"FlowIdempotency\":{\"dbName\":null,\"schema\":null,\"fields\":[{\"name\":\"key\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"runId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nodeId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"outputJson\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"patchJson\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}},\"enums\":{\"FlowRunStatus\":{\"values\":[{\"name\":\"RUNNING\",\"dbName\":null},{\"name\":\"WAITING\",\"dbName\":null},{\"name\":\"COMPLETED\",\"dbName\":null},{\"name\":\"FAILED\",\"dbName\":null}],\"dbName\":null}},\"types\":{}}")
233
+ defineDmmfProperty(exports.Prisma, config.runtimeDataModel)
234
+ config.engineWasm = undefined
235
+ config.compilerWasm = undefined
236
+
237
+ config.injectableEdgeEnv = () => ({
238
+ parsed: {
239
+ DATABASE_URL: typeof globalThis !== 'undefined' && globalThis['DATABASE_URL'] || typeof process !== 'undefined' && process.env && process.env.DATABASE_URL || undefined
240
+ }
241
+ })
242
+
243
+ if (typeof globalThis !== 'undefined' && globalThis['DEBUG'] || typeof process !== 'undefined' && process.env && process.env.DEBUG || undefined) {
244
+ Debug.enable(typeof globalThis !== 'undefined' && globalThis['DEBUG'] || typeof process !== 'undefined' && process.env && process.env.DEBUG || undefined)
245
+ }
246
+
247
+ const PrismaClient = getPrismaClient(config)
248
+ exports.PrismaClient = PrismaClient
249
+ Object.assign(exports, Prisma)
250
+
@@ -0,0 +1,236 @@
1
+
2
+ /* !!! This is code generated by Prisma. Do not edit directly. !!!
3
+ /* eslint-disable */
4
+ // biome-ignore-all lint: generated file
5
+
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+
8
+ const {
9
+ Decimal,
10
+ objectEnumValues,
11
+ makeStrictEnum,
12
+ Public,
13
+ getRuntime,
14
+ skip
15
+ } = require('./runtime/index-browser.js')
16
+
17
+
18
+ const Prisma = {}
19
+
20
+ exports.Prisma = Prisma
21
+ exports.$Enums = {}
22
+
23
+ /**
24
+ * Prisma Client JS version: 6.19.2
25
+ * Query Engine version: c2990dca591cba766e3b7ef5d9e8a84796e47ab7
26
+ */
27
+ Prisma.prismaVersion = {
28
+ client: "6.19.2",
29
+ engine: "c2990dca591cba766e3b7ef5d9e8a84796e47ab7"
30
+ }
31
+
32
+ Prisma.PrismaClientKnownRequestError = () => {
33
+ const runtimeName = getRuntime().prettyName;
34
+ throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
35
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
36
+ )};
37
+ Prisma.PrismaClientUnknownRequestError = () => {
38
+ const runtimeName = getRuntime().prettyName;
39
+ throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
40
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
41
+ )}
42
+ Prisma.PrismaClientRustPanicError = () => {
43
+ const runtimeName = getRuntime().prettyName;
44
+ throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
45
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
46
+ )}
47
+ Prisma.PrismaClientInitializationError = () => {
48
+ const runtimeName = getRuntime().prettyName;
49
+ throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
50
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
51
+ )}
52
+ Prisma.PrismaClientValidationError = () => {
53
+ const runtimeName = getRuntime().prettyName;
54
+ throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
55
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
56
+ )}
57
+ Prisma.Decimal = Decimal
58
+
59
+ /**
60
+ * Re-export of sql-template-tag
61
+ */
62
+ Prisma.sql = () => {
63
+ const runtimeName = getRuntime().prettyName;
64
+ throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
65
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
66
+ )}
67
+ Prisma.empty = () => {
68
+ const runtimeName = getRuntime().prettyName;
69
+ throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
70
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
71
+ )}
72
+ Prisma.join = () => {
73
+ const runtimeName = getRuntime().prettyName;
74
+ throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
75
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
76
+ )}
77
+ Prisma.raw = () => {
78
+ const runtimeName = getRuntime().prettyName;
79
+ throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
80
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
81
+ )}
82
+ Prisma.validator = Public.validator
83
+
84
+ /**
85
+ * Extensions
86
+ */
87
+ Prisma.getExtensionContext = () => {
88
+ const runtimeName = getRuntime().prettyName;
89
+ throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
90
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
91
+ )}
92
+ Prisma.defineExtension = () => {
93
+ const runtimeName = getRuntime().prettyName;
94
+ throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
95
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
96
+ )}
97
+
98
+ /**
99
+ * Shorthand utilities for JSON filtering
100
+ */
101
+ Prisma.DbNull = objectEnumValues.instances.DbNull
102
+ Prisma.JsonNull = objectEnumValues.instances.JsonNull
103
+ Prisma.AnyNull = objectEnumValues.instances.AnyNull
104
+
105
+ Prisma.NullTypes = {
106
+ DbNull: objectEnumValues.classes.DbNull,
107
+ JsonNull: objectEnumValues.classes.JsonNull,
108
+ AnyNull: objectEnumValues.classes.AnyNull
109
+ }
110
+
111
+
112
+
113
+ /**
114
+ * Enums
115
+ */
116
+
117
+ exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
118
+ ReadUncommitted: 'ReadUncommitted',
119
+ ReadCommitted: 'ReadCommitted',
120
+ RepeatableRead: 'RepeatableRead',
121
+ Serializable: 'Serializable'
122
+ });
123
+
124
+ exports.Prisma.FlowDefinitionScalarFieldEnum = {
125
+ flowId: 'flowId',
126
+ version: 'version',
127
+ definitionJson: 'definitionJson',
128
+ createdAt: 'createdAt'
129
+ };
130
+
131
+ exports.Prisma.FlowRunScalarFieldEnum = {
132
+ runId: 'runId',
133
+ flowId: 'flowId',
134
+ flowVersion: 'flowVersion',
135
+ tenantId: 'tenantId',
136
+ status: 'status',
137
+ currentNodeId: 'currentNodeId',
138
+ inputJson: 'inputJson',
139
+ stateJson: 'stateJson',
140
+ outputsJson: 'outputsJson',
141
+ createdAt: 'createdAt',
142
+ updatedAt: 'updatedAt'
143
+ };
144
+
145
+ exports.Prisma.FlowRunEventScalarFieldEnum = {
146
+ id: 'id',
147
+ runId: 'runId',
148
+ at: 'at',
149
+ type: 'type',
150
+ nodeId: 'nodeId',
151
+ attempt: 'attempt',
152
+ payloadJson: 'payloadJson'
153
+ };
154
+
155
+ exports.Prisma.FlowIdempotencyScalarFieldEnum = {
156
+ key: 'key',
157
+ runId: 'runId',
158
+ nodeId: 'nodeId',
159
+ outputJson: 'outputJson',
160
+ patchJson: 'patchJson',
161
+ createdAt: 'createdAt'
162
+ };
163
+
164
+ exports.Prisma.SortOrder = {
165
+ asc: 'asc',
166
+ desc: 'desc'
167
+ };
168
+
169
+ exports.Prisma.JsonNullValueInput = {
170
+ JsonNull: Prisma.JsonNull
171
+ };
172
+
173
+ exports.Prisma.NullableJsonNullValueInput = {
174
+ DbNull: Prisma.DbNull,
175
+ JsonNull: Prisma.JsonNull
176
+ };
177
+
178
+ exports.Prisma.QueryMode = {
179
+ default: 'default',
180
+ insensitive: 'insensitive'
181
+ };
182
+
183
+ exports.Prisma.JsonNullValueFilter = {
184
+ DbNull: Prisma.DbNull,
185
+ JsonNull: Prisma.JsonNull,
186
+ AnyNull: Prisma.AnyNull
187
+ };
188
+
189
+ exports.Prisma.NullsOrder = {
190
+ first: 'first',
191
+ last: 'last'
192
+ };
193
+ exports.FlowRunStatus = exports.$Enums.FlowRunStatus = {
194
+ RUNNING: 'RUNNING',
195
+ WAITING: 'WAITING',
196
+ COMPLETED: 'COMPLETED',
197
+ FAILED: 'FAILED'
198
+ };
199
+
200
+ exports.Prisma.ModelName = {
201
+ FlowDefinition: 'FlowDefinition',
202
+ FlowRun: 'FlowRun',
203
+ FlowRunEvent: 'FlowRunEvent',
204
+ FlowIdempotency: 'FlowIdempotency'
205
+ };
206
+
207
+ /**
208
+ * This is a stub Prisma Client that will error at runtime if called.
209
+ */
210
+ class PrismaClient {
211
+ constructor() {
212
+ return new Proxy(this, {
213
+ get(target, prop) {
214
+ let message
215
+ const runtime = getRuntime()
216
+ if (runtime.isEdge) {
217
+ message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either:
218
+ - Use Prisma Accelerate: https://pris.ly/d/accelerate
219
+ - Use Driver Adapters: https://pris.ly/d/driver-adapters
220
+ `;
221
+ } else {
222
+ message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).'
223
+ }
224
+
225
+ message += `
226
+ If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report`
227
+
228
+ throw new Error(message)
229
+ }
230
+ })
231
+ }
232
+ }
233
+
234
+ exports.PrismaClient = PrismaClient
235
+
236
+ Object.assign(exports, Prisma)