alchemy 2.0.0-beta.47 → 2.0.0-beta.49

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 (263) hide show
  1. package/bin/exec.js +28 -5
  2. package/bin/exec.js.map +1 -1
  3. package/lib/AWS/Lambda/BucketEventSource.d.ts +1 -1
  4. package/lib/AWS/Lambda/BucketEventSource.d.ts.map +1 -1
  5. package/lib/AWS/Lambda/EventBridgeEventSource.d.ts +1 -1
  6. package/lib/AWS/Lambda/EventBridgeEventSource.d.ts.map +1 -1
  7. package/lib/AWS/Lambda/QueueEventSource.d.ts +1 -1
  8. package/lib/AWS/Lambda/QueueEventSource.d.ts.map +1 -1
  9. package/lib/AWS/Lambda/StreamEventSource.d.ts +1 -1
  10. package/lib/AWS/Lambda/StreamEventSource.d.ts.map +1 -1
  11. package/lib/AWS/Lambda/TableEventSource.d.ts +1 -1
  12. package/lib/AWS/Lambda/TableEventSource.d.ts.map +1 -1
  13. package/lib/AWS/Lambda/TopicEventSource.d.ts +1 -1
  14. package/lib/AWS/Lambda/TopicEventSource.d.ts.map +1 -1
  15. package/lib/AdoptPolicy.js +1 -1
  16. package/lib/AdoptPolicy.js.map +1 -1
  17. package/lib/Binding.d.ts +5 -1
  18. package/lib/Binding.d.ts.map +1 -1
  19. package/lib/Binding.js.map +1 -1
  20. package/lib/Cli/commands/cloudflare.d.ts +4 -1
  21. package/lib/Cli/commands/cloudflare.d.ts.map +1 -1
  22. package/lib/Cli/commands/cloudflare.js +274 -1
  23. package/lib/Cli/commands/cloudflare.js.map +1 -1
  24. package/lib/Cloudflare/AiGateway/AiGateway.d.ts +1 -1
  25. package/lib/Cloudflare/AiGateway/AiGateway.d.ts.map +1 -1
  26. package/lib/Cloudflare/AiGateway/AiGateway.js +2 -1
  27. package/lib/Cloudflare/AiGateway/AiGateway.js.map +1 -1
  28. package/lib/Cloudflare/ApiToken/AccountApiToken.d.ts +40 -2
  29. package/lib/Cloudflare/ApiToken/AccountApiToken.d.ts.map +1 -1
  30. package/lib/Cloudflare/ApiToken/AccountApiToken.js +49 -6
  31. package/lib/Cloudflare/ApiToken/AccountApiToken.js.map +1 -1
  32. package/lib/Cloudflare/ApiToken/Common.d.ts +36 -4
  33. package/lib/Cloudflare/ApiToken/Common.d.ts.map +1 -1
  34. package/lib/Cloudflare/ApiToken/Common.js +8 -0
  35. package/lib/Cloudflare/ApiToken/Common.js.map +1 -1
  36. package/lib/Cloudflare/ApiToken/UserApiToken.d.ts +38 -2
  37. package/lib/Cloudflare/ApiToken/UserApiToken.d.ts.map +1 -1
  38. package/lib/Cloudflare/ApiToken/UserApiToken.js +47 -6
  39. package/lib/Cloudflare/ApiToken/UserApiToken.js.map +1 -1
  40. package/lib/Cloudflare/Browser/Browser.d.ts +121 -0
  41. package/lib/Cloudflare/Browser/Browser.d.ts.map +1 -0
  42. package/lib/Cloudflare/{BrowserRendering/BrowserRendering.js → Browser/Browser.js} +19 -26
  43. package/lib/Cloudflare/Browser/Browser.js.map +1 -0
  44. package/lib/Cloudflare/Browser/BrowserBinding.d.ts +55 -0
  45. package/lib/Cloudflare/Browser/BrowserBinding.d.ts.map +1 -0
  46. package/lib/Cloudflare/{BrowserRendering/BrowserRenderingBinding.js → Browser/BrowserBinding.js} +11 -11
  47. package/lib/Cloudflare/Browser/BrowserBinding.js.map +1 -0
  48. package/lib/Cloudflare/Browser/index.d.ts +3 -0
  49. package/lib/Cloudflare/Browser/index.d.ts.map +1 -0
  50. package/lib/Cloudflare/Browser/index.js +3 -0
  51. package/lib/Cloudflare/Browser/index.js.map +1 -0
  52. package/lib/Cloudflare/Container/ContainerBinding.d.ts +2 -1
  53. package/lib/Cloudflare/Container/ContainerBinding.d.ts.map +1 -1
  54. package/lib/Cloudflare/D1/D1Database.d.ts.map +1 -1
  55. package/lib/Cloudflare/D1/D1Database.js +2 -1
  56. package/lib/Cloudflare/D1/D1Database.js.map +1 -1
  57. package/lib/Cloudflare/Dns/DnsBinding.d.ts +52 -0
  58. package/lib/Cloudflare/Dns/DnsBinding.d.ts.map +1 -0
  59. package/lib/Cloudflare/Dns/DnsBinding.js +59 -0
  60. package/lib/Cloudflare/Dns/DnsBinding.js.map +1 -0
  61. package/lib/Cloudflare/Dns/DnsRead.d.ts +80 -0
  62. package/lib/Cloudflare/Dns/DnsRead.d.ts.map +1 -0
  63. package/lib/Cloudflare/Dns/DnsRead.js +70 -0
  64. package/lib/Cloudflare/Dns/DnsRead.js.map +1 -0
  65. package/lib/Cloudflare/Dns/DnsReadWrite.d.ts +79 -0
  66. package/lib/Cloudflare/Dns/DnsReadWrite.d.ts.map +1 -0
  67. package/lib/Cloudflare/Dns/DnsReadWrite.js +72 -0
  68. package/lib/Cloudflare/Dns/DnsReadWrite.js.map +1 -0
  69. package/lib/Cloudflare/Dns/DnsWrite.d.ts +113 -0
  70. package/lib/Cloudflare/Dns/DnsWrite.d.ts.map +1 -0
  71. package/lib/Cloudflare/Dns/DnsWrite.js +100 -0
  72. package/lib/Cloudflare/Dns/DnsWrite.js.map +1 -0
  73. package/lib/Cloudflare/Dns/index.d.ts +5 -0
  74. package/lib/Cloudflare/Dns/index.d.ts.map +1 -0
  75. package/lib/Cloudflare/Dns/index.js +5 -0
  76. package/lib/Cloudflare/Dns/index.js.map +1 -0
  77. package/lib/Cloudflare/Email/EmailRouting.d.ts +1 -1
  78. package/lib/Cloudflare/Email/EmailRouting.d.ts.map +1 -1
  79. package/lib/Cloudflare/Email/EmailRouting.js +1 -1
  80. package/lib/Cloudflare/Email/EmailRouting.js.map +1 -1
  81. package/lib/Cloudflare/Email/EmailRule.d.ts +1 -1
  82. package/lib/Cloudflare/Email/EmailRule.d.ts.map +1 -1
  83. package/lib/Cloudflare/Email/EmailRule.js +1 -1
  84. package/lib/Cloudflare/Email/EmailRule.js.map +1 -1
  85. package/lib/Cloudflare/Hyperdrive/Hyperdrive.d.ts +1 -1
  86. package/lib/Cloudflare/Images/Images.d.ts +32 -23
  87. package/lib/Cloudflare/Images/Images.d.ts.map +1 -1
  88. package/lib/Cloudflare/Images/Images.js +10 -13
  89. package/lib/Cloudflare/Images/Images.js.map +1 -1
  90. package/lib/Cloudflare/KV/KVNamespace.d.ts +1 -1
  91. package/lib/Cloudflare/Providers.d.ts.map +1 -1
  92. package/lib/Cloudflare/Providers.js +14 -3
  93. package/lib/Cloudflare/Providers.js.map +1 -1
  94. package/lib/Cloudflare/Queue/Queue.d.ts +1 -1
  95. package/lib/Cloudflare/R2/R2Bucket.d.ts +2 -2
  96. package/lib/Cloudflare/R2/R2Bucket.d.ts.map +1 -1
  97. package/lib/Cloudflare/R2/R2Bucket.js +13 -7
  98. package/lib/Cloudflare/R2/R2Bucket.js.map +1 -1
  99. package/lib/Cloudflare/RateLimit/RateLimit.d.ts +132 -0
  100. package/lib/Cloudflare/RateLimit/RateLimit.d.ts.map +1 -0
  101. package/lib/Cloudflare/RateLimit/RateLimit.js +80 -0
  102. package/lib/Cloudflare/RateLimit/RateLimit.js.map +1 -0
  103. package/lib/Cloudflare/RateLimit/RateLimitBinding.d.ts +30 -0
  104. package/lib/Cloudflare/RateLimit/RateLimitBinding.d.ts.map +1 -0
  105. package/lib/Cloudflare/RateLimit/RateLimitBinding.js +50 -0
  106. package/lib/Cloudflare/RateLimit/RateLimitBinding.js.map +1 -0
  107. package/lib/Cloudflare/RateLimit/index.d.ts +3 -0
  108. package/lib/Cloudflare/RateLimit/index.d.ts.map +1 -0
  109. package/lib/Cloudflare/RateLimit/index.js +3 -0
  110. package/lib/Cloudflare/RateLimit/index.js.map +1 -0
  111. package/lib/Cloudflare/SecretsStore/Secret.d.ts +3 -2
  112. package/lib/Cloudflare/SecretsStore/Secret.d.ts.map +1 -1
  113. package/lib/Cloudflare/SecretsStore/Secret.js +7 -4
  114. package/lib/Cloudflare/SecretsStore/Secret.js.map +1 -1
  115. package/lib/Cloudflare/StateStore/Api.d.ts +1 -1
  116. package/lib/Cloudflare/Tunnel/Tunnel.d.ts +27 -0
  117. package/lib/Cloudflare/Tunnel/Tunnel.d.ts.map +1 -1
  118. package/lib/Cloudflare/Tunnel/Tunnel.js +27 -0
  119. package/lib/Cloudflare/Tunnel/Tunnel.js.map +1 -1
  120. package/lib/Cloudflare/Tunnel/TunnelBinding.d.ts +48 -0
  121. package/lib/Cloudflare/Tunnel/TunnelBinding.d.ts.map +1 -0
  122. package/lib/Cloudflare/Tunnel/TunnelBinding.js +56 -0
  123. package/lib/Cloudflare/Tunnel/TunnelBinding.js.map +1 -0
  124. package/lib/Cloudflare/Tunnel/TunnelRead.d.ts +83 -0
  125. package/lib/Cloudflare/Tunnel/TunnelRead.d.ts.map +1 -0
  126. package/lib/Cloudflare/Tunnel/TunnelRead.js +79 -0
  127. package/lib/Cloudflare/Tunnel/TunnelRead.js.map +1 -0
  128. package/lib/Cloudflare/Tunnel/TunnelReadWrite.d.ts +70 -0
  129. package/lib/Cloudflare/Tunnel/TunnelReadWrite.d.ts.map +1 -0
  130. package/lib/Cloudflare/Tunnel/TunnelReadWrite.js +63 -0
  131. package/lib/Cloudflare/Tunnel/TunnelReadWrite.js.map +1 -0
  132. package/lib/Cloudflare/Tunnel/TunnelWrite.d.ts +92 -0
  133. package/lib/Cloudflare/Tunnel/TunnelWrite.d.ts.map +1 -0
  134. package/lib/Cloudflare/Tunnel/TunnelWrite.js +88 -0
  135. package/lib/Cloudflare/Tunnel/TunnelWrite.js.map +1 -0
  136. package/lib/Cloudflare/Tunnel/index.d.ts +4 -0
  137. package/lib/Cloudflare/Tunnel/index.d.ts.map +1 -1
  138. package/lib/Cloudflare/Tunnel/index.js +4 -0
  139. package/lib/Cloudflare/Tunnel/index.js.map +1 -1
  140. package/lib/Cloudflare/Vectorize/VectorizeIndex.d.ts +1 -1
  141. package/lib/Cloudflare/Vectorize/VectorizeIndex.js +1 -0
  142. package/lib/Cloudflare/Vectorize/VectorizeIndex.js.map +1 -1
  143. package/lib/Cloudflare/VpcService/VpcService.d.ts +1 -1
  144. package/lib/Cloudflare/VpcService/VpcService.d.ts.map +1 -1
  145. package/lib/Cloudflare/VpcService/VpcService.js.map +1 -1
  146. package/lib/Cloudflare/Workers/DynamicWorkerLoader.d.ts +119 -11
  147. package/lib/Cloudflare/Workers/DynamicWorkerLoader.d.ts.map +1 -1
  148. package/lib/Cloudflare/Workers/DynamicWorkerLoader.js +88 -9
  149. package/lib/Cloudflare/Workers/DynamicWorkerLoader.js.map +1 -1
  150. package/lib/Cloudflare/Workers/InferEnv.d.ts +1 -1
  151. package/lib/Cloudflare/Workers/InferEnv.d.ts.map +1 -1
  152. package/lib/Cloudflare/Workers/LocalWorkerProvider.js +2 -0
  153. package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
  154. package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts.map +1 -1
  155. package/lib/Cloudflare/Workers/WorkerAsyncBindings.js +18 -2
  156. package/lib/Cloudflare/Workers/WorkerAsyncBindings.js.map +1 -1
  157. package/lib/Cloudflare/Workers/WorkerBinding.d.ts +7 -5
  158. package/lib/Cloudflare/Workers/WorkerBinding.d.ts.map +1 -1
  159. package/lib/Cloudflare/Workers/WorkerBinding.js +1 -1
  160. package/lib/Cloudflare/Workers/WorkerBinding.js.map +1 -1
  161. package/lib/Cloudflare/Zaraz/ZarazConfig.d.ts +1 -1
  162. package/lib/Cloudflare/Zaraz/ZarazConfig.d.ts.map +1 -1
  163. package/lib/Cloudflare/Zaraz/ZarazConfig.js +1 -1
  164. package/lib/Cloudflare/Zaraz/ZarazConfig.js.map +1 -1
  165. package/lib/Cloudflare/Zone/Zone.d.ts +170 -0
  166. package/lib/Cloudflare/Zone/Zone.d.ts.map +1 -0
  167. package/lib/Cloudflare/Zone/Zone.js +180 -0
  168. package/lib/Cloudflare/Zone/Zone.js.map +1 -0
  169. package/lib/Cloudflare/Zone/index.d.ts +3 -0
  170. package/lib/Cloudflare/Zone/index.d.ts.map +1 -0
  171. package/lib/Cloudflare/Zone/index.js +3 -0
  172. package/lib/Cloudflare/Zone/index.js.map +1 -0
  173. package/lib/Cloudflare/Zone/lookup.d.ts +33 -0
  174. package/lib/Cloudflare/Zone/lookup.d.ts.map +1 -0
  175. package/lib/Cloudflare/{Zone.js → Zone/lookup.js} +2 -2
  176. package/lib/Cloudflare/Zone/lookup.js.map +1 -0
  177. package/lib/Cloudflare/index.d.ts +4 -1
  178. package/lib/Cloudflare/index.d.ts.map +1 -1
  179. package/lib/Cloudflare/index.js +4 -1
  180. package/lib/Cloudflare/index.js.map +1 -1
  181. package/lib/Output.d.ts +13 -1
  182. package/lib/Output.d.ts.map +1 -1
  183. package/lib/Output.js +43 -11
  184. package/lib/Output.js.map +1 -1
  185. package/lib/Plan.d.ts.map +1 -1
  186. package/lib/Plan.js +8 -0
  187. package/lib/Plan.js.map +1 -1
  188. package/lib/Platform.d.ts +5 -5
  189. package/lib/Platform.d.ts.map +1 -1
  190. package/lib/Platform.js +5 -2
  191. package/lib/Platform.js.map +1 -1
  192. package/lib/RemovalPolicy.js +2 -2
  193. package/lib/RemovalPolicy.js.map +1 -1
  194. package/lib/Resource.d.ts +15 -2
  195. package/lib/Resource.d.ts.map +1 -1
  196. package/lib/Resource.js +3 -2
  197. package/lib/Resource.js.map +1 -1
  198. package/lib/tsconfig.test.tsbuildinfo +1 -1
  199. package/package.json +7 -7
  200. package/src/AdoptPolicy.ts +1 -1
  201. package/src/Binding.ts +5 -1
  202. package/src/Cli/commands/cloudflare.ts +394 -1
  203. package/src/Cloudflare/AiGateway/AiGateway.ts +2 -1
  204. package/src/Cloudflare/ApiToken/AccountApiToken.ts +60 -7
  205. package/src/Cloudflare/ApiToken/Common.ts +45 -6
  206. package/src/Cloudflare/ApiToken/UserApiToken.ts +58 -7
  207. package/src/Cloudflare/Browser/Browser.ts +140 -0
  208. package/src/Cloudflare/Browser/BrowserBinding.ts +128 -0
  209. package/src/Cloudflare/Browser/index.ts +11 -0
  210. package/src/Cloudflare/D1/D1Database.ts +6 -2
  211. package/src/Cloudflare/Dns/DnsBinding.ts +123 -0
  212. package/src/Cloudflare/Dns/DnsRead.ts +129 -0
  213. package/src/Cloudflare/Dns/DnsReadWrite.ts +99 -0
  214. package/src/Cloudflare/Dns/DnsWrite.ts +209 -0
  215. package/src/Cloudflare/Dns/index.ts +4 -0
  216. package/src/Cloudflare/Email/EmailRouting.ts +1 -1
  217. package/src/Cloudflare/Email/EmailRule.ts +6 -6
  218. package/src/Cloudflare/Images/Images.ts +40 -27
  219. package/src/Cloudflare/Providers.ts +22 -3
  220. package/src/Cloudflare/R2/R2Bucket.ts +17 -9
  221. package/src/Cloudflare/RateLimit/RateLimit.ts +160 -0
  222. package/src/Cloudflare/RateLimit/RateLimitBinding.ts +90 -0
  223. package/src/Cloudflare/RateLimit/index.ts +2 -0
  224. package/src/Cloudflare/SecretsStore/Secret.ts +12 -6
  225. package/src/Cloudflare/Tunnel/Tunnel.ts +27 -0
  226. package/src/Cloudflare/Tunnel/TunnelBinding.ts +114 -0
  227. package/src/Cloudflare/Tunnel/TunnelRead.ts +168 -0
  228. package/src/Cloudflare/Tunnel/TunnelReadWrite.ts +88 -0
  229. package/src/Cloudflare/Tunnel/TunnelWrite.ts +194 -0
  230. package/src/Cloudflare/Tunnel/index.ts +4 -0
  231. package/src/Cloudflare/Vectorize/VectorizeIndex.ts +2 -1
  232. package/src/Cloudflare/VpcService/VpcService.ts +4 -2
  233. package/src/Cloudflare/Workers/DynamicWorkerLoader.ts +139 -13
  234. package/src/Cloudflare/Workers/InferEnv.ts +19 -15
  235. package/src/Cloudflare/Workers/LocalWorkerProvider.ts +13 -2
  236. package/src/Cloudflare/Workers/WorkerAsyncBindings.ts +16 -2
  237. package/src/Cloudflare/Workers/WorkerBinding.ts +6 -2
  238. package/src/Cloudflare/Zaraz/ZarazConfig.ts +1 -1
  239. package/src/Cloudflare/Zone/Zone.ts +349 -0
  240. package/src/Cloudflare/Zone/index.ts +2 -0
  241. package/src/Cloudflare/{Zone.ts → Zone/lookup.ts} +16 -3
  242. package/src/Cloudflare/index.ts +4 -1
  243. package/src/Output.ts +67 -11
  244. package/src/Plan.ts +9 -0
  245. package/src/Platform.ts +19 -15
  246. package/src/RemovalPolicy.ts +2 -2
  247. package/src/Resource.ts +19 -2
  248. package/lib/Cloudflare/BrowserRendering/BrowserRendering.d.ts +0 -116
  249. package/lib/Cloudflare/BrowserRendering/BrowserRendering.d.ts.map +0 -1
  250. package/lib/Cloudflare/BrowserRendering/BrowserRendering.js.map +0 -1
  251. package/lib/Cloudflare/BrowserRendering/BrowserRenderingBinding.d.ts +0 -55
  252. package/lib/Cloudflare/BrowserRendering/BrowserRenderingBinding.d.ts.map +0 -1
  253. package/lib/Cloudflare/BrowserRendering/BrowserRenderingBinding.js.map +0 -1
  254. package/lib/Cloudflare/BrowserRendering/index.d.ts +0 -3
  255. package/lib/Cloudflare/BrowserRendering/index.d.ts.map +0 -1
  256. package/lib/Cloudflare/BrowserRendering/index.js +0 -3
  257. package/lib/Cloudflare/BrowserRendering/index.js.map +0 -1
  258. package/lib/Cloudflare/Zone.d.ts +0 -14
  259. package/lib/Cloudflare/Zone.d.ts.map +0 -1
  260. package/lib/Cloudflare/Zone.js.map +0 -1
  261. package/src/Cloudflare/BrowserRendering/BrowserRendering.ts +0 -132
  262. package/src/Cloudflare/BrowserRendering/BrowserRenderingBinding.ts +0 -137
  263. package/src/Cloudflare/BrowserRendering/index.ts +0 -11
