effect-cf 0.41.1 → 0.42.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +28 -0
  3. package/dist/AiGateway.d.mts +2 -2
  4. package/dist/AnalyticsEngine.d.mts +2 -2
  5. package/dist/Artifacts.d.mts +2 -2
  6. package/dist/BrowserRendering.d.mts +2 -2
  7. package/dist/ContainerNamespace.d.mts +2 -2
  8. package/dist/D1.d.mts +9 -12
  9. package/dist/DurableObject.d.mts +9 -5
  10. package/dist/DurableObject.mjs +9 -4
  11. package/dist/DurableObjectDefinition.d.mts +15 -12
  12. package/dist/DurableObjectDefinition.mjs +5 -3
  13. package/dist/DurableObjectNamespace.d.mts +10 -8
  14. package/dist/DurableObjectSqlite.mjs +1 -1
  15. package/dist/Email.d.mts +2 -2
  16. package/dist/Hyperdrive.d.mts +2 -2
  17. package/dist/Images.d.mts +2 -2
  18. package/dist/Kv.d.mts +2 -2
  19. package/dist/Queue.d.mts +5 -4
  20. package/dist/QueueDefinition.d.mts +4 -4
  21. package/dist/R2.d.mts +2 -2
  22. package/dist/RpcDefinition.d.mts +26 -12
  23. package/dist/RpcDefinition.mjs +22 -5
  24. package/dist/Sandbox.d.mts +1 -1
  25. package/dist/ServiceBinding.d.mts +17 -18
  26. package/dist/Vectorize.d.mts +2 -2
  27. package/dist/Worker.d.mts +5 -3
  28. package/dist/Worker.mjs +4 -3
  29. package/dist/WorkerDefinition.d.mts +15 -11
  30. package/dist/WorkerDefinition.mjs +5 -3
  31. package/dist/WorkersAi.d.mts +2 -2
  32. package/dist/Workflow.d.mts +5 -4
  33. package/dist/WorkflowDefinition.d.mts +4 -4
  34. package/dist/index.d.mts +2 -2
  35. package/dist/internal/NativeCallback.mjs +5 -2
  36. package/package.json +1 -1
  37. package/src/AiGateway.ts +2 -0
  38. package/src/AnalyticsEngine.ts +2 -0
  39. package/src/Artifacts.ts +2 -0
  40. package/src/BrowserRendering.ts +2 -0
  41. package/src/ContainerNamespace.ts +2 -0
  42. package/src/D1.ts +16 -8
  43. package/src/DurableObject.ts +30 -4
  44. package/src/DurableObjectDefinition.ts +33 -17
  45. package/src/DurableObjectNamespace.ts +19 -35
  46. package/src/Email.ts +2 -0
  47. package/src/Hyperdrive.ts +2 -0
  48. package/src/Images.ts +2 -0
  49. package/src/Kv.ts +2 -0
  50. package/src/Queue.ts +4 -7
  51. package/src/QueueDefinition.ts +7 -4
  52. package/src/R2.ts +2 -0
  53. package/src/RpcDefinition.ts +64 -25
  54. package/src/Sandbox.ts +2 -0
  55. package/src/ServiceBinding.ts +39 -34
  56. package/src/Vectorize.ts +2 -0
  57. package/src/Worker.ts +12 -1
  58. package/src/WorkerDefinition.ts +28 -17
  59. package/src/WorkersAi.ts +2 -0
  60. package/src/Workflow.ts +9 -8
  61. package/src/WorkflowDefinition.ts +12 -4
  62. package/src/internal/NativeCallback.ts +13 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # effect-cf
2
2
 
