effect-cf 0.13.1 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # effect-cf
2
2
 
3
+ ## 0.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#47](https://github.com/danieljvdm/effect-cf/pull/47) [`debc5e1`](https://github.com/danieljvdm/effect-cf/commit/debc5e12cee68c85c5ea99096e2660aa0ec90b6f) Thanks [@owensbla](https://github.com/owensbla)! - Add an Effect-native Cloudflare Send Email binding wrapper. `Email.Tag(...)` now provides a typed client for `send_email` bindings with `send(...)`, `unsafeRaw`, binding validation, and `EmailOperationError` failure mapping.
8
+
9
+ ## 0.14.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#43](https://github.com/danieljvdm/effect-cf/pull/43) [`ad00f22`](https://github.com/danieljvdm/effect-cf/commit/ad00f2211cf6b09e5b6d7ad7393d714bf61a35cd) Thanks [@danieljvdm](https://github.com/danieljvdm)! - Simplify `CloudflareOtlp` around Effect's standard OTEL configuration layers from `effect@4.0.0-beta.77`.
14
+
15
+ `CloudflareOtlpSettings`, `settingsConfig`, and `settingsLayer` have been removed. Configure OTLP with standard OTEL environment variables instead, including `OTEL_TRACES_EXPORTER=otlp`, `OTEL_METRICS_EXPORTER=otlp`, or `OTEL_LOGS_EXPORTER=otlp` for the signals you want to export. Resource options now live under `resource`, so `CloudflareOtlp.workerLayer({ serviceName })` becomes `CloudflareOtlp.workerLayer({ resource: { serviceName } })`. Export intervals, batch sizes, shutdown timeouts, and metrics temporality now use Effect's OTEL env support instead of effect-cf-specific layer options.
16
+
17
+ Durable Object runtimes now install the Cloudflare `env` as the default Effect `ConfigProvider`, matching Worker runtime behavior.
18
+
19
+ - [#45](https://github.com/danieljvdm/effect-cf/pull/45) [`88aa8ac`](https://github.com/danieljvdm/effect-cf/commit/88aa8aca1d2d44a4da142273e53cccec84772056) Thanks [@danieljvdm](https://github.com/danieljvdm)! - Add Effect-native Cloudflare bindings for Workers AI, Vectorize, AI Gateway, and Browser Rendering.
20
+
3
21
  ## 0.13.1
4
22
 
5
23
  ### Patch Changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # effect-cf
2
2
 
3
- Effect-native Cloudflare primitives for Workers, Durable Objects, bindings, KV, D1, Queues, Workflows, and Durable Object storage.
3
+ Effect-native Cloudflare primitives for Workers, Durable Objects, bindings, KV, D1, Queues, Email, Workflows, and Durable Object storage.
4
4
 
5
5
  ## Install
6
6
 
@@ -35,6 +35,7 @@ Runtime creation belongs at Cloudflare entrypoints, not inside binding helpers.
35
35
  - `R2` - typed R2 bucket binding helper with Effect-wrapped object and multipart operations
36
36
  - `Hyperdrive` - typed Hyperdrive binding helper for connection strings and optional Postgres SQL integration
37
37
  - `Images` - typed Cloudflare Images binding helper with transformation APIs and optional hosted image operations
38
+ - `Email` - typed Cloudflare Send Email binding helper for `send_email` bindings
38
39
  - `Queue` - typed Queue producer/consumer tags plus client and error types
39
40
  - `Workflow` - typed Workflow entrypoints, steps, starter clients, and instance types
40
41
  - `Rpc` - Cloudflare RPC type helpers and scoped disposal utilities
@@ -206,6 +207,32 @@ export const resizeAvatar = (image: Images.ImageInputValue) =>
206
207
  });
207
208
  ```
208
209
 
210
+ ## Email Example
211
+
212
+ Email tags expose Cloudflare Send Email bindings as Effect-wrapped `send(...)` operations.
213
+
214
+ ```ts
215
+ import { Effect } from "effect";
216
+ import { Email } from "effect-cf";
217
+
218
+ class TransactionalEmail extends Email.Tag<TransactionalEmail>()("TransactionalEmail") {}
219
+
220
+ export const TransactionalEmailLayer = TransactionalEmail.layer({ binding: "EMAIL" });
221
+
222
+ export const sendWelcomeEmail = (to: string) =>
223
+ Effect.gen(function* () {
224
+ const email = yield* TransactionalEmail;
225
+
226
+ return yield* email.send({
227
+ from: { name: "Example", email: "team@example.com" },
228
+ to,
229
+ subject: "Welcome to Example",
230
+ text: "Welcome to Example",
231
+ html: "<p>Welcome to Example</p>",
232
+ });
233
+ });
234
+ ```
235
+
209
236
  ## Workflow Example
210
237
 
211
238
  Workflow definitions type the payload and result. Runtime handlers can access `Workflow.WorkflowEvent`, use durable `Workflow.step(...)`, and use normal binding services inside steps.
@@ -16,7 +16,7 @@ type ScalarConfigValue = string | number | boolean;
16
16
  type ScalarConfigKey = Extract<{ readonly [Key in keyof Cloudflare.Env]-?: NonNullable<Cloudflare.Env[Key]> extends ScalarConfigValue ? Key : never }[keyof Cloudflare.Env], string>;
17
17
  /**
18
18
  * Effect `Config` helpers for scalar Cloudflare vars and secrets declared on
19
- * `Cloudflare.Env` / generated `worker-configuration.d.ts`.
19
+ * `Cloudflare.Env`.
20
20
  *
21
21
  * Users still author their app config explicitly with Effect `Config`:
22
22
  *
@@ -1,4 +1,4 @@
1
- import { i as BindingNotFoundError, n as LayerOptions, o as BindingValidationError, r as TagClass, u as WorkerEnvironment } from "./Hyperdrive-L6ldMlRF.mjs";
1
+ import { i as BindingNotFoundError, n as LayerOptions, o as BindingValidationError, r as TagClass, u as WorkerEnvironment } from "./Hyperdrive-C0vfrPeG.mjs";
2
2
  import { Layer } from "effect";
3
3
  import { PgClient } from "@effect/sql-pg";
4
4
  import * as _$effect_unstable_sql_SqlClient0 from "effect/unstable/sql/SqlClient";