effect-cf 0.27.0 → 0.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +6 -0
- package/dist/{Artifacts-DcoXcRP5.d.mts → Artifacts-DnHQA-Ax.d.mts} +42 -25
- package/dist/{Artifacts-BhWrdyqX.mjs → Artifacts-rq3hUKQE.mjs} +46 -30
- package/dist/{Binding-COCtoJXa.d.mts → Binding-xJJJPmiD.d.mts} +6 -5
- package/dist/ComputerArtifacts.d.mts +1 -1
- package/dist/ComputerArtifacts.mjs +9 -9
- package/dist/ComputerWorkspace.d.mts +5 -5
- package/dist/ComputerWorkspace.mjs +107 -75
- package/dist/ComputerWorkspaceHost.d.mts +1 -1
- package/dist/ComputerWorkspaceHost.mjs +18 -16
- package/dist/{DurableObjectState-Dux8KfjG.mjs → DurableObjectState-BjkK2kwH.mjs} +3 -3
- package/dist/{DurableObjectState-biHrHwrh.d.mts → DurableObjectState-OupNMMUl.d.mts} +89 -64
- package/dist/{ErrorMessage-_lg53p3W.mjs → ErrorMessage-BM0K-Nik.mjs} +1 -4
- package/dist/{Hyperdrive-6p59yyVk.d.mts → Hyperdrive-z-9fFz15.d.mts} +2 -2
- package/dist/HyperdrivePg.d.mts +2 -2
- package/dist/Vitest.d.mts +6 -5
- package/dist/Vitest.mjs +2 -2
- package/dist/{WorkflowBinding-zlRPCXVf.d.mts → WorkflowBinding-DUZtKCVM.d.mts} +5 -10
- package/dist/index.d.mts +88 -62
- package/dist/index.mjs +291 -181
- package/package.json +1 -1
- package/src/AiGateway.ts +62 -7
- package/src/AnalyticsEngine.ts +17 -13
- package/src/Artifacts.ts +111 -47
- package/src/Binding.ts +34 -23
- package/src/BrowserRendering.ts +72 -33
- package/src/CloudflareOtlp.ts +21 -11
- package/src/ComputerArtifacts.ts +17 -9
- package/src/ComputerWorkspace.ts +202 -98
- package/src/ComputerWorkspaceHost.ts +55 -27
- package/src/ContainerNamespace.ts +8 -9
- package/src/D1.ts +8 -14
- package/src/DurableObject.ts +33 -13
- package/src/DurableObjectAlarm.ts +17 -5
- package/src/DurableObjectDefinition.ts +89 -72
- package/src/DurableObjectNamespace.ts +26 -12
- package/src/DurableObjectRpcWebSocket.ts +9 -10
- package/src/DurableObjectState.ts +1 -0
- package/src/DurableObjectStorage.ts +5 -2
- package/src/DurableObjectWebSocket.ts +4 -1
- package/src/Email.ts +26 -25
- package/src/Hyperdrive.ts +4 -10
- package/src/Images.ts +12 -14
- package/src/Kv.ts +15 -17
- package/src/Queue.ts +2 -1
- package/src/QueueBinding.ts +7 -12
- package/src/QueueDefinition.ts +7 -2
- package/src/R2.ts +33 -24
- package/src/Rpc.ts +15 -21
- package/src/RpcDefinition.ts +33 -38
- package/src/ServiceBinding.ts +26 -8
- package/src/Vectorize.ts +45 -18
- package/src/Vitest.ts +9 -3
- package/src/WebTransport.ts +11 -5
- package/src/Worker.ts +97 -24
- package/src/WorkerDefinition.ts +143 -63
- package/src/WorkersAi.ts +50 -28
- package/src/Workflow.ts +66 -13
- package/src/WorkflowBinding.ts +18 -25
- package/src/WorkflowDefinition.ts +4 -2
- package/src/internal/Entrypoint.ts +29 -13
- package/src/internal/ErrorMessage.ts +7 -6
- package/src/internal/RpcInvocation.ts +34 -11
- package/src/internal/Runtime.ts +33 -22
- package/src/internal/Telemetry.ts +17 -10
- package/src/internal/WorkerContext.ts +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a as Environment_d_exports, c as WorkerEnvironment, i as Binding_d_exports, n as BindingService, o as WorkerConfig, r as BindingValidationError, s as WorkerEnv, t as BindingNotFoundError } from "./Binding-
|
|
2
|
-
import { l as Artifacts_d_exports } from "./Artifacts-
|
|
3
|
-
import { C as Rpc_d_exports, D as StorageOperationError, E as DurableObjectStorage_d_exports, S as Provider, T as DurableWebSocket, _ as Definition$4, a as NativeRequest, b as RpcDefinition_d_exports, c as WorkerDefinition_d_exports, d as AsyncMethodCloudflareReturn, f as AsyncMethodKey, g as QueueBinding_d_exports, h as QueueDefinition_d_exports, i as ExecutionContext, l as ServiceBinding_d_exports, m as Queue_d_exports, o as WorkerContext, p as AsyncMethodSuccess, r as DurableObjectState_d_exports, s as Worker_d_exports, t as DurableObjectState, u as AsyncMethodArgs, v as Method$2, w as DurableObjectWebSocket_d_exports, x as ServiceFreeSchema$1, y as ReservedMethodName$2 } from "./DurableObjectState-
|
|
4
|
-
import { t as Hyperdrive_d_exports } from "./Hyperdrive-
|
|
5
|
-
import { a as WorkflowInstanceCreateOptions, i as WorkflowInstanceCreateBatchOptions, n as WorkflowBinding_d_exports, r as WorkflowInstance, s as WorkflowOperationError, t as WorkflowBindingClient } from "./WorkflowBinding-
|
|
6
|
-
import { Config, Context, Data, DateTime, Duration, Effect, Layer, Option, Redacted, Schema, Scope } from "effect";
|
|
1
|
+
import { a as Environment_d_exports, c as WorkerEnvironment, i as Binding_d_exports, n as BindingService, o as WorkerConfig, r as BindingValidationError, s as WorkerEnv, t as BindingNotFoundError } from "./Binding-xJJJPmiD.mjs";
|
|
2
|
+
import { l as Artifacts_d_exports } from "./Artifacts-DnHQA-Ax.mjs";
|
|
3
|
+
import { C as Rpc_d_exports, D as StorageOperationError, E as DurableObjectStorage_d_exports, S as Provider, T as DurableWebSocket, _ as Definition$4, a as NativeRequest, b as RpcDefinition_d_exports, c as WorkerDefinition_d_exports, d as AsyncMethodCloudflareReturn, f as AsyncMethodKey, g as QueueBinding_d_exports, h as QueueDefinition_d_exports, i as ExecutionContext, l as ServiceBinding_d_exports, m as Queue_d_exports, o as WorkerContext, p as AsyncMethodSuccess, r as DurableObjectState_d_exports, s as Worker_d_exports, t as DurableObjectState, u as AsyncMethodArgs, v as Method$2, w as DurableObjectWebSocket_d_exports, x as ServiceFreeSchema$1, y as ReservedMethodName$2 } from "./DurableObjectState-OupNMMUl.mjs";
|
|
4
|
+
import { t as Hyperdrive_d_exports } from "./Hyperdrive-z-9fFz15.mjs";
|
|
5
|
+
import { a as WorkflowInstanceCreateOptions, i as WorkflowInstanceCreateBatchOptions, n as WorkflowBinding_d_exports, r as WorkflowInstance, s as WorkflowOperationError, t as WorkflowBindingClient } from "./WorkflowBinding-DUZtKCVM.mjs";
|
|
6
|
+
import { Cause, Config, Context, Data, DateTime, Duration, Effect, Layer, Option, Predicate, Redacted, Schema, Scope } from "effect";
|
|
7
7
|
import { Headers as Headers$1, HttpClient, HttpClientResponse } from "effect/unstable/http";
|
|
8
|
-
import { OtlpExporter } from "effect/unstable/observability";
|
|
8
|
+
import { OtlpExporter, OtlpResource } from "effect/unstable/observability";
|
|
9
9
|
import { D1Client } from "@effect/sql-d1";
|
|
10
10
|
import { DurableObject, WorkflowEntrypoint, WorkflowEvent, WorkflowSleepDuration, WorkflowStep, WorkflowStepConfig, WorkflowStepContext, WorkflowStepEvent, WorkflowTimeoutDuration } from "cloudflare:workers";
|
|
11
11
|
import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization";
|
|
@@ -37,10 +37,11 @@ type WorkersAiOptions = AiOptions;
|
|
|
37
37
|
type WorkersAiModelsSearchParams = AiModelsSearchParams;
|
|
38
38
|
type WorkersAiModelsSearchObject = AiModelsSearchObject;
|
|
39
39
|
type WorkersAiAsyncBatchResponse = AiAsyncBatchResponse;
|
|
40
|
-
type WorkersAiEmbeddingInput = AiTextEmbeddingsInput | Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Input |
|
|
40
|
+
type WorkersAiEmbeddingInput = AiTextEmbeddingsInput | Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Input | Parameters<WorkersAiBinding["run"]>[1];
|
|
41
|
+
declare const embeddingDimensionsKey = "shape";
|
|
41
42
|
interface WorkersAiEmbeddingResponse {
|
|
42
43
|
readonly data: ReadonlyArray<ReadonlyArray<number>>;
|
|
43
|
-
readonly
|
|
44
|
+
readonly [embeddingDimensionsKey]: ReadonlyArray<number>;
|
|
44
45
|
}
|
|
45
46
|
interface WorkersAiClient<ModelList extends AiModelListType = AiModels> {
|
|
46
47
|
readonly aiGatewayLogId: Effect.Effect<string | null, WorkersAiOperationError>;
|
|
@@ -60,7 +61,7 @@ interface WorkersAiClient<ModelList extends AiModelListType = AiModels> {
|
|
|
60
61
|
readonly stream: true;
|
|
61
62
|
}, options?: WorkersAiOptions): Effect.Effect<ReadableStream, WorkersAiOperationError>;
|
|
62
63
|
<Name extends keyof ModelList>(model: Name, input: ModelList[Name]["inputs"], options?: WorkersAiOptions): Effect.Effect<ModelList[Name]["postProcessedOutputs"], WorkersAiOperationError>;
|
|
63
|
-
<Input extends
|
|
64
|
+
<Input extends Parameters<WorkersAiBinding["run"]>[1], Output = Awaited<ReturnType<WorkersAiBinding["run"]>>>(model: string, input: Input, options?: WorkersAiOptions): Effect.Effect<Output, WorkersAiOperationError>;
|
|
64
65
|
};
|
|
65
66
|
readonly runEmbedding: <Input extends WorkersAiEmbeddingInput>(model: string, input: Input, options?: WorkersAiOptions) => Effect.Effect<WorkersAiEmbeddingResponse, WorkersAiOperationError>;
|
|
66
67
|
readonly models: (params?: WorkersAiModelsSearchParams) => Effect.Effect<ReadonlyArray<WorkersAiModelsSearchObject>, WorkersAiOperationError>;
|
|
@@ -82,10 +83,11 @@ interface TagClass$12<Self, Id extends string, ModelList extends AiModelListType
|
|
|
82
83
|
readonly id: Id;
|
|
83
84
|
readonly layer: (options: LayerOptions$14) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
84
85
|
}
|
|
85
|
-
|
|
86
|
+
type WorkersAiBindingValue = Schema.Schema.Type<typeof Schema.Unknown>;
|
|
87
|
+
declare const isWorkersAiBinding: (value: WorkersAiBindingValue) => value is WorkersAiBinding;
|
|
86
88
|
declare const embeddingResponse: (value: {
|
|
87
89
|
readonly data?: ReadonlyArray<ReadonlyArray<number>>;
|
|
88
|
-
readonly
|
|
90
|
+
readonly [embeddingDimensionsKey]?: ReadonlyArray<number>;
|
|
89
91
|
}) => WorkersAiEmbeddingResponse;
|
|
90
92
|
declare const makeClient$11: <ModelList extends AiModelListType = AiModels>(definition: WorkersAiDefinition) => (ai: WorkersAiBinding<ModelList>) => WorkersAiClient<ModelList>;
|
|
91
93
|
declare const layer$14: <Self, ModelList extends AiModelListType = AiModels>(tag: Context.Service<Self, WorkersAiClient<ModelList>>, definition: WorkersAiDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
@@ -122,6 +124,7 @@ type AiGatewayProvider = NonNullable<Parameters<AiGatewayBinding["getUrl"]>[0]>;
|
|
|
122
124
|
type AiGatewayUniversalRequest = Exclude<AiGatewayRunData, ReadonlyArray<unknown>>;
|
|
123
125
|
type AiGatewayHeaders = NonNullable<AiGatewayUniversalRequest["headers"]>;
|
|
124
126
|
type AiGatewayRunOptions = Parameters<CloudflareAiGateway["run"]>[1];
|
|
127
|
+
type AiGatewayBindingCandidate = Parameters<typeof isWorkersAiBinding>[0];
|
|
125
128
|
interface AiGatewayFetchOptions {
|
|
126
129
|
readonly provider?: AiGatewayProvider;
|
|
127
130
|
readonly path?: string;
|
|
@@ -152,7 +155,7 @@ interface TagClass$11<Self, Id extends string> extends Context.ServiceClass<Self
|
|
|
152
155
|
readonly id: Id;
|
|
153
156
|
readonly layer: (options: LayerOptions$13) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError | AiGatewayOperationError, WorkerEnvironment>;
|
|
154
157
|
}
|
|
155
|
-
declare const isAiGatewayBinding: (value:
|
|
158
|
+
declare const isAiGatewayBinding: (value: AiGatewayBindingCandidate) => value is WorkersAiBinding;
|
|
156
159
|
declare const makeClient$10: (definition: AiGatewayDefinition, gateway: AiGatewayBinding) => {
|
|
157
160
|
definition: AiGatewayDefinition;
|
|
158
161
|
run: (data: import("@cloudflare/workers-types").AIGatewayUniversalRequest | readonly import("@cloudflare/workers-types").AIGatewayUniversalRequest[], options?: {
|
|
@@ -324,7 +327,7 @@ interface QueryTagClass<Self, Id extends string> extends Context.ServiceClass<Se
|
|
|
324
327
|
readonly layerFetchConfig: (config?: Config.Config<AnalyticsEngineQueryDefinition>) => Layer.Layer<Self, Config.ConfigError>;
|
|
325
328
|
}
|
|
326
329
|
declare const makeQueryClient: (definition: AnalyticsEngineQueryDefinition) => Effect.Effect<AnalyticsEngineQueryClient, never, HttpClient.HttpClient>;
|
|
327
|
-
declare const isAnalyticsEngineDataset: (value:
|
|
330
|
+
declare const isAnalyticsEngineDataset: <Candidate>(value: Candidate) => value is Candidate & AnalyticsEngineBinding;
|
|
328
331
|
declare const makeClient$9: (definition: AnalyticsEngineDefinition, defaults?: AnalyticsEngineWritePolicy) => (dataset: AnalyticsEngineBinding) => AnalyticsEngineClient;
|
|
329
332
|
declare const queryConfig: (options?: QueryConfigOptions) => Config.Config<{
|
|
330
333
|
accountId: string;
|
|
@@ -341,7 +344,7 @@ declare const makeQuery: <Id extends string>(id: Id) => QueryTagClass<AnalyticsE
|
|
|
341
344
|
declare const Tag$11: <Self>() => <Id extends string>(id: Id) => TagClass$10<Self, Id>;
|
|
342
345
|
declare const QueryTag: <Self>() => <Id extends string>(id: Id) => QueryTagClass<Self, Id>;
|
|
343
346
|
declare namespace BrowserRendering_d_exports {
|
|
344
|
-
export { BrowserRenderingBinding, BrowserRenderingBrowserClient, BrowserRenderingBrowserLike, BrowserRenderingClient, BrowserRenderingConnect, BrowserRenderingDefinition, BrowserRenderingLaunch, BrowserRenderingOperationError, BrowserRenderingPageClient, BrowserRenderingPageLike, BrowserRenderingService, LayerOptions$11 as LayerOptions, Tag$10 as Tag, TagClass$9 as TagClass, isBrowserRenderingBinding, layer$11 as layer, make$10 as make, makeClient$8 as makeClient };
|
|
347
|
+
export { BrowserRenderingBinding, BrowserRenderingBrowserClient, BrowserRenderingBrowserLike, BrowserRenderingClient, BrowserRenderingConnect, BrowserRenderingDefinition, BrowserRenderingExternalResult, BrowserRenderingLaunch, BrowserRenderingMethodOptions, BrowserRenderingOperationError, BrowserRenderingPageClient, BrowserRenderingPageFunction, BrowserRenderingPageLike, BrowserRenderingService, LayerOptions$11 as LayerOptions, Tag$10 as Tag, TagClass$9 as TagClass, isBrowserRenderingBinding, layer$11 as layer, make$10 as make, makeClient$8 as makeClient };
|
|
345
348
|
}
|
|
346
349
|
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 & {
|
|
347
350
|
readonly _tag: "BrowserRenderingOperationError";
|
|
@@ -360,6 +363,9 @@ interface BrowserRenderingDefinition {
|
|
|
360
363
|
readonly binding: string;
|
|
361
364
|
}
|
|
362
365
|
type BrowserRenderingBinding = object;
|
|
366
|
+
interface BrowserRenderingMethodOptions {}
|
|
367
|
+
type BrowserRenderingExternalResult = Awaited<ReturnType<Response["json"]>>;
|
|
368
|
+
type BrowserRenderingPageFunction = string | Function;
|
|
363
369
|
type BrowserRenderingLaunch<RawBinding, Browser, LaunchOptions = unknown> = (binding: RawBinding, options?: LaunchOptions) => Promise<Browser>;
|
|
364
370
|
type BrowserRenderingConnect<RawBinding, Browser, ConnectOptions = unknown> = (binding: RawBinding, options?: ConnectOptions) => Promise<Browser>;
|
|
365
371
|
interface BrowserRenderingBrowserLike<Page = BrowserRenderingPageLike> {
|
|
@@ -369,22 +375,22 @@ interface BrowserRenderingBrowserLike<Page = BrowserRenderingPageLike> {
|
|
|
369
375
|
readonly version?: () => Promise<string>;
|
|
370
376
|
}
|
|
371
377
|
interface BrowserRenderingPageLike {
|
|
372
|
-
readonly goto?: (url: string, options?:
|
|
373
|
-
readonly setContent?: (html: string, options?:
|
|
378
|
+
readonly goto?: (url: string, options?: BrowserRenderingMethodOptions) => Promise<BrowserRenderingExternalResult>;
|
|
379
|
+
readonly setContent?: (html: string, options?: BrowserRenderingMethodOptions) => Promise<void>;
|
|
374
380
|
readonly content?: () => Promise<string>;
|
|
375
|
-
readonly screenshot?: (options?:
|
|
376
|
-
readonly pdf?: (options?:
|
|
377
|
-
readonly evaluate?: (pageFunction:
|
|
378
|
-
readonly close?: (options?:
|
|
381
|
+
readonly screenshot?: (options?: BrowserRenderingMethodOptions) => Promise<Uint8Array | string>;
|
|
382
|
+
readonly pdf?: (options?: BrowserRenderingMethodOptions) => Promise<Uint8Array>;
|
|
383
|
+
readonly evaluate?: (pageFunction: BrowserRenderingPageFunction, ...args: ReadonlyArray<unknown>) => Promise<BrowserRenderingExternalResult>;
|
|
384
|
+
readonly close?: (options?: BrowserRenderingMethodOptions) => Promise<void>;
|
|
379
385
|
}
|
|
380
386
|
interface BrowserRenderingPageClient<Page extends BrowserRenderingPageLike> {
|
|
381
387
|
readonly raw: Page;
|
|
382
388
|
readonly goto: (url: string, options?: Parameters<NonNullable<Page["goto"]>>[1]) => Effect.Effect<Awaited<ReturnType<NonNullable<Page["goto"]>>>, BrowserRenderingOperationError>;
|
|
383
389
|
readonly setContent: (html: string, options?: Parameters<NonNullable<Page["setContent"]>>[1]) => Effect.Effect<void, BrowserRenderingOperationError>;
|
|
384
390
|
readonly content: Effect.Effect<string, BrowserRenderingOperationError>;
|
|
385
|
-
readonly screenshot:
|
|
386
|
-
readonly pdf:
|
|
387
|
-
readonly evaluate:
|
|
391
|
+
readonly screenshot: (options?: Parameters<NonNullable<Page["screenshot"]>>[0]) => Effect.Effect<Awaited<ReturnType<NonNullable<Page["screenshot"]>>>, BrowserRenderingOperationError>;
|
|
392
|
+
readonly pdf: (options?: Parameters<NonNullable<Page["pdf"]>>[0]) => Effect.Effect<Awaited<ReturnType<NonNullable<Page["pdf"]>>>, BrowserRenderingOperationError>;
|
|
393
|
+
readonly evaluate: (pageFunction: Parameters<NonNullable<Page["evaluate"]>>[0], ...args: ReadonlyArray<unknown>) => Effect.Effect<Awaited<ReturnType<NonNullable<Page["evaluate"]>>>, BrowserRenderingOperationError>;
|
|
388
394
|
readonly close: (options?: Parameters<NonNullable<Page["close"]>>[0]) => Effect.Effect<void, BrowserRenderingOperationError>;
|
|
389
395
|
}
|
|
390
396
|
interface BrowserRenderingBrowserClient<Browser extends BrowserRenderingBrowserLike<Page>, Page extends BrowserRenderingPageLike> {
|
|
@@ -414,7 +420,7 @@ interface TagClass$9<Self, Id extends string> extends Context.ServiceClass<Self,
|
|
|
414
420
|
readonly id: Id;
|
|
415
421
|
readonly layer: (options: LayerOptions$11) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
416
422
|
}
|
|
417
|
-
declare const isBrowserRenderingBinding: (value:
|
|
423
|
+
declare const isBrowserRenderingBinding: <Candidate>(value: Candidate) => value is Candidate & BrowserRenderingBinding;
|
|
418
424
|
declare const makeClient$8: <RawBinding extends BrowserRenderingBinding = BrowserRenderingBinding>(definition: BrowserRenderingDefinition) => (binding: RawBinding) => BrowserRenderingClient<RawBinding>;
|
|
419
425
|
declare const layer$11: <Self>(tag: Context.Service<Self, BrowserRenderingClient>, definition: BrowserRenderingDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
420
426
|
declare const make$10: <Id extends string>(id: Id) => TagClass$9<BrowserRenderingService<Id>, Id>;
|
|
@@ -475,6 +481,7 @@ declare const layer$10: Layer.Layer<CacheStorage>;
|
|
|
475
481
|
declare namespace CloudflareOtlp_d_exports {
|
|
476
482
|
export { DurableObjectLayerOptions, LayerOptions$10 as LayerOptions, ResourceOptions, Serialization, Signal, WorkerLayerOptions, layer$9 as layer, layerDurableObject, layerJson, layerProtobuf, layerWorker };
|
|
477
483
|
}
|
|
484
|
+
type ResourceAttributes = NonNullable<Parameters<typeof OtlpResource.make>[0]["attributes"]>;
|
|
478
485
|
/** Telemetry signal groups supported by the Cloudflare OTLP layers. */
|
|
479
486
|
type Signal = "logs" | "traces" | "metrics";
|
|
480
487
|
/** OTLP payload serialization used by the Effect OTLP exporters. */
|
|
@@ -494,7 +501,7 @@ interface ResourceOptions {
|
|
|
494
501
|
/** Explicit service version. Takes precedence over OTEL environment variables. */
|
|
495
502
|
readonly serviceVersion?: string;
|
|
496
503
|
/** Additional resource attributes attached to exported telemetry. */
|
|
497
|
-
readonly attributes?:
|
|
504
|
+
readonly attributes?: ResourceAttributes;
|
|
498
505
|
}
|
|
499
506
|
/** Options shared by all Cloudflare OTLP telemetry layers. */
|
|
500
507
|
interface LayerOptions$10 {
|
|
@@ -707,7 +714,7 @@ interface TagClass$8<Self, Id extends string, Namespace extends ContainerNamespa
|
|
|
707
714
|
readonly id: Id;
|
|
708
715
|
readonly layer: (options: LayerOptions$9) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
709
716
|
}
|
|
710
|
-
declare const isContainerNamespaceResource: (value:
|
|
717
|
+
declare const isContainerNamespaceResource: <Candidate>(value: Candidate) => value is Candidate & ContainerNamespaceResource;
|
|
711
718
|
declare const makeClient$6: (definition: ContainerNamespaceDefinition) => <Namespace extends ContainerNamespaceResource>(namespace: Namespace) => ContainerNamespaceClient<Namespace>;
|
|
712
719
|
declare const layer$8: <Self, Namespace extends ContainerNamespaceResource>(tag: Context.Service<Self, ContainerNamespaceClient<Namespace>>, definition: ContainerNamespaceDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
713
720
|
declare const make$9: <Id extends string>(id: Id) => TagClass$8<ContainerNamespaceService<Id>, Id, ContainerNamespaceResource>;
|
|
@@ -774,8 +781,9 @@ declare namespace DurableObjectNamespace_d_exports {
|
|
|
774
781
|
interface DurableObjectFetcher {
|
|
775
782
|
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
776
783
|
}
|
|
777
|
-
type RpcClient<Api> = { readonly [Key in keyof Api as Key extends string ? Api[Key] extends ((...args: Array<any>) =>
|
|
784
|
+
type RpcClient<Api> = { readonly [Key in keyof Api as Key extends string ? Api[Key] extends ((...args: Array<any>) => any) ? Key : never : never]: Api[Key]; };
|
|
778
785
|
type ReservedMethodName$1 = ReservedMethodName | "fetch";
|
|
786
|
+
type NamespaceCandidate = Parameters<typeof Predicate.isUnknown>[0];
|
|
779
787
|
/**
|
|
780
788
|
* Cloudflare Durable Object stub, optionally enriched with RPC methods.
|
|
781
789
|
*/
|
|
@@ -976,7 +984,7 @@ type DurableObjectNamespaceStaticClient<R, Api extends object, Definition extend
|
|
|
976
984
|
readonly scopedCall: <Method extends StubMethodKey<Api>>(stub: DurableObjectStubClient<Api>, method: Method, ...args: StubMethodArgs<Api, Method>) => Effect.Effect<Awaited<StubMethodSuccess<Api, Method>>, unknown, Scope.Scope | R>;
|
|
977
985
|
readonly rawUnsafe: () => Effect.Effect<DurableObjectNamespaceClient<Api>, never, R>;
|
|
978
986
|
};
|
|
979
|
-
declare const isDurableObjectNamespaceClient: <Api extends object>(value:
|
|
987
|
+
declare const isDurableObjectNamespaceClient: <Api extends object>(value: NamespaceCandidate) => value is DurableObjectNamespaceClient<Api>;
|
|
980
988
|
declare const makeClient$5: <Api extends object, const Definition extends Definition$3.Any | undefined = undefined>(definition: DurableObjectNamespaceBindingDefinition<Definition>) => ((namespace: DurableObjectNamespaceClient<Api>) => DurableObjectNamespaceEffectClient<Api, Definition>);
|
|
981
989
|
declare const layer$7: <Self, Api extends object, const Definition extends Definition$3.Any | undefined = undefined>(tag: Context.Service<Self, DurableObjectNamespaceEffectClient<Api, Definition>>, definition: DurableObjectNamespaceBindingDefinition<Definition>) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
982
990
|
declare const makeDirectMethods: <R, Api extends object, Definition extends Definition$3.Any | undefined>(rpcDefinition: Definition | undefined, helpers: {
|
|
@@ -1001,22 +1009,22 @@ declare namespace Method$1 {
|
|
|
1001
1009
|
export type Args<Self extends Any> = ArgsFromSchemas<Self["args"]>;
|
|
1002
1010
|
export type EncodedArgs<Self extends Any> = EncodedArgsFromSchemas<Self["args"]>;
|
|
1003
1011
|
export type Success<Self extends Any> = Schema.Schema.Type<Self["success"]>;
|
|
1004
|
-
export type EncodedSuccess<
|
|
1012
|
+
export type EncodedSuccess<_Self extends Any> = Schema.Json;
|
|
1005
1013
|
export {};
|
|
1006
1014
|
}
|
|
1007
1015
|
type Methods = Record<string, Method$1.Any>;
|
|
1008
1016
|
/**
|
|
1009
1017
|
* RPC contract for a Durable Object class.
|
|
1010
1018
|
*/
|
|
1011
|
-
interface Definition$3<Id extends string = string,
|
|
1019
|
+
interface Definition$3<Id extends string = string, MethodDefinitions extends Methods = Methods> {
|
|
1012
1020
|
readonly id: Id;
|
|
1013
|
-
readonly methods:
|
|
1021
|
+
readonly methods: MethodDefinitions;
|
|
1014
1022
|
}
|
|
1015
1023
|
declare namespace Definition$3 {
|
|
1016
1024
|
type Any = Definition$3<string, Methods>;
|
|
1017
1025
|
}
|
|
1018
1026
|
type ReservedMethodName = ReservedMethodName$2 | "fetch" | "alarm" | "webSocketMessage" | "webSocketClose" | "webSocketError";
|
|
1019
|
-
type NoReservedMethods<
|
|
1027
|
+
type NoReservedMethods<MethodDefinitions extends Methods> = Extract<keyof MethodDefinitions, ReservedMethodName> extends never ? MethodDefinitions : never;
|
|
1020
1028
|
/**
|
|
1021
1029
|
* Promise-based client API derived from a Durable Object definition.
|
|
1022
1030
|
*/
|
|
@@ -1035,26 +1043,24 @@ interface Options$2<ROut, Self extends Definition$3.Any, REvent = never, EventLa
|
|
|
1035
1043
|
type LayerOptions$8 = {
|
|
1036
1044
|
readonly binding: string;
|
|
1037
1045
|
};
|
|
1038
|
-
type TagClass$7<Self, Id extends string,
|
|
1046
|
+
type TagClass$7<Self, Id extends string, MethodDefinitions extends Methods> = Context.ServiceClass<Self, `effect-cf/DurableObject/${Id}`, DurableObjectNamespaceEffectClient<Api<Definition$3<Id, MethodDefinitions>>, Definition$3<Id, MethodDefinitions>>> & DurableObjectNamespaceStaticClient<Self, Api<Definition$3<Id, MethodDefinitions>>, Definition$3<Id, MethodDefinitions>> & {
|
|
1039
1047
|
readonly id: Id;
|
|
1040
|
-
readonly methods:
|
|
1041
|
-
readonly make: <ROut, LayerError, REvent = never, EventLayerError = never>(layer: Layer.Layer<ROut, LayerError, DurableObjectState | WorkerEnvironment>, options: Options$2<ROut, Definition$3<Id,
|
|
1048
|
+
readonly methods: MethodDefinitions;
|
|
1049
|
+
readonly make: <ROut, LayerError, REvent = never, EventLayerError = never>(layer: Layer.Layer<ROut, LayerError, DurableObjectState | WorkerEnvironment>, options: Options$2<ROut, Definition$3<Id, MethodDefinitions>, REvent, EventLayerError>) => DurableObjectClass<Handlers<ROut | REvent, Definition$3<Id, MethodDefinitions>>, ROut | REvent>;
|
|
1042
1050
|
readonly layer: (options: LayerOptions$8) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1043
1051
|
};
|
|
1044
1052
|
/**
|
|
1045
1053
|
* Defines a single RPC method schema in a Durable Object definition.
|
|
1046
1054
|
*/
|
|
1047
|
-
declare
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
declare const make$7: <Id extends string, const MethodsShape extends Methods>(id: Id, methods: MethodsShape & NoReservedMethods<MethodsShape>) => TagClass$7<Definition$3<Id, MethodsShape>, Id, MethodsShape>;
|
|
1057
|
-
declare const Tag$8: <Self>() => <Id extends string, const MethodsShape extends Methods>(id: Id, methods: MethodsShape & NoReservedMethods<MethodsShape>) => TagClass$7<Self, Id, MethodsShape>;
|
|
1055
|
+
declare function method<Success extends ServiceFreeSchema>(definition: {
|
|
1056
|
+
readonly success: Success;
|
|
1057
|
+
}): Method$1<readonly [], Success>;
|
|
1058
|
+
declare function method<const Args extends ReadonlyArray<ServiceFreeSchema>, Success extends ServiceFreeSchema>(definition: {
|
|
1059
|
+
readonly args: Args;
|
|
1060
|
+
readonly success: Success;
|
|
1061
|
+
}): Method$1<Args, Success>;
|
|
1062
|
+
declare const make$7: <Id extends string, const MethodDefinitions extends Methods>(id: Id, methods: MethodDefinitions & NoReservedMethods<MethodDefinitions>) => TagClass$7<Definition$3<Id, MethodDefinitions>, Id, MethodDefinitions>;
|
|
1063
|
+
declare const Tag$8: <Self>() => <Id extends string, const MethodDefinitions extends Methods>(id: Id, methods: MethodDefinitions & NoReservedMethods<MethodDefinitions>) => TagClass$7<Self, Id, MethodDefinitions>;
|
|
1058
1064
|
declare const DurableObject$1: typeof Tag$8;
|
|
1059
1065
|
/**
|
|
1060
1066
|
* Helper for implementing handlers with the exact method shape of a definition.
|
|
@@ -1065,7 +1071,7 @@ declare const implement$2: <ROut, const Self extends Definition$3.Any>(_definiti
|
|
|
1065
1071
|
*/
|
|
1066
1072
|
type HandlerEffect<ROut, Self extends Definition$3.Any, Key extends keyof Self["methods"]> = DurableObjectHandler<ROut, Method$1.Success<Self["methods"][Key]>>;
|
|
1067
1073
|
declare namespace DurableObject_d_exports {
|
|
1068
|
-
export { Api, Definition$3 as Definition, DurableObjectClass, DurableObjectHandler, DurableObjectOptions, DurableObjectRpc, DurableObjectRpcShape, HandlerEffect, Handlers, LayerOptions$8 as LayerOptions, Method$1 as Method, Methods, NoReservedMethods, Options$2 as Options, ReservedMethodName, RpcHandlers, ServerApi, ServiceFreeSchema, Tag$8 as Tag, TagClass$7 as TagClass, implement$2 as implement, make$6 as make, method };
|
|
1074
|
+
export { Api, Definition$3 as Definition, DurableObjectClass, DurableObjectHandler, DurableObjectOptions, DurableObjectRpc, DurableObjectRpcApi, DurableObjectRpcApi as DurableObjectRpcShape, HandlerEffect, Handlers, LayerOptions$8 as LayerOptions, Method$1 as Method, Methods, NoReservedMethods, Options$2 as Options, ReservedMethodName, RpcHandlers, ServerApi, ServiceFreeSchema, Tag$8 as Tag, TagClass$7 as TagClass, implement$2 as implement, make$6 as make, method };
|
|
1069
1075
|
}
|
|
1070
1076
|
type RuntimeContext$1<ROut> = DurableObjectState | WorkerEnvironment | ROut;
|
|
1071
1077
|
type HandlerContext<ROut> = RuntimeContext$1<ROut> | Scope.Scope;
|
|
@@ -1078,8 +1084,8 @@ type DurableObjectHandler<ROut, A = unknown> = Effect.Effect<A, unknown, Handler
|
|
|
1078
1084
|
* Shape of Durable Object RPC handlers passed to {@link make}.
|
|
1079
1085
|
*/
|
|
1080
1086
|
type DurableObjectRpc<ROut> = Record<string, (...args: Array<any>) => DurableObjectHandler<ROut>>;
|
|
1081
|
-
type
|
|
1082
|
-
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<
|
|
1087
|
+
type DurableObjectRpcApi<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; };
|
|
1088
|
+
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<any>) ? Key : never : never]: Api[Key] extends ((...args: infer Args) => Promise<infer A>) ? (...args: Args) => DurableObjectHandler<ROut, A> : never; };
|
|
1083
1089
|
/**
|
|
1084
1090
|
* Options for creating a Durable Object class backed by Effect handlers.
|
|
1085
1091
|
*/
|
|
@@ -1105,7 +1111,9 @@ interface DurableObjectOptions<RRuntime, REvent = never, EventLayerError = never
|
|
|
1105
1111
|
* Optional RPC methods exposed as Durable Object instance methods.
|
|
1106
1112
|
*
|
|
1107
1113
|
* After every invocation, the configured OTLP flusher is scheduled through
|
|
1108
|
-
* `DurableObjectState.waitUntil`, including when the handler fails.
|
|
1114
|
+
* `DurableObjectState.waitUntil`, including when the handler fails. The
|
|
1115
|
+
* scheduled flush silently settles within two seconds even if the exporter
|
|
1116
|
+
* does not.
|
|
1109
1117
|
*/
|
|
1110
1118
|
readonly rpc?: Rpc;
|
|
1111
1119
|
/** Optional fetch handler for HTTP/WebSocket requests. */
|
|
@@ -1122,17 +1130,19 @@ interface DurableObjectOptions<RRuntime, REvent = never, EventLayerError = never
|
|
|
1122
1130
|
* Optional raw alarm handler.
|
|
1123
1131
|
*
|
|
1124
1132
|
* After every invocation, the configured OTLP flusher is scheduled through
|
|
1125
|
-
* `DurableObjectState.waitUntil`, including when the handler fails.
|
|
1133
|
+
* `DurableObjectState.waitUntil`, including when the handler fails. The
|
|
1134
|
+
* scheduled flush silently settles within two seconds even if the exporter
|
|
1135
|
+
* does not.
|
|
1126
1136
|
*/
|
|
1127
1137
|
readonly alarm?: (alarmInfo?: globalThis.AlarmInvocationInfo) => Effect.Effect<void, unknown, HandlerContext<RRuntime | REvent>>;
|
|
1128
1138
|
readonly webSocketMessage?: (socket: DurableWebSocket, message: string | ArrayBuffer) => Effect.Effect<void, unknown, HandlerContext<RRuntime | REvent>>;
|
|
1129
1139
|
readonly webSocketClose?: (socket: DurableWebSocket, code: number, reason: string, wasClean: boolean) => Effect.Effect<void, unknown, HandlerContext<RRuntime | REvent>>;
|
|
1130
|
-
readonly webSocketError?: (socket: DurableWebSocket,
|
|
1140
|
+
readonly webSocketError?: (socket: DurableWebSocket, cause: unknown) => Effect.Effect<void, unknown, HandlerContext<RRuntime | REvent>>;
|
|
1131
1141
|
}
|
|
1132
1142
|
/**
|
|
1133
1143
|
* Cloudflare `DurableObject` constructor produced by {@link make}.
|
|
1134
1144
|
*/
|
|
1135
|
-
type DurableObjectClass<Rpc extends DurableObjectRpc<ROut>, ROut> = new (state: globalThis.DurableObjectState, env: WorkerEnv) => DurableObject<WorkerEnv> &
|
|
1145
|
+
type DurableObjectClass<Rpc extends DurableObjectRpc<ROut>, ROut> = new (state: globalThis.DurableObjectState, env: WorkerEnv) => DurableObject<WorkerEnv> & DurableObjectRpcApi<Rpc, ROut>;
|
|
1136
1146
|
/**
|
|
1137
1147
|
* Creates a Durable Object class backed by a single managed Effect runtime.
|
|
1138
1148
|
*/
|
|
@@ -1491,7 +1501,7 @@ interface DurableObjectRpcWebSocketService {
|
|
|
1491
1501
|
readonly accept: (socket: DurableWebSocket) => Effect.Effect<void>;
|
|
1492
1502
|
readonly message: (socket: DurableWebSocket, message: NativeWebSocketMessage) => Effect.Effect<void>;
|
|
1493
1503
|
readonly close: (socket: DurableWebSocket) => Effect.Effect<void>;
|
|
1494
|
-
readonly error: (socket: DurableWebSocket,
|
|
1504
|
+
readonly error: (socket: DurableWebSocket, cause: unknown) => Effect.Effect<void>;
|
|
1495
1505
|
}
|
|
1496
1506
|
declare const DurableObjectRpcWebSocket_base: Context.ServiceClass<DurableObjectRpcWebSocket, "effect-cf/DurableObjectRpcWebSocket", DurableObjectRpcWebSocketService>;
|
|
1497
1507
|
/**
|
|
@@ -1625,7 +1635,7 @@ interface TagClass$6<Self, Id extends string> extends Context.ServiceClass<Self,
|
|
|
1625
1635
|
* because the encoded MIME size is only known once Cloudflare composes it.
|
|
1626
1636
|
*/
|
|
1627
1637
|
declare const validateMessage: (message: EmailMessageBuilder) => ReadonlyArray<EmailViolation>;
|
|
1628
|
-
declare const isEmailBinding: (value:
|
|
1638
|
+
declare const isEmailBinding: <Candidate>(value: Candidate) => value is Candidate & EmailBinding;
|
|
1629
1639
|
declare const makeClient$4: (definition: EmailDefinition, options?: EmailSendOptions) => (email: EmailBinding) => EmailClient;
|
|
1630
1640
|
declare const layer$4: <Self>(tag: Context.Service<Self, EmailClient>, definition: LayerOptions$6) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1631
1641
|
declare const make$5: <Id extends string>(id: Id) => TagClass$6<EmailService<Id>, Id>;
|
|
@@ -1799,7 +1809,7 @@ declare const draw: {
|
|
|
1799
1809
|
(draw: DrawStepOptions): (steps: Steps) => Steps;
|
|
1800
1810
|
(steps: Steps, draw: DrawStepOptions): Steps;
|
|
1801
1811
|
};
|
|
1802
|
-
declare const isImagesBinding: (value:
|
|
1812
|
+
declare const isImagesBinding: <Candidate>(value: Candidate) => value is Candidate & ImagesRuntimeBinding;
|
|
1803
1813
|
declare const makeClient$3: (definition: ImagesDefinition) => (images: ImagesRuntimeBinding) => ImagesClient;
|
|
1804
1814
|
declare const layer$3: <Self>(tag: Context.Service<Self, ImagesClient>, definition: ImagesDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1805
1815
|
declare const make$4: <Id extends string>(id: Id) => TagClass$5<ImagesService<Id>, Id>;
|
|
@@ -1887,7 +1897,7 @@ interface TagClass$4<Self, Id extends string, Key, Value, EncodedValue> extends
|
|
|
1887
1897
|
readonly valueSchema: Schema.Codec<Value, EncodedValue>;
|
|
1888
1898
|
readonly layer: (options: LayerOptions$4) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1889
1899
|
}
|
|
1890
|
-
declare const isKvNamespace: (value:
|
|
1900
|
+
declare const isKvNamespace: <Candidate>(value: Candidate) => value is Candidate & KVNamespace;
|
|
1891
1901
|
declare const makeClient$2: <Key, Value, EncodedValue>(definition: KvDefinition<Key, Value, EncodedValue>) => ((kv: KVNamespace) => KvClient<Key, Value, EncodedValue>);
|
|
1892
1902
|
declare const layer$2: <Self, Key, Value, EncodedValue>(tag: Context.Service<Self, KvClient<Key, Value, EncodedValue>>, definition: KvDefinition<Key, Value, EncodedValue>) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1893
1903
|
declare const Tag$5: <Self>() => <Id extends string, Key, Value, EncodedValue>(id: Id, definition: {
|
|
@@ -1973,7 +1983,8 @@ interface TagClass$3<Self, Id extends string> extends Context.ServiceClass<Self,
|
|
|
1973
1983
|
readonly id: Id;
|
|
1974
1984
|
readonly layer: (options: LayerOptions$3) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1975
1985
|
}
|
|
1976
|
-
|
|
1986
|
+
type R2BindingValue = Schema.Schema.Type<typeof Schema.Unknown>;
|
|
1987
|
+
declare const isR2Bucket: (value: R2BindingValue) => value is CloudflareR2Bucket;
|
|
1977
1988
|
declare const makeClient$1: (definition: R2Definition) => ((bucket: CloudflareR2Bucket) => R2Client);
|
|
1978
1989
|
declare const layer$1: <Self>(tag: Context.Service<Self, R2Client>, definition: R2Definition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1979
1990
|
declare const make$3: <Id extends string>(id: Id) => TagClass$3<R2Service<Id>, Id>;
|
|
@@ -2037,7 +2048,8 @@ interface TagClass$2<Self, Id extends string> extends Context.ServiceClass<Self,
|
|
|
2037
2048
|
readonly id: Id;
|
|
2038
2049
|
readonly layer: (options: LayerOptions$2) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2039
2050
|
}
|
|
2040
|
-
|
|
2051
|
+
type VectorizeBindingValue = Schema.Schema.Type<typeof Schema.Unknown>;
|
|
2052
|
+
declare const isVectorizeBinding: (value: VectorizeBindingValue) => value is VectorizeBinding;
|
|
2041
2053
|
declare const makeClient: (definition: VectorizeDefinition) => (index: VectorizeBinding) => VectorizeClient;
|
|
2042
2054
|
declare const layer: <Self>(tag: Context.Service<Self, VectorizeClient>, definition: VectorizeDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2043
2055
|
declare const make$2: <Id extends string>(id: Id) => TagClass$2<VectorizeService<Id>, Id>;
|
|
@@ -2158,7 +2170,7 @@ declare const Tag$2: <Self>() => <Id extends string, Payload extends ServiceFree
|
|
|
2158
2170
|
declare const Workflow: typeof Tag$2;
|
|
2159
2171
|
declare const implement$1: <ROut, const Self extends Definition$1.Any>(_definition: Self, handler: Handler$1<ROut, Self>) => Handler$1<ROut, Self>;
|
|
2160
2172
|
declare namespace Workflow_d_exports {
|
|
2161
|
-
export { Definition, Handler, LayerOptions, Options, Tag$1 as Tag, TagClass, WorkflowClass, WorkflowEvent$1 as WorkflowEvent, WorkflowEventService, WorkflowHandler, WorkflowOptions, WorkflowRunContext, WorkflowStep$1 as WorkflowStep, WorkflowStepContext$1 as WorkflowStepContext, WorkflowStepError, WorkflowStepService, implement, make, sleep, sleepUntil, step, waitForEvent };
|
|
2173
|
+
export { Definition, Handler, LayerOptions, Options, Tag$1 as Tag, TagClass, WorkflowClass, WorkflowEvent$1 as WorkflowEvent, WorkflowEventService, WorkflowHandler, WorkflowOptions, WorkflowRunContext, WorkflowStep$1 as WorkflowStep, WorkflowStepContext$1 as WorkflowStepContext, WorkflowStepError, WorkflowStepNonRetryableError, WorkflowStepService, implement, make, sleep, sleepUntil, step, waitForEvent };
|
|
2162
2174
|
}
|
|
2163
2175
|
interface WorkflowEventService<Payload = unknown> {
|
|
2164
2176
|
readonly raw: WorkflowEvent<unknown>;
|
|
@@ -2169,7 +2181,7 @@ interface WorkflowEventService<Payload = unknown> {
|
|
|
2169
2181
|
}
|
|
2170
2182
|
declare const WorkflowEvent_base: Context.ServiceClass<WorkflowEvent$1, "effect-cf/WorkflowEvent", WorkflowEventService<unknown>>;
|
|
2171
2183
|
declare class WorkflowEvent$1 extends WorkflowEvent_base {}
|
|
2172
|
-
declare const WorkflowStepError_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]; }>) =>
|
|
2184
|
+
declare const WorkflowStepError_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]; }>) => Cause.YieldableError & {
|
|
2173
2185
|
readonly _tag: "WorkflowStepError";
|
|
2174
2186
|
} & Readonly<A>;
|
|
2175
2187
|
/** Failure raised when a Cloudflare Workflow step operation rejects. */
|
|
@@ -2180,6 +2192,20 @@ declare class WorkflowStepError extends WorkflowStepError_base<{
|
|
|
2180
2192
|
}> {
|
|
2181
2193
|
get message(): string;
|
|
2182
2194
|
}
|
|
2195
|
+
declare const WorkflowStepNonRetryableError_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]; }>) => Cause.YieldableError & {
|
|
2196
|
+
readonly _tag: "WorkflowStepNonRetryableError";
|
|
2197
|
+
} & Readonly<A>;
|
|
2198
|
+
/**
|
|
2199
|
+
* Typed step failure that Cloudflare must treat as terminal instead of retrying.
|
|
2200
|
+
*
|
|
2201
|
+
* The workflow boundary converts this value into Cloudflare's native
|
|
2202
|
+
* `NonRetryableError` while preserving the original cause and its message.
|
|
2203
|
+
*/
|
|
2204
|
+
declare class WorkflowStepNonRetryableError extends WorkflowStepNonRetryableError_base<{
|
|
2205
|
+
readonly cause: unknown;
|
|
2206
|
+
}> {
|
|
2207
|
+
get message(): string;
|
|
2208
|
+
}
|
|
2183
2209
|
interface WorkflowStepService {
|
|
2184
2210
|
readonly raw: WorkflowStep;
|
|
2185
2211
|
do<A, E, R>(name: string, effect: Effect.Effect<A, E, R>, config?: WorkflowStepConfig): Effect.Effect<A, WorkflowStepError, Exclude<R, WorkflowStepContext$1>>;
|