domainkit 0.2.2 → 0.3.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.
Files changed (58) hide show
  1. package/README.md +26 -26
  2. package/dist/index.d.mts +639 -187
  3. package/dist/index.mjs +301 -300
  4. package/dist/index.mjs.map +1 -1
  5. package/dist/promise.d.mts +464 -0
  6. package/dist/promise.mjs +636 -0
  7. package/dist/promise.mjs.map +1 -0
  8. package/dist/{resolver-CxE-VDw4.mjs → resolver-CvK7JoJM.mjs} +401 -54
  9. package/dist/resolver-CvK7JoJM.mjs.map +1 -0
  10. package/dist/{resolver-Dc0hwV-J.d.mts → resolver-uqe1h5Vz.d.mts} +1513 -25
  11. package/dist/testing.d.mts +4 -5
  12. package/dist/testing.mjs +17 -3
  13. package/dist/testing.mjs.map +1 -1
  14. package/dist/verify-B00c81-n.mjs +2420 -0
  15. package/dist/verify-B00c81-n.mjs.map +1 -0
  16. package/dist/{verify-Dls29YC-.d.mts → verify-CkgVrwyl.d.mts} +318 -21
  17. package/package.json +6 -30
  18. package/dist/auth-BR-19zj-.mjs +0 -738
  19. package/dist/auth-BR-19zj-.mjs.map +0 -1
  20. package/dist/auth-g-waCHcz.mjs +0 -671
  21. package/dist/auth-g-waCHcz.mjs.map +0 -1
  22. package/dist/authorization-OeaSR47S.mjs +0 -284
  23. package/dist/authorization-OeaSR47S.mjs.map +0 -1
  24. package/dist/canonical-json-CpvqGMcr.mjs +0 -57
  25. package/dist/canonical-json-CpvqGMcr.mjs.map +0 -1
  26. package/dist/cloudflare-BrZPU9li.d.mts +0 -32
  27. package/dist/cloudflare-CGmasR8A.mjs +0 -69
  28. package/dist/cloudflare-CGmasR8A.mjs.map +0 -1
  29. package/dist/cloudflare.d.mts +0 -3
  30. package/dist/cloudflare.mjs +0 -2
  31. package/dist/connection-BfkloPZy.d.mts +0 -186
  32. package/dist/connection-BwtOwpH6.mjs +0 -195
  33. package/dist/connection-BwtOwpH6.mjs.map +0 -1
  34. package/dist/connection-CjNQe_E-.mjs +0 -58
  35. package/dist/connection-CjNQe_E-.mjs.map +0 -1
  36. package/dist/connection-api-DNuEZ_jR.d.mts +0 -7
  37. package/dist/dns-record-BLeqo56C.mjs +0 -289
  38. package/dist/dns-record-BLeqo56C.mjs.map +0 -1
  39. package/dist/effect-cloudflare.d.mts +0 -2
  40. package/dist/effect-cloudflare.mjs +0 -2
  41. package/dist/effect-vercel.d.mts +0 -2
  42. package/dist/effect-vercel.mjs +0 -2
  43. package/dist/effect.d.mts +0 -36
  44. package/dist/effect.mjs +0 -51
  45. package/dist/effect.mjs.map +0 -1
  46. package/dist/index-BHWRTThN.d.mts +0 -159
  47. package/dist/index-D3PVknwE.d.mts +0 -145
  48. package/dist/resolver-CxE-VDw4.mjs.map +0 -1
  49. package/dist/vercel-BsNDu4Np.d.mts +0 -31
  50. package/dist/vercel-CfoJaaCu.mjs +0 -60
  51. package/dist/vercel-CfoJaaCu.mjs.map +0 -1
  52. package/dist/vercel.d.mts +0 -3
  53. package/dist/vercel.mjs +0 -2
  54. package/dist/verify-BKbvq7IN.mjs +0 -642
  55. package/dist/verify-BKbvq7IN.mjs.map +0 -1
  56. package/dist/zone-discovery-BPnH3sLU.d.mts +0 -1397
  57. package/dist/zones-DKHTpX9C.mjs +0 -19
  58. package/dist/zones-DKHTpX9C.mjs.map +0 -1
@@ -1,5 +1,1493 @@
1
- import { At as Type, Ft as DomainName, X as CryptoError, bt as DnsRecord, ft as Error$3, mt as Service$1, n as Service$2, t as Candidate, xt as Encoded, zt as Error$2 } from "./zone-discovery-BPnH3sLU.mjs";
2
1
  import { Cause, Context, Crypto, Data, Effect, Layer, Schema } from "effect";
