@workflow/world-postgres 4.1.0-beta.42 → 4.1.0-beta.44
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 +10 -2
- package/dist/message.d.ts +1 -0
- package/dist/message.d.ts.map +1 -1
- package/dist/message.js +1 -0
- package/dist/message.js.map +1 -1
- package/dist/queue.d.ts.map +1 -1
- package/dist/queue.js +119 -20
- package/dist/queue.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ const world = createWorld({
|
|
|
58
58
|
| ------------------ | -------- | -------------------------------------------------------------------------------------- | ----------------------------------- |
|
|
59
59
|
| `connectionString` | `string` | `process.env.WORKFLOW_POSTGRES_URL` or `'postgres://world:world@localhost:5432/world'` | PostgreSQL connection string |
|
|
60
60
|
| `jobPrefix` | `string` | `process.env.WORKFLOW_POSTGRES_JOB_PREFIX` | Optional prefix for queue job names |
|
|
61
|
-
| `queueConcurrency` | `number` | `10` | Number of concurrent
|
|
61
|
+
| `queueConcurrency` | `number` | `10` | Number of concurrent active step executions per process |
|
|
62
62
|
|
|
63
63
|
## Environment Variables
|
|
64
64
|
|
|
@@ -115,11 +115,19 @@ Make sure your PostgreSQL database is accessible and the user has sufficient per
|
|
|
115
115
|
## Features
|
|
116
116
|
|
|
117
117
|
- **Durable Storage**: Stores workflow runs, events, steps, hooks, and webhooks in PostgreSQL
|
|
118
|
-
- **Queue Processing**: Uses graphile-worker
|
|
118
|
+
- **Queue Processing**: Uses graphile-worker as the durable queue and executes jobs inline in the worker
|
|
119
|
+
- **Durable Delays**: Re-schedules waits and retries in PostgreSQL
|
|
119
120
|
- **Streaming**: Real-time event streaming capabilities
|
|
120
121
|
- **Health Checks**: Built-in connection health monitoring
|
|
121
122
|
- **Configurable Concurrency**: Adjustable worker concurrency for queue processing
|
|
122
123
|
|
|
124
|
+
## Queue Behavior
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
- Graphile jobs are acknowledged only after the workflow or step execution finishes, or after the worker durably schedules a delayed follow-up job
|
|
128
|
+
- Backlog stays in PostgreSQL when all execution slots are busy
|
|
129
|
+
- Retry and sleep-style delays use Graphile `runAt` scheduling
|
|
130
|
+
|
|
123
131
|
## Development
|
|
124
132
|
|
|
125
133
|
For local development, you can use the included Docker Compose configuration:
|
package/dist/message.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare const MessageData: z.ZodObject<{
|
|
|
8
8
|
attempt: z.ZodNumber;
|
|
9
9
|
messageId: z.core.$ZodBranded<z.ZodString, "MessageId", "out">;
|
|
10
10
|
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
11
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
11
12
|
id: z.ZodString;
|
|
12
13
|
data: z.ZodCodec<z.ZodBase64, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>;
|
|
13
14
|
}, z.core.$strip>;
|
package/dist/message.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../src/message.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB;;;;GAIG;AACH,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../src/message.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;;;;;iBAWtB,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
package/dist/message.js
CHANGED
|
@@ -10,6 +10,7 @@ export const MessageData = z.object({
|
|
|
10
10
|
attempt: z.number().describe('The attempt number of the message'),
|
|
11
11
|
messageId: MessageId.describe('The unique ID of the message'),
|
|
12
12
|
idempotencyKey: z.string().optional(),
|
|
13
|
+
headers: z.record(z.string(), z.string()).optional(),
|
|
13
14
|
id: z
|
|
14
15
|
.string()
|
|
15
16
|
.describe("The ID of the sub-queue. For workflows, it's the workflow name. For steps, it's the step name."),
|
package/dist/message.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","sourceRoot":"","sources":["../src/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IACjE,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IAC7D,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,EAAE,EAAE,CAAC;SACF,MAAM,EAAE;SACR,QAAQ,CACP,gGAAgG,CACjG;IACH,IAAI,EAAE,YAAY,CAAC,QAAQ,CAAC,2BAA2B,CAAC;CACzD,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"message.js","sourceRoot":"","sources":["../src/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IACjE,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IAC7D,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACpD,EAAE,EAAE,CAAC;SACF,MAAM,EAAE;SACR,QAAQ,CACP,gGAAgG,CACjG;IACH,IAAI,EAAE,YAAY,CAAC,QAAQ,CAAC,2BAA2B,CAAC;CACzD,CAAC,CAAC"}
|
package/dist/queue.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../src/queue.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,KAAK,EAIX,MAAM,iBAAiB,CAAC;AASzB,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../src/queue.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,KAAK,EAIX,MAAM,iBAAiB,CAAC;AASzB,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAGrC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AA6BvD;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG;IAClC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB,CAAC;AAEF,wBAAgB,WAAW,CACzB,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,QAAQ,CAAC,GAAG,GACrB,aAAa,CA0Sf"}
|
package/dist/queue.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as Stream from 'node:stream';
|
|
2
2
|
import { JsonTransport } from '@vercel/queue';
|
|
3
3
|
import { MessageId, QueuePayloadSchema, } from '@workflow/world';
|
|
4
|
-
import { createLocalWorld } from '@workflow/world-local';
|
|
4
|
+
import { createLocalWorld, createQueueExecutor } from '@workflow/world-local';
|
|
5
5
|
import { Logger, makeWorkerUtils, run, } from 'graphile-worker';
|
|
6
6
|
import { monotonicFactory } from 'ulid';
|
|
7
|
+
import z from 'zod';
|
|
7
8
|
import { MessageData } from './message.js';
|
|
8
9
|
function createGraphileLogger() {
|
|
9
10
|
const isJsonMode = () => process.env.WORKFLOW_JSON_MODE === '1';
|
|
@@ -23,9 +24,16 @@ function createGraphileLogger() {
|
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
26
|
const graphileLogger = createGraphileLogger();
|
|
27
|
+
const COMPLETED_IDEMPOTENCY_CACHE_LIMIT = 10_000;
|
|
28
|
+
const GraphileHelpers = z.object({
|
|
29
|
+
job: z.object({
|
|
30
|
+
attempts: z.number().int().positive(),
|
|
31
|
+
}),
|
|
32
|
+
});
|
|
26
33
|
export function createQueue(config, postgres) {
|
|
27
34
|
const port = process.env.PORT ? Number(process.env.PORT) : undefined;
|
|
28
35
|
const localWorld = createLocalWorld({ dataDir: undefined, port });
|
|
36
|
+
const executor = createQueueExecutor({ port });
|
|
29
37
|
const transport = new JsonTransport();
|
|
30
38
|
const generateMessageId = monotonicFactory();
|
|
31
39
|
const prefix = config.jobPrefix || 'workflow_';
|
|
@@ -33,13 +41,52 @@ export function createQueue(config, postgres) {
|
|
|
33
41
|
__wkf_workflow_: `${prefix}flows`,
|
|
34
42
|
__wkf_step_: `${prefix}steps`,
|
|
35
43
|
};
|
|
36
|
-
const createQueueHandler =
|
|
44
|
+
const createQueueHandler = (prefix, handler) => {
|
|
45
|
+
const wrappedHandler = localWorld.createQueueHandler(prefix, handler);
|
|
46
|
+
// Register the HTTP-compatible handler so Graphile workers can execute it
|
|
47
|
+
// directly in-process when the route module has been loaded.
|
|
48
|
+
executor.registerHandler(prefix, wrappedHandler);
|
|
49
|
+
return wrappedHandler;
|
|
50
|
+
};
|
|
37
51
|
const getDeploymentId = async () => {
|
|
38
52
|
return 'postgres';
|
|
39
53
|
};
|
|
54
|
+
const completedMessages = new Set();
|
|
55
|
+
const inflightMessages = new Map();
|
|
40
56
|
let workerUtils = null;
|
|
41
57
|
let runner = null;
|
|
42
58
|
let startPromise = null;
|
|
59
|
+
function markMessageCompleted(idempotencyKey) {
|
|
60
|
+
completedMessages.delete(idempotencyKey);
|
|
61
|
+
completedMessages.add(idempotencyKey);
|
|
62
|
+
if (completedMessages.size > COMPLETED_IDEMPOTENCY_CACHE_LIMIT) {
|
|
63
|
+
const oldestKey = completedMessages.values().next().value;
|
|
64
|
+
if (oldestKey) {
|
|
65
|
+
completedMessages.delete(oldestKey);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
async function addGraphileJob({ queuePrefix, queueId, body, messageId, attempt, idempotencyKey, headers, delaySeconds, jobKey, }) {
|
|
70
|
+
const utils = workerUtils;
|
|
71
|
+
if (!utils) {
|
|
72
|
+
throw new Error('Postgres queue worker utils are not initialized');
|
|
73
|
+
}
|
|
74
|
+
const runAt = typeof delaySeconds === 'number' && delaySeconds > 0
|
|
75
|
+
? new Date(Date.now() + delaySeconds * 1000)
|
|
76
|
+
: undefined;
|
|
77
|
+
await utils.addJob(Queues[queuePrefix], MessageData.encode({
|
|
78
|
+
id: queueId,
|
|
79
|
+
data: Buffer.from(body),
|
|
80
|
+
attempt,
|
|
81
|
+
messageId,
|
|
82
|
+
idempotencyKey,
|
|
83
|
+
headers,
|
|
84
|
+
}), {
|
|
85
|
+
...(jobKey ? { jobKey } : {}),
|
|
86
|
+
...(runAt ? { runAt } : {}),
|
|
87
|
+
maxAttempts: 3,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
43
90
|
async function migratePgBossJobs(utils) {
|
|
44
91
|
// Scenario A: Drizzle migration already ran — staging table exists
|
|
45
92
|
const hasStaging = await postgres `
|
|
@@ -107,35 +154,86 @@ export function createQueue(config, postgres) {
|
|
|
107
154
|
}
|
|
108
155
|
const queue = async (queue, message, opts) => {
|
|
109
156
|
await start();
|
|
110
|
-
const [
|
|
111
|
-
const jobName = Queues[prefix];
|
|
157
|
+
const [queuePrefix, queueId] = parseQueueName(queue);
|
|
112
158
|
const body = transport.serialize(message);
|
|
113
159
|
const messageId = MessageId.parse(`msg_${generateMessageId()}`);
|
|
114
|
-
await
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
160
|
+
await addGraphileJob({
|
|
161
|
+
queuePrefix,
|
|
162
|
+
queueId,
|
|
163
|
+
body,
|
|
118
164
|
messageId,
|
|
165
|
+
attempt: 1,
|
|
119
166
|
idempotencyKey: opts?.idempotencyKey,
|
|
120
|
-
|
|
167
|
+
headers: opts?.headers,
|
|
168
|
+
delaySeconds: opts?.delaySeconds,
|
|
121
169
|
jobKey: opts?.idempotencyKey ?? messageId,
|
|
122
|
-
maxAttempts: 3,
|
|
123
170
|
});
|
|
124
171
|
return { messageId };
|
|
125
172
|
};
|
|
126
173
|
function createTaskHandler(queue) {
|
|
127
|
-
return async (payload) => {
|
|
174
|
+
return async (payload, helpers) => {
|
|
128
175
|
const messageData = MessageData.parse(payload);
|
|
129
|
-
const
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
176
|
+
const graphileAttempt = GraphileHelpers.safeParse(helpers);
|
|
177
|
+
const attempt = graphileAttempt.success
|
|
178
|
+
? graphileAttempt.data.job.attempts
|
|
179
|
+
: messageData.attempt;
|
|
180
|
+
const executeTask = async () => {
|
|
181
|
+
const bodyStream = Stream.Readable.toWeb(Stream.Readable.from([messageData.data]));
|
|
182
|
+
const body = await transport.deserialize(bodyStream);
|
|
183
|
+
QueuePayloadSchema.parse(body);
|
|
184
|
+
const queueName = `${queue}${messageData.id}`;
|
|
185
|
+
const result = await executor.executeMessage({
|
|
186
|
+
queueName,
|
|
187
|
+
messageId: messageData.messageId,
|
|
188
|
+
attempt,
|
|
189
|
+
body: messageData.data,
|
|
190
|
+
headers: messageData.headers,
|
|
191
|
+
});
|
|
192
|
+
if (result.type === 'completed') {
|
|
193
|
+
return 'completed';
|
|
194
|
+
}
|
|
195
|
+
if (result.type === 'reschedule') {
|
|
196
|
+
// Schedule the follow-up job before we return so a crash cannot
|
|
197
|
+
// lose the wake-up request.
|
|
198
|
+
await addGraphileJob({
|
|
199
|
+
queuePrefix: queue,
|
|
200
|
+
queueId: messageData.id,
|
|
201
|
+
body: messageData.data,
|
|
202
|
+
messageId: messageData.messageId,
|
|
203
|
+
attempt: attempt + 1,
|
|
204
|
+
idempotencyKey: messageData.idempotencyKey,
|
|
205
|
+
headers: messageData.headers,
|
|
206
|
+
delaySeconds: result.timeoutSeconds,
|
|
207
|
+
jobKey: messageData.idempotencyKey ?? messageData.messageId,
|
|
208
|
+
});
|
|
209
|
+
return 'rescheduled';
|
|
210
|
+
}
|
|
211
|
+
throw new Error(`[postgres world] Queue execution failed (${result.status}): ${result.text}`);
|
|
212
|
+
};
|
|
213
|
+
const idempotencyKey = messageData.idempotencyKey;
|
|
214
|
+
if (!idempotencyKey) {
|
|
215
|
+
await executeTask();
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
if (completedMessages.has(idempotencyKey)) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
const existing = inflightMessages.get(idempotencyKey);
|
|
222
|
+
if (existing) {
|
|
223
|
+
await existing;
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
const execution = executeTask()
|
|
227
|
+
.then((result) => {
|
|
228
|
+
if (result === 'completed') {
|
|
229
|
+
markMessageCompleted(idempotencyKey);
|
|
230
|
+
}
|
|
231
|
+
})
|
|
232
|
+
.finally(() => {
|
|
233
|
+
inflightMessages.delete(idempotencyKey);
|
|
138
234
|
});
|
|
235
|
+
inflightMessages.set(idempotencyKey, execution);
|
|
236
|
+
await execution;
|
|
139
237
|
};
|
|
140
238
|
}
|
|
141
239
|
async function setupListeners() {
|
|
@@ -166,6 +264,7 @@ export function createQueue(config, postgres) {
|
|
|
166
264
|
workerUtils = null;
|
|
167
265
|
}
|
|
168
266
|
startPromise = null;
|
|
267
|
+
await executor.close();
|
|
169
268
|
await localWorld.close?.();
|
|
170
269
|
},
|
|
171
270
|
};
|
package/dist/queue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../src/queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EACL,SAAS,EAET,kBAAkB,GAGnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../src/queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EACL,SAAS,EAET,kBAAkB,GAGnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EACL,MAAM,EACN,eAAe,EAEf,GAAG,GAEJ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,SAAS,oBAAoB;IAC3B,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,KAAK,GAAG,CAAC;IAChE,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAEnD,OAAO,IAAI,MAA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,cAAc;YACtB,YAAY,EAAE,GAAG,EAAE,mEAAmE;YACtF,QAAQ;SACT,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,kBAAkB;QAClB,eAAe;QACf,KAAK;QACL,KAAK;QACL,KAAK,CAAC,KAAK;YACT,IAAI,MAAM,EAAE,CAAC;gBACX,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;gBACpB,MAAM,GAAG,IAAI,CAAC;YAChB,CAAC;YACD,IAAI,WAAW,EAAE,CAAC;gBAChB,MAAM,WAAW,CAAC,OAAO,EAAE,CAAC;gBAC5B,WAAW,GAAG,IAAI,CAAC;YACrB,CAAC;YACD,YAAY,GAAG,IAAI,CAAC;YACpB,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;YACvB,MAAM,UAAU,CAAC,KAAK,EAAE,EAAE,CAAC;QAC7B,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,cAAc,GAAG,CAAC,IAAoB,EAAyB,EAAE;IACrE,MAAM,QAAQ,GAAkB,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACnE,KAAK,MAAM,MAAM,IAAI,QAAQ,EAAE,CAAC;QAC9B,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5B,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC;AACjD,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workflow/world-postgres",
|
|
3
|
-
"version": "4.1.0-beta.
|
|
3
|
+
"version": "4.1.0-beta.44",
|
|
4
4
|
"description": "A reference World implementation based on PostgreSQL",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"ulid": "~3.0.1",
|
|
47
47
|
"zod": "4.3.6",
|
|
48
48
|
"@workflow/errors": "4.1.0-beta.18",
|
|
49
|
-
"@workflow/world": "4.1.0-beta.
|
|
50
|
-
"@workflow/world-local": "4.1.0-beta.
|
|
49
|
+
"@workflow/world": "4.1.0-beta.12",
|
|
50
|
+
"@workflow/world-local": "4.1.0-beta.42"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@testcontainers/postgresql": "11.12.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"vitest": "^4.0.18",
|
|
57
57
|
"@workflow/errors": "4.1.0-beta.18",
|
|
58
58
|
"@workflow/tsconfig": "4.0.1-beta.0",
|
|
59
|
-
"@workflow/world-testing": "4.1.0-beta.
|
|
59
|
+
"@workflow/world-testing": "4.1.0-beta.70"
|
|
60
60
|
},
|
|
61
61
|
"keywords": [],
|
|
62
62
|
"author": "",
|