@@ -0,0 +1,129 @@
1
+ import type {
2
+ GetRecordError,
3
+ GetRecordResponse,
4
+ ListRecordsError,
5
+ ListRecordsRequest,
6
+ ListRecordsResponse,
7
+ } from "@distilled.cloud/cloudflare/dns";
8
+ import * as dns from "@distilled.cloud/cloudflare/dns";
9
+ import * as Effect from "effect/Effect";
10
+ import * as Layer from "effect/Layer";
11
+ import * as Binding from "../../Binding.ts";
12
+ import type { RuntimeContext } from "../../RuntimeContext.ts";
13
+ import type { AccountApiToken } from "../ApiToken/AccountApiToken.ts";
14
+ import type { Zone } from "../Zone/Zone.ts";
15
+ import {
16
+ authorizeDns,
17
+ type DnsToken,
18
+ makeDnsClient,
19
+ makeDnsPolicyLive,
20
+ } from "./DnsBinding.ts";
21
+
22
+ /** List-records request, minus the zone id (bound at `.bind(zone)` time). */
23
+ export type ListRecordsRequestInput = Omit<ListRecordsRequest, "zoneId">;
24
+
25
+ /**
26
+ * Read-only DNS record operations. Backed by the `DNS Read` permission group.
27
+ * The zone is fixed when the client is bound, so no `zoneId` is passed per call.
28
+ */
29
+ export interface DnsReadClient {
30
+ /** Fetch a single DNS record by id. */
31
+ getDnsRecord(
32
+ dnsRecordId: string,
33
+ ): Effect.Effect<GetRecordResponse, GetRecordError, RuntimeContext>;
34
+ /** List the DNS records in the bound zone. */
35
+ listDnsRecords(
36
+ request?: ListRecordsRequestInput,
37
+ ): Effect.Effect<ListRecordsResponse, ListRecordsError, RuntimeContext>;
38
+ }
39
+
40
+ /** Build the read-only client over a bound token and zone id. */
41
+ export const dnsReadClient = (
42
+ token: DnsToken,
43
+ zoneId: Effect.Effect<string>,
44
+ ): DnsReadClient => {
45
+ const authorize = authorizeDns(token);
46
+ return {
47
+ getDnsRecord: Effect.fn("Cloudflare.Dns.getDnsRecord")(
48
+ function* (dnsRecordId) {
49
+ return yield* authorize(
50
+ dns.getRecord({ zoneId: yield* zoneId, dnsRecordId }),
51
+ );
52
+ },
53
+ ),
54
+ listDnsRecords: Effect.fn("Cloudflare.Dns.listDnsRecords")(
55
+ function* (request) {
56
+ return yield* authorize(
57
+ dns.listRecords({ zoneId: yield* zoneId, ...request }),
58
+ );
59
+ },
60
+ ),
61
+ };
62
+ };
63
+
64
+ /**
65
+ * Binding that lets a Worker read Cloudflare DNS records at runtime.
66
+ *
67
+ * Creates a least-privilege {@link AccountApiToken} with only the `DNS Read`
68
+ * permission, scoped to the single zone passed to `bind`, and binds its value
69
+ * into the Worker so runtime code can authenticate.
70
+ *
71
+ * @binding
72
+ *
73
+ * @section Reading DNS records at runtime
74
+ * @example Read records from inside a Worker
75
+ * Bind the client in the Worker's Init phase and provide {@link DnsReadLive}.
76
+ * The zone is fixed by `.bind(zone)` — the provisioned token only grants
77
+ * access to that zone, so calls take no `zoneId`. Pass the {@link Zone}
78
+ * resource directly (it's an `Effect`), or `yield* Zone` for a resolved value.
79
+ * ```typescript
80
+ * import * as Cloudflare from "alchemy/Cloudflare";
81
+ * import * as Effect from "effect/Effect";
82
+ * import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
83
+ *
84
+ * const Zone = Cloudflare.Zone("MyZone", { name: "example.com" });
85
+ *
86
+ * export class DnsReaderWorker extends Cloudflare.Worker<DnsReaderWorker>()(
87
+ * "DnsReaderWorker",
88
+ * { main: import.meta.filename },
89
+ * Effect.gen(function* () {
90
+ * // Init phase — bind the read client scoped to the zone.
91
+ * const dns = yield* Cloudflare.DnsRead.bind(Zone);
92
+ *
93
+ * return {
94
+ * fetch: Effect.gen(function* () {
95
+ * const { result } = yield* dns.listDnsRecords({ type: "A" });
96
+ * const record = yield* dns.getDnsRecord(result[0].id);
97
+ * return yield* HttpServerResponse.json({ id: record.id });
98
+ * }),
99
+ * };
100
+ * }).pipe(Effect.provide(Cloudflare.DnsReadLive)),
101
+ * ) {}
102
+ * ```
103
+ */
104
+ export class DnsRead extends Binding.Service<
105
+ DnsRead,
106
+ (zone: Zone) => Effect.Effect<DnsReadClient>
107
+ >()("Cloudflare.DnsRead") {}
108
+
109
+ /**
110
+ * Deploy-time policy for {@link DnsRead}. Attaches the `DNS Read` permission to
111
+ * the token via its binding contract.
112
+ */
113
+ export class DnsReadPolicy extends Binding.Policy<
114
+ DnsReadPolicy,
115
+ (token: AccountApiToken, zone: Zone) => Effect.Effect<void>
116
+ >()("Cloudflare.DnsRead") {}
117
+
118
+ /** Runtime layer for {@link DnsRead}. */
119
+ export const DnsReadLive = Layer.effect(
120
+ DnsRead,
121
+ makeDnsClient(DnsReadPolicy, "DnsReadToken", dnsReadClient),
122
+ );
123
+
124
+ /** Live deploy-time policy layer for {@link DnsReadPolicy}. */
125
+ export const DnsReadPolicyLive = makeDnsPolicyLive(
126
+ DnsReadPolicy,
127
+ "Cloudflare.DnsRead",
128
+ ["DNS Read"],
129
+ );
@@ -0,0 +1,99 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Layer from "effect/Layer";
3
+ import * as Binding from "../../Binding.ts";
4
+ import type { AccountApiToken } from "../ApiToken/AccountApiToken.ts";
5
+ import type { Zone } from "../Zone/Zone.ts";
6
+ import {
7
+ type DnsToken,
8
+ makeDnsClient,
9
+ makeDnsPolicyLive,
10
+ } from "./DnsBinding.ts";
11
+ import { dnsReadClient, type DnsReadClient } from "./DnsRead.ts";
12
+ import { dnsWriteClient, type DnsWriteClient } from "./DnsWrite.ts";
13
+
14
+ /** Combined read + write DNS record operations. */
15
+ export interface DnsReadWriteClient extends DnsReadClient, DnsWriteClient {}
16
+
17
+ /** Build the combined read + write client over a bound token and zone id. */
18
+ export const dnsReadWriteClient = (
19
+ token: DnsToken,
20
+ zoneId: Effect.Effect<string>,
21
+ ): DnsReadWriteClient => ({
22
+ ...dnsReadClient(token, zoneId),
23
+ ...dnsWriteClient(token, zoneId),
24
+ });
25
+
26
+ /**
27
+ * Binding that lets a Worker perform the full Cloudflare DNS record CRUD
28
+ * surface at runtime.
29
+ *
30
+ * Creates a least-privilege {@link AccountApiToken} with both the `DNS Read`
31
+ * and `DNS Write` permissions, scoped to the single zone passed to `bind`, and
32
+ * binds its value into the Worker so runtime code can authenticate.
33
+ *
34
+ * @binding
35
+ *
36
+ * @section Managing DNS records at runtime
37
+ * @example Full CRUD from inside a Worker
38
+ * Bind the client in the Worker's Init phase and provide
39
+ * {@link DnsReadWriteLive}. The zone is fixed by `.bind(zone)` — the
40
+ * provisioned token only grants access to that zone, so calls take no
41
+ * `zoneId`. Pass the {@link Zone} resource directly (it's an `Effect`), or
42
+ * `yield* Zone` for a resolved value.
43
+ * ```typescript
44
+ * import * as Cloudflare from "alchemy/Cloudflare";
45
+ * import * as Effect from "effect/Effect";
46
+ * import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
47
+ *
48
+ * const Zone = Cloudflare.Zone("MyZone", { name: "example.com" });
49
+ *
50
+ * export class DnsWorker extends Cloudflare.Worker<DnsWorker>()(
51
+ * "DnsWorker",
52
+ * { main: import.meta.filename },
53
+ * Effect.gen(function* () {
54
+ * // Init phase — bind the full CRUD client scoped to the zone.
55
+ * const dns = yield* Cloudflare.DnsReadWrite.bind(Zone);
56
+ *
57
+ * return {
58
+ * fetch: Effect.gen(function* () {
59
+ * const { result } = yield* dns.createDnsRecord({
60
+ * type: "A",
61
+ * name: "app.example.com",
62
+ * content: "192.0.2.1",
63
+ * ttl: 1,
64
+ * });
65
+ * const record = yield* dns.getDnsRecord(result.id);
66
+ * yield* dns.deleteDnsRecord(result.id);
67
+ * return yield* HttpServerResponse.json({ id: record.id });
68
+ * }),
69
+ * };
70
+ * }).pipe(Effect.provide(Cloudflare.DnsReadWriteLive)),
71
+ * ) {}
72
+ * ```
73
+ */
74
+ export class DnsReadWrite extends Binding.Service<
75
+ DnsReadWrite,
76
+ (zone: Zone) => Effect.Effect<DnsReadWriteClient>
77
+ >()("Cloudflare.DnsReadWrite") {}
78
+
79
+ /**
80
+ * Deploy-time policy for {@link DnsReadWrite}. Attaches both the `DNS Read` and
81
+ * `DNS Write` permissions to the token via its binding contract.
82
+ */
83
+ export class DnsReadWritePolicy extends Binding.Policy<
84
+ DnsReadWritePolicy,
85
+ (token: AccountApiToken, zone: Zone) => Effect.Effect<void>
86
+ >()("Cloudflare.DnsReadWrite") {}
87
+
88
+ /** Runtime layer for {@link DnsReadWrite}. */
89
+ export const DnsReadWriteLive = Layer.effect(
90
+ DnsReadWrite,
91
+ makeDnsClient(DnsReadWritePolicy, "DnsReadWriteToken", dnsReadWriteClient),
92
+ );
93
+
94
+ /** Live deploy-time policy layer for {@link DnsReadWritePolicy}. */
95
+ export const DnsReadWritePolicyLive = makeDnsPolicyLive(
96
+ DnsReadWritePolicy,
97
+ "Cloudflare.DnsReadWrite",
98
+ ["DNS Read", "DNS Write"],
99
+ );
@@ -0,0 +1,209 @@
1
+ import type {
2
+ BatchRecordError,
3
+ BatchRecordRequest,
4
+ BatchRecordResponse,
5
+ CreateRecordError,
6
+ CreateRecordRequest,
7
+ CreateRecordResponse,
8
+ DeleteRecordError,
9
+ DeleteRecordResponse,
10
+ PatchRecordError,
11
+ PatchRecordRequest,
12
+ PatchRecordResponse,
13
+ UpdateRecordError,
14
+ UpdateRecordRequest,
15
+ UpdateRecordResponse,
16
+ } from "@distilled.cloud/cloudflare/dns";
17
+ import * as dns from "@distilled.cloud/cloudflare/dns";
18
+ import * as Effect from "effect/Effect";
19
+ import * as Layer from "effect/Layer";
20
+ import * as Binding from "../../Binding.ts";
21
+ import type { RuntimeContext } from "../../RuntimeContext.ts";
22
+ import type { AccountApiToken } from "../ApiToken/AccountApiToken.ts";
23
+ import type { Zone } from "../Zone/Zone.ts";
24
+ import {
25
+ authorizeDns,
26
+ type DnsToken,
27
+ makeDnsClient,
28
+ makeDnsPolicyLive,
29
+ } from "./DnsBinding.ts";
30
+
31
+ /** Create-record request, minus the zone id (bound at `.bind(zone)` time). */
32
+ export type CreateRecordRequestInput = Omit<CreateRecordRequest, "zoneId">;
33
+
34
+ /** Update-record request, minus the zone id and record id. */
35
+ export type UpdateRecordRequestInput = Omit<
36
+ UpdateRecordRequest,
37
+ "zoneId" | "dnsRecordId"
38
+ >;
39
+
40
+ /** Patch-record request, minus the zone id and record id. */
41
+ export type PatchRecordRequestInput = Omit<
42
+ PatchRecordRequest,
43
+ "zoneId" | "dnsRecordId"
44
+ >;
45
+
46
+ /** Batch-records request, minus the zone id (bound at `.bind(zone)` time). */
47
+ export type BatchRecordRequestInput = Omit<BatchRecordRequest, "zoneId">;
48
+
49
+ /**
50
+ * Mutating DNS record operations. Backed by the `DNS Write` permission group.
51
+ * The zone is fixed when the client is bound, so no `zoneId` is passed per call.
52
+ */
53
+ export interface DnsWriteClient {
54
+ /** Create a DNS record. */
55
+ createDnsRecord(
56
+ request: CreateRecordRequestInput,
57
+ ): Effect.Effect<CreateRecordResponse, CreateRecordError, RuntimeContext>;
58
+ /** Overwrite (PUT) a DNS record. */
59
+ updateDnsRecord(
60
+ dnsRecordId: string,
61
+ request: UpdateRecordRequestInput,
62
+ ): Effect.Effect<UpdateRecordResponse, UpdateRecordError, RuntimeContext>;
63
+ /** Partially update (PATCH) a DNS record. */
64
+ patchDnsRecord(
65
+ dnsRecordId: string,
66
+ request: PatchRecordRequestInput,
67
+ ): Effect.Effect<PatchRecordResponse, PatchRecordError, RuntimeContext>;
68
+ /** Delete a DNS record by id. */
69
+ deleteDnsRecord(
70
+ dnsRecordId: string,
71
+ ): Effect.Effect<DeleteRecordResponse, DeleteRecordError, RuntimeContext>;
72
+ /** Apply a batch of create / update / patch / delete operations atomically. */
73
+ batchDnsRecords(
74
+ request: BatchRecordRequestInput,
75
+ ): Effect.Effect<BatchRecordResponse, BatchRecordError, RuntimeContext>;
76
+ }
77
+
78
+ /** Build the write client over a bound token and zone id. */
79
+ export const dnsWriteClient = (
80
+ token: DnsToken,
81
+ zoneId: Effect.Effect<string>,
82
+ ): DnsWriteClient => {
83
+ const authorize = authorizeDns(token);
84
+ return {
85
+ createDnsRecord: Effect.fn("Cloudflare.Dns.createDnsRecord")(
86
+ function* (request) {
87
+ return yield* authorize(
88
+ dns.createRecord({ zoneId: yield* zoneId, ...request }),
89
+ );
90
+ },
91
+ ),
92
+ updateDnsRecord: Effect.fn("Cloudflare.Dns.updateDnsRecord")(
93
+ function* (dnsRecordId, request) {
94
+ return yield* authorize(
95
+ dns.updateRecord({ zoneId: yield* zoneId, dnsRecordId, ...request }),
96
+ );
97
+ },
98
+ ),
99
+ patchDnsRecord: Effect.fn("Cloudflare.Dns.patchDnsRecord")(
100
+ function* (dnsRecordId, request) {
101
+ return yield* authorize(
102
+ dns.patchRecord({ zoneId: yield* zoneId, dnsRecordId, ...request }),
103
+ );
104
+ },
105
+ ),
106
+ deleteDnsRecord: Effect.fn("Cloudflare.Dns.deleteDnsRecord")(
107
+ function* (dnsRecordId) {
108
+ return yield* authorize(
109
+ dns.deleteRecord({ zoneId: yield* zoneId, dnsRecordId }),
110
+ );
111
+ },
112
+ ),
113
+ batchDnsRecords: Effect.fn("Cloudflare.Dns.batchDnsRecords")(
114
+ function* (request) {
115
+ return yield* authorize(
116
+ dns.batchRecord({ zoneId: yield* zoneId, ...request }),
117
+ );
118
+ },
119
+ ),
120
+ };
121
+ };
122
+
123
+ /**
124
+ * Binding that lets a Worker create, update, and delete Cloudflare DNS records
125
+ * at runtime.
126
+ *
127
+ * Creates a least-privilege {@link AccountApiToken} with only the `DNS Write`
128
+ * permission, scoped to the single zone passed to `bind`, and binds its value
129
+ * into the Worker so runtime code can authenticate.
130
+ *
131
+ * @binding
132
+ *
133
+ * @section Mutating DNS records at runtime
134
+ * @example Create, update, and delete records from inside a Worker
135
+ * Bind the client in the Worker's Init phase and provide {@link DnsWriteLive}.
136
+ * The zone is fixed by `.bind(zone)` — the provisioned token only grants
137
+ * access to that zone, so calls take no `zoneId`. Pass the {@link Zone}
138
+ * resource directly (it's an `Effect`), or `yield* Zone` for a resolved value.
139
+ * ```typescript
140
+ * import * as Cloudflare from "alchemy/Cloudflare";
141
+ * import * as Effect from "effect/Effect";
142
+ * import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
143
+ *
144
+ * const Zone = Cloudflare.Zone("MyZone", { name: "example.com" });
145
+ *
146
+ * export class DnsWriterWorker extends Cloudflare.Worker<DnsWriterWorker>()(
147
+ * "DnsWriterWorker",
148
+ * { main: import.meta.filename },
149
+ * Effect.gen(function* () {
150
+ * // Init phase — bind the write client scoped to the zone.
151
+ * const dns = yield* Cloudflare.DnsWrite.bind(Zone);
152
+ *
153
+ * return {
154
+ * fetch: Effect.gen(function* () {
155
+ * const { result } = yield* dns.createDnsRecord({
156
+ * type: "A",
157
+ * name: "app.example.com",
158
+ * content: "192.0.2.1",
159
+ * ttl: 1,
160
+ * proxied: true,
161
+ * });
162
+ * yield* dns.updateDnsRecord(result.id, {
163
+ * type: "A",
164
+ * name: "app.example.com",
165
+ * content: "192.0.2.2",
166
+ * ttl: 1,
167
+ * });
168
+ * yield* dns.deleteDnsRecord(result.id);
169
+ * return yield* HttpServerResponse.json({ id: result.id });
170
+ * }),
171
+ * };
172
+ * }).pipe(Effect.provide(Cloudflare.DnsWriteLive)),
173
+ * ) {}
174
+ * ```
175
+ *
176
+ * @example Apply a batch of changes atomically
177
+ * ```typescript
178
+ * yield* dns.batchDnsRecords({
179
+ * posts: [{ type: "A", name: "a.example.com", content: "192.0.2.1", ttl: 1 }],
180
+ * deletes: [{ id: oldRecordId }],
181
+ * });
182
+ * ```
183
+ */
184
+ export class DnsWrite extends Binding.Service<
185
+ DnsWrite,
186
+ (zone: Zone) => Effect.Effect<DnsWriteClient>
187
+ >()("Cloudflare.DnsWrite") {}
188
+
189
+ /**
190
+ * Deploy-time policy for {@link DnsWrite}. Attaches the `DNS Write` permission
191
+ * to the token via its binding contract.
192
+ */
193
+ export class DnsWritePolicy extends Binding.Policy<
194
+ DnsWritePolicy,
195
+ (token: AccountApiToken, zone: Zone) => Effect.Effect<void>
196
+ >()("Cloudflare.DnsWrite") {}
197
+
198
+ /** Runtime layer for {@link DnsWrite}. */
199
+ export const DnsWriteLive = Layer.effect(
200
+ DnsWrite,
201
+ makeDnsClient(DnsWritePolicy, "DnsWriteToken", dnsWriteClient),
202
+ );
203
+
204
+ /** Live deploy-time policy layer for {@link DnsWritePolicy}. */
205
+ export const DnsWritePolicyLive = makeDnsPolicyLive(
206
+ DnsWritePolicy,
207
+ "Cloudflare.DnsWrite",
208
+ ["DNS Write"],
209
+ );
@@ -0,0 +1,4 @@
1
+ export * from "./DnsBinding.ts";
2
+ export * from "./DnsRead.ts";
3
+ export * from "./DnsReadWrite.ts";
4
+ export * from "./DnsWrite.ts";
@@ -5,7 +5,7 @@ import * as Provider from "../../Provider.ts";
5
5
  import { Resource } from "../../Resource.ts";
