effect-cf 0.18.0 → 0.20.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 +18 -0
- package/README.md +16 -2
- package/dist/{Hyperdrive-C0vfrPeG.d.mts → Hyperdrive-RTjgirMV.d.mts} +7 -12
- package/dist/HyperdrivePg.d.mts +2 -6
- package/dist/HyperdrivePg.mjs +0 -1
- package/dist/index.d.mts +160 -106
- package/dist/index.mjs +550 -168
- package/package.json +8 -9
- package/src/AiGateway.ts +3 -0
- package/src/AnalyticsEngine.ts +6 -1
- package/src/Binding.ts +4 -2
- package/src/CloudflareOtlp.ts +20 -7
- package/src/ContainerNamespace.ts +3 -0
- package/src/D1.ts +1 -0
- package/src/DurableObject.ts +10 -2
- package/src/DurableObjectAlarm.ts +19 -0
- package/src/DurableObjectDefinition.ts +34 -6
- package/src/DurableObjectNamespace.ts +4 -1
- package/src/DurableObjectRpcWebSocket.ts +14 -0
- package/src/DurableObjectSqlite.ts +1 -0
- package/src/DurableObjectStorage.ts +2 -0
- package/src/DurableObjectWebSocket.ts +4 -1
- package/src/Email.ts +354 -10
- package/src/HyperdrivePg.ts +1 -1
- package/src/Kv.ts +3 -1
- package/src/QueueBinding.ts +2 -1
- package/src/QueueDefinition.ts +6 -1
- package/src/R2.ts +1 -0
- package/src/RpcDefinition.ts +2 -0
- package/src/ServiceBinding.ts +6 -1
- package/src/Worker.ts +10 -2
- package/src/WorkerDefinition.ts +28 -6
- package/src/WorkflowBinding.ts +5 -2
- package/src/WorkflowDefinition.ts +6 -1
- package/src/internal/Clock.ts +9 -0
- package/src/internal/RpcInvocation.ts +1 -0
- package/dist/Hyperdrive-89hg_Fck.mjs +0 -156
- /package/dist/{chunk-CfYAbeIz.mjs → rolldown-runtime-D7D4PA-g.mjs} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as BindingService, c as WorkerConfig, i as BindingNotFoundError, l as WorkerEnv, o as BindingValidationError, s as Binding_d_exports, t as Hyperdrive_d_exports, u as WorkerEnvironment } from "./Hyperdrive-
|
|
1
|
+
import { a as BindingService, c as WorkerConfig, i as BindingNotFoundError, l as WorkerEnv, o as BindingValidationError, s as Binding_d_exports, t as Hyperdrive_d_exports, u as WorkerEnvironment } from "./Hyperdrive-RTjgirMV.mjs";
|
|
2
2
|
import { Cause, Config, Context, Data, DateTime, Duration, Effect, Layer, Option, Redacted, Schema, Scope } from "effect";
|
|
3
3
|
import { Headers as Headers$1, HttpClient, HttpClientResponse, HttpServerRequest, HttpServerResponse } from "effect/unstable/http";
|
|
4
4
|
import { D1Client } from "@effect/sql-d1";
|
|
@@ -6,19 +6,11 @@ import { DurableObject, RpcStub, RpcTarget, WorkerEntrypoint, WorkflowEntrypoint
|
|
|
6
6
|
import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization";
|
|
7
7
|
import * as RpcServer from "effect/unstable/rpc/RpcServer";
|
|
8
8
|
import { SqliteClient } from "@effect/sql-sqlite-do";
|
|
9
|
-
import * as _$effect_unstable_sql_SqlClient0 from "effect/unstable/sql/SqlClient";
|
|
10
|
-
import * as _$effect_Types0 from "effect/Types";
|
|
11
|
-
import * as _$effect_Cause0 from "effect/Cause";
|
|
12
|
-
import * as _$effect_Layer0 from "effect/Layer";
|
|
13
|
-
import * as _$effect_Scope0 from "effect/Scope";
|
|
14
9
|
import * as Tracer from "effect/Tracer";
|
|
15
|
-
import * as _$effect_Config0 from "effect/Config";
|
|
16
|
-
|
|
17
|
-
//#region src/WorkersAi.d.ts
|
|
18
10
|
declare namespace WorkersAi_d_exports {
|
|
19
11
|
export { LayerOptions$19 as LayerOptions, Tag$18 as Tag, TagClass$17 as TagClass, WorkersAiAsyncBatchResponse, WorkersAiBinding, WorkersAiClient, WorkersAiDefinition, WorkersAiEmbeddingInput, WorkersAiEmbeddingResponse, WorkersAiModelsSearchObject, WorkersAiModelsSearchParams, WorkersAiOperationError, WorkersAiOptions, WorkersAiService, embeddingResponse, isWorkersAiBinding, layer$17 as layer, make$17 as make, makeClient$14 as makeClient };
|
|
20
12
|
}
|
|
21
|
-
declare const WorkersAiOperationError_base: new <A extends Record<string, any> = {}>(args:
|
|
13
|
+
declare const WorkersAiOperationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
22
14
|
readonly _tag: "WorkersAiOperationError";
|
|
23
15
|
} & Readonly<A>;
|
|
24
16
|
/** Error raised when a Workers AI operation fails. */
|
|
@@ -94,7 +86,7 @@ declare const Tag$18: <Self>() => <Id extends string, ModelList extends AiModelL
|
|
|
94
86
|
declare namespace AiGateway_d_exports {
|
|
95
87
|
export { AiGatewayBinding, AiGatewayClient, AiGatewayDefinition, AiGatewayFetchOptions, AiGatewayHeaders, AiGatewayLog, AiGatewayOperationError, AiGatewayPatchLog, AiGatewayProvider, AiGatewayRunOptions, AiGatewayService, AiGatewayUniversalRequest, LayerOptions$18 as LayerOptions, Tag$17 as Tag, TagClass$16 as TagClass, isAiGatewayBinding, layer$16 as layer, make$16 as make, makeClient$13 as makeClient, makeClientFromAi, makeHttpClient };
|
|
96
88
|
}
|
|
97
|
-
declare const AiGatewayOperationError_base: new <A extends Record<string, any> = {}>(args:
|
|
89
|
+
declare const AiGatewayOperationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
98
90
|
readonly _tag: "AiGatewayOperationError";
|
|
99
91
|
} & Readonly<A>;
|
|
100
92
|
/** Error raised when an AI Gateway operation fails. */
|
|
@@ -194,7 +186,7 @@ declare const AnalyticsEngineDataPointSchema: Schema.Struct<{
|
|
|
194
186
|
readonly doubles: Schema.optional<Schema.$Array<Schema.Finite>>;
|
|
195
187
|
readonly blobs: Schema.optional<Schema.$Array<Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.instanceOf<ArrayBuffer, unknown>]>>>>;
|
|
196
188
|
}>;
|
|
197
|
-
declare const AnalyticsEngineOperationError_base: new <A extends Record<string, any> = {}>(args:
|
|
189
|
+
declare const AnalyticsEngineOperationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
198
190
|
readonly _tag: "AnalyticsEngineOperationError";
|
|
199
191
|
} & Readonly<A>;
|
|
200
192
|
/** Error raised when an Analytics Engine operation fails. */
|
|
@@ -209,7 +201,7 @@ interface AnalyticsEngineWriteViolation {
|
|
|
209
201
|
readonly limit?: number;
|
|
210
202
|
readonly actual?: number;
|
|
211
203
|
}
|
|
212
|
-
declare const AnalyticsEngineWriteValidationError_base: new <A extends Record<string, any> = {}>(args:
|
|
204
|
+
declare const AnalyticsEngineWriteValidationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
213
205
|
readonly _tag: "AnalyticsEngineWriteValidationError";
|
|
214
206
|
} & Readonly<A>;
|
|
215
207
|
/** Error raised when an Analytics Engine write input violates Cloudflare limits. */
|
|
@@ -219,7 +211,7 @@ declare class AnalyticsEngineWriteValidationError extends AnalyticsEngineWriteVa
|
|
|
219
211
|
readonly violations: ReadonlyArray<AnalyticsEngineWriteViolation>;
|
|
220
212
|
readonly cause?: unknown;
|
|
221
213
|
}> {}
|
|
222
|
-
declare const AnalyticsEngineQueryError_base: new <A extends Record<string, any> = {}>(args:
|
|
214
|
+
declare const AnalyticsEngineQueryError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
223
215
|
readonly _tag: "AnalyticsEngineQueryError";
|
|
224
216
|
} & Readonly<A>;
|
|
225
217
|
/** Error raised when an Analytics Engine SQL API query fails. */
|
|
@@ -346,7 +338,7 @@ declare const QueryTag: <Self>() => <Id extends string>(id: Id) => QueryTagClass
|
|
|
346
338
|
declare namespace BrowserRendering_d_exports {
|
|
347
339
|
export { BrowserRenderingBinding, BrowserRenderingBrowserClient, BrowserRenderingBrowserLike, BrowserRenderingClient, BrowserRenderingConnect, BrowserRenderingDefinition, BrowserRenderingLaunch, BrowserRenderingOperationError, BrowserRenderingPageClient, BrowserRenderingPageLike, BrowserRenderingService, LayerOptions$16 as LayerOptions, Tag$15 as Tag, TagClass$14 as TagClass, isBrowserRenderingBinding, layer$14 as layer, make$14 as make, makeClient$11 as makeClient };
|
|
348
340
|
}
|
|
349
|
-
declare const BrowserRenderingOperationError_base: new <A extends Record<string, any> = {}>(args:
|
|
341
|
+
declare const BrowserRenderingOperationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
350
342
|
readonly _tag: "BrowserRenderingOperationError";
|
|
351
343
|
} & Readonly<A>;
|
|
352
344
|
/** Error raised when a Browser Rendering operation fails. */
|
|
@@ -429,7 +421,7 @@ type CacheRequest = CloudflareRequestInfo | URL;
|
|
|
429
421
|
type CacheQueryOptions = CloudflareCacheQueryOptions;
|
|
430
422
|
/** Cache operation represented by {@link CacheOperationError}. */
|
|
431
423
|
type CacheOperation = "open" | "match" | "put" | "delete";
|
|
432
|
-
declare const CacheOperationError_base: new <A extends Record<string, any> = {}>(args:
|
|
424
|
+
declare const CacheOperationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
433
425
|
readonly _tag: "CacheOperationError";
|
|
434
426
|
} & Readonly<A>;
|
|
435
427
|
/** Error raised when a Cloudflare Cache API operation fails. */
|
|
@@ -476,7 +468,7 @@ declare namespace DurableObjectStorage_d_exports {
|
|
|
476
468
|
}
|
|
477
469
|
/** Supported primitive value types for Durable Object SQL APIs. */
|
|
478
470
|
type SqlStorageValue = globalThis.SqlStorageValue;
|
|
479
|
-
declare const StorageOperationError_base: new <A extends Record<string, any> = {}>(args:
|
|
471
|
+
declare const StorageOperationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
480
472
|
readonly _tag: "StorageOperationError";
|
|
481
473
|
} & Readonly<A>;
|
|
482
474
|
/** Error type used when a storage operation throws or rejects. */
|
|
@@ -608,21 +600,21 @@ declare namespace DurableObjectWebSocket_d_exports {
|
|
|
608
600
|
}
|
|
609
601
|
/** Data supported by Cloudflare websocket `send`. */
|
|
610
602
|
type DurableWebSocketSendData = string | ArrayBuffer | ArrayBufferView;
|
|
611
|
-
declare const DurableWebSocketSendError_base: new <A extends Record<string, any> = {}>(args:
|
|
603
|
+
declare const DurableWebSocketSendError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
612
604
|
readonly _tag: "DurableWebSocketSendError";
|
|
613
605
|
} & Readonly<A>;
|
|
614
606
|
/** Error raised when sending on a Durable Object websocket fails. */
|
|
615
607
|
declare class DurableWebSocketSendError extends DurableWebSocketSendError_base<{
|
|
616
608
|
readonly cause: unknown;
|
|
617
609
|
}> {}
|
|
618
|
-
declare const DurableWebSocketCloseError_base: new <A extends Record<string, any> = {}>(args:
|
|
610
|
+
declare const DurableWebSocketCloseError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
619
611
|
readonly _tag: "DurableWebSocketCloseError";
|
|
620
612
|
} & Readonly<A>;
|
|
621
613
|
/** Error raised when closing a Durable Object websocket fails. */
|
|
622
614
|
declare class DurableWebSocketCloseError extends DurableWebSocketCloseError_base<{
|
|
623
615
|
readonly cause: unknown;
|
|
624
616
|
}> {}
|
|
625
|
-
declare const DurableWebSocketAttachmentError_base: new <A extends Record<string, any> = {}>(args:
|
|
617
|
+
declare const DurableWebSocketAttachmentError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
626
618
|
readonly _tag: "DurableWebSocketAttachmentError";
|
|
627
619
|
} & Readonly<A>;
|
|
628
620
|
/** Error raised when serializing or deserializing a websocket attachment fails. */
|
|
@@ -779,11 +771,19 @@ declare namespace CloudflareOtlp_d_exports {
|
|
|
779
771
|
type Signal = "logs" | "traces" | "metrics";
|
|
780
772
|
/** OTLP payload serialization used by the Effect OTLP exporters. */
|
|
781
773
|
type Serialization = "json" | "protobuf";
|
|
782
|
-
/**
|
|
774
|
+
/**
|
|
775
|
+
* Resource metadata shared by Worker and Durable Object OTLP layers.
|
|
776
|
+
*
|
|
777
|
+
* Precedence follows Effect's `OtlpResource.fromConfig`: explicit
|
|
778
|
+
* `serviceName`/`serviceVersion` win over matching explicit `attributes`, and
|
|
779
|
+
* explicit attributes win over `OTEL_SERVICE_NAME`, `OTEL_SERVICE_VERSION`, and
|
|
780
|
+
* `OTEL_RESOURCE_ATTRIBUTES`. Omit an option to let operators set it from the
|
|
781
|
+
* environment.
|
|
782
|
+
*/
|
|
783
783
|
interface ResourceOptions {
|
|
784
|
-
/** Explicit service name. OTEL
|
|
784
|
+
/** Explicit service name. Takes precedence over OTEL environment variables. */
|
|
785
785
|
readonly serviceName?: string;
|
|
786
|
-
/** Explicit service version. OTEL
|
|
786
|
+
/** Explicit service version. Takes precedence over OTEL environment variables. */
|
|
787
787
|
readonly serviceVersion?: string;
|
|
788
788
|
/** Additional resource attributes attached to exported telemetry. */
|
|
789
789
|
readonly attributes?: Record<string, unknown>;
|
|
@@ -922,7 +922,7 @@ interface ContainerNamespaceDefinition {
|
|
|
922
922
|
/** Binding name as configured in `wrangler.jsonc`. */
|
|
923
923
|
readonly binding: string;
|
|
924
924
|
}
|
|
925
|
-
declare const ContainerOperationError_base: new <A extends Record<string, any> = {}>(args:
|
|
925
|
+
declare const ContainerOperationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
926
926
|
readonly _tag: "ContainerOperationError";
|
|
927
927
|
} & Readonly<A>;
|
|
928
928
|
/** Failure raised when invoking a named Container operation. */
|
|
@@ -982,7 +982,7 @@ interface ContainerNamespaceService<Id extends string> {
|
|
|
982
982
|
}
|
|
983
983
|
/** Creates a typed Effect service for a Cloudflare Container namespace. */
|
|
984
984
|
declare const Tag$14: <Self>() => <Id extends string>(id: Id) => TagClass$13<Self, Id>;
|
|
985
|
-
declare const ContainerNamespace:
|
|
985
|
+
declare const ContainerNamespace: typeof Tag$14;
|
|
986
986
|
declare namespace D1_d_exports {
|
|
987
987
|
export { D1Definition, D1Service, D1SqlLayerOptions, Service$1 as Service, make$12 as make };
|
|
988
988
|
}
|
|
@@ -1006,7 +1006,7 @@ interface D1Service<Id extends string> {
|
|
|
1006
1006
|
declare const make$12: <Id extends string>(id: Id, definition: D1Definition) => BindingService<D1Service<Id>, Id, D1Database> & {
|
|
1007
1007
|
"effect-cf/D1": "effect-cf/D1";
|
|
1008
1008
|
definition: D1Definition;
|
|
1009
|
-
sqlLayer: (options?: D1SqlLayerOptions) => Layer.Layer<D1Client.D1Client |
|
|
1009
|
+
sqlLayer: (options?: D1SqlLayerOptions) => Layer.Layer<D1Client.D1Client | import("effect/unstable/sql/SqlClient").SqlClient, BindingNotFoundError | BindingValidationError | import("effect/Config").ConfigError, WorkerEnvironment>;
|
|
1010
1010
|
};
|
|
1011
1011
|
/**
|
|
1012
1012
|
* Builds a D1 service around a Cloudflare D1 database binding.
|
|
@@ -1026,7 +1026,7 @@ declare const make$12: <Id extends string>(id: Id, definition: D1Definition) =>
|
|
|
1026
1026
|
declare const Service$1: <Self>() => <Id extends string>(id: Id, definition: D1Definition) => BindingService<Self, Id, D1Database> & {
|
|
1027
1027
|
"effect-cf/D1": "effect-cf/D1";
|
|
1028
1028
|
definition: D1Definition;
|
|
1029
|
-
sqlLayer: (options?: D1SqlLayerOptions) => Layer.Layer<D1Client.D1Client |
|
|
1029
|
+
sqlLayer: (options?: D1SqlLayerOptions) => Layer.Layer<D1Client.D1Client | import("effect/unstable/sql/SqlClient").SqlClient, BindingNotFoundError | BindingValidationError | import("effect/Config").ConfigError, WorkerEnvironment | Exclude<Exclude<Self, import("effect/Scope").Scope>, Self>>;
|
|
1030
1030
|
};
|
|
1031
1031
|
declare namespace Rpc_d_exports {
|
|
1032
1032
|
export { DisposableValue, MethodArgs, MethodKey, MethodReturn, Provider, Result$1 as Result, RpcStub, RpcTarget, Serializable, Stub, Stubable, Stubify, dispose, isDisposable, resolve, scoped };
|
|
@@ -1035,14 +1035,14 @@ type Stubable = Rpc.Stubable;
|
|
|
1035
1035
|
type Stub<T extends Stubable> = Rpc.Stub<T>;
|
|
1036
1036
|
type Provider<T extends object, Reserved extends string = never> = Rpc.Provider<T, Reserved>;
|
|
1037
1037
|
type BaseType = void | undefined | null | boolean | number | bigint | string | TypedArray | ArrayBuffer | DataView | Date | Error | RegExp | ReadableStream<Uint8Array> | WritableStream<Uint8Array> | Request | Response | Headers;
|
|
1038
|
-
type Serializable<T> = BaseType | Map<T extends Map<infer Key, unknown> ? Serializable<Key> : never, T extends Map<unknown, infer Value> ? Serializable<Value> : never> | Set<T extends Set<infer Value> ? Serializable<Value> : never> | ReadonlyArray<T extends ReadonlyArray<infer Value> ? Serializable<Value> : never> | { [Key in keyof T]: Key extends number | string ? Serializable<T[Key]> : never } | Stub<Stubable> | Stubable;
|
|
1038
|
+
type Serializable<T> = BaseType | Map<T extends Map<infer Key, unknown> ? Serializable<Key> : never, T extends Map<unknown, infer Value> ? Serializable<Value> : never> | Set<T extends Set<infer Value> ? Serializable<Value> : never> | ReadonlyArray<T extends ReadonlyArray<infer Value> ? Serializable<Value> : never> | { [Key in keyof T]: Key extends number | string ? Serializable<T[Key]> : never; } | Stub<Stubable> | Stubable;
|
|
1039
1039
|
type Stubify<T> = T extends Stubable ? Stub<T> : T extends Map<infer Key, infer Value> ? Map<Stubify<Key>, Stubify<Value>> : T extends Set<infer Value> ? Set<Stubify<Value>> : T extends Array<infer Value> ? Array<Stubify<Value>> : T extends ReadonlyArray<infer Value> ? ReadonlyArray<Stubify<Value>> : T extends BaseType ? T : T extends {
|
|
1040
1040
|
[key: string | number]: unknown;
|
|
1041
|
-
} ? { [Key in keyof T]: Stubify<T[Key]
|
|
1041
|
+
} ? { [Key in keyof T]: Stubify<T[Key]>; } : T;
|
|
1042
1042
|
type MaybeProvider<T> = T extends object ? Provider<T> : unknown;
|
|
1043
1043
|
type MaybeDisposable<T> = T extends object ? Disposable : unknown;
|
|
1044
1044
|
type Result$1<T> = T extends Stubable ? Promise<Stub<T>> & Provider<T> : T extends Serializable<T> ? Promise<Stubify<T> & MaybeDisposable<T>> & MaybeProvider<T> : never;
|
|
1045
|
-
type MethodKey<Api> = { [Key in keyof Api]-?: Key extends string ? Api[Key] extends ((...args: Array<any>) => unknown) ? Key : never : never }[keyof Api];
|
|
1045
|
+
type MethodKey<Api> = { [Key in keyof Api]-?: Key extends string ? Api[Key] extends ((...args: Array<any>) => unknown) ? Key : never : never; }[keyof Api];
|
|
1046
1046
|
type MethodArgs<Api, Method extends keyof Api> = Api[Method] extends ((...args: infer Args) => unknown) ? Args : never;
|
|
1047
1047
|
type MethodReturn<Api, Method extends keyof Api> = Api[Method] extends ((...args: Array<any>) => infer Return) ? Return : never;
|
|
1048
1048
|
type DisposableValue = {
|
|
@@ -1055,14 +1055,14 @@ declare const scoped: <A>(value: A) => Effect.Effect<Awaited<A>, unknown, Scope.
|
|
|
1055
1055
|
declare namespace RpcDefinition_d_exports {
|
|
1056
1056
|
export { Definition$9 as Definition, Method$5 as Method, Methods$4 as Methods, NoReservedMethods$4 as NoReservedMethods, ReservedMethodName$6 as ReservedMethodName, ReservedMethodNameError, RpcArgumentCountError, RpcArgumentDecodeError, RpcArgumentEncodeError, RpcReservedMethodNameError, RpcSuccessDecodeError, RpcSuccessEncodeError, ServiceFreeSchema$4 as ServiceFreeSchema, assertNoReservedMethodNames, assertNoReservedMethods, decodeArgs, decodeSuccess, encodeArgs, encodeSuccess, make$11 as make, method$4 as method, reservedMethodNames };
|
|
1057
1057
|
}
|
|
1058
|
-
declare const RpcReservedMethodNameError_base: new <A extends Record<string, any> = {}>(args:
|
|
1058
|
+
declare const RpcReservedMethodNameError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1059
1059
|
readonly _tag: "RpcReservedMethodNameError";
|
|
1060
1060
|
} & Readonly<A>;
|
|
1061
1061
|
declare class RpcReservedMethodNameError extends RpcReservedMethodNameError_base<{
|
|
1062
1062
|
readonly definition: string;
|
|
1063
1063
|
readonly method: string;
|
|
1064
1064
|
}> {}
|
|
1065
|
-
declare const RpcArgumentCountError_base: new <A extends Record<string, any> = {}>(args:
|
|
1065
|
+
declare const RpcArgumentCountError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1066
1066
|
readonly _tag: "RpcArgumentCountError";
|
|
1067
1067
|
} & Readonly<A>;
|
|
1068
1068
|
declare class RpcArgumentCountError extends RpcArgumentCountError_base<{
|
|
@@ -1071,7 +1071,7 @@ declare class RpcArgumentCountError extends RpcArgumentCountError_base<{
|
|
|
1071
1071
|
readonly expected: number;
|
|
1072
1072
|
readonly actual: number;
|
|
1073
1073
|
}> {}
|
|
1074
|
-
declare const RpcArgumentDecodeError_base: new <A extends Record<string, any> = {}>(args:
|
|
1074
|
+
declare const RpcArgumentDecodeError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1075
1075
|
readonly _tag: "RpcArgumentDecodeError";
|
|
1076
1076
|
} & Readonly<A>;
|
|
1077
1077
|
declare class RpcArgumentDecodeError extends RpcArgumentDecodeError_base<{
|
|
@@ -1080,7 +1080,7 @@ declare class RpcArgumentDecodeError extends RpcArgumentDecodeError_base<{
|
|
|
1080
1080
|
readonly index: number;
|
|
1081
1081
|
readonly cause: unknown;
|
|
1082
1082
|
}> {}
|
|
1083
|
-
declare const RpcArgumentEncodeError_base: new <A extends Record<string, any> = {}>(args:
|
|
1083
|
+
declare const RpcArgumentEncodeError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1084
1084
|
readonly _tag: "RpcArgumentEncodeError";
|
|
1085
1085
|
} & Readonly<A>;
|
|
1086
1086
|
declare class RpcArgumentEncodeError extends RpcArgumentEncodeError_base<{
|
|
@@ -1089,7 +1089,7 @@ declare class RpcArgumentEncodeError extends RpcArgumentEncodeError_base<{
|
|
|
1089
1089
|
readonly index: number;
|
|
1090
1090
|
readonly cause: unknown;
|
|
1091
1091
|
}> {}
|
|
1092
|
-
declare const RpcSuccessDecodeError_base: new <A extends Record<string, any> = {}>(args:
|
|
1092
|
+
declare const RpcSuccessDecodeError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1093
1093
|
readonly _tag: "RpcSuccessDecodeError";
|
|
1094
1094
|
} & Readonly<A>;
|
|
1095
1095
|
declare class RpcSuccessDecodeError extends RpcSuccessDecodeError_base<{
|
|
@@ -1097,7 +1097,7 @@ declare class RpcSuccessDecodeError extends RpcSuccessDecodeError_base<{
|
|
|
1097
1097
|
readonly method: string;
|
|
1098
1098
|
readonly cause: unknown;
|
|
1099
1099
|
}> {}
|
|
1100
|
-
declare const RpcSuccessEncodeError_base: new <A extends Record<string, any> = {}>(args:
|
|
1100
|
+
declare const RpcSuccessEncodeError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1101
1101
|
readonly _tag: "RpcSuccessEncodeError";
|
|
1102
1102
|
} & Readonly<A>;
|
|
1103
1103
|
declare class RpcSuccessEncodeError extends RpcSuccessEncodeError_base<{
|
|
@@ -1130,7 +1130,7 @@ interface Definition$9<Id extends string = string, MethodsShape extends Methods$
|
|
|
1130
1130
|
}
|
|
1131
1131
|
declare namespace Definition$9 {
|
|
1132
1132
|
type Any = Definition$9<string, Methods$4>;
|
|
1133
|
-
type ServerApi<Self extends Any> = { readonly [Key in keyof Self["methods"]]: (...args: Method$5.Args<Self["methods"][Key]>) => Promise<Method$5.Success<Self["methods"][Key]
|
|
1133
|
+
type ServerApi<Self extends Any> = { readonly [Key in keyof Self["methods"]]: (...args: Method$5.Args<Self["methods"][Key]>) => Promise<Method$5.Success<Self["methods"][Key]>>; };
|
|
1134
1134
|
type Api<Self extends Any, Reserved extends string = never> = Provider<ServerApi<Self>, Reserved>;
|
|
1135
1135
|
type MethodNames<Self extends Any> = Extract<keyof Self["methods"], string>;
|
|
1136
1136
|
}
|
|
@@ -1175,7 +1175,7 @@ interface QueueBindingClient<Message extends ServiceFreeSchema$4> {
|
|
|
1175
1175
|
readonly metrics: () => Effect.Effect<QueueMetrics, QueueOperationError>;
|
|
1176
1176
|
readonly unsafeRaw: Effect.Effect<CloudflareQueue<Schema.Codec.Encoded<Message>>>;
|
|
1177
1177
|
}
|
|
1178
|
-
declare const QueueOperationError_base: new <A extends Record<string, any> = {}>(args:
|
|
1178
|
+
declare const QueueOperationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1179
1179
|
readonly _tag: "QueueOperationError";
|
|
1180
1180
|
} & Readonly<A>;
|
|
1181
1181
|
declare class QueueOperationError extends QueueOperationError_base<{
|
|
@@ -1186,7 +1186,7 @@ declare class QueueOperationError extends QueueOperationError_base<{
|
|
|
1186
1186
|
}> {}
|
|
1187
1187
|
declare const isQueue: <Body>(value: unknown) => value is QueueProducer<Body>;
|
|
1188
1188
|
declare const makeClient$8: <Message extends ServiceFreeSchema$4>(definition: QueueBindingDefinition<Message>) => ((queue: QueueProducer<Schema.Codec.Encoded<Message>>) => QueueBindingClient<Message>);
|
|
1189
|
-
declare const layer$10: <Self, Message extends ServiceFreeSchema$4>(tag: Context.Service<Self, QueueBindingClient<Message>>, definition: QueueBindingDefinition<Message>) =>
|
|
1189
|
+
declare const layer$10: <Self, Message extends ServiceFreeSchema$4>(tag: Context.Service<Self, QueueBindingClient<Message>>, definition: QueueBindingDefinition<Message>) => import("effect/Layer").Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1190
1190
|
declare namespace QueueDefinition_d_exports {
|
|
1191
1191
|
export { Definition$8 as Definition, Handler$3 as Handler, LayerOptions$13 as LayerOptions, Options$7 as Options, Queue$1 as Queue, Tag$13 as Tag, TagClass$12 as TagClass, implement$7 as implement, make$10 as make };
|
|
1192
1192
|
}
|
|
@@ -1221,9 +1221,7 @@ declare const make$10: <Id extends string, Message extends ServiceFreeSchema$4>(
|
|
|
1221
1221
|
declare const Tag$13: <Self>() => <Id extends string, Message extends ServiceFreeSchema$4>(id: Id, definition: {
|
|
1222
1222
|
readonly message: Message;
|
|
1223
1223
|
}) => TagClass$12<Self, Id, Message>;
|
|
1224
|
-
declare const Queue$1:
|
|
1225
|
-
readonly message: Message;
|
|
1226
|
-
}) => TagClass$12<Self, Id, Message>;
|
|
1224
|
+
declare const Queue$1: typeof Tag$13;
|
|
1227
1225
|
declare const implement$7: <ROut, const Self extends Definition$8.Any>(_definition: Self, handler: Handler$3<ROut, Self>) => Handler$3<ROut, Self>;
|
|
1228
1226
|
declare namespace Queue_d_exports {
|
|
1229
1227
|
export { Definition$7 as Definition, Handler$2 as Handler, LayerOptions$12 as LayerOptions, Options$6 as Options, QueueBatch, QueueHandler, QueueMessage, QueueMessageDecodeError, QueueOptions, Tag$12 as Tag, TagClass$11 as TagClass, decodeBatch, fromMessage, fromMessageBatch, implement$6 as implement };
|
|
@@ -1245,7 +1243,7 @@ interface QueueBatch<Body> {
|
|
|
1245
1243
|
readonly ackAll: Effect.Effect<void>;
|
|
1246
1244
|
readonly retryAll: (options?: globalThis.QueueRetryOptions) => Effect.Effect<void>;
|
|
1247
1245
|
}
|
|
1248
|
-
declare const QueueMessageDecodeError_base: new <A extends Record<string, any> = {}>(args:
|
|
1246
|
+
declare const QueueMessageDecodeError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1249
1247
|
readonly _tag: "QueueMessageDecodeError";
|
|
1250
1248
|
} & Readonly<A>;
|
|
1251
1249
|
declare class QueueMessageDecodeError extends QueueMessageDecodeError_base<{
|
|
@@ -1280,7 +1278,7 @@ type TagClass$11<Self, Id extends string, Message extends Definition$8.Any["mess
|
|
|
1280
1278
|
declare const Tag$12: <Self>() => <Id extends string, Message extends Definition$8.Any["message"]>(id: Id, definition: {
|
|
1281
1279
|
readonly message: Message;
|
|
1282
1280
|
}) => TagClass$11<Self, Id, Message>;
|
|
1283
|
-
declare const implement$6:
|
|
1281
|
+
declare const implement$6: typeof implement$7;
|
|
1284
1282
|
type Handler$2<ROut, Self extends Definition$8.Any> = Handler$3<ROut, Self>;
|
|
1285
1283
|
type Options$6<ROut, Self extends Definition$8.Any> = Options$7<ROut, Self>;
|
|
1286
1284
|
declare namespace WorkerDefinition_d_exports {
|
|
@@ -1320,12 +1318,12 @@ type NoReservedMethods$3<MethodsShape extends Methods$3> = Extract<keyof Methods
|
|
|
1320
1318
|
/**
|
|
1321
1319
|
* Promise-based client API derived from a {@link Definition}.
|
|
1322
1320
|
*/
|
|
1323
|
-
type ServerApi$4<Self extends Definition$6.Any> = { readonly [Key in keyof Self["methods"]]: (...args: Method$4.Args<Self["methods"][Key]>) => Promise<Method$4.Success<Self["methods"][Key]
|
|
1321
|
+
type ServerApi$4<Self extends Definition$6.Any> = { readonly [Key in keyof Self["methods"]]: (...args: Method$4.Args<Self["methods"][Key]>) => Promise<Method$4.Success<Self["methods"][Key]>>; };
|
|
1324
1322
|
type Api$3<Self extends Definition$6.Any> = Provider<ServerApi$4<Self>, ReservedMethodName$5>;
|
|
1325
1323
|
/**
|
|
1326
1324
|
* Effect handlers for each RPC method in a worker definition.
|
|
1327
1325
|
*/
|
|
1328
|
-
type Handlers$3<ROut, Self extends Definition$6.Any> = { readonly [Key in keyof Self["methods"]]: (...args: Method$4.Args<Self["methods"][Key]>) => WorkerRpcHandler<ROut, Method$4.Success<Self["methods"][Key]
|
|
1326
|
+
type Handlers$3<ROut, Self extends Definition$6.Any> = { readonly [Key in keyof Self["methods"]]: (...args: Method$4.Args<Self["methods"][Key]>) => WorkerRpcHandler<ROut, Method$4.Success<Self["methods"][Key]>>; };
|
|
1329
1327
|
/**
|
|
1330
1328
|
* Worker constructor options for a specific RPC definition.
|
|
1331
1329
|
*/
|
|
@@ -1348,14 +1346,14 @@ declare const method$3: {
|
|
|
1348
1346
|
<Success extends ServiceFreeSchema$3>(definition: {
|
|
1349
1347
|
readonly success: Success;
|
|
1350
1348
|
}): Method$4<readonly [], Success>;
|
|
1351
|
-
<const Args extends
|
|
1349
|
+
<const Args extends ReadonlyArray<ServiceFreeSchema$3>, Success extends ServiceFreeSchema$3>(definition: {
|
|
1352
1350
|
readonly args: Args;
|
|
1353
1351
|
readonly success: Success;
|
|
1354
1352
|
}): Method$4<Args, Success>;
|
|
1355
1353
|
};
|
|
1356
1354
|
declare const make$9: <Id extends string, const MethodsShape extends Methods$3>(id: Id, methods: MethodsShape & NoReservedMethods$3<MethodsShape>) => TagClass$10<Definition$6<Id, MethodsShape>, Id, MethodsShape>;
|
|
1357
1355
|
declare const Tag$11: <Self>() => <Id extends string, const MethodsShape extends Methods$3>(id: Id, methods: MethodsShape & NoReservedMethods$3<MethodsShape>) => TagClass$10<Self, Id, MethodsShape>;
|
|
1358
|
-
declare const Worker:
|
|
1356
|
+
declare const Worker: typeof Tag$11;
|
|
1359
1357
|
/**
|
|
1360
1358
|
* Helper for implementing handlers with the exact method shape of a definition.
|
|
1361
1359
|
*/
|
|
@@ -1367,7 +1365,7 @@ type HandlerEffect$3<ROut, Self extends Definition$6.Any, Key extends keyof Self
|
|
|
1367
1365
|
//#endregion
|
|
1368
1366
|
//#region src/internal/RpcInvocation.d.ts
|
|
1369
1367
|
type AnyArgs = Array<any>;
|
|
1370
|
-
type AsyncMethodKey<Api> = { [Key in keyof Api]-?: Key extends string ? Api[Key] extends ((...args: AnyArgs) => Promise<unknown>) ? Key : never : never }[keyof Api];
|
|
1368
|
+
type AsyncMethodKey<Api> = { [Key in keyof Api]-?: Key extends string ? Api[Key] extends ((...args: AnyArgs) => Promise<unknown>) ? Key : never : never; }[keyof Api];
|
|
1371
1369
|
type AsyncMethodArgs<Api, Method extends keyof Api> = Api[Method] extends ((...args: infer Args) => Promise<unknown>) ? Args : never;
|
|
1372
1370
|
type AsyncMethodSuccess<Api, Method extends keyof Api> = Api[Method] extends ((...args: AnyArgs) => Promise<infer A>) ? A : never;
|
|
1373
1371
|
type AsyncMethodCloudflareReturn<Api, Method extends keyof Api> = Result$1<AsyncMethodSuccess<Api, Method>>;
|
|
@@ -1381,7 +1379,7 @@ declare const TypeId$1: "effect-cf/ServiceBinding";
|
|
|
1381
1379
|
interface ServiceFetcher {
|
|
1382
1380
|
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
1383
1381
|
}
|
|
1384
|
-
type RpcClient$1<Api> = { readonly [Key in keyof Api as Key extends string ? Api[Key] extends ((...args: Array<any>) => unknown) ? Key : never : never]: Api[Key] };
|
|
1382
|
+
type RpcClient$1<Api> = { readonly [Key in keyof Api as Key extends string ? Api[Key] extends ((...args: Array<any>) => unknown) ? Key : never : never]: Api[Key]; };
|
|
1385
1383
|
type ReservedMethodName$4 = ReservedMethodName$5 | "fetch";
|
|
1386
1384
|
/**
|
|
1387
1385
|
* Native Cloudflare service object including optional RPC methods.
|
|
@@ -1398,7 +1396,7 @@ interface ServiceBindingDefinition<Definition extends Definition$6.Any | undefin
|
|
|
1398
1396
|
/** Optional RPC schema used for argument/result encoding. */
|
|
1399
1397
|
readonly definition?: Definition;
|
|
1400
1398
|
}
|
|
1401
|
-
declare const ServiceBindingFetchError_base: new <A extends Record<string, any> = {}>(args:
|
|
1399
|
+
declare const ServiceBindingFetchError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1402
1400
|
readonly _tag: "ServiceBindingFetchError";
|
|
1403
1401
|
} & Readonly<A>;
|
|
1404
1402
|
/**
|
|
@@ -1408,7 +1406,7 @@ declare class ServiceBindingFetchError extends ServiceBindingFetchError_base<{
|
|
|
1408
1406
|
readonly binding: string;
|
|
1409
1407
|
readonly cause: unknown;
|
|
1410
1408
|
}> {}
|
|
1411
|
-
declare const ServiceBindingRpcError_base: new <A extends Record<string, any> = {}>(args:
|
|
1409
|
+
declare const ServiceBindingRpcError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1412
1410
|
readonly _tag: "ServiceBindingRpcError";
|
|
1413
1411
|
} & Readonly<A>;
|
|
1414
1412
|
/**
|
|
@@ -1424,7 +1422,7 @@ type ServiceMethodArgs<Api, Method extends keyof Api> = AsyncMethodArgs<Api, Met
|
|
|
1424
1422
|
type ServiceMethodSuccess<Api, Method extends keyof Api> = AsyncMethodSuccess<Api, Method>;
|
|
1425
1423
|
type ServiceMethodCloudflareReturn<Api, Method extends keyof Api> = AsyncMethodCloudflareReturn<Api, Method>;
|
|
1426
1424
|
type ServiceCall<R, Api> = <Method extends ServiceMethodKey<Api>>(method: Method, ...args: ServiceMethodArgs<Api, Method>) => Effect.Effect<ServiceMethodSuccess<Api, Method>, ServiceBindingRpcError, R>;
|
|
1427
|
-
type DefinitionDirectMethods<R, Definition extends Definition$6.Any> = { readonly [Method in Definition$9.MethodNames<Definition>]: (...args: Method$5.Args<Definition["methods"][Method]>) => Effect.Effect<Method$5.Success<Definition["methods"][Method]>, ServiceBindingRpcError, R
|
|
1425
|
+
type DefinitionDirectMethods<R, Definition extends Definition$6.Any> = { readonly [Method in Definition$9.MethodNames<Definition>]: (...args: Method$5.Args<Definition["methods"][Method]>) => Effect.Effect<Method$5.Success<Definition["methods"][Method]>, ServiceBindingRpcError, R>; };
|
|
1428
1426
|
type DirectMethods$1<R, Definition> = Definition extends Definition$6.Any ? DefinitionDirectMethods<R, Definition> : {};
|
|
1429
1427
|
type ServiceBindingEffectClient<Api extends object, Definition extends Definition$6.Any | undefined = undefined> = DirectMethods$1<never, Definition> & {
|
|
1430
1428
|
/**
|
|
@@ -1519,7 +1517,7 @@ type ServiceBindingStaticClient<R, Api extends object, Definition extends Defini
|
|
|
1519
1517
|
};
|
|
1520
1518
|
declare const isServiceBindingClient: <Api extends object>(value: unknown) => value is ServiceBindingClient<Api>;
|
|
1521
1519
|
declare const makeClient$7: <Api extends object, const Definition extends Definition$6.Any | undefined = undefined>(definition: ServiceBindingDefinition<Definition>) => ((service: ServiceBindingClient<Api>) => ServiceBindingEffectClient<Api, Definition>);
|
|
1522
|
-
declare const layer$9: <Self, Api extends object, const Definition extends Definition$6.Any | undefined = undefined>(tag: Context.Service<Self, ServiceBindingEffectClient<Api, Definition>>, definition: ServiceBindingDefinition<Definition>) =>
|
|
1520
|
+
declare const layer$9: <Self, Api extends object, const Definition extends Definition$6.Any | undefined = undefined>(tag: Context.Service<Self, ServiceBindingEffectClient<Api, Definition>>, definition: ServiceBindingDefinition<Definition>) => import("effect/Layer").Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1523
1521
|
/**
|
|
1524
1522
|
* Creates a typed Effect service for a Worker service binding.
|
|
1525
1523
|
*
|
|
@@ -1586,8 +1584,8 @@ type WorkerFetchSuccess = Response | HttpServerResponse.HttpServerResponse;
|
|
|
1586
1584
|
type WorkerHandler<ROut, A = WorkerFetchSuccess> = Effect.Effect<A, unknown, WorkerFetchContext<ROut>>;
|
|
1587
1585
|
type WorkerRpcHandler<ROut, A = unknown> = Effect.Effect<A, unknown, WorkerRpcContext<ROut>>;
|
|
1588
1586
|
type WorkerRpc<ROut> = Record<string, (...args: Array<any>) => WorkerRpcHandler<ROut>>;
|
|
1589
|
-
type WorkerRpcShape<Rpc extends WorkerRpc<ROut>, ROut> = { readonly [Key in keyof Rpc]: Rpc[Key] extends ((...args: infer Args) => Effect.Effect<infer A, unknown, WorkerRpcContext<ROut>>) ? (...args: Args) => Promise<A> : never };
|
|
1590
|
-
type RpcHandlers$1<ROut, Api> = { readonly [Key in keyof Api as Key extends keyof WorkerEntrypoint ? never : Key extends string ? Key extends ReservedMethodName$3 ? never : [Api[Key]] extends [never] ? never : Api[Key] extends ((...args: Array<any>) => Promise<unknown>) ? Key : never : never]: Api[Key] extends ((...args: infer Args) => Promise<infer A>) ? (...args: Args) => WorkerRpcHandler<ROut, A> : never };
|
|
1587
|
+
type WorkerRpcShape<Rpc extends WorkerRpc<ROut>, ROut> = { readonly [Key in keyof Rpc]: Rpc[Key] extends ((...args: infer Args) => Effect.Effect<infer A, unknown, WorkerRpcContext<ROut>>) ? (...args: Args) => Promise<A> : never; };
|
|
1588
|
+
type RpcHandlers$1<ROut, Api> = { readonly [Key in keyof Api as Key extends keyof WorkerEntrypoint ? never : Key extends string ? Key extends ReservedMethodName$3 ? never : [Api[Key]] extends [never] ? never : Api[Key] extends ((...args: Array<any>) => Promise<unknown>) ? Key : never : never]: Api[Key] extends ((...args: infer Args) => Promise<infer A>) ? (...args: Args) => WorkerRpcHandler<ROut, A> : never; };
|
|
1591
1589
|
interface WorkerOptions<RRuntime, REvent = never, EventLayerError = never, Rpc extends WorkerRpc<RRuntime | REvent> = Record<never, never>> {
|
|
1592
1590
|
/**
|
|
1593
1591
|
* Layer provided around each Cloudflare event handled by this Worker.
|
|
@@ -1636,9 +1634,9 @@ interface Definition$5<Id extends string = string, MethodsShape extends Methods$
|
|
|
1636
1634
|
declare namespace Definition$5 {
|
|
1637
1635
|
type Any = Definition$5<string, Methods$2>;
|
|
1638
1636
|
}
|
|
1639
|
-
type ServerApi$3<Self extends Definition$5.Any> = { readonly [Key in keyof Self["methods"]]: (...args: Method$3.Args<Self["methods"][Key]>) => Promise<Method$3.Success<Self["methods"][Key]
|
|
1637
|
+
type ServerApi$3<Self extends Definition$5.Any> = { readonly [Key in keyof Self["methods"]]: (...args: Method$3.Args<Self["methods"][Key]>) => Promise<Method$3.Success<Self["methods"][Key]>>; };
|
|
1640
1638
|
type Api$2<Self extends Definition$5.Any> = Provider<ServerApi$3<Self>, ReservedMethodName$3>;
|
|
1641
|
-
type Handlers$2<ROut, Self extends Definition$5.Any> = { readonly [Key in keyof Self["methods"]]: (...args: Method$3.Args<Self["methods"][Key]>) => WorkerRpcHandler<ROut, Method$3.Success<Self["methods"][Key]
|
|
1639
|
+
type Handlers$2<ROut, Self extends Definition$5.Any> = { readonly [Key in keyof Self["methods"]]: (...args: Method$3.Args<Self["methods"][Key]>) => WorkerRpcHandler<ROut, Method$3.Success<Self["methods"][Key]>>; };
|
|
1642
1640
|
interface Options$4<ROut, Self extends Definition$5.Any, REvent = never, EventLayerError = never> extends Omit<WorkerOptions<ROut, REvent, EventLayerError, Handlers$2<ROut | REvent, Self>>, "rpc"> {
|
|
1643
1641
|
readonly rpc: Handlers$2<ROut | REvent, Self>;
|
|
1644
1642
|
}
|
|
@@ -1655,7 +1653,7 @@ declare const method$2: {
|
|
|
1655
1653
|
<Success extends ServiceFreeSchema$2>(definition: {
|
|
1656
1654
|
readonly success: Success;
|
|
1657
1655
|
}): Method$3<readonly [], Success>;
|
|
1658
|
-
<const Args extends
|
|
1656
|
+
<const Args extends ReadonlyArray<ServiceFreeSchema$2>, Success extends ServiceFreeSchema$2>(definition: {
|
|
1659
1657
|
readonly args: Args;
|
|
1660
1658
|
readonly success: Success;
|
|
1661
1659
|
}): Method$3<Args, Success>;
|
|
@@ -1668,7 +1666,7 @@ declare namespace DurableObjectNamespace_d_exports {
|
|
|
1668
1666
|
interface DurableObjectFetcher {
|
|
1669
1667
|
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
1670
1668
|
}
|
|
1671
|
-
type RpcClient<Api> = { readonly [Key in keyof Api as Key extends string ? Api[Key] extends ((...args: Array<any>) => unknown) ? Key : never : never]: Api[Key] };
|
|
1669
|
+
type RpcClient<Api> = { readonly [Key in keyof Api as Key extends string ? Api[Key] extends ((...args: Array<any>) => unknown) ? Key : never : never]: Api[Key]; };
|
|
1672
1670
|
type ReservedMethodName$2 = ReservedMethodName$1 | "fetch";
|
|
1673
1671
|
/**
|
|
1674
1672
|
* Cloudflare Durable Object stub, optionally enriched with RPC methods.
|
|
@@ -1709,7 +1707,7 @@ interface DurableObjectNamespaceBindingDefinition<Definition extends Definition$
|
|
|
1709
1707
|
/** Optional RPC schema used for argument/result encoding. */
|
|
1710
1708
|
readonly definition?: Definition;
|
|
1711
1709
|
}
|
|
1712
|
-
declare const DurableObjectRpcError_base: new <A extends Record<string, any> = {}>(args:
|
|
1710
|
+
declare const DurableObjectRpcError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1713
1711
|
readonly _tag: "DurableObjectRpcError";
|
|
1714
1712
|
} & Readonly<A>;
|
|
1715
1713
|
/**
|
|
@@ -1720,7 +1718,7 @@ declare class DurableObjectRpcError extends DurableObjectRpcError_base<{
|
|
|
1720
1718
|
readonly method: string;
|
|
1721
1719
|
readonly cause: unknown;
|
|
1722
1720
|
}> {}
|
|
1723
|
-
declare const DurableObjectFetchError_base: new <A extends Record<string, any> = {}>(args:
|
|
1721
|
+
declare const DurableObjectFetchError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1724
1722
|
readonly _tag: "DurableObjectFetchError";
|
|
1725
1723
|
} & Readonly<A>;
|
|
1726
1724
|
/**
|
|
@@ -1735,21 +1733,27 @@ type StubMethodArgs<Api, Method extends keyof Api> = AsyncMethodArgs<Api, Method
|
|
|
1735
1733
|
type StubMethodSuccess<Api, Method extends keyof Api> = AsyncMethodSuccess<Api, Method>;
|
|
1736
1734
|
type StubMethodCloudflareReturn<Api, Method extends keyof Api> = AsyncMethodCloudflareReturn<Api, Method>;
|
|
1737
1735
|
type StubCall<R, Api extends object> = <Method extends StubMethodKey<Api>>(stub: DurableObjectStubClient<Api>, method: Method, ...args: StubMethodArgs<Api, Method>) => Effect.Effect<StubMethodSuccess<Api, Method>, DurableObjectRpcError, R>;
|
|
1738
|
-
type DefinitionNamespaceDirectMethods<R, Api extends object, Definition extends Definition$4.Any> = { readonly [Method in Definition$9.MethodNames<Definition>]: (stub: DurableObjectStubClient<Api>, ...args: Method$5.Args<Definition["methods"][Method]>) => Effect.Effect<Method$5.Success<Definition["methods"][Method]>, DurableObjectRpcError, R
|
|
1736
|
+
type DefinitionNamespaceDirectMethods<R, Api extends object, Definition extends Definition$4.Any> = { readonly [Method in Definition$9.MethodNames<Definition>]: (stub: DurableObjectStubClient<Api>, ...args: Method$5.Args<Definition["methods"][Method]>) => Effect.Effect<Method$5.Success<Definition["methods"][Method]>, DurableObjectRpcError, R>; };
|
|
1739
1737
|
type DefinitionDurableObjectDirectClient<R, Definition extends Definition$4.Any> = {
|
|
1740
1738
|
readonly fetch: (input: RequestInfo | URL, init?: RequestInit) => Effect.Effect<globalThis.Response, DurableObjectFetchError, R>;
|
|
1741
|
-
} & { readonly [Method in Definition$9.MethodNames<Definition>]: (...args: Method$5.Args<Definition["methods"][Method]>) => Effect.Effect<Method$5.Success<Definition["methods"][Method]>, DurableObjectRpcError, R
|
|
1739
|
+
} & { readonly [Method in Definition$9.MethodNames<Definition>]: (...args: Method$5.Args<Definition["methods"][Method]>) => Effect.Effect<Method$5.Success<Definition["methods"][Method]>, DurableObjectRpcError, R>; };
|
|
1742
1740
|
type DefinitionNamespaceDirectClientMethods<R, Definition extends Definition$4.Any> = {
|
|
1743
1741
|
readonly byName: (name: string, options?: globalThis.DurableObjectNamespaceGetDurableObjectOptions) => DefinitionDurableObjectDirectClient<R, Definition>;
|
|
1744
1742
|
readonly byId: (id: globalThis.DurableObjectId, options?: globalThis.DurableObjectNamespaceGetDurableObjectOptions) => DefinitionDurableObjectDirectClient<R, Definition>;
|
|
1745
1743
|
};
|
|
1746
1744
|
type DirectMethods<R, Api extends object, Definition> = Definition extends Definition$4.Any ? DefinitionNamespaceDirectMethods<R, Api, Definition> & DefinitionNamespaceDirectClientMethods<R, Definition> : {};
|
|
1747
1745
|
type DurableObjectNamespaceEffectClient<Api extends object, Definition extends Definition$4.Any | undefined = undefined> = DirectMethods<never, Api, Definition> & {
|
|
1748
|
-
/** Creates a globally unique Durable Object id. */
|
|
1749
|
-
readonly
|
|
1750
|
-
|
|
1751
|
-
readonly
|
|
1752
|
-
|
|
1746
|
+
/** Creates a globally unique Durable Object id. */
|
|
1747
|
+
readonly newUniqueId: (options?: globalThis.DurableObjectNamespaceNewUniqueIdOptions) => Effect.Effect<globalThis.DurableObjectId>;
|
|
1748
|
+
/** Deterministically maps a name to a Durable Object id. */
|
|
1749
|
+
readonly idFromName: (name: string) => Effect.Effect<globalThis.DurableObjectId>;
|
|
1750
|
+
/** Rehydrates a Durable Object id from its string form. */
|
|
1751
|
+
readonly idFromString: (id: string) => Effect.Effect<globalThis.DurableObjectId>;
|
|
1752
|
+
/** Returns a stub for an existing Durable Object id. */
|
|
1753
|
+
readonly get: (id: globalThis.DurableObjectId, options?: globalThis.DurableObjectNamespaceGetDurableObjectOptions) => Effect.Effect<DurableObjectStubClient<Api>>;
|
|
1754
|
+
/** Returns a stub by deterministic name. */
|
|
1755
|
+
readonly getByName: (name: string, options?: globalThis.DurableObjectNamespaceGetDurableObjectOptions) => Effect.Effect<DurableObjectStubClient<Api>>;
|
|
1756
|
+
/** Selects a namespace pinned to a specific jurisdiction. */
|
|
1753
1757
|
readonly jurisdiction: (jurisdiction: globalThis.DurableObjectJurisdiction) => Effect.Effect<DurableObjectNamespaceClient<Api>>;
|
|
1754
1758
|
/**
|
|
1755
1759
|
* Forwards an HTTP request to a Durable Object stub.
|
|
@@ -1862,7 +1866,7 @@ type DurableObjectNamespaceStaticClient<R, Api extends object, Definition extend
|
|
|
1862
1866
|
};
|
|
1863
1867
|
declare const isDurableObjectNamespaceClient: <Api extends object>(value: unknown) => value is DurableObjectNamespaceClient<Api>;
|
|
1864
1868
|
declare const makeClient$6: <Api extends object, const Definition extends Definition$4.Any | undefined = undefined>(definition: DurableObjectNamespaceBindingDefinition<Definition>) => ((namespace: DurableObjectNamespaceClient<Api>) => DurableObjectNamespaceEffectClient<Api, Definition>);
|
|
1865
|
-
declare const layer$8: <Self, Api extends object, const Definition extends Definition$4.Any | undefined = undefined>(tag: Context.Service<Self, DurableObjectNamespaceEffectClient<Api, Definition>>, definition: DurableObjectNamespaceBindingDefinition<Definition>) =>
|
|
1869
|
+
declare const layer$8: <Self, Api extends object, const Definition extends Definition$4.Any | undefined = undefined>(tag: Context.Service<Self, DurableObjectNamespaceEffectClient<Api, Definition>>, definition: DurableObjectNamespaceBindingDefinition<Definition>) => import("effect/Layer").Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1866
1870
|
declare const makeDirectMethods: <R, Api extends object, Definition extends Definition$4.Any | undefined>(rpcDefinition: Definition | undefined, helpers: {
|
|
1867
1871
|
readonly call: StubCall<R, Api>;
|
|
1868
1872
|
readonly fetch: (stub: DurableObjectStubClient<Api>, input: RequestInfo | URL, init?: RequestInit) => Effect.Effect<globalThis.Response, DurableObjectFetchError, R>;
|
|
@@ -1903,12 +1907,12 @@ type NoReservedMethods$1<MethodsShape extends Methods$1> = Extract<keyof Methods
|
|
|
1903
1907
|
/**
|
|
1904
1908
|
* Promise-based client API derived from a Durable Object definition.
|
|
1905
1909
|
*/
|
|
1906
|
-
type ServerApi$2<Self extends Definition$4.Any> = { readonly [Key in keyof Self["methods"]]: (...args: Method$2.Args<Self["methods"][Key]>) => Promise<Method$2.Success<Self["methods"][Key]
|
|
1910
|
+
type ServerApi$2<Self extends Definition$4.Any> = { readonly [Key in keyof Self["methods"]]: (...args: Method$2.Args<Self["methods"][Key]>) => Promise<Method$2.Success<Self["methods"][Key]>>; };
|
|
1907
1911
|
type Api$1<Self extends Definition$4.Any> = Provider<ServerApi$2<Self>, ReservedMethodName$1>;
|
|
1908
1912
|
/**
|
|
1909
1913
|
* Effect handlers for each RPC method in a Durable Object definition.
|
|
1910
1914
|
*/
|
|
1911
|
-
type Handlers$1<ROut, Self extends Definition$4.Any> = { readonly [Key in keyof Self["methods"]]: (...args: Method$2.Args<Self["methods"][Key]>) => DurableObjectHandler<ROut, Method$2.Success<Self["methods"][Key]
|
|
1915
|
+
type Handlers$1<ROut, Self extends Definition$4.Any> = { readonly [Key in keyof Self["methods"]]: (...args: Method$2.Args<Self["methods"][Key]>) => DurableObjectHandler<ROut, Method$2.Success<Self["methods"][Key]>>; };
|
|
1912
1916
|
/**
|
|
1913
1917
|
* Durable Object constructor options for a specific RPC definition.
|
|
1914
1918
|
*/
|
|
@@ -1931,14 +1935,14 @@ declare const method$1: {
|
|
|
1931
1935
|
<Success extends ServiceFreeSchema$1>(definition: {
|
|
1932
1936
|
readonly success: Success;
|
|
1933
1937
|
}): Method$2<readonly [], Success>;
|
|
1934
|
-
<const Args extends
|
|
1938
|
+
<const Args extends ReadonlyArray<ServiceFreeSchema$1>, Success extends ServiceFreeSchema$1>(definition: {
|
|
1935
1939
|
readonly args: Args;
|
|
1936
1940
|
readonly success: Success;
|
|
1937
1941
|
}): Method$2<Args, Success>;
|
|
1938
1942
|
};
|
|
1939
1943
|
declare const make$7: <Id extends string, const MethodsShape extends Methods$1>(id: Id, methods: MethodsShape & NoReservedMethods$1<MethodsShape>) => TagClass$8<Definition$4<Id, MethodsShape>, Id, MethodsShape>;
|
|
1940
1944
|
declare const Tag$9: <Self>() => <Id extends string, const MethodsShape extends Methods$1>(id: Id, methods: MethodsShape & NoReservedMethods$1<MethodsShape>) => TagClass$8<Self, Id, MethodsShape>;
|
|
1941
|
-
declare const DurableObject$1:
|
|
1945
|
+
declare const DurableObject$1: typeof Tag$9;
|
|
1942
1946
|
/**
|
|
1943
1947
|
* Helper for implementing handlers with the exact method shape of a definition.
|
|
1944
1948
|
*/
|
|
@@ -1961,8 +1965,8 @@ type DurableObjectHandler<ROut, A = unknown> = Effect.Effect<A, unknown, Handler
|
|
|
1961
1965
|
* Shape of Durable Object RPC handlers passed to {@link make}.
|
|
1962
1966
|
*/
|
|
1963
1967
|
type DurableObjectRpc<ROut> = Record<string, (...args: Array<any>) => DurableObjectHandler<ROut>>;
|
|
1964
|
-
type DurableObjectRpcShape<Rpc extends DurableObjectRpc<ROut>, ROut> = { readonly [Key in keyof Rpc]: Rpc[Key] extends ((...args: infer Args) => Effect.Effect<infer A, unknown, HandlerContext<ROut>>) ? (...args: Args) => Promise<A> : never };
|
|
1965
|
-
type RpcHandlers<ROut, Api> = { readonly [Key in keyof Api as Key extends keyof DurableObject<WorkerEnv> ? never : Key extends string ? [Api[Key]] extends [never] ? never : Api[Key] extends ((...args: Array<any>) => Promise<unknown>) ? Key : never : never]: Api[Key] extends ((...args: infer Args) => Promise<infer A>) ? (...args: Args) => DurableObjectHandler<ROut, A> : never };
|
|
1968
|
+
type DurableObjectRpcShape<Rpc extends DurableObjectRpc<ROut>, ROut> = { readonly [Key in keyof Rpc]: Rpc[Key] extends ((...args: infer Args) => Effect.Effect<infer A, unknown, HandlerContext<ROut>>) ? (...args: Args) => Promise<A> : never; };
|
|
1969
|
+
type RpcHandlers<ROut, Api> = { readonly [Key in keyof Api as Key extends keyof DurableObject<WorkerEnv> ? never : Key extends string ? [Api[Key]] extends [never] ? never : Api[Key] extends ((...args: Array<any>) => Promise<unknown>) ? Key : never : never]: Api[Key] extends ((...args: infer Args) => Promise<infer A>) ? (...args: Args) => DurableObjectHandler<ROut, A> : never; };
|
|
1966
1970
|
/**
|
|
1967
1971
|
* Options for creating a Durable Object class backed by Effect handlers.
|
|
1968
1972
|
*/
|
|
@@ -2032,9 +2036,9 @@ declare namespace Definition$3 {
|
|
|
2032
2036
|
type Any = Definition$3<string, Methods>;
|
|
2033
2037
|
}
|
|
2034
2038
|
type LayerOptions$8 = LayerOptions$9;
|
|
2035
|
-
type ServerApi$1<Self extends Definition$3.Any> = { readonly [Key in keyof Self["methods"]]: (...args: Method$1.Args<Self["methods"][Key]>) => Promise<Method$1.Success<Self["methods"][Key]
|
|
2039
|
+
type ServerApi$1<Self extends Definition$3.Any> = { readonly [Key in keyof Self["methods"]]: (...args: Method$1.Args<Self["methods"][Key]>) => Promise<Method$1.Success<Self["methods"][Key]>>; };
|
|
2036
2040
|
type Api<Self extends Definition$3.Any> = Provider<ServerApi$1<Self>, ReservedMethodName>;
|
|
2037
|
-
type Handlers<ROut, Self extends Definition$3.Any> = { readonly [Key in keyof Self["methods"]]: (...args: Method$1.Args<Self["methods"][Key]>) => DurableObjectHandler<ROut, Method$1.Success<Self["methods"][Key]
|
|
2041
|
+
type Handlers<ROut, Self extends Definition$3.Any> = { readonly [Key in keyof Self["methods"]]: (...args: Method$1.Args<Self["methods"][Key]>) => DurableObjectHandler<ROut, Method$1.Success<Self["methods"][Key]>>; };
|
|
2038
2042
|
interface Options$2<ROut, Self extends Definition$3.Any, REvent = never, EventLayerError = never> extends Omit<DurableObjectOptions<ROut, REvent, EventLayerError, Handlers<ROut | REvent, Self>>, "rpc"> {
|
|
2039
2043
|
readonly rpc: Handlers<ROut | REvent, Self>;
|
|
2040
2044
|
}
|
|
@@ -2050,7 +2054,7 @@ declare const method: {
|
|
|
2050
2054
|
<Success extends ServiceFreeSchema>(definition: {
|
|
2051
2055
|
readonly success: Success;
|
|
2052
2056
|
}): Method$1<readonly [], Success>;
|
|
2053
|
-
<const Args extends
|
|
2057
|
+
<const Args extends ReadonlyArray<ServiceFreeSchema>, Success extends ServiceFreeSchema>(definition: {
|
|
2054
2058
|
readonly args: Args;
|
|
2055
2059
|
readonly success: Success;
|
|
2056
2060
|
}): Method$1<Args, Success>;
|
|
@@ -2068,31 +2072,31 @@ declare namespace DurableObjectAlarm_d_exports {
|
|
|
2068
2072
|
* tag in their own domain layer.
|
|
2069
2073
|
*/
|
|
2070
2074
|
type AlarmPayload = Schema.Json;
|
|
2071
|
-
declare const InvalidAlarmRefError_base: new <A extends Record<string, any> = {}>(args:
|
|
2075
|
+
declare const InvalidAlarmRefError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
2072
2076
|
readonly _tag: "InvalidAlarmRefError";
|
|
2073
2077
|
} & Readonly<A>;
|
|
2074
2078
|
declare class InvalidAlarmRefError extends InvalidAlarmRefError_base<{
|
|
2075
2079
|
readonly cause: unknown;
|
|
2076
2080
|
}> {}
|
|
2077
|
-
declare const InvalidAlarmPayloadError_base: new <A extends Record<string, any> = {}>(args:
|
|
2081
|
+
declare const InvalidAlarmPayloadError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
2078
2082
|
readonly _tag: "InvalidAlarmPayloadError";
|
|
2079
2083
|
} & Readonly<A>;
|
|
2080
2084
|
declare class InvalidAlarmPayloadError extends InvalidAlarmPayloadError_base<{
|
|
2081
2085
|
readonly cause: unknown;
|
|
2082
2086
|
}> {}
|
|
2083
|
-
declare const InvalidRepeatEveryError_base: new <A extends Record<string, any> = {}>(args:
|
|
2087
|
+
declare const InvalidRepeatEveryError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
2084
2088
|
readonly _tag: "InvalidRepeatEveryError";
|
|
2085
2089
|
} & Readonly<A>;
|
|
2086
2090
|
declare class InvalidRepeatEveryError extends InvalidRepeatEveryError_base<{
|
|
2087
2091
|
readonly cause: unknown;
|
|
2088
2092
|
}> {}
|
|
2089
|
-
declare const InvalidProcessDueAlarmsOptionsError_base: new <A extends Record<string, any> = {}>(args:
|
|
2093
|
+
declare const InvalidProcessDueAlarmsOptionsError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
2090
2094
|
readonly _tag: "InvalidProcessDueAlarmsOptionsError";
|
|
2091
2095
|
} & Readonly<A>;
|
|
2092
2096
|
declare class InvalidProcessDueAlarmsOptionsError extends InvalidProcessDueAlarmsOptionsError_base<{
|
|
2093
2097
|
readonly cause: unknown;
|
|
2094
2098
|
}> {}
|
|
2095
|
-
declare const StoredAlarmDecodeError_base: new <A extends Record<string, any> = {}>(args:
|
|
2099
|
+
declare const StoredAlarmDecodeError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
2096
2100
|
readonly _tag: "StoredAlarmDecodeError";
|
|
2097
2101
|
} & Readonly<A>;
|
|
2098
2102
|
declare class StoredAlarmDecodeError extends StoredAlarmDecodeError_base<{
|
|
@@ -2310,7 +2314,7 @@ type AlarmScheduler = {
|
|
|
2310
2314
|
readonly scheduleAlarm: (input: ScheduleAlarmInput) => Effect.Effect<void, InvalidAlarmPayloadError | InvalidAlarmRefError | InvalidRepeatEveryError | StorageOperationError>;
|
|
2311
2315
|
};
|
|
2312
2316
|
declare const processDue: <R = never, E = never, OnFailureR = never, OnFailureE = never>(handle: ProcessDueAlarmsHandler<R, E>, options?: ProcessDueAlarmsOptions<OnFailureR, OnFailureE>) => Effect.Effect<ProcessDueAlarmsResult, E | OnFailureE | DurableObjectAlarmError, OnFailureR | R | DurableObjectAlarm>;
|
|
2313
|
-
declare const process:
|
|
2317
|
+
declare const process: typeof processDue;
|
|
2314
2318
|
type AlarmPayloadSchema = Schema.Codec<any, any, never, never>;
|
|
2315
2319
|
type AlarmFailurePolicy = "ordered" | "retry" | "skip-and-advance-repeat";
|
|
2316
2320
|
interface AlarmRetryPolicy {
|
|
@@ -2329,7 +2333,7 @@ type DefinedAlarmEvent<Tag extends string, Payload> = Omit<DurableObjectAlarmEve
|
|
|
2329
2333
|
readonly payload: Payload;
|
|
2330
2334
|
readonly tag: Tag;
|
|
2331
2335
|
};
|
|
2332
|
-
type DefinedAlarmHandlers<Definitions extends AlarmDefinitions, R = never, E = never> = { readonly [Tag in keyof Definitions & string]: (event: DefinedAlarmEvent<Tag, AlarmDefinitionPayload<Definitions[Tag]>>) => Effect.Effect<void, E, R
|
|
2336
|
+
type DefinedAlarmHandlers<Definitions extends AlarmDefinitions, R = never, E = never> = { readonly [Tag in keyof Definitions & string]: (event: DefinedAlarmEvent<Tag, AlarmDefinitionPayload<Definitions[Tag]>>) => Effect.Effect<void, E, R>; };
|
|
2333
2337
|
declare const define: <const Definitions extends AlarmDefinitions>(definitions: Definitions) => {
|
|
2334
2338
|
handlers: <R = never, E = never>(handlers: DefinedAlarmHandlers<Definitions, R, E>, options?: ProcessDueAlarmsOptions<R, E>) => Effect.Effect<ProcessDueAlarmsResult, E | DurableObjectAlarmError, R | DurableObjectAlarm>;
|
|
2335
2339
|
};
|
|
@@ -2429,11 +2433,28 @@ type SqliteLayerOptions = Omit<SqliteClient.SqliteClientConfig, "db">;
|
|
|
2429
2433
|
* );
|
|
2430
2434
|
* ```
|
|
2431
2435
|
*/
|
|
2432
|
-
declare const layer$6: (options?: SqliteLayerOptions) => Layer.Layer<
|
|
2436
|
+
declare const layer$6: (options?: SqliteLayerOptions) => Layer.Layer<import("effect/unstable/sql/SqlClient").SqlClient | SqliteClient.SqliteClient, never, DurableObjectState>;
|
|
2433
2437
|
declare namespace Email_d_exports {
|
|
2434
|
-
export { EmailAddress, EmailAttachment, EmailBinding, EmailClient, EmailDefinition, EmailMessage, EmailMessageBuilder, EmailOperationError, EmailSendInput, EmailSendResult, EmailService, LayerOptions$6 as LayerOptions, Tag$7 as Tag, TagClass$6 as TagClass, isEmailBinding, layer$5 as layer, make$5 as make, makeClient$5 as makeClient };
|
|
2435
|
-
}
|
|
2436
|
-
|
|
2438
|
+
export { EmailAddress, EmailAttachment, EmailBinding, EmailClient, EmailDefinition, EmailErrorCode, EmailMessage, EmailMessageBuilder, EmailOperationError, EmailRecipients, EmailSendError, EmailSendInput, EmailSendOptions, EmailSendResult, EmailService, EmailValidationError, EmailViolation, LayerOptions$6 as LayerOptions, Tag$7 as Tag, TagClass$6 as TagClass, emailErrorCodes, isEmailBinding, isEmailMessageBuilder, layer$5 as layer, make$5 as make, makeClient$5 as makeClient, sendLimits, validateMessage };
|
|
2439
|
+
}
|
|
2440
|
+
/** Documented Cloudflare Email Sending limits. */
|
|
2441
|
+
declare const sendLimits: {
|
|
2442
|
+
/** Combined `to`, `cc`, and `bcc` addresses per message. */
|
|
2443
|
+
readonly maxRecipients: 50;
|
|
2444
|
+
readonly maxAttachments: 32;
|
|
2445
|
+
/** Total message size, including attachments. Not enforced client side. */
|
|
2446
|
+
readonly maxMessageBytes: number;
|
|
2447
|
+
readonly maxHeaderNameBytes: 100;
|
|
2448
|
+
readonly maxHeaderValueBytes: 2048;
|
|
2449
|
+
readonly maxHeadersBytes: number;
|
|
2450
|
+
/** Allowlisted custom headers, excluding `X-` prefixed headers. */
|
|
2451
|
+
readonly maxAllowlistHeaders: 20;
|
|
2452
|
+
};
|
|
2453
|
+
/** Error codes reported by Cloudflare Email Sending. */
|
|
2454
|
+
declare const emailErrorCodes: readonly ["E_VALIDATION_ERROR", "E_FIELD_MISSING", "E_TOO_MANY_RECIPIENTS", "E_TOO_MANY_ATTACHMENTS", "E_SENDER_NOT_VERIFIED", "E_RECIPIENT_NOT_ALLOWED", "E_RECIPIENT_SUPPRESSED", "E_SENDER_DOMAIN_NOT_AVAILABLE", "E_CONTENT_TOO_LARGE", "E_DELIVERY_FAILED", "E_RATE_LIMIT_EXCEEDED", "E_DAILY_LIMIT_EXCEEDED", "E_INTERNAL_SERVER_ERROR", "E_HEADER_NOT_ALLOWED", "E_HEADER_USE_API_FIELD", "E_HEADER_VALUE_INVALID", "E_HEADER_VALUE_TOO_LONG", "E_HEADER_NAME_INVALID", "E_HEADERS_TOO_LARGE", "E_HEADERS_TOO_MANY"];
|
|
2455
|
+
/** A documented Cloudflare Email Sending error code. */
|
|
2456
|
+
type EmailErrorCode = (typeof emailErrorCodes)[number];
|
|
2457
|
+
declare const EmailOperationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
2437
2458
|
readonly _tag: "EmailOperationError";
|
|
2438
2459
|
} & Readonly<A>;
|
|
2439
2460
|
/** Error raised when a Cloudflare Send Email operation fails. */
|
|
@@ -2441,6 +2462,24 @@ declare class EmailOperationError extends EmailOperationError_base<{
|
|
|
2441
2462
|
readonly binding: string;
|
|
2442
2463
|
readonly operation: string;
|
|
2443
2464
|
readonly cause: unknown;
|
|
2465
|
+
/** Cloudflare error code taken from the thrown error, when present. */
|
|
2466
|
+
readonly code?: EmailErrorCode | (string & {});
|
|
2467
|
+
}> {}
|
|
2468
|
+
/** A single message field that violates a documented Email Sending limit. */
|
|
2469
|
+
interface EmailViolation {
|
|
2470
|
+
readonly path: string;
|
|
2471
|
+
readonly message: string;
|
|
2472
|
+
readonly limit?: number;
|
|
2473
|
+
readonly actual?: number;
|
|
2474
|
+
}
|
|
2475
|
+
declare const EmailValidationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
2476
|
+
readonly _tag: "EmailValidationError";
|
|
2477
|
+
} & Readonly<A>;
|
|
2478
|
+
/** Error raised when a message violates documented Cloudflare Email Sending limits. */
|
|
2479
|
+
declare class EmailValidationError extends EmailValidationError_base<{
|
|
2480
|
+
readonly binding: string;
|
|
2481
|
+
readonly operation: string;
|
|
2482
|
+
readonly violations: ReadonlyArray<EmailViolation>;
|
|
2444
2483
|
}> {}
|
|
2445
2484
|
/** Typed Cloudflare Send Email binding definition. */
|
|
2446
2485
|
interface EmailDefinition {
|
|
@@ -2454,10 +2493,16 @@ type EmailMessageBuilder = Parameters<CloudflareSendEmail["send"]>[0];
|
|
|
2454
2493
|
type EmailSendInput = EmailMessage | EmailMessageBuilder;
|
|
2455
2494
|
type EmailSendResult = CloudflareEmailSendResult;
|
|
2456
2495
|
type EmailBinding = CloudflareSendEmail;
|
|
2496
|
+
type EmailRecipients = string | EmailAddress | ReadonlyArray<string | EmailAddress>;
|
|
2497
|
+
type EmailSendError = EmailOperationError | EmailValidationError;
|
|
2498
|
+
interface EmailSendOptions {
|
|
2499
|
+
/** Validates builder messages against documented limits. Defaults to `true`. */
|
|
2500
|
+
readonly validate?: boolean;
|
|
2501
|
+
}
|
|
2457
2502
|
interface EmailClient {
|
|
2458
2503
|
readonly send: {
|
|
2459
|
-
(message: EmailMessage): Effect.Effect<EmailSendResult,
|
|
2460
|
-
(builder: EmailMessageBuilder): Effect.Effect<EmailSendResult,
|
|
2504
|
+
(message: EmailMessage): Effect.Effect<EmailSendResult, EmailSendError>;
|
|
2505
|
+
(builder: EmailMessageBuilder): Effect.Effect<EmailSendResult, EmailSendError>;
|
|
2461
2506
|
};
|
|
2462
2507
|
readonly unsafeRaw: Effect.Effect<EmailBinding>;
|
|
2463
2508
|
readonly definition: EmailDefinition;
|
|
@@ -2471,21 +2516,33 @@ interface EmailService<Id extends string> {
|
|
|
2471
2516
|
}
|
|
2472
2517
|
type LayerOptions$6 = {
|
|
2473
2518
|
readonly binding: string;
|
|
2519
|
+
readonly send?: EmailSendOptions;
|
|
2474
2520
|
};
|
|
2475
2521
|
interface TagClass$6<Self, Id extends string> extends Context.ServiceClass<Self, Id, EmailClient> {
|
|
2476
2522
|
readonly id: Id;
|
|
2477
2523
|
readonly layer: (options: LayerOptions$6) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2478
2524
|
}
|
|
2525
|
+
/**
|
|
2526
|
+
* Distinguishes structured Email Sending messages from raw MIME `EmailMessage`
|
|
2527
|
+
* values, which only carry envelope `from` and `to` addresses.
|
|
2528
|
+
*/
|
|
2529
|
+
declare const isEmailMessageBuilder: (message: EmailSendInput) => message is EmailMessageBuilder;
|
|
2530
|
+
/**
|
|
2531
|
+
* Validates a structured message against documented Cloudflare Email Sending
|
|
2532
|
+
* limits and returns every violation found. Total message size is not checked
|
|
2533
|
+
* because the encoded MIME size is only known once Cloudflare composes it.
|
|
2534
|
+
*/
|
|
2535
|
+
declare const validateMessage: (message: EmailMessageBuilder) => ReadonlyArray<EmailViolation>;
|
|
2479
2536
|
declare const isEmailBinding: (value: unknown) => value is EmailBinding;
|
|
2480
|
-
declare const makeClient$5: (definition: EmailDefinition) => (email: EmailBinding) => EmailClient;
|
|
2481
|
-
declare const layer$5: <Self>(tag: Context.Service<Self, EmailClient>, definition:
|
|
2537
|
+
declare const makeClient$5: (definition: EmailDefinition, options?: EmailSendOptions) => (email: EmailBinding) => EmailClient;
|
|
2538
|
+
declare const layer$5: <Self>(tag: Context.Service<Self, EmailClient>, definition: LayerOptions$6) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2482
2539
|
declare const make$5: <Id extends string>(id: Id) => TagClass$6<EmailService<Id>, Id>;
|
|
2483
2540
|
declare const Tag$7: <Self>() => <Id extends string>(id: Id) => TagClass$6<Self, Id>;
|
|
2484
2541
|
declare namespace Images_d_exports {
|
|
2485
2542
|
export { DrawStepOptions, HostedImagesClient, ImageDrawOptions, ImageHandleClient, ImageInfoResponse, ImageInputOptions, ImageInputValue, ImageList, ImageListOptions, ImageMetadata, ImageOutputOptions, ImageTransform, ImageTransformationOutputOptions, ImageTransformationResult, ImageUpdateOptions, ImageUploadOptions, ImageUploadValue, ImagesClient, ImagesDefinition, ImagesOperationError, ImagesRuntimeBinding, ImagesService, ImagesTransformationResultClient, LayerOptions$5 as LayerOptions, ProcessOptions, Step, Steps, Tag$6 as Tag, TagClass$5 as TagClass, draw, empty, isImagesBinding, layer$4 as layer, make$4 as make, makeClient$4 as makeClient, transform };
|
|
2486
2543
|
}
|
|
2487
2544
|
declare const TypeId: "effect-cf/Images/Steps";
|
|
2488
|
-
declare const ImagesOperationError_base: new <A extends Record<string, any> = {}>(args:
|
|
2545
|
+
declare const ImagesOperationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
2489
2546
|
readonly _tag: "ImagesOperationError";
|
|
2490
2547
|
} & Readonly<A>;
|
|
2491
2548
|
/** Error raised when a Cloudflare Images operation fails. */
|
|
@@ -2592,7 +2649,7 @@ declare const Tag$6: <Self>() => <Id extends string>(id: Id) => TagClass$5<Self,
|
|
|
2592
2649
|
declare namespace Kv_d_exports {
|
|
2593
2650
|
export { Definition$2 as Definition, KvClient, KvDefinition, KvListKey, KvListOptions, KvListResult, KvOperationError, KvPutOptions, KvWithMetadata, LayerOptions$4 as LayerOptions, Tag$5 as Tag, TagClass$4 as TagClass, isKvNamespace, layer$3 as layer, makeClient$3 as makeClient };
|
|
2594
2651
|
}
|
|
2595
|
-
declare const KvOperationError_base: new <A extends Record<string, any> = {}>(args:
|
|
2652
|
+
declare const KvOperationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
2596
2653
|
readonly _tag: "KvOperationError";
|
|
2597
2654
|
} & Readonly<A>;
|
|
2598
2655
|
/** Error raised when a KV operation fails. */
|
|
@@ -2678,7 +2735,7 @@ declare const Tag$5: <Self>() => <Id extends string, Key, Value, EncodedValue>(i
|
|
|
2678
2735
|
declare namespace R2_d_exports {
|
|
2679
2736
|
export { LayerOptions$3 as LayerOptions, R2Client, R2Definition, R2GetOptions, R2ListOptions, R2MultipartOptions, R2MultipartUploadClient, R2ObjectBodyClient, R2OperationError, R2PutOptions, R2PutValue, R2Service, R2UploadPartOptions, R2UploadPartValue, Tag$4 as Tag, TagClass$3 as TagClass, isR2Bucket, layer$2 as layer, make$3 as make, makeClient$2 as makeClient };
|
|
2680
2737
|
}
|
|
2681
|
-
declare const R2OperationError_base: new <A extends Record<string, any> = {}>(args:
|
|
2738
|
+
declare const R2OperationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
2682
2739
|
readonly _tag: "R2OperationError";
|
|
2683
2740
|
} & Readonly<A>;
|
|
2684
2741
|
/** Error raised when an R2 operation fails. */
|
|
@@ -2806,7 +2863,7 @@ interface WorkflowBindingClient<Payload extends ServiceFreeSchema$4, Result exte
|
|
|
2806
2863
|
readonly get: (instanceId: string) => Effect.Effect<WorkflowInstance<Schema.Schema.Type<Result>>, WorkflowOperationError>;
|
|
2807
2864
|
readonly unsafeRaw: Effect.Effect<CloudflareWorkflow<Schema.Codec.Encoded<Payload>>>;
|
|
2808
2865
|
}
|
|
2809
|
-
declare const WorkflowOperationError_base: new <A extends Record<string, any> = {}>(args:
|
|
2866
|
+
declare const WorkflowOperationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
2810
2867
|
readonly _tag: "WorkflowOperationError";
|
|
2811
2868
|
} & Readonly<A>;
|
|
2812
2869
|
declare class WorkflowOperationError extends WorkflowOperationError_base<{
|
|
@@ -2814,7 +2871,7 @@ declare class WorkflowOperationError extends WorkflowOperationError_base<{
|
|
|
2814
2871
|
readonly operation: string;
|
|
2815
2872
|
readonly cause: unknown;
|
|
2816
2873
|
}> {}
|
|
2817
|
-
declare const WorkflowResultDecodeError_base: new <A extends Record<string, any> = {}>(args:
|
|
2874
|
+
declare const WorkflowResultDecodeError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
2818
2875
|
readonly _tag: "WorkflowResultDecodeError";
|
|
2819
2876
|
} & Readonly<A>;
|
|
2820
2877
|
declare class WorkflowResultDecodeError extends WorkflowResultDecodeError_base<{
|
|
@@ -2824,7 +2881,7 @@ declare class WorkflowResultDecodeError extends WorkflowResultDecodeError_base<{
|
|
|
2824
2881
|
}> {}
|
|
2825
2882
|
declare const isWorkflow: <Payload>(value: unknown) => value is CloudflareWorkflow<Payload>;
|
|
2826
2883
|
declare const makeClient$1: <Payload extends ServiceFreeSchema$4, Result extends ServiceFreeSchema$4>(definition: WorkflowBindingDefinition<Payload, Result>) => ((workflow: CloudflareWorkflow<Schema.Codec.Encoded<Payload>>) => WorkflowBindingClient<Payload, Result>);
|
|
2827
|
-
declare const layer$1: <Self, Payload extends ServiceFreeSchema$4, Result extends ServiceFreeSchema$4>(tag: Context.Service<Self, WorkflowBindingClient<Payload, Result>>, definition: WorkflowBindingDefinition<Payload, Result>) =>
|
|
2884
|
+
declare const layer$1: <Self, Payload extends ServiceFreeSchema$4, Result extends ServiceFreeSchema$4>(tag: Context.Service<Self, WorkflowBindingClient<Payload, Result>>, definition: WorkflowBindingDefinition<Payload, Result>) => import("effect/Layer").Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2828
2885
|
declare namespace WorkflowDefinition_d_exports {
|
|
2829
2886
|
export { Definition$1 as Definition, Handler$1 as Handler, LayerOptions$2 as LayerOptions, Options$1 as Options, Tag$3 as Tag, TagClass$2 as TagClass, Workflow, implement$1 as implement, make$2 as make };
|
|
2830
2887
|
}
|
|
@@ -2862,10 +2919,7 @@ declare const Tag$3: <Self>() => <Id extends string, Payload extends ServiceFree
|
|
|
2862
2919
|
readonly payload: Payload;
|
|
2863
2920
|
readonly result: Result;
|
|
2864
2921
|
}) => TagClass$2<Self, Id, Payload, Result>;
|
|
2865
|
-
declare const Workflow:
|
|
2866
|
-
readonly payload: Payload;
|
|
2867
|
-
readonly result: Result;
|
|
2868
|
-
}) => TagClass$2<Self, Id, Payload, Result>;
|
|
2922
|
+
declare const Workflow: typeof Tag$3;
|
|
2869
2923
|
declare const implement$1: <ROut, const Self extends Definition$1.Any>(_definition: Self, handler: Handler$1<ROut, Self>) => Handler$1<ROut, Self>;
|
|
2870
2924
|
declare namespace Workflow_d_exports {
|
|
2871
2925
|
export { Definition, Handler, LayerOptions$1 as LayerOptions, Options, Tag$2 as Tag, TagClass$1 as TagClass, WorkflowClass, WorkflowEvent$1 as WorkflowEvent, WorkflowEventService, WorkflowHandler, WorkflowOptions, WorkflowRunContext, WorkflowStep$1 as WorkflowStep, WorkflowStepContext$1 as WorkflowStepContext, WorkflowStepService, implement, make$1 as make, sleep, sleepUntil, step, waitForEvent };
|
|
@@ -2920,13 +2974,13 @@ declare const Tag$2: <Self>() => <Id extends string, Payload extends Definition$
|
|
|
2920
2974
|
readonly payload: Payload;
|
|
2921
2975
|
readonly result: Result;
|
|
2922
2976
|
}) => TagClass$1<Self, Id, Payload, Result>;
|
|
2923
|
-
declare const implement:
|
|
2977
|
+
declare const implement: typeof implement$1;
|
|
2924
2978
|
type Handler<ROut, Self extends Definition$1.Any> = Handler$1<ROut, Self>;
|
|
2925
2979
|
type Options<ROut, Self extends Definition$1.Any> = Options$1<ROut, Self>;
|
|
2926
2980
|
declare namespace Vectorize_d_exports {
|
|
2927
2981
|
export { LayerOptions, Tag$1 as Tag, TagClass, VectorizeBinding, VectorizeClient, VectorizeDefinition, VectorizeIndexDetails, VectorizeIndexInfo, VectorizeMatch, VectorizeMatches, VectorizeMutation, VectorizeOperationError, VectorizeQueryOptions, VectorizeService, VectorizeValues, VectorizeVector, VectorizeVectorMetadata, VectorizeVectorMetadataFilter, VectorizeVectorMetadataValue, isVectorizeBinding, layer, make, makeClient };
|
|
2928
2982
|
}
|
|
2929
|
-
declare const VectorizeOperationError_base: new <A extends Record<string, any> = {}>(args:
|
|
2983
|
+
declare const VectorizeOperationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
2930
2984
|
readonly _tag: "VectorizeOperationError";
|
|
2931
2985
|
} & Readonly<A>;
|
|
2932
2986
|
/** Error raised when a Vectorize operation fails. */
|