domainkit 0.1.1 → 0.2.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 (67) hide show
  1. package/README.md +87 -83
  2. package/dist/{auth-B0owkrpk.mjs → auth-CZ1pZHMZ.mjs} +212 -20
  3. package/dist/auth-CZ1pZHMZ.mjs.map +1 -0
  4. package/dist/{client-BnD7QLRF.mjs → auth-CzhZ3Cuc.mjs} +235 -131
  5. package/dist/auth-CzhZ3Cuc.mjs.map +1 -0
  6. package/dist/authorization-DOg2Re1D.mjs +247 -0
  7. package/dist/authorization-DOg2Re1D.mjs.map +1 -0
  8. package/dist/canonical-json-CpvqGMcr.mjs +57 -0
  9. package/dist/canonical-json-CpvqGMcr.mjs.map +1 -0
  10. package/dist/{cloudflare-D0-J2MfP.mjs → cloudflare-BedFw4cX.mjs} +26 -3
  11. package/dist/cloudflare-BedFw4cX.mjs.map +1 -0
  12. package/dist/cloudflare-FDl5q7Dm.d.mts +32 -0
  13. package/dist/cloudflare.d.mts +3 -3
  14. package/dist/cloudflare.mjs +2 -2
  15. package/dist/connection-BWrBwqjk.mjs +58 -0
  16. package/dist/connection-BWrBwqjk.mjs.map +1 -0
  17. package/dist/connection-CEqadXSm.d.mts +182 -0
  18. package/dist/connection-CcQokgrd.mjs +186 -0
  19. package/dist/connection-CcQokgrd.mjs.map +1 -0
  20. package/dist/connection-api-DftK7eHo.d.mts +7 -0
  21. package/dist/{dns-record-C_KwGPLf.mjs → dns-record-BLeqo56C.mjs} +23 -3
  22. package/dist/dns-record-BLeqo56C.mjs.map +1 -0
  23. package/dist/effect-cloudflare.d.mts +2 -2
  24. package/dist/effect-cloudflare.mjs +2 -2
  25. package/dist/effect-vercel.d.mts +2 -2
  26. package/dist/effect-vercel.mjs +2 -2
  27. package/dist/effect.d.mts +9 -46
  28. package/dist/effect.mjs +29 -7
  29. package/dist/effect.mjs.map +1 -1
  30. package/dist/{index-D2howbNz.d.mts → index-B1opsgls.d.mts} +53 -6
  31. package/dist/{index-CEzk2gbZ.d.mts → index-Ewc__bQu.d.mts} +58 -7
  32. package/dist/index.d.mts +169 -113
  33. package/dist/index.mjs +201 -139
  34. package/dist/index.mjs.map +1 -1
  35. package/dist/{resolver-BHPsADzE.d.mts → resolver-CJOR9mQ8.d.mts} +620 -263
  36. package/dist/resolver-CxE-VDw4.mjs +598 -0
  37. package/dist/resolver-CxE-VDw4.mjs.map +1 -0
  38. package/dist/testing.d.mts +53 -44
  39. package/dist/testing.mjs +379 -107
  40. package/dist/testing.mjs.map +1 -1
  41. package/dist/{vercel-DD89DCqH.mjs → vercel-CWZ33NUS.mjs} +23 -3
  42. package/dist/vercel-CWZ33NUS.mjs.map +1 -0
  43. package/dist/vercel-DgJaUX9D.d.mts +31 -0
  44. package/dist/vercel.d.mts +3 -3
  45. package/dist/vercel.mjs +2 -2
  46. package/dist/verify-BzpiA0Es.mjs +642 -0
  47. package/dist/verify-BzpiA0Es.mjs.map +1 -0
  48. package/dist/verify-DZWLM91T.d.mts +805 -0
  49. package/dist/zone-discovery-BA5I24vu.d.mts +1390 -0
  50. package/dist/zones-DKHTpX9C.mjs +19 -0
  51. package/dist/zones-DKHTpX9C.mjs.map +1 -0
  52. package/package.json +1 -1
  53. package/dist/auth-B0owkrpk.mjs.map +0 -1
  54. package/dist/client-BnD7QLRF.mjs.map +0 -1
  55. package/dist/cloudflare-CprjjXfm.d.mts +0 -23
  56. package/dist/cloudflare-D0-J2MfP.mjs.map +0 -1
  57. package/dist/dns-record-C_KwGPLf.mjs.map +0 -1
  58. package/dist/manifest-CP85ePFn.d.mts +0 -583
  59. package/dist/receipt-CGSnfZQ6.mjs +0 -28
  60. package/dist/receipt-CGSnfZQ6.mjs.map +0 -1
  61. package/dist/resolver-tEXpKxmH.mjs +0 -200
  62. package/dist/resolver-tEXpKxmH.mjs.map +0 -1
  63. package/dist/vercel-D-E2aqb1.d.mts +0 -22
  64. package/dist/vercel-DD89DCqH.mjs.map +0 -1
  65. package/dist/verify-B80xCBh2.d.mts +0 -1407
  66. package/dist/verify-BXOvXE20.mjs +0 -1388
  67. package/dist/verify-BXOvXE20.mjs.map +0 -1
