effect-cf 0.46.0 → 0.46.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/dist/R2.d.mts CHANGED
@@ -4,10 +4,9 @@ import * as Context$1 from "effect/Context";
4
4
  import * as Effect from "effect/Effect";
5
5
  import * as Schema$1 from "effect/Schema";
6
6
  import * as Option from "effect/Option";
7
- import { R2Bucket, R2Conditional, R2GetOptions, R2ListOptions, R2MultipartOptions, R2MultipartUpload, R2Object, R2ObjectBody, R2Objects, R2PutOptions, R2UploadPartOptions, R2UploadedPart } from "@cloudflare/workers-types";
8
7
  import { Layer } from "effect";
9
8
  declare namespace R2_d_exports {
10
- export { BindingNotFoundError, BindingValidationError, LayerOptions, R2Client, R2Definition, R2GetOptions$1 as R2GetOptions, R2ListOptions$1 as R2ListOptions, R2MultipartOptions$1 as R2MultipartOptions, R2MultipartUploadClient, R2ObjectBodyClient, R2Operation, R2OperationError, R2PutOptions$1 as R2PutOptions, R2PutValue, R2Service, R2UploadPartOptions$1 as R2UploadPartOptions, R2UploadPartValue, Tag, TagClass, isR2Bucket, layer, make, makeClient };
9
+ export { BindingNotFoundError, BindingValidationError, LayerOptions, R2Client, R2Definition, R2GetOptions, R2ListOptions, R2MultipartOptions, R2MultipartUploadClient, R2ObjectBodyClient, R2Operation, R2OperationError, R2PutOptions, R2PutValue, R2Service, R2UploadPartOptions, R2UploadPartValue, Tag, TagClass, isR2Bucket, layer, make, makeClient };
11
10
  }
12
11
  type R2Operation = "head" | "get" | "put" | "delete" | "list" | "createMultipartUpload" | "resumeMultipartUpload" | "uploadPart" | "abortMultipartUpload" | "completeMultipartUpload" | "arrayBuffer" | "bytes" | "text" | "json" | "blob";