3
+ ## 0.42.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#171](https://github.com/danieljvdm/effect-cf/pull/171) [`06a0bfc`](https://github.com/danieljvdm/effect-cf/commit/06a0bfc1f750f5042e13f97b212c63ced5caa5e5) Thanks [@danieljvdm](https://github.com/danieljvdm)! - Prevent the first Durable Object event from overtaking an initialization hook's concurrency gate while its service layer is still building. Hooks that perform background setup without a concurrency gate continue to allow incoming events.
8
+
9
+ - [#170](https://github.com/danieljvdm/effect-cf/pull/170) [`4c41e8d`](https://github.com/danieljvdm/effect-cf/commit/4c41e8d648f340dbf43c5e2c17a850d967b7fa09) Thanks [@danieljvdm](https://github.com/danieljvdm)! - Prevent Durable Object storage transactions and concurrency-blocking callbacks from stalling when their Effect work yields while an earlier timer is blocked by the native input gate.
10
+
11
+ ## 0.42.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#163](https://github.com/danieljvdm/effect-cf/pull/163) [`8817ade`](https://github.com/danieljvdm/effect-cf/commit/8817adeead3fcaaf3b199ad02de7f5f347af88a5) Thanks [@limwa](https://github.com/limwa)! - Add `Worker.native(schema)` and `DurableObject.native(schema)` for RPC arguments and results that Cloudflare must transport without JSON encoding, including byte streams, requests, and responses.
16
+
17
+ ### Patch Changes
18
+
19
+ - [#169](https://github.com/danieljvdm/effect-cf/pull/169) [`7560c67`](https://github.com/danieljvdm/effect-cf/commit/7560c67e392c9906dd8019a0c951e6c08b4ac306) Thanks [@danieljvdm](https://github.com/danieljvdm)! - Fix TS2883 in consumers that export binding layers, D1 and service-binding classes, or Queue, Workflow, Worker, and Durable Object operations with `declaration` or `composite` enabled. These exports now emit portable types without consumers importing additional namespaces or annotating otherwise inferred values.
20
+
21
+ `isolatedDeclarations` continues to require explicit type annotations and a named class base instead of a factory call in `extends`.
22
+
23
+ - [#166](https://github.com/danieljvdm/effect-cf/pull/166) [`183c198`](https://github.com/danieljvdm/effect-cf/commit/183c19896cb1a27675dce9a462893fcc96b6e3d6) Thanks [@limwa](https://github.com/limwa)! - Fix TS2883 when extending `Queue.Tag(...)` in projects that emit declarations with `declaration` or `composite`. The inferred base type can now be named through the `Queue` namespace. With `isolatedDeclarations`, TypeScript still requires an explicitly typed base variable instead of a factory call in the `extends` clause.
24
+
25
+ - [#165](https://github.com/danieljvdm/effect-cf/pull/165) [`1681cbb`](https://github.com/danieljvdm/effect-cf/commit/1681cbb767954a90aa0222fd44485abfb490b98a) Thanks [@limwa](https://github.com/limwa)! - Fix TS2883 when extending `Workflow.Tag(...)` in projects that emit declarations with `declaration` or `composite`. The inferred base type can now be named through the `Workflow` namespace. With `isolatedDeclarations`, TypeScript still requires an explicitly typed base variable instead of a factory call in the `extends` clause.
26
+
3
27
  ## 0.41.1
4
28
 
5
29
  ### Patch Changes
package/README.md CHANGED
@@ -23,6 +23,34 @@ export default Worker.make(Layer.empty, {
23
23
 
24
24
  `Worker.make` owns the Effect runtime. Pass application services as its layer; use `Worker.NativeRequest` inside the handler to read the request.
25
25
 
26
+ ### Native RPC values
27
+
28
+ Tagged Worker and Durable Object methods encode declared schemas through their canonical JSON codec by default. Wrap a method argument or success schema with `Worker.native(schema)` or `DurableObject.native(schema)` when its encoded value must instead pass directly through Cloudflare RPC.
29
+
30
+ ```ts
31
+ import { Effect, Layer, Schema } from "effect";
32
+ import { Worker } from "effect-cf";
33
+
34
+ const ByteStream = Schema.declare(
35
+ (value): value is ReadableStream<Uint8Array> => value instanceof ReadableStream,
36
+ );
37
+
38
+ class Documents extends Worker.Tag<Documents>()("Documents", {
39
+ upload: Worker.method({
40
+ args: [Worker.native(ByteStream)],
41
+ success: Schema.Void,
42
+ }),
43
+ }) {}
44
+
45
+ export default Documents.make(Layer.empty, {
46
+ rpc: {
47
+ upload: (body) => Effect.tryPromise(() => new Response(body).arrayBuffer()).pipe(Effect.asVoid),
48
+ },
49
+ });
50
+ ```
51
+
52
+ The wrapped schema still validates and transforms values, but its encoded form must be supported by Cloudflare RPC. Native byte streams must be byte-oriented (`type: "bytes"`). Cloudflare transfers stream ownership to the recipient; use `ReadableStream.tee()` first if the sender must retain a copy.
53
+
26
54
  ## Bindings
27
55
 
28
56
  Define a service, connect it to a Wrangler binding, then yield it in your program.
@@ -5,7 +5,7 @@ import * as Context$1 from "effect/Context";
5
5
  import * as Effect from "effect/Effect";
6
6
  import { Layer } from "effect";
7
7
  declare namespace AiGateway_d_exports {
8
- export { AiGatewayBinding, AiGatewayClient, AiGatewayDefinition, AiGatewayFetchOptions, AiGatewayHeaders, AiGatewayLog, AiGatewayOperationError, AiGatewayPatchLog, AiGatewayProvider, AiGatewayRunOptions, AiGatewayService, AiGatewayUniversalRequest, LayerOptions, Tag, TagClass, isAiGatewayBinding, layer, make, makeClient, makeClientFromAi, makeHttpClient };
8
+ export { AiGatewayBinding, AiGatewayClient, AiGatewayDefinition, AiGatewayFetchOptions, AiGatewayHeaders, AiGatewayLog, AiGatewayOperationError, AiGatewayPatchLog, AiGatewayProvider, AiGatewayRunOptions, AiGatewayService, AiGatewayUniversalRequest, BindingNotFoundError, BindingValidationError, LayerOptions, Tag, TagClass, isAiGatewayBinding, layer, make, makeClient, makeClientFromAi, makeHttpClient };
9
9
  }
10
10
  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 & {
11
11
  readonly _tag: "AiGatewayOperationError";
@@ -83,4 +83,4 @@ declare const layer: <Self>(tag: Context$1.Service<Self, AiGatewayClient>, defin
83
83
  declare const make: <Id extends string>(id: Id) => TagClass<AiGatewayService<Id>, Id>;
84
84
  declare const Tag: <Self>() => <Id extends string>(id: Id) => TagClass<Self, Id>;
85
85
  //#endregion
86
- export { AiGatewayBinding, AiGatewayClient, AiGatewayDefinition, AiGatewayFetchOptions, AiGatewayHeaders, AiGatewayLog, AiGatewayOperationError, AiGatewayPatchLog, AiGatewayProvider, AiGatewayRunOptions, AiGatewayService, AiGatewayUniversalRequest, AiGateway_d_exports, LayerOptions, Tag, TagClass, isAiGatewayBinding, layer, make, makeClient, makeClientFromAi, makeHttpClient };
86
+ export { AiGatewayBinding, AiGatewayClient, AiGatewayDefinition, AiGatewayFetchOptions, AiGatewayHeaders, AiGatewayLog, AiGatewayOperationError, AiGatewayPatchLog, AiGatewayProvider, AiGatewayRunOptions, AiGatewayService, AiGatewayUniversalRequest, AiGateway_d_exports, type BindingNotFoundError, type BindingValidationError, LayerOptions, Tag, TagClass, isAiGatewayBinding, layer, make, makeClient, makeClientFromAi, makeHttpClient };
@@ -10,7 +10,7 @@ import * as HttpClient from "effect/unstable/http/HttpClient";
10
10
  import { Redacted } from "effect";
11
11
  import { Headers, HttpClientResponse } from "effect/unstable/http";
12
12
  declare namespace AnalyticsEngine_d_exports {
13
- 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, QueryConfigOptions, QueryTag, QueryTagClass, Tag, TagClass, isAnalyticsEngineDataset, layer, layerFetch, layerFetchConfig, make, makeClient, makeQuery, makeQueryClient, queryConfig, queryLayer, queryLayerConfig, writeLimits };
13
+ export { AnalyticsEngineBinding, AnalyticsEngineClient, AnalyticsEngineDataPoint, AnalyticsEngineDataPointSchema, AnalyticsEngineDefinition, AnalyticsEngineFieldValue, AnalyticsEngineFieldValueSchema, AnalyticsEngineInvalidWritePolicy, AnalyticsEngineOperationError, AnalyticsEngineQueryClient, AnalyticsEngineQueryColumn, AnalyticsEngineQueryDefinition, AnalyticsEngineQueryError, AnalyticsEngineQueryOptions, AnalyticsEngineQueryResult, AnalyticsEngineQueryRow, AnalyticsEngineQueryService, AnalyticsEngineService, AnalyticsEngineWriteError, AnalyticsEngineWriteOptions, AnalyticsEngineWritePolicy, AnalyticsEngineWriteValidationError, AnalyticsEngineWriteViolation, BindingNotFoundError, BindingValidationError, LayerOptions, QueryConfigOptions, QueryTag, QueryTagClass, Tag, TagClass, isAnalyticsEngineDataset, layer, layerFetch, layerFetchConfig, make, makeClient, makeQuery, makeQueryClient, queryConfig, queryLayer, queryLayerConfig, writeLimits };
14
14
  }
15
15
  declare const writeLimits: {
16
16
  readonly maxBlobs: 20;
@@ -167,4 +167,4 @@ declare const makeQuery: <Id extends string>(id: Id) => QueryTagClass<AnalyticsE
167
167
  declare const Tag: <Self>() => <Id extends string>(id: Id) => TagClass<Self, Id>;
168
168
  declare const QueryTag: <Self>() => <Id extends string>(id: Id) => QueryTagClass<Self, Id>;
169
169
  //#endregion
170
- export { AnalyticsEngineBinding, AnalyticsEngineClient, AnalyticsEngineDataPoint, AnalyticsEngineDataPointSchema, AnalyticsEngineDefinition, AnalyticsEngineFieldValue, AnalyticsEngineFieldValueSchema, AnalyticsEngineInvalidWritePolicy, AnalyticsEngineOperationError, AnalyticsEngineQueryClient, AnalyticsEngineQueryColumn, AnalyticsEngineQueryDefinition, AnalyticsEngineQueryError, AnalyticsEngineQueryOptions, AnalyticsEngineQueryResult, AnalyticsEngineQueryRow, AnalyticsEngineQueryService, AnalyticsEngineService, AnalyticsEngineWriteError, AnalyticsEngineWriteOptions, AnalyticsEngineWritePolicy, AnalyticsEngineWriteValidationError, AnalyticsEngineWriteViolation, AnalyticsEngine_d_exports, LayerOptions, QueryConfigOptions, QueryTag, QueryTagClass, Tag, TagClass, isAnalyticsEngineDataset, layer, layerFetch, layerFetchConfig, make, makeClient, makeQuery, makeQueryClient, queryConfig, queryLayer, queryLayerConfig, writeLimits };
170
+ export { AnalyticsEngineBinding, AnalyticsEngineClient, AnalyticsEngineDataPoint, AnalyticsEngineDataPointSchema, AnalyticsEngineDefinition, AnalyticsEngineFieldValue, AnalyticsEngineFieldValueSchema, AnalyticsEngineInvalidWritePolicy, AnalyticsEngineOperationError, AnalyticsEngineQueryClient, AnalyticsEngineQueryColumn, AnalyticsEngineQueryDefinition, AnalyticsEngineQueryError, AnalyticsEngineQueryOptions, AnalyticsEngineQueryResult, AnalyticsEngineQueryRow, AnalyticsEngineQueryService, AnalyticsEngineService, AnalyticsEngineWriteError, AnalyticsEngineWriteOptions, AnalyticsEngineWritePolicy, AnalyticsEngineWriteValidationError, AnalyticsEngineWriteViolation, AnalyticsEngine_d_exports, type BindingNotFoundError, type BindingValidationError, LayerOptions, QueryConfigOptions, QueryTag, QueryTagClass, Tag, TagClass, isAnalyticsEngineDataset, layer, layerFetch, layerFetchConfig, make, makeClient, makeQuery, makeQueryClient, queryConfig, queryLayer, queryLayerConfig, writeLimits };
@@ -4,7 +4,7 @@ import * as Context$1 from "effect/Context";
4
4
  import * as Effect from "effect/Effect";
5
5
  import { Layer } from "effect";
6
6
  declare namespace Artifacts_d_exports {
7
- export { ArtifactsBinding, ArtifactsClient, ArtifactsCommit, ArtifactsCommitIdentity, ArtifactsCreateOptions, ArtifactsCreateRepoResult, ArtifactsCreateTokenResult, ArtifactsDefinition, ArtifactsErrorCode, ArtifactsForkOptions, ArtifactsImportParams, ArtifactsImportSource, ArtifactsImportTarget, ArtifactsImportTargetOptions, ArtifactsListOptions, ArtifactsLogOptions, ArtifactsLogResult, ArtifactsOperation, ArtifactsOperationError, ArtifactsRepoBinding, ArtifactsRepoClient, ArtifactsRepoInfo, ArtifactsRepoListEntry, ArtifactsRepoListResult, ArtifactsRepoStatus, ArtifactsService, ArtifactsTokenInfo, ArtifactsTokenListResult, ArtifactsTokenScope, ArtifactsTokenState, ArtifactsTree, Cursor, LayerOptions, RepoName, Tag, TagClass, artifactsErrorCodes, artifactsErrorNumericCodes, isArtifactsBinding, isArtifactsRepoBinding, layer, make, makeClient };
7
+ export { ArtifactsBinding, ArtifactsClient, ArtifactsCommit, ArtifactsCommitIdentity, ArtifactsCreateOptions, ArtifactsCreateRepoResult, ArtifactsCreateTokenResult, ArtifactsDefinition, ArtifactsErrorCode, ArtifactsForkOptions, ArtifactsImportParams, ArtifactsImportSource, ArtifactsImportTarget, ArtifactsImportTargetOptions, ArtifactsListOptions, ArtifactsLogOptions, ArtifactsLogResult, ArtifactsOperation, ArtifactsOperationError, ArtifactsRepoBinding, ArtifactsRepoClient, ArtifactsRepoInfo, ArtifactsRepoListEntry, ArtifactsRepoListResult, ArtifactsRepoStatus, ArtifactsService, ArtifactsTokenInfo, ArtifactsTokenListResult, ArtifactsTokenScope, ArtifactsTokenState, ArtifactsTree, BindingNotFoundError, BindingValidationError, Cursor, LayerOptions, RepoName, Tag, TagClass, artifactsErrorCodes, artifactsErrorNumericCodes, isArtifactsBinding, isArtifactsRepoBinding, layer, make, makeClient };
8
8
  }
9
9
  type ArtifactsOperation = "createClient" | "create" | "get" | "import" | "list" | "delete" | "createToken" | "listTokens" | "getToken" | "revokeToken" | "fork" | "info" | "log" | "readCommit" | "readTree" | "cli";
10
10
  declare const artifactsErrorCodes: readonly ["ALREADY_EXISTS", "NOT_FOUND", "IMPORT_IN_PROGRESS", "FORK_IN_PROGRESS", "INVALID_INPUT", "INVALID_REPO_NAME", "INVALID_TTL", "INVALID_URL", "REMOTE_AUTH_REQUIRED", "UPSTREAM_UNAVAILABLE", "MEMORY_LIMIT", "INTERNAL_ERROR"];
@@ -201,4 +201,4 @@ declare const layer: <Self>(tag: Context$1.Service<Self, ArtifactsClient>, defin
201
201
  declare const make: <Id extends string>(id: Id) => TagClass<ArtifactsService<Id>, Id>;
202
202
  declare const Tag: <Self>() => <Id extends string>(id: Id) => TagClass<Self, Id>;
203
203
  //#endregion
204
- export { ArtifactsBinding, ArtifactsClient, ArtifactsCommit, ArtifactsCommitIdentity, ArtifactsCreateOptions, ArtifactsCreateRepoResult, ArtifactsCreateTokenResult, ArtifactsDefinition, ArtifactsErrorCode, ArtifactsForkOptions, ArtifactsImportParams, ArtifactsImportSource, ArtifactsImportTarget, ArtifactsImportTargetOptions, ArtifactsListOptions, ArtifactsLogOptions, ArtifactsLogResult, ArtifactsOperation, ArtifactsOperationError, ArtifactsRepoBinding, ArtifactsRepoClient, ArtifactsRepoInfo, ArtifactsRepoListEntry, ArtifactsRepoListResult, ArtifactsRepoStatus, ArtifactsService, ArtifactsTokenInfo, ArtifactsTokenListResult, ArtifactsTokenScope, ArtifactsTokenState, ArtifactsTree, Artifacts_d_exports, Cursor, LayerOptions, RepoName, Tag, TagClass, artifactsErrorCodes, artifactsErrorNumericCodes, isArtifactsBinding, isArtifactsRepoBinding, layer, make, makeClient };
204
+ export { ArtifactsBinding, ArtifactsClient, ArtifactsCommit, ArtifactsCommitIdentity, ArtifactsCreateOptions, ArtifactsCreateRepoResult, ArtifactsCreateTokenResult, ArtifactsDefinition, ArtifactsErrorCode, ArtifactsForkOptions, ArtifactsImportParams, ArtifactsImportSource, ArtifactsImportTarget, ArtifactsImportTargetOptions, ArtifactsListOptions, ArtifactsLogOptions, ArtifactsLogResult, ArtifactsOperation, ArtifactsOperationError, ArtifactsRepoBinding, ArtifactsRepoClient, ArtifactsRepoInfo, ArtifactsRepoListEntry, ArtifactsRepoListResult, ArtifactsRepoStatus, ArtifactsService, ArtifactsTokenInfo, ArtifactsTokenListResult, ArtifactsTokenScope, ArtifactsTokenState, ArtifactsTree, Artifacts_d_exports, type BindingNotFoundError, type BindingValidationError, Cursor, LayerOptions, RepoName, Tag, TagClass, artifactsErrorCodes, artifactsErrorNumericCodes, isArtifactsBinding, isArtifactsRepoBinding, layer, make, makeClient };
@@ -4,7 +4,7 @@ import * as Context$1 from "effect/Context";
4
4
  import * as Effect from "effect/Effect";
5
5
  import { Layer } from "effect";
6
6
  declare namespace BrowserRendering_d_exports {
7
- export { BrowserRenderingBinding, BrowserRenderingBrowserClient, BrowserRenderingBrowserLike, BrowserRenderingClient, BrowserRenderingConnect, BrowserRenderingDefinition, BrowserRenderingExternalResult, BrowserRenderingLaunch, BrowserRenderingMethodOptions, BrowserRenderingOperationError, BrowserRenderingPageClient, BrowserRenderingPageFunction, BrowserRenderingPageLike, BrowserRenderingService, LayerOptions, Tag, TagClass, isBrowserRenderingBinding, layer, make, makeClient };
7
+ export { BindingNotFoundError, BindingValidationError, BrowserRenderingBinding, BrowserRenderingBrowserClient, BrowserRenderingBrowserLike, BrowserRenderingClient, BrowserRenderingConnect, BrowserRenderingDefinition, BrowserRenderingExternalResult, BrowserRenderingLaunch, BrowserRenderingMethodOptions, BrowserRenderingOperationError, BrowserRenderingPageClient, BrowserRenderingPageFunction, BrowserRenderingPageLike, BrowserRenderingService, LayerOptions, Tag, TagClass, isBrowserRenderingBinding, layer, make, makeClient };
8
8
  }
9
9
  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 & {
10
10
  readonly _tag: "BrowserRenderingOperationError";
@@ -82,4 +82,4 @@ declare const layer: <Self>(tag: Context$1.Service<Self, BrowserRenderingClient>
82
82
  declare const make: <Id extends string>(id: Id) => TagClass<BrowserRenderingService<Id>, Id>;
83
83
  declare const Tag: <Self>() => <Id extends string>(id: Id) => TagClass<Self, Id>;
84
84
  //#endregion
85
- export { BrowserRenderingBinding, BrowserRenderingBrowserClient, BrowserRenderingBrowserLike, BrowserRenderingClient, BrowserRenderingConnect, BrowserRenderingDefinition, BrowserRenderingExternalResult, BrowserRenderingLaunch, BrowserRenderingMethodOptions, BrowserRenderingOperationError, BrowserRenderingPageClient, BrowserRenderingPageFunction, BrowserRenderingPageLike, BrowserRenderingService, BrowserRendering_d_exports, LayerOptions, Tag, TagClass, isBrowserRenderingBinding, layer, make, makeClient };
85
+ export { type BindingNotFoundError, type BindingValidationError, BrowserRenderingBinding, BrowserRenderingBrowserClient, BrowserRenderingBrowserLike, BrowserRenderingClient, BrowserRenderingConnect, BrowserRenderingDefinition, BrowserRenderingExternalResult, BrowserRenderingLaunch, BrowserRenderingMethodOptions, BrowserRenderingOperationError, BrowserRenderingPageClient, BrowserRenderingPageFunction, BrowserRenderingPageLike, BrowserRenderingService, BrowserRendering_d_exports, LayerOptions, Tag, TagClass, isBrowserRenderingBinding, layer, make, makeClient };
@@ -5,7 +5,7 @@ import * as Effect from "effect/Effect";
5
5
  import * as S from "effect/Schema";
6
6
  import { Layer } from "effect";
7
7
  declare namespace ContainerNamespace_d_exports {
8
- export { ContainerInstanceClient, ContainerNamespace, ContainerNamespaceClient, ContainerNamespaceDefinition, ContainerNamespaceResource, ContainerNamespaceService, ContainerNamespaceStaticClient, ContainerOperationError, ContainerReadinessOptions, ContainerSignal, ContainerStartAndWaitForPortsOptions, ContainerStartOptions, ContainerState, ContainerStopSignal, ContainerStub, ContainerStubOf, ContainerWaitOptions, LayerOptions, Tag, TagClass, isContainerNamespaceResource, layer, make, makeClient };
8
+ export { BindingNotFoundError, BindingValidationError, ContainerInstanceClient, ContainerNamespace, ContainerNamespaceClient, ContainerNamespaceDefinition, ContainerNamespaceResource, ContainerNamespaceService, ContainerNamespaceStaticClient, ContainerOperationError, ContainerReadinessOptions, ContainerSignal, ContainerStartAndWaitForPortsOptions, ContainerStartOptions, ContainerState, ContainerStopSignal, ContainerStub, ContainerStubOf, ContainerWaitOptions, LayerOptions, Tag, TagClass, isContainerNamespaceResource, layer, make, makeClient };
9
9
  }
10
10
  type ContainerSignal = "SIGKILL" | "SIGINT" | "SIGTERM";
11
11
  type ContainerStopSignal = ContainerSignal | number;
@@ -143,4 +143,4 @@ interface ContainerNamespaceService<Id extends string> {
143
143
  declare const Tag: <Self, Namespace extends ContainerNamespaceResource = ContainerNamespaceResource>() => <Id extends string>(id: Id) => TagClass<Self, Id, Namespace>;
144
144
  declare const ContainerNamespace: typeof Tag;
145
145
  //#endregion
146
- export { ContainerInstanceClient, ContainerNamespace, ContainerNamespaceClient, ContainerNamespaceDefinition, ContainerNamespaceResource, ContainerNamespaceService, ContainerNamespaceStaticClient, ContainerNamespace_d_exports, ContainerOperationError, ContainerReadinessOptions, ContainerSignal, ContainerStartAndWaitForPortsOptions, ContainerStartOptions, ContainerState, ContainerStopSignal, ContainerStub, ContainerStubOf, ContainerWaitOptions, LayerOptions, Tag, TagClass, isContainerNamespaceResource, layer, make, makeClient };
146
+ export { type BindingNotFoundError, type BindingValidationError, ContainerInstanceClient, ContainerNamespace, ContainerNamespaceClient, ContainerNamespaceDefinition, ContainerNamespaceResource, ContainerNamespaceService, ContainerNamespaceStaticClient, ContainerNamespace_d_exports, ContainerOperationError, ContainerReadinessOptions, ContainerSignal, ContainerStartAndWaitForPortsOptions, ContainerStartOptions, ContainerState, ContainerStopSignal, ContainerStub, ContainerStubOf, ContainerWaitOptions, LayerOptions, Tag, TagClass, isContainerNamespaceResource, layer, make, makeClient };
package/dist/D1.d.mts CHANGED
@@ -5,7 +5,7 @@ import { D1Client } from "@effect/sql-d1";
5
5
  import { SqlClient } from "effect/unstable/sql";
6
6
  import { Config } from "effect";
7
7
  declare namespace D1_d_exports {
8
- export { D1Definition, D1Service, D1SqlLayerOptions, Service, TypeId, make };
8
+ export { BindingNotFoundError, BindingValidationError, D1Definition, D1Service, D1SqlLayerOptions, Service, ServiceClass, TypeId, make };
9
9
  }
10
10
  declare const TypeId: "~effect-cf/D1";
11
11
  type TypeId = typeof TypeId;
@@ -13,21 +13,18 @@ interface D1Definition {
13
13
  readonly binding: string;
14
14
  }
15
15
  type D1SqlLayerOptions = Omit<D1Client.D1ClientConfig, "db">;
16
+ type ServiceClass<Self, Id extends string> = BindingService<Self, Id, D1Database> & {
17
+ [TypeId]: typeof TypeId;
18
+ definition: D1Definition;
19
+ sqlLayer: (options?: D1SqlLayerOptions) => Layer$1.Layer<D1Client.D1Client | SqlClient.SqlClient, Config.ConfigError | BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
20
+ };
16
21
  declare const D1ServiceTypeId: unique symbol;
17
22
  interface D1Service<Id extends string> {
18
23
  readonly [D1ServiceTypeId]: {
19
24
  readonly id: Id;
20
25
  };
21
26
  }
22
- declare const make: <Id extends string>(id: Id, definition: D1Definition) => BindingService<D1Service<Id>, Id, D1Database> & {
23
- "~effect-cf/D1": "~effect-cf/D1";
24
- definition: D1Definition;
25
- sqlLayer: (options?: D1SqlLayerOptions) => Layer$1.Layer<D1Client.D1Client | SqlClient.SqlClient, Config.ConfigError | BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
26
- };
27
- declare const Service: <Self>() => <Id extends string>(id: Id, definition: D1Definition) => BindingService<Self, Id, D1Database> & {
28
- "~effect-cf/D1": "~effect-cf/D1";
29
- definition: D1Definition;
30
- sqlLayer: (options?: D1SqlLayerOptions) => Layer$1.Layer<D1Client.D1Client | SqlClient.SqlClient, Config.ConfigError | BindingNotFoundError | BindingValidationError, WorkerEnvironment>;
31
- };
27
+ declare const make: <Id extends string>(id: Id, definition: D1Definition) => ServiceClass<D1Service<Id>, Id>;
28
+ declare const Service: <Self>() => <Id extends string>(id: Id, definition: D1Definition) => ServiceClass<Self, Id>;
32
29
  //#endregion
33
- export { D1Definition, D1Service, D1SqlLayerOptions, D1_d_exports, Service, TypeId, make };
30
+ export { type BindingNotFoundError, type BindingValidationError, D1Definition, D1Service, D1SqlLayerOptions, D1_d_exports, Service, ServiceClass, TypeId, make };
@@ -1,16 +1,18 @@
1
1
  import { WorkerEnv, WorkerEnvironment } from "./Environment.mjs";
2
+ import { BindingNotFoundError, BindingValidationError } from "./Binding.mjs";
2
3
  import { DurableWebSocket } from "./DurableObjectWebSocket.mjs";
3
4
  import { ReceiverOptions, RpcInvocationInfo } from "./RpcTracing.mjs";
4
5
  import { NativeRequest } from "./Worker.mjs";
5
6
  import { DurableObjectState } from "./DurableObjectState.mjs";
6
7
  import { AlarmRegistration, AlarmService, DurableObjectAlarm } from "./DurableObjectAlarm.mjs";
7
- import { Api, Definition, HandlerEffect, Handlers, LayerOptions, Method, Methods, NoReservedMethods, Options, ReservedMethodName, ServerApi, ServiceFreeSchema, Tag, TagClass, implement, method } from "./DurableObjectDefinition.mjs";
8
+ import { Api, Definition, HandlerEffect, Handlers, LayerOptions, Method, Methods, NativeSchema, NoReservedMethods, Options, ReservedMethodName, RpcSchema, ServerApi, ServiceFreeSchema, Tag, TagClass, implement, method, native } from "./DurableObjectDefinition.mjs";
9
+ import { DurableObjectFetchError, DurableObjectNamespaceClient, DurableObjectRpcError, DurableObjectStubClient, StubCall, StubRpc, StubScopedCall } from "./DurableObjectNamespace.mjs";
8
10
  import * as Effect from "effect/Effect";
9
11
  import * as Layer$1 from "effect/Layer";
10
12
  import { DurableObject } from "cloudflare:workers";
11
13
  import { Scope } from "effect";
12
14
  declare namespace DurableObject_d_exports {
13
- export { Api, Definition, DurableObjectClass, DurableObjectHandler, DurableObjectOptions, DurableObjectRpc, DurableObjectRpcApi, DurableObjectRpcApi as DurableObjectRpcShape, HandlerEffect, Handlers, LayerOptions, Method, Methods, NoReservedMethods, Options, ReservedMethodName, RpcHandlers, RunOptions, RunSymbol, RuntimeContext, ServerApi, ServiceFreeSchema, Tag, TagClass, implement, make, method };
15
+ export { Api, BindingNotFoundError, BindingValidationError, Definition, DurableObjectClass, DurableObjectFetchError, DurableObjectHandler, DurableObjectNamespaceClient, DurableObjectOptions, DurableObjectRpc, DurableObjectRpcApi, DurableObjectRpcError, DurableObjectRpcApi as DurableObjectRpcShape, DurableObjectStubClient, HandlerEffect, Handlers, LayerOptions, Method, Methods, NativeSchema, NoReservedMethods, Options, ReservedMethodName, RpcHandlers, RpcSchema, RunOptions, RunSymbol, RuntimeContext, ServerApi, ServiceFreeSchema, StubCall, StubRpc, StubScopedCall, Tag, TagClass, implement, make, method, native };
14
16
  }
15
17
  type RuntimeContext<ROut> = DurableObjectState | DurableObjectAlarm | WorkerEnvironment | ROut;
16
18
  type HandlerContext<ROut> = RuntimeContext<ROut> | Scope.Scope;
@@ -45,8 +47,10 @@ interface DurableObjectOptionsBase<RRuntime, REvent = never, EventLayerError = n
45
47
  /**
46
48
  * Effect run when Cloudflare loads this Durable Object instance into memory.
47
49
  *
48
- * Use `DurableObjectState.blockConcurrencyWhile` inside this hook when
49
- * incoming events should wait for setup to finish. Cloudflare may construct
50
+ * The base layer is acquired before incoming events are admitted. The hook
51
+ * itself runs in the background; start it with
52
+ * `DurableObjectState.blockConcurrencyWhile` when incoming events should
53
+ * wait for setup to finish. Cloudflare may construct
50
54
  * the same Durable Object id again after eviction or restart; use Durable
51
55
  * Object storage if work must happen only once per id.
52
56
  */
@@ -100,4 +104,4 @@ type DurableObjectClass<Rpc extends DurableObjectRpc<ROut>, ROut> = new (state:
100
104
  declare function make<ROut, LayerError>(layer: Layer$1.Layer<ROut, LayerError, RuntimeContext<never>> & CheckAlarmRegistration<ROut, never>): DurableObjectClass<Record<never, never>, ROut>;
101
105
  declare function make<ROut, LayerError, REvent = never, EventLayerError = never, const Rpc extends DurableObjectRpc<NoInfer<ROut> | REvent | NoInfer<RAlarm>> = Record<never, never>, RAlarm = never>(layer: Layer$1.Layer<ROut, LayerError, RuntimeContext<NoInfer<RAlarm>>>, options: DurableObjectOptions<ROut, REvent, EventLayerError, Rpc, RAlarm>): DurableObjectClass<Rpc, ROut | REvent | RAlarm>;
102
106
  //#endregion
103
- export { type Api, type Definition, DurableObjectClass, DurableObjectHandler, DurableObjectOptions, DurableObjectRpc, DurableObjectRpcApi, type DurableObjectRpcApi as DurableObjectRpcShape, DurableObject_d_exports, type HandlerEffect, type Handlers, type LayerOptions, type Method, type Methods, type NoReservedMethods, type Options, type ReservedMethodName, RpcHandlers, RunOptions, RunSymbol, RuntimeContext, type ServerApi, type ServiceFreeSchema, Tag, type TagClass, implement, make, method };
107
+ export { type Api, type BindingNotFoundError, type BindingValidationError, type Definition, DurableObjectClass, type DurableObjectFetchError, DurableObjectHandler, type DurableObjectNamespaceClient, DurableObjectOptions, DurableObjectRpc, DurableObjectRpcApi, type DurableObjectRpcApi as DurableObjectRpcShape, type DurableObjectRpcError, type DurableObjectStubClient, DurableObject_d_exports, type HandlerEffect, type Handlers, type LayerOptions, type Method, type Methods, type NativeSchema, type NoReservedMethods, type Options, type ReservedMethodName, RpcHandlers, type RpcSchema, RunOptions, RunSymbol, RuntimeContext, type ServerApi, type ServiceFreeSchema, type StubCall, type StubRpc, type StubScopedCall, Tag, type TagClass, implement, make, method, native };
@@ -7,9 +7,10 @@ import { makeEntrypointRuntime, runEventPromise } from "./internal/Runtime.mjs";
7
7
  import { scheduleTelemetryFlush as scheduleTelemetryFlush$1 } from "./internal/Telemetry.mjs";
8
8
  import { NativeRequest } from "./Worker.mjs";
9
9
  import { DurableObjectAlarm } from "./DurableObjectAlarm.mjs";
10
- import { Tag, implement, method } from "./DurableObjectDefinition.mjs";
10
+ import { Tag, implement, method, native } from "./DurableObjectDefinition.mjs";
11
11
  import * as Effect from "effect/Effect";
12
12
  import * as Layer from "effect/Layer";
13
+ import * as Scheduler from "effect/Scheduler";
13
14
  import { DurableObject } from "cloudflare:workers";
14
15
  import * as Tracer from "effect/Tracer";
15
16
  //#region src/DurableObject.ts
@@ -18,7 +19,8 @@ var DurableObject_exports = /* @__PURE__ */ __exportAll({
18
19
  Tag: () => Tag,
19
20
  implement: () => implement,
20
21
  make: () => make,
21
- method: () => method
22
+ method: () => method,
23
+ native: () => native
22
24
  });
23
25
  const reservedMethodNames = reservedMethodNames$1;
24
26
  /** Override to instrument the whole event, then call super[RunSymbol]. */
@@ -35,7 +37,10 @@ function make(layer, options = {}) {
35
37
  const services = (registration?.layer ?? Layer.empty).pipe(Layer.provideMerge(baseServices));
36
38
  this.runtime = makeEntrypointRuntime(layer, env, services);
37
39
  const initialize = options.initialize;
38
- if (initialize !== void 0) state.waitUntil(this[RunSymbol](initialize, { eventLayer: false }));
40
+ if (initialize !== void 0) state.waitUntil(state.blockConcurrencyWhile(async () => {
41
+ await Effect.runPromise(this.runtime.contextEffect, { scheduler: new Scheduler.MixedScheduler("sync") });
42
+ state.waitUntil(this[RunSymbol](initialize, { eventLayer: false }));
43
+ }));
39
44
  }
40
45
  [RunSymbol](effect, runOptions = {}) {
41
46
  const eventLayer = runOptions.eventLayer === false ? void 0 : options.eventLayer;
@@ -74,4 +79,4 @@ function make(layer, options = {}) {
74
79
  return assumeEntrypointClass(EffectDurableObject);
75
80
  }
76
81
  //#endregion
77
- export { DurableObject_exports, RunSymbol, Tag, implement, make, method };
82
+ export { DurableObject_exports, RunSymbol, Tag, implement, make, method, native };
@@ -1,27 +1,29 @@
1
1
  import { WorkerEnvironment } from "./Environment.mjs";
2
2
  import { BindingNotFoundError, BindingValidationError } from "./Binding.mjs";
3
3
  import { Provider } from "./Rpc.mjs";
4
- import { ReservedMethodName as ReservedMethodName$1 } from "./RpcDefinition.mjs";
5
- import { DurableObjectNamespaceEffectClient, DurableObjectNamespaceStaticClient } from "./DurableObjectNamespace.mjs";
4
+ import { NativeSchema as NativeSchema$1, ReservedMethodName as ReservedMethodName$1, RpcSchema as RpcSchema$1, SchemaType, WireEncoded, native as native$1 } from "./RpcDefinition.mjs";
5
+ import { DurableObjectFetchError, DurableObjectNamespaceClient, DurableObjectNamespaceEffectClient, DurableObjectNamespaceStaticClient, DurableObjectRpcError, DurableObjectStubClient, StubCall, StubRpc, StubScopedCall } from "./DurableObjectNamespace.mjs";
6
6
  import { DurableObjectClass, DurableObjectHandler, DurableObjectOptions, RuntimeContext } from "./DurableObject.mjs";
7
7
  import * as Context$1 from "effect/Context";
8
8
  import { Layer, Schema } from "effect";
9
9
  declare namespace DurableObjectDefinition_d_exports {
10
- export { Api, Definition, DurableObject, HandlerEffect, Handlers, LayerOptions, Method, Methods, NoReservedMethods, Options, ReservedMethodName, ServerApi, ServiceFreeSchema, Tag, TagClass, implement, make, method };
10
+ export { Api, BindingNotFoundError, BindingValidationError, Definition, DurableObject, DurableObjectFetchError, DurableObjectNamespaceClient, DurableObjectRpcError, DurableObjectStubClient, HandlerEffect, Handlers, LayerOptions, Method, Methods, NativeSchema, NoReservedMethods, Options, ReservedMethodName, RpcSchema, ServerApi, ServiceFreeSchema, StubCall, StubRpc, StubScopedCall, Tag, TagClass, implement, make, method, native };
11
11
  }
12
12
  type ServiceFreeSchema = Schema.Codec<any, any, never, never>;
13
- interface Method<Args extends ReadonlyArray<ServiceFreeSchema> = ReadonlyArray<ServiceFreeSchema>, Success extends ServiceFreeSchema = ServiceFreeSchema> {
13
+ type NativeSchema<Schema extends ServiceFreeSchema = ServiceFreeSchema> = NativeSchema$1<Schema>;
14
+ type RpcSchema = RpcSchema$1;
15
+ interface Method<Args extends ReadonlyArray<RpcSchema> = ReadonlyArray<RpcSchema>, Success extends RpcSchema = RpcSchema> {
14
16
  readonly args: Args;
15
17
  readonly success: Success;
16
18
  }
17
19
  declare namespace Method {
18
- export type Any = Method<ReadonlyArray<ServiceFreeSchema>, ServiceFreeSchema>;
19
- type ArgsFromSchemas<Args extends ReadonlyArray<ServiceFreeSchema>> = Args extends readonly [] ? [] : Args extends readonly [infer Head extends ServiceFreeSchema, ...infer Tail extends ReadonlyArray<ServiceFreeSchema>] ? [Schema.Schema.Type<Head>, ...ArgsFromSchemas<Tail>] : Array<Schema.Schema.Type<Args[number]>>;
20
- type EncodedArgsFromSchemas<Args extends ReadonlyArray<ServiceFreeSchema>> = { [Index in keyof Args]: Schema.Json; };
20
+ export type Any = Method<ReadonlyArray<RpcSchema>, RpcSchema>;
21
+ type ArgsFromSchemas<Args extends ReadonlyArray<RpcSchema>> = Args extends readonly [] ? [] : Args extends readonly [infer Head extends RpcSchema, ...infer Tail extends ReadonlyArray<RpcSchema>] ? [SchemaType<Head>, ...ArgsFromSchemas<Tail>] : Array<SchemaType<Args[number]>>;
22
+ type EncodedArgsFromSchemas<Args extends ReadonlyArray<RpcSchema>> = { [Index in keyof Args]: WireEncoded<Args[Index]>; };
21
23
  export type Args<Self extends Any> = ArgsFromSchemas<Self["args"]>;
22
24
  export type EncodedArgs<Self extends Any> = EncodedArgsFromSchemas<Self["args"]>;
23
- export type Success<Self extends Any> = Schema.Schema.Type<Self["success"]>;
24
- export type EncodedSuccess<_Self extends Any> = Schema.Json;
25
+ export type Success<Self extends Any> = SchemaType<Self["success"]>;
26
+ export type EncodedSuccess<Self extends Any> = WireEncoded<Self["success"]>;
25
27
  export {};
26
28
  }
27
29
  type Methods = Record<string, Method.Any>;
@@ -65,13 +67,14 @@ type TagClass<Self, Id extends string, MethodDefinitions extends Methods> = Cont
65
67
  /**
66
68
  * Defines a single RPC method schema in a Durable Object definition.
67
69
  */
68
- declare function method<Success extends ServiceFreeSchema>(definition: {
70
+ declare function method<Success extends RpcSchema>(definition: {
69
71
  readonly success: Success;
70
72
  }): Method<readonly [], Success>;
71
- declare function method<const Args extends ReadonlyArray<ServiceFreeSchema>, Success extends ServiceFreeSchema>(definition: {
73
+ declare function method<const Args extends ReadonlyArray<RpcSchema>, Success extends RpcSchema>(definition: {
72
74
  readonly args: Args;
73
75
  readonly success: Success;
74
76
  }): Method<Args, Success>;
77
+ declare const native: typeof native$1;
75
78
  declare const make: <Id extends string, const MethodDefinitions extends Methods>(id: Id, methods: MethodDefinitions & NoReservedMethods<MethodDefinitions>) => TagClass<Definition<Id, MethodDefinitions>, Id, MethodDefinitions>;
76
79
  declare const Tag: <Self>() => <Id extends string, const MethodDefinitions extends Methods>(id: Id, methods: MethodDefinitions & NoReservedMethods<MethodDefinitions>) => TagClass<Self, Id, MethodDefinitions>;
77
80
  declare const DurableObject: typeof Tag;
@@ -84,4 +87,4 @@ declare const implement: <ROut, const Self extends Definition.Any>(_definition:
84
87
  */
85
88
  type HandlerEffect<ROut, Self extends Definition.Any, Key extends keyof Self["methods"]> = DurableObjectHandler<ROut, Method.Success<Self["methods"][Key]>>;
86
89
  //#endregion
87
- export { Api, Definition, DurableObject, DurableObjectDefinition_d_exports, HandlerEffect, Handlers, LayerOptions, Method, Methods, NoReservedMethods, Options, ReservedMethodName, ServerApi, ServiceFreeSchema, Tag, TagClass, implement, make, method };
90
+ export { Api, type BindingNotFoundError, type BindingValidationError, Definition, DurableObject, DurableObjectDefinition_d_exports, type DurableObjectFetchError, type DurableObjectNamespaceClient, type DurableObjectRpcError, type DurableObjectStubClient, HandlerEffect, Handlers, LayerOptions, Method, Methods, NativeSchema, NoReservedMethods, Options, ReservedMethodName, RpcSchema, ServerApi, ServiceFreeSchema, type StubCall, type StubRpc, type StubScopedCall, Tag, TagClass, implement, make, method, native };
@@ -1,5 +1,5 @@
1
1
  import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
2
- import { assertNoReservedMethods, decodeArgs, encodeSuccess, make as make$1, method as method$1 } from "./RpcDefinition.mjs";
2
+ import { assertNoReservedMethods, decodeArgs, encodeSuccess, make as make$1, method as method$1, native as native$1 } from "./RpcDefinition.mjs";
3
3
  import { recordDecodedArgs } from "./internal/RpcInvocation.mjs";
4
4
  import { layer, makeDirectMethods } from "./DurableObjectNamespace.mjs";
5
5
  import { make as make$2 } from "./DurableObject.mjs";
@@ -11,7 +11,8 @@ var DurableObjectDefinition_exports = /* @__PURE__ */ __exportAll({
11
11
  Tag: () => Tag,
12
12
  implement: () => implement,
13
13
  make: () => make,
14
- method: () => method
14
+ method: () => method,
15
+ native: () => native
15
16
  });
16
17
  const reservedMethodNames = /* @__PURE__ */ new Set([
17
18
  "constructor",
@@ -25,6 +26,7 @@ const reservedMethodNames = /* @__PURE__ */ new Set([
25
26
  function method(definition) {
26
27
  return method$1(definition);
27
28
  }
29
+ const native = native$1;
28
30
  const makeDefinition = (id, methods) => {
29
31
  assertNoReservedMethods("Durable Object", methods, reservedMethodNames);
30
32
  const definition = make$1(id, methods);
@@ -122,4 +124,4 @@ const wrapHandlers = (definition, handlers) => {
122
124
  */
123
125
  const implement = (_definition, handlers) => handlers;
124
126
  //#endregion
125
- export { DurableObject, DurableObjectDefinition_exports, Tag, implement, make, method };
127
+ export { DurableObject, DurableObjectDefinition_exports, Tag, implement, make, method, native };
@@ -8,7 +8,7 @@ import * as Effect from "effect/Effect";
8
8
  import * as Predicate from "effect/Predicate";
9
9
  import { Context, Layer, Scope } from "effect";
10
10
  declare namespace DurableObjectNamespace_d_exports {
11
- export { DurableObjectFetchError, DurableObjectNamespaceBindingDefinition, DurableObjectNamespaceClient, DurableObjectNamespaceDefinition, DurableObjectNamespaceEffectClient, DurableObjectNamespaceStaticClient, DurableObjectRpcError, DurableObjectStubClient, isDurableObjectNamespaceClient, layer, makeClient, makeDirectMethods };
11
+ export { DurableObjectFetchError, DurableObjectNamespaceBindingDefinition, DurableObjectNamespaceClient, DurableObjectNamespaceDefinition, DurableObjectNamespaceEffectClient, DurableObjectNamespaceStaticClient, DurableObjectRpcError, DurableObjectStubClient, StubCall, StubRpc, StubScopedCall, isDurableObjectNamespaceClient, layer, makeClient, makeDirectMethods };
12
12
  }
13
13
  interface DurableObjectFetcher {
14
14
  fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
@@ -76,6 +76,8 @@ type StubMethodArgs<Api, Method extends keyof Api> = AsyncMethodArgs<Api, Method
76
76
  type StubMethodSuccess<Api, Method extends keyof Api> = AsyncMethodSuccess<Api, Method>;
77
77
  type StubMethodCloudflareReturn<Api, Method extends keyof Api> = AsyncMethodCloudflareReturn<Api, Method>;
78
78
  type StubCall<R, Api extends object> = <Method extends StubMethodKey<Api>>(stub: DurableObjectStubClient<Api>, method: Method, ...args: StubMethodArgs<Api, Method>) => Effect.Effect<StubMethodSuccess<Api, Method>, DurableObjectRpcError, R>;
79
+ type StubRpc<R, Api extends object> = <Method extends StubMethodKey<Api>>(stub: DurableObjectStubClient<Api>, method: Method, ...args: StubMethodArgs<Api, Method>) => Effect.Effect<StubMethodCloudflareReturn<Api, Method>, DurableObjectRpcError, R>;
80
+ type StubScopedCall<R, Api extends object> = <Method extends StubMethodKey<Api>>(stub: DurableObjectStubClient<Api>, method: Method, ...args: StubMethodArgs<Api, Method>) => Effect.Effect<Awaited<StubMethodSuccess<Api, Method>>, DurableObjectRpcError, Scope.Scope | R>;
79
81
  type DefinitionNamespaceDirectMethods<R, Api extends object, Definition$3 extends Definition$1.Any> = { readonly [Method in Definition.MethodNames<Definition$3>]: (stub: DurableObjectStubClient<Api>, ...args: Method$1.Args<Definition$3["methods"][Method]>) => Effect.Effect<Method$1.Success<Definition$3["methods"][Method]>, DurableObjectRpcError, R>; };
80
82
  type DefinitionDurableObjectDirectClient<R, Definition$2 extends Definition$1.Any> = {
81
83
  readonly fetch: (input: RequestInfo | URL, init?: RequestInit) => Effect.Effect<globalThis.Response, DurableObjectFetchError, R>;
@@ -102,14 +104,14 @@ type DurableObjectNamespaceEffectClient<Api extends object, Definition extends D
102
104
  *
103
105
  * Most application code should use {@link call} instead.
104
106
  */
105
- readonly rpc: <Method extends StubMethodKey<Api>>(stub: DurableObjectStubClient<Api>, method: Method, ...args: StubMethodArgs<Api, Method>) => Effect.Effect<StubMethodCloudflareReturn<Api, Method>, DurableObjectRpcError>;
107
+ readonly rpc: StubRpc<never, Api>;
106
108
  /**
107
109
  * Invokes a Durable Object RPC method, resolves Cloudflare's RPC result, and
108
110
  * decodes the success value when the namespace was created from a definition.
109
111
  *
110
112
  * This is the normal choice when application code wants the final typed value.
111
113
  */
112
- readonly call: <Method extends StubMethodKey<Api>>(stub: DurableObjectStubClient<Api>, method: Method, ...args: StubMethodArgs<Api, Method>) => Effect.Effect<StubMethodSuccess<Api, Method>, DurableObjectRpcError>;
114
+ readonly call: StubCall<never, Api>;
113
115
  /**
114
116
  * Invokes a Durable Object RPC method in the current `Scope`, resolves
115
117
  * Cloudflare's RPC result, decodes definition-backed success values, and
@@ -119,7 +121,7 @@ type DurableObjectNamespaceEffectClient<Api extends object, Definition extends D
119
121
  * Use this for RPC methods that return Cloudflare RPC resources or other
120
122
  * disposable objects whose lifetime should be tied to an Effect scope.
121
123
  */
122
- readonly scopedCall: <Method extends StubMethodKey<Api>>(stub: DurableObjectStubClient<Api>, method: Method, ...args: StubMethodArgs<Api, Method>) => Effect.Effect<Awaited<StubMethodSuccess<Api, Method>>, DurableObjectRpcError, Scope.Scope>;
124
+ readonly scopedCall: StubScopedCall<never, Api>;
123
125
  /**
124
126
  * Exposes the underlying native Durable Object namespace binding.
125
127
  *
@@ -136,9 +138,9 @@ type DurableObjectNamespaceStaticClient<R, Api extends object, Definition extend
136
138
  readonly getByName: (name: string, options?: globalThis.DurableObjectNamespaceGetDurableObjectOptions) => Effect.Effect<DurableObjectStubClient<Api>, never, R>;
137
139
  readonly jurisdiction: (jurisdiction: globalThis.DurableObjectJurisdiction) => Effect.Effect<DurableObjectNamespaceClient<Api>, never, R>;
138
140
  readonly fetch: (stub: DurableObjectStubClient<Api>, input: RequestInfo | URL, init?: RequestInit) => Effect.Effect<globalThis.Response, DurableObjectFetchError, R>;
139
- readonly rpc: <Method extends StubMethodKey<Api>>(stub: DurableObjectStubClient<Api>, method: Method, ...args: StubMethodArgs<Api, Method>) => Effect.Effect<StubMethodCloudflareReturn<Api, Method>, DurableObjectRpcError, R>;
140
- readonly call: <Method extends StubMethodKey<Api>>(stub: DurableObjectStubClient<Api>, method: Method, ...args: StubMethodArgs<Api, Method>) => Effect.Effect<StubMethodSuccess<Api, Method>, DurableObjectRpcError, R>;
141
- readonly scopedCall: <Method extends StubMethodKey<Api>>(stub: DurableObjectStubClient<Api>, method: Method, ...args: StubMethodArgs<Api, Method>) => Effect.Effect<Awaited<StubMethodSuccess<Api, Method>>, DurableObjectRpcError, Scope.Scope | R>;
141
+ readonly rpc: StubRpc<R, Api>;
142
+ readonly call: StubCall<R, Api>;
143
+ readonly scopedCall: StubScopedCall<R, Api>;
142
144
  readonly rawUnsafe: () => Effect.Effect<DurableObjectNamespaceClient<Api>, never, R>;
143
145
  };
144
146
  declare const isDurableObjectNamespaceClient: <Api extends object>(value: NamespaceCandidate) => value is DurableObjectNamespaceClient<Api>;
@@ -151,4 +153,4 @@ declare const makeDirectMethods: <R, Api extends object, Definition extends Defi
151
153
  readonly getByName: (name: string, options?: globalThis.DurableObjectNamespaceGetDurableObjectOptions) => Effect.Effect<DurableObjectStubClient<Api>, never, R>;
152
154
  }) => DirectMethods<R, Api, Definition>;
153
155
  //#endregion
154
- export { DurableObjectFetchError, DurableObjectNamespaceBindingDefinition, DurableObjectNamespaceClient, DurableObjectNamespaceDefinition, DurableObjectNamespaceEffectClient, DurableObjectNamespaceStaticClient, DurableObjectNamespace_d_exports, DurableObjectRpcError, DurableObjectStubClient, isDurableObjectNamespaceClient, layer, makeClient, makeDirectMethods };
156
+ export { DurableObjectFetchError, DurableObjectNamespaceBindingDefinition, DurableObjectNamespaceClient, DurableObjectNamespaceDefinition, DurableObjectNamespaceEffectClient, DurableObjectNamespaceStaticClient, DurableObjectNamespace_d_exports, DurableObjectRpcError, DurableObjectStubClient, StubCall, StubRpc, StubScopedCall, isDurableObjectNamespaceClient, layer, makeClient, makeDirectMethods };
@@ -3,8 +3,8 @@ import { DurableObjectState } from "./DurableObjectState.mjs";
3
3
  import * as Context from "effect/Context";
4
4
  import * as Effect from "effect/Effect";
5
5
  import * as Layer from "effect/Layer";
6
- import { SqliteClient } from "@effect/sql-sqlite-do";
7
6
  import * as Scheduler from "effect/Scheduler";
7
+ import { SqliteClient } from "@effect/sql-sqlite-do";
8
8
  import * as Reactivity from "effect/unstable/reactivity/Reactivity";
9
9
  import { SqlClient } from "effect/unstable/sql";
10
10
  //#region src/DurableObjectSqlite.ts
package/dist/Email.d.mts CHANGED
@@ -4,7 +4,7 @@ import * as Context$1 from "effect/Context";
4
4
  import * as Effect from "effect/Effect";
5
5
  import { Layer } from "effect";
6
6
  declare namespace Email_d_exports {
7
- export { EmailAddress, EmailAttachment, EmailBinding, EmailClient, EmailDefinition, EmailErrorCode, EmailMessageBuilder, EmailOperationError, EmailRecipients, EmailSendError, EmailSendOptions, EmailSendResult, EmailService, EmailValidationError, EmailViolation, LayerOptions, Tag, TagClass, emailErrorCodes, isEmailBinding, layer, make, makeClient, sendLimits, validateMessage };
7
+ export { BindingNotFoundError, BindingValidationError, EmailAddress, EmailAttachment, EmailBinding, EmailClient, EmailDefinition, EmailErrorCode, EmailMessageBuilder, EmailOperationError, EmailRecipients, EmailSendError, EmailSendOptions, EmailSendResult, EmailService, EmailValidationError, EmailViolation, LayerOptions, Tag, TagClass, emailErrorCodes, isEmailBinding, layer, make, makeClient, sendLimits, validateMessage };
8
8
  }
9
9
  declare const sendLimits: {
10
10
  readonly maxRecipients: 50;
@@ -103,4 +103,4 @@ declare const layer: <Self>(tag: Context$1.Service<Self, EmailClient>, definitio
103
103
  declare const make: <Id extends string>(id: Id) => TagClass<EmailService<Id>, Id>;
104
104
  declare const Tag: <Self>() => <Id extends string>(id: Id) => TagClass<Self, Id>;
105
105
  //#endregion
106
- export { EmailAddress, EmailAttachment, EmailBinding, EmailClient, EmailDefinition, EmailErrorCode, EmailMessageBuilder, EmailOperationError, EmailRecipients, EmailSendError, EmailSendOptions, EmailSendResult, EmailService, EmailValidationError, EmailViolation, Email_d_exports, LayerOptions, Tag, TagClass, emailErrorCodes, isEmailBinding, layer, make, makeClient, sendLimits, validateMessage };
106
+ export { type BindingNotFoundError, type BindingValidationError, EmailAddress, EmailAttachment, EmailBinding, EmailClient, EmailDefinition, EmailErrorCode, EmailMessageBuilder, EmailOperationError, EmailRecipients, EmailSendError, EmailSendOptions, EmailSendResult, EmailService, EmailValidationError, EmailViolation, Email_d_exports, LayerOptions, Tag, TagClass, emailErrorCodes, isEmailBinding, layer, make, makeClient, sendLimits, validateMessage };
@@ -4,7 +4,7 @@ import * as Context$1 from "effect/Context";
4
4
  import * as Effect from "effect/Effect";
5
5
  import { Layer } from "effect";
6
6
  declare namespace Hyperdrive_d_exports {
7
- export { HyperdriveClient, HyperdriveDefinition, HyperdriveService, LayerOptions, Tag, TagClass, isHyperdrive, layer, make, makeClient };
7
+ export { BindingNotFoundError, BindingValidationError, HyperdriveClient, HyperdriveDefinition, HyperdriveService, LayerOptions, Tag, TagClass, isHyperdrive, layer, make, makeClient };
8
8
  }
9
9
  interface HyperdriveDefinition {
10
10
  readonly binding: string;
@@ -33,4 +33,4 @@ declare const layer: <Self>(tag: Context$1.Service<Self, HyperdriveClient>, defi
33
33
  declare const make: <Id extends string>(id: Id) => TagClass<HyperdriveService<Id>, Id>;
34
34
  declare const Tag: <Self>() => <Id extends string>(id: Id) => TagClass<Self, Id>;
35
35
  //#endregion
36
- export { HyperdriveClient, HyperdriveDefinition, HyperdriveService, Hyperdrive_d_exports, LayerOptions, Tag, TagClass, isHyperdrive, layer, make, makeClient };
36
+ export { type BindingNotFoundError, type BindingValidationError, HyperdriveClient, HyperdriveDefinition, HyperdriveService, Hyperdrive_d_exports, LayerOptions, Tag, TagClass, isHyperdrive, layer, make, makeClient };
package/dist/Images.d.mts CHANGED
@@ -6,7 +6,7 @@ import * as Effect from "effect/Effect";
6
6
  import * as Option from "effect/Option";
7
7
  import { Layer } from "effect";
8
8
  declare namespace Images_d_exports {
9
- 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, ProcessOptions, Step, Steps, Tag, TagClass, TextOptions, TypeId, draw, empty, isImagesBinding, layer, make, makeClient, transform };
9
+ export { BindingNotFoundError, BindingValidationError, 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, ProcessOptions, Step, Steps, Tag, TagClass, TextOptions, TypeId, draw, empty, isImagesBinding, layer, make, makeClient, transform };
10
10
  }
11
11
  declare const TypeId: "~effect-cf/Images/Steps";
12
12
  type TypeId = typeof TypeId;
@@ -188,4 +188,4 @@ declare const layer: <Self>(tag: Context$1.Service<Self, ImagesClient>, definiti
188
188
  declare const make: <Id extends string>(id: Id) => TagClass<ImagesService<Id>, Id>;
189
189
  declare const Tag: <Self>() => <Id extends string>(id: Id) => TagClass<Self, Id>;
190
190
  //#endregion
191
- 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, Images_d_exports, LayerOptions, ProcessOptions, Step, Steps, Tag, TagClass, TextOptions, TypeId, draw, empty, isImagesBinding, layer, make, makeClient, transform };
191
+ export { type BindingNotFoundError, type BindingValidationError, 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, Images_d_exports, LayerOptions, ProcessOptions, Step, Steps, Tag, TagClass, TextOptions, TypeId, draw, empty, isImagesBinding, layer, make, makeClient, transform };
package/dist/Kv.d.mts CHANGED
@@ -6,7 +6,7 @@ import * as S from "effect/Schema";
6
6
  import * as Option from "effect/Option";
7
7
  import { Layer } from "effect";
8
8
  declare namespace Kv_d_exports {
9
- export { Definition, KvClient, KvDefinition, KvListKey, KvListOptions, KvListResult, KvOperation, KvOperationError, KvPutOptions, KvWithMetadata, LayerOptions, Tag, TagClass, isKvNamespace, layer, makeClient };
9
+ export { BindingNotFoundError, BindingValidationError, Definition, KvClient, KvDefinition, KvListKey, KvListOptions, KvListResult, KvOperation, KvOperationError, KvPutOptions, KvWithMetadata, LayerOptions, Tag, TagClass, isKvNamespace, layer, makeClient };
10
10
  }
11
11
  type KvOperation = "put" | "get" | "getWithMetadata" | "list" | "delete";
12
12
  declare const KvOperationError_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 & {
@@ -81,4 +81,4 @@ declare const Tag: <Self>() => <Id extends string, Key, Value, EncodedValue>(id:
81
81
  readonly value: S.Codec<Value, EncodedValue>;
82
82
  }) => TagClass<Self, Id, Key, Value, EncodedValue>;
83
83
  //#endregion
84
- export { Definition, KvClient, KvDefinition, KvListKey, KvListOptions, KvListResult, KvOperation, KvOperationError, KvPutOptions, KvWithMetadata, Kv_d_exports, LayerOptions, Tag, TagClass, isKvNamespace, layer, makeClient };
84
+ export { type BindingNotFoundError, type BindingValidationError, Definition, KvClient, KvDefinition, KvListKey, KvListOptions, KvListResult, KvOperation, KvOperationError, KvPutOptions, KvWithMetadata, Kv_d_exports, LayerOptions, Tag, TagClass, isKvNamespace, layer, makeClient };
package/dist/Queue.d.mts CHANGED
@@ -1,10 +1,12 @@
1
1
  import { WorkerEnvironment } from "./Environment.mjs";
2
- import { Definition as Definition$1, Handler as Handler$1, LayerOptions as LayerOptions$1, Options as Options$1, Tag, TagClass as TagClass$1, implement } from "./QueueDefinition.mjs";
2
+ import { BindingNotFoundError, BindingValidationError } from "./Binding.mjs";
3
+ import { QueueOperationError, QueueProducer } from "./QueueBinding.mjs";
4
+ import { Definition as Definition$1, Handler as Handler$1, LayerOptions as LayerOptions$1, Options as Options$1, Tag, TagClass, implement } from "./QueueDefinition.mjs";
3
5
  import { ExecutionContext, WorkerContext } from "./Worker.mjs";
4
6
  import * as Effect from "effect/Effect";
5
7
  import { Scope } from "effect";
6
8
  declare namespace Queue_d_exports {
7
- export { Definition, Handler, LayerOptions, Options, QueueBatch, QueueHandler, QueueMessage, QueueMessageDecodeError, QueueOptions, Tag, TagClass, decodeBatch, fromMessage, fromMessageBatch, implement };
9
+ export { BindingNotFoundError, BindingValidationError, Definition, Handler, LayerOptions, Options, QueueBatch, QueueHandler, QueueMessage, QueueMessageDecodeError, QueueOperationError, QueueOptions, QueueProducer, Tag, TagClass, decodeBatch, fromMessage, fromMessageBatch, implement };
8
10
  }
9
11
  interface QueueMessage<Body> {
10
12
  readonly raw: globalThis.Message<unknown>;
@@ -57,8 +59,7 @@ declare namespace Definition {
57
59
  type Any = Definition$1.Any;
58
60
  }
59
61
  type LayerOptions = LayerOptions$1;
60
- type TagClass<Self, Id extends string, Message extends Definition$1.Any["message"]> = TagClass$1<Self, Id, Message>;
61
62
  type Handler<ROut, Self extends Definition$1.Any> = Handler$1<ROut, Self>;
62
63
  type Options<ROut, Self extends Definition$1.Any> = Options$1<ROut, Self>;
63
64
  //#endregion
64
- export { Definition, Handler, LayerOptions, Options, QueueBatch, QueueHandler, QueueMessage, QueueMessageDecodeError, QueueOptions, Queue_d_exports, Tag, TagClass, decodeBatch, fromMessage, fromMessageBatch, implement };
65
+ export { type BindingNotFoundError, type BindingValidationError, Definition, Handler, LayerOptions, Options, QueueBatch, QueueHandler, QueueMessage, QueueMessageDecodeError, type QueueOperationError, QueueOptions, type QueueProducer, Queue_d_exports, Tag, type TagClass, decodeBatch, fromMessage, fromMessageBatch, implement };
@@ -9,7 +9,7 @@ import * as Effect from "effect/Effect";
9
9
  import * as S from "effect/Schema";
10
10
  import { Layer, Scope } from "effect";
11
11
  declare namespace QueueDefinition_d_exports {
12
- export { Definition, Handler, LayerOptions, Options, Queue, Tag, TagClass, implement, make };
12
+ export { BindingNotFoundError, BindingValidationError, Definition, Handler, LayerOptions, Options, Queue, QueueOperationError, QueueProducer, Tag, TagClass, implement, make };
13
13
  }
14
14
  interface Definition<Id extends string = string, Message extends ServiceFreeSchema = ServiceFreeSchema> {
15
15
  readonly id: Id;
@@ -26,7 +26,7 @@ interface Options<ROut, Self extends Definition.Any> extends Omit<WorkerOptions<
26
26
  type LayerOptions = {
27
27
  readonly binding: string;
28
28
  };
29
- interface TagClass<Self, Id extends string, Message extends ServiceFreeSchema> extends Context$1.ServiceClass<Self, `effect-cf/Queue/${Id}`, QueueBindingClient<Message>> {
29
+ type TagClass<Self, Id extends string, Message extends ServiceFreeSchema> = Context$1.ServiceClass<Self, `effect-cf/Queue/${Id}`, QueueBindingClient<Message>> & {
30
30
  readonly id: Id;
31
31
  readonly message: Message;
32
32
  readonly make: <ROut, LayerError>(layer: Layer.Layer<ROut, LayerError, ExecutionContext | WorkerContext | WorkerEnvironment>, options: Options<ROut, Definition<Id, Message>>) => WorkerClass<Record<never, never>, ROut>;
@@ -35,7 +35,7 @@ interface TagClass<Self, Id extends string, Message extends ServiceFreeSchema> e
35
35
  readonly sendBatch: (messages: Iterable<MessageSendRequest<S.Schema.Type<Message>>>, options?: QueueSendBatchOptions) => Effect.Effect<void, QueueOperationError | S.SchemaError, Self>;
36
36
  readonly metrics: () => Effect.Effect<QueueMetrics, QueueOperationError, Self>;
37
37
  readonly rawUnsafe: Effect.Effect<QueueProducer<S.Codec.Encoded<Message>>, never, Self>;
38
- }
38
+ };
39
39
  declare const make: <Id extends string, Message extends ServiceFreeSchema>(id: Id, definition: {
40
40
  readonly message: Message;
41
41
  }) => TagClass<Definition<Id, Message>, Id, Message>;
@@ -45,4 +45,4 @@ declare const Tag: <Self>() => <Id extends string, Message extends ServiceFreeSc
45
45
  declare const Queue: typeof Tag;
46
46
  declare const implement: <ROut, const Self extends Definition.Any>(_definition: Self, handler: Handler<ROut, Self>) => Handler<ROut, Self>;
47
47
  //#endregion
48
- export { Definition, Handler, LayerOptions, Options, Queue, QueueDefinition_d_exports, Tag, TagClass, implement, make };
48
+ export { type BindingNotFoundError, type BindingValidationError, Definition, Handler, LayerOptions, Options, Queue, QueueDefinition_d_exports, type QueueOperationError, type QueueProducer, Tag, TagClass, implement, make };