effect-cf 0.14.0 → 0.16.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 +12 -0
- package/README.md +110 -1
- package/dist/index.d.mts +322 -100
- package/dist/index.mjs +414 -103
- package/package.json +1 -1
- package/src/AnalyticsEngine.ts +846 -0
- package/src/Email.ts +134 -0
- package/src/index.ts +2 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
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";
|
|
2
|
+
import { Cause, Config, Context, Data, DateTime, Duration, Effect, Layer, Option, Redacted, Schema, Scope } from "effect";
|
|
3
|
+
import { Headers as Headers$1, HttpClient, HttpClientResponse, HttpServerRequest, HttpServerResponse } from "effect/unstable/http";
|
|
4
4
|
import { D1Client } from "@effect/sql-d1";
|
|
5
5
|
import { DurableObject, RpcStub, RpcTarget, WorkerEntrypoint, WorkflowEntrypoint, WorkflowEvent, WorkflowSleepDuration, WorkflowStep, WorkflowStepConfig, WorkflowStepContext, WorkflowStepEvent, WorkflowTimeoutDuration } from "cloudflare:workers";
|
|
6
6
|
import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization";
|
|
@@ -16,7 +16,7 @@ import * as _$effect_Config0 from "effect/Config";
|
|
|
16
16
|
|
|
17
17
|
//#region src/WorkersAi.d.ts
|
|
18
18
|
declare namespace WorkersAi_d_exports {
|
|
19
|
-
export { LayerOptions$
|
|
19
|
+
export { LayerOptions$18 as LayerOptions, Tag$17 as Tag, TagClass$16 as TagClass, WorkersAiAsyncBatchResponse, WorkersAiBinding, WorkersAiClient, WorkersAiDefinition, WorkersAiEmbeddingInput, WorkersAiEmbeddingResponse, WorkersAiModelsSearchObject, WorkersAiModelsSearchParams, WorkersAiOperationError, WorkersAiOptions, WorkersAiService, embeddingResponse, isWorkersAiBinding, layer$15 as layer, make$16 as make, makeClient$12 as makeClient };
|
|
20
20
|
}
|
|
21
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
22
|
readonly _tag: "WorkersAiOperationError";
|
|
@@ -75,24 +75,24 @@ interface WorkersAiService<Id extends string> {
|
|
|
75
75
|
readonly id: Id;
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
type LayerOptions$
|
|
78
|
+
type LayerOptions$18 = {
|
|
79
79
|
readonly binding: string;
|
|
80
80
|
};
|
|
81
|
-
interface TagClass$
|
|
81
|
+
interface TagClass$16<Self, Id extends string, ModelList extends AiModelListType = AiModels> extends Context.ServiceClass<Self, Id, WorkersAiClient<ModelList>> {
|
|
82
82
|
readonly id: Id;
|
|
83
|
-
readonly layer: (options: LayerOptions$
|
|
83
|
+
readonly layer: (options: LayerOptions$18) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
84
84
|
}
|
|
85
85
|
declare const isWorkersAiBinding: (value: unknown) => value is WorkersAiBinding;
|
|
86
86
|
declare const embeddingResponse: (value: {
|
|
87
87
|
readonly data?: ReadonlyArray<ReadonlyArray<number>>;
|
|
88
88
|
readonly shape?: ReadonlyArray<number>;
|
|
89
89
|
}) => WorkersAiEmbeddingResponse;
|
|
90
|
-
declare const makeClient$
|
|
91
|
-
declare const layer$
|
|
92
|
-
declare const make$
|
|
93
|
-
declare const Tag$
|
|
90
|
+
declare const makeClient$12: <ModelList extends AiModelListType = AiModels>(definition: WorkersAiDefinition) => (ai: WorkersAiBinding<ModelList>) => WorkersAiClient<ModelList>;
|
|
91
|
+
declare const layer$15: <Self, ModelList extends AiModelListType = AiModels>(tag: Context.Service<Self, WorkersAiClient<ModelList>>, definition: WorkersAiDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
92
|
+
declare const make$16: <Id extends string>(id: Id) => TagClass$16<WorkersAiService<Id>, Id, AiModels>;
|
|
93
|
+
declare const Tag$17: <Self>() => <Id extends string, ModelList extends AiModelListType = AiModels>(id: Id) => TagClass$16<Self, Id, ModelList>;
|
|
94
94
|
declare namespace AiGateway_d_exports {
|
|
95
|
-
export { AiGatewayBinding, AiGatewayClient, AiGatewayDefinition, AiGatewayFetchOptions, AiGatewayHeaders, AiGatewayLog, AiGatewayOperationError, AiGatewayPatchLog, AiGatewayProvider, AiGatewayRunOptions, AiGatewayService, AiGatewayUniversalRequest, LayerOptions$
|
|
95
|
+
export { AiGatewayBinding, AiGatewayClient, AiGatewayDefinition, AiGatewayFetchOptions, AiGatewayHeaders, AiGatewayLog, AiGatewayOperationError, AiGatewayPatchLog, AiGatewayProvider, AiGatewayRunOptions, AiGatewayService, AiGatewayUniversalRequest, LayerOptions$17 as LayerOptions, Tag$16 as Tag, TagClass$15 as TagClass, isAiGatewayBinding, layer$14 as layer, make$15 as make, makeClient$11 as makeClient, makeClientFromAi, makeHttpClient };
|
|
96
96
|
}
|
|
97
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
98
|
readonly _tag: "AiGatewayOperationError";
|
|
@@ -141,17 +141,17 @@ interface AiGatewayService<Id extends string> {
|
|
|
141
141
|
readonly id: Id;
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
-
type LayerOptions$
|
|
144
|
+
type LayerOptions$17 = {
|
|
145
145
|
readonly binding: string;
|
|
146
146
|
readonly gatewayId: string;
|
|
147
147
|
readonly accountId?: string;
|
|
148
148
|
};
|
|
149
|
-
interface TagClass$
|
|
149
|
+
interface TagClass$15<Self, Id extends string> extends Context.ServiceClass<Self, Id, AiGatewayClient> {
|
|
150
150
|
readonly id: Id;
|
|
151
|
-
readonly layer: (options: LayerOptions$
|
|
151
|
+
readonly layer: (options: LayerOptions$17) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError | AiGatewayOperationError, WorkerEnvironment>;
|
|
152
152
|
}
|
|
153
153
|
declare const isAiGatewayBinding: (value: unknown) => value is WorkersAiBinding;
|
|
154
|
-
declare const makeClient$
|
|
154
|
+
declare const makeClient$11: (definition: AiGatewayDefinition, gateway: AiGatewayBinding) => {
|
|
155
155
|
definition: AiGatewayDefinition;
|
|
156
156
|
run: (data: _$_cloudflare_workers_types0.AIGatewayUniversalRequest | readonly _$_cloudflare_workers_types0.AIGatewayUniversalRequest[], options: {
|
|
157
157
|
gateway?: _$_cloudflare_workers_types0.UniversalGatewayOptions;
|
|
@@ -169,11 +169,182 @@ declare const makeHttpClient: (definition: Omit<AiGatewayDefinition, "binding">
|
|
|
169
169
|
readonly accountId: string;
|
|
170
170
|
readonly binding?: string;
|
|
171
171
|
}, request?: typeof fetch) => AiGatewayClient;
|
|
172
|
-
declare const layer$
|
|
173
|
-
declare const make$
|
|
174
|
-
declare const Tag$
|
|
172
|
+
declare const layer$14: <Self>(tag: Context.Service<Self, AiGatewayClient>, definition: AiGatewayDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
173
|
+
declare const make$15: <Id extends string>(id: Id) => TagClass$15<AiGatewayService<Id>, Id>;
|
|
174
|
+
declare const Tag$16: <Self>() => <Id extends string>(id: Id) => TagClass$15<Self, Id>;
|
|
175
|
+
declare namespace AnalyticsEngine_d_exports {
|
|
176
|
+
export { AnalyticsEngineBinding, AnalyticsEngineClient, AnalyticsEngineDataPoint, AnalyticsEngineDataPointSchema, AnalyticsEngineDefinition, AnalyticsEngineFieldValue, AnalyticsEngineFieldValueSchema, AnalyticsEngineInvalidWritePolicy, AnalyticsEngineOperationError, AnalyticsEngineQueryClient, AnalyticsEngineQueryColumn, AnalyticsEngineQueryDefinition, AnalyticsEngineQueryError, AnalyticsEngineQueryOptions, AnalyticsEngineQueryResult, AnalyticsEngineQueryRow, AnalyticsEngineQueryService, AnalyticsEngineService, AnalyticsEngineWriteBatchOptions, AnalyticsEngineWriteError, AnalyticsEngineWriteOptions, AnalyticsEngineWritePolicy, AnalyticsEngineWriteValidationError, AnalyticsEngineWriteViolation, LayerOptions$16 as LayerOptions, QueryConfigOptions, QueryTag, QueryTagClass, Tag$15 as Tag, TagClass$14 as TagClass, isAnalyticsEngineDataset, layer$13 as layer, make$14 as make, makeClient$10 as makeClient, makeQuery, makeQueryClient, queryConfig, queryFetchLayer, queryFetchLayerConfig, queryLayer, queryLayerConfig, writeLimits };
|
|
177
|
+
}
|
|
178
|
+
declare const writeLimits: {
|
|
179
|
+
readonly maxBlobs: 20;
|
|
180
|
+
readonly maxDoubles: 20;
|
|
181
|
+
readonly maxIndexes: 1;
|
|
182
|
+
readonly maxBlobBytes: number;
|
|
183
|
+
readonly maxIndexBytes: 96;
|
|
184
|
+
readonly maxDataPointsPerInvocation: 250;
|
|
185
|
+
};
|
|
186
|
+
declare const queryColumnSchema: Schema.Struct<{
|
|
187
|
+
readonly name: Schema.String;
|
|
188
|
+
readonly type: Schema.String;
|
|
189
|
+
}>;
|
|
190
|
+
declare const queryRowSchema: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
191
|
+
declare const AnalyticsEngineFieldValueSchema: Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.instanceOf<ArrayBuffer, unknown>]>>;
|
|
192
|
+
declare const AnalyticsEngineDataPointSchema: Schema.Struct<{
|
|
193
|
+
readonly indexes: Schema.optional<Schema.$Array<Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.instanceOf<ArrayBuffer, unknown>]>>>>;
|
|
194
|
+
readonly doubles: Schema.optional<Schema.$Array<Schema.Finite>>;
|
|
195
|
+
readonly blobs: Schema.optional<Schema.$Array<Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.instanceOf<ArrayBuffer, unknown>]>>>>;
|
|
196
|
+
}>;
|
|
197
|
+
declare const AnalyticsEngineOperationError_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 & {
|
|
198
|
+
readonly _tag: "AnalyticsEngineOperationError";
|
|
199
|
+
} & Readonly<A>;
|
|
200
|
+
/** Error raised when an Analytics Engine operation fails. */
|
|
201
|
+
declare class AnalyticsEngineOperationError extends AnalyticsEngineOperationError_base<{
|
|
202
|
+
readonly binding: string;
|
|
203
|
+
readonly operation: string;
|
|
204
|
+
readonly cause: unknown;
|
|
205
|
+
}> {}
|
|
206
|
+
interface AnalyticsEngineWriteViolation {
|
|
207
|
+
readonly path: string;
|
|
208
|
+
readonly message: string;
|
|
209
|
+
readonly limit?: number;
|
|
210
|
+
readonly actual?: number;
|
|
211
|
+
}
|
|
212
|
+
declare const AnalyticsEngineWriteValidationError_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 & {
|
|
213
|
+
readonly _tag: "AnalyticsEngineWriteValidationError";
|
|
214
|
+
} & Readonly<A>;
|
|
215
|
+
/** Error raised when an Analytics Engine write input violates Cloudflare limits. */
|
|
216
|
+
declare class AnalyticsEngineWriteValidationError extends AnalyticsEngineWriteValidationError_base<{
|
|
217
|
+
readonly binding: string;
|
|
218
|
+
readonly operation: string;
|
|
219
|
+
readonly violations: ReadonlyArray<AnalyticsEngineWriteViolation>;
|
|
220
|
+
readonly cause?: unknown;
|
|
221
|
+
}> {}
|
|
222
|
+
declare const AnalyticsEngineQueryError_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 & {
|
|
223
|
+
readonly _tag: "AnalyticsEngineQueryError";
|
|
224
|
+
} & Readonly<A>;
|
|
225
|
+
/** Error raised when an Analytics Engine SQL API query fails. */
|
|
226
|
+
declare class AnalyticsEngineQueryError extends AnalyticsEngineQueryError_base<{
|
|
227
|
+
readonly operation: string;
|
|
228
|
+
readonly accountId: string;
|
|
229
|
+
readonly message: string;
|
|
230
|
+
readonly status?: number;
|
|
231
|
+
readonly body?: string;
|
|
232
|
+
readonly cause?: unknown;
|
|
233
|
+
}> {}
|
|
234
|
+
/** Typed Analytics Engine dataset binding definition. */
|
|
235
|
+
interface AnalyticsEngineDefinition {
|
|
236
|
+
/** Binding name as configured in `wrangler.jsonc`. */
|
|
237
|
+
readonly binding: string;
|
|
238
|
+
}
|
|
239
|
+
type AnalyticsEngineBinding = CloudflareAnalyticsEngineDataset;
|
|
240
|
+
type AnalyticsEngineDataPoint = CloudflareAnalyticsEngineDataPoint;
|
|
241
|
+
type AnalyticsEngineFieldValue = ArrayBuffer | string | null;
|
|
242
|
+
type AnalyticsEngineWriteError = AnalyticsEngineOperationError | AnalyticsEngineWriteValidationError;
|
|
243
|
+
type AnalyticsEngineInvalidWritePolicy = "error" | "drop";
|
|
244
|
+
type AnalyticsEngineQueryColumn = Schema.Schema.Type<typeof queryColumnSchema>;
|
|
245
|
+
type AnalyticsEngineQueryRow = Schema.Schema.Type<typeof queryRowSchema>;
|
|
246
|
+
interface AnalyticsEngineWriteOptions {
|
|
247
|
+
/**
|
|
248
|
+
* Controls invalid write behavior. The default is `"error"`, which fails with
|
|
249
|
+
* `AnalyticsEngineWriteValidationError`. `"drop"` skips invalid points.
|
|
250
|
+
*/
|
|
251
|
+
readonly onInvalid?: AnalyticsEngineInvalidWritePolicy;
|
|
252
|
+
}
|
|
253
|
+
interface AnalyticsEngineWriteBatchOptions extends AnalyticsEngineWriteOptions {
|
|
254
|
+
/**
|
|
255
|
+
* Maximum points per native batch call. Values are clamped to Cloudflare's
|
|
256
|
+
* per-invocation limit.
|
|
257
|
+
*/
|
|
258
|
+
readonly batchSize?: number;
|
|
259
|
+
}
|
|
260
|
+
type AnalyticsEngineWritePolicy = AnalyticsEngineWriteBatchOptions;
|
|
261
|
+
interface AnalyticsEngineQueryResult<Row = AnalyticsEngineQueryRow> {
|
|
262
|
+
readonly meta: ReadonlyArray<AnalyticsEngineQueryColumn>;
|
|
263
|
+
readonly data: ReadonlyArray<Row>;
|
|
264
|
+
readonly rows: number;
|
|
265
|
+
}
|
|
266
|
+
interface AnalyticsEngineQueryDefinition {
|
|
267
|
+
/** Cloudflare account id that owns the Analytics Engine datasets. */
|
|
268
|
+
readonly accountId: string;
|
|
269
|
+
/** API token with Account Analytics Read permission. */
|
|
270
|
+
readonly apiToken: Redacted.Redacted<string>;
|
|
271
|
+
/** Base Cloudflare API URL. Defaults to `https://api.cloudflare.com/client/v4`. */
|
|
272
|
+
readonly apiBaseUrl?: string | URL;
|
|
273
|
+
}
|
|
274
|
+
interface AnalyticsEngineQueryOptions {
|
|
275
|
+
/** Additional request headers. Authorization is always derived from `apiToken`. */
|
|
276
|
+
readonly headers?: Headers$1.Input;
|
|
277
|
+
}
|
|
278
|
+
interface AnalyticsEngineClient {
|
|
279
|
+
readonly writeDataPoint: (dataPoint?: AnalyticsEngineDataPoint, options?: AnalyticsEngineWriteOptions) => Effect.Effect<void, AnalyticsEngineWriteError>;
|
|
280
|
+
readonly write: (dataPoint?: AnalyticsEngineDataPoint, options?: AnalyticsEngineWriteOptions) => Effect.Effect<void, AnalyticsEngineWriteError>;
|
|
281
|
+
readonly writeDataPoints: (dataPoints: ReadonlyArray<AnalyticsEngineDataPoint>, options?: AnalyticsEngineWriteBatchOptions) => Effect.Effect<void, AnalyticsEngineWriteError>;
|
|
282
|
+
readonly writeBatch: (dataPoints: ReadonlyArray<AnalyticsEngineDataPoint>, options?: AnalyticsEngineWriteBatchOptions) => Effect.Effect<void, AnalyticsEngineWriteError>;
|
|
283
|
+
readonly unsafeRaw: Effect.Effect<AnalyticsEngineBinding>;
|
|
284
|
+
readonly definition: AnalyticsEngineDefinition;
|
|
285
|
+
}
|
|
286
|
+
interface AnalyticsEngineQueryClient {
|
|
287
|
+
readonly query: (sql: string, options?: AnalyticsEngineQueryOptions) => Effect.Effect<AnalyticsEngineQueryResult, AnalyticsEngineQueryError | Schema.SchemaError>;
|
|
288
|
+
readonly queryResult: <Row>(row: Schema.Codec<Row, unknown>, sql: string, options?: AnalyticsEngineQueryOptions) => Effect.Effect<AnalyticsEngineQueryResult<Row>, AnalyticsEngineQueryError | Schema.SchemaError>;
|
|
289
|
+
readonly queryRows: <Row>(row: Schema.Codec<Row, unknown>, sql: string, options?: AnalyticsEngineQueryOptions) => Effect.Effect<ReadonlyArray<Row>, AnalyticsEngineQueryError | Schema.SchemaError>;
|
|
290
|
+
readonly queryOne: <Row>(row: Schema.Codec<Row, unknown>, sql: string, options?: AnalyticsEngineQueryOptions) => Effect.Effect<Option.Option<Row>, AnalyticsEngineQueryError | Schema.SchemaError>;
|
|
291
|
+
readonly queryText: (sql: string, options?: AnalyticsEngineQueryOptions) => Effect.Effect<string, AnalyticsEngineQueryError>;
|
|
292
|
+
readonly raw: (sql: string, options?: AnalyticsEngineQueryOptions) => Effect.Effect<HttpClientResponse.HttpClientResponse, AnalyticsEngineQueryError>;
|
|
293
|
+
readonly definition: AnalyticsEngineQueryDefinition;
|
|
294
|
+
}
|
|
295
|
+
declare const AnalyticsEngineServiceTypeId: unique symbol;
|
|
296
|
+
declare const AnalyticsEngineQueryServiceTypeId: unique symbol;
|
|
297
|
+
/** Nominal service marker for Analytics Engine services created with {@link make}. */
|
|
298
|
+
interface AnalyticsEngineService<Id extends string> {
|
|
299
|
+
readonly [AnalyticsEngineServiceTypeId]: {
|
|
300
|
+
readonly id: Id;
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
/** Nominal service marker for Analytics Engine query services created with {@link makeQuery}. */
|
|
304
|
+
interface AnalyticsEngineQueryService<Id extends string> {
|
|
305
|
+
readonly [AnalyticsEngineQueryServiceTypeId]: {
|
|
306
|
+
readonly id: Id;
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
type LayerOptions$16 = {
|
|
310
|
+
readonly binding: string;
|
|
311
|
+
readonly write?: AnalyticsEngineWritePolicy;
|
|
312
|
+
};
|
|
313
|
+
type QueryConfigOptions = {
|
|
314
|
+
readonly accountId?: Config.Config<string>;
|
|
315
|
+
readonly apiToken?: Config.Config<Redacted.Redacted<string>>;
|
|
316
|
+
readonly apiBaseUrl?: Config.Config<string>;
|
|
317
|
+
};
|
|
318
|
+
interface TagClass$14<Self, Id extends string> extends Context.ServiceClass<Self, Id, AnalyticsEngineClient> {
|
|
319
|
+
readonly id: Id;
|
|
320
|
+
readonly layer: (options: LayerOptions$16) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
321
|
+
}
|
|
322
|
+
interface QueryTagClass<Self, Id extends string> extends Context.ServiceClass<Self, Id, AnalyticsEngineQueryClient> {
|
|
323
|
+
readonly id: Id;
|
|
324
|
+
readonly layer: (definition: AnalyticsEngineQueryDefinition) => Layer.Layer<Self, never, HttpClient.HttpClient>;
|
|
325
|
+
readonly fetchLayer: (definition: AnalyticsEngineQueryDefinition) => Layer.Layer<Self>;
|
|
326
|
+
readonly layerConfig: (config?: Config.Config<AnalyticsEngineQueryDefinition>) => Layer.Layer<Self, Config.ConfigError, HttpClient.HttpClient>;
|
|
327
|
+
readonly fetchLayerConfig: (config?: Config.Config<AnalyticsEngineQueryDefinition>) => Layer.Layer<Self, Config.ConfigError>;
|
|
328
|
+
}
|
|
329
|
+
declare const makeQueryClient: (definition: AnalyticsEngineQueryDefinition) => Effect.Effect<AnalyticsEngineQueryClient, never, HttpClient.HttpClient>;
|
|
330
|
+
declare const isAnalyticsEngineDataset: (value: unknown) => value is AnalyticsEngineBinding;
|
|
331
|
+
declare const makeClient$10: (definition: AnalyticsEngineDefinition, defaults?: AnalyticsEngineWritePolicy) => (dataset: AnalyticsEngineBinding) => AnalyticsEngineClient;
|
|
332
|
+
declare const queryConfig: (options?: QueryConfigOptions) => Config.Config<{
|
|
333
|
+
accountId: string;
|
|
334
|
+
apiToken: Redacted.Redacted<string>;
|
|
335
|
+
apiBaseUrl: string;
|
|
336
|
+
}>;
|
|
337
|
+
declare const queryLayer: <Self>(tag: Context.Service<Self, AnalyticsEngineQueryClient>, definition: AnalyticsEngineQueryDefinition) => Layer.Layer<Self, never, HttpClient.HttpClient>;
|
|
338
|
+
declare const queryFetchLayer: <Self>(tag: Context.Service<Self, AnalyticsEngineQueryClient>, definition: AnalyticsEngineQueryDefinition) => Layer.Layer<Self, never, never>;
|
|
339
|
+
declare const queryLayerConfig: <Self>(tag: Context.Service<Self, AnalyticsEngineQueryClient>, config?: Config.Config<AnalyticsEngineQueryDefinition>) => Layer.Layer<Self, Config.ConfigError, HttpClient.HttpClient>;
|
|
340
|
+
declare const queryFetchLayerConfig: <Self>(tag: Context.Service<Self, AnalyticsEngineQueryClient>, config?: Config.Config<AnalyticsEngineQueryDefinition>) => Layer.Layer<Self, Config.ConfigError, never>;
|
|
341
|
+
declare const layer$13: <Self>(tag: Context.Service<Self, AnalyticsEngineClient>, definition: LayerOptions$16) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
342
|
+
declare const make$14: <Id extends string>(id: Id) => TagClass$14<AnalyticsEngineService<Id>, Id>;
|
|
343
|
+
declare const makeQuery: <Id extends string>(id: Id) => QueryTagClass<AnalyticsEngineQueryService<Id>, Id>;
|
|
344
|
+
declare const Tag$15: <Self>() => <Id extends string>(id: Id) => TagClass$14<Self, Id>;
|
|
345
|
+
declare const QueryTag: <Self>() => <Id extends string>(id: Id) => QueryTagClass<Self, Id>;
|
|
175
346
|
declare namespace BrowserRendering_d_exports {
|
|
176
|
-
export { BrowserRenderingBinding, BrowserRenderingBrowserClient, BrowserRenderingBrowserLike, BrowserRenderingClient, BrowserRenderingConnect, BrowserRenderingDefinition, BrowserRenderingLaunch, BrowserRenderingOperationError, BrowserRenderingPageClient, BrowserRenderingPageLike, BrowserRenderingService, LayerOptions$
|
|
347
|
+
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
348
|
}
|
|
178
349
|
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
350
|
readonly _tag: "BrowserRenderingOperationError";
|
|
@@ -237,18 +408,18 @@ interface BrowserRenderingService<Id extends string> {
|
|
|
237
408
|
readonly id: Id;
|
|
238
409
|
};
|
|
239
410
|
}
|
|
240
|
-
type LayerOptions$
|
|
411
|
+
type LayerOptions$15 = {
|
|
241
412
|
readonly binding: string;
|
|
242
413
|
};
|
|
243
|
-
interface TagClass$
|
|
414
|
+
interface TagClass$13<Self, Id extends string> extends Context.ServiceClass<Self, Id, BrowserRenderingClient> {
|
|
244
415
|
readonly id: Id;
|
|
245
|
-
readonly layer: (options: LayerOptions$
|
|
416
|
+
readonly layer: (options: LayerOptions$15) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
246
417
|
}
|
|
247
418
|
declare const isBrowserRenderingBinding: (value: unknown) => value is BrowserRenderingBinding;
|
|
248
|
-
declare const makeClient$
|
|
249
|
-
declare const layer$
|
|
250
|
-
declare const make$
|
|
251
|
-
declare const Tag$
|
|
419
|
+
declare const makeClient$9: <RawBinding extends BrowserRenderingBinding = BrowserRenderingBinding>(definition: BrowserRenderingDefinition) => (binding: RawBinding) => BrowserRenderingClient<RawBinding>;
|
|
420
|
+
declare const layer$12: <Self>(tag: Context.Service<Self, BrowserRenderingClient>, definition: BrowserRenderingDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
421
|
+
declare const make$13: <Id extends string>(id: Id) => TagClass$13<BrowserRenderingService<Id>, Id>;
|
|
422
|
+
declare const Tag$14: <Self>() => <Id extends string>(id: Id) => TagClass$13<Self, Id>;
|
|
252
423
|
declare namespace DurableObjectStorage_d_exports {
|
|
253
424
|
export { DurableObjectStorage, DurableObjectTransaction, SchemaBackedSyncKvStorage, SqlCursor, SqlStorage, SqlStorageValue, StorageOperationError, SyncKvDefinition, SyncKvStorage, fromDurableObjectStorage };
|
|
254
425
|
}
|
|
@@ -551,7 +722,7 @@ declare class DurableObjectState extends DurableObjectState_base {}
|
|
|
551
722
|
*/
|
|
552
723
|
declare const fromDurableObjectState: (state: globalThis.DurableObjectState) => DurableObjectStateService;
|
|
553
724
|
declare namespace CloudflareOtlp_d_exports {
|
|
554
|
-
export { DurableObjectLayerOptions, LayerOptions$
|
|
725
|
+
export { DurableObjectLayerOptions, LayerOptions$14 as LayerOptions, ResourceOptions, Serialization, Signal, WorkerLayerOptions, durableObjectLayer, layer$11 as layer, layerJson, layerProtobuf, workerLayer };
|
|
555
726
|
}
|
|
556
727
|
/** Telemetry signal groups supported by the Cloudflare OTLP layers. */
|
|
557
728
|
type Signal = "logs" | "traces" | "metrics";
|
|
@@ -567,7 +738,7 @@ interface ResourceOptions {
|
|
|
567
738
|
readonly attributes?: Record<string, unknown>;
|
|
568
739
|
}
|
|
569
740
|
/** Options shared by all Cloudflare OTLP telemetry layers. */
|
|
570
|
-
interface LayerOptions$
|
|
741
|
+
interface LayerOptions$14 {
|
|
571
742
|
/**
|
|
572
743
|
* Telemetry signals to export. Defaults to logs, traces, and metrics.
|
|
573
744
|
*
|
|
@@ -594,12 +765,12 @@ interface LayerOptions$13 {
|
|
|
594
765
|
readonly tracerContext?: <X>(primitive: Tracer.EffectPrimitive<X>, span: Tracer.AnySpan) => X;
|
|
595
766
|
}
|
|
596
767
|
/** Resource metadata specific to Cloudflare Workers. */
|
|
597
|
-
interface WorkerLayerOptions extends LayerOptions$
|
|
768
|
+
interface WorkerLayerOptions extends LayerOptions$14 {
|
|
598
769
|
/** Cloudflare Worker name to attach as `cloudflare.worker.name`. */
|
|
599
770
|
readonly workerName?: string;
|
|
600
771
|
}
|
|
601
772
|
/** Resource metadata specific to Cloudflare Durable Objects. */
|
|
602
|
-
interface DurableObjectLayerOptions extends LayerOptions$
|
|
773
|
+
interface DurableObjectLayerOptions extends LayerOptions$14 {
|
|
603
774
|
/** Durable Object class name to attach as `cloudflare.durable_object.class`. */
|
|
604
775
|
readonly className?: string;
|
|
605
776
|
/**
|
|
@@ -617,11 +788,11 @@ interface DurableObjectLayerOptions extends LayerOptions$13 {
|
|
|
617
788
|
* installed as the primary `ConfigProvider`; outside Cloudflare, the ambient
|
|
618
789
|
* Effect `ConfigProvider` remains the fallback.
|
|
619
790
|
*/
|
|
620
|
-
declare const layer$
|
|
791
|
+
declare const layer$11: (options?: LayerOptions$14) => Layer.Layer<never, never, never>;
|
|
621
792
|
/** Base OTLP telemetry layer forced to JSON serialization. */
|
|
622
|
-
declare const layerJson: (options?: Omit<LayerOptions$
|
|
793
|
+
declare const layerJson: (options?: Omit<LayerOptions$14, "serialization">) => Layer.Layer<never, never, never>;
|
|
623
794
|
/** Base OTLP telemetry layer forced to protobuf serialization. */
|
|
624
|
-
declare const layerProtobuf: (options?: Omit<LayerOptions$
|
|
795
|
+
declare const layerProtobuf: (options?: Omit<LayerOptions$14, "serialization">) => Layer.Layer<never, never, never>;
|
|
625
796
|
/**
|
|
626
797
|
* OTLP layer with Cloudflare Worker resource attributes.
|
|
627
798
|
*
|
|
@@ -638,7 +809,7 @@ declare const workerLayer: (options?: WorkerLayerOptions) => Layer.Layer<never,
|
|
|
638
809
|
*/
|
|
639
810
|
declare const durableObjectLayer: (options?: DurableObjectLayerOptions) => Layer.Layer<never, never, DurableObjectState>;
|
|
640
811
|
declare namespace D1_d_exports {
|
|
641
|
-
export { D1Definition, D1Service, D1SqlLayerOptions, Service$1 as Service, make$
|
|
812
|
+
export { D1Definition, D1Service, D1SqlLayerOptions, Service$1 as Service, make$12 as make };
|
|
642
813
|
}
|
|
643
814
|
/** Typed D1 binding definition. */
|
|
644
815
|
interface D1Definition {
|
|
@@ -657,7 +828,7 @@ interface D1Service<Id extends string> {
|
|
|
657
828
|
/**
|
|
658
829
|
* Creates a typed D1 service tag plus Effect helpers.
|
|
659
830
|
*/
|
|
660
|
-
declare const make$
|
|
831
|
+
declare const make$12: <Id extends string>(id: Id, definition: D1Definition) => BindingService<D1Service<Id>, Id, D1Database> & {
|
|
661
832
|
"effect-cf/D1": "effect-cf/D1";
|
|
662
833
|
definition: D1Definition;
|
|
663
834
|
sqlLayer: (options?: D1SqlLayerOptions) => Layer.Layer<D1Client.D1Client | _$effect_unstable_sql_SqlClient0.SqlClient, BindingNotFoundError | BindingValidationError | _$effect_Config0.ConfigError, WorkerEnvironment>;
|
|
@@ -683,7 +854,7 @@ declare const Service$1: <Self>() => <Id extends string>(id: Id, definition: D1D
|
|
|
683
854
|
sqlLayer: (options?: D1SqlLayerOptions) => Layer.Layer<D1Client.D1Client | _$effect_unstable_sql_SqlClient0.SqlClient, BindingNotFoundError | BindingValidationError | _$effect_Config0.ConfigError, WorkerEnvironment | Exclude<Exclude<Self, _$effect_Scope0.Scope>, Self>>;
|
|
684
855
|
};
|
|
685
856
|
declare namespace Rpc_d_exports {
|
|
686
|
-
export { DisposableValue, MethodArgs, MethodKey, MethodReturn, Provider, Result, RpcStub, RpcTarget, Serializable, Stub, Stubable, Stubify, dispose, isDisposable, resolve, scoped };
|
|
857
|
+
export { DisposableValue, MethodArgs, MethodKey, MethodReturn, Provider, Result$1 as Result, RpcStub, RpcTarget, Serializable, Stub, Stubable, Stubify, dispose, isDisposable, resolve, scoped };
|
|
687
858
|
}
|
|
688
859
|
type Stubable = Rpc.Stubable;
|
|
689
860
|
type Stub<T extends Stubable> = Rpc.Stub<T>;
|
|
@@ -695,7 +866,7 @@ type Stubify<T> = T extends Stubable ? Stub<T> : T extends Map<infer Key, infer
|
|
|
695
866
|
} ? { [Key in keyof T]: Stubify<T[Key]> } : T;
|
|
696
867
|
type MaybeProvider<T> = T extends object ? Provider<T> : unknown;
|
|
697
868
|
type MaybeDisposable<T> = T extends object ? Disposable : unknown;
|
|
698
|
-
type Result<T> = T extends Stubable ? Promise<Stub<T>> & Provider<T> : T extends Serializable<T> ? Promise<Stubify<T> & MaybeDisposable<T>> & MaybeProvider<T> : never;
|
|
869
|
+
type Result$1<T> = T extends Stubable ? Promise<Stub<T>> & Provider<T> : T extends Serializable<T> ? Promise<Stubify<T> & MaybeDisposable<T>> & MaybeProvider<T> : never;
|
|
699
870
|
type MethodKey<Api> = { [Key in keyof Api]-?: Key extends string ? Api[Key] extends ((...args: Array<any>) => unknown) ? Key : never : never }[keyof Api];
|
|
700
871
|
type MethodArgs<Api, Method extends keyof Api> = Api[Method] extends ((...args: infer Args) => unknown) ? Args : never;
|
|
701
872
|
type MethodReturn<Api, Method extends keyof Api> = Api[Method] extends ((...args: Array<any>) => infer Return) ? Return : never;
|
|
@@ -707,7 +878,7 @@ declare const dispose: (value: unknown) => Effect.Effect<void>;
|
|
|
707
878
|
declare const resolve: <A>(value: A) => Effect.Effect<Awaited<A>, unknown>;
|
|
708
879
|
declare const scoped: <A>(value: A) => Effect.Effect<Awaited<A>, unknown, Scope.Scope>;
|
|
709
880
|
declare namespace RpcDefinition_d_exports {
|
|
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$
|
|
881
|
+
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 };
|
|
711
882
|
}
|
|
712
883
|
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 & {
|
|
713
884
|
readonly _tag: "RpcReservedMethodNameError";
|
|
@@ -806,9 +977,9 @@ declare const decodeArgs: <const Self extends Definition$9.Any, MethodName exten
|
|
|
806
977
|
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>;
|
|
807
978
|
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>;
|
|
808
979
|
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>;
|
|
809
|
-
declare const make$
|
|
980
|
+
declare const make$11: <Id extends string, const MethodsShape extends Methods$4>(id: Id, methods: MethodsShape) => Definition$9<Id, MethodsShape>;
|
|
810
981
|
declare namespace QueueBinding_d_exports {
|
|
811
|
-
export { MessageSendRequest, QueueBindingClient, QueueBindingDefinition, QueueMetrics, QueueOperationError, QueueProducer, QueueSendBatchOptions, QueueSendBatchResponse, QueueSendOptions, QueueSendResponse, isQueue, layer$
|
|
982
|
+
export { MessageSendRequest, QueueBindingClient, QueueBindingDefinition, QueueMetrics, QueueOperationError, QueueProducer, QueueSendBatchOptions, QueueSendBatchResponse, QueueSendOptions, QueueSendResponse, isQueue, layer$10 as layer, makeClient$8 as makeClient };
|
|
812
983
|
}
|
|
813
984
|
type QueueSendOptions = CloudflareQueueSendOptions;
|
|
814
985
|
type QueueSendResponse = CloudflareQueueSendResponse;
|
|
@@ -839,10 +1010,10 @@ declare class QueueOperationError extends QueueOperationError_base<{
|
|
|
839
1010
|
readonly message: string;
|
|
840
1011
|
}> {}
|
|
841
1012
|
declare const isQueue: <Body>(value: unknown) => value is QueueProducer<Body>;
|
|
842
|
-
declare const makeClient$
|
|
843
|
-
declare const layer$
|
|
1013
|
+
declare const makeClient$8: <Message extends ServiceFreeSchema$4>(definition: QueueBindingDefinition<Message>) => ((queue: QueueProducer<Schema.Codec.Encoded<Message>>) => QueueBindingClient<Message>);
|
|
1014
|
+
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>;
|
|
844
1015
|
declare namespace QueueDefinition_d_exports {
|
|
845
|
-
export { Definition$8 as Definition, Handler$3 as Handler, LayerOptions$
|
|
1016
|
+
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 };
|
|
846
1017
|
}
|
|
847
1018
|
interface Definition$8<Id extends string = string, Message extends ServiceFreeSchema$4 = ServiceFreeSchema$4> {
|
|
848
1019
|
readonly id: Id;
|
|
@@ -856,31 +1027,31 @@ interface Options$7<ROut, Self extends Definition$8.Any> extends Omit<WorkerOpti
|
|
|
856
1027
|
readonly queue: Handler$3<ROut, Self>;
|
|
857
1028
|
readonly rpc?: never;
|
|
858
1029
|
}
|
|
859
|
-
type LayerOptions$
|
|
1030
|
+
type LayerOptions$13 = {
|
|
860
1031
|
readonly binding: string;
|
|
861
1032
|
};
|
|
862
|
-
interface TagClass$
|
|
1033
|
+
interface TagClass$12<Self, Id extends string, Message extends ServiceFreeSchema$4> extends Context.ServiceClass<Self, Id, QueueBindingClient<Message>> {
|
|
863
1034
|
readonly id: Id;
|
|
864
1035
|
readonly message: Message;
|
|
865
1036
|
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>;
|
|
866
|
-
readonly layer: (options: LayerOptions$
|
|
1037
|
+
readonly layer: (options: LayerOptions$13) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
867
1038
|
readonly send: (message: Schema.Schema.Type<Message>, options?: QueueSendOptions) => Effect.Effect<void, QueueOperationError | Schema.SchemaError, Self>;
|
|
868
1039
|
readonly sendBatch: (messages: Iterable<MessageSendRequest<Schema.Schema.Type<Message>>>, options?: QueueSendBatchOptions) => Effect.Effect<void, QueueOperationError | Schema.SchemaError, Self>;
|
|
869
1040
|
readonly metrics: () => Effect.Effect<QueueMetrics, QueueOperationError, Self>;
|
|
870
1041
|
readonly unsafeRaw: () => Effect.Effect<globalThis.Queue<Schema.Codec.Encoded<Message>>, never, Self>;
|
|
871
1042
|
}
|
|
872
|
-
declare const make$
|
|
1043
|
+
declare const make$10: <Id extends string, Message extends ServiceFreeSchema$4>(id: Id, definition: {
|
|
873
1044
|
readonly message: Message;
|
|
874
|
-
}) => TagClass$
|
|
875
|
-
declare const Tag$
|
|
1045
|
+
}) => TagClass$12<Definition$8<Id, Message>, Id, Message>;
|
|
1046
|
+
declare const Tag$13: <Self>() => <Id extends string, Message extends ServiceFreeSchema$4>(id: Id, definition: {
|
|
876
1047
|
readonly message: Message;
|
|
877
|
-
}) => TagClass$
|
|
1048
|
+
}) => TagClass$12<Self, Id, Message>;
|
|
878
1049
|
declare const Queue$1: <Self>() => <Id extends string, Message extends ServiceFreeSchema$4>(id: Id, definition: {
|
|
879
1050
|
readonly message: Message;
|
|
880
|
-
}) => TagClass$
|
|
1051
|
+
}) => TagClass$12<Self, Id, Message>;
|
|
881
1052
|
declare const implement$7: <ROut, const Self extends Definition$8.Any>(_definition: Self, handler: Handler$3<ROut, Self>) => Handler$3<ROut, Self>;
|
|
882
1053
|
declare namespace Queue_d_exports {
|
|
883
|
-
export { Definition$7 as Definition, Handler$2 as Handler, LayerOptions$
|
|
1054
|
+
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 };
|
|
884
1055
|
}
|
|
885
1056
|
interface QueueMessage<Body> {
|
|
886
1057
|
readonly raw: globalThis.Message<unknown>;
|
|
@@ -929,16 +1100,16 @@ type Definition$7<Id extends string = string, Message extends Definition$8.Any["
|
|
|
929
1100
|
declare namespace Definition$7 {
|
|
930
1101
|
type Any = Definition$8.Any;
|
|
931
1102
|
}
|
|
932
|
-
type LayerOptions$
|
|
933
|
-
type TagClass$
|
|
934
|
-
declare const Tag$
|
|
1103
|
+
type LayerOptions$12 = LayerOptions$13;
|
|
1104
|
+
type TagClass$11<Self, Id extends string, Message extends Definition$8.Any["message"]> = TagClass$12<Self, Id, Message>;
|
|
1105
|
+
declare const Tag$12: <Self>() => <Id extends string, Message extends Definition$8.Any["message"]>(id: Id, definition: {
|
|
935
1106
|
readonly message: Message;
|
|
936
|
-
}) => TagClass$
|
|
1107
|
+
}) => TagClass$11<Self, Id, Message>;
|
|
937
1108
|
declare const implement$6: <ROut, const Self extends Definition$8.Any>(_definition: Self, handler: Handler$3<ROut, Self>) => Handler$3<ROut, Self>;
|
|
938
1109
|
type Handler$2<ROut, Self extends Definition$8.Any> = Handler$3<ROut, Self>;
|
|
939
1110
|
type Options$6<ROut, Self extends Definition$8.Any> = Options$7<ROut, Self>;
|
|
940
1111
|
declare namespace WorkerDefinition_d_exports {
|
|
941
|
-
export { Api$3 as Api, Definition$6 as Definition, HandlerEffect$3 as HandlerEffect, Handlers$3 as Handlers, LayerOptions$
|
|
1112
|
+
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 };
|
|
942
1113
|
}
|
|
943
1114
|
type ServiceFreeSchema$3 = Schema.Codec<any, any, never, never>;
|
|
944
1115
|
interface Method$4<Args extends ReadonlyArray<ServiceFreeSchema$3> = ReadonlyArray<ServiceFreeSchema$3>, Success extends ServiceFreeSchema$3 = ServiceFreeSchema$3> {
|
|
@@ -986,14 +1157,14 @@ type Handlers$3<ROut, Self extends Definition$6.Any> = { readonly [Key in keyof
|
|
|
986
1157
|
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"> {
|
|
987
1158
|
readonly rpc: Handlers$3<ROut | REvent, Self>;
|
|
988
1159
|
}
|
|
989
|
-
type LayerOptions$
|
|
1160
|
+
type LayerOptions$11 = {
|
|
990
1161
|
readonly binding: string;
|
|
991
1162
|
};
|
|
992
|
-
type TagClass$
|
|
1163
|
+
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>> & {
|
|
993
1164
|
readonly id: Id;
|
|
994
1165
|
readonly methods: MethodsShape;
|
|
995
1166
|
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>;
|
|
996
|
-
readonly layer: (options: LayerOptions$
|
|
1167
|
+
readonly layer: (options: LayerOptions$11) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
997
1168
|
};
|
|
998
1169
|
/**
|
|
999
1170
|
* Defines a single RPC method schema in a worker definition.
|
|
@@ -1007,9 +1178,9 @@ declare const method$3: {
|
|
|
1007
1178
|
readonly success: Success;
|
|
1008
1179
|
}): Method$4<Args, Success>;
|
|
1009
1180
|
};
|
|
1010
|
-
declare const make$
|
|
1011
|
-
declare const Tag$
|
|
1012
|
-
declare const Worker: <Self>() => <Id extends string, const MethodsShape extends Methods$3>(id: Id, methods: MethodsShape & NoReservedMethods$3<MethodsShape>) => TagClass$
|
|
1181
|
+
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>;
|
|
1182
|
+
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>;
|
|
1183
|
+
declare const Worker: <Self>() => <Id extends string, const MethodsShape extends Methods$3>(id: Id, methods: MethodsShape & NoReservedMethods$3<MethodsShape>) => TagClass$10<Self, Id, MethodsShape>;
|
|
1013
1184
|
/**
|
|
1014
1185
|
* Helper for implementing handlers with the exact method shape of a definition.
|
|
1015
1186
|
*/
|
|
@@ -1024,9 +1195,9 @@ type AnyArgs = Array<any>;
|
|
|
1024
1195
|
type AsyncMethodKey<Api> = { [Key in keyof Api]-?: Key extends string ? Api[Key] extends ((...args: AnyArgs) => Promise<unknown>) ? Key : never : never }[keyof Api];
|
|
1025
1196
|
type AsyncMethodArgs<Api, Method extends keyof Api> = Api[Method] extends ((...args: infer Args) => Promise<unknown>) ? Args : never;
|
|
1026
1197
|
type AsyncMethodSuccess<Api, Method extends keyof Api> = Api[Method] extends ((...args: AnyArgs) => Promise<infer A>) ? A : never;
|
|
1027
|
-
type AsyncMethodCloudflareReturn<Api, Method extends keyof Api> = Result<AsyncMethodSuccess<Api, Method>>;
|
|
1198
|
+
type AsyncMethodCloudflareReturn<Api, Method extends keyof Api> = Result$1<AsyncMethodSuccess<Api, Method>>;
|
|
1028
1199
|
declare namespace ServiceBinding_d_exports {
|
|
1029
|
-
export { Service, ServiceBindingClient, ServiceBindingDefinition, ServiceBindingEffectClient, ServiceBindingFetchError, ServiceBindingRpcError, ServiceBindingStaticClient, ServiceFetcher, isServiceBindingClient, layer$
|
|
1200
|
+
export { Service, ServiceBindingClient, ServiceBindingDefinition, ServiceBindingEffectClient, ServiceBindingFetchError, ServiceBindingRpcError, ServiceBindingStaticClient, ServiceFetcher, isServiceBindingClient, layer$9 as layer, makeClient$7 as makeClient, makeDirectMethods$1 as makeDirectMethods };
|
|
1030
1201
|
}
|
|
1031
1202
|
declare const TypeId$1: "effect-cf/ServiceBinding";
|
|
1032
1203
|
/**
|
|
@@ -1172,8 +1343,8 @@ type ServiceBindingStaticClient<R, Api extends object, Definition extends Defini
|
|
|
1172
1343
|
readonly scopedCall: <Method extends ServiceMethodKey<Api>>(method: Method, ...args: ServiceMethodArgs<Api, Method>) => Effect.Effect<Awaited<ServiceMethodSuccess<Api, Method>>, unknown, Scope.Scope | R>;
|
|
1173
1344
|
};
|
|
1174
1345
|
declare const isServiceBindingClient: <Api extends object>(value: unknown) => value is ServiceBindingClient<Api>;
|
|
1175
|
-
declare const makeClient$
|
|
1176
|
-
declare const layer$
|
|
1346
|
+
declare const makeClient$7: <Api extends object, const Definition extends Definition$6.Any | undefined = undefined>(definition: ServiceBindingDefinition<Definition>) => ((service: ServiceBindingClient<Api>) => ServiceBindingEffectClient<Api, Definition>);
|
|
1347
|
+
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>;
|
|
1177
1348
|
/**
|
|
1178
1349
|
* Creates a typed Effect service for a Worker service binding.
|
|
1179
1350
|
*
|
|
@@ -1207,13 +1378,13 @@ declare const Service: <Self, Api extends object = never>() => <Id extends strin
|
|
|
1207
1378
|
readonly [TypeId$1]: typeof TypeId$1;
|
|
1208
1379
|
readonly definition: ServiceBindingDefinition<Definition>;
|
|
1209
1380
|
readonly fetch: (input: RequestInfo | URL, init?: RequestInit) => Effect.Effect<Response, ServiceBindingFetchError, Self>;
|
|
1210
|
-
readonly rpc: <Method extends ServiceMethodKey<ApiOrDefinition<Api, Definition>>>(method: Method, ...args: ServiceMethodArgs<ApiOrDefinition<Api, Definition>, Method>) => Effect.Effect<Result<AsyncMethodSuccess<ApiOrDefinition<Api, Definition>, Method>>, ServiceBindingRpcError, Self>;
|
|
1381
|
+
readonly rpc: <Method extends ServiceMethodKey<ApiOrDefinition<Api, Definition>>>(method: Method, ...args: ServiceMethodArgs<ApiOrDefinition<Api, Definition>, Method>) => Effect.Effect<Result$1<AsyncMethodSuccess<ApiOrDefinition<Api, Definition>, Method>>, ServiceBindingRpcError, Self>;
|
|
1211
1382
|
readonly call: <Method extends ServiceMethodKey<ApiOrDefinition<Api, Definition>>>(method: Method, ...args: ServiceMethodArgs<ApiOrDefinition<Api, Definition>, Method>) => Effect.Effect<AsyncMethodSuccess<ApiOrDefinition<Api, Definition>, Method>, ServiceBindingRpcError, Self>;
|
|
1212
1383
|
readonly scopedCall: <Method extends ServiceMethodKey<ApiOrDefinition<Api, Definition>>>(method: Method, ...args: ServiceMethodArgs<ApiOrDefinition<Api, Definition>, Method>) => Effect.Effect<Awaited<AsyncMethodSuccess<ApiOrDefinition<Api, Definition>, Method>>, unknown, Self | Scope.Scope>;
|
|
1213
1384
|
};
|
|
1214
1385
|
declare const makeDirectMethods$1: <R, Api, Definition extends Definition$6.Any | undefined>(rpcDefinition: Definition | undefined, call: ServiceCall<R, Api>) => DirectMethods$1<R, Definition>;
|
|
1215
1386
|
declare namespace Worker_d_exports {
|
|
1216
|
-
export { Api$2 as Api, Definition$5 as Definition, ExecutionContext, FetchHandler, FetchWorkerOptions, HandlerEffect$2 as HandlerEffect, Handlers$2 as Handlers, LayerOptions$
|
|
1387
|
+
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 };
|
|
1217
1388
|
}
|
|
1218
1389
|
declare const ExecutionContext_base: Context.ServiceClass<ExecutionContext, "effect-cf/ExecutionContext", globalThis.ExecutionContext<unknown>>;
|
|
1219
1390
|
declare class ExecutionContext extends ExecutionContext_base {}
|
|
@@ -1266,8 +1437,8 @@ interface FetchHandler<Env extends WorkerEnv = WorkerEnv> {
|
|
|
1266
1437
|
readonly fetch: (request: Request, env: Env, ctx: globalThis.ExecutionContext) => Promise<Response>;
|
|
1267
1438
|
}
|
|
1268
1439
|
declare const renderHttpResponse: <A extends HttpServerResponse.HttpServerResponse, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<Response, E, R>;
|
|
1269
|
-
declare function make$
|
|
1270
|
-
declare function make$
|
|
1440
|
+
declare function make$8<ROut, LayerError>(layer: Layer.Layer<ROut, LayerError, ExecutionContext | WorkerContext | WorkerEnvironment>, fetch: WorkerHandler<ROut>): WorkerClass<Record<never, never>, ROut>;
|
|
1441
|
+
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>;
|
|
1271
1442
|
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>;
|
|
1272
1443
|
type ServiceFreeSchema$2 = Schema.Codec<any, any, never, never>;
|
|
1273
1444
|
interface Method$3<Args extends ReadonlyArray<ServiceFreeSchema$2> = ReadonlyArray<ServiceFreeSchema$2>, Success extends ServiceFreeSchema$2 = ServiceFreeSchema$2> {
|
|
@@ -1296,20 +1467,20 @@ type Handlers$2<ROut, Self extends Definition$5.Any> = { readonly [Key in keyof
|
|
|
1296
1467
|
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"> {
|
|
1297
1468
|
readonly rpc: Handlers$2<ROut | REvent, Self>;
|
|
1298
1469
|
}
|
|
1299
|
-
type LayerOptions$
|
|
1300
|
-
type TagClass$
|
|
1470
|
+
type LayerOptions$10 = LayerOptions$11;
|
|
1471
|
+
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>> & {
|
|
1301
1472
|
readonly id: Id;
|
|
1302
1473
|
readonly methods: MethodsShape;
|
|
1303
1474
|
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>;
|
|
1304
|
-
readonly layer: (options: LayerOptions$
|
|
1475
|
+
readonly layer: (options: LayerOptions$10) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1305
1476
|
};
|
|
1306
|
-
type TagFactory$1 = <Self>() => <Id extends string, const MethodsShape extends Methods$2>(id: Id, methods: MethodsShape & NoReservedMethods$2<MethodsShape>) => TagClass$
|
|
1307
|
-
declare const Tag$
|
|
1477
|
+
type TagFactory$1 = <Self>() => <Id extends string, const MethodsShape extends Methods$2>(id: Id, methods: MethodsShape & NoReservedMethods$2<MethodsShape>) => TagClass$9<Self, Id, MethodsShape>;
|
|
1478
|
+
declare const Tag$10: TagFactory$1;
|
|
1308
1479
|
declare const method$2: {
|
|
1309
1480
|
<Success extends ServiceFreeSchema$2>(definition: {
|
|
1310
1481
|
readonly success: Success;
|
|
1311
1482
|
}): Method$3<readonly [], Success>;
|
|
1312
|
-
<const Args extends
|
|
1483
|
+
<const Args extends ReadonlyArray<ServiceFreeSchema$2>, Success extends ServiceFreeSchema$2>(definition: {
|
|
1313
1484
|
readonly args: Args;
|
|
1314
1485
|
readonly success: Success;
|
|
1315
1486
|
}): Method$3<Args, Success>;
|
|
@@ -1317,7 +1488,7 @@ declare const method$2: {
|
|
|
1317
1488
|
declare const implement$4: <ROut, const Self extends Definition$5.Any>(_definition: Self, handlers: Handlers$2<ROut, Self>) => Handlers$2<ROut, Self>;
|
|
1318
1489
|
type HandlerEffect$2<ROut, Self extends Definition$5.Any, Key extends keyof Self["methods"]> = WorkerRpcHandler<ROut, Method$3.Success<Self["methods"][Key]>>;
|
|
1319
1490
|
declare namespace DurableObjectNamespace_d_exports {
|
|
1320
|
-
export { DurableObjectFetchError, DurableObjectNamespaceBindingDefinition, DurableObjectNamespaceClient, DurableObjectNamespaceDefinition, DurableObjectNamespaceEffectClient, DurableObjectNamespaceStaticClient, DurableObjectRpcError, DurableObjectStubClient, isDurableObjectNamespaceClient, layer$
|
|
1491
|
+
export { DurableObjectFetchError, DurableObjectNamespaceBindingDefinition, DurableObjectNamespaceClient, DurableObjectNamespaceDefinition, DurableObjectNamespaceEffectClient, DurableObjectNamespaceStaticClient, DurableObjectRpcError, DurableObjectStubClient, isDurableObjectNamespaceClient, layer$8 as layer, makeClient$6 as makeClient, makeDirectMethods };
|
|
1321
1492
|
}
|
|
1322
1493
|
interface DurableObjectFetcher {
|
|
1323
1494
|
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
@@ -1515,8 +1686,8 @@ type DurableObjectNamespaceStaticClient<R, Api extends object, Definition extend
|
|
|
1515
1686
|
readonly unsafeRaw: () => Effect.Effect<DurableObjectNamespaceClient<Api>, never, R>;
|
|
1516
1687
|
};
|
|
1517
1688
|
declare const isDurableObjectNamespaceClient: <Api extends object>(value: unknown) => value is DurableObjectNamespaceClient<Api>;
|
|
1518
|
-
declare const makeClient$
|
|
1519
|
-
declare const layer$
|
|
1689
|
+
declare const makeClient$6: <Api extends object, const Definition extends Definition$4.Any | undefined = undefined>(definition: DurableObjectNamespaceBindingDefinition<Definition>) => ((namespace: DurableObjectNamespaceClient<Api>) => DurableObjectNamespaceEffectClient<Api, Definition>);
|
|
1690
|
+
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>;
|
|
1520
1691
|
declare const makeDirectMethods: <R, Api extends object, Definition extends Definition$4.Any | undefined>(rpcDefinition: Definition | undefined, helpers: {
|
|
1521
1692
|
readonly call: StubCall<R, Api>;
|
|
1522
1693
|
readonly fetch: (stub: DurableObjectStubClient<Api>, input: RequestInfo | URL, init?: RequestInit) => Effect.Effect<globalThis.Response, DurableObjectFetchError, R>;
|
|
@@ -1524,7 +1695,7 @@ declare const makeDirectMethods: <R, Api extends object, Definition extends Defi
|
|
|
1524
1695
|
readonly getByName: (name: string, options?: globalThis.DurableObjectNamespaceGetDurableObjectOptions) => Effect.Effect<DurableObjectStubClient<Api>, never, R>;
|
|
1525
1696
|
}) => DirectMethods<R, Api, Definition>;
|
|
1526
1697
|
declare namespace DurableObjectDefinition_d_exports {
|
|
1527
|
-
export { Api$1 as Api, Definition$4 as Definition, DurableObject$1 as DurableObject, HandlerEffect$1 as HandlerEffect, Handlers$1 as Handlers, LayerOptions$
|
|
1698
|
+
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 };
|
|
1528
1699
|
}
|
|
1529
1700
|
type ServiceFreeSchema$1 = Schema.Codec<any, any, never, never>;
|
|
1530
1701
|
interface Method$2<Args extends ReadonlyArray<ServiceFreeSchema$1> = ReadonlyArray<ServiceFreeSchema$1>, Success extends ServiceFreeSchema$1 = ServiceFreeSchema$1> {
|
|
@@ -1569,14 +1740,14 @@ type Handlers$1<ROut, Self extends Definition$4.Any> = { readonly [Key in keyof
|
|
|
1569
1740
|
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"> {
|
|
1570
1741
|
readonly rpc: Handlers$1<ROut | REvent, Self>;
|
|
1571
1742
|
}
|
|
1572
|
-
type LayerOptions$
|
|
1743
|
+
type LayerOptions$9 = {
|
|
1573
1744
|
readonly binding: string;
|
|
1574
1745
|
};
|
|
1575
|
-
type TagClass$
|
|
1746
|
+
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>> & {
|
|
1576
1747
|
readonly id: Id;
|
|
1577
1748
|
readonly methods: MethodsShape;
|
|
1578
1749
|
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>;
|
|
1579
|
-
readonly layer: (options: LayerOptions$
|
|
1750
|
+
readonly layer: (options: LayerOptions$9) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1580
1751
|
};
|
|
1581
1752
|
/**
|
|
1582
1753
|
* Defines a single RPC method schema in a Durable Object definition.
|
|
@@ -1590,9 +1761,9 @@ declare const method$1: {
|
|
|
1590
1761
|
readonly success: Success;
|
|
1591
1762
|
}): Method$2<Args, Success>;
|
|
1592
1763
|
};
|
|
1593
|
-
declare const make$
|
|
1594
|
-
declare const Tag$
|
|
1595
|
-
declare const DurableObject$1: <Self>() => <Id extends string, const MethodsShape extends Methods$1>(id: Id, methods: MethodsShape & NoReservedMethods$1<MethodsShape>) => TagClass$
|
|
1764
|
+
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>;
|
|
1765
|
+
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>;
|
|
1766
|
+
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>;
|
|
1596
1767
|
/**
|
|
1597
1768
|
* Helper for implementing handlers with the exact method shape of a definition.
|
|
1598
1769
|
*/
|
|
@@ -1602,7 +1773,7 @@ declare const implement$3: <ROut, const Self extends Definition$4.Any>(_definiti
|
|
|
1602
1773
|
*/
|
|
1603
1774
|
type HandlerEffect$1<ROut, Self extends Definition$4.Any, Key extends keyof Self["methods"]> = DurableObjectHandler<ROut, Method$2.Success<Self["methods"][Key]>>;
|
|
1604
1775
|
declare namespace DurableObject_d_exports {
|
|
1605
|
-
export { Api, Definition$3 as Definition, DurableObjectClass, DurableObjectHandler, DurableObjectOptions, DurableObjectRpc, DurableObjectRpcShape, HandlerEffect, Handlers, LayerOptions$
|
|
1776
|
+
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 };
|
|
1606
1777
|
}
|
|
1607
1778
|
type RuntimeContext$1<ROut> = DurableObjectState | WorkerEnvironment | ROut;
|
|
1608
1779
|
type HandlerContext<ROut> = RuntimeContext$1<ROut> | Scope.Scope;
|
|
@@ -1662,7 +1833,7 @@ type DurableObjectClass<Rpc extends DurableObjectRpc<ROut>, ROut> = new (state:
|
|
|
1662
1833
|
/**
|
|
1663
1834
|
* Creates a Durable Object class backed by a single managed Effect runtime.
|
|
1664
1835
|
*/
|
|
1665
|
-
declare const make$
|
|
1836
|
+
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>;
|
|
1666
1837
|
type ServiceFreeSchema = Schema.Codec<any, any, never, never>;
|
|
1667
1838
|
interface Method$1<Args extends ReadonlyArray<ServiceFreeSchema> = ReadonlyArray<ServiceFreeSchema>, Success extends ServiceFreeSchema = ServiceFreeSchema> {
|
|
1668
1839
|
readonly args: Args;
|
|
@@ -1685,21 +1856,21 @@ interface Definition$3<Id extends string = string, MethodsShape extends Methods
|
|
|
1685
1856
|
declare namespace Definition$3 {
|
|
1686
1857
|
type Any = Definition$3<string, Methods>;
|
|
1687
1858
|
}
|
|
1688
|
-
type LayerOptions$
|
|
1859
|
+
type LayerOptions$8 = LayerOptions$9;
|
|
1689
1860
|
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]>> };
|
|
1690
1861
|
type Api<Self extends Definition$3.Any> = Provider<ServerApi$1<Self>, ReservedMethodName>;
|
|
1691
1862
|
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]>> };
|
|
1692
1863
|
interface Options$2<ROut, Self extends Definition$3.Any, REvent = never, EventLayerError = never> extends Omit<DurableObjectOptions<ROut, REvent, EventLayerError, Handlers<ROut | REvent, Self>>, "rpc"> {
|
|
1693
1864
|
readonly rpc: Handlers<ROut | REvent, Self>;
|
|
1694
1865
|
}
|
|
1695
|
-
type TagClass$
|
|
1866
|
+
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>> & {
|
|
1696
1867
|
readonly id: Id;
|
|
1697
1868
|
readonly methods: MethodsShape;
|
|
1698
1869
|
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>;
|
|
1699
|
-
readonly layer: (options: LayerOptions$
|
|
1870
|
+
readonly layer: (options: LayerOptions$8) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
1700
1871
|
};
|
|
1701
|
-
type TagFactory = <Self>() => <Id extends string, const MethodsShape extends Methods>(id: Id, methods: MethodsShape & NoReservedMethods<MethodsShape>) => TagClass$
|
|
1702
|
-
declare const Tag$
|
|
1872
|
+
type TagFactory = <Self>() => <Id extends string, const MethodsShape extends Methods>(id: Id, methods: MethodsShape & NoReservedMethods<MethodsShape>) => TagClass$7<Self, Id, MethodsShape>;
|
|
1873
|
+
declare const Tag$8: TagFactory;
|
|
1703
1874
|
declare const method: {
|
|
1704
1875
|
<Success extends ServiceFreeSchema>(definition: {
|
|
1705
1876
|
readonly success: Success;
|
|
@@ -2036,12 +2207,12 @@ declare class DurableObjectAlarm extends DurableObjectAlarm_base {
|
|
|
2036
2207
|
static readonly layer: Layer.Layer<DurableObjectAlarm, never, DurableObjectState>;
|
|
2037
2208
|
}
|
|
2038
2209
|
declare namespace DurableObjectRpcWebSocket_d_exports {
|
|
2039
|
-
export { DurableObjectRpcWebSocket, DurableObjectRpcWebSocketService, LayerOptions$
|
|
2210
|
+
export { DurableObjectRpcWebSocket, DurableObjectRpcWebSocketService, LayerOptions$7 as LayerOptions, NativeWebSocketMessage, layer$7 as layer };
|
|
2040
2211
|
}
|
|
2041
2212
|
/**
|
|
2042
2213
|
* Configuration for {@link layer}.
|
|
2043
2214
|
*/
|
|
2044
|
-
interface LayerOptions$
|
|
2215
|
+
interface LayerOptions$7 {
|
|
2045
2216
|
/** Tag used to select hibernated sockets. */
|
|
2046
2217
|
readonly tag?: string | undefined;
|
|
2047
2218
|
/** Socket attachment key used to persist client ids across hibernation. */
|
|
@@ -2066,9 +2237,9 @@ declare class DurableObjectRpcWebSocket extends DurableObjectRpcWebSocket_base {
|
|
|
2066
2237
|
/**
|
|
2067
2238
|
* Builds a layer that bridges Durable Object websocket events to `RpcServer.Protocol`.
|
|
2068
2239
|
*/
|
|
2069
|
-
declare const layer$
|
|
2240
|
+
declare const layer$7: (options?: LayerOptions$7) => Layer.Layer<DurableObjectRpcWebSocket | RpcServer.Protocol, never, DurableObjectState | RpcSerialization.RpcSerialization>;
|
|
2070
2241
|
declare namespace DurableObjectSqlite_d_exports {
|
|
2071
|
-
export { SqliteLayerOptions, layer$
|
|
2242
|
+
export { SqliteLayerOptions, layer$6 as layer };
|
|
2072
2243
|
}
|
|
2073
2244
|
/** Options forwarded to `@effect/sql-sqlite-do` when building a SQL client layer. */
|
|
2074
2245
|
type SqliteLayerOptions = Omit<SqliteClient.SqliteClientConfig, "db">;
|
|
@@ -2083,7 +2254,58 @@ type SqliteLayerOptions = Omit<SqliteClient.SqliteClientConfig, "db">;
|
|
|
2083
2254
|
* );
|
|
2084
2255
|
* ```
|
|
2085
2256
|
*/
|
|
2086
|
-
declare const layer$
|
|
2257
|
+
declare const layer$6: (options?: SqliteLayerOptions) => Layer.Layer<_$effect_unstable_sql_SqlClient0.SqlClient | SqliteClient.SqliteClient, never, DurableObjectState>;
|
|
2258
|
+
declare namespace Email_d_exports {
|
|
2259
|
+
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 };
|
|
2260
|
+
}
|
|
2261
|
+
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 & {
|
|
2262
|
+
readonly _tag: "EmailOperationError";
|
|
2263
|
+
} & Readonly<A>;
|
|
2264
|
+
/** Error raised when a Cloudflare Send Email operation fails. */
|
|
2265
|
+
declare class EmailOperationError extends EmailOperationError_base<{
|
|
2266
|
+
readonly binding: string;
|
|
2267
|
+
readonly operation: string;
|
|
2268
|
+
readonly cause: unknown;
|
|
2269
|
+
}> {}
|
|
2270
|
+
/** Typed Cloudflare Send Email binding definition. */
|
|
2271
|
+
interface EmailDefinition {
|
|
2272
|
+
/** Binding name as configured in `wrangler.jsonc`. */
|
|
2273
|
+
readonly binding: string;
|
|
2274
|
+
}
|
|
2275
|
+
type EmailAddress = CloudflareEmailAddress;
|
|
2276
|
+
type EmailAttachment = CloudflareEmailAttachment;
|
|
2277
|
+
type EmailMessage = CloudflareEmailMessage;
|
|
2278
|
+
type EmailMessageBuilder = Parameters<CloudflareSendEmail["send"]>[0];
|
|
2279
|
+
type EmailSendInput = EmailMessage | EmailMessageBuilder;
|
|
2280
|
+
type EmailSendResult = CloudflareEmailSendResult;
|
|
2281
|
+
type EmailBinding = CloudflareSendEmail;
|
|
2282
|
+
interface EmailClient {
|
|
2283
|
+
readonly send: {
|
|
2284
|
+
(message: EmailMessage): Effect.Effect<EmailSendResult, EmailOperationError>;
|
|
2285
|
+
(builder: EmailMessageBuilder): Effect.Effect<EmailSendResult, EmailOperationError>;
|
|
2286
|
+
};
|
|
2287
|
+
readonly unsafeRaw: Effect.Effect<EmailBinding>;
|
|
2288
|
+
readonly definition: EmailDefinition;
|
|
2289
|
+
}
|
|
2290
|
+
declare const EmailServiceTypeId: unique symbol;
|
|
2291
|
+
/** Nominal service marker for Send Email services created with {@link make}. */
|
|
2292
|
+
interface EmailService<Id extends string> {
|
|
2293
|
+
readonly [EmailServiceTypeId]: {
|
|
2294
|
+
readonly id: Id;
|
|
2295
|
+
};
|
|
2296
|
+
}
|
|
2297
|
+
type LayerOptions$6 = {
|
|
2298
|
+
readonly binding: string;
|
|
2299
|
+
};
|
|
2300
|
+
interface TagClass$6<Self, Id extends string> extends Context.ServiceClass<Self, Id, EmailClient> {
|
|
2301
|
+
readonly id: Id;
|
|
2302
|
+
readonly layer: (options: LayerOptions$6) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2303
|
+
}
|
|
2304
|
+
declare const isEmailBinding: (value: unknown) => value is EmailBinding;
|
|
2305
|
+
declare const makeClient$5: (definition: EmailDefinition) => (email: EmailBinding) => EmailClient;
|
|
2306
|
+
declare const layer$5: <Self>(tag: Context.Service<Self, EmailClient>, definition: EmailDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
2307
|
+
declare const make$5: <Id extends string>(id: Id) => TagClass$6<EmailService<Id>, Id>;
|
|
2308
|
+
declare const Tag$7: <Self>() => <Id extends string>(id: Id) => TagClass$6<Self, Id>;
|
|
2087
2309
|
declare namespace Images_d_exports {
|
|
2088
2310
|
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 };
|
|
2089
2311
|
}
|
|
@@ -2587,4 +2809,4 @@ declare const layer: <Self>(tag: Context.Service<Self, VectorizeClient>, definit
|
|
|
2587
2809
|
declare const make: <Id extends string>(id: Id) => TagClass<VectorizeService<Id>, Id>;
|
|
2588
2810
|
declare const Tag$1: <Self>() => <Id extends string>(id: Id) => TagClass<Self, Id>;
|
|
2589
2811
|
//#endregion
|
|
2590
|
-
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, 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 };
|
|
2812
|
+
export { AiGateway_d_exports as AiGateway, AnalyticsEngine_d_exports as AnalyticsEngine, Binding_d_exports as Binding, BrowserRendering_d_exports as BrowserRendering, CloudflareOtlp_d_exports as CloudflareOtlp, 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 };
|