@@ -1,249 +1,9 @@
1
- import { H as Error$2, N as Type, R as DomainName, d as Value, o as OAuthMethod } from "./manifest-CP85ePFn.mjs";
2
- import { Context, Effect, Layer, Schema } from "effect";
3
- declare namespace authorization_d_exports$1 {
4
- export { Capability, ProviderAuthorization, Schema$3 as Schema, decode$2 as decode, encode$2 as encode, validate$1 as validate };
5
- }
6
- declare const Capability: Schema.Literals<readonly ["dns:read", "dns:write"]>;
7
- type Capability = typeof Capability.Type;
8
- /** A provider credential authorization shared by one or more owner connections. */
9
- declare const Schema$3: Schema.Struct<{
10
- readonly accountId: Schema.String;
11
- readonly capabilities: Schema.$Array<Schema.Literals<readonly ["dns:read", "dns:write"]>>;
12
- readonly createdAt: Schema.DateFromString;
13
- readonly expiresAt: Schema.NullOr<Schema.DateFromString>;
14
- readonly id: Schema.String;
15
- readonly kind: Schema.Literals<readonly ["oauth2", "token"]>;
16
- readonly providerId: Schema.String;
17
- readonly scopes: Schema.$Array<Schema.String>;
18
- readonly subjectId: Schema.String;
19
- }>;
20
- interface ProviderAuthorization extends Schema.Schema.Type<typeof Schema$3> {}
21
- declare const decode$2: (input: unknown) => Effect.Effect<{
22
- readonly accountId: string;
23
- readonly capabilities: readonly ("dns:read" | "dns:write")[];
24
- readonly createdAt: Date;
25
- readonly expiresAt: Date | null;
26
- readonly id: string;
27
- readonly kind: "oauth2" | "token";
28
- readonly providerId: string;
29
- readonly scopes: readonly string[];
30
- readonly subjectId: string;
31
- }, Error$2, never>;
32
- declare const validate$1: (input: unknown) => Effect.Effect<{
33
- readonly accountId: string;
34
- readonly capabilities: readonly ("dns:read" | "dns:write")[];
35
- readonly createdAt: Date;
36
- readonly expiresAt: Date | null;
37
- readonly id: string;
38
- readonly kind: "oauth2" | "token";
39
- readonly providerId: string;
40
- readonly scopes: readonly string[];
41
- readonly subjectId: string;
42
- }, Error$2, never>;
43
- declare const encode$2: (input: {
44
- readonly accountId: string;
45
- readonly capabilities: readonly ("dns:read" | "dns:write")[];
46
- readonly createdAt: Date;
47
- readonly expiresAt: Date | null;
48
- readonly id: string;
49
- readonly kind: "oauth2" | "token";
50
- readonly providerId: string;
51
- readonly scopes: readonly string[];
52
- readonly subjectId: string;
53
- }, options?: import("effect/SchemaAST").ParseOptions) => {
54
- readonly accountId: string;
55
- readonly capabilities: readonly ("dns:read" | "dns:write")[];
56
- readonly createdAt: string;
57
- readonly expiresAt: string | null;
58
- readonly id: string;
59
- readonly kind: "oauth2" | "token";
60
- readonly providerId: string;
61
- readonly scopes: readonly string[];
62
- readonly subjectId: string;
63
- };
64
- declare namespace connection_d_exports$1 {
65
- export { AuthorizationError, Connection, Grant, OAuthContinuation, Schema$2 as Schema, StoredCredential, assertGrant, decode$1 as decode, encode$1 as encode, validate };
66
- }
67
- declare const Grant: Schema.TaggedUnion<{
68
- readonly account: Schema.TaggedStruct<"account", {}>;
69
- readonly domains: Schema.TaggedStruct<"domains", {
70
- readonly domains: Schema.$Array<Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>>;
71
- }>;
72
- }>;
73
- type Grant = typeof Grant.Type;
74
- /** An owner-scoped grant bound to one provider authorization. */
75
- declare const Schema$2: Schema.Struct<{
76
- readonly authorizationId: Schema.String;
77
- readonly createdAt: Schema.DateFromString;
78
- readonly grant: Schema.TaggedUnion<{
79
- readonly account: Schema.TaggedStruct<"account", {}>;
80
- readonly domains: Schema.TaggedStruct<"domains", {
81
- readonly domains: Schema.$Array<Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>>;
82
- }>;
83
- }>;
84
- readonly id: Schema.String;
85
- readonly ownerId: Schema.String;
86
- }>;
87
- interface Connection extends Schema.Schema.Type<typeof Schema$2> {}
88
- declare const decode$1: (input: unknown) => Effect.Effect<{
89
- readonly authorizationId: string;
90
- readonly createdAt: Date;
91
- readonly grant: {
92
- readonly _tag: "account";
93
- } | {
94
- readonly _tag: "domains";
95
- readonly domains: readonly (string & import("effect/Brand").Brand<"DomainName">)[];
96
- };
97
- readonly id: string;
98
- readonly ownerId: string;
99
- }, Error$2, never>;
100
- declare const validate: (input: unknown) => Effect.Effect<{
101
- readonly authorizationId: string;
102
- readonly createdAt: Date;
103
- readonly grant: {
104
- readonly _tag: "account";
105
- } | {
106
- readonly _tag: "domains";
107
- readonly domains: readonly (string & import("effect/Brand").Brand<"DomainName">)[];
108
- };
109
- readonly id: string;
110
- readonly ownerId: string;
111
- }, Error$2, never>;
112
- declare const encode$1: (input: {
113
- readonly authorizationId: string;
114
- readonly createdAt: Date;
115
- readonly grant: {
116
- readonly _tag: "account";
117
- } | {
118
- readonly _tag: "domains";
119
- readonly domains: readonly (string & import("effect/Brand").Brand<"DomainName">)[];
120
- };
121
- readonly id: string;
122
- readonly ownerId: string;
123
- }, options?: import("effect/SchemaAST").ParseOptions) => {
124
- readonly authorizationId: string;
125
- readonly createdAt: string;
126
- readonly grant: {
127
- readonly _tag: "account";
128
- } | {
129
- readonly _tag: "domains";
130
- readonly domains: readonly string[];
131
- };
132
- readonly id: string;
133
- readonly ownerId: string;
134
- };
135
- interface OAuthContinuation {
136
- readonly clientId: string;
137
- readonly codeVerifier: Value;
138
- readonly expiresAt: Date;
139
- readonly grant: Grant;
140
- readonly method: OAuthMethod;
141
- readonly ownerId: string;
142
- readonly redirectUri: string;
143
- readonly stateHash: string;
144
- readonly subjectId: string;
145
- }
146
- interface StoredCredential {
147
- readonly accessToken: Value;
148
- readonly refreshToken: Value | null;
149
- readonly tokenType: string;
150
- }
151
- declare const AuthorizationError_base: Schema.Class<AuthorizationError, Schema.TaggedStruct<"AuthorizationError", {
152
- readonly message: Schema.String;
153
- }>, import("effect/Cause").YieldableError>;
154
- declare class AuthorizationError extends AuthorizationError_base {}
155
- declare function assertGrant(connection: Connection, authorization: ProviderAuthorization, request: {
156
- readonly capability: Capability;
157
- readonly domain: string;
158
- readonly now?: Date;
159
- readonly providerId: string;
160
- }): DomainName;
161
- declare namespace error_d_exports {
162
- export { Error$1 as Error, fromCause };
163
- }
164
- declare const Error_base$1: Schema.Class<Error$1, Schema.TaggedStruct<"StorageError", {
165
- readonly cause: Schema.optionalKey<Schema.Unknown>;
166
- readonly message: Schema.String;
167
- readonly operation: Schema.String;
168
- }>, import("effect/Cause").YieldableError>;
169
- declare class Error$1 extends Error_base$1 {}
170
- declare function fromCause(operation: string, cause: unknown): Error$1;
171
- declare namespace connection_d_exports {
172
- export { AsyncInterface$5 as AsyncInterface, Interface$5 as Interface, Service$5 as Service, layerFromAsync$5 as layerFromAsync, toAsync$5 as toAsync };
173
- }
174
- interface Interface$5 {
175
- readonly delete: (connectionId: string) => Effect.Effect<void, Error$1>;
176
- readonly find: (ownerId: string, authorizationId: string) => Effect.Effect<Connection | null, Error$1>;
177
- readonly get: (connectionId: string) => Effect.Effect<Connection | null, Error$1>;
178
- readonly listByAuthorizationId: (authorizationId: string) => Effect.Effect<ReadonlyArray<Connection>, Error$1>;
179
- readonly put: (connection: Connection) => Effect.Effect<void, Error$1>;
180
- }
181
- declare const Service_base$5: Context.ServiceClass<Service$5, "@domainkit/ConnectionStore", Interface$5>;
182
- declare class Service$5 extends Service_base$5 {}
183
- interface AsyncInterface$5 {
184
- readonly delete: (connectionId: string) => Promise<void>;
185
- readonly find: (ownerId: string, authorizationId: string) => Promise<Connection | null>;
186
- readonly get: (connectionId: string) => Promise<Connection | null>;
187
- readonly listByAuthorizationId: (authorizationId: string) => Promise<ReadonlyArray<Connection>>;
188
- readonly put: (connection: Connection) => Promise<void>;
189
- }
190
- declare const toAsync$5: (store: Interface$5) => AsyncInterface$5;
191
- declare const layerFromAsync$5: (store: AsyncInterface$5) => Layer.Layer<Service$5>;
192
- declare namespace credential_d_exports {
193
- export { AsyncInterface$4 as AsyncInterface, Interface$4 as Interface, Service$4 as Service, layerFromAsync$4 as layerFromAsync, toAsync$4 as toAsync };
194
- }
195
- interface Interface$4 {
196
- readonly delete: (authorizationId: string) => Effect.Effect<void, Error$1>;
197
- readonly get: (authorizationId: string) => Effect.Effect<StoredCredential | null, Error$1>;
198
- readonly put: (authorizationId: string, credential: StoredCredential) => Effect.Effect<void, Error$1>;
199
- }
200
- declare const Service_base$4: Context.ServiceClass<Service$4, "@domainkit/CredentialStore", Interface$4>;
201
- declare class Service$4 extends Service_base$4 {}
202
- interface AsyncInterface$4 {
203
- readonly delete: (authorizationId: string) => Promise<void>;
204
- readonly get: (authorizationId: string) => Promise<StoredCredential | null>;
205
- readonly put: (authorizationId: string, credential: StoredCredential) => Promise<void>;
206
- }
207
- declare const toAsync$4: (store: Interface$4) => AsyncInterface$4;
208
- declare const layerFromAsync$4: (store: AsyncInterface$4) => Layer.Layer<Service$4>;
209
- declare namespace authorization_d_exports {
210
- export { AsyncInterface$3 as AsyncInterface, Interface$3 as Interface, Service$3 as Service, layerFromAsync$3 as layerFromAsync, toAsync$3 as toAsync };
211
- }
212
- interface Interface$3 {
213
- readonly delete: (authorizationId: string) => Effect.Effect<void, Error$1>;
214
- readonly findByProviderAccount: (providerId: string, accountId: string) => Effect.Effect<ProviderAuthorization | null, Error$1>;
215
- readonly get: (authorizationId: string) => Effect.Effect<ProviderAuthorization | null, Error$1>;
216
- readonly put: (authorization: ProviderAuthorization) => Effect.Effect<void, Error$1>;
217
- }
218
- declare const Service_base$3: Context.ServiceClass<Service$3, "@domainkit/ProviderAuthorizationStore", Interface$3>;
219
- declare class Service$3 extends Service_base$3 {}
220
- interface AsyncInterface$3 {
221
- readonly delete: (authorizationId: string) => Promise<void>;
222
- readonly findByProviderAccount: (providerId: string, accountId: string) => Promise<ProviderAuthorization | null>;
223
- readonly get: (authorizationId: string) => Promise<ProviderAuthorization | null>;
224
- readonly put: (authorization: ProviderAuthorization) => Promise<void>;
225
- }
226
- declare const toAsync$3: (store: Interface$3) => AsyncInterface$3;
227
- declare const layerFromAsync$3: (store: AsyncInterface$3) => Layer.Layer<Service$3>;
228
- declare namespace oauth_state_d_exports {
229
- export { AsyncInterface$2 as AsyncInterface, Interface$2 as Interface, Service$2 as Service, layerFromAsync$2 as layerFromAsync, toAsync$2 as toAsync };
230
- }
231
- interface Interface$2 {
232
- readonly consume: (stateHash: string, now: Date) => Effect.Effect<OAuthContinuation | null, Error$1>;
233
- readonly put: (continuation: OAuthContinuation) => Effect.Effect<void, Error$1>;
234
- }
235
- declare const Service_base$2: Context.ServiceClass<Service$2, "@domainkit/OAuthStateStore", Interface$2>;
236
- declare class Service$2 extends Service_base$2 {}
237
- interface AsyncInterface$2 {
238
- readonly consume: (stateHash: string, now: Date) => Promise<OAuthContinuation | null>;
239
- readonly put: (continuation: OAuthContinuation) => Promise<void>;
240
- }
241
- declare const toAsync$2: (store: Interface$2) => AsyncInterface$2;
242
- declare const layerFromAsync$2: (store: AsyncInterface$2) => Layer.Layer<Service$2>;
1
+ import { J as CryptoError, Lt as Error$2, Nt as DomainName, Ot as Type, ft as Service$1, n as Service$2, t as Candidate, ut as Error$3, vt as DnsRecord, yt as Encoded } from "./zone-discovery-BA5I24vu.mjs";
2
+ import { Cause, Context, Crypto, Data, Effect, Layer, Schema } from "effect";
243
3
  declare namespace types_d_exports {
244
- export { ApplyReceipt, Authorization, DnsPlan, Operation, PlanAuthorization, Receipt, Schema$1 as Schema, decode, decodeReceipt, encode, encodeReceipt };
4
+ export { ApplyReceipt, Authorization$1 as Authorization, DnsPlan, Operation$1 as Operation, PlanAuthorization, Receipt$1 as Receipt, Schema$1 as Schema, decode, decodeReceipt, encode, encodeReceipt };
245
5
  }