2
+ import * as oauth from "oauth4webapi";
3
+ declare namespace invalid_input_d_exports {
4
+ export { Error$5 as Error };
5
+ }
6
+ declare const Error_base$5: Schema.Class<Error$5, Schema.TaggedStruct<"InvalidInputError", {
7
+ readonly message: Schema.String;
8
+ }>, import("effect/Cause").YieldableError>;
9
+ declare class Error$5 extends Error_base$5 {}
10
+ declare namespace domain_name_d_exports {
11
+ export { DomainName, Schema$6 as Schema, decode$6 as decode, parse$1 as parse };
12
+ }
13
+ declare const Type$1: Schema.brand<Schema.String, "DomainName">;
14
+ /** A lower-case, fully qualified DNS name without a trailing dot. */
15
+ type DomainName = typeof Type$1.Type;
16
+ /** Decodes user and wire strings into canonical domain names. */
17
+ declare const Schema$6: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
18
+ declare const decode$6: (input: unknown) => Effect.Effect<string & import("effect/Brand").Brand<"DomainName">, Error$5, never>;
19
+ declare function parse$1(input: unknown): DomainName;
20
+ declare namespace secret_d_exports {
21
+ export { Value, make$1 as make };
22
+ }
23
+ /** A deliberately non-serializable credential value. */
24
+ declare class Value {
25
+ #private;
26
+ private constructor();
27
+ static from(value: string): Value;
28
+ expose(): string;
29
+ toJSON(): string;
30
+ toString(): string;
31
+ }
32
+ declare const make$1: typeof Value.from;
33
+ declare namespace dns_record_d_exports {
34
+ export { A, Aaaa, Caa, Cname, DnsRecord, Encoded, Mx, Ns, Observed, Opaque, RequirementMetadata, Schema$5 as Schema, Srv, Txt, Type, data, decode$5 as decode, equals, parse };
35
+ }
36
+ declare const Type: Schema.Literals<readonly ["A", "AAAA", "CNAME", "TXT", "MX", "CAA", "NS", "SRV"]>;
37
+ type Type = typeof Type.Type;
38
+ declare const RequirementMetadata: Schema.Struct<{
39
+ readonly ownership: Schema.String;
40
+ readonly provenance: Schema.String;
41
+ readonly purpose: Schema.String;
42
+ }>;
43
+ interface RequirementMetadata extends Schema.Schema.Type<typeof RequirementMetadata> {}
44
+ declare const Schema$5: Schema.TaggedUnion<{
45
+ readonly A: Schema.TaggedStruct<"A", {
46
+ readonly metadata: Schema.Struct<{
47
+ readonly ownership: Schema.String;
48
+ readonly provenance: Schema.String;
49
+ readonly purpose: Schema.String;
50
+ }>;
51
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
52
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
53
+ readonly ttl: Schema.NullOr<Schema.Int>;
54
+ readonly address: Schema.String;
55
+ }>;
56
+ readonly AAAA: Schema.TaggedStruct<"AAAA", {
57
+ readonly metadata: Schema.Struct<{
58
+ readonly ownership: Schema.String;
59
+ readonly provenance: Schema.String;
60
+ readonly purpose: Schema.String;
61
+ }>;
62
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
63
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
64
+ readonly ttl: Schema.NullOr<Schema.Int>;
65
+ readonly address: Schema.String;
66
+ }>;
67
+ readonly CAA: Schema.TaggedStruct<"CAA", {
68
+ readonly metadata: Schema.Struct<{
69
+ readonly ownership: Schema.String;
70
+ readonly provenance: Schema.String;
71
+ readonly purpose: Schema.String;
72
+ }>;
73
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
74
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
75
+ readonly ttl: Schema.NullOr<Schema.Int>;
76
+ readonly flags: Schema.Int;
77
+ readonly tag: Schema.Literals<readonly ["issue", "issuewild", "iodef"]>;
78
+ readonly value: Schema.String;
79
+ }>;
80
+ readonly CNAME: Schema.TaggedStruct<"CNAME", {
81
+ readonly metadata: Schema.Struct<{
82
+ readonly ownership: Schema.String;
83
+ readonly provenance: Schema.String;
84
+ readonly purpose: Schema.String;
85
+ }>;
86
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
87
+ readonly ttl: Schema.NullOr<Schema.Int>;
88
+ readonly policy: Schema.Literal<"exclusive">;
89
+ readonly target: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
90
+ }>;
91
+ readonly MX: Schema.TaggedStruct<"MX", {
92
+ readonly metadata: Schema.Struct<{
93
+ readonly ownership: Schema.String;
94
+ readonly provenance: Schema.String;
95
+ readonly purpose: Schema.String;
96
+ }>;
97
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
98
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
99
+ readonly ttl: Schema.NullOr<Schema.Int>;
100
+ readonly exchange: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
101
+ readonly priority: Schema.Int;
102
+ }>;
103
+ readonly NS: Schema.TaggedStruct<"NS", {
104
+ readonly metadata: Schema.Struct<{
105
+ readonly ownership: Schema.String;
106
+ readonly provenance: Schema.String;
107
+ readonly purpose: Schema.String;
108
+ }>;
109
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
110
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
111
+ readonly ttl: Schema.NullOr<Schema.Int>;
112
+ readonly target: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
113
+ }>;
114
+ readonly SRV: Schema.TaggedStruct<"SRV", {
115
+ readonly metadata: Schema.Struct<{
116
+ readonly ownership: Schema.String;
117
+ readonly provenance: Schema.String;
118
+ readonly purpose: Schema.String;
119
+ }>;
120
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
121
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
122
+ readonly ttl: Schema.NullOr<Schema.Int>;
123
+ readonly port: Schema.Int;
124
+ readonly priority: Schema.Int;
125
+ readonly target: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
126
+ readonly weight: Schema.Int;
127
+ }>;
128
+ readonly TXT: Schema.TaggedStruct<"TXT", {
129
+ readonly metadata: Schema.Struct<{
130
+ readonly ownership: Schema.String;
131
+ readonly provenance: Schema.String;
132
+ readonly purpose: Schema.String;
133
+ }>;
134
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
135
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
136
+ readonly ttl: Schema.NullOr<Schema.Int>;
137
+ readonly value: Schema.String;
138
+ }>;
139
+ }>;
140
+ declare const A: Schema.TaggedStruct<"A", {
141
+ readonly metadata: Schema.Struct<{
142
+ readonly ownership: Schema.String;
143
+ readonly provenance: Schema.String;
144
+ readonly purpose: Schema.String;
145
+ }>;
146
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
147
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
148
+ readonly ttl: Schema.NullOr<Schema.Int>;
149
+ readonly address: Schema.String;
150
+ }>, Aaaa: Schema.TaggedStruct<"AAAA", {
151
+ readonly metadata: Schema.Struct<{
152
+ readonly ownership: Schema.String;
153
+ readonly provenance: Schema.String;
154
+ readonly purpose: Schema.String;
155
+ }>;
156
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
157
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
158
+ readonly ttl: Schema.NullOr<Schema.Int>;
159
+ readonly address: Schema.String;
160
+ }>, Caa: Schema.TaggedStruct<"CAA", {
161
+ readonly metadata: Schema.Struct<{
162
+ readonly ownership: Schema.String;
163
+ readonly provenance: Schema.String;
164
+ readonly purpose: Schema.String;
165
+ }>;
166
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
167
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
168
+ readonly ttl: Schema.NullOr<Schema.Int>;
169
+ readonly flags: Schema.Int;
170
+ readonly tag: Schema.Literals<readonly ["issue", "issuewild", "iodef"]>;
171
+ readonly value: Schema.String;
172
+ }>, Cname: Schema.TaggedStruct<"CNAME", {
173
+ readonly metadata: Schema.Struct<{
174
+ readonly ownership: Schema.String;
175
+ readonly provenance: Schema.String;
176
+ readonly purpose: Schema.String;
177
+ }>;
178
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
179
+ readonly ttl: Schema.NullOr<Schema.Int>;
180
+ readonly policy: Schema.Literal<"exclusive">;
181
+ readonly target: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
182
+ }>, Mx: Schema.TaggedStruct<"MX", {
183
+ readonly metadata: Schema.Struct<{
184
+ readonly ownership: Schema.String;
185
+ readonly provenance: Schema.String;
186
+ readonly purpose: Schema.String;
187
+ }>;
188
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
189
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
190
+ readonly ttl: Schema.NullOr<Schema.Int>;
191
+ readonly exchange: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
192
+ readonly priority: Schema.Int;
193
+ }>, Ns: Schema.TaggedStruct<"NS", {
194
+ readonly metadata: Schema.Struct<{
195
+ readonly ownership: Schema.String;
196
+ readonly provenance: Schema.String;
197
+ readonly purpose: Schema.String;
198
+ }>;
199
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
200
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
201
+ readonly ttl: Schema.NullOr<Schema.Int>;
202
+ readonly target: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
203
+ }>, Srv: Schema.TaggedStruct<"SRV", {
204
+ readonly metadata: Schema.Struct<{
205
+ readonly ownership: Schema.String;
206
+ readonly provenance: Schema.String;
207
+ readonly purpose: Schema.String;
208
+ }>;
209
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
210
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
211
+ readonly ttl: Schema.NullOr<Schema.Int>;
212
+ readonly port: Schema.Int;
213
+ readonly priority: Schema.Int;
214
+ readonly target: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
215
+ readonly weight: Schema.Int;
216
+ }>, Txt: Schema.TaggedStruct<"TXT", {
217
+ readonly metadata: Schema.Struct<{
218
+ readonly ownership: Schema.String;
219
+ readonly provenance: Schema.String;
220
+ readonly purpose: Schema.String;
221
+ }>;
222
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
223
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
224
+ readonly ttl: Schema.NullOr<Schema.Int>;
225
+ readonly value: Schema.String;
226
+ }>;
227
+ type DnsRecord = typeof Schema$5.Type;
228
+ type Encoded = typeof Schema$5.Encoded;
229
+ /** Provider state that DomainKit cannot create but must retain for safe reconciliation. */
230
+ declare const Opaque: Schema.Struct<{
231
+ readonly _tag: Schema.Literal<"Opaque">;
232
+ readonly name: Schema.String;
233
+ readonly providerRecordId: Schema.NullOr<Schema.String>;
234
+ readonly providerType: Schema.String;
235
+ }>;
236
+ interface Opaque extends Schema.Schema.Type<typeof Opaque> {}
237
+ /** Any DNS record observed through a provider, including non-portable record types. */
238
+ declare const Observed: Schema.Union<readonly [Schema.TaggedUnion<{
239
+ readonly A: Schema.TaggedStruct<"A", {
240
+ readonly metadata: Schema.Struct<{
241
+ readonly ownership: Schema.String;
242
+ readonly provenance: Schema.String;
243
+ readonly purpose: Schema.String;
244
+ }>;
245
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
246
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
247
+ readonly ttl: Schema.NullOr<Schema.Int>;
248
+ readonly address: Schema.String;
249
+ }>;
250
+ readonly AAAA: Schema.TaggedStruct<"AAAA", {
251
+ readonly metadata: Schema.Struct<{
252
+ readonly ownership: Schema.String;
253
+ readonly provenance: Schema.String;
254
+ readonly purpose: Schema.String;
255
+ }>;
256
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
257
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
258
+ readonly ttl: Schema.NullOr<Schema.Int>;
259
+ readonly address: Schema.String;
260
+ }>;
261
+ readonly CAA: Schema.TaggedStruct<"CAA", {
262
+ readonly metadata: Schema.Struct<{
263
+ readonly ownership: Schema.String;
264
+ readonly provenance: Schema.String;
265
+ readonly purpose: Schema.String;
266
+ }>;
267
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
268
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
269
+ readonly ttl: Schema.NullOr<Schema.Int>;
270
+ readonly flags: Schema.Int;
271
+ readonly tag: Schema.Literals<readonly ["issue", "issuewild", "iodef"]>;
272
+ readonly value: Schema.String;
273
+ }>;
274
+ readonly CNAME: Schema.TaggedStruct<"CNAME", {
275
+ readonly metadata: Schema.Struct<{
276
+ readonly ownership: Schema.String;
277
+ readonly provenance: Schema.String;
278
+ readonly purpose: Schema.String;
279
+ }>;
280
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
281
+ readonly ttl: Schema.NullOr<Schema.Int>;
282
+ readonly policy: Schema.Literal<"exclusive">;
283
+ readonly target: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
284
+ }>;
285
+ readonly MX: Schema.TaggedStruct<"MX", {
286
+ readonly metadata: Schema.Struct<{
287
+ readonly ownership: Schema.String;
288
+ readonly provenance: Schema.String;
289
+ readonly purpose: Schema.String;
290
+ }>;
291
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
292
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
293
+ readonly ttl: Schema.NullOr<Schema.Int>;
294
+ readonly exchange: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
295
+ readonly priority: Schema.Int;
296
+ }>;
297
+ readonly NS: Schema.TaggedStruct<"NS", {
298
+ readonly metadata: Schema.Struct<{
299
+ readonly ownership: Schema.String;
300
+ readonly provenance: Schema.String;
301
+ readonly purpose: Schema.String;
302
+ }>;
303
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
304
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
305
+ readonly ttl: Schema.NullOr<Schema.Int>;
306
+ readonly target: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
307
+ }>;
308
+ readonly SRV: Schema.TaggedStruct<"SRV", {
309
+ readonly metadata: Schema.Struct<{
310
+ readonly ownership: Schema.String;
311
+ readonly provenance: Schema.String;
312
+ readonly purpose: Schema.String;
313
+ }>;
314
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
315
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
316
+ readonly ttl: Schema.NullOr<Schema.Int>;
317
+ readonly port: Schema.Int;
318
+ readonly priority: Schema.Int;
319
+ readonly target: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
320
+ readonly weight: Schema.Int;
321
+ }>;
322
+ readonly TXT: Schema.TaggedStruct<"TXT", {
323
+ readonly metadata: Schema.Struct<{
324
+ readonly ownership: Schema.String;
325
+ readonly provenance: Schema.String;
326
+ readonly purpose: Schema.String;
327
+ }>;
328
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
329
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
330
+ readonly ttl: Schema.NullOr<Schema.Int>;
331
+ readonly value: Schema.String;
332
+ }>;
333
+ }>, Schema.Struct<{
334
+ readonly _tag: Schema.Literal<"Opaque">;
335
+ readonly name: Schema.String;
336
+ readonly providerRecordId: Schema.NullOr<Schema.String>;
337
+ readonly providerType: Schema.String;
338
+ }>]>;
339
+ type Observed = typeof Observed.Type;
340
+ declare const decode$5: (input: unknown) => Effect.Effect<{
341
+ readonly _tag: "A";
342
+ readonly metadata: {
343
+ readonly ownership: string;
344
+ readonly provenance: string;
345
+ readonly purpose: string;
346
+ };
347
+ readonly name: string & import("effect/Brand").Brand<"DomainName">;
348
+ readonly policy: "append" | "exclusive";
349
+ readonly ttl: number | null;
350
+ readonly address: string;
351
+ } | {
352
+ readonly _tag: "AAAA";
353
+ readonly metadata: {
354
+ readonly ownership: string;
355
+ readonly provenance: string;
356
+ readonly purpose: string;
357
+ };
358
+ readonly name: string & import("effect/Brand").Brand<"DomainName">;
359
+ readonly policy: "append" | "exclusive";
360
+ readonly ttl: number | null;
361
+ readonly address: string;
362
+ } | {
363
+ readonly _tag: "CAA";
364
+ readonly metadata: {
365
+ readonly ownership: string;
366
+ readonly provenance: string;
367
+ readonly purpose: string;
368
+ };
369
+ readonly name: string & import("effect/Brand").Brand<"DomainName">;
370
+ readonly policy: "append" | "exclusive";
371
+ readonly ttl: number | null;
372
+ readonly flags: number;
373
+ readonly tag: "iodef" | "issue" | "issuewild";
374
+ readonly value: string;
375
+ } | {
376
+ readonly _tag: "CNAME";
377
+ readonly metadata: {
378
+ readonly ownership: string;
379
+ readonly provenance: string;
380
+ readonly purpose: string;
381
+ };
382
+ readonly name: string & import("effect/Brand").Brand<"DomainName">;
383
+ readonly ttl: number | null;
384
+ readonly policy: "exclusive";
385
+ readonly target: string & import("effect/Brand").Brand<"DomainName">;
386
+ } | {
387
+ readonly _tag: "MX";
388
+ readonly metadata: {
389
+ readonly ownership: string;
390
+ readonly provenance: string;
391
+ readonly purpose: string;
392
+ };
393
+ readonly name: string & import("effect/Brand").Brand<"DomainName">;
394
+ readonly policy: "append" | "exclusive";
395
+ readonly ttl: number | null;
396
+ readonly exchange: string & import("effect/Brand").Brand<"DomainName">;
397
+ readonly priority: number;
398
+ } | {
399
+ readonly _tag: "NS";
400
+ readonly metadata: {
401
+ readonly ownership: string;
402
+ readonly provenance: string;
403
+ readonly purpose: string;
404
+ };
405
+ readonly name: string & import("effect/Brand").Brand<"DomainName">;
406
+ readonly policy: "append" | "exclusive";
407
+ readonly ttl: number | null;
408
+ readonly target: string & import("effect/Brand").Brand<"DomainName">;
409
+ } | {
410
+ readonly _tag: "SRV";
411
+ readonly metadata: {
412
+ readonly ownership: string;
413
+ readonly provenance: string;
414
+ readonly purpose: string;
415
+ };
416
+ readonly name: string & import("effect/Brand").Brand<"DomainName">;
417
+ readonly policy: "append" | "exclusive";
418
+ readonly ttl: number | null;
419
+ readonly port: number;
420
+ readonly priority: number;
421
+ readonly target: string & import("effect/Brand").Brand<"DomainName">;
422
+ readonly weight: number;
423
+ } | {
424
+ readonly _tag: "TXT";
425
+ readonly metadata: {
426
+ readonly ownership: string;
427
+ readonly provenance: string;
428
+ readonly purpose: string;
429
+ };
430
+ readonly name: string & import("effect/Brand").Brand<"DomainName">;
431
+ readonly policy: "append" | "exclusive";
432
+ readonly ttl: number | null;
433
+ readonly value: string;
434
+ }, Error$5, never>;
435
+ declare function parse(input: unknown): DnsRecord;
436
+ declare function data(record: DnsRecord): Readonly<Record<string, number | string>>;
437
+ declare function equals(left: DnsRecord, right: DnsRecord): boolean;
438
+ declare namespace provider_d_exports {
439
+ export { AsyncInterface$1 as AsyncInterface, CreateResult$1 as CreateResult, Error$4 as Error, ErrorReason, Interface$3 as Interface, Service$3 as Service, fromAsync, layerFromAsync$1 as layerFromAsync, toAsync$1 as toAsync };
440
+ }
441
+ interface CreateResult$1 {
442
+ readonly providerRecordId: string | null;
443
+ }
444
+ declare const ErrorReason: Schema.Literals<readonly ["authentication", "authorization", "conflict", "not_found", "rate_limit", "request", "response", "transport", "unsupported"]>;
445
+ type ErrorReason = typeof ErrorReason.Type;
446
+ declare const Error_base$4: Schema.Class<Error$4, Schema.TaggedStruct<"ProviderError", {
447
+ readonly cause: Schema.optionalKey<Schema.Unknown>;
448
+ readonly code: Schema.optionalKey<Schema.Union<readonly [Schema.Number, Schema.String]>>;
449
+ readonly message: Schema.String;
450
+ readonly operation: Schema.String;
451
+ readonly providerId: Schema.String;
452
+ readonly reason: Schema.optionalKey<Schema.Literals<readonly ["authentication", "authorization", "conflict", "not_found", "rate_limit", "request", "response", "transport", "unsupported"]>>;
453
+ readonly retryAfterMs: Schema.optionalKey<Schema.Number>;
454
+ readonly status: Schema.optionalKey<Schema.Number>;
455
+ }>, import("effect/Cause").YieldableError>;
456
+ declare class Error$4 extends Error_base$4 {}
457
+ /** The provider capability used by DNS planning, application, and verification. */
458
+ interface Interface$3 {
459
+ readonly id: string;
460
+ readonly createRecord: (zone: DomainName, record: DnsRecord) => Effect.Effect<CreateResult$1, Error$4>;
461
+ readonly deleteRecord: (zone: DomainName, providerRecordId: string) => Effect.Effect<void, Error$4>;
462
+ readonly getRecord: (zone: DomainName, providerRecordId: string) => Effect.Effect<Observed | null, Error$4>;
463
+ readonly listRecords: (zone: DomainName) => Effect.Effect<ReadonlyArray<Observed>, Error$4>;
464
+ }
465
+ declare const Service_base$3: Context.ServiceClass<Service$3, "@domainkit/DnsProvider", Interface$3>;
466
+ declare class Service$3 extends Service_base$3 {}
467
+ /** Minimal Promise-shaped provider contract for hosts that do not use Effect directly. */
468
+ interface AsyncInterface$1 {
469
+ readonly id: string;
470
+ readonly createRecord: (zone: DomainName, record: DnsRecord) => Promise<CreateResult$1>;
471
+ readonly deleteRecord: (zone: DomainName, providerRecordId: string) => Promise<void>;
472
+ readonly getRecord: (zone: DomainName, providerRecordId: string) => Promise<Observed | null>;
473
+ readonly listRecords: (zone: DomainName) => Promise<ReadonlyArray<Observed>>;
474
+ }
475
+ declare const fromAsync: (provider: AsyncInterface$1) => Interface$3;
476
+ declare const layerFromAsync$1: (provider: AsyncInterface$1) => Layer.Layer<Service$3>;
477
+ declare const toAsync$1: (provider: Interface$3) => AsyncInterface$1;
478
+ declare namespace manifest_d_exports {
479
+ export { AsyncOAuthSubjectResolver, IntegrationMethod, Manifest, Method$1 as Method, OAuthClientConfiguration, OAuthMethod, OAuthSubjectResolver, Schema$4 as Schema, TokenValidation, decode$4 as decode };
480
+ }
481
+ declare const Method$1: Schema.TaggedUnion<{
482
+ readonly integration: Schema.TaggedStruct<"integration", {
483
+ readonly capabilities: Schema.$Array<Schema.Literals<readonly ["dns:read", "dns:write"]>>;
484
+ readonly installUrl: Schema.String;
485
+ readonly tokenEndpoint: Schema.String;
486
+ }>;
487
+ readonly oauth2: Schema.TaggedStruct<"oauth2", {
488
+ readonly authorizationServer: Schema.Struct<{
489
+ readonly authorization_endpoint: Schema.String;
490
+ readonly issuer: Schema.String;
491
+ readonly revocation_endpoint: Schema.optionalKey<Schema.String>;
492
+ readonly token_endpoint: Schema.String;
493
+ }>;
494
+ readonly capabilities: Schema.$Array<Schema.Literals<readonly ["dns:read", "dns:write"]>>;
495
+ readonly clientAuth: Schema.Literals<readonly ["none", "client_secret_basic", "client_secret_post"]>;
496
+ readonly scopes: Schema.$Array<Schema.String>;
497
+ }>;
498
+ readonly token: Schema.TaggedStruct<"token", {
499
+ readonly capabilities: Schema.$Array<Schema.Literals<readonly ["dns:read", "dns:write"]>>;
500
+ readonly instructionsUrl: Schema.String;
501
+ }>;
502
+ }>;
503
+ declare const Schema$4: Schema.Struct<{
504
+ readonly methods: Schema.$Array<Schema.TaggedUnion<{
505
+ readonly integration: Schema.TaggedStruct<"integration", {
506
+ readonly capabilities: Schema.$Array<Schema.Literals<readonly ["dns:read", "dns:write"]>>;
507
+ readonly installUrl: Schema.String;
508
+ readonly tokenEndpoint: Schema.String;
509
+ }>;
510
+ readonly oauth2: Schema.TaggedStruct<"oauth2", {
511
+ readonly authorizationServer: Schema.Struct<{
512
+ readonly authorization_endpoint: Schema.String;
513
+ readonly issuer: Schema.String;
514
+ readonly revocation_endpoint: Schema.optionalKey<Schema.String>;
515
+ readonly token_endpoint: Schema.String;
516
+ }>;
517
+ readonly capabilities: Schema.$Array<Schema.Literals<readonly ["dns:read", "dns:write"]>>;
518
+ readonly clientAuth: Schema.Literals<readonly ["none", "client_secret_basic", "client_secret_post"]>;
519
+ readonly scopes: Schema.$Array<Schema.String>;
520
+ }>;
521
+ readonly token: Schema.TaggedStruct<"token", {
522
+ readonly capabilities: Schema.$Array<Schema.Literals<readonly ["dns:read", "dns:write"]>>;
523
+ readonly instructionsUrl: Schema.String;
524
+ }>;
525
+ }>>;
526
+ readonly providerId: Schema.String;
527
+ }>;
528
+ interface Manifest extends Schema.Schema.Type<typeof Schema$4> {}
529
+ type OAuthMethod = Extract<Manifest["methods"][number], {
530
+ readonly _tag: "oauth2";
531
+ }>;
532
+ /** A provider-owned installation flow that returns a credential from a one-time code. */
533
+ type IntegrationMethod = Extract<Manifest["methods"][number], {
534
+ readonly _tag: "integration";
535
+ }>;
536
+ declare const decode$4: (input: unknown) => Effect.Effect<{
537
+ readonly methods: readonly ({
538
+ readonly _tag: "integration";
539
+ readonly capabilities: readonly ("dns:read" | "dns:write")[];
540
+ readonly installUrl: string;
541
+ readonly tokenEndpoint: string;
542
+ } | {
543
+ readonly _tag: "oauth2";
544
+ readonly authorizationServer: {
545
+ readonly authorization_endpoint: string;
546
+ readonly issuer: string;
547
+ readonly revocation_endpoint?: string;
548
+ readonly token_endpoint: string;
549
+ };
550
+ readonly capabilities: readonly ("dns:read" | "dns:write")[];
551
+ readonly clientAuth: "client_secret_basic" | "client_secret_post" | "none";
552
+ readonly scopes: readonly string[];
553
+ } | {
554
+ readonly _tag: "token";
555
+ readonly capabilities: readonly ("dns:read" | "dns:write")[];
556
+ readonly instructionsUrl: string;
557
+ })[];
558
+ readonly providerId: string;
559
+ }, Error$5, never>;
560
+ interface OAuthClientConfiguration {
561
+ readonly clientId: string;
562
+ readonly clientSecret?: Value;
563
+ }
564
+ interface TokenValidation {
565
+ readonly accountId: string;
566
+ readonly capabilities: ReadonlyArray<"dns:read" | "dns:write">;
567
+ readonly expiresAt: Date | null;
568
+ readonly scopes: ReadonlyArray<string>;
569
+ }
570
+ interface OAuthSubjectResolver {
571
+ (tokens: oauth.TokenEndpointResponse, accessToken: Value): Effect.Effect<{
572
+ readonly accountId: string;
573
+ readonly expiresAt: Date | null;
574
+ }, Error$4>;
575
+ }
576
+ interface AsyncOAuthSubjectResolver {
577
+ (tokens: oauth.TokenEndpointResponse, accessToken: Value): Promise<{
578
+ readonly accountId: string;
579
+ readonly expiresAt: Date | null;
580
+ }>;
581
+ }
582
+ declare namespace authorization_d_exports {
583
+ export { Capability, CapabilityEvidence, Evidence, EvidenceSchema, ProviderAuthorization, Revocation, Schema$3 as Schema, decode$3 as decode, encode$3 as encode, evidenceFor, validate$3 as validate };
584
+ }
585
+ declare const Capability: Schema.Literals<readonly ["dns:read", "dns:write"]>;
586
+ type Capability = typeof Capability.Type;
587
+ type Evidence = Data.TaggedEnum<{
588
+ Declared: {};
589
+ Exercised: {
590
+ readonly observedAt: Date;
591
+ };
592
+ Introspected: {
593
+ readonly observedAt: Date;
594
+ };
595
+ }>;
596
+ declare const Evidence: {
597
+ readonly $is: <Tag extends "Declared" | "Exercised" | "Introspected">(tag: Tag) => (u: unknown) => u is Extract<{
598
+ readonly _tag: "Declared";
599
+ }, {
600
+ readonly _tag: Tag;
601
+ }> | Extract<{
602
+ readonly _tag: "Exercised";
603
+ readonly observedAt: Date;
604
+ }, {
605
+ readonly _tag: Tag;
606
+ }> | Extract<{
607
+ readonly _tag: "Introspected";
608
+ readonly observedAt: Date;
609
+ }, {
610
+ readonly _tag: Tag;
611
+ }>;
612
+ readonly $match: {
613
+ <Cases extends { readonly [Tag in "Declared" | "Exercised" | "Introspected"]: (args: Extract<{
614
+ readonly _tag: "Declared";
615
+ } | {
616
+ readonly _tag: "Exercised";
617
+ readonly observedAt: Date;
618
+ } | {
619
+ readonly _tag: "Introspected";
620
+ readonly observedAt: Date;
621
+ }, {
622
+ readonly _tag: Tag;
623
+ }>) => any; }>(cases: Cases): (value: {
624
+ readonly _tag: "Declared";
625
+ } | {
626
+ readonly _tag: "Exercised";
627
+ readonly observedAt: Date;
628
+ } | {
629
+ readonly _tag: "Introspected";
630
+ readonly observedAt: Date;
631
+ }) => import("effect/Unify").Unify<ReturnType<Cases["Declared" | "Exercised" | "Introspected"]>>;
632
+ <Cases extends { readonly [Tag in "Declared" | "Exercised" | "Introspected"]: (args: Extract<{
633
+ readonly _tag: "Declared";
634
+ } | {
635
+ readonly _tag: "Exercised";
636
+ readonly observedAt: Date;
637
+ } | {
638
+ readonly _tag: "Introspected";
639
+ readonly observedAt: Date;
640
+ }, {
641
+ readonly _tag: Tag;
642
+ }>) => any; }>(value: {
643
+ readonly _tag: "Declared";
644
+ } | {
645
+ readonly _tag: "Exercised";
646
+ readonly observedAt: Date;
647
+ } | {
648
+ readonly _tag: "Introspected";
649
+ readonly observedAt: Date;
650
+ }, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Declared" | "Exercised" | "Introspected"]>>;
651
+ };
652
+ readonly Declared: Data.TaggedEnum.ConstructorFrom<{
653
+ readonly _tag: "Declared";
654
+ }, "_tag">;
655
+ readonly Exercised: Data.TaggedEnum.ConstructorFrom<{
656
+ readonly _tag: "Exercised";
657
+ readonly observedAt: Date;
658
+ }, "_tag">;
659
+ readonly Introspected: Data.TaggedEnum.ConstructorFrom<{
660
+ readonly _tag: "Introspected";
661
+ readonly observedAt: Date;
662
+ }, "_tag">;
663
+ };
664
+ declare const EvidenceSchema: Schema.TaggedUnion<{
665
+ readonly Declared: Schema.TaggedStruct<"Declared", {}>;
666
+ readonly Exercised: Schema.TaggedStruct<"Exercised", {
667
+ readonly observedAt: Schema.DateFromString;
668
+ }>;
669
+ readonly Introspected: Schema.TaggedStruct<"Introspected", {
670
+ readonly observedAt: Schema.DateFromString;
671
+ }>;
672
+ }>;
673
+ declare const CapabilityEvidence: Schema.Struct<{
674
+ readonly capability: Schema.Literals<readonly ["dns:read", "dns:write"]>;
675
+ readonly evidence: Schema.TaggedUnion<{
676
+ readonly Declared: Schema.TaggedStruct<"Declared", {}>;
677
+ readonly Exercised: Schema.TaggedStruct<"Exercised", {
678
+ readonly observedAt: Schema.DateFromString;
679
+ }>;
680
+ readonly Introspected: Schema.TaggedStruct<"Introspected", {
681
+ readonly observedAt: Schema.DateFromString;
682
+ }>;
683
+ }>;
684
+ }>;
685
+ interface CapabilityEvidence extends Schema.Schema.Type<typeof CapabilityEvidence> {}
686
+ declare const Revocation: Schema.TaggedUnion<{
687
+ readonly Active: Schema.TaggedStruct<"Active", {}>;
688
+ readonly Pending: Schema.TaggedStruct<"Pending", {
689
+ readonly requestedAt: Schema.DateFromString;
690
+ }>;
691
+ }>;
692
+ type Revocation = typeof Revocation.Type;
693
+ /** A provider credential authorization shared by one or more owner connections. */
694
+ declare const Schema$3: Schema.Struct<{
695
+ readonly authorizedById: Schema.String;
696
+ readonly capabilityEvidence: Schema.$Array<Schema.Struct<{
697
+ readonly capability: Schema.Literals<readonly ["dns:read", "dns:write"]>;
698
+ readonly evidence: Schema.TaggedUnion<{
699
+ readonly Declared: Schema.TaggedStruct<"Declared", {}>;
700
+ readonly Exercised: Schema.TaggedStruct<"Exercised", {
701
+ readonly observedAt: Schema.DateFromString;
702
+ }>;
703
+ readonly Introspected: Schema.TaggedStruct<"Introspected", {
704
+ readonly observedAt: Schema.DateFromString;
705
+ }>;
706
+ }>;
707
+ }>>;
708
+ readonly createdAt: Schema.DateFromString;
709
+ readonly expiresAt: Schema.NullOr<Schema.DateFromString>;
710
+ readonly id: Schema.String;
711
+ readonly method: Schema.Literals<readonly ["integration", "oauth2", "token"]>;
712
+ readonly providerAccountId: Schema.String;
713
+ readonly providerContext: Schema.Struct<{
714
+ readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
715
+ readonly version: Schema.String;
716
+ }>;
717
+ readonly providerId: Schema.String;
718
+ readonly requiredCapabilities: Schema.$Array<Schema.Literals<readonly ["dns:read", "dns:write"]>>;
719
+ readonly revocation: Schema.TaggedUnion<{
720
+ readonly Active: Schema.TaggedStruct<"Active", {}>;
721
+ readonly Pending: Schema.TaggedStruct<"Pending", {
722
+ readonly requestedAt: Schema.DateFromString;
723
+ }>;
724
+ }>;
725
+ readonly scopes: Schema.$Array<Schema.String>;
726
+ }>;
727
+ interface ProviderAuthorization extends Schema.Schema.Type<typeof Schema$3> {}
728
+ declare const decode$3: (input: unknown) => Effect.Effect<{
729
+ readonly authorizedById: string;
730
+ readonly capabilityEvidence: readonly {
731
+ readonly capability: "dns:read" | "dns:write";
732
+ readonly evidence: {
733
+ readonly _tag: "Declared";
734
+ } | {
735
+ readonly _tag: "Exercised";
736
+ readonly observedAt: Date;
737
+ } | {
738
+ readonly _tag: "Introspected";
739
+ readonly observedAt: Date;
740
+ };
741
+ }[];
742
+ readonly createdAt: Date;
743
+ readonly expiresAt: Date | null;
744
+ readonly id: string;
745
+ readonly method: "integration" | "oauth2" | "token";
746
+ readonly providerAccountId: string;
747
+ readonly providerContext: {
748
+ readonly value: Schema.Json;
749
+ readonly version: string;
750
+ };
751
+ readonly providerId: string;
752
+ readonly requiredCapabilities: readonly ("dns:read" | "dns:write")[];
753
+ readonly revocation: {
754
+ readonly _tag: "Active";
755
+ } | {
756
+ readonly _tag: "Pending";
757
+ readonly requestedAt: Date;
758
+ };
759
+ readonly scopes: readonly string[];
760
+ }, Error$5, never>;
761
+ declare const validate$3: (input: unknown) => Effect.Effect<{
762
+ readonly authorizedById: string;
763
+ readonly capabilityEvidence: readonly {
764
+ readonly capability: "dns:read" | "dns:write";
765
+ readonly evidence: {
766
+ readonly _tag: "Declared";
767
+ } | {
768
+ readonly _tag: "Exercised";
769
+ readonly observedAt: Date;
770
+ } | {
771
+ readonly _tag: "Introspected";
772
+ readonly observedAt: Date;
773
+ };
774
+ }[];
775
+ readonly createdAt: Date;
776
+ readonly expiresAt: Date | null;
777
+ readonly id: string;
778
+ readonly method: "integration" | "oauth2" | "token";
779
+ readonly providerAccountId: string;
780
+ readonly providerContext: {
781
+ readonly value: Schema.Json;
782
+ readonly version: string;
783
+ };
784
+ readonly providerId: string;
785
+ readonly requiredCapabilities: readonly ("dns:read" | "dns:write")[];
786
+ readonly revocation: {
787
+ readonly _tag: "Active";
788
+ } | {
789
+ readonly _tag: "Pending";
790
+ readonly requestedAt: Date;
791
+ };
792
+ readonly scopes: readonly string[];
793
+ }, Error$5, never>;
794
+ declare const encode$3: (input: {
795
+ readonly authorizedById: string;
796
+ readonly capabilityEvidence: readonly {
797
+ readonly capability: "dns:read" | "dns:write";
798
+ readonly evidence: {
799
+ readonly _tag: "Declared";
800
+ } | {
801
+ readonly _tag: "Exercised";
802
+ readonly observedAt: Date;
803
+ } | {
804
+ readonly _tag: "Introspected";
805
+ readonly observedAt: Date;
806
+ };
807
+ }[];
808
+ readonly createdAt: Date;
809
+ readonly expiresAt: Date | null;
810
+ readonly id: string;
811
+ readonly method: "integration" | "oauth2" | "token";
812
+ readonly providerAccountId: string;
813
+ readonly providerContext: {
814
+ readonly value: Schema.Json;
815
+ readonly version: string;
816
+ };
817
+ readonly providerId: string;
818
+ readonly requiredCapabilities: readonly ("dns:read" | "dns:write")[];
819
+ readonly revocation: {
820
+ readonly _tag: "Active";
821
+ } | {
822
+ readonly _tag: "Pending";
823
+ readonly requestedAt: Date;
824
+ };
825
+ readonly scopes: readonly string[];
826
+ }, options?: import("effect/SchemaAST").ParseOptions) => {
827
+ readonly authorizedById: string;
828
+ readonly capabilityEvidence: readonly {
829
+ readonly capability: "dns:read" | "dns:write";
830
+ readonly evidence: {
831
+ readonly _tag: "Declared";
832
+ } | {
833
+ readonly _tag: "Exercised";
834
+ readonly observedAt: string;
835
+ } | {
836
+ readonly _tag: "Introspected";
837
+ readonly observedAt: string;
838
+ };
839
+ }[];
840
+ readonly createdAt: string;
841
+ readonly expiresAt: string | null;
842
+ readonly id: string;
843
+ readonly method: "integration" | "oauth2" | "token";
844
+ readonly providerAccountId: string;
845
+ readonly providerContext: {
846
+ readonly value: Schema.Json;
847
+ readonly version: string;
848
+ };
849
+ readonly providerId: string;
850
+ readonly requiredCapabilities: readonly ("dns:read" | "dns:write")[];
851
+ readonly revocation: {
852
+ readonly _tag: "Active";
853
+ } | {
854
+ readonly _tag: "Pending";
855
+ readonly requestedAt: string;
856
+ };
857
+ readonly scopes: readonly string[];
858
+ };
859
+ declare function evidenceFor(authorization: ProviderAuthorization, capability: Capability): Evidence | undefined;
860
+ //#endregion
861
+ //#region src/auth/connection.d.ts
862
+ declare const Grant: Schema.TaggedUnion<{
863
+ readonly account: Schema.TaggedStruct<"account", {
864
+ readonly excludedDomains: Schema.$Array<Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>>;
865
+ }>;
866
+ readonly domains: Schema.TaggedStruct<"domains", {
867
+ readonly domains: Schema.$Array<Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>>;
868
+ }>;
869
+ }>;
870
+ type Grant = typeof Grant.Type;
871
+ /** Returns whether a grant includes one parsed domain. */
872
+ declare const coversDomain: (grant: Grant, domain: DomainName) => boolean;
873
+ /** Expands a grant to include the requested domains. */
874
+ declare const includeDomains: (current: Grant | undefined, requested: Grant) => Grant;
875
+ /** Contracts a grant so it no longer includes one parsed domain. */
876
+ declare const removeDomain$1: (grant: Grant, domain: DomainName) => Grant;
877
+ /** An owner-scoped grant bound to one provider authorization. */
878
+ declare const Schema$2: Schema.Struct<{
879
+ readonly authorizationId: Schema.String;
880
+ readonly createdAt: Schema.DateFromString;
881
+ readonly grant: Schema.TaggedUnion<{
882
+ readonly account: Schema.TaggedStruct<"account", {
883
+ readonly excludedDomains: Schema.$Array<Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>>;
884
+ }>;
885
+ readonly domains: Schema.TaggedStruct<"domains", {
886
+ readonly domains: Schema.$Array<Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>>;
887
+ }>;
888
+ }>;
889
+ readonly id: Schema.String;
890
+ readonly ownerId: Schema.String;
891
+ }>;
892
+ interface Connection extends Schema.Schema.Type<typeof Schema$2> {}
893
+ declare const decode$2: (input: unknown) => Effect.Effect<{
894
+ readonly authorizationId: string;
895
+ readonly createdAt: Date;
896
+ readonly grant: {
897
+ readonly _tag: "account";
898
+ readonly excludedDomains: readonly (string & import("effect/Brand").Brand<"DomainName">)[];
899
+ } | {
900
+ readonly _tag: "domains";
901
+ readonly domains: readonly (string & import("effect/Brand").Brand<"DomainName">)[];
902
+ };
903
+ readonly id: string;
904
+ readonly ownerId: string;
905
+ }, Error$5, never>;
906
+ declare const validate$2: (input: unknown) => Effect.Effect<{
907
+ readonly authorizationId: string;
908
+ readonly createdAt: Date;
909
+ readonly grant: {
910
+ readonly _tag: "account";
911
+ readonly excludedDomains: readonly (string & import("effect/Brand").Brand<"DomainName">)[];
912
+ } | {
913
+ readonly _tag: "domains";
914
+ readonly domains: readonly (string & import("effect/Brand").Brand<"DomainName">)[];
915
+ };
916
+ readonly id: string;
917
+ readonly ownerId: string;
918
+ }, Error$5, never>;
919
+ declare const encode$2: (input: {
920
+ readonly authorizationId: string;
921
+ readonly createdAt: Date;
922
+ readonly grant: {
923
+ readonly _tag: "account";
924
+ readonly excludedDomains: readonly (string & import("effect/Brand").Brand<"DomainName">)[];
925
+ } | {
926
+ readonly _tag: "domains";
927
+ readonly domains: readonly (string & import("effect/Brand").Brand<"DomainName">)[];
928
+ };
929
+ readonly id: string;
930
+ readonly ownerId: string;
931
+ }, options?: import("effect/SchemaAST").ParseOptions) => {
932
+ readonly authorizationId: string;
933
+ readonly createdAt: string;
934
+ readonly grant: {
935
+ readonly _tag: "account";
936
+ readonly excludedDomains: readonly string[];
937
+ } | {
938
+ readonly _tag: "domains";
939
+ readonly domains: readonly string[];
940
+ };
941
+ readonly id: string;
942
+ readonly ownerId: string;
943
+ };
944
+ interface OAuthContinuation {
945
+ readonly clientId: string;
946
+ readonly codeVerifier: Value;
947
+ readonly expiresAt: Date;
948
+ readonly grant: Grant;
949
+ readonly method: OAuthMethod;
950
+ readonly ownerId: string;
951
+ readonly redirectUri: string;
952
+ readonly stateHash: string;
953
+ readonly authorizedById: string;
954
+ }
955
+ interface StoredCredential {
956
+ readonly accessToken: Value;
957
+ readonly refreshToken: Value | null;
958
+ readonly tokenType: string;
959
+ }
960
+ declare const AuthorizationError_base$1: Schema.Class<AuthorizationError$1, Schema.TaggedStruct<"AuthorizationError", {
961
+ readonly category: Schema.Literal<"authorization">;
962
+ readonly message: Schema.String;
963
+ readonly operation: Schema.String;
964
+ readonly retry: Schema.Literals<readonly ["never", "after-user-action", "safe", "unknown"]>;
965
+ }>, import("effect/Cause").YieldableError>;
966
+ declare class AuthorizationError$1 extends AuthorizationError_base$1 {}
967
+ declare const authorizationError: (message: string, operation: string) => AuthorizationError$1;
968
+ declare function assertGrant(connection: Connection, authorization: ProviderAuthorization, request: {
969
+ readonly capability: Capability;
970
+ readonly domain: string;
971
+ readonly now?: Date;
972
+ readonly providerId: string;
973
+ }): DomainName;
974
+ declare namespace canonical_json_d_exports {
975
+ export { CryptoError, Json, sha256Encoded, sha256Json, sha256Text, stringify, webCryptoLayer };
976
+ }
977
+ declare const CryptoError_base: Schema.Class<CryptoError, Schema.TaggedStruct<"CryptoError", {
978
+ readonly message: Schema.String;
979
+ }>, import("effect/Cause").YieldableError>;
980
+ declare class CryptoError extends CryptoError_base {}
981
+ type Json = null | boolean | number | string | ReadonlyArray<Json> | {
982
+ readonly [key: string]: Json;
983
+ };
984
+ /** Deterministic JSON serialization for already schema-encoded protocol values. */
985
+ declare function stringify(value: Json): string;
986
+ declare const sha256Text: (value: string) => Effect.Effect<string, CryptoError, Crypto.Crypto>;
987
+ declare const sha256Json: (value: Json) => Effect.Effect<string, CryptoError, Crypto.Crypto>;
988
+ declare const sha256Encoded: <S extends Schema.Constraint>(schema: S, value: S["Type"]) => Effect.Effect<string, CryptoError, Crypto.Crypto | S["EncodingServices"]>;
989
+ /** Portable Web Crypto implementation for hosts that want a ready-made Layer. */
990
+ declare const webCryptoLayer: Layer.Layer<Crypto.Crypto>;
991
+ declare namespace lifecycle_repository_d_exports {
992
+ export { Aggregate, BindingModification, DetachResult, Error$3 as Error, Interface$2 as Interface, Service$2 as Service };
993
+ }
994
+ interface Aggregate {
995
+ readonly authorization: ProviderAuthorization;
996
+ readonly bindings: ReadonlyArray<Connection>;
997
+ readonly credential: StoredCredential;
998
+ }
999
+ interface DetachResult {
1000
+ readonly authorizationId: string;
1001
+ readonly remainingBindings: number;
1002
+ readonly revokedAuthorization: boolean;
1003
+ }
1004
+ interface BindingModification<A> {
1005
+ readonly aggregate: Aggregate;
1006
+ readonly value: A;
1007
+ }
1008
+ declare const Error_base$3: Schema.Class<Error$3, Schema.TaggedStruct<"LifecycleRepositoryError", {
1009
+ readonly category: Schema.Literal<"storage">;
1010
+ readonly message: Schema.String;
1011
+ readonly operation: Schema.String;
1012
+ readonly retry: Schema.Literals<readonly ["never", "after-user-action", "safe", "unknown"]>;
1013
+ }>, import("effect/Cause").YieldableError>;
1014
+ declare class Error$3 extends Error_base$3 {}
1015
+ interface Interface$2 {
1016
+ readonly bind: (authorizationId: string, binding: Connection) => Effect.Effect<Aggregate, Error$3>;
1017
+ readonly connect: (aggregate: Aggregate) => Effect.Effect<Aggregate, Error$3>;
1018
+ readonly detach: <E>(input: {
1019
+ readonly connectionId: string;
1020
+ readonly revoke: (aggregate: Aggregate) => Effect.Effect<void, E>;
1021
+ }) => Effect.Effect<DetachResult, Error$3 | E>;
1022
+ readonly findByProviderAccount: (providerId: string, providerAccountId: string) => Effect.Effect<Aggregate | null, Error$3>;
1023
+ readonly get: (authorizationId: string) => Effect.Effect<Aggregate | null, Error$3>;
1024
+ readonly getByConnectionId: (connectionId: string) => Effect.Effect<Aggregate | null, Error$3>;
1025
+ readonly modifyBinding: <A>(connectionId: string, modify: (binding: Connection) => {
1026
+ readonly binding: Connection;
1027
+ readonly value: A;
1028
+ }) => Effect.Effect<BindingModification<A>, Error$3>;
1029
+ readonly promoteEvidence: (authorizationId: string, evidence: ReadonlyArray<CapabilityEvidence>) => Effect.Effect<Aggregate, Error$3>;
1030
+ readonly recover: <E>(input: {
1031
+ readonly authorizationId: string;
1032
+ readonly revoke: (aggregate: Aggregate) => Effect.Effect<void, E>;
1033
+ }) => Effect.Effect<DetachResult, Error$3 | E>;
1034
+ readonly rotate: (authorizationId: string, credential: StoredCredential, expiresAt: Date | null) => Effect.Effect<Aggregate, Error$3>;
1035
+ }
1036
+ declare const Service_base$2: Context.ServiceClass<Service$2, "@domainkit/AuthorizationLifecycleRepository", Interface$2>;
1037
+ declare class Service$2 extends Service_base$2 {}
1038
+ declare namespace provider_context_d_exports {
1039
+ export { Codec, Envelope, codec, decode$1 as decode, encode$1 as encode };
1040
+ }
1041
+ /** A provider-owned, versioned, non-secret context value persisted by the host. */
1042
+ declare const Envelope: Schema.Struct<{
1043
+ readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
1044
+ readonly version: Schema.String;
1045
+ }>;
1046
+ interface Envelope extends Schema.Schema.Type<typeof Envelope> {}
1047
+ interface Codec<A> {
1048
+ readonly decode: (envelope: Envelope) => Effect.Effect<A, Error$5>;
1049
+ readonly encode: (value: A) => Effect.Effect<Envelope, Error$5>;
1050
+ readonly version: string;
1051
+ }
1052
+ /** Build an adapter-owned context codec from a schema and stable version identifier. */
1053
+ declare function codec<A, I>(version: string, schema: Schema.Codec<A, I>): Codec<A>;
1054
+ declare const decode$1: (input: unknown) => Effect.Effect<{
1055
+ readonly value: Schema.Json;
1056
+ readonly version: string;
1057
+ }, Error$5, never>;
1058
+ declare const encode$1: (input: {
1059
+ readonly value: Schema.Json;
1060
+ readonly version: string;
1061
+ }, options?: import("effect/SchemaAST").ParseOptions) => {
1062
+ readonly value: Schema.Json;
1063
+ readonly version: string;
1064
+ };
1065
+ //#endregion
1066
+ //#region src/auth/connect.d.ts
1067
+ interface Authentication {
1068
+ readonly capabilityEvidence: ReadonlyArray<CapabilityEvidence>;
1069
+ readonly credential: StoredCredential;
1070
+ readonly expiresAt: Date | null;
1071
+ readonly providerAccountId: string;
1072
+ readonly providerContext: Envelope;
1073
+ readonly scopes: ReadonlyArray<string>;
1074
+ }
1075
+ type AuthenticationFailure = Error$2 | Error$5 | Error$4;
1076
+ interface InteractiveStart {
1077
+ readonly authorizationUrl: URL;
1078
+ readonly payload: Value;
1079
+ }
1080
+ interface Continuation extends BaseInput {
1081
+ readonly expiresAt: Date;
1082
+ readonly id: string;
1083
+ readonly method: "integration" | "oauth2";
1084
+ readonly payload: Value;
1085
+ readonly providerId: string;
1086
+ readonly requiredCapabilities: ReadonlyArray<Capability>;
1087
+ }
1088
+ interface ContinuationStore {
1089
+ readonly consume: (id: string, now: Date) => Effect.Effect<Continuation | null, Error$2>;
1090
+ readonly put: (continuation: Continuation) => Effect.Effect<void, Error$2>;
1091
+ }
1092
+ interface InteractiveFlow {
1093
+ readonly complete: (payload: Value, callbackUrl: URL) => Effect.Effect<Authentication, AuthenticationFailure>;
1094
+ readonly method: "integration" | "oauth2";
1095
+ readonly providerId: string;
1096
+ readonly requiredCapabilities: ReadonlyArray<Capability>;
1097
+ readonly start: (continuationId: string) => Effect.Effect<InteractiveStart, AuthenticationFailure, Crypto.Crypto>;
1098
+ }
1099
+ type Method = Data.TaggedEnum<{
1100
+ Interactive: {
1101
+ readonly continuations: ContinuationStore;
1102
+ readonly flow: InteractiveFlow;
1103
+ readonly ttlMs?: number;
1104
+ };
1105
+ Token: {
1106
+ readonly authenticate: (token: Value) => Effect.Effect<Authentication, AuthenticationFailure>;
1107
+ readonly providerId: string;
1108
+ readonly requiredCapabilities: ReadonlyArray<Capability>;
1109
+ readonly token: Value;
1110
+ };
1111
+ }>;
1112
+ declare const Method: {
1113
+ readonly $is: <Tag extends "Interactive" | "Token">(tag: Tag) => (u: unknown) => u is Extract<{
1114
+ readonly _tag: "Interactive";
1115
+ readonly continuations: ContinuationStore;
1116
+ readonly flow: InteractiveFlow;
1117
+ readonly ttlMs?: number;
1118
+ }, {
1119
+ readonly _tag: Tag;
1120
+ }> | Extract<{
1121
+ readonly _tag: "Token";
1122
+ readonly authenticate: (token: Value) => Effect.Effect<Authentication, AuthenticationFailure>;
1123
+ readonly providerId: string;
1124
+ readonly requiredCapabilities: ReadonlyArray<Capability>;
1125
+ readonly token: Value;
1126
+ }, {
1127
+ readonly _tag: Tag;
1128
+ }>;
1129
+ readonly $match: {
1130
+ <Cases extends { readonly [Tag in "Interactive" | "Token"]: (args: Extract<{
1131
+ readonly _tag: "Interactive";
1132
+ readonly continuations: ContinuationStore;
1133
+ readonly flow: InteractiveFlow;
1134
+ readonly ttlMs?: number;
1135
+ } | {
1136
+ readonly _tag: "Token";
1137
+ readonly authenticate: (token: Value) => Effect.Effect<Authentication, AuthenticationFailure>;
1138
+ readonly providerId: string;
1139
+ readonly requiredCapabilities: ReadonlyArray<Capability>;
1140
+ readonly token: Value;
1141
+ }, {
1142
+ readonly _tag: Tag;
1143
+ }>) => any; }>(cases: Cases): (value: {
1144
+ readonly _tag: "Interactive";
1145
+ readonly continuations: ContinuationStore;
1146
+ readonly flow: InteractiveFlow;
1147
+ readonly ttlMs?: number;
1148
+ } | {
1149
+ readonly _tag: "Token";
1150
+ readonly authenticate: (token: Value) => Effect.Effect<Authentication, AuthenticationFailure>;
1151
+ readonly providerId: string;
1152
+ readonly requiredCapabilities: ReadonlyArray<Capability>;
1153
+ readonly token: Value;
1154
+ }) => import("effect/Unify").Unify<ReturnType<Cases["Interactive" | "Token"]>>;
1155
+ <Cases extends { readonly [Tag in "Interactive" | "Token"]: (args: Extract<{
1156
+ readonly _tag: "Interactive";
1157
+ readonly continuations: ContinuationStore;
1158
+ readonly flow: InteractiveFlow;
1159
+ readonly ttlMs?: number;
1160
+ } | {
1161
+ readonly _tag: "Token";
1162
+ readonly authenticate: (token: Value) => Effect.Effect<Authentication, AuthenticationFailure>;
1163
+ readonly providerId: string;
1164
+ readonly requiredCapabilities: ReadonlyArray<Capability>;
1165
+ readonly token: Value;
1166
+ }, {
1167
+ readonly _tag: Tag;
1168
+ }>) => any; }>(value: {
1169
+ readonly _tag: "Interactive";
1170
+ readonly continuations: ContinuationStore;
1171
+ readonly flow: InteractiveFlow;
1172
+ readonly ttlMs?: number;
1173
+ } | {
1174
+ readonly _tag: "Token";
1175
+ readonly authenticate: (token: Value) => Effect.Effect<Authentication, AuthenticationFailure>;
1176
+ readonly providerId: string;
1177
+ readonly requiredCapabilities: ReadonlyArray<Capability>;
1178
+ readonly token: Value;
1179
+ }, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Interactive" | "Token"]>>;
1180
+ };
1181
+ readonly Interactive: Data.TaggedEnum.ConstructorFrom<{
1182
+ readonly _tag: "Interactive";
1183
+ readonly continuations: ContinuationStore;
1184
+ readonly flow: InteractiveFlow;
1185
+ readonly ttlMs?: number;
1186
+ }, "_tag">;
1187
+ readonly Token: Data.TaggedEnum.ConstructorFrom<{
1188
+ readonly _tag: "Token";
1189
+ readonly authenticate: (token: Value) => Effect.Effect<Authentication, AuthenticationFailure>;
1190
+ readonly providerId: string;
1191
+ readonly requiredCapabilities: ReadonlyArray<Capability>;
1192
+ readonly token: Value;
1193
+ }, "_tag">;
1194
+ };
1195
+ type StartResult = Data.TaggedEnum<{
1196
+ Connected: {
1197
+ readonly aggregate: Aggregate;
1198
+ };
1199
+ Redirect: {
1200
+ readonly authorizationUrl: URL;
1201
+ readonly continuationId: string;
1202
+ };
1203
+ }>;
1204
+ declare const StartResult: {
1205
+ readonly $is: <Tag extends "Connected" | "Redirect">(tag: Tag) => (u: unknown) => u is Extract<{
1206
+ readonly _tag: "Connected";
1207
+ readonly aggregate: Aggregate;
1208
+ }, {
1209
+ readonly _tag: Tag;
1210
+ }> | Extract<{
1211
+ readonly _tag: "Redirect";
1212
+ readonly authorizationUrl: URL;
1213
+ readonly continuationId: string;
1214
+ }, {
1215
+ readonly _tag: Tag;
1216
+ }>;
1217
+ readonly $match: {
1218
+ <Cases extends { readonly [Tag in "Connected" | "Redirect"]: (args: Extract<{
1219
+ readonly _tag: "Connected";
1220
+ readonly aggregate: Aggregate;
1221
+ } | {
1222
+ readonly _tag: "Redirect";
1223
+ readonly authorizationUrl: URL;
1224
+ readonly continuationId: string;
1225
+ }, {
1226
+ readonly _tag: Tag;
1227
+ }>) => any; }>(cases: Cases): (value: {
1228
+ readonly _tag: "Connected";
1229
+ readonly aggregate: Aggregate;
1230
+ } | {
1231
+ readonly _tag: "Redirect";
1232
+ readonly authorizationUrl: URL;
1233
+ readonly continuationId: string;
1234
+ }) => import("effect/Unify").Unify<ReturnType<Cases["Connected" | "Redirect"]>>;
1235
+ <Cases extends { readonly [Tag in "Connected" | "Redirect"]: (args: Extract<{
1236
+ readonly _tag: "Connected";
1237
+ readonly aggregate: Aggregate;
1238
+ } | {
1239
+ readonly _tag: "Redirect";
1240
+ readonly authorizationUrl: URL;
1241
+ readonly continuationId: string;
1242
+ }, {
1243
+ readonly _tag: Tag;
1244
+ }>) => any; }>(value: {
1245
+ readonly _tag: "Connected";
1246
+ readonly aggregate: Aggregate;
1247
+ } | {
1248
+ readonly _tag: "Redirect";
1249
+ readonly authorizationUrl: URL;
1250
+ readonly continuationId: string;
1251
+ }, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Connected" | "Redirect"]>>;
1252
+ };
1253
+ readonly Connected: Data.TaggedEnum.ConstructorFrom<{
1254
+ readonly _tag: "Connected";
1255
+ readonly aggregate: Aggregate;
1256
+ }, "_tag">;
1257
+ readonly Redirect: Data.TaggedEnum.ConstructorFrom<{
1258
+ readonly _tag: "Redirect";
1259
+ readonly authorizationUrl: URL;
1260
+ readonly continuationId: string;
1261
+ }, "_tag">;
1262
+ };
1263
+ declare const Error_base$2: Schema.Class<Error$2, Schema.TaggedStruct<"ConnectionError", {
1264
+ readonly category: Schema.Literals<readonly ["authorization", "provider", "validation"]>;
1265
+ readonly message: Schema.String;
1266
+ readonly operation: Schema.String;
1267
+ readonly retry: Schema.Literals<readonly ["never", "after-user-action", "safe", "unknown"]>;
1268
+ }>, import("effect/Cause").YieldableError>;
1269
+ declare class Error$2 extends Error_base$2 {}
1270
+ interface BaseInput {
1271
+ readonly authorizedById: string;
1272
+ readonly grant: Grant;
1273
+ readonly ownerId: string;
1274
+ }
1275
+ interface CompleteInput {
1276
+ readonly callbackUrl: URL;
1277
+ readonly continuationId: string;
1278
+ readonly continuations: ContinuationStore;
1279
+ readonly flow: InteractiveFlow;
1280
+ }
1281
+ interface ExtendInput {
1282
+ readonly connectionId: string;
1283
+ readonly grant: Grant;
1284
+ readonly ownerId: string;
1285
+ }
1286
+ interface RemoveDomainInput {
1287
+ readonly connectionId: string;
1288
+ readonly domain: string;
1289
+ readonly ownerId: string;
1290
+ }
1291
+ type RemoveDomainResult = Data.TaggedEnum<{
1292
+ AlreadyRemoved: {
1293
+ readonly aggregate: Aggregate;
1294
+ };
1295
+ Removed: {
1296
+ readonly aggregate: Aggregate;
1297
+ };
1298
+ }>;
1299
+ declare const RemoveDomainResult: {
1300
+ readonly $is: <Tag extends "AlreadyRemoved" | "Removed">(tag: Tag) => (u: unknown) => u is Extract<{
1301
+ readonly _tag: "AlreadyRemoved";
1302
+ readonly aggregate: Aggregate;
1303
+ }, {
1304
+ readonly _tag: Tag;
1305
+ }> | Extract<{
1306
+ readonly _tag: "Removed";
1307
+ readonly aggregate: Aggregate;
1308
+ }, {
1309
+ readonly _tag: Tag;
1310
+ }>;
1311
+ readonly $match: {
1312
+ <Cases extends { readonly [Tag in "AlreadyRemoved" | "Removed"]: (args: Extract<{
1313
+ readonly _tag: "AlreadyRemoved";
1314
+ readonly aggregate: Aggregate;
1315
+ } | {
1316
+ readonly _tag: "Removed";
1317
+ readonly aggregate: Aggregate;
1318
+ }, {
1319
+ readonly _tag: Tag;
1320
+ }>) => any; }>(cases: Cases): (value: {
1321
+ readonly _tag: "AlreadyRemoved";
1322
+ readonly aggregate: Aggregate;
1323
+ } | {
1324
+ readonly _tag: "Removed";
1325
+ readonly aggregate: Aggregate;
1326
+ }) => import("effect/Unify").Unify<ReturnType<Cases["AlreadyRemoved" | "Removed"]>>;
1327
+ <Cases extends { readonly [Tag in "AlreadyRemoved" | "Removed"]: (args: Extract<{
1328
+ readonly _tag: "AlreadyRemoved";
1329
+ readonly aggregate: Aggregate;
1330
+ } | {
1331
+ readonly _tag: "Removed";
1332
+ readonly aggregate: Aggregate;
1333
+ }, {
1334
+ readonly _tag: Tag;
1335
+ }>) => any; }>(value: {
1336
+ readonly _tag: "AlreadyRemoved";
1337
+ readonly aggregate: Aggregate;
1338
+ } | {
1339
+ readonly _tag: "Removed";
1340
+ readonly aggregate: Aggregate;
1341
+ }, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["AlreadyRemoved" | "Removed"]>>;
1342
+ };
1343
+ readonly AlreadyRemoved: Data.TaggedEnum.ConstructorFrom<{
1344
+ readonly _tag: "AlreadyRemoved";
1345
+ readonly aggregate: Aggregate;
1346
+ }, "_tag">;
1347
+ readonly Removed: Data.TaggedEnum.ConstructorFrom<{
1348
+ readonly _tag: "Removed";
1349
+ readonly aggregate: Aggregate;
1350
+ }, "_tag">;
1351
+ };
1352
+ declare const start: (input: BaseInput & {
1353
+ readonly method: Method;
1354
+ }) => Effect.Effect<{
1355
+ readonly _tag: "Connected";
1356
+ readonly aggregate: Aggregate;
1357
+ } | {
1358
+ readonly _tag: "Redirect";
1359
+ readonly authorizationUrl: URL;
1360
+ readonly continuationId: string;
1361
+ }, Error$3 | AuthenticationFailure, Crypto.Crypto | Service$2>;
1362
+ declare const complete: (input: CompleteInput) => Effect.Effect<Aggregate, Error$3 | AuthenticationFailure, Crypto.Crypto | Service$2>;
1363
+ /** Extends one owner binding without repeating provider authentication. */
1364
+ declare const extend: (input: ExtendInput) => Effect.Effect<Aggregate, Error$3 | Error$2, Service$2>;
1365
+ /** Removes one domain from an owner binding without revoking provider authorization. */
1366
+ declare const removeDomain: (input: RemoveDomainInput) => Effect.Effect<{
1367
+ readonly _tag: "AlreadyRemoved";
1368
+ readonly aggregate: Aggregate;
1369
+ } | {
1370
+ readonly _tag: "Removed";
1371
+ readonly aggregate: Aggregate;
1372
+ }, Error$3 | Error$2, Service$2>;
1373
+ type Requirements$1 = Service$2 | Crypto.Crypto;
1374
+ type Failure = AuthenticationFailure | Error$3 | CryptoError;
1375
+ declare namespace zone_discovery_d_exports {
1376
+ export { Candidate, Interface$1 as Interface, Outcome, Service$1 as Service, Source, make };
1377
+ }
1378
+ /** Display-safe identity and nameserver evidence for one provider-owned zone. */
1379
+ declare const Candidate: Schema.Struct<{
1380
+ readonly accountId: Schema.String;
1381
+ readonly id: Schema.String;
1382
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
1383
+ readonly nameservers: Schema.$Array<Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>>;
1384
+ readonly providerId: Schema.String;
1385
+ readonly status: Schema.Literals<readonly ["active", "pending", "unknown"]>;
1386
+ }>;
1387
+ interface Candidate extends Schema.Schema.Type<typeof Candidate> {}
1388
+ interface Source {
1389
+ readonly listZones: (name: DomainName) => Effect.Effect<ReadonlyArray<Omit<Candidate, "providerId">>, Error$4>;
1390
+ readonly provider: Interface$3;
1391
+ }
1392
+ type Outcome = Data.TaggedEnum<{
1393
+ NotFound: {
1394
+ readonly domain: DomainName;
1395
+ };
1396
+ Resolved: {
1397
+ readonly candidate: Candidate;
1398
+ readonly provider: Interface$3;
1399
+ };
1400
+ SelectionRequired: {
1401
+ readonly candidates: ReadonlyArray<Candidate>;
1402
+ };
1403
+ }>;
1404
+ declare const Outcome: {
1405
+ readonly $is: <Tag extends "NotFound" | "Resolved" | "SelectionRequired">(tag: Tag) => (u: unknown) => u is Extract<{
1406
+ readonly _tag: "NotFound";
1407
+ readonly domain: DomainName;
1408
+ }, {
1409
+ readonly _tag: Tag;
1410
+ }> | Extract<{
1411
+ readonly _tag: "Resolved";
1412
+ readonly candidate: Candidate;
1413
+ readonly provider: Interface$3;
1414
+ }, {
1415
+ readonly _tag: Tag;
1416
+ }> | Extract<{
1417
+ readonly _tag: "SelectionRequired";
1418
+ readonly candidates: ReadonlyArray<Candidate>;
1419
+ }, {
1420
+ readonly _tag: Tag;
1421
+ }>;
1422
+ readonly $match: {
1423
+ <Cases extends { readonly [Tag in "NotFound" | "Resolved" | "SelectionRequired"]: (args: Extract<{
1424
+ readonly _tag: "NotFound";
1425
+ readonly domain: DomainName;
1426
+ } | {
1427
+ readonly _tag: "Resolved";
1428
+ readonly candidate: Candidate;
1429
+ readonly provider: Interface$3;
1430
+ } | {
1431
+ readonly _tag: "SelectionRequired";
1432
+ readonly candidates: ReadonlyArray<Candidate>;
1433
+ }, {
1434
+ readonly _tag: Tag;
1435
+ }>) => any; }>(cases: Cases): (value: {
1436
+ readonly _tag: "NotFound";
1437
+ readonly domain: DomainName;
1438
+ } | {
1439
+ readonly _tag: "Resolved";
1440
+ readonly candidate: Candidate;
1441
+ readonly provider: Interface$3;
1442
+ } | {
1443
+ readonly _tag: "SelectionRequired";
1444
+ readonly candidates: ReadonlyArray<Candidate>;
1445
+ }) => import("effect/Unify").Unify<ReturnType<Cases["NotFound" | "Resolved" | "SelectionRequired"]>>;
1446
+ <Cases extends { readonly [Tag in "NotFound" | "Resolved" | "SelectionRequired"]: (args: Extract<{
1447
+ readonly _tag: "NotFound";
1448
+ readonly domain: DomainName;
1449
+ } | {
1450
+ readonly _tag: "Resolved";
1451
+ readonly candidate: Candidate;
1452
+ readonly provider: Interface$3;
1453
+ } | {
1454
+ readonly _tag: "SelectionRequired";
1455
+ readonly candidates: ReadonlyArray<Candidate>;
1456
+ }, {
1457
+ readonly _tag: Tag;
1458
+ }>) => any; }>(value: {
1459
+ readonly _tag: "NotFound";
1460
+ readonly domain: DomainName;
1461
+ } | {
1462
+ readonly _tag: "Resolved";
1463
+ readonly candidate: Candidate;
1464
+ readonly provider: Interface$3;
1465
+ } | {
1466
+ readonly _tag: "SelectionRequired";
1467
+ readonly candidates: ReadonlyArray<Candidate>;
1468
+ }, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["NotFound" | "Resolved" | "SelectionRequired"]>>;
1469
+ };
1470
+ readonly NotFound: Data.TaggedEnum.ConstructorFrom<{
1471
+ readonly _tag: "NotFound";
1472
+ readonly domain: DomainName;
1473
+ }, "_tag">;
1474
+ readonly Resolved: Data.TaggedEnum.ConstructorFrom<{
1475
+ readonly _tag: "Resolved";
1476
+ readonly candidate: Candidate;
1477
+ readonly provider: Interface$3;
1478
+ }, "_tag">;
1479
+ readonly SelectionRequired: Data.TaggedEnum.ConstructorFrom<{
1480
+ readonly _tag: "SelectionRequired";
1481
+ readonly candidates: ReadonlyArray<Candidate>;
1482
+ }, "_tag">;
1483
+ };
1484
+ interface Interface$1 {
1485
+ readonly discover: (domain: DomainName) => Effect.Effect<Outcome, Error$4>;
1486
+ }
1487
+ declare const Service_base$1: Context.ServiceClass<Service$1, "@domainkit/ZoneDiscovery", Interface$1>;
1488
+ declare class Service$1 extends Service_base$1 {}
1489
+ /** Compose provider-account discovery sources without expanding the record-provider contract. */
1490
+ declare function make(sources: ReadonlyArray<Source>): Interface$1;
3
1491
  declare namespace types_d_exports {
4
1492
  export { ApplyReceipt, Authorization$1 as Authorization, DnsPlan, Operation$1 as Operation, PlanAuthorization, Receipt$1 as Receipt, Schema$1 as Schema, decode, decodeReceipt, encode, encodeReceipt };
5
1493
  }
@@ -840,11 +2328,6 @@ declare const decode: (input: unknown) => Effect.Effect<{
840
2328
  readonly operations: readonly ({
841
2329
  readonly _tag: "conflict";
842
2330
  readonly existing: readonly ({
843
- readonly _tag: "Opaque";
844
- readonly name: string;
845
- readonly providerRecordId: string | null;
846
- readonly providerType: string;
847
- } | {
848
2331
  readonly _tag: "A";
849
2332
  readonly metadata: {
850
2333
  readonly ownership: string;
@@ -938,6 +2421,11 @@ declare const decode: (input: unknown) => Effect.Effect<{
938
2421
  readonly policy: "append" | "exclusive";
939
2422
  readonly ttl: number | null;
940
2423
  readonly value: string;
2424
+ } | {
2425
+ readonly _tag: "Opaque";
2426
+ readonly name: string;
2427
+ readonly providerRecordId: string | null;
2428
+ readonly providerType: string;
941
2429
  })[];
942
2430
  readonly id: string;
943
2431
  readonly reason: string;
@@ -1237,17 +2725,12 @@ declare const decode: (input: unknown) => Effect.Effect<{
1237
2725
  readonly providerId: string;
1238
2726
  readonly version: "domainkit.dns-plan.v1";
1239
2727
  readonly zone: string & import("effect/Brand").Brand<"DomainName">;
1240
- }, Error$2, never>;
2728
+ }, Error$5, never>;
1241
2729
  declare const encode: (input: {
1242
2730
  readonly digest: string;
1243
2731
  readonly operations: readonly ({
1244
2732
  readonly _tag: "conflict";
1245
2733
  readonly existing: readonly ({
1246
- readonly _tag: "Opaque";
1247
- readonly name: string;
1248
- readonly providerRecordId: string | null;
1249
- readonly providerType: string;
1250
- } | {
1251
2734
  readonly _tag: "A";
1252
2735
  readonly metadata: {
1253
2736
  readonly ownership: string;
@@ -1341,6 +2824,11 @@ declare const encode: (input: {
1341
2824
  readonly policy: "append" | "exclusive";
1342
2825
  readonly ttl: number | null;
1343
2826
  readonly value: string;
2827
+ } | {
2828
+ readonly _tag: "Opaque";
2829
+ readonly name: string;
2830
+ readonly providerRecordId: string | null;
2831
+ readonly providerType: string;
1344
2832
  })[];
1345
2833
  readonly id: string;
1346
2834
  readonly reason: string;
@@ -2054,7 +3542,7 @@ declare const decodeReceipt: (input: unknown) => Effect.Effect<{
2054
3542
  readonly status: "complete" | "partial";
2055
3543
  readonly version: "domainkit.apply-receipt.v1";
2056
3544
  readonly zone: string & import("effect/Brand").Brand<"DomainName">;
2057
- }, Error$2, never>;
3545
+ }, Error$5, never>;
2058
3546
  declare const encodeReceipt: (input: {
2059
3547
  readonly appliedAt: Date;
2060
3548
  readonly operations: readonly {
@@ -2286,12 +3774,12 @@ interface ApplyInput {
2286
3774
  readonly authorization: PlanAuthorization;
2287
3775
  readonly plan: DnsPlan;
2288
3776
  }
2289
- type CreateError$1 = Error$2 | Error$3 | CryptoError;
3777
+ type CreateError$1 = Error$5 | Error$4 | CryptoError;
2290
3778
  type AuthorizeError = AuthorizationError | CryptoError;
2291
- type ApplyError$1 = Error$2 | Error$3 | CryptoError | AuthorizationError | ConflictError | StaleError | PartialApplyError;
3779
+ type ApplyError$1 = Error$5 | Error$4 | CryptoError | AuthorizationError | ConflictError | StaleError | PartialApplyError;
2292
3780
  /** Builds a deterministic DNS plan through an exact or discoverable authoritative-zone target. */
2293
- declare function create$1(input: ExactCreateInput): Effect.Effect<ResolvedCreateResult, CreateError$1, Crypto.Crypto | Service$1>;
2294
- declare function create$1(input: DiscoverCreateInput): Effect.Effect<CreateResult, CreateError$1, Crypto.Crypto | Service$2>;
3781
+ declare function create$1(input: ExactCreateInput): Effect.Effect<ResolvedCreateResult, CreateError$1, Crypto.Crypto | Service$3>;
3782
+ declare function create$1(input: DiscoverCreateInput): Effect.Effect<CreateResult, CreateError$1, Crypto.Crypto | Service$1>;
2295
3783
  /** Authorizes all or a selected subset of create operations in a digest-bound plan. */
2296
3784
  declare const authorize$1: (plan: DnsPlan, operationIds?: readonly string[] | undefined, options?: {
2297
3785
  readonly allowPartial?: boolean;
@@ -2302,7 +3790,7 @@ declare const authorize$1: (plan: DnsPlan, operationIds?: readonly string[] | un
2302
3790
  version: "domainkit.plan-authorization.v1";
2303
3791
  }, AuthorizeError, Crypto.Crypto>;
2304
3792
  /** Applies approved creates sequentially after full and per-operation revalidation. */
2305
- declare const apply$1: (input: ApplyInput) => Effect.Effect<ApplyReceipt, AuthorizationError | ConflictError | CryptoError | Error$2 | Error$3 | PartialApplyError | StaleError, Crypto.Crypto | Service$1>;
3793
+ declare const apply$1: (input: ApplyInput) => Effect.Effect<ApplyReceipt, AuthorizationError | ConflictError | CryptoError | Error$5 | Error$4 | PartialApplyError | StaleError, Crypto.Crypto | Service$3>;
2306
3794
  declare function renderManualInstructions(plan: DnsPlan): ReadonlyArray<string>;
2307
3795
  declare function validate$1(plan: DnsPlan): Effect.Effect<void, AuthorizeError, Crypto.Crypto>;
2308
3796
  declare namespace deletion_d_exports {
@@ -2673,7 +4161,7 @@ declare const create: (input: CreateInput) => Effect.Effect<{
2673
4161
  version: "domainkit.deletion-plan.v1";
2674
4162
  zone: string & import("effect/Brand").Brand<"DomainName">;
2675
4163
  digest: string;
2676
- }, Error$3 | Error$1 | AuthorizeError, Crypto.Crypto | Service$1>;
4164
+ }, Error$4 | Error$1 | AuthorizeError, Crypto.Crypto | Service$3>;
2677
4165
  /** Produce a separate digest-bound consent artifact for destructive operations. */
2678
4166
  declare const authorize: (plan: Plan, operationIds?: readonly string[] | undefined) => Effect.Effect<{
2679
4167
  operationIds: string[];
@@ -2685,11 +4173,11 @@ declare const apply: (input: {
2685
4173
  readonly authorization: Authorization;
2686
4174
  readonly plan: Plan;
2687
4175
  readonly priorReceipt?: Receipt;
2688
- }) => Effect.Effect<Receipt, CryptoError | Error$3 | Error$1 | PartialError, Crypto.Crypto | Service$1>;
4176
+ }) => Effect.Effect<Receipt, CryptoError | Error$4 | Error$1 | PartialError, Crypto.Crypto | Service$3>;
2689
4177
  declare function validate(plan: Plan): Effect.Effect<void, Error$1 | CryptoError, Crypto.Crypto>;
2690
- type CreateError = Error$1 | Error$2 | AuthorizationError | Error$3 | CryptoError;
2691
- type ApplyError = Error$1 | PartialError | Error$3 | CryptoError;
2692
- type Requirements = Service$1 | Crypto.Crypto;
4178
+ type CreateError = Error$1 | Error$5 | AuthorizationError | Error$4 | CryptoError;
4179
+ type ApplyError = Error$1 | PartialError | Error$4 | CryptoError;
4180
+ type Requirements = Service$3 | Crypto.Crypto;
2693
4181
  declare namespace resolver_d_exports {
2694
4182
  export { Answer, AsyncInterface, AsyncResolution, Error, Interface, Query, Resolution, Service, layerFromAsync, toAsync };
2695
4183
  }
@@ -2740,5 +4228,5 @@ interface AsyncInterface {
2740
4228
  declare const layerFromAsync: (resolver: AsyncInterface) => Layer.Layer<Service>;
2741
4229
  declare const toAsync: (resolver: Interface) => AsyncInterface;
2742
4230
  //#endregion
2743
- export { renderManualInstructions as A, types_d_exports as B, DiscoverCreateInput as C, StaleError as D, ResolvedCreateResult as E, PlanAuthorization as F, Receipt$1 as I, Schema$1 as L, Authorization$1 as M, DnsPlan as N, Target as O, Operation$1 as P, encode as R, CreateResult as S, PartialApplyError as T, Receipt as _, Interface as a, AuthorizeError as b, Service as c, Authorization as d, CreateError as f, Plan as g, PartialError as h, Error as i, ApplyReceipt as j, plan_d_exports as k, resolver_d_exports as l, Operation as m, AsyncInterface as n, Query as o, Error$1 as p, AsyncResolution as r, Resolution as s, Answer as t, ApplyError as u, deletion_d_exports as v, ExactCreateInput as w, ConflictError as x, AuthorizationError as y, encodeReceipt as z };
2744
- //# sourceMappingURL=resolver-Dc0hwV-J.d.mts.map
4231
+ export { InteractiveFlow as $, manifest_d_exports as $t, renderManualInstructions as A, parse$1 as An, coversDomain as At, types_d_exports as B, ProviderAuthorization as Bt, DiscoverCreateInput as C, equals as Cn, Connection as Ct, StaleError as D, DomainName as Dn, StoredCredential as Dt, ResolvedCreateResult as E, secret_d_exports as En, Schema$2 as Et, PlanAuthorization as F, validate$2 as Ft, AuthenticationFailure as G, IntegrationMethod as Gt, Source as H, authorization_d_exports as Ht, Receipt$1 as I, Capability as It, Continuation as J, OAuthClientConfiguration as Jt, BaseInput as K, Manifest as Kt, Schema$1 as L, CapabilityEvidence as Lt, Authorization$1 as M, invalid_input_d_exports as Mn, encode$2 as Mt, DnsPlan as N, includeDomains as Nt, Target as O, Schema$6 as On, assertGrant as Ot, Operation$1 as P, removeDomain$1 as Pt, Failure as Q, TokenValidation as Qt, encode as R, Evidence as Rt, CreateResult as S, dns_record_d_exports as Sn, AuthorizationError$1 as St, PartialApplyError as T, Value as Tn, OAuthContinuation as Tt, zone_discovery_d_exports as U, encode$3 as Ut, Candidate as V, Schema$3 as Vt, Authentication as W, AsyncOAuthSubjectResolver as Wt, Error$2 as X, OAuthSubjectResolver as Xt, ContinuationStore as Y, OAuthMethod as Yt, ExtendInput as Z, Schema$4 as Zt, Receipt as _, Schema$5 as _n, Interface$2 as _t, Interface as a, provider_d_exports as an, StartResult as at, AuthorizeError as b, Type as bn, CryptoError as bt, Service as c, Caa as cn, removeDomain as ct, Authorization as d, Encoded as dn, Envelope as dt, AsyncInterface$1 as en, InteractiveStart as et, CreateError as f, Mx as fn, provider_context_d_exports as ft, Plan as g, RequirementMetadata as gn, Error$3 as gt, PartialError as h, Opaque as hn, DetachResult as ht, Error as i, Service$3 as in, Requirements$1 as it, ApplyReceipt as j, Error$5 as jn, decode$2 as jt, plan_d_exports as k, domain_name_d_exports as kn, authorizationError as kt, resolver_d_exports as l, Cname as ln, start as lt, Operation as m, Observed as mn, BindingModification as mt, AsyncInterface as n, Error$4 as nn, RemoveDomainInput as nt, Query as o, A as on, complete as ot, Error$1 as p, Ns as pn, Aggregate as pt, CompleteInput as q, Method$1 as qt, AsyncResolution as r, Interface$3 as rn, RemoveDomainResult as rt, Resolution as s, Aaaa as sn, extend as st, Answer as t, CreateResult$1 as tn, Method as tt, ApplyError as u, DnsRecord as un, Codec as ut, deletion_d_exports as v, Srv as vn, Service$2 as vt, ExactCreateInput as w, parse as wn, Grant as wt, ConflictError as x, data as xn, canonical_json_d_exports as xt, AuthorizationError as y, Txt as yn, lifecycle_repository_d_exports as yt, encodeReceipt as z, EvidenceSchema as zt };
4232
+ //# sourceMappingURL=resolver-uqe1h5Vz.d.mts.map