13
12
  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 & {
@@ -23,11 +22,11 @@ declare class R2OperationError extends R2OperationError_base<{
23
22
  interface R2Definition {
24
23
  readonly binding: string;
25
24
  }
26
- type R2GetOptions$1 = R2GetOptions;
27
- type R2PutOptions$1 = R2PutOptions;
28
- type R2ListOptions$1 = R2ListOptions;
29
- type R2MultipartOptions$1 = R2MultipartOptions;
30
- type R2UploadPartOptions$1 = R2UploadPartOptions;
25
+ type R2GetOptions = globalThis.R2GetOptions;
26
+ type R2ListOptions = globalThis.R2ListOptions;
27
+ type R2MultipartOptions = globalThis.R2MultipartOptions;
28
+ type R2PutOptions = globalThis.R2PutOptions;
29
+ type R2UploadPartOptions = globalThis.R2UploadPartOptions;
31
30
  type R2PutValue = ReadableStream | ArrayBuffer | ArrayBufferView | string | null | Blob;
32
31
  type R2UploadPartValue = ReadableStream | ArrayBuffer | ArrayBufferView | string | Blob;
33
32
  interface R2ObjectBodyClient extends Omit<R2ObjectBody, "arrayBuffer" | "blob" | "bytes" | "json" | "text"> {
@@ -42,28 +41,28 @@ interface R2MultipartUploadClient {
42
41
  readonly raw: R2MultipartUpload;
43
42
  readonly key: string;
44
43
  readonly uploadId: string;
45
- readonly uploadPart: (partNumber: number, value: R2UploadPartValue, options?: R2UploadPartOptions$1) => Effect.Effect<R2UploadedPart, R2OperationError>;
44
+ readonly uploadPart: (partNumber: number, value: R2UploadPartValue, options?: R2UploadPartOptions) => Effect.Effect<R2UploadedPart, R2OperationError>;
46
45
  readonly abort: Effect.Effect<void, R2OperationError>;
47
46
  readonly complete: (uploadedParts: ReadonlyArray<R2UploadedPart>) => Effect.Effect<R2Object, R2OperationError>;
48
47
  }
49
48
  interface R2Client {
50
49
  readonly head: (key: string) => Effect.Effect<Option.Option<R2Object>, R2OperationError>;
51
50
  readonly get: {
52
- (key: string, options: R2GetOptions$1 & {
51
+ (key: string, options: R2GetOptions & {
53
52
  readonly onlyIf: R2Conditional | Headers;
54
53
  }): Effect.Effect<Option.Option<R2ObjectBodyClient | R2Object>, R2OperationError>;
55
- (key: string, options?: R2GetOptions$1): Effect.Effect<Option.Option<R2ObjectBodyClient>, R2OperationError>;
54
+ (key: string, options?: R2GetOptions): Effect.Effect<Option.Option<R2ObjectBodyClient>, R2OperationError>;
56
55
  };
57
56
  readonly put: {
58
- (key: string, value: R2PutValue, options: R2PutOptions$1 & {
57
+ (key: string, value: R2PutValue, options: R2PutOptions & {
59
58
  readonly onlyIf: R2Conditional | Headers;
60
59
  }): Effect.Effect<Option.Option<R2Object>, R2OperationError>;
61
- (key: string, value: R2PutValue, options?: R2PutOptions$1): Effect.Effect<R2Object, R2OperationError>;
60
+ (key: string, value: R2PutValue, options?: R2PutOptions): Effect.Effect<R2Object, R2OperationError>;
62
61
  };
63
- readonly createMultipartUpload: (key: string, options?: R2MultipartOptions$1) => Effect.Effect<R2MultipartUploadClient, R2OperationError>;
62
+ readonly createMultipartUpload: (key: string, options?: R2MultipartOptions) => Effect.Effect<R2MultipartUploadClient, R2OperationError>;
64
63
  readonly resumeMultipartUpload: (key: string, uploadId: string) => Effect.Effect<R2MultipartUploadClient, R2OperationError>;
65
64
  readonly delete: (keys: string | ReadonlyArray<string>) => Effect.Effect<void, R2OperationError>;
66
- readonly list: (options?: R2ListOptions$1) => Effect.Effect<R2Objects, R2OperationError>;
65
+ readonly list: (options?: R2ListOptions) => Effect.Effect<R2Objects, R2OperationError>;
67
66
  readonly rawUnsafe: Effect.Effect<R2Bucket>;
68
67
  readonly definition: R2Definition;
69
68
  }
@@ -87,4 +86,4 @@ declare const layer: <Self>(tag: Context$1.Service<Self, R2Client>, definition:
87
86
  declare const make: <Id extends string>(id: Id) => TagClass<R2Service<Id>, Id>;
88
87
  declare const Tag: <Self>() => <Id extends string>(id: Id) => TagClass<Self, Id>;
89
88
  //#endregion
90
- export { type BindingNotFoundError, type BindingValidationError, LayerOptions, R2Client, R2Definition, R2GetOptions$1 as R2GetOptions, R2ListOptions$1 as R2ListOptions, R2MultipartOptions$1 as R2MultipartOptions, R2MultipartUploadClient, R2ObjectBodyClient, R2Operation, R2OperationError, R2PutOptions$1 as R2PutOptions, R2PutValue, R2Service, R2UploadPartOptions$1 as R2UploadPartOptions, R2UploadPartValue, R2_d_exports, Tag, TagClass, isR2Bucket, layer, make, makeClient };
89
+ export { type BindingNotFoundError, type BindingValidationError, LayerOptions, R2Client, R2Definition, R2GetOptions, R2ListOptions, R2MultipartOptions, R2MultipartUploadClient, R2ObjectBodyClient, R2Operation, R2OperationError, R2PutOptions, R2PutValue, R2Service, R2UploadPartOptions, R2UploadPartValue, R2_d_exports, Tag, TagClass, isR2Bucket, layer, make, makeClient };
@@ -3,10 +3,9 @@ import { BindingNotFoundError, BindingValidationError } from "./Binding.mjs";
3
3
  import * as Context$1 from "effect/Context";
4
4
  import * as Effect from "effect/Effect";
5
5
  import * as Schema$1 from "effect/Schema";
6
- import { Vectorize, VectorizeAsyncMutation, VectorizeIndex, VectorizeIndexDetails, VectorizeIndexInfo, VectorizeMatch, VectorizeMatches, VectorizeQueryOptions, VectorizeVector, VectorizeVectorMetadata, VectorizeVectorMetadataFilter, VectorizeVectorMetadataValue, VectorizeVectorMutation } from "@cloudflare/workers-types";
7
6
  import { Layer } from "effect";
8
7
  declare namespace Vectorize_d_exports {
9
- export { BindingNotFoundError, BindingValidationError, LayerOptions, Tag, TagClass, VectorizeBinding, VectorizeClient, VectorizeDefinition, VectorizeIndexDetails$1 as VectorizeIndexDetails, VectorizeIndexInfo$1 as VectorizeIndexInfo, VectorizeMatch$1 as VectorizeMatch, VectorizeMatches$1 as VectorizeMatches, VectorizeMutation, VectorizeOperation, VectorizeOperationError, VectorizeQueryOptions$1 as VectorizeQueryOptions, VectorizeService, VectorizeValues, VectorizeVector$1 as VectorizeVector, VectorizeVectorMetadata$1 as VectorizeVectorMetadata, VectorizeVectorMetadataFilter$1 as VectorizeVectorMetadataFilter, VectorizeVectorMetadataValue$1 as VectorizeVectorMetadataValue, isVectorizeBinding, layer, make, makeClient };
8
+ export { BindingNotFoundError, BindingValidationError, LayerOptions, Tag, TagClass, VectorizeBinding, VectorizeClient, VectorizeDefinition, VectorizeIndexDetails, VectorizeIndexInfo, VectorizeMatch, VectorizeMatches, VectorizeMutation, VectorizeOperation, VectorizeOperationError, VectorizeQueryOptions, VectorizeService, VectorizeValues, VectorizeVector, VectorizeVectorMetadata, VectorizeVectorMetadataFilter, VectorizeVectorMetadataValue, isVectorizeBinding, layer, make, makeClient };
10
9
  }
11
10
  type VectorizeOperation = "describe" | "query" | "queryById" | "insert" | "upsert" | "deleteByIds" | "getByIds";
12
11
  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 & {
@@ -23,26 +22,26 @@ interface VectorizeDefinition {
23
22
  readonly binding: string;
24
23
  }
25
24
  type VectorizeBinding = Vectorize | VectorizeIndex;
26
- type VectorizeVector$1 = VectorizeVector;
27
- type VectorizeVectorMetadata$1 = VectorizeVectorMetadata;
28
- type VectorizeVectorMetadataValue$1 = VectorizeVectorMetadataValue;
29
- type VectorizeVectorMetadataFilter$1 = VectorizeVectorMetadataFilter;
30
- type VectorizeQueryOptions$1 = VectorizeQueryOptions;
31
- type VectorizeMatches$1 = VectorizeMatches;
32
- type VectorizeMatch$1 = VectorizeMatch;
33
- type VectorizeIndexInfo$1 = VectorizeIndexInfo;
34
- type VectorizeIndexDetails$1 = VectorizeIndexDetails;
25
+ type VectorizeIndexDetails = globalThis.VectorizeIndexDetails;
26
+ type VectorizeIndexInfo = globalThis.VectorizeIndexInfo;
27
+ type VectorizeMatch = globalThis.VectorizeMatch;
28
+ type VectorizeMatches = globalThis.VectorizeMatches;
29
+ type VectorizeQueryOptions = globalThis.VectorizeQueryOptions;
30
+ type VectorizeVector = globalThis.VectorizeVector;
31
+ type VectorizeVectorMetadata = globalThis.VectorizeVectorMetadata;
32
+ type VectorizeVectorMetadataFilter = globalThis.VectorizeVectorMetadataFilter;
33
+ type VectorizeVectorMetadataValue = globalThis.VectorizeVectorMetadataValue;
35
34
  type VectorizeMutation = VectorizeAsyncMutation | VectorizeVectorMutation;
36
35
  type VectorizeValues = Float32Array | Float64Array | ReadonlyArray<number>;
37
36
  interface VectorizeClient {
38
- readonly describe: Effect.Effect<VectorizeIndexInfo$1 | VectorizeIndexDetails$1, VectorizeOperationError>;
39
- readonly query: (vector: VectorizeValues, options?: VectorizeQueryOptions$1) => Effect.Effect<VectorizeMatches$1, VectorizeOperationError>;
40
- readonly queryById: (vectorId: string, options?: VectorizeQueryOptions$1) => Effect.Effect<VectorizeMatches$1, VectorizeOperationError>;
41
- readonly insert: (vectors: ReadonlyArray<VectorizeVector$1>) => Effect.Effect<VectorizeMutation, VectorizeOperationError>;
42
- readonly upsert: (vectors: ReadonlyArray<VectorizeVector$1>) => Effect.Effect<VectorizeMutation, VectorizeOperationError>;
37
+ readonly describe: Effect.Effect<VectorizeIndexInfo | VectorizeIndexDetails, VectorizeOperationError>;
38
+ readonly query: (vector: VectorizeValues, options?: VectorizeQueryOptions) => Effect.Effect<VectorizeMatches, VectorizeOperationError>;
39
+ readonly queryById: (vectorId: string, options?: VectorizeQueryOptions) => Effect.Effect<VectorizeMatches, VectorizeOperationError>;
40
+ readonly insert: (vectors: ReadonlyArray<VectorizeVector>) => Effect.Effect<VectorizeMutation, VectorizeOperationError>;
41
+ readonly upsert: (vectors: ReadonlyArray<VectorizeVector>) => Effect.Effect<VectorizeMutation, VectorizeOperationError>;
43
42
  readonly deleteByIds: (ids: ReadonlyArray<string>) => Effect.Effect<VectorizeMutation, VectorizeOperationError>;
44
43
  readonly delete: (ids: ReadonlyArray<string>) => Effect.Effect<VectorizeMutation, VectorizeOperationError>;
45
- readonly getByIds: (ids: ReadonlyArray<string>) => Effect.Effect<ReadonlyArray<VectorizeVector$1>, VectorizeOperationError>;
44
+ readonly getByIds: (ids: ReadonlyArray<string>) => Effect.Effect<ReadonlyArray<VectorizeVector>, VectorizeOperationError>;
46
45
  readonly rawUnsafe: Effect.Effect<VectorizeBinding>;
47
46
  readonly definition: VectorizeDefinition;
48
47
  }
@@ -66,4 +65,4 @@ declare const layer: <Self>(tag: Context$1.Service<Self, VectorizeClient>, defin
66
65
  declare const make: <Id extends string>(id: Id) => TagClass<VectorizeService<Id>, Id>;
67
66
  declare const Tag: <Self>() => <Id extends string>(id: Id) => TagClass<Self, Id>;
68
67
  //#endregion
69
- export { type BindingNotFoundError, type BindingValidationError, LayerOptions, Tag, TagClass, VectorizeBinding, VectorizeClient, VectorizeDefinition, VectorizeIndexDetails$1 as VectorizeIndexDetails, VectorizeIndexInfo$1 as VectorizeIndexInfo, VectorizeMatch$1 as VectorizeMatch, VectorizeMatches$1 as VectorizeMatches, VectorizeMutation, VectorizeOperation, VectorizeOperationError, VectorizeQueryOptions$1 as VectorizeQueryOptions, VectorizeService, VectorizeValues, VectorizeVector$1 as VectorizeVector, VectorizeVectorMetadata$1 as VectorizeVectorMetadata, VectorizeVectorMetadataFilter$1 as VectorizeVectorMetadataFilter, VectorizeVectorMetadataValue$1 as VectorizeVectorMetadataValue, Vectorize_d_exports, isVectorizeBinding, layer, make, makeClient };
68
+ export { type BindingNotFoundError, type BindingValidationError, LayerOptions, Tag, TagClass, VectorizeBinding, VectorizeClient, VectorizeDefinition, VectorizeIndexDetails, VectorizeIndexInfo, VectorizeMatch, VectorizeMatches, VectorizeMutation, VectorizeOperation, VectorizeOperationError, VectorizeQueryOptions, VectorizeService, VectorizeValues, VectorizeVector, VectorizeVectorMetadata, VectorizeVectorMetadataFilter, VectorizeVectorMetadataValue, Vectorize_d_exports, isVectorizeBinding, layer, make, makeClient };
@@ -1,7 +1,6 @@
1
1
  import * as Effect from "effect/Effect";
2
2
  import * as S from "effect/Schema";
3
3
  import * as Option from "effect/Option";
4
- import { Request } from "@cloudflare/workers-types";
5
4
  declare namespace WebTransport_d_exports {
6
5
  export { Capabilities, InboundTransport, WebTransportCapability, WebTransportUnsupportedError, capabilities, inboundSessionsUnsupported, inboundTransport, isHttp3 };
7
6
  }
@@ -6,6 +6,37 @@ import * as Predicate from "effect/Predicate";
6
6
  import "effect/Option";
7
7
  import * as Result from "effect/Result";
8
8
  //#region src/WebTransport.ts
9
+ /**
10
+ * Truthful WebTransport / HTTP/3 boundary for Cloudflare Workers.
11
+ *
12
+ * What Cloudflare supports today (verified against primary sources, August
13
+ * 2026):
14
+ *
15
+ * - Inbound HTTP/3 is a zone-level setting. Cloudflare's edge terminates the
16
+ * QUIC connection and invokes the Worker with an ordinary `fetch` Request;
17
+ * the inbound protocol is surfaced only as metadata on `request.cf`
18
+ * ({@link inboundTransport}).
19
+ * - There is no runtime API for inbound WebTransport sessions — nothing
20
+ * analogous to `WebSocketPair`. workerd contains no QUIC/HTTP-3 stack, and
21
+ * the maintainers state WebTransport support "is not currently on our
22
+ * priority list" (cloudflare/workerd#6451, discussion #6454).
23
+ * - There is no outbound WebTransport/QUIC/UDP client capability either;
24
+ * `cloudflare:sockets` `connect()` is TCP-only, and
25
+ * `@cloudflare/workers-types` contains no WebTransport types.
26
+ * - Workers and Durable Objects can accept inbound WebSocket connections;
27
+ * Durable Objects additionally support hibernation (`acceptWebSocket`,
28
+ * `webSocketMessage`, `webSocketClose`).
29
+ *
30
+ * Consequently a browser's WebTransport session can never reach Worker code:
31
+ * clients should attempt WebTransport only against origins that actually
32
+ * speak it, and fall back to WebSockets for Cloudflare-hosted endpoints (see
33
+ * the `effect-webtransport` package's `Fallback` module). This module gives
34
+ * that reality a typed shape: {@link capabilities} feature-detects what the
35
+ * current runtime provides, {@link inboundSessionsUnsupported} is the
36
+ * explicit typed boundary for the missing inbound API, and
37
+ * {@link inboundTransport} decodes the HTTP/3-relevant request metadata that
38
+ * the edge does provide.
39
+ */
9
40
  var WebTransport_exports = /* @__PURE__ */ __exportAll({
10
41
  InboundTransport: () => InboundTransport,
11
42
  WebTransportUnsupportedError: () => WebTransportUnsupportedError,
@@ -3,7 +3,6 @@ import { BindingNotFoundError, BindingValidationError } from "./Binding.mjs";
3
3
  import * as Context$1 from "effect/Context";
4
4
  import * as Effect from "effect/Effect";
5
5
  import * as S from "effect/Schema";
6
- import { Ai, AiAsyncBatchResponse, AiGateway, AiModelListType, AiModels, AiModelsSearchObject, AiModelsSearchParams, AiOptions, AiTextEmbeddingsInput, Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Input } from "@cloudflare/workers-types";
7
6
  import { Layer } from "effect";
8
7
  declare namespace WorkersAi_d_exports {
9
8
  export { BindingNotFoundError, BindingValidationError, LayerOptions, Tag, TagClass, WorkersAiAsyncBatchResponse, WorkersAiBinding, WorkersAiClient, WorkersAiDefinition, WorkersAiEmbeddingInput, WorkersAiEmbeddingResponse, WorkersAiModelsSearchObject, WorkersAiModelsSearchParams, WorkersAiOperationError, WorkersAiOptions, WorkersAiService, embeddingResponse, isWorkersAiBinding, layer, make, makeClient };
@@ -4,18 +4,17 @@ import { ServiceFreeSchema } from "./RpcDefinition.mjs";
4
4
  import * as Effect from "effect/Effect";
5
5
  import * as S from "effect/Schema";
6
6
  import * as Option from "effect/Option";
7
- import { InstanceStatus, Workflow, WorkflowInstance, WorkflowInstanceCreateOptions, WorkflowInstanceLocationHint, WorkflowInstanceRestartOptions, WorkflowInstanceTerminateOptions } from "@cloudflare/workers-types";
8
7
  import { Context } from "effect";
9
8
  declare namespace WorkflowBinding_d_exports {
10
- export { WorkflowBindingClient, WorkflowBindingDefinition, WorkflowInstance$1 as WorkflowInstance, WorkflowInstanceCreateBatchOptions, WorkflowInstanceCreateOptions$1 as WorkflowInstanceCreateOptions, WorkflowInstanceEvent, WorkflowInstanceLocationHint$1 as WorkflowInstanceLocationHint, WorkflowInstanceRestartOptions$1 as WorkflowInstanceRestartOptions, WorkflowInstanceStatus, WorkflowInstanceStatusName, WorkflowInstanceTerminateOptions$1 as WorkflowInstanceTerminateOptions, WorkflowOperationError, WorkflowResultDecodeError, isWorkflow, layer, makeClient };
9
+ export { WorkflowBindingClient, WorkflowBindingDefinition, WorkflowInstance, WorkflowInstanceCreateBatchOptions, WorkflowInstanceCreateOptions, WorkflowInstanceEvent, WorkflowInstanceLocationHint, WorkflowInstanceRestartOptions, WorkflowInstanceStatus, WorkflowInstanceStatusName, WorkflowInstanceTerminateOptions, WorkflowOperationError, WorkflowResultDecodeError, isWorkflow, layer, makeClient };
11
10
  }
12
- type WorkflowInstanceCreateOptions$1<Payload> = Omit<WorkflowInstanceCreateOptions<Payload>, "params">;
11
+ type WorkflowInstanceCreateOptions<Payload> = Omit<globalThis.WorkflowInstanceCreateOptions<Payload>, "params">;
13
12
  type WorkflowInstanceCreateBatchOptions<Payload, EncodedPayload = unknown> = ReadonlyArray<{
14
13
  readonly payload: Payload;
15
- } & WorkflowInstanceCreateOptions$1<EncodedPayload>>;
16
- type WorkflowInstanceRestartOptions$1 = WorkflowInstanceRestartOptions;
17
- type WorkflowInstanceTerminateOptions$1 = WorkflowInstanceTerminateOptions;
18
- type WorkflowInstanceLocationHint$1 = WorkflowInstanceLocationHint;
14
+ } & WorkflowInstanceCreateOptions<EncodedPayload>>;
15
+ type WorkflowInstanceLocationHint = globalThis.WorkflowInstanceLocationHint;
16
+ type WorkflowInstanceRestartOptions = globalThis.WorkflowInstanceRestartOptions;
17
+ type WorkflowInstanceTerminateOptions = globalThis.WorkflowInstanceTerminateOptions;
19
18
  type WorkflowInstanceStatusName = InstanceStatus["status"];
20
19
  interface WorkflowInstanceStatus<Result> {
21
20
  readonly status: WorkflowInstanceStatusName;
@@ -25,13 +24,13 @@ interface WorkflowInstanceStatus<Result> {
25
24
  readonly message: string;
26
25
  }>;
27
26
  }
28
- interface WorkflowInstance$1<Result> {
29
- readonly raw: WorkflowInstance;
27
+ interface WorkflowInstance<Result> {
28
+ readonly raw: globalThis.WorkflowInstance;
30
29
  readonly id: string;
31
30
  readonly pause: Effect.Effect<void, WorkflowOperationError>;
32
31
  readonly resume: Effect.Effect<void, WorkflowOperationError>;
33
- readonly terminate: (options?: WorkflowInstanceTerminateOptions$1) => Effect.Effect<void, WorkflowOperationError>;
34
- readonly restart: (options?: WorkflowInstanceRestartOptions$1) => Effect.Effect<void, WorkflowOperationError>;
32
+ readonly terminate: (options?: WorkflowInstanceTerminateOptions) => Effect.Effect<void, WorkflowOperationError>;
33
+ readonly restart: (options?: WorkflowInstanceRestartOptions) => Effect.Effect<void, WorkflowOperationError>;
35
34
  readonly delete: Effect.Effect<void, WorkflowOperationError>;
36
35
  readonly status: Effect.Effect<WorkflowInstanceStatus<Result>, WorkflowOperationError | WorkflowResultDecodeError>;
37
36
  readonly sendEvent: (event: WorkflowInstanceEvent) => Effect.Effect<void, WorkflowOperationError>;
@@ -46,9 +45,9 @@ interface WorkflowBindingDefinition<Payload extends ServiceFreeSchema, Result ex
46
45
  readonly result: Result;
47
46
  }
48
47
  interface WorkflowBindingClient<Payload extends ServiceFreeSchema, Result extends ServiceFreeSchema> {
49
- readonly create: (payload: S.Schema.Type<Payload>, options?: WorkflowInstanceCreateOptions$1<S.Codec.Encoded<Payload>>) => Effect.Effect<WorkflowInstance$1<S.Schema.Type<Result>>, WorkflowOperationError | S.SchemaError>;
50
- readonly createBatch: (batch: WorkflowInstanceCreateBatchOptions<S.Schema.Type<Payload>, S.Codec.Encoded<Payload>>) => Effect.Effect<ReadonlyArray<WorkflowInstance$1<S.Schema.Type<Result>>>, WorkflowOperationError | S.SchemaError>;
51
- readonly get: (instanceId: string) => Effect.Effect<WorkflowInstance$1<S.Schema.Type<Result>>, WorkflowOperationError>;
48
+ readonly create: (payload: S.Schema.Type<Payload>, options?: WorkflowInstanceCreateOptions<S.Codec.Encoded<Payload>>) => Effect.Effect<WorkflowInstance<S.Schema.Type<Result>>, WorkflowOperationError | S.SchemaError>;
49
+ readonly createBatch: (batch: WorkflowInstanceCreateBatchOptions<S.Schema.Type<Payload>, S.Codec.Encoded<Payload>>) => Effect.Effect<ReadonlyArray<WorkflowInstance<S.Schema.Type<Result>>>, WorkflowOperationError | S.SchemaError>;
50
+ readonly get: (instanceId: string) => Effect.Effect<WorkflowInstance<S.Schema.Type<Result>>, WorkflowOperationError>;
52
51
  readonly rawUnsafe: Effect.Effect<Workflow<S.Codec.Encoded<Payload>>>;
53
52
  }
54
53
  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 & {
@@ -76,4 +75,4 @@ declare const isWorkflow: <Payload>(value: WorkflowBindingValue) => value is Wor
76
75
  declare const makeClient: <Payload extends ServiceFreeSchema, Result extends ServiceFreeSchema>(definition: WorkflowBindingDefinition<Payload, Result>) => ((workflow: Workflow<S.Codec.Encoded<Payload>>) => WorkflowBindingClient<Payload, Result>);
77
76
  declare const layer: <Self, Payload extends ServiceFreeSchema, Result extends ServiceFreeSchema>(tag: Context.Service<Self, WorkflowBindingClient<Payload, Result>>, definition: WorkflowBindingDefinition<Payload, Result>) => import("effect/Layer").Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
78
77
  //#endregion
79
- export { WorkflowBindingClient, WorkflowBindingDefinition, WorkflowBinding_d_exports, WorkflowInstance$1 as WorkflowInstance, WorkflowInstanceCreateBatchOptions, WorkflowInstanceCreateOptions$1 as WorkflowInstanceCreateOptions, WorkflowInstanceEvent, WorkflowInstanceLocationHint$1 as WorkflowInstanceLocationHint, WorkflowInstanceRestartOptions$1 as WorkflowInstanceRestartOptions, WorkflowInstanceStatus, WorkflowInstanceStatusName, WorkflowInstanceTerminateOptions$1 as WorkflowInstanceTerminateOptions, WorkflowOperationError, WorkflowResultDecodeError, isWorkflow, layer, makeClient };
78
+ export { WorkflowBindingClient, WorkflowBindingDefinition, WorkflowBinding_d_exports, WorkflowInstance, WorkflowInstanceCreateBatchOptions, WorkflowInstanceCreateOptions, WorkflowInstanceEvent, WorkflowInstanceLocationHint, WorkflowInstanceRestartOptions, WorkflowInstanceStatus, WorkflowInstanceStatusName, WorkflowInstanceTerminateOptions, WorkflowOperationError, WorkflowResultDecodeError, isWorkflow, layer, makeClient };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "effect-cf",
3
- "version": "0.46.0",
3
+ "version": "0.46.1",
4
4
  "description": "Effect-native primitives for Cloudflare Workers and bindings.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/AiGateway.ts CHANGED
@@ -3,7 +3,6 @@ import * as Data from "effect/Data";
3
3
  import * as Effect from "effect/Effect";
4
4
  import * as S from "effect/Schema";
5
5
  import type { Layer } from "effect";
6
- import type { AiGateway as CloudflareAiGateway } from "@cloudflare/workers-types";
7
6
 
8
7
  import * as Binding from "./Binding";
9
8
  import type { WorkerEnvironment } from "./Environment";
@@ -30,14 +29,14 @@ export interface AiGatewayDefinition {
30
29
  readonly accountId?: string;
31
30
  }
32
31
 
33
- export type AiGatewayBinding = CloudflareAiGateway;
32
+ export type AiGatewayBinding = AiGateway;
34
33
  type AiGatewayRunData = Parameters<AiGatewayBinding["run"]>[0];
35
34
  export type AiGatewayPatchLog = Parameters<AiGatewayBinding["patchLog"]>[1];
36
35
  export type AiGatewayLog = Awaited<ReturnType<AiGatewayBinding["getLog"]>>;
37
36
  export type AiGatewayProvider = NonNullable<Parameters<AiGatewayBinding["getUrl"]>[0]>;
38
37
  export type AiGatewayUniversalRequest = Exclude<AiGatewayRunData, ReadonlyArray<unknown>>;
39
38
  export type AiGatewayHeaders = NonNullable<AiGatewayUniversalRequest["headers"]>;
40
- export type AiGatewayRunOptions = Parameters<CloudflareAiGateway["run"]>[1];
39
+ export type AiGatewayRunOptions = Parameters<AiGatewayBinding["run"]>[1];
41
40
  type AiGatewayBindingCandidate = Parameters<typeof isWorkersAiBinding>[0];
42
41
 
43
42
  const AiGatewayMetadata = S.Record(S.String, S.Union([S.String, S.Number, S.Boolean, S.Null]));
@@ -1,7 +1,3 @@
1
- import type {
2
- AnalyticsEngineDataPoint as CloudflareAnalyticsEngineDataPoint,
3
- AnalyticsEngineDataset as CloudflareAnalyticsEngineDataset,
4
- } from "@cloudflare/workers-types";
5
1
  import * as Config from "effect/Config";
6
2
  import * as Context from "effect/Context";
7
3
  import * as Data from "effect/Data";
@@ -107,8 +103,8 @@ export interface AnalyticsEngineDefinition {
107
103
  readonly binding: string;
108
104
  }
109
105
 
110
- export type AnalyticsEngineBinding = CloudflareAnalyticsEngineDataset;
111
- export type AnalyticsEngineDataPoint = CloudflareAnalyticsEngineDataPoint;
106
+ export type AnalyticsEngineBinding = AnalyticsEngineDataset;
107
+ export type AnalyticsEngineDataPoint = globalThis.AnalyticsEngineDataPoint;
112
108
  export type AnalyticsEngineFieldValue = ArrayBuffer | string | null;
113
109
  export type AnalyticsEngineWriteError =
114
110
  | AnalyticsEngineOperationError
package/src/Artifacts.ts CHANGED
@@ -1,11 +1,3 @@
1
- import type {
2
- ArtifactsCreateRepoResult as CloudflareArtifactsCreateRepoResult,
3
- ArtifactsCreateTokenResult as CloudflareArtifactsCreateTokenResult,
4
- ArtifactsErrorCode as CloudflareArtifactsErrorCode,
5
- ArtifactsRepoInfo as CloudflareArtifactsRepoInfo,
6
- ArtifactsTokenInfo as CloudflareArtifactsTokenInfo,
7
- ArtifactsTokenListResult as CloudflareArtifactsTokenListResult,
8
- } from "@cloudflare/workers-types";
9
1
  import * as Context from "effect/Context";
10
2
  import * as Data from "effect/Data";
11
3
  import * as Effect from "effect/Effect";
@@ -56,7 +48,7 @@ export const artifactsErrorCodes = [
56
48
  "UPSTREAM_UNAVAILABLE",
57
49
  "MEMORY_LIMIT",
58
50
  "INTERNAL_ERROR",
59
- ] as const satisfies ReadonlyArray<CloudflareArtifactsErrorCode>;
51
+ ] as const satisfies ReadonlyArray<ArtifactsErrorCode>;
60
52
 
61
53
  export const artifactsErrorNumericCodes = {
62
54
  ALREADY_EXISTS: 10201,
@@ -71,9 +63,9 @@ export const artifactsErrorNumericCodes = {
71
63
  UPSTREAM_UNAVAILABLE: 10401,
72
64
  MEMORY_LIMIT: 10402,
73
65
  INTERNAL_ERROR: 10400,
74
- } as const satisfies Readonly<Record<CloudflareArtifactsErrorCode, number>>;
66
+ } as const satisfies Readonly<Record<ArtifactsErrorCode, number>>;
75
67
 
76
- export type ArtifactsErrorCode = CloudflareArtifactsErrorCode;
68
+ export type ArtifactsErrorCode = globalThis.ArtifactsErrorCode;
77
69
 
78
70
  export class ArtifactsOperationError extends Data.TaggedError("ArtifactsOperationError")<{
79
71
  readonly binding: string;
@@ -105,9 +97,9 @@ export type ArtifactsTokenState = "active" | "expired" | "revoked";
105
97
 
106
98
  export type ArtifactsRepoStatus = "ready" | "importing" | "forking";
107
99
 
108
- export type ArtifactsRepoInfo = CloudflareArtifactsRepoInfo;
100
+ export type ArtifactsRepoInfo = globalThis.ArtifactsRepoInfo;
109
101
 
110
- export type ArtifactsCreateRepoResult = Readonly<CloudflareArtifactsCreateRepoResult>;
102
+ export type ArtifactsCreateRepoResult = Readonly<globalThis.ArtifactsCreateRepoResult>;
111
103
 
112
104
  export interface ArtifactsRepoListEntry extends ArtifactsRepoInfo {
113
105
  readonly status: ArtifactsRepoStatus;
@@ -120,13 +112,13 @@ export interface ArtifactsRepoListResult {
120
112
  }
121
113
 
122
114
  /** Result of creating a repository token. */
123
- export type ArtifactsCreateTokenResult = CloudflareArtifactsCreateTokenResult;
115
+ export type ArtifactsCreateTokenResult = globalThis.ArtifactsCreateTokenResult;
124
116
 
125
117
  /** Repository token metadata, excluding its plaintext secret. */
126
- export type ArtifactsTokenInfo = CloudflareArtifactsTokenInfo;
118
+ export type ArtifactsTokenInfo = globalThis.ArtifactsTokenInfo;
127
119
 
128
120
  /** Repository token list result. */
129
- export type ArtifactsTokenListResult = CloudflareArtifactsTokenListResult;
121
+ export type ArtifactsTokenListResult = globalThis.ArtifactsTokenListResult;
130
122
 
131
123
  /** Identity recorded for a Git commit author or committer. */
132
124
  export interface ArtifactsCommitIdentity {
package/src/Cache.ts CHANGED
@@ -1,9 +1,3 @@
1
- import type {
2
- Cache as CloudflareCache,
3
- CacheQueryOptions as CloudflareCacheQueryOptions,
4
- CacheStorage as CloudflareCacheStorage,
5
- RequestInfo as CloudflareRequestInfo,
6
- } from "@cloudflare/workers-types";
7
1
  import * as Context from "effect/Context";
8
2
  import * as Data from "effect/Data";
9
3
  import * as Effect from "effect/Effect";
@@ -12,9 +6,9 @@ import * as Option from "effect/Option";
12
6
 
13
7
  import * as ErrorMessage from "./internal/ErrorMessage";
14
8
 
15
- export type CacheRequest = CloudflareRequestInfo | URL;
9
+ export type CacheRequest = RequestInfo | URL;
16
10
 
17
- export type CacheQueryOptions = CloudflareCacheQueryOptions;
11
+ export type CacheQueryOptions = globalThis.CacheQueryOptions;
18
12
 
19
13
  export type CacheOperation = "open" | "match" | "put" | "delete";
20
14
 
@@ -42,13 +36,13 @@ export interface CacheClient {
42
36
  request: CacheRequest,
43
37
  options?: CacheQueryOptions,
44
38
  ) => Effect.Effect<boolean, CacheOperationError>;
45
- readonly rawUnsafe: Effect.Effect<CloudflareCache>;
39
+ readonly rawUnsafe: Effect.Effect<Cache>;
46
40
  }
47
41
 
48
42
  export interface CacheStorageClient {
49
43
  readonly default: CacheClient;
50
44
  readonly open: (name: string) => Effect.Effect<CacheClient, CacheOperationError>;
51
- readonly rawUnsafe: Effect.Effect<CloudflareCacheStorage>;
45
+ readonly rawUnsafe: Effect.Effect<globalThis.CacheStorage>;
52
46
  }
53
47
 
54
48
  export class CacheStorage extends Context.Service<CacheStorage, CacheStorageClient>()(
@@ -72,7 +66,7 @@ const spanOptions = (cache: string, operation: CacheOperation) => ({
72
66
  attributes: { cache, operation },
73
67
  });
74
68
 
75
- export const makeCacheClient = (cache: CloudflareCache, name = "default"): CacheClient => ({
69
+ export const makeCacheClient = (cache: Cache, name = "default"): CacheClient => ({
76
70
  name,
77
71
  match: Effect.fn(
78
72
  "Cache.match",
@@ -97,7 +91,7 @@ export const makeCacheClient = (cache: CloudflareCache, name = "default"): Cache
97
91
  rawUnsafe: Effect.succeed(cache),
98
92
  });
99
93
 
100
- export const makeClient = (storage: CloudflareCacheStorage): CacheStorageClient => ({
94
+ export const makeClient = (storage: globalThis.CacheStorage): CacheStorageClient => ({
101
95
  default: makeCacheClient(storage.default),
102
96
  open: (name) =>
103
97
  tryCachePromise(name, "open", () => storage.open(name)).pipe(
@@ -107,7 +101,7 @@ export const makeClient = (storage: CloudflareCacheStorage): CacheStorageClient
107
101
  rawUnsafe: Effect.succeed(storage),
108
102
  });
109
103
 
110
- export const layerFrom = (storage: CloudflareCacheStorage): Layer.Layer<CacheStorage> =>
104
+ export const layerFrom = (storage: globalThis.CacheStorage): Layer.Layer<CacheStorage> =>
111
105
  Layer.succeed(CacheStorage, makeClient(storage));
112
106
 
113
107
  export const layer: Layer.Layer<CacheStorage> = Layer.sync(CacheStorage, () => makeClient(caches));
package/src/Email.ts CHANGED
@@ -1,9 +1,3 @@
1
- import type {
2
- EmailAddress as CloudflareEmailAddress,
3
- EmailAttachment as CloudflareEmailAttachment,
4
- EmailSendResult as CloudflareEmailSendResult,
5
- SendEmail as CloudflareSendEmail,
6
- } from "@cloudflare/workers-types";
7
1
  import * as Context from "effect/Context";
8
2
  import * as Data from "effect/Data";
9
3
  import * as Effect from "effect/Effect";
@@ -103,11 +97,11 @@ export interface EmailDefinition {
103
97
  readonly binding: string;
104
98
  }
105
99
 
106
- export type EmailAddress = CloudflareEmailAddress;
107
- export type EmailAttachment = CloudflareEmailAttachment;
108
- export type EmailMessageBuilder = Parameters<CloudflareSendEmail["send"]>[0];
109
- export type EmailSendResult = CloudflareEmailSendResult;
110
- export type EmailBinding = CloudflareSendEmail;
100
+ export type EmailAddress = globalThis.EmailAddress;
101
+ export type EmailAttachment = globalThis.EmailAttachment;
102
+ export type EmailSendResult = globalThis.EmailSendResult;
103
+ export type EmailMessageBuilder = Parameters<SendEmail["send"]>[0];
104
+ export type EmailBinding = SendEmail;
111
105
  export type EmailRecipients = string | EmailAddress | ReadonlyArray<string | EmailAddress>;
112
106
  export type EmailSendError = EmailOperationError | EmailValidationError;
113
107
  type EmailFieldCandidate = Parameters<typeof Predicate.isUnknown>[0];