effect-cf 0.23.1 → 0.25.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/CHANGELOG.md +20 -0
- package/README.md +157 -7
- package/dist/{Hyperdrive-COyg7R26.d.mts → Binding-DI7u3fEY.d.mts} +5 -39
- package/dist/DurableObjectState-B5RCFnRy.mjs +384 -0
- package/dist/Hyperdrive-BwYp8Rsz.d.mts +36 -0
- package/dist/HyperdrivePg.d.mts +2 -1
- package/dist/Vitest.d.mts +192 -0
- package/dist/Vitest.mjs +184 -0
- package/dist/WorkflowBinding--eMVaixT.d.mts +1081 -0
- package/dist/index.d.mts +84 -1177
- package/dist/index.mjs +18 -435
- package/package.json +15 -6
- package/src/AnalyticsEngine.ts +7 -53
- package/src/DurableObjectAlarm.ts +0 -2
- package/src/Email.ts +5 -34
- package/src/Environment.ts +1 -4
- package/src/Vitest.ts +500 -0
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { Cause, Config, ConfigProvider, Context, Data, Effect, Exit, Option, Result, Schema } from "effect";
|
|
3
|
+
//#region src/Environment.ts
|
|
4
|
+
var Environment_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
WorkerConfig: () => WorkerConfig,
|
|
6
|
+
WorkerEnvironment: () => WorkerEnvironment
|
|
7
|
+
});
|
|
8
|
+
/**
|
|
9
|
+
* Context service for reading worker bindings from the current `env` object.
|
|
10
|
+
*/
|
|
11
|
+
var WorkerEnvironment = class extends Context.Service()("effect-cf/WorkerEnvironment") {};
|
|
12
|
+
let WorkerConfig;
|
|
13
|
+
(function(_WorkerConfig) {
|
|
14
|
+
_WorkerConfig.string = (name) => Config.string(name);
|
|
15
|
+
_WorkerConfig.redacted = (name) => Config.redacted(name);
|
|
16
|
+
_WorkerConfig.number = (name) => Config.number(name);
|
|
17
|
+
_WorkerConfig.integer = (name) => Config.int(name);
|
|
18
|
+
_WorkerConfig.boolean = (name) => Config.boolean(name);
|
|
19
|
+
const providerFromEnv = _WorkerConfig.providerFromEnv = (env, options) => ConfigProvider.fromUnknown(env, options);
|
|
20
|
+
const providerWith = _WorkerConfig.providerWith = (makeProvider) => Effect.map(WorkerEnvironment, makeProvider);
|
|
21
|
+
const provider = _WorkerConfig.provider = providerWith(providerFromEnv);
|
|
22
|
+
_WorkerConfig.providerLayer = ConfigProvider.layer(provider);
|
|
23
|
+
_WorkerConfig.layerWith = (makeProvider) => ConfigProvider.layer(providerWith(makeProvider));
|
|
24
|
+
})(WorkerConfig || (WorkerConfig = {}));
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/internal/ErrorMessage.ts
|
|
27
|
+
/**
|
|
28
|
+
* Renders the most useful human-readable description of an unknown `cause`
|
|
29
|
+
* for use in tagged error `message` getters.
|
|
30
|
+
*/
|
|
31
|
+
const causeMessage = (cause) => {
|
|
32
|
+
if (typeof cause === "object" && cause !== null) {
|
|
33
|
+
const message = Reflect.get(cause, "message");
|
|
34
|
+
if (typeof message === "string" && message.length > 0) return message;
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
return String(cause);
|
|
38
|
+
} catch {
|
|
39
|
+
return "unknown cause";
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
/** Renders a violation list as a single `path: message; ...` line. */
|
|
43
|
+
const violationsMessage = (violations) => violations.map((violation) => `${violation.path}: ${violation.message}`).join("; ");
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/DurableObjectStorage.ts
|
|
46
|
+
var DurableObjectStorage_exports = /* @__PURE__ */ __exportAll({
|
|
47
|
+
StorageOperationError: () => StorageOperationError,
|
|
48
|
+
fromDurableObjectStorage: () => fromDurableObjectStorage
|
|
49
|
+
});
|
|
50
|
+
/** Error type used when a storage operation throws or rejects. */
|
|
51
|
+
var StorageOperationError = class extends Data.TaggedError("StorageOperationError") {
|
|
52
|
+
get message() {
|
|
53
|
+
return `Durable Object storage ${this.operation} failed: ${causeMessage(this.cause)}`;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const storageError = (operation, cause) => new StorageOperationError({
|
|
57
|
+
operation,
|
|
58
|
+
cause
|
|
59
|
+
});
|
|
60
|
+
const tryStorageSync = (operation, evaluate) => Effect.try({
|
|
61
|
+
try: evaluate,
|
|
62
|
+
catch: (cause) => storageError(operation, cause)
|
|
63
|
+
});
|
|
64
|
+
const tryStoragePromise = (operation, evaluate) => Effect.tryPromise({
|
|
65
|
+
try: evaluate,
|
|
66
|
+
catch: (cause) => storageError(operation, cause)
|
|
67
|
+
});
|
|
68
|
+
const fromSqlCursor = (cursor) => ({
|
|
69
|
+
next: () => tryStorageSync("sql.next", () => cursor.next()),
|
|
70
|
+
toArray: () => tryStorageSync("sql.toArray", () => cursor.toArray()),
|
|
71
|
+
one: () => tryStorageSync("sql.one", () => cursor.one()),
|
|
72
|
+
raw: () => tryStorageSync("sql.raw", () => cursor.raw()),
|
|
73
|
+
get columnNames() {
|
|
74
|
+
return cursor.columnNames;
|
|
75
|
+
},
|
|
76
|
+
rowsRead: tryStorageSync("sql.rowsRead", () => cursor.rowsRead),
|
|
77
|
+
rowsWritten: tryStorageSync("sql.rowsWritten", () => cursor.rowsWritten)
|
|
78
|
+
});
|
|
79
|
+
const fromSqlStorage = (sql) => ({
|
|
80
|
+
exec: (query, ...bindings) => tryStorageSync("sql.exec", () => fromSqlCursor(sql.exec(query, ...bindings))),
|
|
81
|
+
get databaseSize() {
|
|
82
|
+
return sql.databaseSize;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
const schemaBackedSyncKvStorage = (kv, definition) => {
|
|
86
|
+
const encodeKey = Schema.encodeEffect(definition.key);
|
|
87
|
+
const decodeKey = Schema.decodeUnknownEffect(definition.key);
|
|
88
|
+
const encodeValue = Schema.encodeEffect(definition.value);
|
|
89
|
+
const decodeValue = Schema.decodeUnknownEffect(definition.value);
|
|
90
|
+
return {
|
|
91
|
+
get: (key) => Effect.gen(function* () {
|
|
92
|
+
const encodedKey = yield* encodeKey(key);
|
|
93
|
+
const encodedValue = yield* tryStorageSync("kv.get", () => kv.get(encodedKey));
|
|
94
|
+
if (encodedValue === void 0) return Option.none();
|
|
95
|
+
return yield* decodeValue(encodedValue).pipe(Effect.map(Option.some));
|
|
96
|
+
}),
|
|
97
|
+
put: (key, value) => Effect.gen(function* () {
|
|
98
|
+
const encodedKey = yield* encodeKey(key);
|
|
99
|
+
const encodedValue = yield* encodeValue(value);
|
|
100
|
+
yield* tryStorageSync("kv.put", () => kv.put(encodedKey, encodedValue));
|
|
101
|
+
}),
|
|
102
|
+
delete: (key) => Effect.gen(function* () {
|
|
103
|
+
const encodedKey = yield* encodeKey(key);
|
|
104
|
+
return yield* tryStorageSync("kv.delete", () => kv.delete(encodedKey));
|
|
105
|
+
}),
|
|
106
|
+
list: (options) => Effect.gen(function* () {
|
|
107
|
+
const entries = Array.from(yield* tryStorageSync("kv.list", () => kv.list(options)));
|
|
108
|
+
const decoded = [];
|
|
109
|
+
for (const [key, value] of entries) decoded.push([yield* decodeKey(key), yield* decodeValue(value)]);
|
|
110
|
+
return decoded;
|
|
111
|
+
})
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
const fromSyncKvStorage = (kv) => ({
|
|
115
|
+
get: (key) => tryStorageSync("kv.get", () => kv.get(key)),
|
|
116
|
+
put: (key, value) => tryStorageSync("kv.put", () => kv.put(key, value)),
|
|
117
|
+
delete: (key) => tryStorageSync("kv.delete", () => kv.delete(key)),
|
|
118
|
+
list: (options) => tryStorageSync("kv.list", () => Array.from(kv.list(options))),
|
|
119
|
+
schema: (definition) => schemaBackedSyncKvStorage(kv, definition)
|
|
120
|
+
});
|
|
121
|
+
const fromDurableObjectTransaction = (txn) => ({
|
|
122
|
+
get: (keyOrKeys, options) => Array.isArray(keyOrKeys) ? tryStoragePromise("transaction.get", () => txn.get(keyOrKeys, options)) : tryStoragePromise("transaction.get", () => txn.get(keyOrKeys, options)),
|
|
123
|
+
list: (options) => tryStoragePromise("transaction.list", () => txn.list(options)),
|
|
124
|
+
put: (keyOrEntries, valueOrOptions, maybeOptions) => tryStoragePromise("transaction.put", () => typeof keyOrEntries === "string" ? txn.put(keyOrEntries, valueOrOptions, maybeOptions) : txn.put(keyOrEntries, valueOrOptions)),
|
|
125
|
+
delete: (keyOrKeys, options) => Array.isArray(keyOrKeys) ? tryStoragePromise("transaction.delete", () => txn.delete(keyOrKeys, options)) : tryStoragePromise("transaction.delete", () => txn.delete(keyOrKeys, options)),
|
|
126
|
+
rollback: () => tryStorageSync("transaction.rollback", () => txn.rollback()),
|
|
127
|
+
getAlarm: (options) => tryStoragePromise("transaction.getAlarm", () => txn.getAlarm(options)),
|
|
128
|
+
setAlarm: (scheduledTime, options) => tryStoragePromise("transaction.setAlarm", () => txn.setAlarm(scheduledTime, options)),
|
|
129
|
+
deleteAlarm: (options) => tryStoragePromise("transaction.deleteAlarm", () => txn.deleteAlarm(options))
|
|
130
|
+
});
|
|
131
|
+
/**
|
|
132
|
+
* Wraps native Cloudflare storage APIs as Effect-returning helpers.
|
|
133
|
+
*/
|
|
134
|
+
const fromDurableObjectStorage = (storage) => ({
|
|
135
|
+
get: (key, options) => tryStoragePromise("get", () => storage.get(key, options)),
|
|
136
|
+
put: (key, value, options) => tryStoragePromise("put", () => storage.put(key, value, options)),
|
|
137
|
+
delete: (key, options) => tryStoragePromise("delete", () => storage.delete(key, options)),
|
|
138
|
+
deleteAll: (options) => tryStoragePromise("deleteAll", () => storage.deleteAll(options)),
|
|
139
|
+
getAlarm: (options) => tryStoragePromise("getAlarm", () => storage.getAlarm(options)),
|
|
140
|
+
setAlarm: (scheduledTime, options) => tryStoragePromise("setAlarm", () => storage.setAlarm(scheduledTime, options)),
|
|
141
|
+
deleteAlarm: (options) => tryStoragePromise("deleteAlarm", () => storage.deleteAlarm(options)),
|
|
142
|
+
transactionSync: (closure) => Effect.context().pipe(Effect.flatMap((context) => Effect.suspend(() => {
|
|
143
|
+
try {
|
|
144
|
+
return Effect.succeed(storage.transactionSync(() => {
|
|
145
|
+
const exit = Effect.runSyncExitWith(context)(closure());
|
|
146
|
+
if (Exit.isSuccess(exit)) return exit.value;
|
|
147
|
+
throw exit;
|
|
148
|
+
}));
|
|
149
|
+
} catch (cause) {
|
|
150
|
+
if (Exit.isExit(cause) && Exit.isFailure(cause)) return Effect.failCause(cause.cause);
|
|
151
|
+
return Effect.fail(storageError("transactionSync", cause));
|
|
152
|
+
}
|
|
153
|
+
}))),
|
|
154
|
+
transaction: (closure) => Effect.context().pipe(Effect.flatMap((context) => Effect.callback((resume) => {
|
|
155
|
+
storage.transaction(async (txn) => {
|
|
156
|
+
const exit = await Effect.runPromiseExitWith(context)(closure(fromDurableObjectTransaction(txn)));
|
|
157
|
+
if (Exit.isSuccess(exit)) return exit.value;
|
|
158
|
+
throw exit;
|
|
159
|
+
}).then((value) => resume(Effect.succeed(value)), (cause) => {
|
|
160
|
+
if (Exit.isExit(cause) && Exit.isFailure(cause)) resume(Effect.failCause(cause.cause));
|
|
161
|
+
else resume(Effect.fail(storageError("transaction", cause)));
|
|
162
|
+
});
|
|
163
|
+
}))),
|
|
164
|
+
sync: () => tryStoragePromise("sync", () => storage.sync()),
|
|
165
|
+
getCurrentBookmark: () => tryStoragePromise("getCurrentBookmark", () => storage.getCurrentBookmark()),
|
|
166
|
+
onNextSessionRestoreBookmark: (bookmark) => tryStoragePromise("onNextSessionRestoreBookmark", () => storage.onNextSessionRestoreBookmark(bookmark)),
|
|
167
|
+
sql: fromSqlStorage(storage.sql),
|
|
168
|
+
kv: fromSyncKvStorage(storage.kv)
|
|
169
|
+
});
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region src/DurableObjectWebSocket.ts
|
|
172
|
+
var DurableObjectWebSocket_exports = /* @__PURE__ */ __exportAll({
|
|
173
|
+
DurableWebSocketAttachmentError: () => DurableWebSocketAttachmentError,
|
|
174
|
+
DurableWebSocketCloseError: () => DurableWebSocketCloseError,
|
|
175
|
+
DurableWebSocketSendError: () => DurableWebSocketSendError,
|
|
176
|
+
acceptUpgrade: () => acceptUpgrade,
|
|
177
|
+
attachment: () => attachment,
|
|
178
|
+
fromWebSocket: () => fromWebSocket,
|
|
179
|
+
handlers: () => handlers
|
|
180
|
+
});
|
|
181
|
+
/** Error raised when sending on a Durable Object websocket fails. */
|
|
182
|
+
var DurableWebSocketSendError = class extends Data.TaggedError("DurableWebSocketSendError") {
|
|
183
|
+
get message() {
|
|
184
|
+
return `Durable Object websocket send failed: ${causeMessage(this.cause)}`;
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
/** Error raised when closing a Durable Object websocket fails. */
|
|
188
|
+
var DurableWebSocketCloseError = class extends Data.TaggedError("DurableWebSocketCloseError") {
|
|
189
|
+
get message() {
|
|
190
|
+
return `Durable Object websocket close failed: ${causeMessage(this.cause)}`;
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
/** Error raised when serializing or deserializing a websocket attachment fails. */
|
|
194
|
+
var DurableWebSocketAttachmentError = class extends Data.TaggedError("DurableWebSocketAttachmentError") {
|
|
195
|
+
get message() {
|
|
196
|
+
return `Durable Object websocket attachment ${this.operation} failed: ${causeMessage(this.cause)}`;
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
const wrappers = /* @__PURE__ */ new WeakMap();
|
|
200
|
+
/** Wraps a native Cloudflare websocket in the Effect-native Durable Object API. */
|
|
201
|
+
const fromWebSocket = (raw) => {
|
|
202
|
+
const existing = wrappers.get(raw);
|
|
203
|
+
if (existing !== void 0) return existing;
|
|
204
|
+
const socket = {
|
|
205
|
+
raw,
|
|
206
|
+
send: (data) => Effect.try({
|
|
207
|
+
try: () => raw.send(data),
|
|
208
|
+
catch: (cause) => new DurableWebSocketSendError({ cause })
|
|
209
|
+
}),
|
|
210
|
+
close: (code, reason) => Effect.try({
|
|
211
|
+
try: () => raw.close(code, reason),
|
|
212
|
+
catch: (cause) => new DurableWebSocketCloseError({ cause })
|
|
213
|
+
}),
|
|
214
|
+
serializeAttachment: (value) => Effect.try({
|
|
215
|
+
try: () => raw.serializeAttachment(value),
|
|
216
|
+
catch: (cause) => new DurableWebSocketAttachmentError({
|
|
217
|
+
operation: "serialize",
|
|
218
|
+
cause
|
|
219
|
+
})
|
|
220
|
+
}),
|
|
221
|
+
deserializeAttachment: Effect.try({
|
|
222
|
+
try: () => raw.deserializeAttachment(),
|
|
223
|
+
catch: (cause) => new DurableWebSocketAttachmentError({
|
|
224
|
+
operation: "deserialize",
|
|
225
|
+
cause
|
|
226
|
+
})
|
|
227
|
+
})
|
|
228
|
+
};
|
|
229
|
+
wrappers.set(raw, socket);
|
|
230
|
+
return socket;
|
|
231
|
+
};
|
|
232
|
+
/**
|
|
233
|
+
* Accepts a websocket upgrade and registers the server socket on `DurableObjectState`.
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* ```ts
|
|
237
|
+
* const response = yield* DurableObjectWebSocket.acceptUpgrade({
|
|
238
|
+
* tags: ["room:general"],
|
|
239
|
+
* });
|
|
240
|
+
*
|
|
241
|
+
* return response.response;
|
|
242
|
+
* ```
|
|
243
|
+
*/
|
|
244
|
+
const acceptUpgrade = Effect.fn("DurableObjectWebSocket.acceptUpgrade")(function* (options = {}) {
|
|
245
|
+
const state = yield* DurableObjectState;
|
|
246
|
+
const pair = new WebSocketPair();
|
|
247
|
+
const client = pair[0];
|
|
248
|
+
const server = fromWebSocket(pair[1]);
|
|
249
|
+
if (options.attachment !== void 0) yield* server.serializeAttachment(options.attachment);
|
|
250
|
+
yield* state.acceptWebSocket(server, options.tags === void 0 ? void 0 : [...options.tags]);
|
|
251
|
+
return {
|
|
252
|
+
client,
|
|
253
|
+
server,
|
|
254
|
+
response: new Response(null, {
|
|
255
|
+
status: 101,
|
|
256
|
+
webSocket: client
|
|
257
|
+
})
|
|
258
|
+
};
|
|
259
|
+
});
|
|
260
|
+
/** Creates typed attachment helpers for accepted and rehydrated sockets. */
|
|
261
|
+
const attachment = (schema) => {
|
|
262
|
+
const serialize = (socket, value) => Schema.encodeEffect(schema)(value).pipe(Effect.mapError((cause) => new DurableWebSocketAttachmentError({
|
|
263
|
+
operation: "serialize",
|
|
264
|
+
cause
|
|
265
|
+
})), Effect.flatMap((encoded) => socket.serializeAttachment(encoded)));
|
|
266
|
+
const deserialize = (socket) => Effect.gen(function* () {
|
|
267
|
+
const value = yield* socket.deserializeAttachment;
|
|
268
|
+
if (value === null || value === void 0) return Option.none();
|
|
269
|
+
return Option.some(yield* Schema.decodeUnknownEffect(schema)(value).pipe(Effect.mapError((cause) => new DurableWebSocketAttachmentError({
|
|
270
|
+
operation: "deserialize",
|
|
271
|
+
cause
|
|
272
|
+
}))));
|
|
273
|
+
});
|
|
274
|
+
const rehydrate = (options = {}) => Effect.gen(function* () {
|
|
275
|
+
const sockets = yield* (yield* DurableObjectState).getWebSockets(options.tag);
|
|
276
|
+
const restored = [];
|
|
277
|
+
const onInvalid = options.onInvalid ?? "ignore";
|
|
278
|
+
for (const socket of sockets) {
|
|
279
|
+
const decoded = yield* Effect.result(deserialize(socket));
|
|
280
|
+
if (Result.isSuccess(decoded) && Option.isSome(decoded.success)) {
|
|
281
|
+
restored.push({
|
|
282
|
+
socket,
|
|
283
|
+
attachment: decoded.success.value
|
|
284
|
+
});
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
if (Result.isFailure(decoded) && onInvalid === "fail") return yield* Effect.fail(decoded.failure);
|
|
288
|
+
if (Result.isFailure(decoded) && onInvalid === "ignore-and-close") yield* socket.close(1008, "invalid websocket attachment").pipe(Effect.ignore);
|
|
289
|
+
}
|
|
290
|
+
return restored;
|
|
291
|
+
});
|
|
292
|
+
return {
|
|
293
|
+
serialize,
|
|
294
|
+
deserialize,
|
|
295
|
+
rehydrate,
|
|
296
|
+
schema
|
|
297
|
+
};
|
|
298
|
+
};
|
|
299
|
+
/** Maps compact websocket lifecycle handler names to `DurableObject.make` options. */
|
|
300
|
+
const handlers = (options) => ({
|
|
301
|
+
webSocketMessage: options.message,
|
|
302
|
+
webSocketClose: options.close,
|
|
303
|
+
webSocketError: options.error
|
|
304
|
+
});
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region src/internal/WorkerContext.ts
|
|
307
|
+
const causeError = (cause) => {
|
|
308
|
+
const squashed = Cause.squash(cause);
|
|
309
|
+
return squashed instanceof Error ? squashed : new Error(Cause.pretty(cause), { cause: squashed });
|
|
310
|
+
};
|
|
311
|
+
const failureHandler = (label, cause, options) => (options?.onFailure?.(cause) ?? Effect.logError(`${label} failed`, Cause.pretty(cause))).pipe(Effect.catchCause((handlerCause) => Effect.logError(`${label} failure handler failed`, Cause.pretty(cause), Cause.pretty(handlerCause))));
|
|
312
|
+
/**
|
|
313
|
+
* Builds a `waitUntil` scheduler for any Cloudflare lifecycle that accepts
|
|
314
|
+
* background promises (`ExecutionContext`, `DurableObjectState`).
|
|
315
|
+
*
|
|
316
|
+
* Background effects capture the calling fiber's context via `Effect.context`
|
|
317
|
+
* before being registered, so the default module-level `Effect.runPromiseExit`
|
|
318
|
+
* runner is sufficient; entrypoints may still pass a runtime-bound runner.
|
|
319
|
+
*/
|
|
320
|
+
const makeWaitUntilScheduler = (label, register, runPromiseExit = (effect) => Effect.runPromiseExit(effect)) => {
|
|
321
|
+
return (effect, options, mode) => Effect.context().pipe(Effect.flatMap((context) => Effect.sync(() => {
|
|
322
|
+
const runHandler = (cause) => runPromiseExit(Effect.scoped(Effect.provideContext(failureHandler(label, cause, options), context))).then((exit) => {
|
|
323
|
+
if (Exit.isFailure(exit)) console.error(`${label} failure handler failed`, Cause.pretty(exit.cause));
|
|
324
|
+
});
|
|
325
|
+
register(runPromiseExit(Effect.scoped(Effect.provideContext(effect, context))).then(async (exit) => {
|
|
326
|
+
if (Exit.isSuccess(exit)) return;
|
|
327
|
+
await runHandler(exit.cause);
|
|
328
|
+
if (mode === "propagate") throw causeError(exit.cause);
|
|
329
|
+
}));
|
|
330
|
+
})));
|
|
331
|
+
};
|
|
332
|
+
/**
|
|
333
|
+
* Builds the `WorkerContext` service from a native `ExecutionContext`.
|
|
334
|
+
*/
|
|
335
|
+
const fromExecutionContext = (ctx, runPromiseExit = (effect) => Effect.runPromiseExit(effect)) => {
|
|
336
|
+
const schedule = makeWaitUntilScheduler("WorkerContext.waitUntil", (promise) => ctx.waitUntil(promise), runPromiseExit);
|
|
337
|
+
return {
|
|
338
|
+
raw: ctx,
|
|
339
|
+
waitUntil: (effect, options) => schedule(effect, options, options?.mode ?? "observe"),
|
|
340
|
+
waitUntilPropagating: (effect, options) => schedule(effect, options, "propagate"),
|
|
341
|
+
passThroughOnException: Effect.sync(() => ctx.passThroughOnException())
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
//#endregion
|
|
345
|
+
//#region src/DurableObjectState.ts
|
|
346
|
+
var DurableObjectState_exports = /* @__PURE__ */ __exportAll({
|
|
347
|
+
DurableObjectState: () => DurableObjectState,
|
|
348
|
+
fromDurableObjectState: () => fromDurableObjectState
|
|
349
|
+
});
|
|
350
|
+
/**
|
|
351
|
+
* Context tag for accessing the current Durable Object state service.
|
|
352
|
+
*/
|
|
353
|
+
var DurableObjectState = class extends Context.Service()("effect-cf/DurableObjectState") {};
|
|
354
|
+
/**
|
|
355
|
+
* Wraps a native Cloudflare `DurableObjectState` as a {@link DurableObjectStateService}.
|
|
356
|
+
*/
|
|
357
|
+
const fromDurableObjectState = (state) => {
|
|
358
|
+
const scheduleWaitUntil = makeWaitUntilScheduler("DurableObjectState.waitUntil", (promise) => state.waitUntil(promise));
|
|
359
|
+
const waitUntil = ((input, options) => Effect.isEffect(input) ? scheduleWaitUntil(input, options, options?.mode ?? "observe") : Effect.sync(() => state.waitUntil(input)));
|
|
360
|
+
return {
|
|
361
|
+
raw: state,
|
|
362
|
+
id: state.id,
|
|
363
|
+
storage: fromDurableObjectStorage(state.storage),
|
|
364
|
+
waitUntil,
|
|
365
|
+
blockConcurrencyWhile: (effect) => Effect.context().pipe(Effect.flatMap((context) => Effect.promise(() => state.blockConcurrencyWhile(() => runPromiseExitPreservingTypedFailures(context, effect)))), Effect.flatten),
|
|
366
|
+
blockConcurrencyWhileOrReset: (effect) => Effect.context().pipe(Effect.flatMap((context) => Effect.promise(() => state.blockConcurrencyWhile(() => Effect.runPromiseWith(context)(effect))))),
|
|
367
|
+
acceptWebSocket: (ws, tags) => Effect.sync(() => state.acceptWebSocket(ws.raw, tags)),
|
|
368
|
+
getWebSockets: (tag) => Effect.sync(() => state.getWebSockets(tag).map((socket) => fromWebSocket(socket))),
|
|
369
|
+
setWebSocketAutoResponse: (pair) => Effect.sync(() => state.setWebSocketAutoResponse(pair)),
|
|
370
|
+
getWebSocketAutoResponse: Effect.sync(() => state.getWebSocketAutoResponse()),
|
|
371
|
+
getWebSocketAutoResponseTimestamp: (ws) => Effect.sync(() => state.getWebSocketAutoResponseTimestamp(ws.raw)),
|
|
372
|
+
setHibernatableWebSocketEventTimeout: (timeoutMs) => Effect.sync(() => state.setHibernatableWebSocketEventTimeout(timeoutMs)),
|
|
373
|
+
getHibernatableWebSocketEventTimeout: Effect.sync(() => state.getHibernatableWebSocketEventTimeout()),
|
|
374
|
+
getTags: (ws) => Effect.sync(() => state.getTags(ws.raw)),
|
|
375
|
+
abort: (reason) => Effect.sync(() => state.abort(reason))
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
const runPromiseExitPreservingTypedFailures = async (context, effect) => {
|
|
379
|
+
const exit = await Effect.runPromiseExitWith(context)(effect);
|
|
380
|
+
if (Exit.isFailure(exit) && (Cause.hasDies(exit.cause) || Cause.hasInterrupts(exit.cause))) throw Cause.squash(exit.cause);
|
|
381
|
+
return exit;
|
|
382
|
+
};
|
|
383
|
+
//#endregion
|
|
384
|
+
export { DurableObjectWebSocket_exports as a, causeMessage as c, WorkerConfig as d, WorkerEnvironment as f, fromExecutionContext as i, violationsMessage as l, DurableObjectState_exports as n, fromWebSocket as o, fromDurableObjectState as r, DurableObjectStorage_exports as s, DurableObjectState as t, Environment_exports as u };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { c as WorkerEnvironment, r as BindingValidationError, t as BindingNotFoundError } from "./Binding-DI7u3fEY.mjs";
|
|
2
|
+
import { Context, Effect, Layer } from "effect";
|
|
3
|
+
declare namespace Hyperdrive_d_exports {
|
|
4
|
+
export { HyperdriveClient, HyperdriveDefinition, HyperdriveService, LayerOptions, Tag, TagClass, isHyperdrive, layer, make, makeClient };
|
|
5
|
+
}
|
|
6
|
+
/** Typed Hyperdrive binding definition. */
|
|
7
|
+
interface HyperdriveDefinition {
|
|
8
|
+
/** Binding name as configured in `wrangler.jsonc`. */
|
|
9
|
+
readonly binding: string;
|
|
10
|
+
}
|
|
11
|
+
interface HyperdriveClient {
|
|
12
|
+
readonly connectionString: string;
|
|
13
|
+
readonly rawUnsafe: Effect.Effect<Hyperdrive>;
|
|
14
|
+
readonly definition: HyperdriveDefinition;
|
|
15
|
+
}
|
|
16
|
+
declare const HyperdriveServiceTypeId: unique symbol;
|
|
17
|
+
/** Nominal service marker for Hyperdrive services created with {@link make}. */
|
|
18
|
+
interface HyperdriveService<Id extends string> {
|
|
19
|
+
readonly [HyperdriveServiceTypeId]: {
|
|
20
|
+
readonly id: Id;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
type LayerOptions = {
|
|
24
|
+
readonly binding: string;
|
|
25
|
+
};
|
|
26
|
+
interface TagClass<Self, Id extends string> extends Context.ServiceClass<Self, Id, HyperdriveClient> {
|
|
27
|
+
readonly id: Id;
|
|
28
|
+
readonly layer: (options: LayerOptions) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
29
|
+
}
|
|
30
|
+
declare const isHyperdrive: (value: unknown) => value is Hyperdrive;
|
|
31
|
+
declare const makeClient: (definition: HyperdriveDefinition) => (hyperdrive: Hyperdrive) => HyperdriveClient;
|
|
32
|
+
declare const layer: <Self>(tag: Context.Service<Self, HyperdriveClient>, definition: HyperdriveDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
33
|
+
declare const make: <Id extends string>(id: Id) => TagClass<HyperdriveService<Id>, Id>;
|
|
34
|
+
declare const Tag: <Self>() => <Id extends string>(id: Id) => TagClass<Self, Id>;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { LayerOptions as n, TagClass as r, Hyperdrive_d_exports as t };
|
package/dist/HyperdrivePg.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as WorkerEnvironment, r as BindingValidationError, t as BindingNotFoundError } from "./Binding-DI7u3fEY.mjs";
|
|
2
|
+
import { n as LayerOptions, r as TagClass } from "./Hyperdrive-BwYp8Rsz.mjs";
|
|
2
3
|
import { Layer } from "effect";
|
|
3
4
|
import { PgClient } from "@effect/sql-pg";
|
|
4
5
|
import { SqlClient, SqlError } from "effect/unstable/sql";
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { c as WorkerEnvironment, s as WorkerEnv } from "./Binding-DI7u3fEY.mjs";
|
|
2
|
+
import { c as DurableObjectState, l as DurableObjectStateService, o as WorkflowInstanceStatusName } from "./WorkflowBinding--eMVaixT.mjs";
|
|
3
|
+
import { Effect, Layer } from "effect";
|
|
4
|
+
import { DurableObject } from "cloudflare:workers";
|
|
5
|
+
import { adminSecretsStore as adminSecretsStore$1, getQueueResult, introspectWorkflow as introspectWorkflow$1, introspectWorkflowInstance as introspectWorkflowInstance$1 } from "cloudflare:test";
|
|
6
|
+
//#region src/Vitest.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Provides the Workers pool environment as both {@link WorkerEnvironment} and
|
|
9
|
+
* the active Effect `ConfigProvider`.
|
|
10
|
+
*/
|
|
11
|
+
declare const layer: Layer.Layer<WorkerEnvironment>;
|
|
12
|
+
/** Constructor shape shared by Effect-backed Worker entrypoints. */
|
|
13
|
+
interface WorkerConstructor<Instance> {
|
|
14
|
+
new (context: globalThis.ExecutionContext, env: WorkerEnv): Instance;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates an `ExecutionContext` and drains all `waitUntil` work before the
|
|
18
|
+
* returned effect completes, including when `use` fails or is interrupted.
|
|
19
|
+
*/
|
|
20
|
+
declare const withExecutionContext: <A, E, R>(use: (context: globalThis.ExecutionContext) => Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
21
|
+
interface FetchWorker {
|
|
22
|
+
fetch(request: Request): Promise<Response>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Invokes an Effect-backed Worker fetch handler and drains its `waitUntil`
|
|
26
|
+
* work before returning the response.
|
|
27
|
+
*/
|
|
28
|
+
declare const fetch: <Instance extends FetchWorker>(Worker: WorkerConstructor<Instance>, request: Request<unknown, CfProperties<unknown>>, workerEnv?: Cloudflare.Env | undefined) => Effect.Effect<Response, never, never>;
|
|
29
|
+
/** Modules-format scheduled handler accepted by {@link scheduled}. */
|
|
30
|
+
type ScheduledHandler = NonNullable<globalThis.ExportedHandler<WorkerEnv>["scheduled"]>;
|
|
31
|
+
/** Options used to construct a scheduled event controller. */
|
|
32
|
+
interface ScheduledOptions {
|
|
33
|
+
readonly scheduledTime?: number | Date;
|
|
34
|
+
readonly cron?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Invokes a modules-format scheduled handler and drains its `waitUntil` work.
|
|
38
|
+
*/
|
|
39
|
+
declare const scheduled: (handler: ExportedHandlerScheduledHandler<Cloudflare.Env, unknown>, options?: ScheduledOptions | undefined, workerEnv?: Cloudflare.Env | undefined) => Effect.Effect<ScheduledController, never, never>;
|
|
40
|
+
type AnyPagesFunction = globalThis.PagesFunction<WorkerEnv, string, any>;
|
|
41
|
+
interface PagesEventContextInitBase {
|
|
42
|
+
readonly request: Request<unknown, IncomingRequestCfProperties>;
|
|
43
|
+
readonly functionPath?: string;
|
|
44
|
+
readonly next?: (request: Request) => Response | Promise<Response>;
|
|
45
|
+
}
|
|
46
|
+
type PagesEventContextInitParams<Context> = Context extends globalThis.EventContext<unknown, infer Params, unknown> ? [Params] extends [never] ? {
|
|
47
|
+
readonly params?: Record<string, never>;
|
|
48
|
+
} : {
|
|
49
|
+
readonly params: Record<Params, string | Array<string>>;
|
|
50
|
+
} : never;
|
|
51
|
+
type PagesEventContextInitData<Context> = Context extends globalThis.EventContext<unknown, string, infer Data> ? Data extends Record<string, never> ? {
|
|
52
|
+
readonly data?: Data;
|
|
53
|
+
} : {
|
|
54
|
+
readonly data: Data;
|
|
55
|
+
} : never;
|
|
56
|
+
/** Initialization accepted by Pool Workers for a Pages Function. */
|
|
57
|
+
type PagesEventContextInit<Function extends AnyPagesFunction> = PagesEventContextInitBase & PagesEventContextInitParams<Parameters<Function>[0]> & PagesEventContextInitData<Parameters<Function>[0]>;
|
|
58
|
+
/**
|
|
59
|
+
* Invokes a Pages Function with a typed event context and drains its
|
|
60
|
+
* `waitUntil` work, including when the function fails.
|
|
61
|
+
*/
|
|
62
|
+
declare const pages: <Function extends AnyPagesFunction>(handler: Function, init: PagesEventContextInit<Function>) => Effect.Effect<Response, never, never>;
|
|
63
|
+
interface QueueWorker {
|
|
64
|
+
queue(batch: globalThis.MessageBatch): Promise<void>;
|
|
65
|
+
}
|
|
66
|
+
/** Input message accepted by Pool Workers' `createMessageBatch` helper. */
|
|
67
|
+
type QueueMessage<Body> = {
|
|
68
|
+
readonly id: string;
|
|
69
|
+
readonly timestamp: Date;
|
|
70
|
+
readonly attempts: number;
|
|
71
|
+
} & ({
|
|
72
|
+
readonly body: Body;
|
|
73
|
+
} | {
|
|
74
|
+
readonly serializedBody: ArrayBuffer | ArrayBufferView;
|
|
75
|
+
});
|
|
76
|
+
/** Acknowledgement and retry result returned by Pool Workers. */
|
|
77
|
+
type QueueResult = Awaited<ReturnType<typeof getQueueResult>>;
|
|
78
|
+
/** Result of invoking a queue consumer through {@link queue}. */
|
|
79
|
+
interface QueueRunResult<Body> {
|
|
80
|
+
readonly batch: globalThis.MessageBatch<Body>;
|
|
81
|
+
readonly result: QueueResult;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Invokes an Effect-backed queue consumer, drains its `waitUntil` work, and
|
|
85
|
+
* returns Pool Workers' acknowledgement and retry result.
|
|
86
|
+
*/
|
|
87
|
+
declare const queue: <Body, Instance extends QueueWorker>(Worker: WorkerConstructor<Instance>, queueName: string, messages: readonly QueueMessage<Body>[], workerEnv?: Cloudflare.Env | undefined) => Effect.Effect<QueueRunResult<Body>, never, never>;
|
|
88
|
+
/**
|
|
89
|
+
* Runs an Effect inside the I/O context of a Durable Object instance.
|
|
90
|
+
*
|
|
91
|
+
* The caller's Effect context is preserved, and the instance's native state is
|
|
92
|
+
* provided as {@link DurableObjectState}. A wrapped state service is also
|
|
93
|
+
* passed to `use` for direct access.
|
|
94
|
+
*/
|
|
95
|
+
declare const runInDurableObject: <Object extends DurableObject, A, E, R>(stub: DurableObjectStub<Object>, use: (instance: Object, state: DurableObjectStateService) => Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, DurableObjectState>>;
|
|
96
|
+
/** Immediately runs and removes a scheduled Durable Object alarm. */
|
|
97
|
+
declare const runDurableObjectAlarm: (stub: DurableObjectStub<DurableObject<Cloudflare.Env, {}>>) => Effect.Effect<boolean, never, never>;
|
|
98
|
+
/** Options controlling how Durable Object eviction handles WebSockets. */
|
|
99
|
+
interface DurableObjectEvictionOptions {
|
|
100
|
+
readonly webSockets?: "close" | "hibernate";
|
|
101
|
+
}
|
|
102
|
+
/** Gracefully evicts one running Durable Object while preserving durable storage. */
|
|
103
|
+
declare const evictDurableObject: (stub: DurableObjectStub<DurableObject<Cloudflare.Env, {}>>, options?: DurableObjectEvictionOptions | undefined) => Effect.Effect<void, never, never>;
|
|
104
|
+
/** Lists all IDs created in a Durable Object namespace. */
|
|
105
|
+
declare const listDurableObjectIds: <Object extends DurableObject | undefined>(namespace: DurableObjectNamespace<Object>) => Effect.Effect<DurableObjectId[], never, never>;
|
|
106
|
+
/** Deletes data from all bindings attached to the current test Worker. */
|
|
107
|
+
declare const reset: () => Effect.Effect<void, never, never>;
|
|
108
|
+
/** Aborts all Durable Object instances without deleting their persisted data. */
|
|
109
|
+
declare const abortAllDurableObjects: () => Effect.Effect<void, never, never>;
|
|
110
|
+
/** Gracefully evicts all running Durable Objects while preserving durable storage. */
|
|
111
|
+
declare const evictAllDurableObjects: (options?: DurableObjectEvictionOptions | undefined) => Effect.Effect<void, never, never>;
|
|
112
|
+
/** A D1 migration accepted by Pool Workers. */
|
|
113
|
+
interface D1Migration {
|
|
114
|
+
readonly name: string;
|
|
115
|
+
readonly queries: ReadonlyArray<string>;
|
|
116
|
+
}
|
|
117
|
+
/** Applies all D1 migrations that have not already been recorded. */
|
|
118
|
+
declare const applyD1Migrations: (database: D1Database, migrations: readonly D1Migration[], migrationsTableName?: string | undefined) => Effect.Effect<void, never, never>;
|
|
119
|
+
type NativeSecretsStoreAdmin = ReturnType<typeof adminSecretsStore$1>;
|
|
120
|
+
/** Secret metadata returned by {@link SecretsStoreAdmin.list}. */
|
|
121
|
+
interface SecretsStoreSecret {
|
|
122
|
+
readonly name: string;
|
|
123
|
+
readonly metadata?: {
|
|
124
|
+
readonly uuid: string;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
/** Effect-native wrapper around Pool Workers' Secrets Store admin API. */
|
|
128
|
+
interface SecretsStoreAdmin {
|
|
129
|
+
readonly raw: NativeSecretsStoreAdmin;
|
|
130
|
+
readonly create: (value: string) => Effect.Effect<string>;
|
|
131
|
+
readonly update: (value: string, id: string) => Effect.Effect<string>;
|
|
132
|
+
readonly duplicate: (id: string, newName: string) => Effect.Effect<string>;
|
|
133
|
+
readonly delete: (id: string) => Effect.Effect<void>;
|
|
134
|
+
readonly list: Effect.Effect<Array<SecretsStoreSecret>>;
|
|
135
|
+
readonly get: (id: string) => Effect.Effect<string>;
|
|
136
|
+
}
|
|
137
|
+
/** Acquires an Effect-native admin client for a Secrets Store binding. */
|
|
138
|
+
declare const adminSecretsStore: (binding: {
|
|
139
|
+
get(): Promise<string>;
|
|
140
|
+
}) => Effect.Effect<SecretsStoreAdmin, never, never>;
|
|
141
|
+
type NativeWorkflowIntrospector = Awaited<ReturnType<typeof introspectWorkflow$1>>;
|
|
142
|
+
type NativeWorkflowInstanceIntrospector = Awaited<ReturnType<typeof introspectWorkflowInstance$1>>;
|
|
143
|
+
/** Identifies one occurrence of a Workflow step or sleep. */
|
|
144
|
+
interface WorkflowStepTarget {
|
|
145
|
+
readonly name: string;
|
|
146
|
+
readonly index?: number;
|
|
147
|
+
}
|
|
148
|
+
/** Event delivered to a mocked Workflow `waitForEvent` operation. */
|
|
149
|
+
interface WorkflowMockEvent {
|
|
150
|
+
readonly type: string;
|
|
151
|
+
readonly payload: unknown;
|
|
152
|
+
}
|
|
153
|
+
/** Effect-native Workflow behavior modifier. */
|
|
154
|
+
interface WorkflowInstanceModifier {
|
|
155
|
+
readonly disableSleeps: (steps?: ReadonlyArray<WorkflowStepTarget>) => Effect.Effect<void>;
|
|
156
|
+
readonly disableRetryDelays: (steps?: ReadonlyArray<WorkflowStepTarget>) => Effect.Effect<void>;
|
|
157
|
+
readonly mockStepResult: (step: WorkflowStepTarget, result: unknown) => Effect.Effect<void>;
|
|
158
|
+
readonly mockStepError: (step: WorkflowStepTarget, error: Error, times?: number) => Effect.Effect<void>;
|
|
159
|
+
readonly forceStepTimeout: (step: WorkflowStepTarget, times?: number) => Effect.Effect<void>;
|
|
160
|
+
readonly mockEvent: (event: WorkflowMockEvent) => Effect.Effect<void>;
|
|
161
|
+
readonly forceEventTimeout: (step: WorkflowStepTarget) => Effect.Effect<void>;
|
|
162
|
+
}
|
|
163
|
+
/** Effect-native introspector for one Workflow instance. */
|
|
164
|
+
interface WorkflowInstanceIntrospector {
|
|
165
|
+
readonly raw: NativeWorkflowInstanceIntrospector;
|
|
166
|
+
readonly modify: <A, E, R>(use: (modifier: WorkflowInstanceModifier) => Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
167
|
+
readonly waitForStepResult: (step: WorkflowStepTarget) => Effect.Effect<unknown>;
|
|
168
|
+
readonly waitForStatus: (status: WorkflowInstanceStatusName) => Effect.Effect<void>;
|
|
169
|
+
readonly getOutput: Effect.Effect<unknown>;
|
|
170
|
+
readonly getError: Effect.Effect<{
|
|
171
|
+
readonly name: string;
|
|
172
|
+
readonly message: string;
|
|
173
|
+
}>;
|
|
174
|
+
}
|
|
175
|
+
/** Effect-native introspector for subsequently created Workflow instances. */
|
|
176
|
+
interface WorkflowIntrospector {
|
|
177
|
+
readonly raw: NativeWorkflowIntrospector;
|
|
178
|
+
readonly modifyAll: <A, E, R>(use: (modifier: WorkflowInstanceModifier) => Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
179
|
+
readonly get: Effect.Effect<ReadonlyArray<WorkflowInstanceIntrospector>>;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Acquires an Effect-native Workflow introspector that is disposed when the
|
|
183
|
+
* surrounding Effect scope closes.
|
|
184
|
+
*/
|
|
185
|
+
declare const introspectWorkflow: (workflow: Workflow<unknown>) => Effect.Effect<WorkflowIntrospector, never, import("effect/Scope").Scope>;
|
|
186
|
+
/**
|
|
187
|
+
* Acquires an Effect-native Workflow instance introspector that is disposed
|
|
188
|
+
* when the surrounding Effect scope closes.
|
|
189
|
+
*/
|
|
190
|
+
declare const introspectWorkflowInstance: (workflow: Workflow<unknown>, instanceId: string) => Effect.Effect<WorkflowInstanceIntrospector, never, import("effect/Scope").Scope>;
|
|
191
|
+
//#endregion
|
|
192
|
+
export { D1Migration, DurableObjectEvictionOptions, PagesEventContextInit, QueueMessage, QueueResult, QueueRunResult, ScheduledHandler, ScheduledOptions, SecretsStoreAdmin, SecretsStoreSecret, WorkerConstructor, WorkflowInstanceIntrospector, WorkflowInstanceModifier, WorkflowIntrospector, WorkflowMockEvent, WorkflowStepTarget, abortAllDurableObjects, adminSecretsStore, applyD1Migrations, evictAllDurableObjects, evictDurableObject, fetch, introspectWorkflow, introspectWorkflowInstance, layer, listDurableObjectIds, pages, queue, reset, runDurableObjectAlarm, runInDurableObject, scheduled, withExecutionContext };
|