effect-cf 0.17.1 → 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 +24 -0
- package/README.md +50 -3
- 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 +223 -118
- package/dist/index.mjs +587 -164
- 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/Cache.ts +104 -0
- 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/index.ts +1 -0
- 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
|
-
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$
|
|
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. */
|
|
@@ -87,14 +79,14 @@ declare const embeddingResponse: (value: {
|
|
|
87
79
|
readonly data?: ReadonlyArray<ReadonlyArray<number>>;
|
|
88
80
|
readonly shape?: ReadonlyArray<number>;
|
|
89
81
|
}) => WorkersAiEmbeddingResponse;
|
|
90
|
-
declare const makeClient$
|
|
91
|
-
declare const layer$
|
|
82
|
+
declare const makeClient$14: <ModelList extends AiModelListType = AiModels>(definition: WorkersAiDefinition) => (ai: WorkersAiBinding<ModelList>) => WorkersAiClient<ModelList>;
|
|
83
|
+
declare const layer$17: <Self, ModelList extends AiModelListType = AiModels>(tag: Context.Service<Self, WorkersAiClient<ModelList>>, definition: WorkersAiDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
92
84
|
declare const make$17: <Id extends string>(id: Id) => TagClass$17<WorkersAiService<Id>, Id, AiModels>;
|
|
93
85
|
declare const Tag$18: <Self>() => <Id extends string, ModelList extends AiModelListType = AiModels>(id: Id) => TagClass$17<Self, Id, ModelList>;
|
|
94
86
|
declare namespace AiGateway_d_exports {
|
|
95
|
-
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$
|
|
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. */
|
|
@@ -151,7 +143,7 @@ interface TagClass$16<Self, Id extends string> extends Context.ServiceClass<Self
|
|
|
151
143
|
readonly layer: (options: LayerOptions$18) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError | AiGatewayOperationError, WorkerEnvironment>;
|
|
152
144
|
}
|
|
153
145
|
declare const isAiGatewayBinding: (value: unknown) => value is WorkersAiBinding;
|
|
154
|
-
declare const makeClient$
|
|
146
|
+
declare const makeClient$13: (definition: AiGatewayDefinition, gateway: AiGatewayBinding) => {
|
|
155
147
|
definition: AiGatewayDefinition;
|
|
156
148
|
run: (data: _$_cloudflare_workers_types0.AIGatewayUniversalRequest | readonly _$_cloudflare_workers_types0.AIGatewayUniversalRequest[], options: {
|
|
157
149
|
gateway?: _$_cloudflare_workers_types0.UniversalGatewayOptions;
|
|
@@ -169,11 +161,11 @@ declare const makeHttpClient: (definition: Omit<AiGatewayDefinition, "binding">
|
|
|
169
161
|
readonly accountId: string;
|
|
170
162
|
readonly binding?: string;
|
|
171
163
|
}, request?: typeof fetch) => AiGatewayClient;
|
|
172
|
-
declare const layer$
|
|
164
|
+
declare const layer$16: <Self>(tag: Context.Service<Self, AiGatewayClient>, definition: AiGatewayDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
173
165
|
declare const make$16: <Id extends string>(id: Id) => TagClass$16<AiGatewayService<Id>, Id>;
|
|
174
166
|
declare const Tag$17: <Self>() => <Id extends string>(id: Id) => TagClass$16<Self, Id>;
|
|
175
167
|
declare namespace AnalyticsEngine_d_exports {
|
|
176
|
-
export { AnalyticsEngineBinding, AnalyticsEngineClient, AnalyticsEngineDataPoint, AnalyticsEngineDataPointSchema, AnalyticsEngineDefinition, AnalyticsEngineFieldValue, AnalyticsEngineFieldValueSchema, AnalyticsEngineInvalidWritePolicy, AnalyticsEngineOperationError, AnalyticsEngineQueryClient, AnalyticsEngineQueryColumn, AnalyticsEngineQueryDefinition, AnalyticsEngineQueryError, AnalyticsEngineQueryOptions, AnalyticsEngineQueryResult, AnalyticsEngineQueryRow, AnalyticsEngineQueryService, AnalyticsEngineService, AnalyticsEngineWriteBatchOptions, AnalyticsEngineWriteError, AnalyticsEngineWriteOptions, AnalyticsEngineWritePolicy, AnalyticsEngineWriteValidationError, AnalyticsEngineWriteViolation, LayerOptions$17 as LayerOptions, QueryConfigOptions, QueryTag, QueryTagClass, Tag$16 as Tag, TagClass$15 as TagClass, isAnalyticsEngineDataset, layer$
|
|
168
|
+
export { AnalyticsEngineBinding, AnalyticsEngineClient, AnalyticsEngineDataPoint, AnalyticsEngineDataPointSchema, AnalyticsEngineDefinition, AnalyticsEngineFieldValue, AnalyticsEngineFieldValueSchema, AnalyticsEngineInvalidWritePolicy, AnalyticsEngineOperationError, AnalyticsEngineQueryClient, AnalyticsEngineQueryColumn, AnalyticsEngineQueryDefinition, AnalyticsEngineQueryError, AnalyticsEngineQueryOptions, AnalyticsEngineQueryResult, AnalyticsEngineQueryRow, AnalyticsEngineQueryService, AnalyticsEngineService, AnalyticsEngineWriteBatchOptions, AnalyticsEngineWriteError, AnalyticsEngineWriteOptions, AnalyticsEngineWritePolicy, AnalyticsEngineWriteValidationError, AnalyticsEngineWriteViolation, LayerOptions$17 as LayerOptions, QueryConfigOptions, QueryTag, QueryTagClass, Tag$16 as Tag, TagClass$15 as TagClass, isAnalyticsEngineDataset, layer$15 as layer, make$15 as make, makeClient$12 as makeClient, makeQuery, makeQueryClient, queryConfig, queryFetchLayer, queryFetchLayerConfig, queryLayer, queryLayerConfig, writeLimits };
|
|
177
169
|
}
|
|
178
170
|
declare const writeLimits: {
|
|
179
171
|
readonly maxBlobs: 20;
|
|
@@ -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. */
|
|
@@ -328,7 +320,7 @@ interface QueryTagClass<Self, Id extends string> extends Context.ServiceClass<Se
|
|
|
328
320
|
}
|
|
329
321
|
declare const makeQueryClient: (definition: AnalyticsEngineQueryDefinition) => Effect.Effect<AnalyticsEngineQueryClient, never, HttpClient.HttpClient>;
|
|
330
322
|
declare const isAnalyticsEngineDataset: (value: unknown) => value is AnalyticsEngineBinding;
|
|
331
|
-
declare const makeClient$
|
|
323
|
+
declare const makeClient$12: (definition: AnalyticsEngineDefinition, defaults?: AnalyticsEngineWritePolicy) => (dataset: AnalyticsEngineBinding) => AnalyticsEngineClient;
|
|
332
324
|
declare const queryConfig: (options?: QueryConfigOptions) => Config.Config<{
|
|
333
325
|
accountId: string;
|
|
334
326
|
apiToken: Redacted.Redacted<string>;
|
|
@@ -338,15 +330,15 @@ declare const queryLayer: <Self>(tag: Context.Service<Self, AnalyticsEngineQuery
|
|
|
338
330
|
declare const queryFetchLayer: <Self>(tag: Context.Service<Self, AnalyticsEngineQueryClient>, definition: AnalyticsEngineQueryDefinition) => Layer.Layer<Self, never, never>;
|
|
339
331
|
declare const queryLayerConfig: <Self>(tag: Context.Service<Self, AnalyticsEngineQueryClient>, config?: Config.Config<AnalyticsEngineQueryDefinition>) => Layer.Layer<Self, Config.ConfigError, HttpClient.HttpClient>;
|
|
340
332
|
declare const queryFetchLayerConfig: <Self>(tag: Context.Service<Self, AnalyticsEngineQueryClient>, config?: Config.Config<AnalyticsEngineQueryDefinition>) => Layer.Layer<Self, Config.ConfigError, never>;
|
|
341
|
-
declare const layer$
|
|
333
|
+
declare const layer$15: <Self>(tag: Context.Service<Self, AnalyticsEngineClient>, definition: LayerOptions$17) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
342
334
|
declare const make$15: <Id extends string>(id: Id) => TagClass$15<AnalyticsEngineService<Id>, Id>;
|
|
343
335
|
declare const makeQuery: <Id extends string>(id: Id) => QueryTagClass<AnalyticsEngineQueryService<Id>, Id>;
|
|
344
336
|
declare const Tag$16: <Self>() => <Id extends string>(id: Id) => TagClass$15<Self, Id>;
|
|
345
337
|
declare const QueryTag: <Self>() => <Id extends string>(id: Id) => QueryTagClass<Self, Id>;
|
|
346
338
|
declare namespace BrowserRendering_d_exports {
|
|
347
|
-
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$
|
|
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. */
|
|
@@ -416,16 +408,67 @@ interface TagClass$14<Self, Id extends string> extends Context.ServiceClass<Self
|
|
|
416
408
|
readonly layer: (options: LayerOptions$16) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
417
409
|
}
|
|
418
410
|
declare const isBrowserRenderingBinding: (value: unknown) => value is BrowserRenderingBinding;
|
|
419
|
-
declare const makeClient$
|
|
420
|
-
declare const layer$
|
|
411
|
+
declare const makeClient$11: <RawBinding extends BrowserRenderingBinding = BrowserRenderingBinding>(definition: BrowserRenderingDefinition) => (binding: RawBinding) => BrowserRenderingClient<RawBinding>;
|
|
412
|
+
declare const layer$14: <Self>(tag: Context.Service<Self, BrowserRenderingClient>, definition: BrowserRenderingDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
421
413
|
declare const make$14: <Id extends string>(id: Id) => TagClass$14<BrowserRenderingService<Id>, Id>;
|
|
422
414
|
declare const Tag$15: <Self>() => <Id extends string>(id: Id) => TagClass$14<Self, Id>;
|
|
415
|
+
declare namespace Cache_d_exports {
|
|
416
|
+
export { CacheClient, CacheOperation, CacheOperationError, CacheQueryOptions, CacheRequest, CacheStorage, CacheStorageClient, layer$13 as layer, layerFrom, makeCacheClient, makeClient$10 as makeClient };
|
|
417
|
+
}
|
|
418
|
+
/** Request key accepted by Cloudflare's Cache API. */
|
|
419
|
+
type CacheRequest = CloudflareRequestInfo | URL;
|
|
420
|
+
/** Query options supported by Cloudflare's Cache API. */
|
|
421
|
+
type CacheQueryOptions = CloudflareCacheQueryOptions;
|
|
422
|
+
/** Cache operation represented by {@link CacheOperationError}. */
|
|
423
|
+
type CacheOperation = "open" | "match" | "put" | "delete";
|
|
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 & {
|
|
425
|
+
readonly _tag: "CacheOperationError";
|
|
426
|
+
} & Readonly<A>;
|
|
427
|
+
/** Error raised when a Cloudflare Cache API operation fails. */
|
|
428
|
+
declare class CacheOperationError extends CacheOperationError_base<{
|
|
429
|
+
readonly cache: string;
|
|
430
|
+
readonly operation: CacheOperation;
|
|
431
|
+
readonly cause: unknown;
|
|
432
|
+
}> {}
|
|
433
|
+
/** Effect wrapper around one Cloudflare `Cache` instance. */
|
|
434
|
+
interface CacheClient {
|
|
435
|
+
/** Cache name (`default` for `caches.default`). */
|
|
436
|
+
readonly name: string;
|
|
437
|
+
/** Finds a cached response, mapping cache misses to `Option.none()`. */
|
|
438
|
+
readonly match: (request: CacheRequest, options?: CacheQueryOptions) => Effect.Effect<Option.Option<Response>, CacheOperationError>;
|
|
439
|
+
/** Stores a response under the request key. */
|
|
440
|
+
readonly put: (request: CacheRequest, response: Response) => Effect.Effect<void, CacheOperationError>;
|
|
441
|
+
/** Deletes a cached response and reports whether it existed. */
|
|
442
|
+
readonly delete: (request: CacheRequest, options?: CacheQueryOptions) => Effect.Effect<boolean, CacheOperationError>;
|
|
443
|
+
/** Access to the native Cloudflare `Cache` instance. */
|
|
444
|
+
readonly unsafeRaw: Effect.Effect<CloudflareCache>;
|
|
445
|
+
}
|
|
446
|
+
/** Effect wrapper around Cloudflare's global `caches` object. */
|
|
447
|
+
interface CacheStorageClient {
|
|
448
|
+
/** Cloudflare's shared default cache. */
|
|
449
|
+
readonly default: CacheClient;
|
|
450
|
+
/** Opens a named cache. */
|
|
451
|
+
readonly open: (name: string) => Effect.Effect<CacheClient, CacheOperationError>;
|
|
452
|
+
/** Access to the native Cloudflare `CacheStorage` instance. */
|
|
453
|
+
readonly unsafeRaw: Effect.Effect<CloudflareCacheStorage>;
|
|
454
|
+
}
|
|
455
|
+
declare const CacheStorage_base: Context.ServiceClass<CacheStorage, "effect-cf/CacheStorage", CacheStorageClient>;
|
|
456
|
+
/** Service for Cloudflare's global Cache API. */
|
|
457
|
+
declare class CacheStorage extends CacheStorage_base {}
|
|
458
|
+
/** Wraps a native Cloudflare `Cache` instance. */
|
|
459
|
+
declare const makeCacheClient: (cache: CloudflareCache, name?: string) => CacheClient;
|
|
460
|
+
/** Wraps a native Cloudflare `CacheStorage` instance. */
|
|
461
|
+
declare const makeClient$10: (storage: CloudflareCacheStorage) => CacheStorageClient;
|
|
462
|
+
/** Provides Cache API services from an explicit native `CacheStorage` instance. */
|
|
463
|
+
declare const layerFrom: (storage: CloudflareCacheStorage) => Layer.Layer<CacheStorage>;
|
|
464
|
+
/** Provides Cache API services from Cloudflare's global `caches` object. */
|
|
465
|
+
declare const layer$13: Layer.Layer<CacheStorage>;
|
|
423
466
|
declare namespace DurableObjectStorage_d_exports {
|
|
424
467
|
export { DurableObjectStorage, DurableObjectTransaction, SchemaBackedSyncKvStorage, SqlCursor, SqlStorage, SqlStorageValue, StorageOperationError, SyncKvDefinition, SyncKvStorage, fromDurableObjectStorage };
|
|
425
468
|
}
|
|
426
469
|
/** Supported primitive value types for Durable Object SQL APIs. */
|
|
427
470
|
type SqlStorageValue = globalThis.SqlStorageValue;
|
|
428
|
-
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 & {
|
|
429
472
|
readonly _tag: "StorageOperationError";
|
|
430
473
|
} & Readonly<A>;
|
|
431
474
|
/** Error type used when a storage operation throws or rejects. */
|
|
@@ -557,21 +600,21 @@ declare namespace DurableObjectWebSocket_d_exports {
|
|
|
557
600
|
}
|
|
558
601
|
/** Data supported by Cloudflare websocket `send`. */
|
|
559
602
|
type DurableWebSocketSendData = string | ArrayBuffer | ArrayBufferView;
|
|
560
|
-
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 & {
|
|
561
604
|
readonly _tag: "DurableWebSocketSendError";
|
|
562
605
|
} & Readonly<A>;
|
|
563
606
|
/** Error raised when sending on a Durable Object websocket fails. */
|
|
564
607
|
declare class DurableWebSocketSendError extends DurableWebSocketSendError_base<{
|
|
565
608
|
readonly cause: unknown;
|
|
566
609
|
}> {}
|
|
567
|
-
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 & {
|
|
568
611
|
readonly _tag: "DurableWebSocketCloseError";
|
|
569
612
|
} & Readonly<A>;
|
|
570
613
|
/** Error raised when closing a Durable Object websocket fails. */
|
|
571
614
|
declare class DurableWebSocketCloseError extends DurableWebSocketCloseError_base<{
|
|
572
615
|
readonly cause: unknown;
|
|
573
616
|
}> {}
|
|
574
|
-
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 & {
|
|
575
618
|
readonly _tag: "DurableWebSocketAttachmentError";
|
|
576
619
|
} & Readonly<A>;
|
|
577
620
|
/** Error raised when serializing or deserializing a websocket attachment fails. */
|
|
@@ -728,11 +771,19 @@ declare namespace CloudflareOtlp_d_exports {
|
|
|
728
771
|
type Signal = "logs" | "traces" | "metrics";
|
|
729
772
|
/** OTLP payload serialization used by the Effect OTLP exporters. */
|
|
730
773
|
type Serialization = "json" | "protobuf";
|
|
731
|
-
/**
|
|
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
|
+
*/
|
|
732
783
|
interface ResourceOptions {
|
|
733
|
-
/** Explicit service name. OTEL
|
|
784
|
+
/** Explicit service name. Takes precedence over OTEL environment variables. */
|
|
734
785
|
readonly serviceName?: string;
|
|
735
|
-
/** Explicit service version. OTEL
|
|
786
|
+
/** Explicit service version. Takes precedence over OTEL environment variables. */
|
|
736
787
|
readonly serviceVersion?: string;
|
|
737
788
|
/** Additional resource attributes attached to exported telemetry. */
|
|
738
789
|
readonly attributes?: Record<string, unknown>;
|
|
@@ -871,7 +922,7 @@ interface ContainerNamespaceDefinition {
|
|
|
871
922
|
/** Binding name as configured in `wrangler.jsonc`. */
|
|
872
923
|
readonly binding: string;
|
|
873
924
|
}
|
|
874
|
-
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 & {
|
|
875
926
|
readonly _tag: "ContainerOperationError";
|
|
876
927
|
} & Readonly<A>;
|
|
877
928
|
/** Failure raised when invoking a named Container operation. */
|
|
@@ -931,7 +982,7 @@ interface ContainerNamespaceService<Id extends string> {
|
|
|
931
982
|
}
|
|
932
983
|
/** Creates a typed Effect service for a Cloudflare Container namespace. */
|
|
933
984
|
declare const Tag$14: <Self>() => <Id extends string>(id: Id) => TagClass$13<Self, Id>;
|
|
934
|
-
declare const ContainerNamespace:
|
|
985
|
+
declare const ContainerNamespace: typeof Tag$14;
|
|
935
986
|
declare namespace D1_d_exports {
|
|
936
987
|
export { D1Definition, D1Service, D1SqlLayerOptions, Service$1 as Service, make$12 as make };
|
|
937
988
|
}
|
|
@@ -955,7 +1006,7 @@ interface D1Service<Id extends string> {
|
|
|
955
1006
|
declare const make$12: <Id extends string>(id: Id, definition: D1Definition) => BindingService<D1Service<Id>, Id, D1Database> & {
|
|
956
1007
|
"effect-cf/D1": "effect-cf/D1";
|
|
957
1008
|
definition: D1Definition;
|
|
958
|
-
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>;
|
|
959
1010
|
};
|
|
960
1011
|
/**
|
|
961
1012
|
* Builds a D1 service around a Cloudflare D1 database binding.
|
|
@@ -975,7 +1026,7 @@ declare const make$12: <Id extends string>(id: Id, definition: D1Definition) =>
|
|
|
975
1026
|
declare const Service$1: <Self>() => <Id extends string>(id: Id, definition: D1Definition) => BindingService<Self, Id, D1Database> & {
|
|
976
1027
|
"effect-cf/D1": "effect-cf/D1";
|
|
977
1028
|
definition: D1Definition;
|
|
978
|
-
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>>;
|
|
979
1030
|
};
|
|
980
1031
|
declare namespace Rpc_d_exports {
|
|
981
1032
|
export { DisposableValue, MethodArgs, MethodKey, MethodReturn, Provider, Result$1 as Result, RpcStub, RpcTarget, Serializable, Stub, Stubable, Stubify, dispose, isDisposable, resolve, scoped };
|
|
@@ -984,14 +1035,14 @@ type Stubable = Rpc.Stubable;
|
|
|
984
1035
|
type Stub<T extends Stubable> = Rpc.Stub<T>;
|
|
985
1036
|
type Provider<T extends object, Reserved extends string = never> = Rpc.Provider<T, Reserved>;
|
|
986
1037
|
type BaseType = void | undefined | null | boolean | number | bigint | string | TypedArray | ArrayBuffer | DataView | Date | Error | RegExp | ReadableStream<Uint8Array> | WritableStream<Uint8Array> | Request | Response | Headers;
|
|
987
|
-
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;
|
|
988
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 {
|
|
989
1040
|
[key: string | number]: unknown;
|
|
990
|
-
} ? { [Key in keyof T]: Stubify<T[Key]
|
|
1041
|
+
} ? { [Key in keyof T]: Stubify<T[Key]>; } : T;
|
|
991
1042
|
type MaybeProvider<T> = T extends object ? Provider<T> : unknown;
|
|
992
1043
|
type MaybeDisposable<T> = T extends object ? Disposable : unknown;
|
|
993
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;
|
|
994
|
-
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];
|
|
995
1046
|
type MethodArgs<Api, Method extends keyof Api> = Api[Method] extends ((...args: infer Args) => unknown) ? Args : never;
|
|
996
1047
|
type MethodReturn<Api, Method extends keyof Api> = Api[Method] extends ((...args: Array<any>) => infer Return) ? Return : never;
|
|
997
1048
|
type DisposableValue = {
|
|
@@ -1004,14 +1055,14 @@ declare const scoped: <A>(value: A) => Effect.Effect<Awaited<A>, unknown, Scope.
|
|
|
1004
1055
|
declare namespace RpcDefinition_d_exports {
|
|
1005
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 };
|
|
1006
1057
|
}
|
|
1007
|
-
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 & {
|
|
1008
1059
|
readonly _tag: "RpcReservedMethodNameError";
|
|
1009
1060
|
} & Readonly<A>;
|
|
1010
1061
|
declare class RpcReservedMethodNameError extends RpcReservedMethodNameError_base<{
|
|
1011
1062
|
readonly definition: string;
|
|
1012
1063
|
readonly method: string;
|
|
1013
1064
|
}> {}
|
|
1014
|
-
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 & {
|
|
1015
1066
|
readonly _tag: "RpcArgumentCountError";
|
|
1016
1067
|
} & Readonly<A>;
|
|
1017
1068
|
declare class RpcArgumentCountError extends RpcArgumentCountError_base<{
|
|
@@ -1020,7 +1071,7 @@ declare class RpcArgumentCountError extends RpcArgumentCountError_base<{
|
|
|
1020
1071
|
readonly expected: number;
|
|
1021
1072
|
readonly actual: number;
|
|
1022
1073
|
}> {}
|
|
1023
|
-
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 & {
|
|
1024
1075
|
readonly _tag: "RpcArgumentDecodeError";
|
|
1025
1076
|
} & Readonly<A>;
|
|
1026
1077
|
declare class RpcArgumentDecodeError extends RpcArgumentDecodeError_base<{
|
|
@@ -1029,7 +1080,7 @@ declare class RpcArgumentDecodeError extends RpcArgumentDecodeError_base<{
|
|
|
1029
1080
|
readonly index: number;
|
|
1030
1081
|
readonly cause: unknown;
|
|
1031
1082
|
}> {}
|
|
1032
|
-
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 & {
|
|
1033
1084
|
readonly _tag: "RpcArgumentEncodeError";
|
|
1034
1085
|
} & Readonly<A>;
|
|
1035
1086
|
declare class RpcArgumentEncodeError extends RpcArgumentEncodeError_base<{
|
|
@@ -1038,7 +1089,7 @@ declare class RpcArgumentEncodeError extends RpcArgumentEncodeError_base<{
|
|
|
1038
1089
|
readonly index: number;
|
|
1039
1090
|
readonly cause: unknown;
|
|
1040
1091
|
}> {}
|
|
1041
|
-
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 & {
|
|
1042
1093
|
readonly _tag: "RpcSuccessDecodeError";
|
|
1043
1094
|
} & Readonly<A>;
|
|
1044
1095
|
declare class RpcSuccessDecodeError extends RpcSuccessDecodeError_base<{
|
|
@@ -1046,7 +1097,7 @@ declare class RpcSuccessDecodeError extends RpcSuccessDecodeError_base<{
|
|
|
1046
1097
|
readonly method: string;
|
|
1047
1098
|
readonly cause: unknown;
|
|
1048
1099
|
}> {}
|
|
1049
|
-
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 & {
|
|
1050
1101
|
readonly _tag: "RpcSuccessEncodeError";
|
|
1051
1102
|
} & Readonly<A>;
|
|
1052
1103
|
declare class RpcSuccessEncodeError extends RpcSuccessEncodeError_base<{
|
|
@@ -1079,7 +1130,7 @@ interface Definition$9<Id extends string = string, MethodsShape extends Methods$
|
|
|
1079
1130
|
}
|
|
1080
1131
|
declare namespace Definition$9 {
|
|
1081
1132
|
type Any = Definition$9<string, Methods$4>;
|
|
1082
|
-
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]>>; };
|
|
1083
1134
|
type Api<Self extends Any, Reserved extends string = never> = Provider<ServerApi<Self>, Reserved>;
|
|
1084
1135
|
type MethodNames<Self extends Any> = Extract<keyof Self["methods"], string>;
|
|
1085
1136
|
}
|
|
@@ -1124,7 +1175,7 @@ interface QueueBindingClient<Message extends ServiceFreeSchema$4> {
|
|
|
1124
1175
|
readonly metrics: () => Effect.Effect<QueueMetrics, QueueOperationError>;
|
|
1125
1176
|
readonly unsafeRaw: Effect.Effect<CloudflareQueue<Schema.Codec.Encoded<Message>>>;
|
|
1126
1177
|
}
|
|
1127
|
-
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 & {
|
|
1128
1179
|
readonly _tag: "QueueOperationError";
|
|
1129
1180
|
} & Readonly<A>;
|
|
1130
1181
|
declare class QueueOperationError extends QueueOperationError_base<{
|
|
@@ -1135,7 +1186,7 @@ declare class QueueOperationError extends QueueOperationError_base<{
|
|
|
1135
1186
|
}> {}
|
|
1136
1187
|
declare const isQueue: <Body>(value: unknown) => value is QueueProducer<Body>;
|
|
1137
1188
|
declare const makeClient$8: <Message extends ServiceFreeSchema$4>(definition: QueueBindingDefinition<Message>) => ((queue: QueueProducer<Schema.Codec.Encoded<Message>>) => QueueBindingClient<Message>);
|
|
1138
|
-
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>;
|
|
1139
1190
|
declare namespace QueueDefinition_d_exports {
|
|
1140
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 };
|
|
1141
1192
|
}
|
|
@@ -1170,9 +1221,7 @@ declare const make$10: <Id extends string, Message extends ServiceFreeSchema$4>(
|
|
|
1170
1221
|
declare const Tag$13: <Self>() => <Id extends string, Message extends ServiceFreeSchema$4>(id: Id, definition: {
|
|
1171
1222
|
readonly message: Message;
|
|
1172
1223
|
}) => TagClass$12<Self, Id, Message>;
|
|
1173
|
-
declare const Queue$1:
|
|
1174
|
-
readonly message: Message;
|
|
1175
|
-
}) => TagClass$12<Self, Id, Message>;
|
|
1224
|
+
declare const Queue$1: typeof Tag$13;
|
|
1176
1225
|
declare const implement$7: <ROut, const Self extends Definition$8.Any>(_definition: Self, handler: Handler$3<ROut, Self>) => Handler$3<ROut, Self>;
|
|
1177
1226
|
declare namespace Queue_d_exports {
|
|
1178
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 };
|
|
@@ -1194,7 +1243,7 @@ interface QueueBatch<Body> {
|
|
|
1194
1243
|
readonly ackAll: Effect.Effect<void>;
|
|
1195
1244
|
readonly retryAll: (options?: globalThis.QueueRetryOptions) => Effect.Effect<void>;
|
|
1196
1245
|
}
|
|
1197
|
-
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 & {
|
|
1198
1247
|
readonly _tag: "QueueMessageDecodeError";
|
|
1199
1248
|
} & Readonly<A>;
|
|
1200
1249
|
declare class QueueMessageDecodeError extends QueueMessageDecodeError_base<{
|
|
@@ -1229,7 +1278,7 @@ type TagClass$11<Self, Id extends string, Message extends Definition$8.Any["mess
|
|
|
1229
1278
|
declare const Tag$12: <Self>() => <Id extends string, Message extends Definition$8.Any["message"]>(id: Id, definition: {
|
|
1230
1279
|
readonly message: Message;
|
|
1231
1280
|
}) => TagClass$11<Self, Id, Message>;
|
|
1232
|
-
declare const implement$6:
|
|
1281
|
+
declare const implement$6: typeof implement$7;
|
|
1233
1282
|
type Handler$2<ROut, Self extends Definition$8.Any> = Handler$3<ROut, Self>;
|
|
1234
1283
|
type Options$6<ROut, Self extends Definition$8.Any> = Options$7<ROut, Self>;
|
|
1235
1284
|
declare namespace WorkerDefinition_d_exports {
|
|
@@ -1269,12 +1318,12 @@ type NoReservedMethods$3<MethodsShape extends Methods$3> = Extract<keyof Methods
|
|
|
1269
1318
|
/**
|
|
1270
1319
|
* Promise-based client API derived from a {@link Definition}.
|
|
1271
1320
|
*/
|
|
1272
|
-
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]>>; };
|
|
1273
1322
|
type Api$3<Self extends Definition$6.Any> = Provider<ServerApi$4<Self>, ReservedMethodName$5>;
|
|
1274
1323
|
/**
|
|
1275
1324
|
* Effect handlers for each RPC method in a worker definition.
|
|
1276
1325
|
*/
|
|
1277
|
-
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]>>; };
|
|
1278
1327
|
/**
|
|
1279
1328
|
* Worker constructor options for a specific RPC definition.
|
|
1280
1329
|
*/
|
|
@@ -1297,14 +1346,14 @@ declare const method$3: {
|
|
|
1297
1346
|
<Success extends ServiceFreeSchema$3>(definition: {
|
|
1298
1347
|
readonly success: Success;
|
|
1299
1348
|
}): Method$4<readonly [], Success>;
|
|
1300
|
-
<const Args extends
|
|
1349
|
+
<const Args extends ReadonlyArray<ServiceFreeSchema$3>, Success extends ServiceFreeSchema$3>(definition: {
|
|
1301
1350
|
readonly args: Args;
|
|
1302
1351
|
readonly success: Success;
|
|
1303
1352
|
}): Method$4<Args, Success>;
|
|
1304
1353
|
};
|
|
1305
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>;
|
|
1306
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>;
|
|
1307
|
-
declare const Worker:
|
|
1356
|
+
declare const Worker: typeof Tag$11;
|
|
1308
1357
|
/**
|
|
1309
1358
|
* Helper for implementing handlers with the exact method shape of a definition.
|
|
1310
1359
|
*/
|
|
@@ -1316,7 +1365,7 @@ type HandlerEffect$3<ROut, Self extends Definition$6.Any, Key extends keyof Self
|
|
|
1316
1365
|
//#endregion
|
|
1317
1366
|
//#region src/internal/RpcInvocation.d.ts
|
|
1318
1367
|
type AnyArgs = Array<any>;
|
|
1319
|
-
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];
|
|
1320
1369
|
type AsyncMethodArgs<Api, Method extends keyof Api> = Api[Method] extends ((...args: infer Args) => Promise<unknown>) ? Args : never;
|
|
1321
1370
|
type AsyncMethodSuccess<Api, Method extends keyof Api> = Api[Method] extends ((...args: AnyArgs) => Promise<infer A>) ? A : never;
|
|
1322
1371
|
type AsyncMethodCloudflareReturn<Api, Method extends keyof Api> = Result$1<AsyncMethodSuccess<Api, Method>>;
|
|
@@ -1330,7 +1379,7 @@ declare const TypeId$1: "effect-cf/ServiceBinding";
|
|
|
1330
1379
|
interface ServiceFetcher {
|
|
1331
1380
|
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
1332
1381
|
}
|
|
1333
|
-
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]; };
|
|
1334
1383
|
type ReservedMethodName$4 = ReservedMethodName$5 | "fetch";
|
|
1335
1384
|
/**
|
|
1336
1385
|
* Native Cloudflare service object including optional RPC methods.
|
|
@@ -1347,7 +1396,7 @@ interface ServiceBindingDefinition<Definition extends Definition$6.Any | undefin
|
|
|
1347
1396
|
/** Optional RPC schema used for argument/result encoding. */
|
|
1348
1397
|
readonly definition?: Definition;
|
|
1349
1398
|
}
|
|
1350
|
-
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 & {
|
|
1351
1400
|
readonly _tag: "ServiceBindingFetchError";
|
|
1352
1401
|
} & Readonly<A>;
|
|
1353
1402
|
/**
|
|
@@ -1357,7 +1406,7 @@ declare class ServiceBindingFetchError extends ServiceBindingFetchError_base<{
|
|
|
1357
1406
|
readonly binding: string;
|
|
1358
1407
|
readonly cause: unknown;
|
|
1359
1408
|
}> {}
|
|
1360
|
-
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 & {
|
|
1361
1410
|
readonly _tag: "ServiceBindingRpcError";
|
|
1362
1411
|
} & Readonly<A>;
|
|
1363
1412
|
/**
|
|
@@ -1373,7 +1422,7 @@ type ServiceMethodArgs<Api, Method extends keyof Api> = AsyncMethodArgs<Api, Met
|
|
|
1373
1422
|
type ServiceMethodSuccess<Api, Method extends keyof Api> = AsyncMethodSuccess<Api, Method>;
|
|
1374
1423
|
type ServiceMethodCloudflareReturn<Api, Method extends keyof Api> = AsyncMethodCloudflareReturn<Api, Method>;
|
|
1375
1424
|
type ServiceCall<R, Api> = <Method extends ServiceMethodKey<Api>>(method: Method, ...args: ServiceMethodArgs<Api, Method>) => Effect.Effect<ServiceMethodSuccess<Api, Method>, ServiceBindingRpcError, R>;
|
|
1376
|
-
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>; };
|
|
1377
1426
|
type DirectMethods$1<R, Definition> = Definition extends Definition$6.Any ? DefinitionDirectMethods<R, Definition> : {};
|
|
1378
1427
|
type ServiceBindingEffectClient<Api extends object, Definition extends Definition$6.Any | undefined = undefined> = DirectMethods$1<never, Definition> & {
|
|
1379
1428
|
/**
|
|
@@ -1468,7 +1517,7 @@ type ServiceBindingStaticClient<R, Api extends object, Definition extends Defini
|
|
|
1468
1517
|
};
|
|
1469
1518
|
declare const isServiceBindingClient: <Api extends object>(value: unknown) => value is ServiceBindingClient<Api>;
|
|
1470
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>);
|
|
1471
|
-
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>;
|
|
1472
1521
|
/**
|
|
1473
1522
|
* Creates a typed Effect service for a Worker service binding.
|
|
1474
1523
|
*
|
|
@@ -1535,8 +1584,8 @@ type WorkerFetchSuccess = Response | HttpServerResponse.HttpServerResponse;
|
|
|
1535
1584
|
type WorkerHandler<ROut, A = WorkerFetchSuccess> = Effect.Effect<A, unknown, WorkerFetchContext<ROut>>;
|
|
1536
1585
|
type WorkerRpcHandler<ROut, A = unknown> = Effect.Effect<A, unknown, WorkerRpcContext<ROut>>;
|
|
1537
1586
|
type WorkerRpc<ROut> = Record<string, (...args: Array<any>) => WorkerRpcHandler<ROut>>;
|
|
1538
|
-
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 };
|
|
1539
|
-
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; };
|
|
1540
1589
|
interface WorkerOptions<RRuntime, REvent = never, EventLayerError = never, Rpc extends WorkerRpc<RRuntime | REvent> = Record<never, never>> {
|
|
1541
1590
|
/**
|
|
1542
1591
|
* Layer provided around each Cloudflare event handled by this Worker.
|
|
@@ -1585,9 +1634,9 @@ interface Definition$5<Id extends string = string, MethodsShape extends Methods$
|
|
|
1585
1634
|
declare namespace Definition$5 {
|
|
1586
1635
|
type Any = Definition$5<string, Methods$2>;
|
|
1587
1636
|
}
|
|
1588
|
-
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]>>; };
|
|
1589
1638
|
type Api$2<Self extends Definition$5.Any> = Provider<ServerApi$3<Self>, ReservedMethodName$3>;
|
|
1590
|
-
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]>>; };
|
|
1591
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"> {
|
|
1592
1641
|
readonly rpc: Handlers$2<ROut | REvent, Self>;
|
|
1593
1642
|
}
|
|
@@ -1604,7 +1653,7 @@ declare const method$2: {
|
|
|
1604
1653
|
<Success extends ServiceFreeSchema$2>(definition: {
|
|
1605
1654
|
readonly success: Success;
|
|
1606
1655
|
}): Method$3<readonly [], Success>;
|
|
1607
|
-
<const Args extends
|
|
1656
|
+
<const Args extends ReadonlyArray<ServiceFreeSchema$2>, Success extends ServiceFreeSchema$2>(definition: {
|
|
1608
1657
|
readonly args: Args;
|
|
1609
1658
|
readonly success: Success;
|
|
1610
1659
|
}): Method$3<Args, Success>;
|
|
@@ -1617,7 +1666,7 @@ declare namespace DurableObjectNamespace_d_exports {
|
|
|
1617
1666
|
interface DurableObjectFetcher {
|
|
1618
1667
|
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
1619
1668
|
}
|
|
1620
|
-
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]; };
|
|
1621
1670
|
type ReservedMethodName$2 = ReservedMethodName$1 | "fetch";
|
|
1622
1671
|
/**
|
|
1623
1672
|
* Cloudflare Durable Object stub, optionally enriched with RPC methods.
|
|
@@ -1658,7 +1707,7 @@ interface DurableObjectNamespaceBindingDefinition<Definition extends Definition$
|
|
|
1658
1707
|
/** Optional RPC schema used for argument/result encoding. */
|
|
1659
1708
|
readonly definition?: Definition;
|
|
1660
1709
|
}
|
|
1661
|
-
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 & {
|
|
1662
1711
|
readonly _tag: "DurableObjectRpcError";
|
|
1663
1712
|
} & Readonly<A>;
|
|
1664
1713
|
/**
|
|
@@ -1669,7 +1718,7 @@ declare class DurableObjectRpcError extends DurableObjectRpcError_base<{
|
|
|
1669
1718
|
readonly method: string;
|
|
1670
1719
|
readonly cause: unknown;
|
|
1671
1720
|
}> {}
|
|
1672
|
-
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 & {
|
|
1673
1722
|
readonly _tag: "DurableObjectFetchError";
|
|
1674
1723
|
} & Readonly<A>;
|
|
1675
1724
|
/**
|
|
@@ -1684,21 +1733,27 @@ type StubMethodArgs<Api, Method extends keyof Api> = AsyncMethodArgs<Api, Method
|
|
|
1684
1733
|
type StubMethodSuccess<Api, Method extends keyof Api> = AsyncMethodSuccess<Api, Method>;
|
|
1685
1734
|
type StubMethodCloudflareReturn<Api, Method extends keyof Api> = AsyncMethodCloudflareReturn<Api, Method>;
|
|
1686
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>;
|
|
1687
|
-
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>; };
|
|
1688
1737
|
type DefinitionDurableObjectDirectClient<R, Definition extends Definition$4.Any> = {
|
|
1689
1738
|
readonly fetch: (input: RequestInfo | URL, init?: RequestInit) => Effect.Effect<globalThis.Response, DurableObjectFetchError, R>;
|
|
1690
|
-
} & { 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>; };
|
|
1691
1740
|
type DefinitionNamespaceDirectClientMethods<R, Definition extends Definition$4.Any> = {
|
|
1692
1741
|
readonly byName: (name: string, options?: globalThis.DurableObjectNamespaceGetDurableObjectOptions) => DefinitionDurableObjectDirectClient<R, Definition>;
|
|
1693
1742
|
readonly byId: (id: globalThis.DurableObjectId, options?: globalThis.DurableObjectNamespaceGetDurableObjectOptions) => DefinitionDurableObjectDirectClient<R, Definition>;
|
|
1694
1743
|
};
|
|
1695
1744
|
type DirectMethods<R, Api extends object, Definition> = Definition extends Definition$4.Any ? DefinitionNamespaceDirectMethods<R, Api, Definition> & DefinitionNamespaceDirectClientMethods<R, Definition> : {};
|
|
1696
1745
|
type DurableObjectNamespaceEffectClient<Api extends object, Definition extends Definition$4.Any | undefined = undefined> = DirectMethods<never, Api, Definition> & {
|
|
1697
|
-
/** Creates a globally unique Durable Object id. */
|
|
1698
|
-
readonly
|
|
1699
|
-
|
|
1700
|
-
readonly
|
|
1701
|
-
|
|
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. */
|
|
1702
1757
|
readonly jurisdiction: (jurisdiction: globalThis.DurableObjectJurisdiction) => Effect.Effect<DurableObjectNamespaceClient<Api>>;
|
|
1703
1758
|
/**
|
|
1704
1759
|
* Forwards an HTTP request to a Durable Object stub.
|
|
@@ -1811,7 +1866,7 @@ type DurableObjectNamespaceStaticClient<R, Api extends object, Definition extend
|
|
|
1811
1866
|
};
|
|
1812
1867
|
declare const isDurableObjectNamespaceClient: <Api extends object>(value: unknown) => value is DurableObjectNamespaceClient<Api>;
|
|
1813
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>);
|
|
1814
|
-
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>;
|
|
1815
1870
|
declare const makeDirectMethods: <R, Api extends object, Definition extends Definition$4.Any | undefined>(rpcDefinition: Definition | undefined, helpers: {
|
|
1816
1871
|
readonly call: StubCall<R, Api>;
|
|
1817
1872
|
readonly fetch: (stub: DurableObjectStubClient<Api>, input: RequestInfo | URL, init?: RequestInit) => Effect.Effect<globalThis.Response, DurableObjectFetchError, R>;
|
|
@@ -1852,12 +1907,12 @@ type NoReservedMethods$1<MethodsShape extends Methods$1> = Extract<keyof Methods
|
|
|
1852
1907
|
/**
|
|
1853
1908
|
* Promise-based client API derived from a Durable Object definition.
|
|
1854
1909
|
*/
|
|
1855
|
-
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]>>; };
|
|
1856
1911
|
type Api$1<Self extends Definition$4.Any> = Provider<ServerApi$2<Self>, ReservedMethodName$1>;
|
|
1857
1912
|
/**
|
|
1858
1913
|
* Effect handlers for each RPC method in a Durable Object definition.
|
|
1859
1914
|
*/
|
|
1860
|
-
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]>>; };
|
|
1861
1916
|
/**
|
|
1862
1917
|
* Durable Object constructor options for a specific RPC definition.
|
|
1863
1918
|
*/
|
|
@@ -1880,14 +1935,14 @@ declare const method$1: {
|
|
|
1880
1935
|
<Success extends ServiceFreeSchema$1>(definition: {
|
|
1881
1936
|
readonly success: Success;
|
|
1882
1937
|
}): Method$2<readonly [], Success>;
|
|
1883
|
-
<const Args extends
|
|
1938
|
+
<const Args extends ReadonlyArray<ServiceFreeSchema$1>, Success extends ServiceFreeSchema$1>(definition: {
|
|
1884
1939
|
readonly args: Args;
|
|
1885
1940
|
readonly success: Success;
|
|
1886
1941
|
}): Method$2<Args, Success>;
|
|
1887
1942
|
};
|
|
1888
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>;
|
|
1889
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>;
|
|
1890
|
-
declare const DurableObject$1:
|
|
1945
|
+
declare const DurableObject$1: typeof Tag$9;
|
|
1891
1946
|
/**
|
|
1892
1947
|
* Helper for implementing handlers with the exact method shape of a definition.
|
|
1893
1948
|
*/
|
|
@@ -1910,8 +1965,8 @@ type DurableObjectHandler<ROut, A = unknown> = Effect.Effect<A, unknown, Handler
|
|
|
1910
1965
|
* Shape of Durable Object RPC handlers passed to {@link make}.
|
|
1911
1966
|
*/
|
|
1912
1967
|
type DurableObjectRpc<ROut> = Record<string, (...args: Array<any>) => DurableObjectHandler<ROut>>;
|
|
1913
|
-
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 };
|
|
1914
|
-
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; };
|
|
1915
1970
|
/**
|
|
1916
1971
|
* Options for creating a Durable Object class backed by Effect handlers.
|
|
1917
1972
|
*/
|
|
@@ -1981,9 +2036,9 @@ declare namespace Definition$3 {
|
|
|
1981
2036
|
type Any = Definition$3<string, Methods>;
|
|
1982
2037
|
}
|
|
1983
2038
|
type LayerOptions$8 = LayerOptions$9;
|
|
1984
|
-
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]>>; };
|
|
1985
2040
|
type Api<Self extends Definition$3.Any> = Provider<ServerApi$1<Self>, ReservedMethodName>;
|
|
1986
|
-
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]>>; };
|
|
1987
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"> {
|
|
1988
2043
|
readonly rpc: Handlers<ROut | REvent, Self>;
|
|
1989
2044
|
}
|
|
@@ -1999,7 +2054,7 @@ declare const method: {
|
|
|
1999
2054
|
<Success extends ServiceFreeSchema>(definition: {
|
|
2000
2055
|
readonly success: Success;
|
|
2001
2056
|
}): Method$1<readonly [], Success>;
|
|
2002
|
-
<const Args extends
|
|
2057
|
+
<const Args extends ReadonlyArray<ServiceFreeSchema>, Success extends ServiceFreeSchema>(definition: {
|
|
2003
2058
|
readonly args: Args;
|
|
2004
2059
|
readonly success: Success;
|
|
2005
2060
|
}): Method$1<Args, Success>;
|
|
@@ -2017,31 +2072,31 @@ declare namespace DurableObjectAlarm_d_exports {
|
|
|
2017
2072
|
* tag in their own domain layer.
|
|
2018
2073
|
*/
|
|
2019
2074
|
type AlarmPayload = Schema.Json;
|
|
2020
|
-
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 & {
|
|
2021
2076
|
readonly _tag: "InvalidAlarmRefError";
|
|
2022
2077
|
} & Readonly<A>;
|
|
2023
2078
|
declare class InvalidAlarmRefError extends InvalidAlarmRefError_base<{
|
|
2024
2079
|
readonly cause: unknown;
|
|
2025
2080
|
}> {}
|
|
2026
|
-
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 & {
|
|
2027
2082
|
readonly _tag: "InvalidAlarmPayloadError";
|
|
2028
2083
|
} & Readonly<A>;
|
|
2029
2084
|
declare class InvalidAlarmPayloadError extends InvalidAlarmPayloadError_base<{
|
|
2030
2085
|
readonly cause: unknown;
|
|
2031
2086
|
}> {}
|
|
2032
|
-
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 & {
|
|
2033
2088
|
readonly _tag: "InvalidRepeatEveryError";
|
|
2034
2089
|
} & Readonly<A>;
|
|
2035
2090
|
declare class InvalidRepeatEveryError extends InvalidRepeatEveryError_base<{
|
|
2036
2091
|
readonly cause: unknown;
|
|
2037
2092
|
}> {}
|
|
2038
|
-
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 & {
|
|
2039
2094
|
readonly _tag: "InvalidProcessDueAlarmsOptionsError";
|
|
2040
2095
|
} & Readonly<A>;
|
|
2041
2096
|
declare class InvalidProcessDueAlarmsOptionsError extends InvalidProcessDueAlarmsOptionsError_base<{
|
|
2042
2097
|
readonly cause: unknown;
|
|
2043
2098
|
}> {}
|
|
2044
|
-
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 & {
|
|
2045
2100
|
readonly _tag: "StoredAlarmDecodeError";
|
|
2046
2101
|
} & Readonly<A>;
|
|
2047
2102
|
declare class StoredAlarmDecodeError extends StoredAlarmDecodeError_base<{
|
|
@@ -2259,7 +2314,7 @@ type AlarmScheduler = {
|
|
|
2259
2314
|
readonly scheduleAlarm: (input: ScheduleAlarmInput) => Effect.Effect<void, InvalidAlarmPayloadError | InvalidAlarmRefError | InvalidRepeatEveryError | StorageOperationError>;
|
|
2260
2315
|
};
|
|
2261
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>;
|
|
2262
|
-
declare const process:
|
|
2317
|
+
declare const process: typeof processDue;
|
|
2263
2318
|
type AlarmPayloadSchema = Schema.Codec<any, any, never, never>;
|
|
2264
2319
|
type AlarmFailurePolicy = "ordered" | "retry" | "skip-and-advance-repeat";
|
|
2265
2320
|
interface AlarmRetryPolicy {
|
|
@@ -2278,7 +2333,7 @@ type DefinedAlarmEvent<Tag extends string, Payload> = Omit<DurableObjectAlarmEve
|
|
|
2278
2333
|
readonly payload: Payload;
|
|
2279
2334
|
readonly tag: Tag;
|
|
2280
2335
|
};
|
|
2281
|
-
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>; };
|
|
2282
2337
|
declare const define: <const Definitions extends AlarmDefinitions>(definitions: Definitions) => {
|
|
2283
2338
|
handlers: <R = never, E = never>(handlers: DefinedAlarmHandlers<Definitions, R, E>, options?: ProcessDueAlarmsOptions<R, E>) => Effect.Effect<ProcessDueAlarmsResult, E | DurableObjectAlarmError, R | DurableObjectAlarm>;
|
|
2284
2339
|
};
|
|
@@ -2378,11 +2433,28 @@ type SqliteLayerOptions = Omit<SqliteClient.SqliteClientConfig, "db">;
|
|
|
2378
2433
|
* );
|
|
2379
2434
|
* ```
|
|
2380
2435
|
*/
|
|
2381
|
-
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>;
|
|
2382
2437
|
declare namespace Email_d_exports {
|
|
2383
|
-
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 };
|
|
2384
|
-
}
|
|
2385
|
-
|
|
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 & {
|
|
2386
2458
|
readonly _tag: "EmailOperationError";
|
|
2387
2459
|
} & Readonly<A>;
|
|
2388
2460
|
/** Error raised when a Cloudflare Send Email operation fails. */
|
|
@@ -2390,6 +2462,24 @@ declare class EmailOperationError extends EmailOperationError_base<{
|
|
|
2390
2462
|
readonly binding: string;
|
|
2391
2463
|
readonly operation: string;
|
|
2392
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>;
|
|
2393
2483
|
}> {}
|
|
2394
2484
|
/** Typed Cloudflare Send Email binding definition. */
|
|
2395
2485
|
interface EmailDefinition {
|
|
@@ -2403,10 +2493,16 @@ type EmailMessageBuilder = Parameters<CloudflareSendEmail["send"]>[0];
|
|
|
2403
2493
|
type EmailSendInput = EmailMessage | EmailMessageBuilder;
|
|
2404
2494
|
type EmailSendResult = CloudflareEmailSendResult;
|
|
2405
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
|
+
}
|
|
2406
2502
|
interface EmailClient {
|
|
2407
2503
|
readonly send: {
|
|
2408
|
-
(message: EmailMessage): Effect.Effect<EmailSendResult,
|
|
2409
|
-
(builder: EmailMessageBuilder): Effect.Effect<EmailSendResult,
|
|
2504
|
+
(message: EmailMessage): Effect.Effect<EmailSendResult, EmailSendError>;
|
|
2505
|
+
(builder: EmailMessageBuilder): Effect.Effect<EmailSendResult, EmailSendError>;
|
|
2410
2506
|
};
|
|
2411
2507
|
readonly unsafeRaw: Effect.Effect<EmailBinding>;
|
|
2412
2508
|
readonly definition: EmailDefinition;
|
|
@@ -2420,21 +2516,33 @@ interface EmailService<Id extends string> {
|
|
|
2420
2516
|
}
|
|
2421
2517
|
type LayerOptions$6 = {
|
|
2422
2518
|
readonly binding: string;
|
|
2519
|
+
readonly send?: EmailSendOptions;
|
|
2423
2520
|
};
|
|
2424
2521
|
interface TagClass$6<Self, Id extends string> extends Context.ServiceClass<Self, Id, EmailClient> {
|
|
2425
2522
|
readonly id: Id;
|
|
2426
2523
|
readonly layer: (options: LayerOptions$6) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2427
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>;
|
|
2428
2536
|
declare const isEmailBinding: (value: unknown) => value is EmailBinding;
|
|
2429
|
-
declare const makeClient$5: (definition: EmailDefinition) => (email: EmailBinding) => EmailClient;
|
|
2430
|
-
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>;
|
|
2431
2539
|
declare const make$5: <Id extends string>(id: Id) => TagClass$6<EmailService<Id>, Id>;
|
|
2432
2540
|
declare const Tag$7: <Self>() => <Id extends string>(id: Id) => TagClass$6<Self, Id>;
|
|
2433
2541
|
declare namespace Images_d_exports {
|
|
2434
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 };
|
|
2435
2543
|
}
|
|
2436
2544
|
declare const TypeId: "effect-cf/Images/Steps";
|
|
2437
|
-
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 & {
|
|
2438
2546
|
readonly _tag: "ImagesOperationError";
|
|
2439
2547
|
} & Readonly<A>;
|
|
2440
2548
|
/** Error raised when a Cloudflare Images operation fails. */
|
|
@@ -2541,7 +2649,7 @@ declare const Tag$6: <Self>() => <Id extends string>(id: Id) => TagClass$5<Self,
|
|
|
2541
2649
|
declare namespace Kv_d_exports {
|
|
2542
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 };
|
|
2543
2651
|
}
|
|
2544
|
-
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 & {
|
|
2545
2653
|
readonly _tag: "KvOperationError";
|
|
2546
2654
|
} & Readonly<A>;
|
|
2547
2655
|
/** Error raised when a KV operation fails. */
|
|
@@ -2627,7 +2735,7 @@ declare const Tag$5: <Self>() => <Id extends string, Key, Value, EncodedValue>(i
|
|
|
2627
2735
|
declare namespace R2_d_exports {
|
|
2628
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 };
|
|
2629
2737
|
}
|
|
2630
|
-
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 & {
|
|
2631
2739
|
readonly _tag: "R2OperationError";
|
|
2632
2740
|
} & Readonly<A>;
|
|
2633
2741
|
/** Error raised when an R2 operation fails. */
|
|
@@ -2755,7 +2863,7 @@ interface WorkflowBindingClient<Payload extends ServiceFreeSchema$4, Result exte
|
|
|
2755
2863
|
readonly get: (instanceId: string) => Effect.Effect<WorkflowInstance<Schema.Schema.Type<Result>>, WorkflowOperationError>;
|
|
2756
2864
|
readonly unsafeRaw: Effect.Effect<CloudflareWorkflow<Schema.Codec.Encoded<Payload>>>;
|
|
2757
2865
|
}
|
|
2758
|
-
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 & {
|
|
2759
2867
|
readonly _tag: "WorkflowOperationError";
|
|
2760
2868
|
} & Readonly<A>;
|
|
2761
2869
|
declare class WorkflowOperationError extends WorkflowOperationError_base<{
|
|
@@ -2763,7 +2871,7 @@ declare class WorkflowOperationError extends WorkflowOperationError_base<{
|
|
|
2763
2871
|
readonly operation: string;
|
|
2764
2872
|
readonly cause: unknown;
|
|
2765
2873
|
}> {}
|
|
2766
|
-
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 & {
|
|
2767
2875
|
readonly _tag: "WorkflowResultDecodeError";
|
|
2768
2876
|
} & Readonly<A>;
|
|
2769
2877
|
declare class WorkflowResultDecodeError extends WorkflowResultDecodeError_base<{
|
|
@@ -2773,7 +2881,7 @@ declare class WorkflowResultDecodeError extends WorkflowResultDecodeError_base<{
|
|
|
2773
2881
|
}> {}
|
|
2774
2882
|
declare const isWorkflow: <Payload>(value: unknown) => value is CloudflareWorkflow<Payload>;
|
|
2775
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>);
|
|
2776
|
-
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>;
|
|
2777
2885
|
declare namespace WorkflowDefinition_d_exports {
|
|
2778
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 };
|
|
2779
2887
|
}
|
|
@@ -2811,10 +2919,7 @@ declare const Tag$3: <Self>() => <Id extends string, Payload extends ServiceFree
|
|
|
2811
2919
|
readonly payload: Payload;
|
|
2812
2920
|
readonly result: Result;
|
|
2813
2921
|
}) => TagClass$2<Self, Id, Payload, Result>;
|
|
2814
|
-
declare const Workflow:
|
|
2815
|
-
readonly payload: Payload;
|
|
2816
|
-
readonly result: Result;
|
|
2817
|
-
}) => TagClass$2<Self, Id, Payload, Result>;
|
|
2922
|
+
declare const Workflow: typeof Tag$3;
|
|
2818
2923
|
declare const implement$1: <ROut, const Self extends Definition$1.Any>(_definition: Self, handler: Handler$1<ROut, Self>) => Handler$1<ROut, Self>;
|
|
2819
2924
|
declare namespace Workflow_d_exports {
|
|
2820
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 };
|
|
@@ -2869,13 +2974,13 @@ declare const Tag$2: <Self>() => <Id extends string, Payload extends Definition$
|
|
|
2869
2974
|
readonly payload: Payload;
|
|
2870
2975
|
readonly result: Result;
|
|
2871
2976
|
}) => TagClass$1<Self, Id, Payload, Result>;
|
|
2872
|
-
declare const implement:
|
|
2977
|
+
declare const implement: typeof implement$1;
|
|
2873
2978
|
type Handler<ROut, Self extends Definition$1.Any> = Handler$1<ROut, Self>;
|
|
2874
2979
|
type Options<ROut, Self extends Definition$1.Any> = Options$1<ROut, Self>;
|
|
2875
2980
|
declare namespace Vectorize_d_exports {
|
|
2876
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 };
|
|
2877
2982
|
}
|
|
2878
|
-
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 & {
|
|
2879
2984
|
readonly _tag: "VectorizeOperationError";
|
|
2880
2985
|
} & Readonly<A>;
|
|
2881
2986
|
/** Error raised when a Vectorize operation fails. */
|
|
@@ -2933,4 +3038,4 @@ declare const layer: <Self>(tag: Context.Service<Self, VectorizeClient>, definit
|
|
|
2933
3038
|
declare const make: <Id extends string>(id: Id) => TagClass<VectorizeService<Id>, Id>;
|
|
2934
3039
|
declare const Tag$1: <Self>() => <Id extends string>(id: Id) => TagClass<Self, Id>;
|
|
2935
3040
|
//#endregion
|
|
2936
|
-
export { AiGateway_d_exports as AiGateway, AnalyticsEngine_d_exports as AnalyticsEngine, Binding_d_exports as Binding, BrowserRendering_d_exports as BrowserRendering, CloudflareOtlp_d_exports as CloudflareOtlp, ContainerNamespace_d_exports as ContainerNamespace, D1_d_exports as D1, DurableObject_d_exports as DurableObject, DurableObjectAlarm_d_exports as DurableObjectAlarm, DurableObjectDefinition_d_exports as DurableObjectDefinition, DurableObjectNamespace_d_exports as DurableObjectNamespace, DurableObjectRpcWebSocket_d_exports as DurableObjectRpcWebSocket, DurableObjectSqlite_d_exports as DurableObjectSqlite, DurableObjectState_d_exports as DurableObjectState, DurableObjectStorage_d_exports as DurableObjectStorage, DurableObjectWebSocket_d_exports as DurableObjectWebSocket, Email_d_exports as Email, Hyperdrive_d_exports as Hyperdrive, Images_d_exports as Images, Kv_d_exports as Kv, Queue_d_exports as Queue, QueueBinding_d_exports as QueueBinding, QueueDefinition_d_exports as QueueDefinition, R2_d_exports as R2, Rpc_d_exports as Rpc, RpcDefinition_d_exports as RpcDefinition, ServiceBinding_d_exports as ServiceBinding, Vectorize_d_exports as Vectorize, Worker_d_exports as Worker, WorkerConfig, WorkerDefinition_d_exports as WorkerDefinition, type WorkerEnv, WorkerEnvironment, WorkersAi_d_exports as WorkersAi, Workflow_d_exports as Workflow, WorkflowBinding_d_exports as WorkflowBinding, WorkflowDefinition_d_exports as WorkflowDefinition };
|
|
3041
|
+
export { AiGateway_d_exports as AiGateway, AnalyticsEngine_d_exports as AnalyticsEngine, Binding_d_exports as Binding, BrowserRendering_d_exports as BrowserRendering, Cache_d_exports as Cache, CloudflareOtlp_d_exports as CloudflareOtlp, ContainerNamespace_d_exports as ContainerNamespace, D1_d_exports as D1, DurableObject_d_exports as DurableObject, DurableObjectAlarm_d_exports as DurableObjectAlarm, DurableObjectDefinition_d_exports as DurableObjectDefinition, DurableObjectNamespace_d_exports as DurableObjectNamespace, DurableObjectRpcWebSocket_d_exports as DurableObjectRpcWebSocket, DurableObjectSqlite_d_exports as DurableObjectSqlite, DurableObjectState_d_exports as DurableObjectState, DurableObjectStorage_d_exports as DurableObjectStorage, DurableObjectWebSocket_d_exports as DurableObjectWebSocket, Email_d_exports as Email, Hyperdrive_d_exports as Hyperdrive, Images_d_exports as Images, Kv_d_exports as Kv, Queue_d_exports as Queue, QueueBinding_d_exports as QueueBinding, QueueDefinition_d_exports as QueueDefinition, R2_d_exports as R2, Rpc_d_exports as Rpc, RpcDefinition_d_exports as RpcDefinition, ServiceBinding_d_exports as ServiceBinding, Vectorize_d_exports as Vectorize, Worker_d_exports as Worker, WorkerConfig, WorkerDefinition_d_exports as WorkerDefinition, type WorkerEnv, WorkerEnvironment, WorkersAi_d_exports as WorkersAi, Workflow_d_exports as Workflow, WorkflowBinding_d_exports as WorkflowBinding, WorkflowDefinition_d_exports as WorkflowDefinition };
|