6
6
  import { CloudflareEnvironment } from "../CloudflareEnvironment.ts";
7
7
  import type { Providers } from "../Providers.ts";
8
- import { resolveZoneId, type ZoneReference } from "../Zone.ts";
8
+ import { resolveZoneId, type ZoneReference } from "../Zone/index.ts";
9
9
 
10
10
  export type EmailRoutingStatus =
11
11
  | "ready"
@@ -5,7 +5,7 @@ import * as Provider from "../../Provider.ts";
5
5
  import { Resource } from "../../Resource.ts";
6
6
  import { CloudflareEnvironment } from "../CloudflareEnvironment.ts";
7
7
  import type { Providers } from "../Providers.ts";
8
- import { resolveZoneId, type ZoneReference } from "../Zone.ts";
8
+ import { resolveZoneId, type ZoneReference } from "../Zone/index.ts";
9
9
 
10
10
  export type EmailMatcher =
11
11
  | { type: "all" }
@@ -88,16 +88,16 @@ const normalize = (
88
88
  name?: string | null;
89
89
  enabled?: boolean | null;
90
90
  priority?: number | null;
91
+ // Distilled widened generated string enums to open unions (`string & {}`);
92
+ // the runtime values are still the known variants, narrowed below.
91
93
  matchers?:
92
94
  | {
93
- type: "all" | "literal";
94
- field?: "to" | null;
95
+ type: string;
96
+ field?: string | null;
95
97
  value?: string | null;
96
98
  }[]
97
99
  | null;
98
- actions?:
99
- | { type: "drop" | "forward" | "worker"; value?: string[] | null }[]
100
- | null;
100
+ actions?: { type: string; value?: string[] | null }[] | null;
101
101
  },
