effect-cf 0.13.1 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +28 -1
- package/dist/{Hyperdrive-L6ldMlRF.d.mts → Hyperdrive-C0vfrPeG.d.mts} +1 -1
- package/dist/HyperdrivePg.d.mts +1 -1
- package/dist/index.d.mts +551 -311
- package/dist/index.mjs +460 -316
- package/package.json +8 -8
- package/src/AiGateway.ts +284 -0
- package/src/BrowserRendering.ts +286 -0
- package/src/CloudflareOtlp.ts +90 -386
- package/src/DurableObject.ts +3 -2
- package/src/Email.ts +134 -0
- package/src/Environment.ts +1 -1
- package/src/Images.ts +42 -24
- package/src/Kv.ts +6 -2
- package/src/QueueBinding.ts +19 -10
- package/src/R2.ts +47 -33
- package/src/Vectorize.ts +213 -0
- package/src/WorkersAi.ts +239 -0
- package/src/Workflow.ts +2 -0
- package/src/WorkflowBinding.ts +15 -9
- package/src/index.ts +5 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
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-
|
|
2
|
-
import { Cause,
|
|
3
|
-
import { HttpServerRequest, HttpServerResponse } from "effect/unstable/http";
|
|
4
|
-
import { OtlpMetrics } from "effect/unstable/observability";
|
|
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-C0vfrPeG.mjs";
|
|
2
|
+
import { Cause, Context, Data, DateTime, Duration, Effect, Layer, Option, Schema, Scope } from "effect";
|
|
3
|
+
import { Headers as Headers$1, HttpServerRequest, HttpServerResponse } from "effect/unstable/http";
|
|
5
4
|
import { D1Client } from "@effect/sql-d1";
|
|
6
5
|
import { DurableObject, RpcStub, RpcTarget, WorkerEntrypoint, WorkflowEntrypoint, WorkflowEvent, WorkflowSleepDuration, WorkflowStep, WorkflowStepConfig, WorkflowStepContext, WorkflowStepEvent, WorkflowTimeoutDuration } from "cloudflare:workers";
|
|
7
6
|
import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization";
|
|
@@ -12,11 +11,244 @@ import * as _$effect_Types0 from "effect/Types";
|
|
|
12
11
|
import * as _$effect_Cause0 from "effect/Cause";
|
|
13
12
|
import * as _$effect_Layer0 from "effect/Layer";
|
|
14
13
|
import * as _$effect_Scope0 from "effect/Scope";
|
|
15
|
-
import * as Duration$1 from "effect/Duration";
|
|
16
14
|
import * as Tracer from "effect/Tracer";
|
|
17
15
|
import * as _$effect_Config0 from "effect/Config";
|
|
18
16
|
|
|
19
|
-
//#region src/
|
|
17
|
+
//#region src/WorkersAi.d.ts
|
|
18
|
+
declare namespace WorkersAi_d_exports {
|
|
19
|
+
export { LayerOptions$17 as LayerOptions, Tag$16 as Tag, TagClass$15 as TagClass, WorkersAiAsyncBatchResponse, WorkersAiBinding, WorkersAiClient, WorkersAiDefinition, WorkersAiEmbeddingInput, WorkersAiEmbeddingResponse, WorkersAiModelsSearchObject, WorkersAiModelsSearchParams, WorkersAiOperationError, WorkersAiOptions, WorkersAiService, embeddingResponse, isWorkersAiBinding, layer$14 as layer, make$15 as make, makeClient$11 as makeClient };
|
|
20
|
+
}
|
|
21
|
+
declare const WorkersAiOperationError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
22
|
+
readonly _tag: "WorkersAiOperationError";
|
|
23
|
+
} & Readonly<A>;
|
|
24
|
+
/** Error raised when a Workers AI operation fails. */
|
|
25
|
+
declare class WorkersAiOperationError extends WorkersAiOperationError_base<{
|
|
26
|
+
readonly binding: string;
|
|
27
|
+
readonly operation: string;
|
|
28
|
+
readonly cause: unknown;
|
|
29
|
+
}> {}
|
|
30
|
+
/** Typed Workers AI binding definition. */
|
|
31
|
+
interface WorkersAiDefinition {
|
|
32
|
+
/** Binding name as configured in `wrangler.jsonc`. */
|
|
33
|
+
readonly binding: string;
|
|
34
|
+
}
|
|
35
|
+
type WorkersAiBinding<ModelList extends AiModelListType = AiModels> = CloudflareAi<ModelList>;
|
|
36
|
+
type WorkersAiOptions = AiOptions;
|
|
37
|
+
type WorkersAiModelsSearchParams = AiModelsSearchParams;
|
|
38
|
+
type WorkersAiModelsSearchObject = AiModelsSearchObject;
|
|
39
|
+
type WorkersAiAsyncBatchResponse = AiAsyncBatchResponse;
|
|
40
|
+
type WorkersAiEmbeddingInput = AiTextEmbeddingsInput | Ai_Cf_Qwen_Qwen3_Embedding_0_6B_Input | Record<string, unknown>;
|
|
41
|
+
interface WorkersAiEmbeddingResponse {
|
|
42
|
+
readonly data: ReadonlyArray<ReadonlyArray<number>>;
|
|
43
|
+
readonly shape: ReadonlyArray<number>;
|
|
44
|
+
}
|
|
45
|
+
interface WorkersAiClient<ModelList extends AiModelListType = AiModels> {
|
|
46
|
+
readonly aiGatewayLogId: Effect.Effect<string | null, WorkersAiOperationError>;
|
|
47
|
+
readonly run: {
|
|
48
|
+
<Name extends keyof ModelList>(model: Name, input: {
|
|
49
|
+
readonly requests: ReadonlyArray<ModelList[Name]["inputs"]>;
|
|
50
|
+
}, options: WorkersAiOptions & {
|
|
51
|
+
readonly queueRequest: true;
|
|
52
|
+
}): Effect.Effect<WorkersAiAsyncBatchResponse, WorkersAiOperationError>;
|
|
53
|
+
<Name extends keyof ModelList>(model: Name, input: ModelList[Name]["inputs"], options: WorkersAiOptions & {
|
|
54
|
+
readonly returnRawResponse: true;
|
|
55
|
+
}): Effect.Effect<Response, WorkersAiOperationError>;
|
|
56
|
+
<Name extends keyof ModelList>(model: Name, input: ModelList[Name]["inputs"], options: WorkersAiOptions & {
|
|
57
|
+
readonly websocket: true;
|
|
58
|
+
}): Effect.Effect<Response, WorkersAiOperationError>;
|
|
59
|
+
<Name extends keyof ModelList>(model: Name, input: ModelList[Name]["inputs"] & {
|
|
60
|
+
readonly stream: true;
|
|
61
|
+
}, options?: WorkersAiOptions): Effect.Effect<ReadableStream, WorkersAiOperationError>;
|
|
62
|
+
<Name extends keyof ModelList>(model: Name, input: ModelList[Name]["inputs"], options?: WorkersAiOptions): Effect.Effect<ModelList[Name]["postProcessedOutputs"], WorkersAiOperationError>;
|
|
63
|
+
<Input extends Record<string, unknown>, Output = Record<string, unknown>>(model: string, input: Input, options?: WorkersAiOptions): Effect.Effect<Output, WorkersAiOperationError>;
|
|
64
|
+
};
|
|
65
|
+
readonly runEmbedding: <Input extends WorkersAiEmbeddingInput>(model: string, input: Input, options?: WorkersAiOptions) => Effect.Effect<WorkersAiEmbeddingResponse, WorkersAiOperationError>;
|
|
66
|
+
readonly models: (params?: WorkersAiModelsSearchParams) => Effect.Effect<ReadonlyArray<WorkersAiModelsSearchObject>, WorkersAiOperationError>;
|
|
67
|
+
readonly gateway: (gatewayId: string) => Effect.Effect<CloudflareAiGateway, WorkersAiOperationError>;
|
|
68
|
+
readonly unsafeRaw: Effect.Effect<WorkersAiBinding<ModelList>>;
|
|
69
|
+
readonly definition: WorkersAiDefinition;
|
|
70
|
+
}
|
|
71
|
+
declare const WorkersAiServiceTypeId: unique symbol;
|
|
72
|
+
/** Nominal service marker for Workers AI services created with {@link make}. */
|
|
73
|
+
interface WorkersAiService<Id extends string> {
|
|
74
|
+
readonly [WorkersAiServiceTypeId]: {
|
|
75
|
+
readonly id: Id;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
type LayerOptions$17 = {
|
|
79
|
+
readonly binding: string;
|
|
80
|
+
};
|
|
81
|
+
interface TagClass$15<Self, Id extends string, ModelList extends AiModelListType = AiModels> extends Context.ServiceClass<Self, Id, WorkersAiClient<ModelList>> {
|
|
82
|
+
readonly id: Id;
|
|
83
|
+
readonly layer: (options: LayerOptions$17) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
84
|
+
}
|
|
85
|
+
declare const isWorkersAiBinding: (value: unknown) => value is WorkersAiBinding;
|
|
86
|
+
declare const embeddingResponse: (value: {
|
|
87
|
+
readonly data?: ReadonlyArray<ReadonlyArray<number>>;
|
|
88
|
+
readonly shape?: ReadonlyArray<number>;
|
|
89
|
+
}) => WorkersAiEmbeddingResponse;
|
|
90
|
+
declare const makeClient$11: <ModelList extends AiModelListType = AiModels>(definition: WorkersAiDefinition) => (ai: WorkersAiBinding<ModelList>) => WorkersAiClient<ModelList>;
|
|
91
|
+
declare const layer$14: <Self, ModelList extends AiModelListType = AiModels>(tag: Context.Service<Self, WorkersAiClient<ModelList>>, definition: WorkersAiDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
92
|
+
declare const make$15: <Id extends string>(id: Id) => TagClass$15<WorkersAiService<Id>, Id, AiModels>;
|
|
93
|
+
declare const Tag$16: <Self>() => <Id extends string, ModelList extends AiModelListType = AiModels>(id: Id) => TagClass$15<Self, Id, ModelList>;
|
|
94
|
+
declare namespace AiGateway_d_exports {
|
|
95
|
+
export { AiGatewayBinding, AiGatewayClient, AiGatewayDefinition, AiGatewayFetchOptions, AiGatewayHeaders, AiGatewayLog, AiGatewayOperationError, AiGatewayPatchLog, AiGatewayProvider, AiGatewayRunOptions, AiGatewayService, AiGatewayUniversalRequest, LayerOptions$16 as LayerOptions, Tag$15 as Tag, TagClass$14 as TagClass, isAiGatewayBinding, layer$13 as layer, make$14 as make, makeClient$10 as makeClient, makeClientFromAi, makeHttpClient };
|
|
96
|
+
}
|
|
97
|
+
declare const AiGatewayOperationError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
98
|
+
readonly _tag: "AiGatewayOperationError";
|
|
99
|
+
} & Readonly<A>;
|
|
100
|
+
/** Error raised when an AI Gateway operation fails. */
|
|
101
|
+
declare class AiGatewayOperationError extends AiGatewayOperationError_base<{
|
|
102
|
+
readonly binding: string;
|
|
103
|
+
readonly operation: string;
|
|
104
|
+
readonly cause: unknown;
|
|
105
|
+
}> {}
|
|
106
|
+
/** Typed AI Gateway client definition. */
|
|
107
|
+
interface AiGatewayDefinition {
|
|
108
|
+
/** Binding name as configured in `wrangler.jsonc`. */
|
|
109
|
+
readonly binding: string;
|
|
110
|
+
/** Gateway id/name passed to `env.AI.gateway(id)`. */
|
|
111
|
+
readonly gatewayId: string;
|
|
112
|
+
/** Optional account id used by the HTTP-only helper. */
|
|
113
|
+
readonly accountId?: string;
|
|
114
|
+
}
|
|
115
|
+
type AiGatewayBinding = CloudflareAiGateway;
|
|
116
|
+
type AiGatewayRunData = Parameters<AiGatewayBinding["run"]>[0];
|
|
117
|
+
type AiGatewayPatchLog = Parameters<AiGatewayBinding["patchLog"]>[1];
|
|
118
|
+
type AiGatewayLog = Awaited<ReturnType<AiGatewayBinding["getLog"]>>;
|
|
119
|
+
type AiGatewayProvider = NonNullable<Parameters<AiGatewayBinding["getUrl"]>[0]>;
|
|
120
|
+
type AiGatewayUniversalRequest = Exclude<AiGatewayRunData, ReadonlyArray<unknown>>;
|
|
121
|
+
type AiGatewayHeaders = NonNullable<AiGatewayUniversalRequest["headers"]>;
|
|
122
|
+
type AiGatewayRunOptions = Parameters<CloudflareAiGateway["run"]>[1];
|
|
123
|
+
interface AiGatewayFetchOptions {
|
|
124
|
+
readonly provider?: AiGatewayProvider;
|
|
125
|
+
readonly path?: string;
|
|
126
|
+
readonly init?: RequestInit;
|
|
127
|
+
}
|
|
128
|
+
interface AiGatewayClient {
|
|
129
|
+
readonly run: (data: AiGatewayUniversalRequest | ReadonlyArray<AiGatewayUniversalRequest>, options?: AiGatewayRunOptions) => Effect.Effect<Response, AiGatewayOperationError>;
|
|
130
|
+
readonly getUrl: (provider?: AiGatewayProvider) => Effect.Effect<string, AiGatewayOperationError>;
|
|
131
|
+
readonly fetch: (options: AiGatewayFetchOptions) => Effect.Effect<Response, AiGatewayOperationError>;
|
|
132
|
+
readonly patchLog: (logId: string, data: AiGatewayPatchLog) => Effect.Effect<void, AiGatewayOperationError>;
|
|
133
|
+
readonly getLog: (logId: string) => Effect.Effect<AiGatewayLog, AiGatewayOperationError>;
|
|
134
|
+
readonly unsafeRaw: Effect.Effect<AiGatewayBinding, AiGatewayOperationError>;
|
|
135
|
+
readonly definition: AiGatewayDefinition;
|
|
136
|
+
}
|
|
137
|
+
declare const AiGatewayServiceTypeId: unique symbol;
|
|
138
|
+
/** Nominal service marker for AI Gateway services created with {@link make}. */
|
|
139
|
+
interface AiGatewayService<Id extends string> {
|
|
140
|
+
readonly [AiGatewayServiceTypeId]: {
|
|
141
|
+
readonly id: Id;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
type LayerOptions$16 = {
|
|
145
|
+
readonly binding: string;
|
|
146
|
+
readonly gatewayId: string;
|
|
147
|
+
readonly accountId?: string;
|
|
148
|
+
};
|
|
149
|
+
interface TagClass$14<Self, Id extends string> extends Context.ServiceClass<Self, Id, AiGatewayClient> {
|
|
150
|
+
readonly id: Id;
|
|
151
|
+
readonly layer: (options: LayerOptions$16) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError | AiGatewayOperationError, WorkerEnvironment>;
|
|
152
|
+
}
|
|
153
|
+
declare const isAiGatewayBinding: (value: unknown) => value is WorkersAiBinding;
|
|
154
|
+
declare const makeClient$10: (definition: AiGatewayDefinition, gateway: AiGatewayBinding) => {
|
|
155
|
+
definition: AiGatewayDefinition;
|
|
156
|
+
run: (data: _$_cloudflare_workers_types0.AIGatewayUniversalRequest | readonly _$_cloudflare_workers_types0.AIGatewayUniversalRequest[], options: {
|
|
157
|
+
gateway?: _$_cloudflare_workers_types0.UniversalGatewayOptions;
|
|
158
|
+
extraHeaders?: object;
|
|
159
|
+
signal?: _$_cloudflare_workers_types0.AbortSignal;
|
|
160
|
+
} | undefined) => Effect.Effect<_$_cloudflare_workers_types0.Response, AiGatewayOperationError, never>;
|
|
161
|
+
getUrl: (provider: string | undefined) => Effect.Effect<string, AiGatewayOperationError, never>;
|
|
162
|
+
fetch: (options: AiGatewayFetchOptions) => Effect.Effect<Response, AiGatewayOperationError, never>;
|
|
163
|
+
patchLog: (logId: string, data: _$_cloudflare_workers_types0.AiGatewayPatchLog) => Effect.Effect<void, AiGatewayOperationError, never>;
|
|
164
|
+
getLog: (logId: string) => Effect.Effect<_$_cloudflare_workers_types0.AiGatewayLog, AiGatewayOperationError, never>;
|
|
165
|
+
unsafeRaw: Effect.Effect<CloudflareAiGateway, never, never>;
|
|
166
|
+
};
|
|
167
|
+
declare const makeClientFromAi: (definition: AiGatewayDefinition, ai: WorkersAiBinding) => AiGatewayClient;
|
|
168
|
+
declare const makeHttpClient: (definition: Omit<AiGatewayDefinition, "binding"> & {
|
|
169
|
+
readonly accountId: string;
|
|
170
|
+
readonly binding?: string;
|
|
171
|
+
}, request?: typeof fetch) => AiGatewayClient;
|
|
172
|
+
declare const layer$13: <Self>(tag: Context.Service<Self, AiGatewayClient>, definition: AiGatewayDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
173
|
+
declare const make$14: <Id extends string>(id: Id) => TagClass$14<AiGatewayService<Id>, Id>;
|
|
174
|
+
declare const Tag$15: <Self>() => <Id extends string>(id: Id) => TagClass$14<Self, Id>;
|
|
175
|
+
declare namespace BrowserRendering_d_exports {
|
|
176
|
+
export { BrowserRenderingBinding, BrowserRenderingBrowserClient, BrowserRenderingBrowserLike, BrowserRenderingClient, BrowserRenderingConnect, BrowserRenderingDefinition, BrowserRenderingLaunch, BrowserRenderingOperationError, BrowserRenderingPageClient, BrowserRenderingPageLike, BrowserRenderingService, LayerOptions$15 as LayerOptions, Tag$14 as Tag, TagClass$13 as TagClass, isBrowserRenderingBinding, layer$12 as layer, make$13 as make, makeClient$9 as makeClient };
|
|
177
|
+
}
|
|
178
|
+
declare const BrowserRenderingOperationError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
179
|
+
readonly _tag: "BrowserRenderingOperationError";
|
|
180
|
+
} & Readonly<A>;
|
|
181
|
+
/** Error raised when a Browser Rendering operation fails. */
|
|
182
|
+
declare class BrowserRenderingOperationError extends BrowserRenderingOperationError_base<{
|
|
183
|
+
readonly binding: string;
|
|
184
|
+
readonly operation: string;
|
|
185
|
+
readonly cause: unknown;
|
|
186
|
+
}> {}
|
|
187
|
+
/** Typed Browser Rendering binding definition. */
|
|
188
|
+
interface BrowserRenderingDefinition {
|
|
189
|
+
/** Binding name as configured in `wrangler.jsonc`. */
|
|
190
|
+
readonly binding: string;
|
|
191
|
+
}
|
|
192
|
+
type BrowserRenderingBinding = object;
|
|
193
|
+
type BrowserRenderingLaunch<RawBinding, Browser, LaunchOptions = unknown> = (binding: RawBinding, options?: LaunchOptions) => Promise<Browser>;
|
|
194
|
+
type BrowserRenderingConnect<RawBinding, Browser, ConnectOptions = unknown> = (binding: RawBinding, options?: ConnectOptions) => Promise<Browser>;
|
|
195
|
+
interface BrowserRenderingBrowserLike<Page = BrowserRenderingPageLike> {
|
|
196
|
+
readonly newPage: () => Promise<Page>;
|
|
197
|
+
readonly close?: () => Promise<void>;
|
|
198
|
+
readonly disconnect?: () => void;
|
|
199
|
+
readonly version?: () => Promise<string>;
|
|
200
|
+
}
|
|
201
|
+
interface BrowserRenderingPageLike {
|
|
202
|
+
readonly goto?: (url: string, options?: unknown) => Promise<unknown>;
|
|
203
|
+
readonly setContent?: (html: string, options?: unknown) => Promise<void>;
|
|
204
|
+
readonly content?: () => Promise<string>;
|
|
205
|
+
readonly screenshot?: (options?: unknown) => Promise<Uint8Array | string>;
|
|
206
|
+
readonly pdf?: (options?: unknown) => Promise<Uint8Array>;
|
|
207
|
+
readonly evaluate?: (pageFunction: unknown, ...args: ReadonlyArray<unknown>) => Promise<unknown>;
|
|
208
|
+
readonly close?: (options?: unknown) => Promise<void>;
|
|
209
|
+
}
|
|
210
|
+
interface BrowserRenderingPageClient<Page extends BrowserRenderingPageLike> {
|
|
211
|
+
readonly raw: Page;
|
|
212
|
+
readonly goto: (url: string, options?: Parameters<NonNullable<Page["goto"]>>[1]) => Effect.Effect<Awaited<ReturnType<NonNullable<Page["goto"]>>>, BrowserRenderingOperationError>;
|
|
213
|
+
readonly setContent: (html: string, options?: Parameters<NonNullable<Page["setContent"]>>[1]) => Effect.Effect<void, BrowserRenderingOperationError>;
|
|
214
|
+
readonly content: Effect.Effect<string, BrowserRenderingOperationError>;
|
|
215
|
+
readonly screenshot: <A = Uint8Array | string>(options?: Parameters<NonNullable<Page["screenshot"]>>[0]) => Effect.Effect<A, BrowserRenderingOperationError>;
|
|
216
|
+
readonly pdf: <A = Uint8Array>(options?: Parameters<NonNullable<Page["pdf"]>>[0]) => Effect.Effect<A, BrowserRenderingOperationError>;
|
|
217
|
+
readonly evaluate: <A = unknown>(pageFunction: Parameters<NonNullable<Page["evaluate"]>>[0], ...args: ReadonlyArray<unknown>) => Effect.Effect<A, BrowserRenderingOperationError>;
|
|
218
|
+
readonly close: (options?: Parameters<NonNullable<Page["close"]>>[0]) => Effect.Effect<void, BrowserRenderingOperationError>;
|
|
219
|
+
}
|
|
220
|
+
interface BrowserRenderingBrowserClient<Browser extends BrowserRenderingBrowserLike<Page>, Page extends BrowserRenderingPageLike> {
|
|
221
|
+
readonly raw: Browser;
|
|
222
|
+
readonly newPage: Effect.Effect<BrowserRenderingPageClient<Page>, BrowserRenderingOperationError>;
|
|
223
|
+
readonly version: Effect.Effect<string, BrowserRenderingOperationError>;
|
|
224
|
+
readonly close: Effect.Effect<void, BrowserRenderingOperationError>;
|
|
225
|
+
readonly disconnect: Effect.Effect<void, BrowserRenderingOperationError>;
|
|
226
|
+
}
|
|
227
|
+
interface BrowserRenderingClient<RawBinding extends BrowserRenderingBinding = BrowserRenderingBinding> {
|
|
228
|
+
readonly launchWith: <Browser extends BrowserRenderingBrowserLike<Page>, Page extends BrowserRenderingPageLike = BrowserRenderingPageLike, LaunchOptions = unknown>(launch: BrowserRenderingLaunch<RawBinding, Browser, LaunchOptions>, options?: LaunchOptions) => Effect.Effect<BrowserRenderingBrowserClient<Browser, Page>, BrowserRenderingOperationError>;
|
|
229
|
+
readonly connectWith: <Browser extends BrowserRenderingBrowserLike<Page>, Page extends BrowserRenderingPageLike = BrowserRenderingPageLike, ConnectOptions = unknown>(connect: BrowserRenderingConnect<RawBinding, Browser, ConnectOptions>, options?: ConnectOptions) => Effect.Effect<BrowserRenderingBrowserClient<Browser, Page>, BrowserRenderingOperationError>;
|
|
230
|
+
readonly unsafeRaw: Effect.Effect<RawBinding>;
|
|
231
|
+
readonly definition: BrowserRenderingDefinition;
|
|
232
|
+
}
|
|
233
|
+
declare const BrowserRenderingServiceTypeId: unique symbol;
|
|
234
|
+
/** Nominal service marker for Browser Rendering services created with {@link make}. */
|
|
235
|
+
interface BrowserRenderingService<Id extends string> {
|
|
236
|
+
readonly [BrowserRenderingServiceTypeId]: {
|
|
237
|
+
readonly id: Id;
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
type LayerOptions$15 = {
|
|
241
|
+
readonly binding: string;
|
|
242
|
+
};
|
|
243
|
+
interface TagClass$13<Self, Id extends string> extends Context.ServiceClass<Self, Id, BrowserRenderingClient> {
|
|
244
|
+
readonly id: Id;
|
|
245
|
+
readonly layer: (options: LayerOptions$15) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
246
|
+
}
|
|
247
|
+
declare const isBrowserRenderingBinding: (value: unknown) => value is BrowserRenderingBinding;
|
|
248
|
+
declare const makeClient$9: <RawBinding extends BrowserRenderingBinding = BrowserRenderingBinding>(definition: BrowserRenderingDefinition) => (binding: RawBinding) => BrowserRenderingClient<RawBinding>;
|
|
249
|
+
declare const layer$12: <Self>(tag: Context.Service<Self, BrowserRenderingClient>, definition: BrowserRenderingDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
250
|
+
declare const make$13: <Id extends string>(id: Id) => TagClass$13<BrowserRenderingService<Id>, Id>;
|
|
251
|
+
declare const Tag$14: <Self>() => <Id extends string>(id: Id) => TagClass$13<Self, Id>;
|
|
20
252
|
declare namespace DurableObjectStorage_d_exports {
|
|
21
253
|
export { DurableObjectStorage, DurableObjectTransaction, SchemaBackedSyncKvStorage, SqlCursor, SqlStorage, SqlStorageValue, StorageOperationError, SyncKvDefinition, SyncKvStorage, fromDurableObjectStorage };
|
|
22
254
|
}
|
|
@@ -319,121 +551,55 @@ declare class DurableObjectState extends DurableObjectState_base {}
|
|
|
319
551
|
*/
|
|
320
552
|
declare const fromDurableObjectState: (state: globalThis.DurableObjectState) => DurableObjectStateService;
|
|
321
553
|
declare namespace CloudflareOtlp_d_exports {
|
|
322
|
-
export {
|
|
554
|
+
export { DurableObjectLayerOptions, LayerOptions$14 as LayerOptions, ResourceOptions, Serialization, Signal, WorkerLayerOptions, durableObjectLayer, layer$11 as layer, layerJson, layerProtobuf, workerLayer };
|
|
323
555
|
}
|
|
324
556
|
/** Telemetry signal groups supported by the Cloudflare OTLP layers. */
|
|
325
557
|
type Signal = "logs" | "traces" | "metrics";
|
|
326
558
|
/** OTLP payload serialization used by the Effect OTLP exporters. */
|
|
327
559
|
type Serialization = "json" | "protobuf";
|
|
328
|
-
/**
|
|
329
|
-
* Resolved OpenTelemetry settings used by the Cloudflare OTLP layers.
|
|
330
|
-
*
|
|
331
|
-
* The default {@link settingsLayer} reads the standard OpenTelemetry
|
|
332
|
-
* environment variable names from `WorkerEnvironment`. Applications that use
|
|
333
|
-
* different binding names can provide {@link CloudflareOtlpSettings} directly
|
|
334
|
-
* with a custom layer.
|
|
335
|
-
*/
|
|
336
|
-
interface Settings {
|
|
337
|
-
/** Generic OTLP base endpoint, read from `OTEL_EXPORTER_OTLP_ENDPOINT`. */
|
|
338
|
-
readonly endpoint: Option.Option<string>;
|
|
339
|
-
/** Logs-specific OTLP endpoint, read from `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT`. */
|
|
340
|
-
readonly logsEndpoint: Option.Option<string>;
|
|
341
|
-
/** Traces-specific OTLP endpoint, read from `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`. */
|
|
342
|
-
readonly tracesEndpoint: Option.Option<string>;
|
|
343
|
-
/** Metrics-specific OTLP endpoint, read from `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`. */
|
|
344
|
-
readonly metricsEndpoint: Option.Option<string>;
|
|
345
|
-
/** Comma-separated OTLP headers, read from `OTEL_EXPORTER_OTLP_HEADERS`. */
|
|
346
|
-
readonly headers: Option.Option<string>;
|
|
347
|
-
/** Logs-specific OTLP headers, read from `OTEL_EXPORTER_OTLP_LOGS_HEADERS`. */
|
|
348
|
-
readonly logsHeaders: Option.Option<string>;
|
|
349
|
-
/** Traces-specific OTLP headers, read from `OTEL_EXPORTER_OTLP_TRACES_HEADERS`. */
|
|
350
|
-
readonly tracesHeaders: Option.Option<string>;
|
|
351
|
-
/** Metrics-specific OTLP headers, read from `OTEL_EXPORTER_OTLP_METRICS_HEADERS`. */
|
|
352
|
-
readonly metricsHeaders: Option.Option<string>;
|
|
353
|
-
/** Service name, read from `OTEL_SERVICE_NAME`. */
|
|
354
|
-
readonly serviceName: Option.Option<string>;
|
|
355
|
-
/** Service version, read from the effect-cf convenience alias `OTEL_SERVICE_VERSION`. */
|
|
356
|
-
readonly serviceVersion: Option.Option<string>;
|
|
357
|
-
/** Resource attributes, read from `OTEL_RESOURCE_ATTRIBUTES`. */
|
|
358
|
-
readonly resourceAttributes: Option.Option<Record<string, string>>;
|
|
359
|
-
}
|
|
360
|
-
/**
|
|
361
|
-
* Supported OpenTelemetry environment configuration for Cloudflare OTLP export.
|
|
362
|
-
*
|
|
363
|
-
* This config intentionally uses the conventional `OTEL_*` variable names so
|
|
364
|
-
* deployments can share the same settings used by other OpenTelemetry SDKs.
|
|
365
|
-
* It covers the OTLP HTTP settings supported by the Effect OTLP layers:
|
|
366
|
-
*
|
|
367
|
-
* - `OTEL_EXPORTER_OTLP_ENDPOINT`
|
|
368
|
-
* - `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT`
|
|
369
|
-
* - `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`
|
|
370
|
-
* - `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`
|
|
371
|
-
* - `OTEL_EXPORTER_OTLP_HEADERS`
|
|
372
|
-
* - `OTEL_EXPORTER_OTLP_LOGS_HEADERS`
|
|
373
|
-
* - `OTEL_EXPORTER_OTLP_TRACES_HEADERS`
|
|
374
|
-
* - `OTEL_EXPORTER_OTLP_METRICS_HEADERS`
|
|
375
|
-
* - `OTEL_SERVICE_NAME`
|
|
376
|
-
* - `OTEL_RESOURCE_ATTRIBUTES`
|
|
377
|
-
*
|
|
378
|
-
* `OTEL_SERVICE_VERSION` is also accepted as an effect-cf convenience alias.
|
|
379
|
-
* The standard OpenTelemetry way to configure service version is
|
|
380
|
-
* `OTEL_RESOURCE_ATTRIBUTES=service.version=...`.
|
|
381
|
-
*
|
|
382
|
-
* Consumers with non-standard binding names should map those names into
|
|
383
|
-
* {@link CloudflareOtlpSettings} rather than changing this config globally.
|
|
384
|
-
*/
|
|
385
|
-
declare const settingsConfig: Config.Config<{
|
|
386
|
-
endpoint: Option.Option<string>;
|
|
387
|
-
logsEndpoint: Option.Option<string>;
|
|
388
|
-
tracesEndpoint: Option.Option<string>;
|
|
389
|
-
metricsEndpoint: Option.Option<string>;
|
|
390
|
-
headers: Option.Option<string>;
|
|
391
|
-
logsHeaders: Option.Option<string>;
|
|
392
|
-
tracesHeaders: Option.Option<string>;
|
|
393
|
-
metricsHeaders: Option.Option<string>;
|
|
394
|
-
serviceName: Option.Option<string>;
|
|
395
|
-
serviceVersion: Option.Option<string>;
|
|
396
|
-
resourceAttributes: Option.Option<{
|
|
397
|
-
readonly [x: string]: string;
|
|
398
|
-
}>;
|
|
399
|
-
}>;
|
|
400
|
-
declare const CloudflareOtlpSettings_base: Context.ServiceClass<CloudflareOtlpSettings, "effect-cf/CloudflareOtlpSettings", Settings>;
|
|
401
|
-
/**
|
|
402
|
-
* Service carrying already-resolved Cloudflare OTLP settings.
|
|
403
|
-
*
|
|
404
|
-
* Provide this service directly when an application needs to map custom
|
|
405
|
-
* Cloudflare binding names, compute settings dynamically, or override settings
|
|
406
|
-
* in tests. When this service is present, the OTLP layers use it instead of
|
|
407
|
-
* reading {@link settingsConfig}.
|
|
408
|
-
*
|
|
409
|
-
* @example
|
|
410
|
-
* ```ts
|
|
411
|
-
* const CustomOtlpSettings = Layer.effect(
|
|
412
|
-
* CloudflareOtlp.CloudflareOtlpSettings,
|
|
413
|
-
* Config.all({
|
|
414
|
-
* ...CloudflareOtlp.settingsConfig,
|
|
415
|
-
* endpoint: Config.string("MY_OTLP_ENDPOINT").pipe(Config.option),
|
|
416
|
-
* }),
|
|
417
|
-
* ).pipe(Layer.provide(WorkerConfig.layer));
|
|
418
|
-
* ```
|
|
419
|
-
*/
|
|
420
|
-
declare class CloudflareOtlpSettings extends CloudflareOtlpSettings_base {}
|
|
421
560
|
/** Resource metadata shared by Worker and Durable Object OTLP layers. */
|
|
422
561
|
interface ResourceOptions {
|
|
423
|
-
/** Explicit service name.
|
|
562
|
+
/** Explicit service name. OTEL resource environment variables take precedence. */
|
|
424
563
|
readonly serviceName?: string;
|
|
425
|
-
/** Explicit service version.
|
|
564
|
+
/** Explicit service version. OTEL resource environment variables take precedence. */
|
|
426
565
|
readonly serviceVersion?: string;
|
|
427
|
-
/** Additional resource attributes attached to
|
|
566
|
+
/** Additional resource attributes attached to exported telemetry. */
|
|
428
567
|
readonly attributes?: Record<string, unknown>;
|
|
429
568
|
}
|
|
569
|
+
/** Options shared by all Cloudflare OTLP telemetry layers. */
|
|
570
|
+
interface LayerOptions$14 {
|
|
571
|
+
/**
|
|
572
|
+
* Telemetry signals to export. Defaults to logs, traces, and metrics.
|
|
573
|
+
*
|
|
574
|
+
* Each selected signal is still controlled by standard OTEL exporter config,
|
|
575
|
+
* such as `OTEL_TRACES_EXPORTER=otlp`.
|
|
576
|
+
*/
|
|
577
|
+
readonly signals?: ReadonlyArray<Signal>;
|
|
578
|
+
/** OTLP payload serialization. Defaults to protobuf. */
|
|
579
|
+
readonly serialization?: Serialization;
|
|
580
|
+
/** Resource metadata forwarded to Effect's OTLP resource resolver. */
|
|
581
|
+
readonly resource?: ResourceOptions;
|
|
582
|
+
/**
|
|
583
|
+
* Explicit headers for every selected signal.
|
|
584
|
+
*
|
|
585
|
+
* When omitted, Effect reads `OTEL_EXPORTER_OTLP_HEADERS` and the
|
|
586
|
+
* signal-specific `OTEL_EXPORTER_OTLP_*_HEADERS` variables.
|
|
587
|
+
*/
|
|
588
|
+
readonly headers?: Headers$1.Input;
|
|
589
|
+
/** Exclude log records emitted for spans when exporting logs. */
|
|
590
|
+
readonly loggerExcludeLogSpans?: boolean;
|
|
591
|
+
/** Merge the OTLP logger with existing loggers instead of replacing them. */
|
|
592
|
+
readonly loggerMergeWithExisting?: boolean;
|
|
593
|
+
/** Custom trace context lookup used by the Effect OTLP tracer. */
|
|
594
|
+
readonly tracerContext?: <X>(primitive: Tracer.EffectPrimitive<X>, span: Tracer.AnySpan) => X;
|
|
595
|
+
}
|
|
430
596
|
/** Resource metadata specific to Cloudflare Workers. */
|
|
431
|
-
interface
|
|
597
|
+
interface WorkerLayerOptions extends LayerOptions$14 {
|
|
432
598
|
/** Cloudflare Worker name to attach as `cloudflare.worker.name`. */
|
|
433
599
|
readonly workerName?: string;
|
|
434
600
|
}
|
|
435
601
|
/** Resource metadata specific to Cloudflare Durable Objects. */
|
|
436
|
-
interface
|
|
602
|
+
interface DurableObjectLayerOptions extends LayerOptions$14 {
|
|
437
603
|
/** Durable Object class name to attach as `cloudflare.durable_object.class`. */
|
|
438
604
|
readonly className?: string;
|
|
439
605
|
/**
|
|
@@ -443,64 +609,26 @@ interface DurableObjectResourceOptions extends ResourceOptions {
|
|
|
443
609
|
*/
|
|
444
610
|
readonly includeObjectId?: boolean;
|
|
445
611
|
}
|
|
446
|
-
/** Options shared by all Cloudflare OTLP telemetry layers. */
|
|
447
|
-
interface LayerOptions$12 extends ResourceOptions {
|
|
448
|
-
/** Telemetry signals to export. Defaults to logs, traces, and metrics. */
|
|
449
|
-
readonly signals?: ReadonlyArray<Signal>;
|
|
450
|
-
/** OTLP payload serialization. Defaults to protobuf. */
|
|
451
|
-
readonly serialization?: Serialization;
|
|
452
|
-
/** Maximum batch size for log and trace exporters. */
|
|
453
|
-
readonly maxBatchSize?: number;
|
|
454
|
-
/** Maximum time to wait for exporter shutdown/flush when a scope closes. */
|
|
455
|
-
readonly shutdownTimeout?: Duration$1.Input;
|
|
456
|
-
/** Export interval for the logs exporter. */
|
|
457
|
-
readonly loggerExportInterval?: Duration$1.Input;
|
|
458
|
-
/** Exclude log records emitted for spans when exporting logs. */
|
|
459
|
-
readonly loggerExcludeLogSpans?: boolean;
|
|
460
|
-
/** Merge the OTLP logger with existing loggers instead of replacing them. */
|
|
461
|
-
readonly loggerMergeWithExisting?: boolean;
|
|
462
|
-
/** Export interval for the traces exporter. */
|
|
463
|
-
readonly tracerExportInterval?: Duration$1.Input;
|
|
464
|
-
/** Custom trace context lookup used by the Effect OTLP tracer. */
|
|
465
|
-
readonly tracerContext?: <X>(primitive: Tracer.EffectPrimitive<X>, span: Tracer.AnySpan) => X;
|
|
466
|
-
/** Export interval for the metrics exporter. */
|
|
467
|
-
readonly metricsExportInterval?: Duration$1.Input;
|
|
468
|
-
/** Aggregation temporality for exported metrics. */
|
|
469
|
-
readonly metricsTemporality?: OtlpMetrics.AggregationTemporality;
|
|
470
|
-
}
|
|
471
|
-
/**
|
|
472
|
-
* Layer that reads standard OpenTelemetry settings from the current Cloudflare
|
|
473
|
-
* `env` object.
|
|
474
|
-
*
|
|
475
|
-
* The layer depends on {@link WorkerEnvironment} and installs a
|
|
476
|
-
* Cloudflare-backed Effect `ConfigProvider`, so `settingsConfig` reads from
|
|
477
|
-
* Worker vars/secrets instead of Node process environment variables.
|
|
478
|
-
*/
|
|
479
|
-
declare const settingsLayer: Layer.Layer<CloudflareOtlpSettings, Config.ConfigError, WorkerEnvironment>;
|
|
480
612
|
/**
|
|
481
613
|
* Base OTLP telemetry layer for Cloudflare-compatible runtimes.
|
|
482
614
|
*
|
|
483
|
-
*
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
*
|
|
487
|
-
* When only `OTEL_EXPORTER_OTLP_ENDPOINT` is configured, per-signal paths are
|
|
488
|
-
* derived by appending `/v1/logs`, `/v1/traces`, and `/v1/metrics`. Signal
|
|
489
|
-
* specific endpoints are used as-is, matching the OpenTelemetry OTLP exporter
|
|
490
|
-
* convention.
|
|
615
|
+
* Standard OpenTelemetry environment variables are resolved by Effect's OTLP
|
|
616
|
+
* layers. In Cloudflare Workers and Durable Objects, the current `env` object is
|
|
617
|
+
* installed as the primary `ConfigProvider`; outside Cloudflare, the ambient
|
|
618
|
+
* Effect `ConfigProvider` remains the fallback.
|
|
491
619
|
*/
|
|
492
|
-
declare const layer$
|
|
620
|
+
declare const layer$11: (options?: LayerOptions$14) => Layer.Layer<never, never, never>;
|
|
493
621
|
/** Base OTLP telemetry layer forced to JSON serialization. */
|
|
494
|
-
declare const layerJson: (options?: Omit<LayerOptions$
|
|
622
|
+
declare const layerJson: (options?: Omit<LayerOptions$14, "serialization">) => Layer.Layer<never, never, never>;
|
|
495
623
|
/** Base OTLP telemetry layer forced to protobuf serialization. */
|
|
496
|
-
declare const layerProtobuf: (options?: Omit<LayerOptions$
|
|
624
|
+
declare const layerProtobuf: (options?: Omit<LayerOptions$14, "serialization">) => Layer.Layer<never, never, never>;
|
|
497
625
|
/**
|
|
498
626
|
* OTLP layer with Cloudflare Worker resource attributes.
|
|
499
627
|
*
|
|
500
628
|
* Provide this layer at runtime scope for long-lived metrics aggregation, or at
|
|
501
629
|
* handler scope when traces/logs should flush as the Cloudflare event finishes.
|
|
502
630
|
*/
|
|
503
|
-
declare const workerLayer: (options?:
|
|
631
|
+
declare const workerLayer: (options?: WorkerLayerOptions) => Layer.Layer<never, never, never>;
|
|
504
632
|
/**
|
|
505
633
|
* OTLP layer with Cloudflare Durable Object resource attributes.
|
|
506
634
|
*
|
|
@@ -508,9 +636,9 @@ declare const workerLayer: (options?: LayerOptions$12 & WorkerResourceOptions) =
|
|
|
508
636
|
* Durable Object id. Prefer leaving `includeObjectId` disabled unless the
|
|
509
637
|
* backend can tolerate high-cardinality resource attributes.
|
|
510
638
|
*/
|
|
511
|
-
declare const durableObjectLayer: (options?:
|
|
639
|
+
declare const durableObjectLayer: (options?: DurableObjectLayerOptions) => Layer.Layer<never, never, DurableObjectState>;
|
|
512
640
|
declare namespace D1_d_exports {
|
|
513
|
-
export { D1Definition, D1Service, D1SqlLayerOptions, Service$1 as Service, make$
|
|
641
|
+
export { D1Definition, D1Service, D1SqlLayerOptions, Service$1 as Service, make$12 as make };
|
|
514
642
|
}
|
|
515
643
|
/** Typed D1 binding definition. */
|
|
516
644
|
interface D1Definition {
|
|
@@ -529,7 +657,7 @@ interface D1Service<Id extends string> {
|
|
|
529
657
|
/**
|
|
530
658
|
* Creates a typed D1 service tag plus Effect helpers.
|
|
531
659
|
*/
|
|
532
|
-
declare const make$
|
|
660
|
+
declare const make$12: <Id extends string>(id: Id, definition: D1Definition) => BindingService<D1Service<Id>, Id, D1Database> & {
|
|
533
661
|
"effect-cf/D1": "effect-cf/D1";
|
|
534
662
|
definition: D1Definition;
|
|
535
663
|
sqlLayer: (options?: D1SqlLayerOptions) => Layer.Layer<D1Client.D1Client | _$effect_unstable_sql_SqlClient0.SqlClient, BindingNotFoundError | BindingValidationError | _$effect_Config0.ConfigError, WorkerEnvironment>;
|
|
@@ -579,7 +707,7 @@ declare const dispose: (value: unknown) => Effect.Effect<void>;
|
|
|
579
707
|
declare const resolve: <A>(value: A) => Effect.Effect<Awaited<A>, unknown>;
|
|
580
708
|
declare const scoped: <A>(value: A) => Effect.Effect<Awaited<A>, unknown, Scope.Scope>;
|
|
581
709
|
declare namespace RpcDefinition_d_exports {
|
|
582
|
-
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$
|
|
710
|
+
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 };
|
|
583
711
|
}
|
|
584
712
|
declare const RpcReservedMethodNameError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
585
713
|
readonly _tag: "RpcReservedMethodNameError";
|
|
@@ -678,17 +806,17 @@ declare const decodeArgs: <const Self extends Definition$9.Any, MethodName exten
|
|
|
678
806
|
declare const encodeArgs: <const Self extends Definition$9.Any, MethodName extends Definition$9.MethodNames<Self>>(definition: Self, methodName: MethodName, args: Method$5.Args<Self["methods"][MethodName]>) => Effect.Effect<Method$5.EncodedArgs<Self["methods"][MethodName]>, RpcArgumentCountError | RpcArgumentEncodeError>;
|
|
679
807
|
declare const encodeSuccess: <const Self extends Definition$9.Any, MethodName extends Definition$9.MethodNames<Self>>(definition: Self, methodName: MethodName, value: Method$5.Success<Self["methods"][MethodName]>) => Effect.Effect<Method$5.EncodedSuccess<Self["methods"][MethodName]>, RpcSuccessEncodeError>;
|
|
680
808
|
declare const decodeSuccess: <const Self extends Definition$9.Any, MethodName extends Definition$9.MethodNames<Self>>(definition: Self, methodName: MethodName, value: unknown) => Effect.Effect<Method$5.Success<Self["methods"][MethodName]>, RpcSuccessDecodeError>;
|
|
681
|
-
declare const make$
|
|
809
|
+
declare const make$11: <Id extends string, const MethodsShape extends Methods$4>(id: Id, methods: MethodsShape) => Definition$9<Id, MethodsShape>;
|
|
682
810
|
declare namespace QueueBinding_d_exports {
|
|
683
|
-
export { MessageSendRequest, QueueBindingClient, QueueBindingDefinition, QueueMetrics, QueueOperationError, QueueProducer, QueueSendBatchOptions, QueueSendBatchResponse, QueueSendOptions, QueueSendResponse, isQueue, layer$
|
|
684
|
-
}
|
|
685
|
-
type QueueSendOptions =
|
|
686
|
-
type QueueSendResponse =
|
|
687
|
-
type QueueSendBatchOptions =
|
|
688
|
-
type QueueSendBatchResponse =
|
|
689
|
-
type QueueMetrics =
|
|
690
|
-
type MessageSendRequest<Body> =
|
|
691
|
-
type QueueProducer<Body> = Pick<
|
|
811
|
+
export { MessageSendRequest, QueueBindingClient, QueueBindingDefinition, QueueMetrics, QueueOperationError, QueueProducer, QueueSendBatchOptions, QueueSendBatchResponse, QueueSendOptions, QueueSendResponse, isQueue, layer$10 as layer, makeClient$8 as makeClient };
|
|
812
|
+
}
|
|
813
|
+
type QueueSendOptions = CloudflareQueueSendOptions;
|
|
814
|
+
type QueueSendResponse = CloudflareQueueSendResponse;
|
|
815
|
+
type QueueSendBatchOptions = CloudflareQueueSendBatchOptions;
|
|
816
|
+
type QueueSendBatchResponse = CloudflareQueueSendBatchResponse;
|
|
817
|
+
type QueueMetrics = CloudflareQueueMetrics;
|
|
818
|
+
type MessageSendRequest<Body> = CloudflareMessageSendRequest<Body>;
|
|
819
|
+
type QueueProducer<Body> = Pick<CloudflareQueue<Body>, "send"> & Partial<Pick<CloudflareQueue<Body>, "sendBatch" | "metrics">>;
|
|
692
820
|
interface QueueBindingDefinition<Message extends ServiceFreeSchema$4> {
|
|
693
821
|
/** Binding name as configured in `wrangler.jsonc`. */
|
|
694
822
|
readonly binding: string;
|
|
@@ -699,7 +827,7 @@ interface QueueBindingClient<Message extends ServiceFreeSchema$4> {
|
|
|
699
827
|
readonly send: (message: Schema.Schema.Type<Message>, options?: QueueSendOptions) => Effect.Effect<void, QueueOperationError | Schema.SchemaError>;
|
|
700
828
|
readonly sendBatch: (messages: Iterable<MessageSendRequest<Schema.Schema.Type<Message>>>, options?: QueueSendBatchOptions) => Effect.Effect<void, QueueOperationError | Schema.SchemaError>;
|
|
701
829
|
readonly metrics: () => Effect.Effect<QueueMetrics, QueueOperationError>;
|
|
702
|
-
readonly unsafeRaw: Effect.Effect<
|
|
830
|
+
readonly unsafeRaw: Effect.Effect<CloudflareQueue<Schema.Codec.Encoded<Message>>>;
|
|
703
831
|
}
|
|
704
832
|
declare const QueueOperationError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
705
833
|
readonly _tag: "QueueOperationError";
|
|
@@ -711,10 +839,10 @@ declare class QueueOperationError extends QueueOperationError_base<{
|
|
|
711
839
|
readonly message: string;
|
|
712
840
|
}> {}
|
|
713
841
|
declare const isQueue: <Body>(value: unknown) => value is QueueProducer<Body>;
|
|
714
|
-
declare const makeClient$
|
|
715
|
-
declare const layer$
|
|
842
|
+
declare const makeClient$8: <Message extends ServiceFreeSchema$4>(definition: QueueBindingDefinition<Message>) => ((queue: QueueProducer<Schema.Codec.Encoded<Message>>) => QueueBindingClient<Message>);
|
|
843
|
+
declare const layer$10: <Self, Message extends ServiceFreeSchema$4>(tag: Context.Service<Self, QueueBindingClient<Message>>, definition: QueueBindingDefinition<Message>) => _$effect_Layer0.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
716
844
|
declare namespace QueueDefinition_d_exports {
|
|
717
|
-
export { Definition$8 as Definition, Handler$3 as Handler, LayerOptions$
|
|
845
|
+
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 };
|
|
718
846
|
}
|
|
719
847
|
interface Definition$8<Id extends string = string, Message extends ServiceFreeSchema$4 = ServiceFreeSchema$4> {
|
|
720
848
|
readonly id: Id;
|
|
@@ -728,31 +856,31 @@ interface Options$7<ROut, Self extends Definition$8.Any> extends Omit<WorkerOpti
|
|
|
728
856
|
readonly queue: Handler$3<ROut, Self>;
|
|
729
857
|
readonly rpc?: never;
|
|
730
858
|
}
|
|
731
|
-
type LayerOptions$
|
|
859
|
+
type LayerOptions$13 = {
|
|
732
860
|
readonly binding: string;
|
|
733
861
|
};
|
|
734
|
-
interface TagClass$
|
|
862
|
+
interface TagClass$12<Self, Id extends string, Message extends ServiceFreeSchema$4> extends Context.ServiceClass<Self, Id, QueueBindingClient<Message>> {
|
|
735
863
|
readonly id: Id;
|
|
736
864
|
readonly message: Message;
|
|
737
865
|
readonly make: <ROut, LayerError>(layer: Layer.Layer<ROut, LayerError, ExecutionContext | WorkerContext | WorkerEnvironment>, options: Options$7<ROut, Definition$8<Id, Message>>) => WorkerClass<Record<never, never>, ROut>;
|
|
738
|
-
readonly layer: (options: LayerOptions$
|
|
866
|
+
readonly layer: (options: LayerOptions$13) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
739
867
|
readonly send: (message: Schema.Schema.Type<Message>, options?: QueueSendOptions) => Effect.Effect<void, QueueOperationError | Schema.SchemaError, Self>;
|
|
740
868
|
readonly sendBatch: (messages: Iterable<MessageSendRequest<Schema.Schema.Type<Message>>>, options?: QueueSendBatchOptions) => Effect.Effect<void, QueueOperationError | Schema.SchemaError, Self>;
|
|
741
869
|
readonly metrics: () => Effect.Effect<QueueMetrics, QueueOperationError, Self>;
|
|
742
870
|
readonly unsafeRaw: () => Effect.Effect<globalThis.Queue<Schema.Codec.Encoded<Message>>, never, Self>;
|
|
743
871
|
}
|
|
744
|
-
declare const make$
|
|
872
|
+
declare const make$10: <Id extends string, Message extends ServiceFreeSchema$4>(id: Id, definition: {
|
|
745
873
|
readonly message: Message;
|
|
746
|
-
}) => TagClass$
|
|
747
|
-
declare const Tag$
|
|
874
|
+
}) => TagClass$12<Definition$8<Id, Message>, Id, Message>;
|
|
875
|
+
declare const Tag$13: <Self>() => <Id extends string, Message extends ServiceFreeSchema$4>(id: Id, definition: {
|
|
748
876
|
readonly message: Message;
|
|
749
|
-
}) => TagClass$
|
|
877
|
+
}) => TagClass$12<Self, Id, Message>;
|
|
750
878
|
declare const Queue$1: <Self>() => <Id extends string, Message extends ServiceFreeSchema$4>(id: Id, definition: {
|
|
751
879
|
readonly message: Message;
|
|
752
|
-
}) => TagClass$
|
|
880
|
+
}) => TagClass$12<Self, Id, Message>;
|
|
753
881
|
declare const implement$7: <ROut, const Self extends Definition$8.Any>(_definition: Self, handler: Handler$3<ROut, Self>) => Handler$3<ROut, Self>;
|
|
754
882
|
declare namespace Queue_d_exports {
|
|
755
|
-
export { Definition$7 as Definition, Handler$2 as Handler, LayerOptions$
|
|
883
|
+
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 };
|
|
756
884
|
}
|
|
757
885
|
interface QueueMessage<Body> {
|
|
758
886
|
readonly raw: globalThis.Message<unknown>;
|
|
@@ -801,16 +929,16 @@ type Definition$7<Id extends string = string, Message extends Definition$8.Any["
|
|
|
801
929
|
declare namespace Definition$7 {
|
|
802
930
|
type Any = Definition$8.Any;
|
|
803
931
|
}
|
|
804
|
-
type LayerOptions$
|
|
805
|
-
type TagClass$
|
|
806
|
-
declare const Tag$
|
|
932
|
+
type LayerOptions$12 = LayerOptions$13;
|
|
933
|
+
type TagClass$11<Self, Id extends string, Message extends Definition$8.Any["message"]> = TagClass$12<Self, Id, Message>;
|
|
934
|
+
declare const Tag$12: <Self>() => <Id extends string, Message extends Definition$8.Any["message"]>(id: Id, definition: {
|
|
807
935
|
readonly message: Message;
|
|
808
|
-
}) => TagClass$
|
|
936
|
+
}) => TagClass$11<Self, Id, Message>;
|
|
809
937
|
declare const implement$6: <ROut, const Self extends Definition$8.Any>(_definition: Self, handler: Handler$3<ROut, Self>) => Handler$3<ROut, Self>;
|
|
810
938
|
type Handler$2<ROut, Self extends Definition$8.Any> = Handler$3<ROut, Self>;
|
|
811
939
|
type Options$6<ROut, Self extends Definition$8.Any> = Options$7<ROut, Self>;
|
|
812
940
|
declare namespace WorkerDefinition_d_exports {
|
|
813
|
-
export { Api$3 as Api, Definition$6 as Definition, HandlerEffect$3 as HandlerEffect, Handlers$3 as Handlers, LayerOptions$
|
|
941
|
+
export { Api$3 as Api, Definition$6 as Definition, HandlerEffect$3 as HandlerEffect, Handlers$3 as Handlers, LayerOptions$11 as LayerOptions, Method$4 as Method, Methods$3 as Methods, NoReservedMethods$3 as NoReservedMethods, Options$5 as Options, ReservedMethodName$5 as ReservedMethodName, ServerApi$4 as ServerApi, ServiceFreeSchema$3 as ServiceFreeSchema, Tag$11 as Tag, TagClass$10 as TagClass, Worker, implement$5 as implement, make$9 as make, method$3 as method };
|
|
814
942
|
}
|
|
815
943
|
type ServiceFreeSchema$3 = Schema.Codec<any, any, never, never>;
|
|
816
944
|
interface Method$4<Args extends ReadonlyArray<ServiceFreeSchema$3> = ReadonlyArray<ServiceFreeSchema$3>, Success extends ServiceFreeSchema$3 = ServiceFreeSchema$3> {
|
|
@@ -858,14 +986,14 @@ type Handlers$3<ROut, Self extends Definition$6.Any> = { readonly [Key in keyof
|
|
|
858
986
|
interface Options$5<ROut, Self extends Definition$6.Any, REvent = never, EventLayerError = never> extends Omit<WorkerOptions<ROut, REvent, EventLayerError, Handlers$3<ROut | REvent, Self>>, "rpc"> {
|
|
859
987
|
readonly rpc: Handlers$3<ROut | REvent, Self>;
|
|
860
988
|
}
|
|
861
|
-
type LayerOptions$
|
|
989
|
+
type LayerOptions$11 = {
|
|
862
990
|
readonly binding: string;
|
|
863
991
|
};
|
|
864
|
-
type TagClass$
|
|
992
|
+
type TagClass$10<Self, Id extends string, MethodsShape extends Methods$3> = Context.ServiceClass<Self, Id, ServiceBindingEffectClient<Api$3<Definition$6<Id, MethodsShape>>, Definition$6<Id, MethodsShape>>> & ServiceBindingStaticClient<Self, Api$3<Definition$6<Id, MethodsShape>>, Definition$6<Id, MethodsShape>> & {
|
|
865
993
|
readonly id: Id;
|
|
866
994
|
readonly methods: MethodsShape;
|
|
867
995
|
readonly make: <ROut, LayerError, REvent = never, EventLayerError = never>(layer: Layer.Layer<ROut, LayerError, ExecutionContext | WorkerContext | WorkerEnvironment>, options: Options$5<ROut, Definition$6<Id, MethodsShape>, REvent, EventLayerError>) => WorkerClass<Handlers$3<ROut | REvent, Definition$6<Id, MethodsShape>>, ROut | REvent>;
|
|
868
|
-
readonly layer: (options: LayerOptions$
|
|
996
|
+
readonly layer: (options: LayerOptions$11) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
869
997
|
};
|
|
870
998
|
/**
|
|
871
999
|
* Defines a single RPC method schema in a worker definition.
|
|
@@ -879,9 +1007,9 @@ declare const method$3: {
|
|
|
879
1007
|
readonly success: Success;
|
|
880
1008
|
}): Method$4<Args, Success>;
|
|
881
1009
|
};
|
|
882
|
-
declare const make$
|
|
883
|
-
declare const Tag$
|
|
884
|
-
declare const Worker: <Self>() => <Id extends string, const MethodsShape extends Methods$3>(id: Id, methods: MethodsShape & NoReservedMethods$3<MethodsShape>) => TagClass$
|
|
1010
|
+
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>;
|
|
1011
|
+
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>;
|
|
1012
|
+
declare const Worker: <Self>() => <Id extends string, const MethodsShape extends Methods$3>(id: Id, methods: MethodsShape & NoReservedMethods$3<MethodsShape>) => TagClass$10<Self, Id, MethodsShape>;
|
|
885
1013
|
/**
|
|
886
1014
|
* Helper for implementing handlers with the exact method shape of a definition.
|
|
887
1015
|
*/
|
|
@@ -898,7 +1026,7 @@ type AsyncMethodArgs<Api, Method extends keyof Api> = Api[Method] extends ((...a
|
|
|
898
1026
|
type AsyncMethodSuccess<Api, Method extends keyof Api> = Api[Method] extends ((...args: AnyArgs) => Promise<infer A>) ? A : never;
|
|
899
1027
|
type AsyncMethodCloudflareReturn<Api, Method extends keyof Api> = Result<AsyncMethodSuccess<Api, Method>>;
|
|
900
1028
|
declare namespace ServiceBinding_d_exports {
|
|
901
|
-
export { Service, ServiceBindingClient, ServiceBindingDefinition, ServiceBindingEffectClient, ServiceBindingFetchError, ServiceBindingRpcError, ServiceBindingStaticClient, ServiceFetcher, isServiceBindingClient, layer$
|
|
1029
|
+
export { Service, ServiceBindingClient, ServiceBindingDefinition, ServiceBindingEffectClient, ServiceBindingFetchError, ServiceBindingRpcError, ServiceBindingStaticClient, ServiceFetcher, isServiceBindingClient, layer$9 as layer, makeClient$7 as makeClient, makeDirectMethods$1 as makeDirectMethods };
|
|
902
1030
|
}
|
|
903
1031
|
declare const TypeId$1: "effect-cf/ServiceBinding";
|
|
904
1032
|
/**
|
|
@@ -1044,8 +1172,8 @@ type ServiceBindingStaticClient<R, Api extends object, Definition extends Defini
|
|
|
1044
1172
|
readonly scopedCall: <Method extends ServiceMethodKey<Api>>(method: Method, ...args: ServiceMethodArgs<Api, Method>) => Effect.Effect<Awaited<ServiceMethodSuccess<Api, Method>>, unknown, Scope.Scope | R>;
|
|
1045
1173
|
};
|
|
1046
1174
|
declare const isServiceBindingClient: <Api extends object>(value: unknown) => value is ServiceBindingClient<Api>;
|
|
1047
|
-
declare const makeClient$
|
|
1048
|
-
declare const layer$
|
|
1175
|
+
declare const makeClient$7: <Api extends object, const Definition extends Definition$6.Any | undefined = undefined>(definition: ServiceBindingDefinition<Definition>) => ((service: ServiceBindingClient<Api>) => ServiceBindingEffectClient<Api, Definition>);
|
|
1176
|
+
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>) => _$effect_Layer0.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1049
1177
|
/**
|
|
1050
1178
|
* Creates a typed Effect service for a Worker service binding.
|
|
1051
1179
|
*
|
|
@@ -1085,7 +1213,7 @@ declare const Service: <Self, Api extends object = never>() => <Id extends strin
|
|
|
1085
1213
|
};
|
|
1086
1214
|
declare const makeDirectMethods$1: <R, Api, Definition extends Definition$6.Any | undefined>(rpcDefinition: Definition | undefined, call: ServiceCall<R, Api>) => DirectMethods$1<R, Definition>;
|
|
1087
1215
|
declare namespace Worker_d_exports {
|
|
1088
|
-
export { Api$2 as Api, Definition$5 as Definition, ExecutionContext, FetchHandler, FetchWorkerOptions, HandlerEffect$2 as HandlerEffect, Handlers$2 as Handlers, LayerOptions$
|
|
1216
|
+
export { Api$2 as Api, Definition$5 as Definition, ExecutionContext, FetchHandler, FetchWorkerOptions, HandlerEffect$2 as HandlerEffect, Handlers$2 as Handlers, LayerOptions$10 as LayerOptions, Method$3 as Method, Methods$2 as Methods, NativeRequest, NoReservedMethods$2 as NoReservedMethods, Options$4 as Options, ReservedMethodName$3 as ReservedMethodName, RpcHandlers$1 as RpcHandlers, ServerApi$3 as ServerApi, ServiceFreeSchema$2 as ServiceFreeSchema, Tag$10 as Tag, TagClass$9 as TagClass, TagFactory$1 as TagFactory, WorkerClass, WorkerContext, WorkerContextService, WorkerContextWaitUntilOptions, WorkerFetchSuccess, WorkerHandler, WorkerOptions, WorkerRpc, WorkerRpcHandler, WorkerRpcShape, implement$4 as implement, isWebSocketUpgrade, make$8 as make, makeFetchHandler, method$2 as method, renderHttpResponse };
|
|
1089
1217
|
}
|
|
1090
1218
|
declare const ExecutionContext_base: Context.ServiceClass<ExecutionContext, "effect-cf/ExecutionContext", globalThis.ExecutionContext<unknown>>;
|
|
1091
1219
|
declare class ExecutionContext extends ExecutionContext_base {}
|
|
@@ -1138,8 +1266,8 @@ interface FetchHandler<Env extends WorkerEnv = WorkerEnv> {
|
|
|
1138
1266
|
readonly fetch: (request: Request, env: Env, ctx: globalThis.ExecutionContext) => Promise<Response>;
|
|
1139
1267
|
}
|
|
1140
1268
|
declare const renderHttpResponse: <A extends HttpServerResponse.HttpServerResponse, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<Response, E, R>;
|
|
1141
|
-
declare function make$
|
|
1142
|
-
declare function make$
|
|
1269
|
+
declare function make$8<ROut, LayerError>(layer: Layer.Layer<ROut, LayerError, ExecutionContext | WorkerContext | WorkerEnvironment>, fetch: WorkerHandler<ROut>): WorkerClass<Record<never, never>, ROut>;
|
|
1270
|
+
declare function make$8<ROut, LayerError, REvent = never, EventLayerError = never, const Rpc extends WorkerRpc<ROut | REvent> = Record<never, never>>(layer: Layer.Layer<ROut, LayerError, ExecutionContext | WorkerContext | WorkerEnvironment>, options: WorkerOptions<ROut, REvent, EventLayerError, Rpc>): WorkerClass<Rpc, ROut | REvent>;
|
|
1143
1271
|
declare const makeFetchHandler: <ROut, LayerError, REvent = never, EventLayerError = never, Env extends WorkerEnv = WorkerEnv>(layer: Layer.Layer<ROut, LayerError, ExecutionContext | WorkerContext | WorkerEnvironment>, options: FetchWorkerOptions<ROut, REvent, EventLayerError>) => FetchHandler<Env>;
|
|
1144
1272
|
type ServiceFreeSchema$2 = Schema.Codec<any, any, never, never>;
|
|
1145
1273
|
interface Method$3<Args extends ReadonlyArray<ServiceFreeSchema$2> = ReadonlyArray<ServiceFreeSchema$2>, Success extends ServiceFreeSchema$2 = ServiceFreeSchema$2> {
|
|
@@ -1168,15 +1296,15 @@ type Handlers$2<ROut, Self extends Definition$5.Any> = { readonly [Key in keyof
|
|
|
1168
1296
|
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"> {
|
|
1169
1297
|
readonly rpc: Handlers$2<ROut | REvent, Self>;
|
|
1170
1298
|
}
|
|
1171
|
-
type LayerOptions$
|
|
1172
|
-
type TagClass$
|
|
1299
|
+
type LayerOptions$10 = LayerOptions$11;
|
|
1300
|
+
type TagClass$9<Self, Id extends string, MethodsShape extends Methods$2> = Context.ServiceClass<Self, Id, ServiceBindingEffectClient<Api$2<Definition$5<Id, MethodsShape>>, Definition$5<Id, MethodsShape>>> & ServiceBindingStaticClient<Self, Api$2<Definition$5<Id, MethodsShape>>, Definition$5<Id, MethodsShape>> & {
|
|
1173
1301
|
readonly id: Id;
|
|
1174
1302
|
readonly methods: MethodsShape;
|
|
1175
1303
|
readonly make: <ROut, LayerError, REvent = never, EventLayerError = never>(layer: Layer.Layer<ROut, LayerError, ExecutionContext | WorkerContext | WorkerEnvironment>, options: Options$4<ROut, Definition$5<Id, MethodsShape>, REvent, EventLayerError>) => WorkerClass<Handlers$2<ROut | REvent, Definition$5<Id, MethodsShape>>, ROut | REvent>;
|
|
1176
|
-
readonly layer: (options: LayerOptions$
|
|
1304
|
+
readonly layer: (options: LayerOptions$10) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1177
1305
|
};
|
|
1178
|
-
type TagFactory$1 = <Self>() => <Id extends string, const MethodsShape extends Methods$2>(id: Id, methods: MethodsShape & NoReservedMethods$2<MethodsShape>) => TagClass$
|
|
1179
|
-
declare const Tag$
|
|
1306
|
+
type TagFactory$1 = <Self>() => <Id extends string, const MethodsShape extends Methods$2>(id: Id, methods: MethodsShape & NoReservedMethods$2<MethodsShape>) => TagClass$9<Self, Id, MethodsShape>;
|
|
1307
|
+
declare const Tag$10: TagFactory$1;
|
|
1180
1308
|
declare const method$2: {
|
|
1181
1309
|
<Success extends ServiceFreeSchema$2>(definition: {
|
|
1182
1310
|
readonly success: Success;
|
|
@@ -1189,7 +1317,7 @@ declare const method$2: {
|
|
|
1189
1317
|
declare const implement$4: <ROut, const Self extends Definition$5.Any>(_definition: Self, handlers: Handlers$2<ROut, Self>) => Handlers$2<ROut, Self>;
|
|
1190
1318
|
type HandlerEffect$2<ROut, Self extends Definition$5.Any, Key extends keyof Self["methods"]> = WorkerRpcHandler<ROut, Method$3.Success<Self["methods"][Key]>>;
|
|
1191
1319
|
declare namespace DurableObjectNamespace_d_exports {
|
|
1192
|
-
export { DurableObjectFetchError, DurableObjectNamespaceBindingDefinition, DurableObjectNamespaceClient, DurableObjectNamespaceDefinition, DurableObjectNamespaceEffectClient, DurableObjectNamespaceStaticClient, DurableObjectRpcError, DurableObjectStubClient, isDurableObjectNamespaceClient, layer$
|
|
1320
|
+
export { DurableObjectFetchError, DurableObjectNamespaceBindingDefinition, DurableObjectNamespaceClient, DurableObjectNamespaceDefinition, DurableObjectNamespaceEffectClient, DurableObjectNamespaceStaticClient, DurableObjectRpcError, DurableObjectStubClient, isDurableObjectNamespaceClient, layer$8 as layer, makeClient$6 as makeClient, makeDirectMethods };
|
|
1193
1321
|
}
|
|
1194
1322
|
interface DurableObjectFetcher {
|
|
1195
1323
|
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
@@ -1387,8 +1515,8 @@ type DurableObjectNamespaceStaticClient<R, Api extends object, Definition extend
|
|
|
1387
1515
|
readonly unsafeRaw: () => Effect.Effect<DurableObjectNamespaceClient<Api>, never, R>;
|
|
1388
1516
|
};
|
|
1389
1517
|
declare const isDurableObjectNamespaceClient: <Api extends object>(value: unknown) => value is DurableObjectNamespaceClient<Api>;
|
|
1390
|
-
declare const makeClient$
|
|
1391
|
-
declare const layer$
|
|
1518
|
+
declare const makeClient$6: <Api extends object, const Definition extends Definition$4.Any | undefined = undefined>(definition: DurableObjectNamespaceBindingDefinition<Definition>) => ((namespace: DurableObjectNamespaceClient<Api>) => DurableObjectNamespaceEffectClient<Api, Definition>);
|
|
1519
|
+
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>) => _$effect_Layer0.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1392
1520
|
declare const makeDirectMethods: <R, Api extends object, Definition extends Definition$4.Any | undefined>(rpcDefinition: Definition | undefined, helpers: {
|
|
1393
1521
|
readonly call: StubCall<R, Api>;
|
|
1394
1522
|
readonly fetch: (stub: DurableObjectStubClient<Api>, input: RequestInfo | URL, init?: RequestInit) => Effect.Effect<globalThis.Response, DurableObjectFetchError, R>;
|
|
@@ -1396,7 +1524,7 @@ declare const makeDirectMethods: <R, Api extends object, Definition extends Defi
|
|
|
1396
1524
|
readonly getByName: (name: string, options?: globalThis.DurableObjectNamespaceGetDurableObjectOptions) => Effect.Effect<DurableObjectStubClient<Api>, never, R>;
|
|
1397
1525
|
}) => DirectMethods<R, Api, Definition>;
|
|
1398
1526
|
declare namespace DurableObjectDefinition_d_exports {
|
|
1399
|
-
export { Api$1 as Api, Definition$4 as Definition, DurableObject$1 as DurableObject, HandlerEffect$1 as HandlerEffect, Handlers$1 as Handlers, LayerOptions$
|
|
1527
|
+
export { Api$1 as Api, Definition$4 as Definition, DurableObject$1 as DurableObject, HandlerEffect$1 as HandlerEffect, Handlers$1 as Handlers, LayerOptions$9 as LayerOptions, Method$2 as Method, Methods$1 as Methods, NoReservedMethods$1 as NoReservedMethods, Options$3 as Options, ReservedMethodName$1 as ReservedMethodName, ServerApi$2 as ServerApi, ServiceFreeSchema$1 as ServiceFreeSchema, Tag$9 as Tag, TagClass$8 as TagClass, implement$3 as implement, make$7 as make, method$1 as method };
|
|
1400
1528
|
}
|
|
1401
1529
|
type ServiceFreeSchema$1 = Schema.Codec<any, any, never, never>;
|
|
1402
1530
|
interface Method$2<Args extends ReadonlyArray<ServiceFreeSchema$1> = ReadonlyArray<ServiceFreeSchema$1>, Success extends ServiceFreeSchema$1 = ServiceFreeSchema$1> {
|
|
@@ -1441,14 +1569,14 @@ type Handlers$1<ROut, Self extends Definition$4.Any> = { readonly [Key in keyof
|
|
|
1441
1569
|
interface Options$3<ROut, Self extends Definition$4.Any, REvent = never, EventLayerError = never> extends Omit<DurableObjectOptions<ROut, REvent, EventLayerError, Handlers$1<ROut | REvent, Self>>, "rpc"> {
|
|
1442
1570
|
readonly rpc: Handlers$1<ROut | REvent, Self>;
|
|
1443
1571
|
}
|
|
1444
|
-
type LayerOptions$
|
|
1572
|
+
type LayerOptions$9 = {
|
|
1445
1573
|
readonly binding: string;
|
|
1446
1574
|
};
|
|
1447
|
-
type TagClass$
|
|
1575
|
+
type TagClass$8<Self, Id extends string, MethodsShape extends Methods$1> = Context.ServiceClass<Self, Id, DurableObjectNamespaceEffectClient<Api$1<Definition$4<Id, MethodsShape>>, Definition$4<Id, MethodsShape>>> & DurableObjectNamespaceStaticClient<Self, Api$1<Definition$4<Id, MethodsShape>>, Definition$4<Id, MethodsShape>> & {
|
|
1448
1576
|
readonly id: Id;
|
|
1449
1577
|
readonly methods: MethodsShape;
|
|
1450
1578
|
readonly make: <ROut, LayerError, REvent = never, EventLayerError = never>(layer: Layer.Layer<ROut, LayerError, DurableObjectState | WorkerEnvironment>, options: Options$3<ROut, Definition$4<Id, MethodsShape>, REvent, EventLayerError>) => DurableObjectClass<Handlers$1<ROut | REvent, Definition$4<Id, MethodsShape>>, ROut | REvent>;
|
|
1451
|
-
readonly layer: (options: LayerOptions$
|
|
1579
|
+
readonly layer: (options: LayerOptions$9) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1452
1580
|
};
|
|
1453
1581
|
/**
|
|
1454
1582
|
* Defines a single RPC method schema in a Durable Object definition.
|
|
@@ -1462,9 +1590,9 @@ declare const method$1: {
|
|
|
1462
1590
|
readonly success: Success;
|
|
1463
1591
|
}): Method$2<Args, Success>;
|
|
1464
1592
|
};
|
|
1465
|
-
declare const make$
|
|
1466
|
-
declare const Tag$
|
|
1467
|
-
declare const DurableObject$1: <Self>() => <Id extends string, const MethodsShape extends Methods$1>(id: Id, methods: MethodsShape & NoReservedMethods$1<MethodsShape>) => TagClass$
|
|
1593
|
+
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>;
|
|
1594
|
+
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>;
|
|
1595
|
+
declare const DurableObject$1: <Self>() => <Id extends string, const MethodsShape extends Methods$1>(id: Id, methods: MethodsShape & NoReservedMethods$1<MethodsShape>) => TagClass$8<Self, Id, MethodsShape>;
|
|
1468
1596
|
/**
|
|
1469
1597
|
* Helper for implementing handlers with the exact method shape of a definition.
|
|
1470
1598
|
*/
|
|
@@ -1474,7 +1602,7 @@ declare const implement$3: <ROut, const Self extends Definition$4.Any>(_definiti
|
|
|
1474
1602
|
*/
|
|
1475
1603
|
type HandlerEffect$1<ROut, Self extends Definition$4.Any, Key extends keyof Self["methods"]> = DurableObjectHandler<ROut, Method$2.Success<Self["methods"][Key]>>;
|
|
1476
1604
|
declare namespace DurableObject_d_exports {
|
|
1477
|
-
export { Api, Definition$3 as Definition, DurableObjectClass, DurableObjectHandler, DurableObjectOptions, DurableObjectRpc, DurableObjectRpcShape, HandlerEffect, Handlers, LayerOptions$
|
|
1605
|
+
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$1 as ServerApi, ServiceFreeSchema, Tag$8 as Tag, TagClass$7 as TagClass, TagFactory, implement$2 as implement, make$6 as make, method };
|
|
1478
1606
|
}
|
|
1479
1607
|
type RuntimeContext$1<ROut> = DurableObjectState | WorkerEnvironment | ROut;
|
|
1480
1608
|
type HandlerContext<ROut> = RuntimeContext$1<ROut> | Scope.Scope;
|
|
@@ -1534,7 +1662,7 @@ type DurableObjectClass<Rpc extends DurableObjectRpc<ROut>, ROut> = new (state:
|
|
|
1534
1662
|
/**
|
|
1535
1663
|
* Creates a Durable Object class backed by a single managed Effect runtime.
|
|
1536
1664
|
*/
|
|
1537
|
-
declare const make$
|
|
1665
|
+
declare const make$6: <ROut, LayerError, REvent = never, EventLayerError = never, const Rpc extends DurableObjectRpc<ROut | REvent> = Record<never, never>>(layer: Layer.Layer<ROut, LayerError, DurableObjectState | WorkerEnvironment>, options?: DurableObjectOptions<ROut, REvent, EventLayerError, Rpc>) => DurableObjectClass<Rpc, ROut | REvent>;
|
|
1538
1666
|
type ServiceFreeSchema = Schema.Codec<any, any, never, never>;
|
|
1539
1667
|
interface Method$1<Args extends ReadonlyArray<ServiceFreeSchema> = ReadonlyArray<ServiceFreeSchema>, Success extends ServiceFreeSchema = ServiceFreeSchema> {
|
|
1540
1668
|
readonly args: Args;
|
|
@@ -1557,21 +1685,21 @@ interface Definition$3<Id extends string = string, MethodsShape extends Methods
|
|
|
1557
1685
|
declare namespace Definition$3 {
|
|
1558
1686
|
type Any = Definition$3<string, Methods>;
|
|
1559
1687
|
}
|
|
1560
|
-
type LayerOptions$
|
|
1688
|
+
type LayerOptions$8 = LayerOptions$9;
|
|
1561
1689
|
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]>> };
|
|
1562
1690
|
type Api<Self extends Definition$3.Any> = Provider<ServerApi$1<Self>, ReservedMethodName>;
|
|
1563
1691
|
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]>> };
|
|
1564
1692
|
interface Options$2<ROut, Self extends Definition$3.Any, REvent = never, EventLayerError = never> extends Omit<DurableObjectOptions<ROut, REvent, EventLayerError, Handlers<ROut | REvent, Self>>, "rpc"> {
|
|
1565
1693
|
readonly rpc: Handlers<ROut | REvent, Self>;
|
|
1566
1694
|
}
|
|
1567
|
-
type TagClass$
|
|
1695
|
+
type TagClass$7<Self, Id extends string, MethodsShape extends Methods> = Context.ServiceClass<Self, Id, DurableObjectNamespaceEffectClient<Api<Definition$3<Id, MethodsShape>>, Definition$3<Id, MethodsShape>>> & DurableObjectNamespaceStaticClient<Self, Api<Definition$3<Id, MethodsShape>>, Definition$3<Id, MethodsShape>> & {
|
|
1568
1696
|
readonly id: Id;
|
|
1569
1697
|
readonly methods: MethodsShape;
|
|
1570
1698
|
readonly make: <ROut, LayerError, REvent = never, EventLayerError = never>(layer: Layer.Layer<ROut, LayerError, DurableObjectState | WorkerEnvironment>, options: Options$2<ROut, Definition$3<Id, MethodsShape>, REvent, EventLayerError>) => DurableObjectClass<Handlers<ROut | REvent, Definition$3<Id, MethodsShape>>, ROut | REvent>;
|
|
1571
|
-
readonly layer: (options: LayerOptions$
|
|
1699
|
+
readonly layer: (options: LayerOptions$8) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1572
1700
|
};
|
|
1573
|
-
type TagFactory = <Self>() => <Id extends string, const MethodsShape extends Methods>(id: Id, methods: MethodsShape & NoReservedMethods<MethodsShape>) => TagClass$
|
|
1574
|
-
declare const Tag$
|
|
1701
|
+
type TagFactory = <Self>() => <Id extends string, const MethodsShape extends Methods>(id: Id, methods: MethodsShape & NoReservedMethods<MethodsShape>) => TagClass$7<Self, Id, MethodsShape>;
|
|
1702
|
+
declare const Tag$8: TagFactory;
|
|
1575
1703
|
declare const method: {
|
|
1576
1704
|
<Success extends ServiceFreeSchema>(definition: {
|
|
1577
1705
|
readonly success: Success;
|
|
@@ -1908,12 +2036,12 @@ declare class DurableObjectAlarm extends DurableObjectAlarm_base {
|
|
|
1908
2036
|
static readonly layer: Layer.Layer<DurableObjectAlarm, never, DurableObjectState>;
|
|
1909
2037
|
}
|
|
1910
2038
|
declare namespace DurableObjectRpcWebSocket_d_exports {
|
|
1911
|
-
export { DurableObjectRpcWebSocket, DurableObjectRpcWebSocketService, LayerOptions$
|
|
2039
|
+
export { DurableObjectRpcWebSocket, DurableObjectRpcWebSocketService, LayerOptions$7 as LayerOptions, NativeWebSocketMessage, layer$7 as layer };
|
|
1912
2040
|
}
|
|
1913
2041
|
/**
|
|
1914
2042
|
* Configuration for {@link layer}.
|
|
1915
2043
|
*/
|
|
1916
|
-
interface LayerOptions$
|
|
2044
|
+
interface LayerOptions$7 {
|
|
1917
2045
|
/** Tag used to select hibernated sockets. */
|
|
1918
2046
|
readonly tag?: string | undefined;
|
|
1919
2047
|
/** Socket attachment key used to persist client ids across hibernation. */
|
|
@@ -1938,9 +2066,9 @@ declare class DurableObjectRpcWebSocket extends DurableObjectRpcWebSocket_base {
|
|
|
1938
2066
|
/**
|
|
1939
2067
|
* Builds a layer that bridges Durable Object websocket events to `RpcServer.Protocol`.
|
|
1940
2068
|
*/
|
|
1941
|
-
declare const layer$
|
|
2069
|
+
declare const layer$7: (options?: LayerOptions$7) => Layer.Layer<DurableObjectRpcWebSocket | RpcServer.Protocol, never, DurableObjectState | RpcSerialization.RpcSerialization>;
|
|
1942
2070
|
declare namespace DurableObjectSqlite_d_exports {
|
|
1943
|
-
export { SqliteLayerOptions, layer$
|
|
2071
|
+
export { SqliteLayerOptions, layer$6 as layer };
|
|
1944
2072
|
}
|
|
1945
2073
|
/** Options forwarded to `@effect/sql-sqlite-do` when building a SQL client layer. */
|
|
1946
2074
|
type SqliteLayerOptions = Omit<SqliteClient.SqliteClientConfig, "db">;
|
|
@@ -1955,9 +2083,60 @@ type SqliteLayerOptions = Omit<SqliteClient.SqliteClientConfig, "db">;
|
|
|
1955
2083
|
* );
|
|
1956
2084
|
* ```
|
|
1957
2085
|
*/
|
|
1958
|
-
declare const layer$
|
|
2086
|
+
declare const layer$6: (options?: SqliteLayerOptions) => Layer.Layer<_$effect_unstable_sql_SqlClient0.SqlClient | SqliteClient.SqliteClient, never, DurableObjectState>;
|
|
2087
|
+
declare namespace Email_d_exports {
|
|
2088
|
+
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 };
|
|
2089
|
+
}
|
|
2090
|
+
declare const EmailOperationError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
2091
|
+
readonly _tag: "EmailOperationError";
|
|
2092
|
+
} & Readonly<A>;
|
|
2093
|
+
/** Error raised when a Cloudflare Send Email operation fails. */
|
|
2094
|
+
declare class EmailOperationError extends EmailOperationError_base<{
|
|
2095
|
+
readonly binding: string;
|
|
2096
|
+
readonly operation: string;
|
|
2097
|
+
readonly cause: unknown;
|
|
2098
|
+
}> {}
|
|
2099
|
+
/** Typed Cloudflare Send Email binding definition. */
|
|
2100
|
+
interface EmailDefinition {
|
|
2101
|
+
/** Binding name as configured in `wrangler.jsonc`. */
|
|
2102
|
+
readonly binding: string;
|
|
2103
|
+
}
|
|
2104
|
+
type EmailAddress = CloudflareEmailAddress;
|
|
2105
|
+
type EmailAttachment = CloudflareEmailAttachment;
|
|
2106
|
+
type EmailMessage = CloudflareEmailMessage;
|
|
2107
|
+
type EmailMessageBuilder = Parameters<CloudflareSendEmail["send"]>[0];
|
|
2108
|
+
type EmailSendInput = EmailMessage | EmailMessageBuilder;
|
|
2109
|
+
type EmailSendResult = CloudflareEmailSendResult;
|
|
2110
|
+
type EmailBinding = CloudflareSendEmail;
|
|
2111
|
+
interface EmailClient {
|
|
2112
|
+
readonly send: {
|
|
2113
|
+
(message: EmailMessage): Effect.Effect<EmailSendResult, EmailOperationError>;
|
|
2114
|
+
(builder: EmailMessageBuilder): Effect.Effect<EmailSendResult, EmailOperationError>;
|
|
2115
|
+
};
|
|
2116
|
+
readonly unsafeRaw: Effect.Effect<EmailBinding>;
|
|
2117
|
+
readonly definition: EmailDefinition;
|
|
2118
|
+
}
|
|
2119
|
+
declare const EmailServiceTypeId: unique symbol;
|
|
2120
|
+
/** Nominal service marker for Send Email services created with {@link make}. */
|
|
2121
|
+
interface EmailService<Id extends string> {
|
|
2122
|
+
readonly [EmailServiceTypeId]: {
|
|
2123
|
+
readonly id: Id;
|
|
2124
|
+
};
|
|
2125
|
+
}
|
|
2126
|
+
type LayerOptions$6 = {
|
|
2127
|
+
readonly binding: string;
|
|
2128
|
+
};
|
|
2129
|
+
interface TagClass$6<Self, Id extends string> extends Context.ServiceClass<Self, Id, EmailClient> {
|
|
2130
|
+
readonly id: Id;
|
|
2131
|
+
readonly layer: (options: LayerOptions$6) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2132
|
+
}
|
|
2133
|
+
declare const isEmailBinding: (value: unknown) => value is EmailBinding;
|
|
2134
|
+
declare const makeClient$5: (definition: EmailDefinition) => (email: EmailBinding) => EmailClient;
|
|
2135
|
+
declare const layer$5: <Self>(tag: Context.Service<Self, EmailClient>, definition: EmailDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2136
|
+
declare const make$5: <Id extends string>(id: Id) => TagClass$6<EmailService<Id>, Id>;
|
|
2137
|
+
declare const Tag$7: <Self>() => <Id extends string>(id: Id) => TagClass$6<Self, Id>;
|
|
1959
2138
|
declare namespace Images_d_exports {
|
|
1960
|
-
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$
|
|
2139
|
+
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 };
|
|
1961
2140
|
}
|
|
1962
2141
|
declare const TypeId: "effect-cf/Images/Steps";
|
|
1963
2142
|
declare const ImagesOperationError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
@@ -1974,22 +2153,22 @@ interface ImagesDefinition {
|
|
|
1974
2153
|
/** Binding name as configured in `wrangler.jsonc`. */
|
|
1975
2154
|
readonly binding: string;
|
|
1976
2155
|
}
|
|
1977
|
-
type ImageInfoResponse =
|
|
1978
|
-
type ImageTransform =
|
|
1979
|
-
type ImageDrawOptions =
|
|
1980
|
-
type ImageInputOptions =
|
|
1981
|
-
type ImageOutputOptions =
|
|
1982
|
-
type ImageTransformationOutputOptions =
|
|
1983
|
-
type ImageTransformationResult =
|
|
1984
|
-
type ImageUploadOptions =
|
|
1985
|
-
type ImageUpdateOptions =
|
|
1986
|
-
type ImageListOptions =
|
|
1987
|
-
type ImageList =
|
|
1988
|
-
type ImageMetadata =
|
|
2156
|
+
type ImageInfoResponse = CloudflareImageInfoResponse;
|
|
2157
|
+
type ImageTransform = CloudflareImageTransform;
|
|
2158
|
+
type ImageDrawOptions = CloudflareImageDrawOptions;
|
|
2159
|
+
type ImageInputOptions = CloudflareImageInputOptions;
|
|
2160
|
+
type ImageOutputOptions = CloudflareImageOutputOptions;
|
|
2161
|
+
type ImageTransformationOutputOptions = CloudflareImageTransformationOutputOptions;
|
|
2162
|
+
type ImageTransformationResult = CloudflareImageTransformationResult;
|
|
2163
|
+
type ImageUploadOptions = CloudflareImageUploadOptions;
|
|
2164
|
+
type ImageUpdateOptions = CloudflareImageUpdateOptions;
|
|
2165
|
+
type ImageListOptions = CloudflareImageListOptions;
|
|
2166
|
+
type ImageList = CloudflareImageList;
|
|
2167
|
+
type ImageMetadata = CloudflareImageMetadata;
|
|
1989
2168
|
type ImageInputValue = ReadableStream<Uint8Array> | ArrayBuffer;
|
|
1990
2169
|
type ImageUploadValue = ReadableStream<Uint8Array> | ArrayBuffer;
|
|
1991
2170
|
interface DrawStepOptions {
|
|
1992
|
-
readonly image: ReadableStream<Uint8Array> |
|
|
2171
|
+
readonly image: ReadableStream<Uint8Array> | CloudflareImageTransformer;
|
|
1993
2172
|
readonly options?: ImageDrawOptions;
|
|
1994
2173
|
}
|
|
1995
2174
|
type Step = Data.TaggedEnum<{
|
|
@@ -2008,13 +2187,13 @@ interface ProcessOptions {
|
|
|
2008
2187
|
readonly outputOptions: ImageOutputOptions;
|
|
2009
2188
|
}
|
|
2010
2189
|
interface ImagesTransformationResultClient {
|
|
2011
|
-
readonly raw:
|
|
2012
|
-
readonly response: Effect.Effect<
|
|
2190
|
+
readonly raw: CloudflareImageTransformationResult;
|
|
2191
|
+
readonly response: Effect.Effect<CloudflareResponse, ImagesOperationError>;
|
|
2013
2192
|
readonly contentType: Effect.Effect<string, ImagesOperationError>;
|
|
2014
2193
|
readonly image: (options?: ImageTransformationOutputOptions) => Effect.Effect<ReadableStream<Uint8Array>, ImagesOperationError>;
|
|
2015
2194
|
}
|
|
2016
2195
|
interface ImageHandleClient {
|
|
2017
|
-
readonly raw:
|
|
2196
|
+
readonly raw: CloudflareImageHandle;
|
|
2018
2197
|
readonly details: Effect.Effect<Option.Option<ImageMetadata>, ImagesOperationError>;
|
|
2019
2198
|
readonly bytes: Effect.Effect<Option.Option<ReadableStream<Uint8Array>>, ImagesOperationError>;
|
|
2020
2199
|
readonly update: (options: ImageUpdateOptions) => Effect.Effect<ImageMetadata, ImagesOperationError>;
|
|
@@ -2024,16 +2203,16 @@ interface HostedImagesClient {
|
|
|
2024
2203
|
readonly image: (imageId: string) => ImageHandleClient;
|
|
2025
2204
|
readonly upload: (image: ImageUploadValue, options?: ImageUploadOptions) => Effect.Effect<ImageMetadata, ImagesOperationError>;
|
|
2026
2205
|
readonly list: (options?: ImageListOptions) => Effect.Effect<ImageList, ImagesOperationError>;
|
|
2027
|
-
readonly unsafeRaw: Effect.Effect<
|
|
2206
|
+
readonly unsafeRaw: Effect.Effect<CloudflareHostedImagesBinding>;
|
|
2028
2207
|
}
|
|
2029
2208
|
interface ImagesRuntimeBinding {
|
|
2030
2209
|
readonly info: (image: ImageInputValue, options?: ImageInputOptions) => Promise<ImageInfoResponse>;
|
|
2031
|
-
readonly input: (image: ImageInputValue, options?: ImageInputOptions) =>
|
|
2032
|
-
readonly hosted?:
|
|
2210
|
+
readonly input: (image: ImageInputValue, options?: ImageInputOptions) => CloudflareImageTransformer;
|
|
2211
|
+
readonly hosted?: CloudflareHostedImagesBinding;
|
|
2033
2212
|
}
|
|
2034
2213
|
interface ImagesClient {
|
|
2035
2214
|
readonly info: (image: ImageInputValue, options?: ImageInputOptions) => Effect.Effect<ImageInfoResponse, ImagesOperationError>;
|
|
2036
|
-
readonly input: (image: ImageInputValue, options?: ImageInputOptions) => Effect.Effect<
|
|
2215
|
+
readonly input: (image: ImageInputValue, options?: ImageInputOptions) => Effect.Effect<CloudflareImageTransformer, ImagesOperationError>;
|
|
2037
2216
|
readonly process: (steps: Steps, options: ProcessOptions) => Effect.Effect<ImagesTransformationResultClient, ImagesOperationError>;
|
|
2038
2217
|
readonly hosted: Option.Option<HostedImagesClient>;
|
|
2039
2218
|
readonly unsafeRaw: Effect.Effect<ImagesRuntimeBinding>;
|
|
@@ -2046,12 +2225,12 @@ interface ImagesService<Id extends string> {
|
|
|
2046
2225
|
readonly id: Id;
|
|
2047
2226
|
};
|
|
2048
2227
|
}
|
|
2049
|
-
type LayerOptions$
|
|
2228
|
+
type LayerOptions$5 = {
|
|
2050
2229
|
readonly binding: string;
|
|
2051
2230
|
};
|
|
2052
|
-
interface TagClass$
|
|
2231
|
+
interface TagClass$5<Self, Id extends string> extends Context.ServiceClass<Self, Id, ImagesClient> {
|
|
2053
2232
|
readonly id: Id;
|
|
2054
|
-
readonly layer: (options: LayerOptions$
|
|
2233
|
+
readonly layer: (options: LayerOptions$5) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2055
2234
|
}
|
|
2056
2235
|
/** Empty Images transformation pipeline. */
|
|
2057
2236
|
declare const empty: Steps;
|
|
@@ -2060,12 +2239,12 @@ declare function transform(steps: Steps, transform: ImageTransform): Steps;
|
|
|
2060
2239
|
declare function draw(draw: DrawStepOptions): (steps: Steps) => Steps;
|
|
2061
2240
|
declare function draw(steps: Steps, draw: DrawStepOptions): Steps;
|
|
2062
2241
|
declare const isImagesBinding: (value: unknown) => value is ImagesRuntimeBinding;
|
|
2063
|
-
declare const makeClient$
|
|
2064
|
-
declare const layer$
|
|
2065
|
-
declare const make$
|
|
2066
|
-
declare const Tag$
|
|
2242
|
+
declare const makeClient$4: (definition: ImagesDefinition) => (images: ImagesRuntimeBinding) => ImagesClient;
|
|
2243
|
+
declare const layer$4: <Self>(tag: Context.Service<Self, ImagesClient>, definition: ImagesDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2244
|
+
declare const make$4: <Id extends string>(id: Id) => TagClass$5<ImagesService<Id>, Id>;
|
|
2245
|
+
declare const Tag$6: <Self>() => <Id extends string>(id: Id) => TagClass$5<Self, Id>;
|
|
2067
2246
|
declare namespace Kv_d_exports {
|
|
2068
|
-
export { Definition$2 as Definition, KvClient, KvDefinition, KvListKey, KvListOptions, KvListResult, KvOperationError, KvPutOptions, KvWithMetadata, LayerOptions$
|
|
2247
|
+
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 };
|
|
2069
2248
|
}
|
|
2070
2249
|
declare const KvOperationError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
2071
2250
|
readonly _tag: "KvOperationError";
|
|
@@ -2077,9 +2256,9 @@ declare class KvOperationError extends KvOperationError_base<{
|
|
|
2077
2256
|
readonly cause: unknown;
|
|
2078
2257
|
}> {}
|
|
2079
2258
|
/** `KVNamespace.put` options. */
|
|
2080
|
-
type KvPutOptions =
|
|
2259
|
+
type KvPutOptions = CloudflareKVNamespacePutOptions;
|
|
2081
2260
|
/** `KVNamespace.list` options with optional metadata decoding schema. */
|
|
2082
|
-
type KvListOptions<Metadata = unknown> =
|
|
2261
|
+
type KvListOptions<Metadata = unknown> = CloudflareKVNamespaceListOptions & {
|
|
2083
2262
|
readonly metadataSchema?: Schema.Codec<Metadata, unknown>;
|
|
2084
2263
|
};
|
|
2085
2264
|
/** Successful value returned by `getWithMetadata`. */
|
|
@@ -2134,24 +2313,24 @@ interface KvClient<Key, Value, EncodedValue> {
|
|
|
2134
2313
|
readonly unsafeRaw: Effect.Effect<KVNamespace>;
|
|
2135
2314
|
readonly definition: KvDefinition<Key, Value, EncodedValue>;
|
|
2136
2315
|
}
|
|
2137
|
-
type LayerOptions$
|
|
2316
|
+
type LayerOptions$4 = {
|
|
2138
2317
|
readonly binding: string;
|
|
2139
2318
|
};
|
|
2140
|
-
interface TagClass$
|
|
2319
|
+
interface TagClass$4<Self, Id extends string, Key, Value, EncodedValue> extends Context.ServiceClass<Self, Id, KvClient<Key, Value, EncodedValue>> {
|
|
2141
2320
|
readonly id: Id;
|
|
2142
2321
|
readonly keySchema: Schema.Codec<Key, string>;
|
|
2143
2322
|
readonly valueSchema: Schema.Codec<Value, EncodedValue>;
|
|
2144
|
-
readonly layer: (options: LayerOptions$
|
|
2323
|
+
readonly layer: (options: LayerOptions$4) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2145
2324
|
}
|
|
2146
2325
|
declare const isKvNamespace: (value: unknown) => value is KVNamespace;
|
|
2147
|
-
declare const makeClient$
|
|
2148
|
-
declare const layer$
|
|
2149
|
-
declare const Tag$
|
|
2326
|
+
declare const makeClient$3: <Key, Value, EncodedValue>(definition: KvDefinition<Key, Value, EncodedValue>) => ((kv: KVNamespace) => KvClient<Key, Value, EncodedValue>);
|
|
2327
|
+
declare const layer$3: <Self, Key, Value, EncodedValue>(tag: Context.Service<Self, KvClient<Key, Value, EncodedValue>>, definition: KvDefinition<Key, Value, EncodedValue>) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2328
|
+
declare const Tag$5: <Self>() => <Id extends string, Key, Value, EncodedValue>(id: Id, definition: {
|
|
2150
2329
|
readonly key: Schema.Codec<Key, string>;
|
|
2151
2330
|
readonly value: Schema.Codec<Value, EncodedValue>;
|
|
2152
|
-
}) => TagClass$
|
|
2331
|
+
}) => TagClass$4<Self, Id, Key, Value, EncodedValue>;
|
|
2153
2332
|
declare namespace R2_d_exports {
|
|
2154
|
-
export { LayerOptions$
|
|
2333
|
+
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 };
|
|
2155
2334
|
}
|
|
2156
2335
|
declare const R2OperationError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
2157
2336
|
readonly _tag: "R2OperationError";
|
|
@@ -2167,15 +2346,15 @@ interface R2Definition {
|
|
|
2167
2346
|
/** Binding name as configured in `wrangler.jsonc`. */
|
|
2168
2347
|
readonly binding: string;
|
|
2169
2348
|
}
|
|
2170
|
-
type R2GetOptions =
|
|
2171
|
-
type R2PutOptions =
|
|
2172
|
-
type R2ListOptions =
|
|
2173
|
-
type R2MultipartOptions =
|
|
2174
|
-
type R2UploadPartOptions =
|
|
2349
|
+
type R2GetOptions = CloudflareR2GetOptions;
|
|
2350
|
+
type R2PutOptions = CloudflareR2PutOptions;
|
|
2351
|
+
type R2ListOptions = CloudflareR2ListOptions;
|
|
2352
|
+
type R2MultipartOptions = CloudflareR2MultipartOptions;
|
|
2353
|
+
type R2UploadPartOptions = CloudflareR2UploadPartOptions;
|
|
2175
2354
|
type R2PutValue = ReadableStream | ArrayBuffer | ArrayBufferView | string | null | Blob;
|
|
2176
2355
|
type R2UploadPartValue = ReadableStream | ArrayBuffer | ArrayBufferView | string | Blob;
|
|
2177
|
-
interface R2ObjectBodyClient extends Omit<
|
|
2178
|
-
readonly raw:
|
|
2356
|
+
interface R2ObjectBodyClient extends Omit<CloudflareR2ObjectBody, "arrayBuffer" | "blob" | "bytes" | "json" | "text"> {
|
|
2357
|
+
readonly raw: CloudflareR2ObjectBody;
|
|
2179
2358
|
readonly arrayBuffer: Effect.Effect<ArrayBuffer, R2OperationError>;
|
|
2180
2359
|
readonly bytes: Effect.Effect<Uint8Array, R2OperationError>;
|
|
2181
2360
|
readonly text: Effect.Effect<string, R2OperationError>;
|
|
@@ -2183,32 +2362,32 @@ interface R2ObjectBodyClient extends Omit<globalThis.R2ObjectBody, "arrayBuffer"
|
|
|
2183
2362
|
readonly blob: Effect.Effect<Blob, R2OperationError>;
|
|
2184
2363
|
}
|
|
2185
2364
|
interface R2MultipartUploadClient {
|
|
2186
|
-
readonly raw:
|
|
2365
|
+
readonly raw: CloudflareR2MultipartUpload;
|
|
2187
2366
|
readonly key: string;
|
|
2188
2367
|
readonly uploadId: string;
|
|
2189
|
-
readonly uploadPart: (partNumber: number, value: R2UploadPartValue, options?: R2UploadPartOptions) => Effect.Effect<
|
|
2368
|
+
readonly uploadPart: (partNumber: number, value: R2UploadPartValue, options?: R2UploadPartOptions) => Effect.Effect<CloudflareR2UploadedPart, R2OperationError>;
|
|
2190
2369
|
readonly abort: Effect.Effect<void, R2OperationError>;
|
|
2191
|
-
readonly complete: (uploadedParts: ReadonlyArray<
|
|
2370
|
+
readonly complete: (uploadedParts: ReadonlyArray<CloudflareR2UploadedPart>) => Effect.Effect<CloudflareR2Object, R2OperationError>;
|
|
2192
2371
|
}
|
|
2193
2372
|
interface R2Client {
|
|
2194
|
-
readonly head: (key: string) => Effect.Effect<Option.Option<
|
|
2373
|
+
readonly head: (key: string) => Effect.Effect<Option.Option<CloudflareR2Object>, R2OperationError>;
|
|
2195
2374
|
readonly get: {
|
|
2196
2375
|
(key: string, options: R2GetOptions & {
|
|
2197
|
-
readonly onlyIf:
|
|
2198
|
-
}): Effect.Effect<Option.Option<R2ObjectBodyClient |
|
|
2376
|
+
readonly onlyIf: CloudflareR2Conditional | Headers;
|
|
2377
|
+
}): Effect.Effect<Option.Option<R2ObjectBodyClient | CloudflareR2Object>, R2OperationError>;
|
|
2199
2378
|
(key: string, options?: R2GetOptions): Effect.Effect<Option.Option<R2ObjectBodyClient>, R2OperationError>;
|
|
2200
2379
|
};
|
|
2201
2380
|
readonly put: {
|
|
2202
2381
|
(key: string, value: R2PutValue, options: R2PutOptions & {
|
|
2203
|
-
readonly onlyIf:
|
|
2204
|
-
}): Effect.Effect<Option.Option<
|
|
2205
|
-
(key: string, value: R2PutValue, options?: R2PutOptions): Effect.Effect<
|
|
2382
|
+
readonly onlyIf: CloudflareR2Conditional | Headers;
|
|
2383
|
+
}): Effect.Effect<Option.Option<CloudflareR2Object>, R2OperationError>;
|
|
2384
|
+
(key: string, value: R2PutValue, options?: R2PutOptions): Effect.Effect<CloudflareR2Object, R2OperationError>;
|
|
2206
2385
|
};
|
|
2207
2386
|
readonly createMultipartUpload: (key: string, options?: R2MultipartOptions) => Effect.Effect<R2MultipartUploadClient, R2OperationError>;
|
|
2208
2387
|
readonly resumeMultipartUpload: (key: string, uploadId: string) => Effect.Effect<R2MultipartUploadClient, R2OperationError>;
|
|
2209
2388
|
readonly delete: (keys: string | ReadonlyArray<string>) => Effect.Effect<void, R2OperationError>;
|
|
2210
|
-
readonly list: (options?: R2ListOptions) => Effect.Effect<
|
|
2211
|
-
readonly unsafeRaw: Effect.Effect<
|
|
2389
|
+
readonly list: (options?: R2ListOptions) => Effect.Effect<CloudflareR2Objects, R2OperationError>;
|
|
2390
|
+
readonly unsafeRaw: Effect.Effect<CloudflareR2Bucket>;
|
|
2212
2391
|
readonly definition: R2Definition;
|
|
2213
2392
|
}
|
|
2214
2393
|
declare const R2ServiceTypeId: unique symbol;
|
|
@@ -2218,22 +2397,22 @@ interface R2Service<Id extends string> {
|
|
|
2218
2397
|
readonly id: Id;
|
|
2219
2398
|
};
|
|
2220
2399
|
}
|
|
2221
|
-
type LayerOptions$
|
|
2400
|
+
type LayerOptions$3 = {
|
|
2222
2401
|
readonly binding: string;
|
|
2223
2402
|
};
|
|
2224
|
-
interface TagClass$
|
|
2403
|
+
interface TagClass$3<Self, Id extends string> extends Context.ServiceClass<Self, Id, R2Client> {
|
|
2225
2404
|
readonly id: Id;
|
|
2226
|
-
readonly layer: (options: LayerOptions$
|
|
2405
|
+
readonly layer: (options: LayerOptions$3) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2227
2406
|
}
|
|
2228
|
-
declare const isR2Bucket: (value: unknown) => value is
|
|
2229
|
-
declare const makeClient$
|
|
2230
|
-
declare const layer$
|
|
2231
|
-
declare const make$
|
|
2232
|
-
declare const Tag$
|
|
2407
|
+
declare const isR2Bucket: (value: unknown) => value is CloudflareR2Bucket;
|
|
2408
|
+
declare const makeClient$2: (definition: R2Definition) => ((bucket: CloudflareR2Bucket) => R2Client);
|
|
2409
|
+
declare const layer$2: <Self>(tag: Context.Service<Self, R2Client>, definition: R2Definition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2410
|
+
declare const make$3: <Id extends string>(id: Id) => TagClass$3<R2Service<Id>, Id>;
|
|
2411
|
+
declare const Tag$4: <Self>() => <Id extends string>(id: Id) => TagClass$3<Self, Id>;
|
|
2233
2412
|
declare namespace WorkflowBinding_d_exports {
|
|
2234
|
-
export { WorkflowBindingClient, WorkflowBindingDefinition, WorkflowInstance, WorkflowInstanceCreateBatchOptions, WorkflowInstanceCreateOptions, WorkflowInstanceEvent, WorkflowInstanceRestartOptions, WorkflowInstanceStatus, WorkflowInstanceStatusName, WorkflowOperationError, WorkflowResultDecodeError, isWorkflow, layer, makeClient };
|
|
2413
|
+
export { WorkflowBindingClient, WorkflowBindingDefinition, WorkflowInstance, WorkflowInstanceCreateBatchOptions, WorkflowInstanceCreateOptions, WorkflowInstanceEvent, WorkflowInstanceRestartOptions, WorkflowInstanceStatus, WorkflowInstanceStatusName, WorkflowOperationError, WorkflowResultDecodeError, isWorkflow, layer$1 as layer, makeClient$1 as makeClient };
|
|
2235
2414
|
}
|
|
2236
|
-
type WorkflowInstanceCreateOptions<Payload> = Omit<
|
|
2415
|
+
type WorkflowInstanceCreateOptions<Payload> = Omit<CloudflareWorkflowInstanceCreateOptions<Payload>, "params">;
|
|
2237
2416
|
type WorkflowInstanceCreateBatchOptions<Payload, EncodedPayload = unknown> = ReadonlyArray<{
|
|
2238
2417
|
readonly payload: Payload;
|
|
2239
2418
|
} & WorkflowInstanceCreateOptions<EncodedPayload>>;
|
|
@@ -2244,7 +2423,7 @@ interface WorkflowInstanceRestartOptions {
|
|
|
2244
2423
|
readonly type?: string;
|
|
2245
2424
|
};
|
|
2246
2425
|
}
|
|
2247
|
-
type WorkflowInstanceStatusName =
|
|
2426
|
+
type WorkflowInstanceStatusName = CloudflareInstanceStatus["status"];
|
|
2248
2427
|
interface WorkflowInstanceStatus<Result> {
|
|
2249
2428
|
readonly status: WorkflowInstanceStatusName;
|
|
2250
2429
|
readonly output: Option.Option<Result>;
|
|
@@ -2254,7 +2433,7 @@ interface WorkflowInstanceStatus<Result> {
|
|
|
2254
2433
|
}>;
|
|
2255
2434
|
}
|
|
2256
2435
|
interface WorkflowInstance<Result> {
|
|
2257
|
-
readonly raw:
|
|
2436
|
+
readonly raw: CloudflareWorkflowInstance;
|
|
2258
2437
|
readonly id: string;
|
|
2259
2438
|
readonly pause: Effect.Effect<void, WorkflowOperationError>;
|
|
2260
2439
|
readonly resume: Effect.Effect<void, WorkflowOperationError>;
|
|
@@ -2279,7 +2458,7 @@ interface WorkflowBindingClient<Payload extends ServiceFreeSchema$4, Result exte
|
|
|
2279
2458
|
readonly create: (payload: Schema.Schema.Type<Payload>, options?: WorkflowInstanceCreateOptions<Schema.Codec.Encoded<Payload>>) => Effect.Effect<WorkflowInstance<Schema.Schema.Type<Result>>, WorkflowOperationError | Schema.SchemaError>;
|
|
2280
2459
|
readonly createBatch: (batch: WorkflowInstanceCreateBatchOptions<Schema.Schema.Type<Payload>, Schema.Codec.Encoded<Payload>>) => Effect.Effect<ReadonlyArray<WorkflowInstance<Schema.Schema.Type<Result>>>, WorkflowOperationError | Schema.SchemaError>;
|
|
2281
2460
|
readonly get: (instanceId: string) => Effect.Effect<WorkflowInstance<Schema.Schema.Type<Result>>, WorkflowOperationError>;
|
|
2282
|
-
readonly unsafeRaw: Effect.Effect<
|
|
2461
|
+
readonly unsafeRaw: Effect.Effect<CloudflareWorkflow<Schema.Codec.Encoded<Payload>>>;
|
|
2283
2462
|
}
|
|
2284
2463
|
declare const WorkflowOperationError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
2285
2464
|
readonly _tag: "WorkflowOperationError";
|
|
@@ -2297,11 +2476,11 @@ declare class WorkflowResultDecodeError extends WorkflowResultDecodeError_base<{
|
|
|
2297
2476
|
readonly instanceId: string;
|
|
2298
2477
|
readonly cause: unknown;
|
|
2299
2478
|
}> {}
|
|
2300
|
-
declare const isWorkflow: <Payload>(value: unknown) => value is
|
|
2301
|
-
declare const makeClient: <Payload extends ServiceFreeSchema$4, Result extends ServiceFreeSchema$4>(definition: WorkflowBindingDefinition<Payload, Result>) => ((workflow:
|
|
2302
|
-
declare const layer: <Self, Payload extends ServiceFreeSchema$4, Result extends ServiceFreeSchema$4>(tag: Context.Service<Self, WorkflowBindingClient<Payload, Result>>, definition: WorkflowBindingDefinition<Payload, Result>) => _$effect_Layer0.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2479
|
+
declare const isWorkflow: <Payload>(value: unknown) => value is CloudflareWorkflow<Payload>;
|
|
2480
|
+
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>);
|
|
2481
|
+
declare const layer$1: <Self, Payload extends ServiceFreeSchema$4, Result extends ServiceFreeSchema$4>(tag: Context.Service<Self, WorkflowBindingClient<Payload, Result>>, definition: WorkflowBindingDefinition<Payload, Result>) => _$effect_Layer0.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2303
2482
|
declare namespace WorkflowDefinition_d_exports {
|
|
2304
|
-
export { Definition$1 as Definition, Handler$1 as Handler, LayerOptions$
|
|
2483
|
+
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 };
|
|
2305
2484
|
}
|
|
2306
2485
|
interface Definition$1<Id extends string = string, Payload extends ServiceFreeSchema$4 = ServiceFreeSchema$4, Result extends ServiceFreeSchema$4 = ServiceFreeSchema$4> {
|
|
2307
2486
|
readonly id: Id;
|
|
@@ -2315,41 +2494,42 @@ type Handler$1<ROut, Self extends Definition$1.Any> = (payload: Schema.Schema.Ty
|
|
|
2315
2494
|
interface Options$1<ROut, Self extends Definition$1.Any> {
|
|
2316
2495
|
readonly run: Handler$1<ROut, Self>;
|
|
2317
2496
|
}
|
|
2318
|
-
type LayerOptions$
|
|
2497
|
+
type LayerOptions$2 = {
|
|
2319
2498
|
readonly binding: string;
|
|
2320
2499
|
};
|
|
2321
|
-
interface TagClass$
|
|
2500
|
+
interface TagClass$2<Self, Id extends string, Payload extends ServiceFreeSchema$4, Result extends ServiceFreeSchema$4> extends Context.ServiceClass<Self, Id, WorkflowBindingClient<Payload, Result>> {
|
|
2322
2501
|
readonly id: Id;
|
|
2323
2502
|
readonly payload: Payload;
|
|
2324
2503
|
readonly result: Result;
|
|
2325
2504
|
readonly make: <ROut, LayerError>(layer: Layer.Layer<ROut, LayerError, ExecutionContext | WorkerContext | WorkerEnvironment>, options: Options$1<ROut, Definition$1<Id, Payload, Result>>) => WorkflowClass<Schema.Codec.Encoded<Payload>, Schema.Codec.Encoded<Result>, ROut>;
|
|
2326
|
-
readonly layer: (options: LayerOptions$
|
|
2505
|
+
readonly layer: (options: LayerOptions$2) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2327
2506
|
readonly create: (payload: Schema.Schema.Type<Payload>, options?: WorkflowInstanceCreateOptions<Schema.Codec.Encoded<Payload>>) => Effect.Effect<WorkflowInstance<Schema.Schema.Type<Result>>, WorkflowOperationError | Schema.SchemaError, Self>;
|
|
2328
2507
|
readonly createBatch: (batch: WorkflowInstanceCreateBatchOptions<Schema.Schema.Type<Payload>, Schema.Codec.Encoded<Payload>>) => Effect.Effect<ReadonlyArray<WorkflowInstance<Schema.Schema.Type<Result>>>, WorkflowOperationError | Schema.SchemaError, Self>;
|
|
2329
2508
|
readonly get: (instanceId: string) => Effect.Effect<WorkflowInstance<Schema.Schema.Type<Result>>, WorkflowOperationError, Self>;
|
|
2330
2509
|
readonly unsafeRaw: () => Effect.Effect<globalThis.Workflow<Schema.Codec.Encoded<Payload>>, never, Self>;
|
|
2331
2510
|
}
|
|
2332
|
-
declare const make$
|
|
2511
|
+
declare const make$2: <Id extends string, Payload extends ServiceFreeSchema$4, Result extends ServiceFreeSchema$4>(id: Id, definition: {
|
|
2333
2512
|
readonly payload: Payload;
|
|
2334
2513
|
readonly result: Result;
|
|
2335
|
-
}) => TagClass$
|
|
2336
|
-
declare const Tag$
|
|
2514
|
+
}) => TagClass$2<Definition$1<Id, Payload, Result>, Id, Payload, Result>;
|
|
2515
|
+
declare const Tag$3: <Self>() => <Id extends string, Payload extends ServiceFreeSchema$4, Result extends ServiceFreeSchema$4>(id: Id, definition: {
|
|
2337
2516
|
readonly payload: Payload;
|
|
2338
2517
|
readonly result: Result;
|
|
2339
|
-
}) => TagClass$
|
|
2518
|
+
}) => TagClass$2<Self, Id, Payload, Result>;
|
|
2340
2519
|
declare const Workflow: <Self>() => <Id extends string, Payload extends ServiceFreeSchema$4, Result extends ServiceFreeSchema$4>(id: Id, definition: {
|
|
2341
2520
|
readonly payload: Payload;
|
|
2342
2521
|
readonly result: Result;
|
|
2343
|
-
}) => TagClass$
|
|
2522
|
+
}) => TagClass$2<Self, Id, Payload, Result>;
|
|
2344
2523
|
declare const implement$1: <ROut, const Self extends Definition$1.Any>(_definition: Self, handler: Handler$1<ROut, Self>) => Handler$1<ROut, Self>;
|
|
2345
2524
|
declare namespace Workflow_d_exports {
|
|
2346
|
-
export { Definition, Handler, LayerOptions, Options, Tag$
|
|
2525
|
+
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 };
|
|
2347
2526
|
}
|
|
2348
2527
|
interface WorkflowEventService<Payload = unknown> {
|
|
2349
2528
|
readonly raw: WorkflowEvent<unknown>;
|
|
2350
2529
|
readonly payload: Payload;
|
|
2351
2530
|
readonly timestamp: Date;
|
|
2352
2531
|
readonly instanceId: string;
|
|
2532
|
+
readonly workflowName: string;
|
|
2353
2533
|
}
|
|
2354
2534
|
declare const WorkflowEvent_base: Context.ServiceClass<WorkflowEvent$1, "effect-cf/WorkflowEvent", WorkflowEventService<unknown>>;
|
|
2355
2535
|
declare class WorkflowEvent$1 extends WorkflowEvent_base {}
|
|
@@ -2376,7 +2556,7 @@ interface WorkflowOptions<ROut, Payload = unknown, Result = unknown> {
|
|
|
2376
2556
|
type WorkflowClass<Payload, Result, _ROut> = new (ctx: globalThis.ExecutionContext, env: WorkerEnv) => WorkflowEntrypoint<WorkerEnv, Payload> & {
|
|
2377
2557
|
run(event: Readonly<WorkflowEvent<Payload>>, step: WorkflowStep): Promise<Result>;
|
|
2378
2558
|
};
|
|
2379
|
-
declare const make: <ROut, LayerError, Payload = unknown, Result = unknown>(layer: Layer.Layer<ROut, LayerError, ExecutionContext | WorkerContext | WorkerEnvironment>, options: WorkflowOptions<ROut, Payload, Result>) => WorkflowClass<Payload, Result, ROut>;
|
|
2559
|
+
declare const make$1: <ROut, LayerError, Payload = unknown, Result = unknown>(layer: Layer.Layer<ROut, LayerError, ExecutionContext | WorkerContext | WorkerEnvironment>, options: WorkflowOptions<ROut, Payload, Result>) => WorkflowClass<Payload, Result, ROut>;
|
|
2380
2560
|
declare const step: <A, E, R>(name: string, effect: Effect.Effect<A, E, R>, config?: WorkflowStepConfig) => Effect.Effect<A, unknown, WorkflowStep$1 | Exclude<R, WorkflowStepContext$1>>;
|
|
2381
2561
|
declare const sleep: (name: string, duration: WorkflowSleepDuration) => Effect.Effect<void, unknown, WorkflowStep$1>;
|
|
2382
2562
|
declare const sleepUntil: (name: string, timestamp: Date | number) => Effect.Effect<void, unknown, WorkflowStep$1>;
|
|
@@ -2388,14 +2568,74 @@ type Definition<Id extends string = string, Payload extends Definition$1.Any["pa
|
|
|
2388
2568
|
declare namespace Definition {
|
|
2389
2569
|
type Any = Definition$1.Any;
|
|
2390
2570
|
}
|
|
2391
|
-
type LayerOptions = LayerOptions$
|
|
2392
|
-
type TagClass<Self, Id extends string, Payload extends Definition$1.Any["payload"], Result extends Definition$1.Any["result"]> = TagClass$
|
|
2393
|
-
declare const Tag$
|
|
2571
|
+
type LayerOptions$1 = LayerOptions$2;
|
|
2572
|
+
type TagClass$1<Self, Id extends string, Payload extends Definition$1.Any["payload"], Result extends Definition$1.Any["result"]> = TagClass$2<Self, Id, Payload, Result>;
|
|
2573
|
+
declare const Tag$2: <Self>() => <Id extends string, Payload extends Definition$1.Any["payload"], Result extends Definition$1.Any["result"]>(id: Id, definition: {
|
|
2394
2574
|
readonly payload: Payload;
|
|
2395
2575
|
readonly result: Result;
|
|
2396
|
-
}) => TagClass<Self, Id, Payload, Result>;
|
|
2576
|
+
}) => TagClass$1<Self, Id, Payload, Result>;
|
|
2397
2577
|
declare const implement: <ROut, const Self extends Definition$1.Any>(_definition: Self, handler: Handler$1<ROut, Self>) => Handler$1<ROut, Self>;
|
|
2398
2578
|
type Handler<ROut, Self extends Definition$1.Any> = Handler$1<ROut, Self>;
|
|
2399
2579
|
type Options<ROut, Self extends Definition$1.Any> = Options$1<ROut, Self>;
|
|
2580
|
+
declare namespace Vectorize_d_exports {
|
|
2581
|
+
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 };
|
|
2582
|
+
}
|
|
2583
|
+
declare const VectorizeOperationError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
|
|
2584
|
+
readonly _tag: "VectorizeOperationError";
|
|
2585
|
+
} & Readonly<A>;
|
|
2586
|
+
/** Error raised when a Vectorize operation fails. */
|
|
2587
|
+
declare class VectorizeOperationError extends VectorizeOperationError_base<{
|
|
2588
|
+
readonly binding: string;
|
|
2589
|
+
readonly operation: string;
|
|
2590
|
+
readonly cause: unknown;
|
|
2591
|
+
}> {}
|
|
2592
|
+
/** Typed Vectorize binding definition. */
|
|
2593
|
+
interface VectorizeDefinition {
|
|
2594
|
+
/** Binding name as configured in `wrangler.jsonc`. */
|
|
2595
|
+
readonly binding: string;
|
|
2596
|
+
}
|
|
2597
|
+
type VectorizeBinding = CloudflareVectorize | CloudflareVectorizeIndex;
|
|
2598
|
+
type VectorizeVector = CloudflareVectorizeVector;
|
|
2599
|
+
type VectorizeVectorMetadata = CloudflareVectorizeVectorMetadata;
|
|
2600
|
+
type VectorizeVectorMetadataValue = CloudflareVectorizeVectorMetadataValue;
|
|
2601
|
+
type VectorizeVectorMetadataFilter = CloudflareVectorizeVectorMetadataFilter;
|
|
2602
|
+
type VectorizeQueryOptions = CloudflareVectorizeQueryOptions;
|
|
2603
|
+
type VectorizeMatches = CloudflareVectorizeMatches;
|
|
2604
|
+
type VectorizeMatch = CloudflareVectorizeMatch;
|
|
2605
|
+
type VectorizeIndexInfo = CloudflareVectorizeIndexInfo;
|
|
2606
|
+
type VectorizeIndexDetails = CloudflareVectorizeIndexDetails;
|
|
2607
|
+
type VectorizeMutation = CloudflareVectorizeAsyncMutation | CloudflareVectorizeVectorMutation;
|
|
2608
|
+
type VectorizeValues = Float32Array | Float64Array | ReadonlyArray<number>;
|
|
2609
|
+
interface VectorizeClient {
|
|
2610
|
+
readonly describe: Effect.Effect<VectorizeIndexInfo | VectorizeIndexDetails, VectorizeOperationError>;
|
|
2611
|
+
readonly query: (vector: VectorizeValues, options?: VectorizeQueryOptions) => Effect.Effect<VectorizeMatches, VectorizeOperationError>;
|
|
2612
|
+
readonly queryById: (vectorId: string, options?: VectorizeQueryOptions) => Effect.Effect<VectorizeMatches, VectorizeOperationError>;
|
|
2613
|
+
readonly insert: (vectors: ReadonlyArray<VectorizeVector>) => Effect.Effect<VectorizeMutation, VectorizeOperationError>;
|
|
2614
|
+
readonly upsert: (vectors: ReadonlyArray<VectorizeVector>) => Effect.Effect<VectorizeMutation, VectorizeOperationError>;
|
|
2615
|
+
readonly deleteByIds: (ids: ReadonlyArray<string>) => Effect.Effect<VectorizeMutation, VectorizeOperationError>;
|
|
2616
|
+
readonly delete: (ids: ReadonlyArray<string>) => Effect.Effect<VectorizeMutation, VectorizeOperationError>;
|
|
2617
|
+
readonly getByIds: (ids: ReadonlyArray<string>) => Effect.Effect<ReadonlyArray<VectorizeVector>, VectorizeOperationError>;
|
|
2618
|
+
readonly unsafeRaw: Effect.Effect<VectorizeBinding>;
|
|
2619
|
+
readonly definition: VectorizeDefinition;
|
|
2620
|
+
}
|
|
2621
|
+
declare const VectorizeServiceTypeId: unique symbol;
|
|
2622
|
+
/** Nominal service marker for Vectorize services created with {@link make}. */
|
|
2623
|
+
interface VectorizeService<Id extends string> {
|
|
2624
|
+
readonly [VectorizeServiceTypeId]: {
|
|
2625
|
+
readonly id: Id;
|
|
2626
|
+
};
|
|
2627
|
+
}
|
|
2628
|
+
type LayerOptions = {
|
|
2629
|
+
readonly binding: string;
|
|
2630
|
+
};
|
|
2631
|
+
interface TagClass<Self, Id extends string> extends Context.ServiceClass<Self, Id, VectorizeClient> {
|
|
2632
|
+
readonly id: Id;
|
|
2633
|
+
readonly layer: (options: LayerOptions) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2634
|
+
}
|
|
2635
|
+
declare const isVectorizeBinding: (value: unknown) => value is VectorizeBinding;
|
|
2636
|
+
declare const makeClient: (definition: VectorizeDefinition) => (index: VectorizeBinding) => VectorizeClient;
|
|
2637
|
+
declare const layer: <Self>(tag: Context.Service<Self, VectorizeClient>, definition: VectorizeDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2638
|
+
declare const make: <Id extends string>(id: Id) => TagClass<VectorizeService<Id>, Id>;
|
|
2639
|
+
declare const Tag$1: <Self>() => <Id extends string>(id: Id) => TagClass<Self, Id>;
|
|
2400
2640
|
//#endregion
|
|
2401
|
-
export { Binding_d_exports as Binding, CloudflareOtlp_d_exports as CloudflareOtlp, 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, 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, Worker_d_exports as Worker, WorkerConfig, WorkerDefinition_d_exports as WorkerDefinition, type WorkerEnv, WorkerEnvironment, Workflow_d_exports as Workflow, WorkflowBinding_d_exports as WorkflowBinding, WorkflowDefinition_d_exports as WorkflowDefinition };
|
|
2641
|
+
export { AiGateway_d_exports as AiGateway, Binding_d_exports as Binding, BrowserRendering_d_exports as BrowserRendering, CloudflareOtlp_d_exports as CloudflareOtlp, 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 };
|