246
- declare const Operation: Schema.TaggedUnion<{
6
+ declare const Operation$1: Schema.TaggedUnion<{
247
7
  readonly conflict: Schema.TaggedStruct<"conflict", {
248
8
  readonly existing: Schema.$Array<Schema.Union<readonly [Schema.TaggedUnion<{
249
9
  readonly A: Schema.TaggedStruct<"A", {
@@ -645,7 +405,7 @@ declare const Operation: Schema.TaggedUnion<{
645
405
  readonly ttlDrift: Schema.Boolean;
646
406
  }>;
647
407
  }>;
648
- type Operation = typeof Operation.Type;
408
+ type Operation$1 = typeof Operation$1.Type;
649
409
  declare const Schema$1: Schema.Struct<{
650
410
  readonly digest: Schema.String;
651
411
  readonly operations: Schema.$Array<Schema.TaggedUnion<{
@@ -1055,14 +815,14 @@ declare const Schema$1: Schema.Struct<{
1055
815
  readonly zone: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
1056
816
  }>;
1057
817
  interface DnsPlan extends Schema.Schema.Type<typeof Schema$1> {}
1058
- declare const Authorization: Schema.Struct<{
818
+ declare const Authorization$1: Schema.Struct<{
1059
819
  readonly allowPartial: Schema.Boolean;
1060
820
  readonly operationIds: Schema.$Array<Schema.String>;
1061
821
  readonly planDigest: Schema.String;
1062
822
  readonly version: Schema.Literal<"domainkit.plan-authorization.v1">;
1063
823
  }>;
1064
- interface PlanAuthorization extends Schema.Schema.Type<typeof Authorization> {}
1065
- declare const Receipt: Schema.Struct<{
824
+ interface PlanAuthorization extends Schema.Schema.Type<typeof Authorization$1> {}
825
+ declare const Receipt$1: Schema.Struct<{
1066
826
  readonly appliedAt: Schema.DateFromString;
1067
827
  readonly operations: Schema.$Array<Schema.Struct<{
1068
828
  readonly operationId: Schema.String;
@@ -1074,7 +834,7 @@ declare const Receipt: Schema.Struct<{
1074
834
  readonly version: Schema.Literal<"domainkit.apply-receipt.v1">;
1075
835
  readonly zone: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
1076
836
  }>;
1077
- interface ApplyReceipt extends Schema.Schema.Type<typeof Receipt> {}
837
+ interface ApplyReceipt extends Schema.Schema.Type<typeof Receipt$1> {}
1078
838
  declare const decode: (input: unknown) => Effect.Effect<{
1079
839
  readonly digest: string;
1080
840
  readonly operations: readonly ({
@@ -2318,21 +2078,618 @@ declare const encodeReceipt: (input: {
2318
2078
  readonly version: "domainkit.apply-receipt.v1";
2319
2079
  readonly zone: string;
2320
2080
  };
2321
- declare namespace receipt_d_exports {
2322
- export { AsyncInterface$1 as AsyncInterface, Interface$1 as Interface, Service$1 as Service, layerFromAsync$1 as layerFromAsync, toAsync$1 as toAsync };
2081
+ declare namespace plan_d_exports {
2082
+ export { ApplyError$1 as ApplyError, ApplyInput, AuthorizationError, AuthorizeError, ConflictError, CreateError$1 as CreateError, CreateInput$1 as CreateInput, CreateResult, DiscoverCreateInput, ExactCreateInput, PartialApplyError, ResolvedCreateResult, StaleError, Target, apply$1 as apply, authorize$1 as authorize, create$1 as create, renderManualInstructions, validate$1 as validate };
2323
2083
  }
2324
- interface Interface$1 {
2325
- readonly get: (planDigest: string) => Effect.Effect<ApplyReceipt | null, Error$1>;
2326
- readonly put: (receipt: ApplyReceipt) => Effect.Effect<void, Error$1>;
2084
+ declare const ConflictError_base: Schema.Class<ConflictError, Schema.TaggedStruct<"PlanConflictError", {
2085
+ readonly operationIds: Schema.$Array<Schema.String>;
2086
+ }>, Cause.YieldableError>;
2087
+ declare class ConflictError extends ConflictError_base {}
2088
+ declare const AuthorizationError_base: Schema.Class<AuthorizationError, Schema.TaggedStruct<"AuthorizationError", {
2089
+ readonly message: Schema.String;
2090
+ }>, Cause.YieldableError>;
2091
+ declare class AuthorizationError extends AuthorizationError_base {}
2092
+ declare const StaleError_base: Schema.Class<StaleError, Schema.TaggedStruct<"StalePlanError", {
2093
+ readonly approvedPlanDigest: Schema.String;
2094
+ readonly currentPlanDigest: Schema.String;
2095
+ }>, Cause.YieldableError>;
2096
+ declare class StaleError extends StaleError_base {}
2097
+ declare const PartialApplyError_base: Schema.Class<PartialApplyError, Schema.TaggedStruct<"PartialApplyError", {
2098
+ readonly causeTag: Schema.Literals<readonly ["CryptoError", "InvalidInputError", "Interrupted", "ProviderError", "StalePlanError"]>;
2099
+ readonly failedOperationId: Schema.String;
2100
+ readonly message: Schema.String;
2101
+ readonly receipt: Schema.Struct<{
2102
+ readonly appliedAt: Schema.DateFromString;
2103
+ readonly operations: Schema.$Array<Schema.Struct<{
2104
+ readonly operationId: Schema.String;
2105
+ readonly providerRecordId: Schema.NullOr<Schema.String>;
2106
+ }>>;
2107
+ readonly planDigest: Schema.String;
2108
+ readonly providerId: Schema.String;
2109
+ readonly status: Schema.Literals<readonly ["complete", "partial"]>;
2110
+ readonly version: Schema.Literal<"domainkit.apply-receipt.v1">;
2111
+ readonly zone: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2112
+ }>;
2113
+ }>, Cause.YieldableError>;
2114
+ declare class PartialApplyError extends PartialApplyError_base {}
2115
+ type Target = Data.TaggedEnum<{
2116
+ DiscoverFromDomain: {
2117
+ readonly domain: string;
2118
+ };
2119
+ ExactZone: {
2120
+ readonly zone: string;
2121
+ };
2122
+ }>;
2123
+ declare const Target: {
2124
+ readonly $is: <Tag extends "DiscoverFromDomain" | "ExactZone">(tag: Tag) => (u: unknown) => u is Extract<{
2125
+ readonly _tag: "DiscoverFromDomain";
2126
+ readonly domain: string;
2127
+ }, {
2128
+ readonly _tag: Tag;
2129
+ }> | Extract<{
2130
+ readonly _tag: "ExactZone";
2131
+ readonly zone: string;
2132
+ }, {
2133
+ readonly _tag: Tag;
2134
+ }>;
2135
+ readonly $match: {
2136
+ <Cases extends { readonly [Tag in "DiscoverFromDomain" | "ExactZone"]: (args: Extract<{
2137
+ readonly _tag: "DiscoverFromDomain";
2138
+ readonly domain: string;
2139
+ } | {
2140
+ readonly _tag: "ExactZone";
2141
+ readonly zone: string;
2142
+ }, {
2143
+ readonly _tag: Tag;
2144
+ }>) => any; }>(cases: Cases): (value: {
2145
+ readonly _tag: "DiscoverFromDomain";
2146
+ readonly domain: string;
2147
+ } | {
2148
+ readonly _tag: "ExactZone";
2149
+ readonly zone: string;
2150
+ }) => import("effect/Unify").Unify<ReturnType<Cases["DiscoverFromDomain" | "ExactZone"]>>;
2151
+ <Cases extends { readonly [Tag in "DiscoverFromDomain" | "ExactZone"]: (args: Extract<{
2152
+ readonly _tag: "DiscoverFromDomain";
2153
+ readonly domain: string;
2154
+ } | {
2155
+ readonly _tag: "ExactZone";
2156
+ readonly zone: string;
2157
+ }, {
2158
+ readonly _tag: Tag;
2159
+ }>) => any; }>(value: {
2160
+ readonly _tag: "DiscoverFromDomain";
2161
+ readonly domain: string;
2162
+ } | {
2163
+ readonly _tag: "ExactZone";
2164
+ readonly zone: string;
2165
+ }, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["DiscoverFromDomain" | "ExactZone"]>>;
2166
+ };
2167
+ readonly DiscoverFromDomain: Data.TaggedEnum.ConstructorFrom<{
2168
+ readonly _tag: "DiscoverFromDomain";
2169
+ readonly domain: string;
2170
+ }, "_tag">;
2171
+ readonly ExactZone: Data.TaggedEnum.ConstructorFrom<{
2172
+ readonly _tag: "ExactZone";
2173
+ readonly zone: string;
2174
+ }, "_tag">;
2175
+ };
2176
+ type CreateResult = Data.TaggedEnum<{
2177
+ NotFound: {
2178
+ readonly domain: DomainName;
2179
+ };
2180
+ Resolved: {
2181
+ readonly candidate: Candidate | null;
2182
+ readonly plan: DnsPlan;
2183
+ };
2184
+ SelectionRequired: {
2185
+ readonly candidates: ReadonlyArray<Candidate>;
2186
+ };
2187
+ }>;
2188
+ declare const CreateResult: {
2189
+ readonly $is: <Tag extends "NotFound" | "Resolved" | "SelectionRequired">(tag: Tag) => (u: unknown) => u is Extract<{
2190
+ readonly _tag: "NotFound";
2191
+ readonly domain: DomainName;
2192
+ }, {
2193
+ readonly _tag: Tag;
2194
+ }> | Extract<{
2195
+ readonly _tag: "Resolved";
2196
+ readonly candidate: Candidate | null;
2197
+ readonly plan: DnsPlan;
2198
+ }, {
2199
+ readonly _tag: Tag;
2200
+ }> | Extract<{
2201
+ readonly _tag: "SelectionRequired";
2202
+ readonly candidates: ReadonlyArray<Candidate>;
2203
+ }, {
2204
+ readonly _tag: Tag;
2205
+ }>;
2206
+ readonly $match: {
2207
+ <Cases extends { readonly [Tag in "NotFound" | "Resolved" | "SelectionRequired"]: (args: Extract<{
2208
+ readonly _tag: "NotFound";
2209
+ readonly domain: DomainName;
2210
+ } | {
2211
+ readonly _tag: "Resolved";
2212
+ readonly candidate: Candidate | null;
2213
+ readonly plan: DnsPlan;
2214
+ } | {
2215
+ readonly _tag: "SelectionRequired";
2216
+ readonly candidates: ReadonlyArray<Candidate>;
2217
+ }, {
2218
+ readonly _tag: Tag;
2219
+ }>) => any; }>(cases: Cases): (value: {
2220
+ readonly _tag: "NotFound";
2221
+ readonly domain: DomainName;
2222
+ } | {
2223
+ readonly _tag: "Resolved";
2224
+ readonly candidate: Candidate | null;
2225
+ readonly plan: DnsPlan;
2226
+ } | {
2227
+ readonly _tag: "SelectionRequired";
2228
+ readonly candidates: ReadonlyArray<Candidate>;
2229
+ }) => import("effect/Unify").Unify<ReturnType<Cases["NotFound" | "Resolved" | "SelectionRequired"]>>;
2230
+ <Cases extends { readonly [Tag in "NotFound" | "Resolved" | "SelectionRequired"]: (args: Extract<{
2231
+ readonly _tag: "NotFound";
2232
+ readonly domain: DomainName;
2233
+ } | {
2234
+ readonly _tag: "Resolved";
2235
+ readonly candidate: Candidate | null;
2236
+ readonly plan: DnsPlan;
2237
+ } | {
2238
+ readonly _tag: "SelectionRequired";
2239
+ readonly candidates: ReadonlyArray<Candidate>;
2240
+ }, {
2241
+ readonly _tag: Tag;
2242
+ }>) => any; }>(value: {
2243
+ readonly _tag: "NotFound";
2244
+ readonly domain: DomainName;
2245
+ } | {
2246
+ readonly _tag: "Resolved";
2247
+ readonly candidate: Candidate | null;
2248
+ readonly plan: DnsPlan;
2249
+ } | {
2250
+ readonly _tag: "SelectionRequired";
2251
+ readonly candidates: ReadonlyArray<Candidate>;
2252
+ }, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["NotFound" | "Resolved" | "SelectionRequired"]>>;
2253
+ };
2254
+ readonly NotFound: Data.TaggedEnum.ConstructorFrom<{
2255
+ readonly _tag: "NotFound";
2256
+ readonly domain: DomainName;
2257
+ }, "_tag">;
2258
+ readonly Resolved: Data.TaggedEnum.ConstructorFrom<{
2259
+ readonly _tag: "Resolved";
2260
+ readonly candidate: Candidate | null;
2261
+ readonly plan: DnsPlan;
2262
+ }, "_tag">;
2263
+ readonly SelectionRequired: Data.TaggedEnum.ConstructorFrom<{
2264
+ readonly _tag: "SelectionRequired";
2265
+ readonly candidates: ReadonlyArray<Candidate>;
2266
+ }, "_tag">;
2267
+ };
2268
+ type ResolvedCreateResult = Extract<CreateResult, {
2269
+ readonly _tag: "Resolved";
2270
+ }>;
2271
+ interface CreateInput$1 {
2272
+ readonly requirements: ReadonlyArray<Encoded | DnsRecord>;
2273
+ readonly target: Target;
2327
2274
  }
2328
- declare const Service_base$1: Context.ServiceClass<Service$1, "@domainkit/ReceiptStore", Interface$1>;
2329
- declare class Service$1 extends Service_base$1 {}
2330
- interface AsyncInterface$1 {
2331
- readonly get: (planDigest: string) => Promise<ApplyReceipt | null>;
2332
- readonly put: (receipt: ApplyReceipt) => Promise<void>;
2275
+ type ExactCreateInput = Omit<CreateInput$1, "target"> & {
2276
+ readonly target: Extract<Target, {
2277
+ readonly _tag: "ExactZone";
2278
+ }>;
2279
+ };
2280
+ type DiscoverCreateInput = Omit<CreateInput$1, "target"> & {
2281
+ readonly target: Extract<Target, {
2282
+ readonly _tag: "DiscoverFromDomain";
2283
+ }>;
2284
+ };
2285
+ interface ApplyInput {
2286
+ readonly authorization: PlanAuthorization;
2287
+ readonly plan: DnsPlan;
2288
+ }
2289
+ type CreateError$1 = Error$2 | Error$3 | CryptoError;
2290
+ type AuthorizeError = AuthorizationError | CryptoError;
2291
+ type ApplyError$1 = Error$2 | Error$3 | CryptoError | AuthorizationError | ConflictError | StaleError | PartialApplyError;
2292
+ /** 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>;
2295
+ /** Authorizes all or a selected subset of create operations in a digest-bound plan. */
2296
+ declare const authorize$1: (plan: DnsPlan, operationIds?: readonly string[] | undefined, options?: {
2297
+ readonly allowPartial?: boolean;
2298
+ } | undefined) => Effect.Effect<{
2299
+ allowPartial: boolean;
2300
+ operationIds: string[];
2301
+ planDigest: string;
2302
+ version: "domainkit.plan-authorization.v1";
2303
+ }, AuthorizeError, Crypto.Crypto>;
2304
+ /** 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>;
2306
+ declare function renderManualInstructions(plan: DnsPlan): ReadonlyArray<string>;
2307
+ declare function validate$1(plan: DnsPlan): Effect.Effect<void, AuthorizeError, Crypto.Crypto>;
2308
+ declare namespace deletion_d_exports {
2309
+ export { ApplyError, Authorization, CreateError, CreateInput, Error$1 as Error, Operation, PartialError, Plan, Receipt, Requirements, apply, authorize, create, validate };
2333
2310
  }
2334
- declare const toAsync$1: (store: Interface$1) => AsyncInterface$1;
2335
- declare const layerFromAsync$1: (store: AsyncInterface$1) => Layer.Layer<Service$1>;
2311
+ declare const Operation: Schema.Struct<{
2312
+ readonly id: Schema.String;
2313
+ readonly providerRecordId: Schema.String;
2314
+ readonly record: Schema.TaggedUnion<{
2315
+ readonly A: Schema.TaggedStruct<"A", {
2316
+ readonly metadata: Schema.Struct<{
2317
+ readonly ownership: Schema.String;
2318
+ readonly provenance: Schema.String;
2319
+ readonly purpose: Schema.String;
2320
+ }>;
2321
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2322
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
2323
+ readonly ttl: Schema.NullOr<Schema.Int>;
2324
+ readonly address: Schema.String;
2325
+ }>;
2326
+ readonly AAAA: Schema.TaggedStruct<"AAAA", {
2327
+ readonly metadata: Schema.Struct<{
2328
+ readonly ownership: Schema.String;
2329
+ readonly provenance: Schema.String;
2330
+ readonly purpose: Schema.String;
2331
+ }>;
2332
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2333
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
2334
+ readonly ttl: Schema.NullOr<Schema.Int>;
2335
+ readonly address: Schema.String;
2336
+ }>;
2337
+ readonly CAA: Schema.TaggedStruct<"CAA", {
2338
+ readonly metadata: Schema.Struct<{
2339
+ readonly ownership: Schema.String;
2340
+ readonly provenance: Schema.String;
2341
+ readonly purpose: Schema.String;
2342
+ }>;
2343
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2344
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
2345
+ readonly ttl: Schema.NullOr<Schema.Int>;
2346
+ readonly flags: Schema.Int;
2347
+ readonly tag: Schema.Literals<readonly ["issue", "issuewild", "iodef"]>;
2348
+ readonly value: Schema.String;
2349
+ }>;
2350
+ readonly CNAME: Schema.TaggedStruct<"CNAME", {
2351
+ readonly metadata: Schema.Struct<{
2352
+ readonly ownership: Schema.String;
2353
+ readonly provenance: Schema.String;
2354
+ readonly purpose: Schema.String;
2355
+ }>;
2356
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2357
+ readonly ttl: Schema.NullOr<Schema.Int>;
2358
+ readonly policy: Schema.Literal<"exclusive">;
2359
+ readonly target: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2360
+ }>;
2361
+ readonly MX: Schema.TaggedStruct<"MX", {
2362
+ readonly metadata: Schema.Struct<{
2363
+ readonly ownership: Schema.String;
2364
+ readonly provenance: Schema.String;
2365
+ readonly purpose: Schema.String;
2366
+ }>;
2367
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2368
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
2369
+ readonly ttl: Schema.NullOr<Schema.Int>;
2370
+ readonly exchange: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2371
+ readonly priority: Schema.Int;
2372
+ }>;
2373
+ readonly NS: Schema.TaggedStruct<"NS", {
2374
+ readonly metadata: Schema.Struct<{
2375
+ readonly ownership: Schema.String;
2376
+ readonly provenance: Schema.String;
2377
+ readonly purpose: Schema.String;
2378
+ }>;
2379
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2380
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
2381
+ readonly ttl: Schema.NullOr<Schema.Int>;
2382
+ readonly target: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2383
+ }>;
2384
+ readonly SRV: Schema.TaggedStruct<"SRV", {
2385
+ readonly metadata: Schema.Struct<{
2386
+ readonly ownership: Schema.String;
2387
+ readonly provenance: Schema.String;
2388
+ readonly purpose: Schema.String;
2389
+ }>;
2390
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2391
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
2392
+ readonly ttl: Schema.NullOr<Schema.Int>;
2393
+ readonly port: Schema.Int;
2394
+ readonly priority: Schema.Int;
2395
+ readonly target: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2396
+ readonly weight: Schema.Int;
2397
+ }>;
2398
+ readonly TXT: Schema.TaggedStruct<"TXT", {
2399
+ readonly metadata: Schema.Struct<{
2400
+ readonly ownership: Schema.String;
2401
+ readonly provenance: Schema.String;
2402
+ readonly purpose: Schema.String;
2403
+ }>;
2404
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2405
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
2406
+ readonly ttl: Schema.NullOr<Schema.Int>;
2407
+ readonly value: Schema.String;
2408
+ }>;
2409
+ }>;
2410
+ }>;
2411
+ interface Operation extends Schema.Schema.Type<typeof Operation> {}
2412
+ declare const Plan: Schema.Struct<{
2413
+ readonly createdAt: Schema.DateFromString;
2414
+ readonly expiresAt: Schema.DateFromString;
2415
+ readonly operations: Schema.$Array<Schema.Struct<{
2416
+ readonly id: Schema.String;
2417
+ readonly providerRecordId: Schema.String;
2418
+ readonly record: Schema.TaggedUnion<{
2419
+ readonly A: Schema.TaggedStruct<"A", {
2420
+ readonly metadata: Schema.Struct<{
2421
+ readonly ownership: Schema.String;
2422
+ readonly provenance: Schema.String;
2423
+ readonly purpose: Schema.String;
2424
+ }>;
2425
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2426
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
2427
+ readonly ttl: Schema.NullOr<Schema.Int>;
2428
+ readonly address: Schema.String;
2429
+ }>;
2430
+ readonly AAAA: Schema.TaggedStruct<"AAAA", {
2431
+ readonly metadata: Schema.Struct<{
2432
+ readonly ownership: Schema.String;
2433
+ readonly provenance: Schema.String;
2434
+ readonly purpose: Schema.String;
2435
+ }>;
2436
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2437
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
2438
+ readonly ttl: Schema.NullOr<Schema.Int>;
2439
+ readonly address: Schema.String;
2440
+ }>;
2441
+ readonly CAA: Schema.TaggedStruct<"CAA", {
2442
+ readonly metadata: Schema.Struct<{
2443
+ readonly ownership: Schema.String;
2444
+ readonly provenance: Schema.String;
2445
+ readonly purpose: Schema.String;
2446
+ }>;
2447
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2448
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
2449
+ readonly ttl: Schema.NullOr<Schema.Int>;
2450
+ readonly flags: Schema.Int;
2451
+ readonly tag: Schema.Literals<readonly ["issue", "issuewild", "iodef"]>;
2452
+ readonly value: Schema.String;
2453
+ }>;
2454
+ readonly CNAME: Schema.TaggedStruct<"CNAME", {
2455
+ readonly metadata: Schema.Struct<{
2456
+ readonly ownership: Schema.String;
2457
+ readonly provenance: Schema.String;
2458
+ readonly purpose: Schema.String;
2459
+ }>;
2460
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2461
+ readonly ttl: Schema.NullOr<Schema.Int>;
2462
+ readonly policy: Schema.Literal<"exclusive">;
2463
+ readonly target: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2464
+ }>;
2465
+ readonly MX: Schema.TaggedStruct<"MX", {
2466
+ readonly metadata: Schema.Struct<{
2467
+ readonly ownership: Schema.String;
2468
+ readonly provenance: Schema.String;
2469
+ readonly purpose: Schema.String;
2470
+ }>;
2471
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2472
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
2473
+ readonly ttl: Schema.NullOr<Schema.Int>;
2474
+ readonly exchange: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2475
+ readonly priority: Schema.Int;
2476
+ }>;
2477
+ readonly NS: Schema.TaggedStruct<"NS", {
2478
+ readonly metadata: Schema.Struct<{
2479
+ readonly ownership: Schema.String;
2480
+ readonly provenance: Schema.String;
2481
+ readonly purpose: Schema.String;
2482
+ }>;
2483
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2484
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
2485
+ readonly ttl: Schema.NullOr<Schema.Int>;
2486
+ readonly target: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2487
+ }>;
2488
+ readonly SRV: Schema.TaggedStruct<"SRV", {
2489
+ readonly metadata: Schema.Struct<{
2490
+ readonly ownership: Schema.String;
2491
+ readonly provenance: Schema.String;
2492
+ readonly purpose: Schema.String;
2493
+ }>;
2494
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2495
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
2496
+ readonly ttl: Schema.NullOr<Schema.Int>;
2497
+ readonly port: Schema.Int;
2498
+ readonly priority: Schema.Int;
2499
+ readonly target: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2500
+ readonly weight: Schema.Int;
2501
+ }>;
2502
+ readonly TXT: Schema.TaggedStruct<"TXT", {
2503
+ readonly metadata: Schema.Struct<{
2504
+ readonly ownership: Schema.String;
2505
+ readonly provenance: Schema.String;
2506
+ readonly purpose: Schema.String;
2507
+ }>;
2508
+ readonly name: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2509
+ readonly policy: Schema.Literals<readonly ["exclusive", "append"]>;
2510
+ readonly ttl: Schema.NullOr<Schema.Int>;
2511
+ readonly value: Schema.String;
2512
+ }>;
2513
+ }>;
2514
+ }>>;
2515
+ readonly providerId: Schema.String;
2516
+ readonly sourcePlanDigest: Schema.String;
2517
+ readonly version: Schema.Literal<"domainkit.deletion-plan.v1">;
2518
+ readonly zone: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2519
+ readonly digest: Schema.String;
2520
+ }>;
2521
+ interface Plan extends Schema.Schema.Type<typeof Plan> {}
2522
+ declare const Authorization: Schema.Struct<{
2523
+ readonly operationIds: Schema.$Array<Schema.String>;
2524
+ readonly planDigest: Schema.String;
2525
+ readonly version: Schema.Literal<"domainkit.deletion-authorization.v1">;
2526
+ }>;
2527
+ interface Authorization extends Schema.Schema.Type<typeof Authorization> {}
2528
+ declare const Receipt: Schema.Struct<{
2529
+ readonly deletedAt: Schema.DateFromString;
2530
+ readonly operations: Schema.$Array<Schema.Struct<{
2531
+ readonly operationId: Schema.String;
2532
+ readonly providerRecordId: Schema.String;
2533
+ }>>;
2534
+ readonly planDigest: Schema.String;
2535
+ readonly providerId: Schema.String;
2536
+ readonly status: Schema.Literals<readonly ["complete", "partial"]>;
2537
+ readonly version: Schema.Literal<"domainkit.deletion-receipt.v1">;
2538
+ readonly zone: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2539
+ }>;
2540
+ interface Receipt extends Schema.Schema.Type<typeof Receipt> {}
2541
+ declare const Error_base$1: Schema.Class<Error$1, Schema.TaggedStruct<"UnsafeDeletionError", {
2542
+ readonly message: Schema.String;
2543
+ readonly operationId: Schema.optionalKey<Schema.String>;
2544
+ }>, import("effect/Cause").YieldableError>;
2545
+ declare class Error$1 extends Error_base$1 {}
2546
+ declare const PartialError_base: Schema.Class<PartialError, Schema.TaggedStruct<"PartialDeletionError", {
2547
+ readonly failedOperationId: Schema.String;
2548
+ readonly message: Schema.String;
2549
+ readonly receipt: Schema.Struct<{
2550
+ readonly deletedAt: Schema.DateFromString;
2551
+ readonly operations: Schema.$Array<Schema.Struct<{
2552
+ readonly operationId: Schema.String;
2553
+ readonly providerRecordId: Schema.String;
2554
+ }>>;
2555
+ readonly planDigest: Schema.String;
2556
+ readonly providerId: Schema.String;
2557
+ readonly status: Schema.Literals<readonly ["complete", "partial"]>;
2558
+ readonly version: Schema.Literal<"domainkit.deletion-receipt.v1">;
2559
+ readonly zone: Schema.decodeTo<Schema.brand<Schema.String, "DomainName">, Schema.String, never, never>;
2560
+ }>;
2561
+ }>, import("effect/Cause").YieldableError>;
2562
+ declare class PartialError extends PartialError_base {}
2563
+ interface CreateInput {
2564
+ readonly plan: DnsPlan;
2565
+ readonly receipt: ApplyReceipt;
2566
+ readonly ttlMs?: number;
2567
+ }
2568
+ /** Build a fresh deletion plan only from records proven by a prior create receipt. */
2569
+ declare const create: (input: CreateInput) => Effect.Effect<{
2570
+ createdAt: Date;
2571
+ expiresAt: Date;
2572
+ operations: readonly {
2573
+ readonly id: string;
2574
+ readonly providerRecordId: string;
2575
+ readonly record: {
2576
+ readonly _tag: "A";
2577
+ readonly metadata: {
2578
+ readonly ownership: string;
2579
+ readonly provenance: string;
2580
+ readonly purpose: string;
2581
+ };
2582
+ readonly name: string & import("effect/Brand").Brand<"DomainName">;
2583
+ readonly policy: "append" | "exclusive";
2584
+ readonly ttl: number | null;
2585
+ readonly address: string;
2586
+ } | {
2587
+ readonly _tag: "AAAA";
2588
+ readonly metadata: {
2589
+ readonly ownership: string;
2590
+ readonly provenance: string;
2591
+ readonly purpose: string;
2592
+ };
2593
+ readonly name: string & import("effect/Brand").Brand<"DomainName">;
2594
+ readonly policy: "append" | "exclusive";
2595
+ readonly ttl: number | null;
2596
+ readonly address: string;
2597
+ } | {
2598
+ readonly _tag: "CAA";
2599
+ readonly metadata: {
2600
+ readonly ownership: string;
2601
+ readonly provenance: string;
2602
+ readonly purpose: string;
2603
+ };
2604
+ readonly name: string & import("effect/Brand").Brand<"DomainName">;
2605
+ readonly policy: "append" | "exclusive";
2606
+ readonly ttl: number | null;
2607
+ readonly flags: number;
2608
+ readonly tag: "iodef" | "issue" | "issuewild";
2609
+ readonly value: string;
2610
+ } | {
2611
+ readonly _tag: "CNAME";
2612
+ readonly metadata: {
2613
+ readonly ownership: string;
2614
+ readonly provenance: string;
2615
+ readonly purpose: string;
2616
+ };
2617
+ readonly name: string & import("effect/Brand").Brand<"DomainName">;
2618
+ readonly ttl: number | null;
2619
+ readonly policy: "exclusive";
2620
+ readonly target: string & import("effect/Brand").Brand<"DomainName">;
2621
+ } | {
2622
+ readonly _tag: "MX";
2623
+ readonly metadata: {
2624
+ readonly ownership: string;
2625
+ readonly provenance: string;
2626
+ readonly purpose: string;
2627
+ };
2628
+ readonly name: string & import("effect/Brand").Brand<"DomainName">;
2629
+ readonly policy: "append" | "exclusive";
2630
+ readonly ttl: number | null;
2631
+ readonly exchange: string & import("effect/Brand").Brand<"DomainName">;
2632
+ readonly priority: number;
2633
+ } | {
2634
+ readonly _tag: "NS";
2635
+ readonly metadata: {
2636
+ readonly ownership: string;
2637
+ readonly provenance: string;
2638
+ readonly purpose: string;
2639
+ };
2640
+ readonly name: string & import("effect/Brand").Brand<"DomainName">;
2641
+ readonly policy: "append" | "exclusive";
2642
+ readonly ttl: number | null;
2643
+ readonly target: string & import("effect/Brand").Brand<"DomainName">;
2644
+ } | {
2645
+ readonly _tag: "SRV";
2646
+ readonly metadata: {
2647
+ readonly ownership: string;
2648
+ readonly provenance: string;
2649
+ readonly purpose: string;
2650
+ };
2651
+ readonly name: string & import("effect/Brand").Brand<"DomainName">;
2652
+ readonly policy: "append" | "exclusive";
2653
+ readonly ttl: number | null;
2654
+ readonly port: number;
2655
+ readonly priority: number;
2656
+ readonly target: string & import("effect/Brand").Brand<"DomainName">;
2657
+ readonly weight: number;
2658
+ } | {
2659
+ readonly _tag: "TXT";
2660
+ readonly metadata: {
2661
+ readonly ownership: string;
2662
+ readonly provenance: string;
2663
+ readonly purpose: string;
2664
+ };
2665
+ readonly name: string & import("effect/Brand").Brand<"DomainName">;
2666
+ readonly policy: "append" | "exclusive";
2667
+ readonly ttl: number | null;
2668
+ readonly value: string;
2669
+ };
2670
+ }[];
2671
+ providerId: string;
2672
+ sourcePlanDigest: string;
2673
+ version: "domainkit.deletion-plan.v1";
2674
+ zone: string & import("effect/Brand").Brand<"DomainName">;
2675
+ digest: string;
2676
+ }, Error$3 | Error$1 | AuthorizeError, Crypto.Crypto | Service$1>;
2677
+ /** Produce a separate digest-bound consent artifact for destructive operations. */
2678
+ declare const authorize: (plan: Plan, operationIds?: readonly string[] | undefined) => Effect.Effect<{
2679
+ operationIds: string[];
2680
+ planDigest: string;
2681
+ version: "domainkit.deletion-authorization.v1";
2682
+ }, CryptoError | Error$1, Crypto.Crypto>;
2683
+ /** Re-read every approved record before the first delete, then delete by provider record ID. */
2684
+ declare const apply: (input: {
2685
+ readonly authorization: Authorization;
2686
+ readonly plan: Plan;
2687
+ readonly priorReceipt?: Receipt;
2688
+ }) => Effect.Effect<Receipt, CryptoError | Error$3 | Error$1 | PartialError, Crypto.Crypto | Service$1>;
2689
+ 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;
2336
2693
  declare namespace resolver_d_exports {
2337
2694
  export { Answer, AsyncInterface, AsyncResolution, Error, Interface, Query, Resolution, Service, layerFromAsync, toAsync };
2338
2695
  }
@@ -2383,5 +2740,5 @@ interface AsyncInterface {
2383
2740
  declare const layerFromAsync: (resolver: AsyncInterface) => Layer.Layer<Service>;
2384
2741
  declare const toAsync: (resolver: Interface) => AsyncInterface;
2385
2742
  //#endregion
2386
- export { Schema$3 as $, Service$3 as A, Error$1 as B, types_d_exports as C, oauth_state_d_exports as D, Service$2 as E, credential_d_exports as F, OAuthContinuation as G, AuthorizationError as H, AsyncInterface$5 as I, assertGrant as J, Schema$2 as K, Interface$5 as L, AsyncInterface$4 as M, Interface$4 as N, AsyncInterface$3 as O, Service$4 as P, ProviderAuthorization as Q, Service$5 as R, encodeReceipt as S, Interface$2 as T, Connection as U, error_d_exports as V, Grant as W, encode$1 as X, connection_d_exports$1 as Y, Capability as Z, Operation as _, Interface as a, Schema$1 as b, Service as c, Interface$1 as d, authorization_d_exports$1 as et, Service$1 as f, DnsPlan as g, Authorization as h, Error as i, authorization_d_exports as j, Interface$3 as k, resolver_d_exports as l, ApplyReceipt as m, AsyncInterface as n, Query as o, receipt_d_exports as p, StoredCredential as q, AsyncResolution as r, Resolution as s, Answer as t, encode$2 as tt, AsyncInterface$1 as u, PlanAuthorization as v, AsyncInterface$2 as w, encode as x, Receipt as y, connection_d_exports as z };
2387
- //# sourceMappingURL=resolver-BHPsADzE.d.mts.map
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-CJOR9mQ8.d.mts.map