102
102
  zoneId: string,
103
103
  ) => ({
@@ -1,32 +1,47 @@
1
- import * as Effect from "effect/Effect";
2
- import { ImagesBinding } from "./ImagesBinding.ts";
1
+ import type * as Effect from "effect/Effect";
2
+ import { SingleShotGen } from "effect/Utils";
3
+ import { ImagesBinding, type ImagesClient } from "./ImagesBinding.ts";
3
4
 
4
5
  type ImagesTypeId = typeof ImagesTypeId;
5
6
  const ImagesTypeId = "Cloudflare.Images" as const;
6
7
 
7
8
  export type ImagesProps = {
8
9
  /**
9
- * Binding name used when `Cloudflare.Images.bind(images)` attaches Images
10
- * from inside a Worker init phase. When Images is passed through
11
- * `Worker({ bindings: { ... } })`, the object key remains the binding name.
10
+ * Binding name used when `Images` is bound from inside a Worker init phase
11
+ * (`yield* Cloudflare.Images(...)`). When passed through
12
+ * `Worker({ env: { ... } })`, the object key remains the binding name.
12
13
  *
13
14
  * @default "IMAGES"
14
15
  */
15
16
  name?: string;
16
17
  };
17
18
 
19
+ /**
20
+ * The Effect yielded when an `Images` marker is used inside a Worker init
21
+ * phase: it attaches the `images` binding to the surrounding Worker and
22
+ * resolves to the runtime {@link ImagesClient}.
23
+ */
24
+ type BindEffect = Effect.Effect<ImagesClient, never, ImagesBinding>;
25
+
18
26
  /**
19
27
  * Marker for a Cloudflare Images binding.
20
28
  *
21
- * Images bindings are configured directly on Workers and do not have a
22
- * standalone provisioning API. The Worker provider sees this object in
23
- * `bindings: { ... }` and emits the corresponding `{ type: "images" }`
24
- * metadata binding to the script.
29
+ * It is a plain data structure (so it can be declared directly on a Worker's
30
+ * `env`) that is **also** yieldable inside an Effect-native Worker. Yielding it
31
+ * (`yield* Cloudflare.Images(...)`) attaches the binding to the surrounding
32
+ * Worker and returns the runtime {@link ImagesClient} — no separate `.bind(...)`
33
+ * step required.
34
+ *
35
+ * The divergence is achieved via `[Symbol.iterator]`: the object is not an
36
+ * `Effect` (so `InferEnv` resolves it to the native `ImagesBinding` in the
37
+ * `env` position), but it is iterable as one when `yield*`-ed.
25
38
  */
26
- export type Images = {
39
+ export interface Images {
27
40
  kind: ImagesTypeId;
28
41
  name: string;
29
- };
42
+ asEffect(): BindEffect;
43
+ [Symbol.iterator](): SingleShotGen<BindEffect, ImagesClient>;
44
+ }
30
45
 
31
46
  export const isImages = (value: unknown): value is Images =>
32
47
  typeof value === "object" &&
@@ -44,12 +59,6 @@ export const isImages = (value: unknown): value is Images =>
44
59
  * .draw(...).output(...)`. The runtime conversion to Cloudflare's
45
60
  * `ReadableStream` is handled internally.
46
61
  *
47
- * @section Declaring Images
48
- * @example
49
- * ```typescript
50
- * const Pipeline = yield* Cloudflare.Images({ name: "PIPELINE" });
51
- * ```
52
- *
53
62
  * @section Effect-style Worker (recommended)
54
63
  * @example Read image format and dimensions from the request body
55
64
  * ```typescript
@@ -57,8 +66,8 @@ export const isImages = (value: unknown): value is Images =>
57
66
  *
58
67
  * Cloudflare.Worker("ImageWorker", { main: import.meta.filename },
59
68
  * Effect.gen(function* () {
60
- * const pipeline = yield* Pipeline;
61
- * const images = yield* Cloudflare.Images.bind(pipeline);
69
+ * // Attaches the binding to this Worker AND returns the runtime client.
70
+ * const images = yield* Cloudflare.Images({ name: "PIPELINE" });
62
71
  * return {
63
72
  * fetch: Effect.gen(function* () {
64
73
  * const request = yield* HttpServerRequest;
@@ -85,7 +94,7 @@ export const isImages = (value: unknown): value is Images =>
85
94
  * ```typescript
86
95
  * export const Worker = Cloudflare.Worker("Worker", {
87
96
  * main: "./src/worker.ts",
88
- * bindings: { MEDIA: Pipeline },
97
+ * env: { MEDIA: Cloudflare.Images({ name: "PIPELINE" }) },
89
98
  * });
90
99
  *
91
100
  * export type WorkerEnv = Cloudflare.InferEnv<typeof Worker>;
@@ -101,19 +110,23 @@ export const isImages = (value: unknown): value is Images =>
101
110
  * @see https://developers.cloudflare.com/images/transform-images/bindings/
102
111
  */
103
112
  export const Images: {
104
- (props?: ImagesProps): Effect.Effect<Images>;
113
+ (props?: ImagesProps): Images;
105
114
  /**
106
- * Bind Cloudflare Images to the surrounding Worker, returning an
107
- * Effect-native client with access to the native Workers runtime binding.
115
+ * Bind an existing `Images` marker to the surrounding Worker, returning the
116
+ * Effect-native client. Equivalent to `yield* images` — prefer yielding the
117
+ * marker directly.
108
118
  */
109
119
  bind: typeof ImagesBinding.bind;
110
120
  } = Object.assign(
111
- Effect.fn(function* (props?: ImagesProps) {
112
- return {
121
+ (props?: ImagesProps): Images => {
122
+ const self: Images = {
113
123
  kind: ImagesTypeId,
114
124
  name: props?.name ?? "IMAGES",
115
- } satisfies Images;
116
- }),
125
+ asEffect: () => ImagesBinding.bind(self),
126
+ [Symbol.iterator]: () => new SingleShotGen(ImagesBinding.bind(self)),
127
+ };
128
+ return self;
129
+ },
117
130
  {
118
131
  bind: (...args: Parameters<typeof ImagesBinding.bind>) =>
119
132
  ImagesBinding.bind(...args),