effect-cf 0.29.0 → 0.31.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 +20 -0
- package/README.md +103 -8
- package/dist/{Artifacts-rq3hUKQE.mjs → Artifacts-CSIk1Oml.mjs} +4 -128
- package/dist/Binding-pfilNJmP.mjs +129 -0
- package/dist/ComputerArtifacts.mjs +1 -1
- package/dist/ComputerWorkspace.d.mts +1 -1
- package/dist/ComputerWorkspace.mjs +1 -1
- package/dist/ContainerNamespace-CFjiLw8b.d.mts +155 -0
- package/dist/{DurableObjectState-DnnLoHV-.mjs → DurableObjectState-CxS5Y2hf.mjs} +10 -2
- package/dist/{DurableObjectState-OupNMMUl.d.mts → DurableObjectState-DVIgf0sA.d.mts} +7 -1
- package/dist/Sandbox.d.mts +222 -0
- package/dist/Sandbox.mjs +361 -0
- package/dist/Vitest.d.mts +9 -9
- package/dist/Vitest.mjs +5 -5
- package/dist/{WorkflowBinding-DUZtKCVM.d.mts → WorkflowBinding-C9KRmfDU.d.mts} +6 -3
- package/dist/index.d.mts +62 -199
- package/dist/index.mjs +15 -6
- package/package.json +15 -5
- package/src/DurableObjectStorage.ts +40 -1
- package/src/Images.ts +60 -9
- package/src/Sandbox.ts +1094 -0
- package/src/Vitest.ts +9 -9
- package/src/Worker.ts +2 -0
- package/src/WorkflowBinding.ts +10 -2
- package/src/internal/WorkerContext.ts +1 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { a as Environment_d_exports, c as WorkerEnvironment, i as Binding_d_exports, n as BindingService, o as WorkerConfig, r as BindingValidationError, s as WorkerEnv, t as BindingNotFoundError } from "./Binding-xJJJPmiD.mjs";
|
|
2
2
|
import { l as Artifacts_d_exports } from "./Artifacts-DnHQA-Ax.mjs";
|
|
3
|
-
import { C as Rpc_d_exports, D as StorageOperationError, E as DurableObjectStorage_d_exports, S as Provider, T as DurableWebSocket, _ as Definition$4, a as NativeRequest, b as RpcDefinition_d_exports, c as WorkerDefinition_d_exports, d as AsyncMethodCloudflareReturn, f as AsyncMethodKey, g as QueueBinding_d_exports, h as QueueDefinition_d_exports, i as ExecutionContext, l as ServiceBinding_d_exports, m as Queue_d_exports, o as WorkerContext, p as AsyncMethodSuccess, r as DurableObjectState_d_exports, s as Worker_d_exports, t as DurableObjectState, u as AsyncMethodArgs, v as Method$2, w as DurableObjectWebSocket_d_exports, x as ServiceFreeSchema$1, y as ReservedMethodName$2 } from "./DurableObjectState-
|
|
3
|
+
import { C as Rpc_d_exports, D as StorageOperationError, E as DurableObjectStorage_d_exports, S as Provider, T as DurableWebSocket, _ as Definition$4, a as NativeRequest, b as RpcDefinition_d_exports, c as WorkerDefinition_d_exports, d as AsyncMethodCloudflareReturn, f as AsyncMethodKey, g as QueueBinding_d_exports, h as QueueDefinition_d_exports, i as ExecutionContext, l as ServiceBinding_d_exports, m as Queue_d_exports, o as WorkerContext, p as AsyncMethodSuccess, r as DurableObjectState_d_exports, s as Worker_d_exports, t as DurableObjectState, u as AsyncMethodArgs, v as Method$2, w as DurableObjectWebSocket_d_exports, x as ServiceFreeSchema$1, y as ReservedMethodName$2 } from "./DurableObjectState-DVIgf0sA.mjs";
|
|
4
4
|
import { t as Hyperdrive_d_exports } from "./Hyperdrive-z-9fFz15.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { t as ContainerNamespace_d_exports } from "./ContainerNamespace-CFjiLw8b.mjs";
|
|
6
|
+
import { a as WorkflowInstanceCreateOptions, i as WorkflowInstanceCreateBatchOptions, n as WorkflowBinding_d_exports, r as WorkflowInstance, s as WorkflowOperationError, t as WorkflowBindingClient } from "./WorkflowBinding-C9KRmfDU.mjs";
|
|
6
7
|
import { Cause, Config, Context, Data, DateTime, Duration, Effect, Layer, Option, Predicate, Redacted, Schema, Scope } from "effect";
|
|
7
8
|
import { Headers as Headers$1, HttpClient, HttpClientResponse } from "effect/unstable/http";
|
|
8
9
|
import { OtlpExporter, OtlpResource } from "effect/unstable/observability";
|
|
@@ -14,7 +15,7 @@ import { SqliteClient } from "@effect/sql-sqlite-do";
|
|
|
14
15
|
import { SqlClient } from "effect/unstable/sql";
|
|
15
16
|
import * as Tracer from "effect/Tracer";
|
|
16
17
|
declare namespace WorkersAi_d_exports {
|
|
17
|
-
export { LayerOptions$
|
|
18
|
+
export { LayerOptions$13 as LayerOptions, Tag$12 as Tag, TagClass$11 as TagClass, WorkersAiAsyncBatchResponse, WorkersAiBinding, WorkersAiClient, WorkersAiDefinition, WorkersAiEmbeddingInput, WorkersAiEmbeddingResponse, WorkersAiModelsSearchObject, WorkersAiModelsSearchParams, WorkersAiOperationError, WorkersAiOptions, WorkersAiService, embeddingResponse, isWorkersAiBinding, layer$13 as layer, make$12 as make, makeClient$10 as makeClient };
|
|
18
19
|
}
|
|
19
20
|
declare const WorkersAiOperationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
20
21
|
readonly _tag: "WorkersAiOperationError";
|
|
@@ -76,12 +77,12 @@ interface WorkersAiService<Id extends string> {
|
|
|
76
77
|
readonly id: Id;
|
|
77
78
|
};
|
|
78
79
|
}
|
|
79
|
-
type LayerOptions$
|
|
80
|
+
type LayerOptions$13 = {
|
|
80
81
|
readonly binding: string;
|
|
81
82
|
};
|
|
82
|
-
interface TagClass$
|
|
83
|
+
interface TagClass$11<Self, Id extends string, ModelList extends AiModelListType = AiModels> extends Context.ServiceClass<Self, Id, WorkersAiClient<ModelList>> {
|
|
83
84
|
readonly id: Id;
|
|
84
|
-
readonly layer: (options: LayerOptions$
|
|
85
|
+
readonly layer: (options: LayerOptions$13) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
85
86
|
}
|
|
86
87
|
type WorkersAiBindingValue = Schema.Schema.Type<typeof Schema.Unknown>;
|
|
87
88
|
declare const isWorkersAiBinding: (value: WorkersAiBindingValue) => value is WorkersAiBinding;
|
|
@@ -89,12 +90,12 @@ declare const embeddingResponse: (value: {
|
|
|
89
90
|
readonly data?: ReadonlyArray<ReadonlyArray<number>>;
|
|
90
91
|
readonly [embeddingDimensionsKey]?: ReadonlyArray<number>;
|
|
91
92
|
}) => WorkersAiEmbeddingResponse;
|
|
92
|
-
declare const makeClient$
|
|
93
|
-
declare const layer$
|
|
94
|
-
declare const make$
|
|
95
|
-
declare const Tag$
|
|
93
|
+
declare const makeClient$10: <ModelList extends AiModelListType = AiModels>(definition: WorkersAiDefinition) => (ai: WorkersAiBinding<ModelList>) => WorkersAiClient<ModelList>;
|
|
94
|
+
declare const layer$13: <Self, ModelList extends AiModelListType = AiModels>(tag: Context.Service<Self, WorkersAiClient<ModelList>>, definition: WorkersAiDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
95
|
+
declare const make$12: <Id extends string>(id: Id) => TagClass$11<WorkersAiService<Id>, Id, AiModels>;
|
|
96
|
+
declare const Tag$12: <Self>() => <Id extends string, ModelList extends AiModelListType = AiModels>(id: Id) => TagClass$11<Self, Id, ModelList>;
|
|
96
97
|
declare namespace AiGateway_d_exports {
|
|
97
|
-
export { AiGatewayBinding, AiGatewayClient, AiGatewayDefinition, AiGatewayFetchOptions, AiGatewayHeaders, AiGatewayLog, AiGatewayOperationError, AiGatewayPatchLog, AiGatewayProvider, AiGatewayRunOptions, AiGatewayService, AiGatewayUniversalRequest, LayerOptions$
|
|
98
|
+
export { AiGatewayBinding, AiGatewayClient, AiGatewayDefinition, AiGatewayFetchOptions, AiGatewayHeaders, AiGatewayLog, AiGatewayOperationError, AiGatewayPatchLog, AiGatewayProvider, AiGatewayRunOptions, AiGatewayService, AiGatewayUniversalRequest, LayerOptions$12 as LayerOptions, Tag$11 as Tag, TagClass$10 as TagClass, isAiGatewayBinding, layer$12 as layer, make$11 as make, makeClient$9 as makeClient, makeClientFromAi, makeHttpClient };
|
|
98
99
|
}
|
|
99
100
|
declare const AiGatewayOperationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
100
101
|
readonly _tag: "AiGatewayOperationError";
|
|
@@ -146,17 +147,17 @@ interface AiGatewayService<Id extends string> {
|
|
|
146
147
|
readonly id: Id;
|
|
147
148
|
};
|
|
148
149
|
}
|
|
149
|
-
type LayerOptions$
|
|
150
|
+
type LayerOptions$12 = {
|
|
150
151
|
readonly binding: string;
|
|
151
152
|
readonly gatewayId: string;
|
|
152
153
|
readonly accountId?: string;
|
|
153
154
|
};
|
|
154
|
-
interface TagClass$
|
|
155
|
+
interface TagClass$10<Self, Id extends string> extends Context.ServiceClass<Self, Id, AiGatewayClient> {
|
|
155
156
|
readonly id: Id;
|
|
156
|
-
readonly layer: (options: LayerOptions$
|
|
157
|
+
readonly layer: (options: LayerOptions$12) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError | AiGatewayOperationError, WorkerEnvironment>;
|
|
157
158
|
}
|
|
158
159
|
declare const isAiGatewayBinding: (value: AiGatewayBindingCandidate) => value is WorkersAiBinding;
|
|
159
|
-
declare const makeClient$
|
|
160
|
+
declare const makeClient$9: (definition: AiGatewayDefinition, gateway: AiGatewayBinding) => {
|
|
160
161
|
definition: AiGatewayDefinition;
|
|
161
162
|
run: (data: import("@cloudflare/workers-types").AIGatewayUniversalRequest | readonly import("@cloudflare/workers-types").AIGatewayUniversalRequest[], options?: {
|
|
162
163
|
gateway?: import("@cloudflare/workers-types").UniversalGatewayOptions;
|
|
@@ -174,11 +175,11 @@ declare const makeHttpClient: (definition: Omit<AiGatewayDefinition, "binding">
|
|
|
174
175
|
readonly accountId: string;
|
|
175
176
|
readonly binding?: string;
|
|
176
177
|
}, request?: typeof fetch) => AiGatewayClient;
|
|
177
|
-
declare const layer$
|
|
178
|
-
declare const make$
|
|
179
|
-
declare const Tag$
|
|
178
|
+
declare const layer$12: <Self>(tag: Context.Service<Self, AiGatewayClient>, definition: AiGatewayDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
179
|
+
declare const make$11: <Id extends string>(id: Id) => TagClass$10<AiGatewayService<Id>, Id>;
|
|
180
|
+
declare const Tag$11: <Self>() => <Id extends string>(id: Id) => TagClass$10<Self, Id>;
|
|
180
181
|
declare namespace AnalyticsEngine_d_exports {
|
|
181
|
-
export { AnalyticsEngineBinding, AnalyticsEngineClient, AnalyticsEngineDataPoint, AnalyticsEngineDataPointSchema, AnalyticsEngineDefinition, AnalyticsEngineFieldValue, AnalyticsEngineFieldValueSchema, AnalyticsEngineInvalidWritePolicy, AnalyticsEngineOperationError, AnalyticsEngineQueryClient, AnalyticsEngineQueryColumn, AnalyticsEngineQueryDefinition, AnalyticsEngineQueryError, AnalyticsEngineQueryOptions, AnalyticsEngineQueryResult, AnalyticsEngineQueryRow, AnalyticsEngineQueryService, AnalyticsEngineService, AnalyticsEngineWriteError, AnalyticsEngineWriteOptions, AnalyticsEngineWritePolicy, AnalyticsEngineWriteValidationError, AnalyticsEngineWriteViolation, LayerOptions$
|
|
182
|
+
export { AnalyticsEngineBinding, AnalyticsEngineClient, AnalyticsEngineDataPoint, AnalyticsEngineDataPointSchema, AnalyticsEngineDefinition, AnalyticsEngineFieldValue, AnalyticsEngineFieldValueSchema, AnalyticsEngineInvalidWritePolicy, AnalyticsEngineOperationError, AnalyticsEngineQueryClient, AnalyticsEngineQueryColumn, AnalyticsEngineQueryDefinition, AnalyticsEngineQueryError, AnalyticsEngineQueryOptions, AnalyticsEngineQueryResult, AnalyticsEngineQueryRow, AnalyticsEngineQueryService, AnalyticsEngineService, AnalyticsEngineWriteError, AnalyticsEngineWriteOptions, AnalyticsEngineWritePolicy, AnalyticsEngineWriteValidationError, AnalyticsEngineWriteViolation, LayerOptions$11 as LayerOptions, QueryConfigOptions, QueryTag, QueryTagClass, Tag$10 as Tag, TagClass$9 as TagClass, isAnalyticsEngineDataset, layer$11 as layer, layerFetch, layerFetchConfig, make$10 as make, makeClient$8 as makeClient, makeQuery, makeQueryClient, queryConfig, queryLayer, queryLayerConfig, writeLimits };
|
|
182
183
|
}
|
|
183
184
|
declare const writeLimits: {
|
|
184
185
|
readonly maxBlobs: 20;
|
|
@@ -306,7 +307,7 @@ interface AnalyticsEngineQueryService<Id extends string> {
|
|
|
306
307
|
readonly id: Id;
|
|
307
308
|
};
|
|
308
309
|
}
|
|
309
|
-
type LayerOptions$
|
|
310
|
+
type LayerOptions$11 = {
|
|
310
311
|
readonly binding: string;
|
|
311
312
|
readonly write?: AnalyticsEngineWritePolicy;
|
|
312
313
|
};
|
|
@@ -315,9 +316,9 @@ type QueryConfigOptions = {
|
|
|
315
316
|
readonly apiToken?: Config.Config<Redacted.Redacted<string>>;
|
|
316
317
|
readonly apiBaseUrl?: Config.Config<string>;
|
|
317
318
|
};
|
|
318
|
-
interface TagClass$
|
|
319
|
+
interface TagClass$9<Self, Id extends string> extends Context.ServiceClass<Self, Id, AnalyticsEngineClient> {
|
|
319
320
|
readonly id: Id;
|
|
320
|
-
readonly layer: (options: LayerOptions$
|
|
321
|
+
readonly layer: (options: LayerOptions$11) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
321
322
|
}
|
|
322
323
|
interface QueryTagClass<Self, Id extends string> extends Context.ServiceClass<Self, Id, AnalyticsEngineQueryClient> {
|
|
323
324
|
readonly id: Id;
|
|
@@ -328,7 +329,7 @@ interface QueryTagClass<Self, Id extends string> extends Context.ServiceClass<Se
|
|
|
328
329
|
}
|
|
329
330
|
declare const makeQueryClient: (definition: AnalyticsEngineQueryDefinition) => Effect.Effect<AnalyticsEngineQueryClient, never, HttpClient.HttpClient>;
|
|
330
331
|
declare const isAnalyticsEngineDataset: <Candidate>(value: Candidate) => value is Candidate & AnalyticsEngineBinding;
|
|
331
|
-
declare const makeClient$
|
|
332
|
+
declare const makeClient$8: (definition: AnalyticsEngineDefinition, defaults?: AnalyticsEngineWritePolicy) => (dataset: AnalyticsEngineBinding) => AnalyticsEngineClient;
|
|
332
333
|
declare const queryConfig: (options?: QueryConfigOptions) => Config.Config<{
|
|
333
334
|
accountId: string;
|
|
334
335
|
apiToken: Redacted.Redacted<string>;
|
|
@@ -338,13 +339,13 @@ declare const queryLayer: <Self>(tag: Context.Service<Self, AnalyticsEngineQuery
|
|
|
338
339
|
declare const layerFetch: <Self>(tag: Context.Service<Self, AnalyticsEngineQueryClient>, definition: AnalyticsEngineQueryDefinition) => Layer.Layer<Self, never, never>;
|
|
339
340
|
declare const queryLayerConfig: <Self>(tag: Context.Service<Self, AnalyticsEngineQueryClient>, config?: Config.Config<AnalyticsEngineQueryDefinition>) => Layer.Layer<Self, Config.ConfigError, HttpClient.HttpClient>;
|
|
340
341
|
declare const layerFetchConfig: <Self>(tag: Context.Service<Self, AnalyticsEngineQueryClient>, config?: Config.Config<AnalyticsEngineQueryDefinition>) => Layer.Layer<Self, Config.ConfigError, never>;
|
|
341
|
-
declare const layer$
|
|
342
|
-
declare const make$
|
|
342
|
+
declare const layer$11: <Self>(tag: Context.Service<Self, AnalyticsEngineClient>, definition: LayerOptions$11) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
343
|
+
declare const make$10: <Id extends string>(id: Id) => TagClass$9<AnalyticsEngineService<Id>, Id>;
|
|
343
344
|
declare const makeQuery: <Id extends string>(id: Id) => QueryTagClass<AnalyticsEngineQueryService<Id>, Id>;
|
|
344
|
-
declare const Tag$
|
|
345
|
+
declare const Tag$10: <Self>() => <Id extends string>(id: Id) => TagClass$9<Self, Id>;
|
|
345
346
|
declare const QueryTag: <Self>() => <Id extends string>(id: Id) => QueryTagClass<Self, Id>;
|
|
346
347
|
declare namespace BrowserRendering_d_exports {
|
|
347
|
-
export { BrowserRenderingBinding, BrowserRenderingBrowserClient, BrowserRenderingBrowserLike, BrowserRenderingClient, BrowserRenderingConnect, BrowserRenderingDefinition, BrowserRenderingExternalResult, BrowserRenderingLaunch, BrowserRenderingMethodOptions, BrowserRenderingOperationError, BrowserRenderingPageClient, BrowserRenderingPageFunction, BrowserRenderingPageLike, BrowserRenderingService, LayerOptions$
|
|
348
|
+
export { BrowserRenderingBinding, BrowserRenderingBrowserClient, BrowserRenderingBrowserLike, BrowserRenderingClient, BrowserRenderingConnect, BrowserRenderingDefinition, BrowserRenderingExternalResult, BrowserRenderingLaunch, BrowserRenderingMethodOptions, BrowserRenderingOperationError, BrowserRenderingPageClient, BrowserRenderingPageFunction, BrowserRenderingPageLike, BrowserRenderingService, LayerOptions$10 as LayerOptions, Tag$9 as Tag, TagClass$8 as TagClass, isBrowserRenderingBinding, layer$10 as layer, make$9 as make, makeClient$7 as makeClient };
|
|
348
349
|
}
|
|
349
350
|
declare const BrowserRenderingOperationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
350
351
|
readonly _tag: "BrowserRenderingOperationError";
|
|
@@ -413,20 +414,20 @@ interface BrowserRenderingService<Id extends string> {
|
|
|
413
414
|
readonly id: Id;
|
|
414
415
|
};
|
|
415
416
|
}
|
|
416
|
-
type LayerOptions$
|
|
417
|
+
type LayerOptions$10 = {
|
|
417
418
|
readonly binding: string;
|
|
418
419
|
};
|
|
419
|
-
interface TagClass$
|
|
420
|
+
interface TagClass$8<Self, Id extends string> extends Context.ServiceClass<Self, Id, BrowserRenderingClient> {
|
|
420
421
|
readonly id: Id;
|
|
421
|
-
readonly layer: (options: LayerOptions$
|
|
422
|
+
readonly layer: (options: LayerOptions$10) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
422
423
|
}
|
|
423
424
|
declare const isBrowserRenderingBinding: <Candidate>(value: Candidate) => value is Candidate & BrowserRenderingBinding;
|
|
424
|
-
declare const makeClient$
|
|
425
|
-
declare const layer$
|
|
426
|
-
declare const make$
|
|
427
|
-
declare const Tag$
|
|
425
|
+
declare const makeClient$7: <RawBinding extends BrowserRenderingBinding = BrowserRenderingBinding>(definition: BrowserRenderingDefinition) => (binding: RawBinding) => BrowserRenderingClient<RawBinding>;
|
|
426
|
+
declare const layer$10: <Self>(tag: Context.Service<Self, BrowserRenderingClient>, definition: BrowserRenderingDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
427
|
+
declare const make$9: <Id extends string>(id: Id) => TagClass$8<BrowserRenderingService<Id>, Id>;
|
|
428
|
+
declare const Tag$9: <Self>() => <Id extends string>(id: Id) => TagClass$8<Self, Id>;
|
|
428
429
|
declare namespace Cache_d_exports {
|
|
429
|
-
export { CacheClient, CacheOperation, CacheOperationError, CacheQueryOptions, CacheRequest, CacheStorage, CacheStorageClient, layer$
|
|
430
|
+
export { CacheClient, CacheOperation, CacheOperationError, CacheQueryOptions, CacheRequest, CacheStorage, CacheStorageClient, layer$9 as layer, layerFrom, makeCacheClient, makeClient$6 as makeClient };
|
|
430
431
|
}
|
|
431
432
|
/** Request key accepted by Cloudflare's Cache API. */
|
|
432
433
|
type CacheRequest = CloudflareRequestInfo | URL;
|
|
@@ -473,13 +474,13 @@ declare class CacheStorage extends CacheStorage_base {}
|
|
|
473
474
|
/** Wraps a native Cloudflare `Cache` instance. */
|
|
474
475
|
declare const makeCacheClient: (cache: CloudflareCache, name?: string) => CacheClient;
|
|
475
476
|
/** Wraps a native Cloudflare `CacheStorage` instance. */
|
|
476
|
-
declare const makeClient$
|
|
477
|
+
declare const makeClient$6: (storage: CloudflareCacheStorage) => CacheStorageClient;
|
|
477
478
|
/** Provides Cache API services from an explicit native `CacheStorage` instance. */
|
|
478
479
|
declare const layerFrom: (storage: CloudflareCacheStorage) => Layer.Layer<CacheStorage>;
|
|
479
480
|
/** Provides Cache API services from Cloudflare's global `caches` object. */
|
|
480
|
-
declare const layer$
|
|
481
|
+
declare const layer$9: Layer.Layer<CacheStorage>;
|
|
481
482
|
declare namespace CloudflareOtlp_d_exports {
|
|
482
|
-
export { DurableObjectLayerOptions, LayerOptions$
|
|
483
|
+
export { DurableObjectLayerOptions, LayerOptions$9 as LayerOptions, ResourceOptions, Serialization, Signal, WorkerLayerOptions, layer$8 as layer, layerDurableObject, layerJson, layerProtobuf, layerWorker };
|
|
483
484
|
}
|
|
484
485
|
type ResourceAttributes = NonNullable<Parameters<typeof OtlpResource.make>[0]["attributes"]>;
|
|
485
486
|
/** Telemetry signal groups supported by the Cloudflare OTLP layers. */
|
|
@@ -504,7 +505,7 @@ interface ResourceOptions {
|
|
|
504
505
|
readonly attributes?: ResourceAttributes;
|
|
505
506
|
}
|
|
506
507
|
/** Options shared by all Cloudflare OTLP telemetry layers. */
|
|
507
|
-
interface LayerOptions$
|
|
508
|
+
interface LayerOptions$9 {
|
|
508
509
|
/**
|
|
509
510
|
* Telemetry signals to export. Defaults to logs, traces, and metrics.
|
|
510
511
|
*
|
|
@@ -531,12 +532,12 @@ interface LayerOptions$10 {
|
|
|
531
532
|
readonly tracerContext?: <X>(primitive: Tracer.EffectPrimitive<X>, span: Tracer.AnySpan) => X;
|
|
532
533
|
}
|
|
533
534
|
/** Resource metadata specific to Cloudflare Workers. */
|
|
534
|
-
interface WorkerLayerOptions extends LayerOptions$
|
|
535
|
+
interface WorkerLayerOptions extends LayerOptions$9 {
|
|
535
536
|
/** Cloudflare Worker name to attach as `cloudflare.worker.name`. */
|
|
536
537
|
readonly workerName?: string;
|
|
537
538
|
}
|
|
538
539
|
/** Resource metadata specific to Cloudflare Durable Objects. */
|
|
539
|
-
interface DurableObjectLayerOptions extends LayerOptions$
|
|
540
|
+
interface DurableObjectLayerOptions extends LayerOptions$9 {
|
|
540
541
|
/** Durable Object class name to attach as `cloudflare.durable_object.class`. */
|
|
541
542
|
readonly className?: string;
|
|
542
543
|
/**
|
|
@@ -557,11 +558,11 @@ interface DurableObjectLayerOptions extends LayerOptions$10 {
|
|
|
557
558
|
* The layer provides {@link OtlpExporter.Flusher} for draining buffered
|
|
558
559
|
* telemetry before the isolate freezes.
|
|
559
560
|
*/
|
|
560
|
-
declare const layer$
|
|
561
|
+
declare const layer$8: (options?: LayerOptions$9) => Layer.Layer<OtlpExporter.Flusher>;
|
|
561
562
|
/** Base OTLP telemetry layer forced to JSON serialization. */
|
|
562
|
-
declare const layerJson: (options?: Omit<LayerOptions$
|
|
563
|
+
declare const layerJson: (options?: Omit<LayerOptions$9, "serialization">) => Layer.Layer<OtlpExporter.Flusher>;
|
|
563
564
|
/** Base OTLP telemetry layer forced to protobuf serialization. */
|
|
564
|
-
declare const layerProtobuf: (options?: Omit<LayerOptions$
|
|
565
|
+
declare const layerProtobuf: (options?: Omit<LayerOptions$9, "serialization">) => Layer.Layer<OtlpExporter.Flusher>;
|
|
565
566
|
/**
|
|
566
567
|
* OTLP layer with Cloudflare Worker resource attributes.
|
|
567
568
|
*
|
|
@@ -577,157 +578,6 @@ declare const layerWorker: (options?: WorkerLayerOptions) => Layer.Layer<OtlpExp
|
|
|
577
578
|
* backend can tolerate high-cardinality resource attributes.
|
|
578
579
|
*/
|
|
579
580
|
declare const layerDurableObject: (options?: DurableObjectLayerOptions) => Layer.Layer<OtlpExporter.Flusher, never, DurableObjectState>;
|
|
580
|
-
declare namespace ContainerNamespace_d_exports {
|
|
581
|
-
export { ContainerInstanceClient, ContainerNamespace, ContainerNamespaceClient, ContainerNamespaceDefinition, ContainerNamespaceResource, ContainerNamespaceService, ContainerNamespaceStaticClient, ContainerOperationError, ContainerReadinessOptions, ContainerSignal, ContainerStartAndWaitForPortsOptions, ContainerStartOptions, ContainerState, ContainerStopSignal, ContainerStub, ContainerStubOf, ContainerWaitOptions, LayerOptions$9 as LayerOptions, Tag$9 as Tag, TagClass$8 as TagClass, isContainerNamespaceResource, layer$8 as layer, make$9 as make, makeClient$6 as makeClient };
|
|
582
|
-
}
|
|
583
|
-
/** Named signal accepted by Cloudflare Container instances. */
|
|
584
|
-
type ContainerSignal = "SIGKILL" | "SIGINT" | "SIGTERM";
|
|
585
|
-
/** Named or numeric signal accepted by Container `stop()`. */
|
|
586
|
-
type ContainerStopSignal = ContainerSignal | number;
|
|
587
|
-
/** Per-instance Container startup configuration. */
|
|
588
|
-
interface ContainerStartOptions {
|
|
589
|
-
readonly envVars?: Record<string, string>;
|
|
590
|
-
readonly entrypoint?: Array<string>;
|
|
591
|
-
readonly enableInternet?: boolean;
|
|
592
|
-
readonly labels?: Record<string, string>;
|
|
593
|
-
}
|
|
594
|
-
/** Serializable retry settings used while starting a Container. */
|
|
595
|
-
interface ContainerWaitOptions {
|
|
596
|
-
readonly portToCheck: number;
|
|
597
|
-
readonly retries?: number;
|
|
598
|
-
readonly waitInterval?: number;
|
|
599
|
-
}
|
|
600
|
-
/** Serializable timeout settings used while waiting for Container ports. */
|
|
601
|
-
interface ContainerReadinessOptions {
|
|
602
|
-
readonly instanceGetTimeoutMS?: number;
|
|
603
|
-
readonly portReadyTimeoutMS?: number;
|
|
604
|
-
readonly waitInterval?: number;
|
|
605
|
-
}
|
|
606
|
-
/** Options for starting a Container and waiting for its ports. */
|
|
607
|
-
interface ContainerStartAndWaitForPortsOptions {
|
|
608
|
-
readonly startOptions?: ContainerStartOptions;
|
|
609
|
-
readonly ports?: number | Array<number>;
|
|
610
|
-
readonly cancellationOptions?: ContainerReadinessOptions;
|
|
611
|
-
}
|
|
612
|
-
/** Serializable state reported by a Cloudflare Container instance. */
|
|
613
|
-
declare const ContainerState: Schema.Union<readonly [Schema.Struct<{
|
|
614
|
-
readonly lastChange: Schema.Finite;
|
|
615
|
-
readonly status: Schema.Literals<readonly ["running", "stopping", "stopped", "healthy"]>;
|
|
616
|
-
}>, Schema.Struct<{
|
|
617
|
-
readonly lastChange: Schema.Finite;
|
|
618
|
-
readonly status: Schema.Literal<"stopped_with_code">;
|
|
619
|
-
readonly exitCode: Schema.optionalKey<Schema.Int>;
|
|
620
|
-
}>]>;
|
|
621
|
-
type ContainerState = typeof ContainerState.Type;
|
|
622
|
-
/**
|
|
623
|
-
* Native Container stub shape exposed by a Container namespace binding.
|
|
624
|
-
*
|
|
625
|
-
* This is structural so using Container bindings does not make
|
|
626
|
-
* `@cloudflare/containers` a runtime dependency of effect-cf.
|
|
627
|
-
*/
|
|
628
|
-
interface ContainerStub {
|
|
629
|
-
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
630
|
-
getState(): Promise<ContainerState>;
|
|
631
|
-
start(options?: ContainerStartOptions, waitOptions?: ContainerWaitOptions): Promise<void>;
|
|
632
|
-
startAndWaitForPorts(options?: ContainerStartAndWaitForPortsOptions): Promise<void>;
|
|
633
|
-
waitForPort(options: ContainerWaitOptions): Promise<number>;
|
|
634
|
-
stop(signal?: ContainerStopSignal): Promise<void>;
|
|
635
|
-
destroy(): Promise<void>;
|
|
636
|
-
setAllowedHosts(hosts: Array<string>): Promise<void>;
|
|
637
|
-
setDeniedHosts(hosts: Array<string>): Promise<void>;
|
|
638
|
-
allowHost(hostname: string): Promise<void>;
|
|
639
|
-
denyHost(hostname: string): Promise<void>;
|
|
640
|
-
removeAllowedHost(hostname: string): Promise<void>;
|
|
641
|
-
removeDeniedHost(hostname: string): Promise<void>;
|
|
642
|
-
}
|
|
643
|
-
/** Native Container namespace binding shape. */
|
|
644
|
-
interface ContainerNamespaceResource {
|
|
645
|
-
getByName(name: string, options?: globalThis.DurableObjectNamespaceGetDurableObjectOptions): ContainerStub;
|
|
646
|
-
}
|
|
647
|
-
/** Exact native stub type produced by a Container namespace binding. */
|
|
648
|
-
type ContainerStubOf<Namespace extends ContainerNamespaceResource> = ReturnType<Namespace["getByName"]>;
|
|
649
|
-
/** Container namespace binding metadata. */
|
|
650
|
-
interface ContainerNamespaceDefinition {
|
|
651
|
-
/** Binding name as configured in `wrangler.jsonc`. */
|
|
652
|
-
readonly binding: string;
|
|
653
|
-
}
|
|
654
|
-
declare const ContainerOperationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
655
|
-
readonly _tag: "ContainerOperationError";
|
|
656
|
-
} & Readonly<A>;
|
|
657
|
-
/** Failure raised when invoking a named Container operation. */
|
|
658
|
-
declare class ContainerOperationError extends ContainerOperationError_base<{
|
|
659
|
-
readonly binding: string;
|
|
660
|
-
readonly instance: string;
|
|
661
|
-
readonly operation: string;
|
|
662
|
-
readonly cause: unknown;
|
|
663
|
-
}> {
|
|
664
|
-
get message(): string;
|
|
665
|
-
}
|
|
666
|
-
/** Effect-wrapped client for one named Container instance. */
|
|
667
|
-
interface ContainerInstanceClient<Stub extends ContainerStub = ContainerStub> {
|
|
668
|
-
readonly rawUnsafe: Effect.Effect<Stub, ContainerOperationError>;
|
|
669
|
-
readonly state: Effect.Effect<ContainerState, ContainerOperationError>;
|
|
670
|
-
readonly fetch: (input: RequestInfo | URL, init?: RequestInit) => Effect.Effect<Response, ContainerOperationError>;
|
|
671
|
-
readonly start: (options?: ContainerStartOptions, waitOptions?: ContainerWaitOptions) => Effect.Effect<void, ContainerOperationError>;
|
|
672
|
-
readonly startAndWaitForPorts: (options?: ContainerStartAndWaitForPortsOptions) => Effect.Effect<void, ContainerOperationError>;
|
|
673
|
-
readonly waitForPort: (options: ContainerWaitOptions) => Effect.Effect<number, ContainerOperationError>;
|
|
674
|
-
readonly stop: (signal?: ContainerStopSignal) => Effect.Effect<void, ContainerOperationError>;
|
|
675
|
-
readonly destroy: Effect.Effect<void, ContainerOperationError>;
|
|
676
|
-
readonly setAllowedHosts: (hosts: ReadonlyArray<string>) => Effect.Effect<void, ContainerOperationError>;
|
|
677
|
-
readonly setDeniedHosts: (hosts: ReadonlyArray<string>) => Effect.Effect<void, ContainerOperationError>;
|
|
678
|
-
readonly allowHost: (hostname: string) => Effect.Effect<void, ContainerOperationError>;
|
|
679
|
-
readonly denyHost: (hostname: string) => Effect.Effect<void, ContainerOperationError>;
|
|
680
|
-
readonly removeAllowedHost: (hostname: string) => Effect.Effect<void, ContainerOperationError>;
|
|
681
|
-
readonly removeDeniedHost: (hostname: string) => Effect.Effect<void, ContainerOperationError>;
|
|
682
|
-
}
|
|
683
|
-
/** Effect client for a Container namespace binding. */
|
|
684
|
-
interface ContainerNamespaceClient<Namespace extends ContainerNamespaceResource = ContainerNamespaceResource> {
|
|
685
|
-
readonly definition: ContainerNamespaceDefinition;
|
|
686
|
-
readonly getByName: (name: string, options?: globalThis.DurableObjectNamespaceGetDurableObjectOptions) => Effect.Effect<ContainerInstanceClient<ContainerStubOf<Namespace>>, ContainerOperationError>;
|
|
687
|
-
readonly byName: (name: string, options?: globalThis.DurableObjectNamespaceGetDurableObjectOptions) => ContainerInstanceClient<ContainerStubOf<Namespace>>;
|
|
688
|
-
readonly rawUnsafe: Effect.Effect<Namespace>;
|
|
689
|
-
}
|
|
690
|
-
type ContainerNamespaceStaticClient<R, Namespace extends ContainerNamespaceResource = ContainerNamespaceResource> = {
|
|
691
|
-
readonly getByName: (name: string, options?: globalThis.DurableObjectNamespaceGetDurableObjectOptions) => Effect.Effect<ContainerInstanceClient<ContainerStubOf<Namespace>>, ContainerOperationError, R>;
|
|
692
|
-
readonly byName: (name: string, options?: globalThis.DurableObjectNamespaceGetDurableObjectOptions) => {
|
|
693
|
-
readonly state: Effect.Effect<ContainerState, ContainerOperationError, R>;
|
|
694
|
-
readonly fetch: (input: RequestInfo | URL, init?: RequestInit) => Effect.Effect<Response, ContainerOperationError, R>;
|
|
695
|
-
readonly start: (options?: ContainerStartOptions, waitOptions?: ContainerWaitOptions) => Effect.Effect<void, ContainerOperationError, R>;
|
|
696
|
-
readonly startAndWaitForPorts: (options?: ContainerStartAndWaitForPortsOptions) => Effect.Effect<void, ContainerOperationError, R>;
|
|
697
|
-
readonly waitForPort: (options: ContainerWaitOptions) => Effect.Effect<number, ContainerOperationError, R>;
|
|
698
|
-
readonly stop: (signal?: ContainerStopSignal) => Effect.Effect<void, ContainerOperationError, R>;
|
|
699
|
-
readonly destroy: Effect.Effect<void, ContainerOperationError, R>;
|
|
700
|
-
readonly setAllowedHosts: (hosts: ReadonlyArray<string>) => Effect.Effect<void, ContainerOperationError, R>;
|
|
701
|
-
readonly setDeniedHosts: (hosts: ReadonlyArray<string>) => Effect.Effect<void, ContainerOperationError, R>;
|
|
702
|
-
readonly allowHost: (hostname: string) => Effect.Effect<void, ContainerOperationError, R>;
|
|
703
|
-
readonly denyHost: (hostname: string) => Effect.Effect<void, ContainerOperationError, R>;
|
|
704
|
-
readonly removeAllowedHost: (hostname: string) => Effect.Effect<void, ContainerOperationError, R>;
|
|
705
|
-
readonly removeDeniedHost: (hostname: string) => Effect.Effect<void, ContainerOperationError, R>;
|
|
706
|
-
readonly rawUnsafe: Effect.Effect<ContainerStubOf<Namespace>, ContainerOperationError, R>;
|
|
707
|
-
};
|
|
708
|
-
readonly rawUnsafe: Effect.Effect<Namespace, never, R>;
|
|
709
|
-
};
|
|
710
|
-
type LayerOptions$9 = {
|
|
711
|
-
readonly binding: string;
|
|
712
|
-
};
|
|
713
|
-
interface TagClass$8<Self, Id extends string, Namespace extends ContainerNamespaceResource = ContainerNamespaceResource> extends Context.ServiceClass<Self, `effect-cf/Container/${Id}`, ContainerNamespaceClient<Namespace>>, ContainerNamespaceStaticClient<Self, Namespace> {
|
|
714
|
-
readonly id: Id;
|
|
715
|
-
readonly layer: (options: LayerOptions$9) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
716
|
-
}
|
|
717
|
-
declare const isContainerNamespaceResource: <Candidate>(value: Candidate) => value is Candidate & ContainerNamespaceResource;
|
|
718
|
-
declare const makeClient$6: (definition: ContainerNamespaceDefinition) => <Namespace extends ContainerNamespaceResource>(namespace: Namespace) => ContainerNamespaceClient<Namespace>;
|
|
719
|
-
declare const layer$8: <Self, Namespace extends ContainerNamespaceResource>(tag: Context.Service<Self, ContainerNamespaceClient<Namespace>>, definition: ContainerNamespaceDefinition) => Layer.Layer<Self, BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
|
|
720
|
-
declare const make$9: <Id extends string>(id: Id) => TagClass$8<ContainerNamespaceService<Id>, Id, ContainerNamespaceResource>;
|
|
721
|
-
declare const ContainerNamespaceServiceTypeId: unique symbol;
|
|
722
|
-
/** Nominal service marker for Container namespaces created with {@link make}. */
|
|
723
|
-
interface ContainerNamespaceService<Id extends string> {
|
|
724
|
-
readonly [ContainerNamespaceServiceTypeId]: {
|
|
725
|
-
readonly id: Id;
|
|
726
|
-
};
|
|
727
|
-
}
|
|
728
|
-
/** Creates a typed Effect service for a Cloudflare Container namespace. */
|
|
729
|
-
declare const Tag$9: <Self, Namespace extends ContainerNamespaceResource = ContainerNamespaceResource>() => <Id extends string>(id: Id) => TagClass$8<Self, Id, Namespace>;
|
|
730
|
-
declare const ContainerNamespace: typeof Tag$9;
|
|
731
581
|
declare namespace D1_d_exports {
|
|
732
582
|
export { D1Definition, D1Service, D1SqlLayerOptions, Service, TypeId$1 as TypeId, make$8 as make };
|
|
733
583
|
}
|
|
@@ -1641,7 +1491,7 @@ declare const layer$4: <Self>(tag: Context.Service<Self, EmailClient>, definitio
|
|
|
1641
1491
|
declare const make$5: <Id extends string>(id: Id) => TagClass$6<EmailService<Id>, Id>;
|
|
1642
1492
|
declare const Tag$7: <Self>() => <Id extends string>(id: Id) => TagClass$6<Self, Id>;
|
|
1643
1493
|
declare namespace Images_d_exports {
|
|
1644
|
-
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, TypeId, draw, empty, isImagesBinding, layer$3 as layer, make$4 as make, makeClient$3 as makeClient, transform };
|
|
1494
|
+
export { DrawStepOptions, HostedImagesClient, ImageDirectUploadOptions, ImageDirectUploadResult, ImageDrawOptions, ImageHandleClient, ImageInfoResponse, ImageInputOptions, ImageInputValue, ImageList, ImageListOptions, ImageMetadata, ImageOutputOptions, ImageSignedUrlOptions, ImageTransform, ImageTransformationOutputOptions, ImageTransformationResponseOptions, 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, TextOptions, TypeId, draw, empty, isImagesBinding, layer$3 as layer, make$4 as make, makeClient$3 as makeClient, transform };
|
|
1645
1495
|
}
|
|
1646
1496
|
declare const TypeId: "~effect-cf/Images/Steps";
|
|
1647
1497
|
type TypeId = typeof TypeId;
|
|
@@ -1667,12 +1517,17 @@ type ImageDrawOptions = CloudflareImageDrawOptions;
|
|
|
1667
1517
|
type ImageInputOptions = CloudflareImageInputOptions;
|
|
1668
1518
|
type ImageOutputOptions = CloudflareImageOutputOptions;
|
|
1669
1519
|
type ImageTransformationOutputOptions = CloudflareImageTransformationOutputOptions;
|
|
1520
|
+
type ImageTransformationResponseOptions = CloudflareImageTransformationResponseOptions;
|
|
1670
1521
|
type ImageTransformationResult = CloudflareImageTransformationResult;
|
|
1671
1522
|
type ImageUploadOptions = CloudflareImageUploadOptions;
|
|
1672
1523
|
type ImageUpdateOptions = CloudflareImageUpdateOptions;
|
|
1673
1524
|
type ImageListOptions = CloudflareImageListOptions;
|
|
1674
1525
|
type ImageList = CloudflareImageList;
|
|
1675
1526
|
type ImageMetadata = CloudflareImageMetadata;
|
|
1527
|
+
type ImageSignedUrlOptions = CloudflareImageSignedUrlOptions;
|
|
1528
|
+
type ImageDirectUploadOptions = CloudflareImageDirectUploadOptions;
|
|
1529
|
+
type ImageDirectUploadResult = CloudflareImageDirectUploadResult;
|
|
1530
|
+
type TextOptions = CloudflareTextOptions;
|
|
1676
1531
|
type ImageInputValue = ReadableStream<Uint8Array> | ArrayBuffer;
|
|
1677
1532
|
type ImageUploadValue = ReadableStream<Uint8Array> | ArrayBuffer;
|
|
1678
1533
|
interface DrawStepOptions {
|
|
@@ -1748,14 +1603,18 @@ interface Steps {
|
|
|
1748
1603
|
readonly [TypeId]: typeof TypeId;
|
|
1749
1604
|
readonly steps: ReadonlyArray<Step>;
|
|
1750
1605
|
}
|
|
1751
|
-
|
|
1606
|
+
type ProcessOptions = {
|
|
1752
1607
|
readonly stream: ImageInputValue;
|
|
1753
1608
|
readonly inputOptions?: ImageInputOptions;
|
|
1754
1609
|
readonly outputOptions: ImageOutputOptions;
|
|
1755
|
-
}
|
|
1610
|
+
} | {
|
|
1611
|
+
readonly text: string;
|
|
1612
|
+
readonly textOptions: TextOptions;
|
|
1613
|
+
readonly outputOptions: ImageOutputOptions;
|
|
1614
|
+
};
|
|
1756
1615
|
interface ImagesTransformationResultClient {
|
|
1757
1616
|
readonly raw: CloudflareImageTransformationResult;
|
|
1758
|
-
readonly response: Effect.Effect<CloudflareResponse, ImagesOperationError>;
|
|
1617
|
+
readonly response: (options?: ImageTransformationResponseOptions) => Effect.Effect<CloudflareResponse, ImagesOperationError>;
|
|
1759
1618
|
readonly contentType: Effect.Effect<string, ImagesOperationError>;
|
|
1760
1619
|
readonly image: (options?: ImageTransformationOutputOptions) => Effect.Effect<ReadableStream<Uint8Array>, ImagesOperationError>;
|
|
1761
1620
|
}
|
|
@@ -1763,6 +1622,7 @@ interface ImageHandleClient {
|
|
|
1763
1622
|
readonly raw: CloudflareImageHandle;
|
|
1764
1623
|
readonly details: Effect.Effect<Option.Option<ImageMetadata>, ImagesOperationError>;
|
|
1765
1624
|
readonly bytes: Effect.Effect<Option.Option<ReadableStream<Uint8Array>>, ImagesOperationError>;
|
|
1625
|
+
readonly signedUrl: (options: ImageSignedUrlOptions) => Effect.Effect<string, ImagesOperationError>;
|
|
1766
1626
|
readonly update: (options: ImageUpdateOptions) => Effect.Effect<ImageMetadata, ImagesOperationError>;
|
|
1767
1627
|
readonly delete: Effect.Effect<boolean, ImagesOperationError>;
|
|
1768
1628
|
}
|
|
@@ -1770,16 +1630,19 @@ interface HostedImagesClient {
|
|
|
1770
1630
|
readonly image: (imageId: string) => ImageHandleClient;
|
|
1771
1631
|
readonly upload: (image: ImageUploadValue, options?: ImageUploadOptions) => Effect.Effect<ImageMetadata, ImagesOperationError>;
|
|
1772
1632
|
readonly list: (options?: ImageListOptions) => Effect.Effect<ImageList, ImagesOperationError>;
|
|
1633
|
+
readonly createDirectUpload: (options?: ImageDirectUploadOptions) => Effect.Effect<ImageDirectUploadResult, ImagesOperationError>;
|
|
1773
1634
|
readonly rawUnsafe: Effect.Effect<CloudflareHostedImagesBinding>;
|
|
1774
1635
|
}
|
|
1775
1636
|
interface ImagesRuntimeBinding {
|
|
1776
1637
|
readonly info: (image: ImageInputValue, options?: ImageInputOptions) => Promise<ImageInfoResponse>;
|
|
1777
1638
|
readonly input: (image: ImageInputValue, options?: ImageInputOptions) => CloudflareImageTransformer;
|
|
1639
|
+
readonly text?: (content: string, options: TextOptions) => CloudflareImageTransformer;
|
|
1778
1640
|
readonly hosted?: CloudflareHostedImagesBinding;
|
|
1779
1641
|
}
|
|
1780
1642
|
interface ImagesClient {
|
|
1781
1643
|
readonly info: (image: ImageInputValue, options?: ImageInputOptions) => Effect.Effect<ImageInfoResponse, ImagesOperationError>;
|
|
1782
1644
|
readonly input: (image: ImageInputValue, options?: ImageInputOptions) => Effect.Effect<CloudflareImageTransformer, ImagesOperationError>;
|
|
1645
|
+
readonly text: (content: string, options: TextOptions) => Effect.Effect<CloudflareImageTransformer, ImagesOperationError>;
|
|
1783
1646
|
readonly process: (steps: Steps, options: ProcessOptions) => Effect.Effect<ImagesTransformationResultClient, ImagesOperationError>;
|
|
1784
1647
|
readonly hosted: Option.Option<HostedImagesClient>;
|
|
1785
1648
|
readonly rawUnsafe: Effect.Effect<ImagesRuntimeBinding>;
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
2
|
import { a as WorkerEnvironment, i as WorkerConfig, n as violationsMessage, r as Environment_exports, t as causeMessage } from "./ErrorMessage-BM0K-Nik.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { n as Service$2, r as layer$19, t as Binding_exports } from "./Binding-pfilNJmP.mjs";
|
|
4
|
+
import { n as Artifacts_exports } from "./Artifacts-CSIk1Oml.mjs";
|
|
5
|
+
import { a as DurableObjectWebSocket_exports, i as fromExecutionContext, n as DurableObjectState_exports, o as fromWebSocket, r as fromDurableObjectState, s as DurableObjectStorage_exports, t as DurableObjectState } from "./DurableObjectState-CxS5Y2hf.mjs";
|
|
5
6
|
import { Cause, Clock, Config, ConfigProvider, Context, Data, DateTime, Duration, Effect, Exit, Function as Function$1, Layer, ManagedRuntime, Option, Predicate, Queue, Result, Schema } from "effect";
|
|
6
7
|
import { FetchHttpClient, HttpClient, HttpClientRequest, HttpEffect, HttpServerRequest, HttpServerResponse } from "effect/unstable/http";
|
|
7
8
|
import { OtlpExporter, OtlpLogger, OtlpMetrics, OtlpSerialization, OtlpTracer } from "effect/unstable/observability";
|
|
@@ -2917,11 +2918,11 @@ const tryImagesSync = (binding, operation, evaluate) => Effect.try({
|
|
|
2917
2918
|
});
|
|
2918
2919
|
const maybe = (value) => value === null ? Option.none() : Option.some(value);
|
|
2919
2920
|
const hasFunction = (value, key) => Predicate.hasProperty(value, key) && Predicate.isFunction(value[key]);
|
|
2920
|
-
const isHostedImagesBinding = (value) => hasFunction(value, "image") && hasFunction(value, "upload") && hasFunction(value, "list");
|
|
2921
|
+
const isHostedImagesBinding = (value) => hasFunction(value, "image") && hasFunction(value, "upload") && hasFunction(value, "list") && hasFunction(value, "createDirectUpload");
|
|
2921
2922
|
const isImagesBinding = (value) => hasFunction(value, "info") && hasFunction(value, "input");
|
|
2922
2923
|
const wrapResult = (binding, result) => ({
|
|
2923
2924
|
raw: result,
|
|
2924
|
-
response: tryImagesSync(binding, "response", () => result.response()),
|
|
2925
|
+
response: (options) => tryImagesSync(binding, "response", () => result.response(options)),
|
|
2925
2926
|
contentType: tryImagesSync(binding, "contentType", () => result.contentType()),
|
|
2926
2927
|
image: (options) => tryImagesSync(binding, "image", () => result.image(options))
|
|
2927
2928
|
});
|
|
@@ -2929,6 +2930,7 @@ const wrapHandle = (binding, handle) => ({
|
|
|
2929
2930
|
raw: handle,
|
|
2930
2931
|
details: tryImagesPromise(binding, "details", () => handle.details()).pipe(Effect.map(maybe), Effect.withSpan("Images.details")),
|
|
2931
2932
|
bytes: tryImagesPromise(binding, "bytes", () => handle.bytes()).pipe(Effect.map(maybe), Effect.withSpan("Images.bytes")),
|
|
2933
|
+
signedUrl: Effect.fn("Images.signedUrl")((options) => tryImagesPromise(binding, "signedUrl", () => handle.signedUrl(options))),
|
|
2932
2934
|
update: Effect.fn("Images.update")((options) => tryImagesPromise(binding, "update", () => handle.update(options))),
|
|
2933
2935
|
delete: tryImagesPromise(binding, "delete", () => handle.delete()).pipe(Effect.withSpan("Images.delete"))
|
|
2934
2936
|
});
|
|
@@ -2936,12 +2938,17 @@ const wrapHosted = (binding, hosted) => ({
|
|
|
2936
2938
|
image: (imageId) => wrapHandle(binding, hosted.image(imageId)),
|
|
2937
2939
|
upload: Effect.fn("Images.upload")((image, options) => tryImagesPromise(binding, "upload", () => hosted.upload(image, options))),
|
|
2938
2940
|
list: Effect.fn("Images.list")((options) => tryImagesPromise(binding, "list", () => hosted.list(options))),
|
|
2941
|
+
createDirectUpload: Effect.fn("Images.createDirectUpload")((options) => tryImagesPromise(binding, "createDirectUpload", () => hosted.createDirectUpload(options))),
|
|
2939
2942
|
rawUnsafe: Effect.succeed(hosted)
|
|
2940
2943
|
});
|
|
2941
2944
|
const makeClient$4 = (definition) => (images) => {
|
|
2942
2945
|
const input = (image, options) => tryImagesSync(definition.binding, "input", () => images.input(image, options));
|
|
2946
|
+
const text = (content, options) => tryImagesSync(definition.binding, "text", () => {
|
|
2947
|
+
if (!hasFunction(images, "text")) throw new Error("Images binding is missing text()");
|
|
2948
|
+
return images.text(content, options);
|
|
2949
|
+
});
|
|
2943
2950
|
const process = Effect.fn("Images.process")(function* (steps, options) {
|
|
2944
|
-
let transformer = yield* input(options.stream, options.inputOptions);
|
|
2951
|
+
let transformer = "text" in options ? yield* text(options.text, options.textOptions) : yield* input(options.stream, options.inputOptions);
|
|
2945
2952
|
for (const step of steps.steps) transformer = yield* Step.$match(step, {
|
|
2946
2953
|
Draw: (drawStep) => tryImagesSync(definition.binding, "draw", () => transformer.draw(drawStep.image, drawStep.options)),
|
|
2947
2954
|
Transform: (transformStep) => tryImagesSync(definition.binding, "transform", () => transformer.transform(transformStep.transform))
|
|
@@ -2953,6 +2960,7 @@ const makeClient$4 = (definition) => (images) => {
|
|
|
2953
2960
|
definition,
|
|
2954
2961
|
info: Effect.fn("Images.info")((image, options) => tryImagesPromise(definition.binding, "info", () => images.info(image, options))),
|
|
2955
2962
|
input,
|
|
2963
|
+
text,
|
|
2956
2964
|
process,
|
|
2957
2965
|
hosted: isHostedImagesBinding(images.hosted) ? Option.some(wrapHosted(definition.binding, images.hosted)) : Option.none(),
|
|
2958
2966
|
rawUnsafe: Effect.succeed(images)
|
|
@@ -3376,8 +3384,9 @@ const makeClient = (definition) => {
|
|
|
3376
3384
|
id: raw.id,
|
|
3377
3385
|
pause: operation("pause", () => raw.pause()),
|
|
3378
3386
|
resume: operation("resume", () => raw.resume()),
|
|
3379
|
-
terminate: operation("terminate", () => raw.terminate()),
|
|
3387
|
+
terminate: (options) => operation("terminate", () => raw.terminate(options)),
|
|
3380
3388
|
restart: (options) => operation("restart", () => raw.restart(options)),
|
|
3389
|
+
delete: operation("delete", () => raw.delete()),
|
|
3381
3390
|
status: operation("status", () => raw.status()).pipe(Effect.flatMap((status) => Effect.gen(function* () {
|
|
3382
3391
|
const output = status.output === void 0 || status.output === null && status.status !== "complete" ? Option.none() : Option.some(yield* decodeResult(status.output).pipe(Effect.mapError((cause) => new WorkflowResultDecodeError({
|
|
3383
3392
|
binding: definition.binding,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "effect-cf",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"description": "Effect-native primitives for Cloudflare Workers and bindings.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -42,6 +42,11 @@
|
|
|
42
42
|
"import": "./dist/ComputerWorkspaceHost.mjs",
|
|
43
43
|
"default": "./dist/ComputerWorkspaceHost.mjs"
|
|
44
44
|
},
|
|
45
|
+
"./sandbox": {
|
|
46
|
+
"types": "./dist/Sandbox.d.mts",
|
|
47
|
+
"import": "./dist/Sandbox.mjs",
|
|
48
|
+
"default": "./dist/Sandbox.mjs"
|
|
49
|
+
},
|
|
45
50
|
"./vitest": {
|
|
46
51
|
"types": "./dist/Vitest.d.mts",
|
|
47
52
|
"import": "./dist/Vitest.mjs",
|
|
@@ -62,7 +67,8 @@
|
|
|
62
67
|
"devDependencies": {
|
|
63
68
|
"@cloudflare/computer": "0.2.0",
|
|
64
69
|
"@cloudflare/containers": "catalog:",
|
|
65
|
-
"@cloudflare/
|
|
70
|
+
"@cloudflare/sandbox": "0.13.0-next.738.2",
|
|
71
|
+
"@cloudflare/vitest-plugin": "catalog:",
|
|
66
72
|
"@cloudflare/workers-types": "catalog:",
|
|
67
73
|
"@effect/platform-node": "^4.0.0-rc.110",
|
|
68
74
|
"@effect/sql-d1": "catalog:",
|
|
@@ -77,8 +83,9 @@
|
|
|
77
83
|
},
|
|
78
84
|
"peerDependencies": {
|
|
79
85
|
"@cloudflare/computer": "^0.2.0",
|
|
80
|
-
"@cloudflare/
|
|
81
|
-
"@cloudflare/
|
|
86
|
+
"@cloudflare/sandbox": "^0.13.0-next.738.2",
|
|
87
|
+
"@cloudflare/vitest-plugin": "^1.0.0",
|
|
88
|
+
"@cloudflare/workers-types": "^5.20260820.1",
|
|
82
89
|
"@effect/sql-d1": "^4.0.0-rc.110",
|
|
83
90
|
"@effect/sql-pg": "^4.0.0-rc.110",
|
|
84
91
|
"@effect/sql-sqlite-do": "^4.0.0-rc.110",
|
|
@@ -88,7 +95,10 @@
|
|
|
88
95
|
"@cloudflare/computer": {
|
|
89
96
|
"optional": true
|
|
90
97
|
},
|
|
91
|
-
"@cloudflare/
|
|
98
|
+
"@cloudflare/sandbox": {
|
|
99
|
+
"optional": true
|
|
100
|
+
},
|
|
101
|
+
"@cloudflare/vitest-plugin": {
|
|
92
102
|
"optional": true
|
|
93
103
|
},
|
|
94
104
|
"@cloudflare/workers-types": {
|