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.
- package/README.md +26 -26
- package/dist/index.d.mts +639 -187
- package/dist/index.mjs +301 -300
- package/dist/index.mjs.map +1 -1
- package/dist/promise.d.mts +464 -0
- package/dist/promise.mjs +636 -0
- package/dist/promise.mjs.map +1 -0
- package/dist/{resolver-CxE-VDw4.mjs → resolver-CvK7JoJM.mjs} +401 -54
- package/dist/resolver-CvK7JoJM.mjs.map +1 -0
- package/dist/{resolver-Dc0hwV-J.d.mts → resolver-uqe1h5Vz.d.mts} +1513 -25
- package/dist/testing.d.mts +4 -5
- package/dist/testing.mjs +17 -3
- package/dist/testing.mjs.map +1 -1
- package/dist/verify-B00c81-n.mjs +2420 -0
- package/dist/verify-B00c81-n.mjs.map +1 -0
- package/dist/{verify-Dls29YC-.d.mts → verify-CkgVrwyl.d.mts} +318 -21
- package/package.json +6 -30
- package/dist/auth-BR-19zj-.mjs +0 -738
- package/dist/auth-BR-19zj-.mjs.map +0 -1
- package/dist/auth-g-waCHcz.mjs +0 -671
- package/dist/auth-g-waCHcz.mjs.map +0 -1
- package/dist/authorization-OeaSR47S.mjs +0 -284
- package/dist/authorization-OeaSR47S.mjs.map +0 -1
- package/dist/canonical-json-CpvqGMcr.mjs +0 -57
- package/dist/canonical-json-CpvqGMcr.mjs.map +0 -1
- package/dist/cloudflare-BrZPU9li.d.mts +0 -32
- package/dist/cloudflare-CGmasR8A.mjs +0 -69
- package/dist/cloudflare-CGmasR8A.mjs.map +0 -1
- package/dist/cloudflare.d.mts +0 -3
- package/dist/cloudflare.mjs +0 -2
- package/dist/connection-BfkloPZy.d.mts +0 -186
- package/dist/connection-BwtOwpH6.mjs +0 -195
- package/dist/connection-BwtOwpH6.mjs.map +0 -1
- package/dist/connection-CjNQe_E-.mjs +0 -58
- package/dist/connection-CjNQe_E-.mjs.map +0 -1
- package/dist/connection-api-DNuEZ_jR.d.mts +0 -7
- package/dist/dns-record-BLeqo56C.mjs +0 -289
- package/dist/dns-record-BLeqo56C.mjs.map +0 -1
- package/dist/effect-cloudflare.d.mts +0 -2
- package/dist/effect-cloudflare.mjs +0 -2
- package/dist/effect-vercel.d.mts +0 -2
- package/dist/effect-vercel.mjs +0 -2
- package/dist/effect.d.mts +0 -36
- package/dist/effect.mjs +0 -51
- package/dist/effect.mjs.map +0 -1
- package/dist/index-BHWRTThN.d.mts +0 -159
- package/dist/index-D3PVknwE.d.mts +0 -145
- package/dist/resolver-CxE-VDw4.mjs.map +0 -1
- package/dist/vercel-BsNDu4Np.d.mts +0 -31
- package/dist/vercel-CfoJaaCu.mjs +0 -60
- package/dist/vercel-CfoJaaCu.mjs.map +0 -1
- package/dist/vercel.d.mts +0 -3
- package/dist/vercel.mjs +0 -2
- package/dist/verify-BKbvq7IN.mjs +0 -642
- package/dist/verify-BKbvq7IN.mjs.map +0 -1
- package/dist/zone-discovery-BPnH3sLU.d.mts +0 -1397
- package/dist/zones-DKHTpX9C.mjs +0 -19
- package/dist/zones-DKHTpX9C.mjs.map +0 -1
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import { Context, Effect, Layer, Schema, SchemaIssue, SchemaTransformation } from "effect";
|
|
3
|
-
//#region src/auth/lifecycle-repository.ts
|
|
4
|
-
var lifecycle_repository_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
-
Error: () => Error$3,
|
|
6
|
-
Service: () => Service$1
|
|
7
|
-
});
|
|
8
|
-
var Error$3 = class extends Schema.TaggedError()("LifecycleRepositoryError", {
|
|
9
|
-
category: Schema.Literal("storage"),
|
|
10
|
-
message: Schema.String,
|
|
11
|
-
operation: Schema.String,
|
|
12
|
-
retry: Schema.Literals([
|
|
13
|
-
"never",
|
|
14
|
-
"after-user-action",
|
|
15
|
-
"safe",
|
|
16
|
-
"unknown"
|
|
17
|
-
])
|
|
18
|
-
}) {};
|
|
19
|
-
var Service$1 = class extends Context.Service()("@domainkit/AuthorizationLifecycleRepository") {};
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region src/invalid-input.ts
|
|
22
|
-
var invalid_input_exports = /* @__PURE__ */ __exportAll({ Error: () => Error$2 });
|
|
23
|
-
var Error$2 = class extends Schema.TaggedError()("InvalidInputError", { message: Schema.String }) {};
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/domain/domain-name.ts
|
|
26
|
-
var domain_name_exports = /* @__PURE__ */ __exportAll({
|
|
27
|
-
Schema: () => Schema$2,
|
|
28
|
-
decode: () => decode$1,
|
|
29
|
-
parse: () => parse$1
|
|
30
|
-
});
|
|
31
|
-
const labelPattern = /^[a-z0-9_](?:[a-z0-9_-]{0,61}[a-z0-9_])?$/;
|
|
32
|
-
const Type$1 = Schema.String.check(Schema.makeFilter((value) => value.length <= 253 && value.includes(".") && value.split(".").every((label) => labelPattern.test(label)) ? void 0 : "Expected a fully qualified DNS name", { identifier: "DomainName" })).pipe(Schema.brand("DomainName"));
|
|
33
|
-
/** Decodes user and wire strings into canonical domain names. */
|
|
34
|
-
const Schema$2 = Schema.String.pipe(Schema.decodeTo(Type$1, SchemaTransformation.transformOrFail({
|
|
35
|
-
decode: (input, options) => Effect.try({
|
|
36
|
-
try: () => normalize(input),
|
|
37
|
-
catch: (cause) => new SchemaIssue.InvalidValue({ message: cause instanceof Error ? cause.message : String(cause) }, input, options)
|
|
38
|
-
}),
|
|
39
|
-
encode: (domain) => Effect.succeed(domain)
|
|
40
|
-
})));
|
|
41
|
-
const decode$1 = Effect.fn("DomainName.decode")((input) => Schema.decodeUnknownEffect(Schema$2)(input).pipe(Effect.mapError((cause) => new Error$2({ message: cause.message }))));
|
|
42
|
-
function parse$1(input) {
|
|
43
|
-
try {
|
|
44
|
-
return Schema.decodeUnknownSync(Schema$2)(input);
|
|
45
|
-
} catch (cause) {
|
|
46
|
-
throw new Error$2({ message: cause instanceof Error ? cause.message : String(cause) });
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function normalize(input) {
|
|
50
|
-
return input.trim().replace(/\.+$/, "").split(".").map((label) => {
|
|
51
|
-
if (label.includes("_") || [...label].every((character) => character.charCodeAt(0) <= 127)) return label.toLowerCase();
|
|
52
|
-
const normalized = new URL(`http://${label}.example`).hostname.split(".")[0];
|
|
53
|
-
if (normalized === void 0) throw new Error("Domain label could not be normalized");
|
|
54
|
-
return normalized.toLowerCase();
|
|
55
|
-
}).join(".");
|
|
56
|
-
}
|
|
57
|
-
//#endregion
|
|
58
|
-
//#region src/provider/provider.ts
|
|
59
|
-
var provider_exports = /* @__PURE__ */ __exportAll({
|
|
60
|
-
Error: () => Error$1,
|
|
61
|
-
ErrorReason: () => ErrorReason,
|
|
62
|
-
Service: () => Service,
|
|
63
|
-
fromAsync: () => fromAsync,
|
|
64
|
-
layerFromAsync: () => layerFromAsync,
|
|
65
|
-
toAsync: () => toAsync
|
|
66
|
-
});
|
|
67
|
-
const ErrorReason = Schema.Literals([
|
|
68
|
-
"authentication",
|
|
69
|
-
"authorization",
|
|
70
|
-
"conflict",
|
|
71
|
-
"not_found",
|
|
72
|
-
"rate_limit",
|
|
73
|
-
"request",
|
|
74
|
-
"response",
|
|
75
|
-
"transport",
|
|
76
|
-
"unsupported"
|
|
77
|
-
]);
|
|
78
|
-
var Error$1 = class extends Schema.TaggedError()("ProviderError", {
|
|
79
|
-
cause: Schema.optionalKey(Schema.Unknown),
|
|
80
|
-
code: Schema.optionalKey(Schema.Union([Schema.Number, Schema.String])),
|
|
81
|
-
message: Schema.String,
|
|
82
|
-
operation: Schema.String,
|
|
83
|
-
providerId: Schema.String,
|
|
84
|
-
reason: Schema.optionalKey(ErrorReason),
|
|
85
|
-
retryAfterMs: Schema.optionalKey(Schema.Number),
|
|
86
|
-
status: Schema.optionalKey(Schema.Number)
|
|
87
|
-
}) {};
|
|
88
|
-
var Service = class extends Context.Service()("@domainkit/DnsProvider") {};
|
|
89
|
-
const fromAsync = (provider) => Service.of({
|
|
90
|
-
id: provider.id,
|
|
91
|
-
createRecord: Effect.fn("DnsProvider.createRecord")((zone, record) => Effect.tryPromise({
|
|
92
|
-
try: () => provider.createRecord(zone, record),
|
|
93
|
-
catch: (cause) => failure(provider, "createRecord", cause)
|
|
94
|
-
})),
|
|
95
|
-
deleteRecord: Effect.fn("DnsProvider.deleteRecord")((zone, providerRecordId) => Effect.tryPromise({
|
|
96
|
-
try: () => provider.deleteRecord(zone, providerRecordId),
|
|
97
|
-
catch: (cause) => failure(provider, "deleteRecord", cause)
|
|
98
|
-
})),
|
|
99
|
-
getRecord: Effect.fn("DnsProvider.getRecord")((zone, providerRecordId) => Effect.tryPromise({
|
|
100
|
-
try: () => provider.getRecord(zone, providerRecordId),
|
|
101
|
-
catch: (cause) => failure(provider, "getRecord", cause)
|
|
102
|
-
})),
|
|
103
|
-
listRecords: Effect.fn("DnsProvider.listRecords")((zone) => Effect.tryPromise({
|
|
104
|
-
try: () => provider.listRecords(zone),
|
|
105
|
-
catch: (cause) => failure(provider, "listRecords", cause)
|
|
106
|
-
}))
|
|
107
|
-
});
|
|
108
|
-
const layerFromAsync = (provider) => Layer.succeed(Service, fromAsync(provider));
|
|
109
|
-
const toAsync = (provider) => ({
|
|
110
|
-
id: provider.id,
|
|
111
|
-
createRecord: (zone, record) => Effect.runPromise(provider.createRecord(zone, record)),
|
|
112
|
-
deleteRecord: (zone, providerRecordId) => Effect.runPromise(provider.deleteRecord(zone, providerRecordId)),
|
|
113
|
-
getRecord: (zone, providerRecordId) => Effect.runPromise(provider.getRecord(zone, providerRecordId)),
|
|
114
|
-
listRecords: (zone) => Effect.runPromise(provider.listRecords(zone))
|
|
115
|
-
});
|
|
116
|
-
function failure(provider, operation, cause) {
|
|
117
|
-
return cause instanceof Error$1 ? cause : new Error$1({
|
|
118
|
-
cause,
|
|
119
|
-
message: cause instanceof globalThis.Error ? cause.message : String(cause),
|
|
120
|
-
operation,
|
|
121
|
-
providerId: provider.id
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
//#endregion
|
|
125
|
-
//#region src/domain/dns-record.ts
|
|
126
|
-
var dns_record_exports = /* @__PURE__ */ __exportAll({
|
|
127
|
-
A: () => A,
|
|
128
|
-
Aaaa: () => Aaaa,
|
|
129
|
-
Caa: () => Caa,
|
|
130
|
-
Cname: () => Cname,
|
|
131
|
-
Mx: () => Mx,
|
|
132
|
-
Ns: () => Ns,
|
|
133
|
-
Observed: () => Observed,
|
|
134
|
-
Opaque: () => Opaque,
|
|
135
|
-
RequirementMetadata: () => RequirementMetadata,
|
|
136
|
-
Schema: () => Schema$1,
|
|
137
|
-
Srv: () => Srv,
|
|
138
|
-
Txt: () => Txt,
|
|
139
|
-
Type: () => Type,
|
|
140
|
-
data: () => data,
|
|
141
|
-
decode: () => decode,
|
|
142
|
-
equals: () => equals,
|
|
143
|
-
parse: () => parse
|
|
144
|
-
});
|
|
145
|
-
const Type = Schema.Literals([
|
|
146
|
-
"A",
|
|
147
|
-
"AAAA",
|
|
148
|
-
"CNAME",
|
|
149
|
-
"TXT",
|
|
150
|
-
"MX",
|
|
151
|
-
"CAA",
|
|
152
|
-
"NS",
|
|
153
|
-
"SRV"
|
|
154
|
-
]);
|
|
155
|
-
const RequirementMetadata = Schema.Struct({
|
|
156
|
-
ownership: Schema.String.check(Schema.isMinLength(1)),
|
|
157
|
-
provenance: Schema.String.check(Schema.isMinLength(1)),
|
|
158
|
-
purpose: Schema.String.check(Schema.isMinLength(1))
|
|
159
|
-
});
|
|
160
|
-
const CommonFields = {
|
|
161
|
-
metadata: RequirementMetadata,
|
|
162
|
-
name: Schema$2,
|
|
163
|
-
policy: Schema.Literals(["exclusive", "append"]),
|
|
164
|
-
ttl: Schema.NullOr(Schema.Int.check(Schema.isBetween({
|
|
165
|
-
minimum: 60,
|
|
166
|
-
maximum: 2147483647
|
|
167
|
-
})))
|
|
168
|
-
};
|
|
169
|
-
const ExclusiveCommonFields = {
|
|
170
|
-
...CommonFields,
|
|
171
|
-
policy: Schema.Literal("exclusive")
|
|
172
|
-
};
|
|
173
|
-
const Address = Schema.String.check(Schema.makeFilter((value) => isIpv4(value) ? void 0 : "Expected an IPv4 address"));
|
|
174
|
-
const Ipv6Address = Schema.String.check(Schema.makeFilter((value) => isIpv6(value) ? void 0 : "Expected an IPv6 address"));
|
|
175
|
-
const Port = Schema.Int.check(Schema.isBetween({
|
|
176
|
-
minimum: 0,
|
|
177
|
-
maximum: 65535
|
|
178
|
-
}));
|
|
179
|
-
const Priority = Schema.Int.check(Schema.isBetween({
|
|
180
|
-
minimum: 0,
|
|
181
|
-
maximum: 65535
|
|
182
|
-
}));
|
|
183
|
-
const Schema$1 = Schema.TaggedUnion({
|
|
184
|
-
A: {
|
|
185
|
-
...CommonFields,
|
|
186
|
-
address: Address
|
|
187
|
-
},
|
|
188
|
-
AAAA: {
|
|
189
|
-
...CommonFields,
|
|
190
|
-
address: Ipv6Address
|
|
191
|
-
},
|
|
192
|
-
CNAME: {
|
|
193
|
-
...ExclusiveCommonFields,
|
|
194
|
-
target: Schema$2
|
|
195
|
-
},
|
|
196
|
-
TXT: {
|
|
197
|
-
...CommonFields,
|
|
198
|
-
value: Schema.String.check(Schema.isMinLength(1))
|
|
199
|
-
},
|
|
200
|
-
MX: {
|
|
201
|
-
...CommonFields,
|
|
202
|
-
exchange: Schema$2,
|
|
203
|
-
priority: Priority
|
|
204
|
-
},
|
|
205
|
-
CAA: {
|
|
206
|
-
...CommonFields,
|
|
207
|
-
flags: Schema.Int.check(Schema.isBetween({
|
|
208
|
-
minimum: 0,
|
|
209
|
-
maximum: 255
|
|
210
|
-
})),
|
|
211
|
-
tag: Schema.Literals([
|
|
212
|
-
"issue",
|
|
213
|
-
"issuewild",
|
|
214
|
-
"iodef"
|
|
215
|
-
]),
|
|
216
|
-
value: Schema.String.check(Schema.isMinLength(1))
|
|
217
|
-
},
|
|
218
|
-
NS: {
|
|
219
|
-
...CommonFields,
|
|
220
|
-
target: Schema$2
|
|
221
|
-
},
|
|
222
|
-
SRV: {
|
|
223
|
-
...CommonFields,
|
|
224
|
-
port: Port,
|
|
225
|
-
priority: Priority,
|
|
226
|
-
target: Schema$2,
|
|
227
|
-
weight: Priority
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
const { A, AAAA: Aaaa, CAA: Caa, CNAME: Cname, MX: Mx, NS: Ns, SRV: Srv, TXT: Txt } = Schema$1.cases;
|
|
231
|
-
/** Provider state that DomainKit cannot create but must retain for safe reconciliation. */
|
|
232
|
-
const Opaque = Schema.Struct({
|
|
233
|
-
_tag: Schema.Literal("Opaque"),
|
|
234
|
-
name: Schema.String.check(Schema.isMinLength(1)),
|
|
235
|
-
providerRecordId: Schema.NullOr(Schema.String),
|
|
236
|
-
providerType: Schema.String.check(Schema.isMinLength(1))
|
|
237
|
-
});
|
|
238
|
-
/** Any DNS record observed through a provider, including non-portable record types. */
|
|
239
|
-
const Observed = Schema.Union([Schema$1, Opaque]);
|
|
240
|
-
const decode = Effect.fn("DnsRecord.decode")((input) => Schema.decodeUnknownEffect(Schema$1)(input).pipe(Effect.mapError((cause) => new Error$2({ message: cause.message }))));
|
|
241
|
-
function parse(input) {
|
|
242
|
-
try {
|
|
243
|
-
return Schema.decodeUnknownSync(Schema$1)(input);
|
|
244
|
-
} catch (cause) {
|
|
245
|
-
throw new Error$2({ message: cause instanceof Error ? cause.message : String(cause) });
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
function data(record) {
|
|
249
|
-
switch (record._tag) {
|
|
250
|
-
case "A":
|
|
251
|
-
case "AAAA": return { address: record.address };
|
|
252
|
-
case "CNAME":
|
|
253
|
-
case "NS": return { target: record.target };
|
|
254
|
-
case "TXT": return { value: record.value };
|
|
255
|
-
case "MX": return {
|
|
256
|
-
exchange: record.exchange,
|
|
257
|
-
priority: record.priority
|
|
258
|
-
};
|
|
259
|
-
case "CAA": return {
|
|
260
|
-
flags: record.flags,
|
|
261
|
-
tag: record.tag,
|
|
262
|
-
value: record.value
|
|
263
|
-
};
|
|
264
|
-
case "SRV": return {
|
|
265
|
-
port: record.port,
|
|
266
|
-
priority: record.priority,
|
|
267
|
-
target: record.target,
|
|
268
|
-
weight: record.weight
|
|
269
|
-
};
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
function equals(left, right) {
|
|
273
|
-
return left._tag === right._tag && left.name === right.name && JSON.stringify(data(left)) === JSON.stringify(data(right));
|
|
274
|
-
}
|
|
275
|
-
function isIpv4(value) {
|
|
276
|
-
const parts = value.split(".");
|
|
277
|
-
return parts.length === 4 && parts.every((part) => /^\d{1,3}$/.test(part) && Number(part) <= 255 && String(Number(part)) === part);
|
|
278
|
-
}
|
|
279
|
-
function isIpv6(value) {
|
|
280
|
-
try {
|
|
281
|
-
return new URL(`http://[${value}]/`).hostname.startsWith("[");
|
|
282
|
-
} catch {
|
|
283
|
-
return false;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
//#endregion
|
|
287
|
-
export { invalid_input_exports as A, provider_exports as C, domain_name_exports as D, decode$1 as E, Service$1 as M, lifecycle_repository_exports as N, parse$1 as O, layerFromAsync as S, Schema$2 as T, equals as _, Mx as a, Service as b, Opaque as c, Srv as d, Txt as f, dns_record_exports as g, decode as h, Cname as i, Error$3 as j, Error$2 as k, RequirementMetadata as l, data as m, Aaaa as n, Ns as o, Type as p, Caa as r, Observed as s, A as t, Schema$1 as u, parse as v, toAsync as w, fromAsync as x, Error$1 as y };
|
|
288
|
-
|
|
289
|
-
//# sourceMappingURL=dns-record-BLeqo56C.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dns-record-BLeqo56C.mjs","names":["Error","Service","Error","Type","S","Schema","decode","InvalidInputError","parse","Error","S","DomainName.Schema","Schema","InvalidInputError"],"sources":["../src/auth/lifecycle-repository.ts","../src/invalid-input.ts","../src/domain/domain-name.ts","../src/provider/provider.ts","../src/domain/dns-record.ts"],"sourcesContent":["import { Context, Effect, Schema } from \"effect\";\n\nimport type * as ProviderAuthorization from \"./authorization.ts\";\nimport type * as Connection from \"./connection.ts\";\n\nexport interface Aggregate {\n readonly authorization: ProviderAuthorization.ProviderAuthorization;\n readonly bindings: ReadonlyArray<Connection.Connection>;\n readonly credential: Connection.StoredCredential;\n}\n\nexport interface DetachResult {\n readonly authorizationId: string;\n readonly remainingBindings: number;\n readonly revokedAuthorization: boolean;\n}\n\nexport class Error extends Schema.TaggedError<Error>()(\"LifecycleRepositoryError\", {\n category: Schema.Literal(\"storage\"),\n message: Schema.String,\n operation: Schema.String,\n retry: Schema.Literals([\"never\", \"after-user-action\", \"safe\", \"unknown\"]),\n}) {}\n\nexport interface Interface {\n readonly bind: (\n authorizationId: string,\n binding: Connection.Connection,\n ) => Effect.Effect<Aggregate, Error>;\n readonly connect: (aggregate: Aggregate) => Effect.Effect<Aggregate, Error>;\n readonly detach: <E>(input: {\n readonly connectionId: string;\n readonly revoke: (aggregate: Aggregate) => Effect.Effect<void, E>;\n }) => Effect.Effect<DetachResult, Error | E>;\n readonly findByProviderAccount: (\n providerId: string,\n providerAccountId: string,\n ) => Effect.Effect<Aggregate | null, Error>;\n readonly get: (authorizationId: string) => Effect.Effect<Aggregate | null, Error>;\n readonly getByConnectionId: (connectionId: string) => Effect.Effect<Aggregate | null, Error>;\n readonly promoteEvidence: (\n authorizationId: string,\n evidence: ReadonlyArray<ProviderAuthorization.CapabilityEvidence>,\n ) => Effect.Effect<Aggregate, Error>;\n readonly recover: <E>(input: {\n readonly authorizationId: string;\n readonly revoke: (aggregate: Aggregate) => Effect.Effect<void, E>;\n }) => Effect.Effect<DetachResult, Error | E>;\n readonly rotate: (\n authorizationId: string,\n credential: Connection.StoredCredential,\n expiresAt: Date | null,\n ) => Effect.Effect<Aggregate, Error>;\n}\n\nexport class Service extends Context.Service<Service, Interface>()(\n \"@domainkit/AuthorizationLifecycleRepository\",\n) {}\n","import { Schema } from \"effect\";\n\nexport class Error extends Schema.TaggedError<Error>()(\"InvalidInputError\", {\n message: Schema.String,\n}) {}\n","import { Effect, Schema as S, SchemaIssue, SchemaTransformation } from \"effect\";\n\nimport { Error as InvalidInputError } from \"../invalid-input.ts\";\n\nconst labelPattern = /^[a-z0-9_](?:[a-z0-9_-]{0,61}[a-z0-9_])?$/;\n\nconst Type = S.String.check(\n S.makeFilter<string>(\n (value) =>\n value.length <= 253 &&\n value.includes(\".\") &&\n value.split(\".\").every((label) => labelPattern.test(label))\n ? undefined\n : \"Expected a fully qualified DNS name\",\n { identifier: \"DomainName\" },\n ),\n).pipe(S.brand(\"DomainName\"));\n\n/** A lower-case, fully qualified DNS name without a trailing dot. */\nexport type DomainName = typeof Type.Type;\n\n/** Decodes user and wire strings into canonical domain names. */\nexport const Schema = S.String.pipe(\n S.decodeTo(\n Type,\n SchemaTransformation.transformOrFail({\n decode: (input, options) =>\n Effect.try({\n try: () => normalize(input),\n catch: (cause) =>\n new SchemaIssue.InvalidValue(\n { message: cause instanceof Error ? cause.message : String(cause) },\n input,\n options,\n ),\n }),\n encode: (domain) => Effect.succeed(domain),\n }),\n ),\n);\n\nexport const decode = Effect.fn(\"DomainName.decode\")((input: unknown) =>\n S.decodeUnknownEffect(Schema)(input).pipe(\n Effect.mapError((cause) => new InvalidInputError({ message: cause.message })),\n ),\n);\n\nexport function parse(input: unknown): DomainName {\n try {\n return S.decodeUnknownSync(Schema)(input);\n } catch (cause) {\n throw new InvalidInputError({\n message: cause instanceof Error ? cause.message : String(cause),\n });\n }\n}\n\nfunction normalize(input: string): string {\n const labels = input\n .trim()\n .replace(/\\.+$/, \"\")\n .split(\".\")\n .map((label) => {\n if (label.includes(\"_\") || [...label].every((character) => character.charCodeAt(0) <= 127)) {\n return label.toLowerCase();\n }\n const hostname = new URL(`http://${label}.example`).hostname;\n const normalized = hostname.split(\".\")[0];\n if (normalized === undefined) throw new Error(\"Domain label could not be normalized\");\n return normalized.toLowerCase();\n });\n return labels.join(\".\");\n}\n","import { Context, Effect, Layer, Schema } from \"effect\";\n\nimport type * as DomainName from \"../domain/domain-name.ts\";\nimport type * as DnsRecord from \"../domain/dns-record.ts\";\n\nexport interface CreateResult {\n readonly providerRecordId: string | null;\n}\n\nexport const ErrorReason = Schema.Literals([\n \"authentication\",\n \"authorization\",\n \"conflict\",\n \"not_found\",\n \"rate_limit\",\n \"request\",\n \"response\",\n \"transport\",\n \"unsupported\",\n]);\nexport type ErrorReason = typeof ErrorReason.Type;\n\nexport class Error extends Schema.TaggedError<Error>()(\"ProviderError\", {\n cause: Schema.optionalKey(Schema.Unknown),\n code: Schema.optionalKey(Schema.Union([Schema.Number, Schema.String])),\n message: Schema.String,\n operation: Schema.String,\n providerId: Schema.String,\n reason: Schema.optionalKey(ErrorReason),\n retryAfterMs: Schema.optionalKey(Schema.Number),\n status: Schema.optionalKey(Schema.Number),\n}) {}\n\n/** The provider capability used by DNS planning, application, and verification. */\nexport interface Interface {\n readonly id: string;\n readonly createRecord: (\n zone: DomainName.DomainName,\n record: DnsRecord.DnsRecord,\n ) => Effect.Effect<CreateResult, Error>;\n readonly deleteRecord: (\n zone: DomainName.DomainName,\n providerRecordId: string,\n ) => Effect.Effect<void, Error>;\n readonly getRecord: (\n zone: DomainName.DomainName,\n providerRecordId: string,\n ) => Effect.Effect<DnsRecord.Observed | null, Error>;\n readonly listRecords: (\n zone: DomainName.DomainName,\n ) => Effect.Effect<ReadonlyArray<DnsRecord.Observed>, Error>;\n}\n\nexport class Service extends Context.Service<Service, Interface>()(\"@domainkit/DnsProvider\") {}\n\n/** Minimal Promise-shaped provider contract for hosts that do not use Effect directly. */\nexport interface AsyncInterface {\n readonly id: string;\n readonly createRecord: (\n zone: DomainName.DomainName,\n record: DnsRecord.DnsRecord,\n ) => Promise<CreateResult>;\n readonly deleteRecord: (zone: DomainName.DomainName, providerRecordId: string) => Promise<void>;\n readonly getRecord: (\n zone: DomainName.DomainName,\n providerRecordId: string,\n ) => Promise<DnsRecord.Observed | null>;\n readonly listRecords: (zone: DomainName.DomainName) => Promise<ReadonlyArray<DnsRecord.Observed>>;\n}\n\nexport const fromAsync = (provider: AsyncInterface): Interface =>\n Service.of({\n id: provider.id,\n createRecord: Effect.fn(\"DnsProvider.createRecord\")((zone, record) =>\n Effect.tryPromise({\n try: () => provider.createRecord(zone, record),\n catch: (cause) => failure(provider, \"createRecord\", cause),\n }),\n ),\n deleteRecord: Effect.fn(\"DnsProvider.deleteRecord\")((zone, providerRecordId) =>\n Effect.tryPromise({\n try: () => provider.deleteRecord(zone, providerRecordId),\n catch: (cause) => failure(provider, \"deleteRecord\", cause),\n }),\n ),\n getRecord: Effect.fn(\"DnsProvider.getRecord\")((zone, providerRecordId) =>\n Effect.tryPromise({\n try: () => provider.getRecord(zone, providerRecordId),\n catch: (cause) => failure(provider, \"getRecord\", cause),\n }),\n ),\n listRecords: Effect.fn(\"DnsProvider.listRecords\")((zone) =>\n Effect.tryPromise({\n try: () => provider.listRecords(zone),\n catch: (cause) => failure(provider, \"listRecords\", cause),\n }),\n ),\n });\n\nexport const layerFromAsync = (provider: AsyncInterface): Layer.Layer<Service> =>\n Layer.succeed(Service, fromAsync(provider));\n\nexport const toAsync = (provider: Interface): AsyncInterface => ({\n id: provider.id,\n createRecord: (zone, record) => Effect.runPromise(provider.createRecord(zone, record)),\n deleteRecord: (zone, providerRecordId) =>\n Effect.runPromise(provider.deleteRecord(zone, providerRecordId)),\n getRecord: (zone, providerRecordId) =>\n Effect.runPromise(provider.getRecord(zone, providerRecordId)),\n listRecords: (zone) => Effect.runPromise(provider.listRecords(zone)),\n});\n\nfunction failure(provider: AsyncInterface, operation: string, cause: unknown): Error {\n return cause instanceof Error\n ? cause\n : new Error({\n cause,\n message: cause instanceof globalThis.Error ? cause.message : String(cause),\n operation,\n providerId: provider.id,\n });\n}\n","import { Effect, Schema as S } from \"effect\";\n\nimport { Error as InvalidInputError } from \"../invalid-input.ts\";\nimport * as DomainName from \"./domain-name.ts\";\n\nexport const Type = S.Literals([\"A\", \"AAAA\", \"CNAME\", \"TXT\", \"MX\", \"CAA\", \"NS\", \"SRV\"]);\nexport type Type = typeof Type.Type;\n\nexport const RequirementMetadata = S.Struct({\n ownership: S.String.check(S.isMinLength(1)),\n provenance: S.String.check(S.isMinLength(1)),\n purpose: S.String.check(S.isMinLength(1)),\n});\nexport interface RequirementMetadata extends S.Schema.Type<typeof RequirementMetadata> {}\n\nconst CommonFields = {\n metadata: RequirementMetadata,\n name: DomainName.Schema,\n policy: S.Literals([\"exclusive\", \"append\"]),\n ttl: S.NullOr(S.Int.check(S.isBetween({ minimum: 60, maximum: 2_147_483_647 }))),\n};\n\nconst ExclusiveCommonFields = { ...CommonFields, policy: S.Literal(\"exclusive\") };\nconst Address = S.String.check(\n S.makeFilter((value) => (isIpv4(value) ? undefined : \"Expected an IPv4 address\")),\n);\nconst Ipv6Address = S.String.check(\n S.makeFilter((value) => (isIpv6(value) ? undefined : \"Expected an IPv6 address\")),\n);\nconst Port = S.Int.check(S.isBetween({ minimum: 0, maximum: 65_535 }));\nconst Priority = S.Int.check(S.isBetween({ minimum: 0, maximum: 65_535 }));\n\nexport const Schema = S.TaggedUnion({\n A: { ...CommonFields, address: Address },\n AAAA: { ...CommonFields, address: Ipv6Address },\n CNAME: { ...ExclusiveCommonFields, target: DomainName.Schema },\n TXT: { ...CommonFields, value: S.String.check(S.isMinLength(1)) },\n MX: { ...CommonFields, exchange: DomainName.Schema, priority: Priority },\n CAA: {\n ...CommonFields,\n flags: S.Int.check(S.isBetween({ minimum: 0, maximum: 255 })),\n tag: S.Literals([\"issue\", \"issuewild\", \"iodef\"]),\n value: S.String.check(S.isMinLength(1)),\n },\n NS: { ...CommonFields, target: DomainName.Schema },\n SRV: {\n ...CommonFields,\n port: Port,\n priority: Priority,\n target: DomainName.Schema,\n weight: Priority,\n },\n});\nexport const {\n A,\n AAAA: Aaaa,\n CAA: Caa,\n CNAME: Cname,\n MX: Mx,\n NS: Ns,\n SRV: Srv,\n TXT: Txt,\n} = Schema.cases;\nexport type DnsRecord = typeof Schema.Type;\nexport type Encoded = typeof Schema.Encoded;\n\n/** Provider state that DomainKit cannot create but must retain for safe reconciliation. */\nexport const Opaque = S.Struct({\n _tag: S.Literal(\"Opaque\"),\n name: S.String.check(S.isMinLength(1)),\n providerRecordId: S.NullOr(S.String),\n providerType: S.String.check(S.isMinLength(1)),\n});\nexport interface Opaque extends S.Schema.Type<typeof Opaque> {}\n\n/** Any DNS record observed through a provider, including non-portable record types. */\nexport const Observed = S.Union([Schema, Opaque]);\nexport type Observed = typeof Observed.Type;\n\nexport const decode = Effect.fn(\"DnsRecord.decode\")((input: unknown) =>\n S.decodeUnknownEffect(Schema)(input).pipe(\n Effect.mapError((cause) => new InvalidInputError({ message: cause.message })),\n ),\n);\n\nexport function parse(input: unknown): DnsRecord {\n try {\n return S.decodeUnknownSync(Schema)(input);\n } catch (cause) {\n throw new InvalidInputError({\n message: cause instanceof Error ? cause.message : String(cause),\n });\n }\n}\n\nexport function data(record: DnsRecord): Readonly<Record<string, number | string>> {\n switch (record._tag) {\n case \"A\":\n case \"AAAA\":\n return { address: record.address };\n case \"CNAME\":\n case \"NS\":\n return { target: record.target };\n case \"TXT\":\n return { value: record.value };\n case \"MX\":\n return { exchange: record.exchange, priority: record.priority };\n case \"CAA\":\n return { flags: record.flags, tag: record.tag, value: record.value };\n case \"SRV\":\n return {\n port: record.port,\n priority: record.priority,\n target: record.target,\n weight: record.weight,\n };\n }\n}\n\nexport function equals(left: DnsRecord, right: DnsRecord): boolean {\n return (\n left._tag === right._tag &&\n left.name === right.name &&\n JSON.stringify(data(left)) === JSON.stringify(data(right))\n );\n}\n\nfunction isIpv4(value: string): boolean {\n const parts = value.split(\".\");\n return (\n parts.length === 4 &&\n parts.every(\n (part) => /^\\d{1,3}$/.test(part) && Number(part) <= 255 && String(Number(part)) === part,\n )\n );\n}\n\nfunction isIpv6(value: string): boolean {\n try {\n return new URL(`http://[${value}]/`).hostname.startsWith(\"[\");\n } catch {\n return false;\n }\n}\n"],"mappings":";;;;;;;AA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AAQ,MAAM,UAAU,OAAO,KAAK,EAChE,CAAC;CACH;AACF;AAEA,SAAgB,KAAK,QAA8D;CACjF,QAAQ,OAAO,MAAf;EACE,KAAK;EACL,KAAK,QACH,OAAO,EAAE,SAAS,OAAO,QAAQ;EACnC,KAAK;EACL,KAAK,MACH,OAAO,EAAE,QAAQ,OAAO,OAAO;EACjC,KAAK,OACH,OAAO,EAAE,OAAO,OAAO,MAAM;EAC/B,KAAK,MACH,OAAO;GAAE,UAAU,OAAO;GAAU,UAAU,OAAO;EAAS;EAChE,KAAK,OACH,OAAO;GAAE,OAAO,OAAO;GAAO,KAAK,OAAO;GAAK,OAAO,OAAO;EAAM;EACrE,KAAK,OACH,OAAO;GACL,MAAM,OAAO;GACb,UAAU,OAAO;GACjB,QAAQ,OAAO;GACf,QAAQ,OAAO;EACjB;CACJ;AACF;AAEA,SAAgB,OAAO,MAAiB,OAA2B;CACjE,OACE,KAAK,SAAS,MAAM,QACpB,KAAK,SAAS,MAAM,QACpB,KAAK,UAAU,KAAK,IAAI,CAAC,MAAM,KAAK,UAAU,KAAK,KAAK,CAAC;AAE7D;AAEA,SAAS,OAAO,OAAwB;CACtC,MAAM,QAAQ,MAAM,MAAM,GAAG;CAC7B,OACE,MAAM,WAAW,KACjB,MAAM,OACH,SAAS,YAAY,KAAK,IAAI,KAAK,OAAO,IAAI,KAAK,OAAO,OAAO,OAAO,IAAI,CAAC,MAAM,IACtF;AAEJ;AAEA,SAAS,OAAO,OAAwB;CACtC,IAAI;EACF,OAAO,IAAI,IAAI,WAAW,MAAM,GAAG,CAAC,CAAC,SAAS,WAAW,GAAG;CAC9D,QAAQ;EACN,OAAO;CACT;AACF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { _ as Zone, b as make, c as auth_d_exports, f as Account, g as Options, h as ListZonesInput, m as Interface, p as Fetch, v as client_d_exports, y as discovery } from "./index-BHWRTThN.mjs";
|
|
2
|
-
export { type Account, auth_d_exports as Auth, client_d_exports as Client, type Fetch, type Interface, type ListZonesInput, type Options, type Zone, discovery, make };
|
package/dist/effect-vercel.d.mts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { _ as Zone, b as make, d as Account, f as AccountContext, g as Options, h as ListZonesInput, m as Interface, p as Fetch, s as auth_d_exports, v as client_d_exports, y as discovery } from "./index-D3PVknwE.mjs";
|
|
2
|
-
export { type Account, type AccountContext, auth_d_exports as Auth, client_d_exports as Client, type Fetch, type Interface, type ListZonesInput, type Options, type Zone, discovery, make };
|
package/dist/effect-vercel.mjs
DELETED
package/dist/effect.d.mts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { A as lifecycle_repository_d_exports, At as Type, Bt as invalid_input_d_exports, J as authorization_d_exports, K as ProviderAuthorization, Lt as domain_name_d_exports, M as Connection, Mt as dns_record_d_exports, X as CryptoError, Z as canonical_json_d_exports, ht as provider_d_exports, i as zone_discovery_d_exports, j as AuthorizationError, lt as secret_d_exports, st as manifest_d_exports, w as provider_context_d_exports, zt as Error$1 } from "./zone-discovery-BPnH3sLU.mjs";
|
|
2
|
-
import { t as index_d_exports } from "./index-BHWRTThN.mjs";
|
|
3
|
-
import { t as connection_api_d_exports } from "./connection-api-DNuEZ_jR.mjs";
|
|
4
|
-
import { t as index_d_exports$1 } from "./index-D3PVknwE.mjs";
|
|
5
|
-
import { _ as selection_d_exports, a as verify_d_exports, d as google_doh_d_exports, g as zones_d_exports, h as doh_d_exports, l as resolver_pool_d_exports, p as cloudflare_doh_d_exports, v as diagnostic_d_exports } from "./verify-Dls29YC-.mjs";
|
|
6
|
-
import { B as types_d_exports, N as DnsPlan, b as AuthorizeError, k as plan_d_exports, l as resolver_d_exports, v as deletion_d_exports } from "./resolver-Dc0hwV-J.mjs";
|
|
7
|
-
import { Crypto, Effect } from "effect";
|
|
8
|
-
declare namespace connection_authorization_d_exports {
|
|
9
|
-
export { Error, Requirements, authorize };
|
|
10
|
-
}
|
|
11
|
-
declare const authorize: (input: {
|
|
12
|
-
readonly allowPartial?: boolean;
|
|
13
|
-
readonly authorization: ProviderAuthorization;
|
|
14
|
-
readonly connection: Connection;
|
|
15
|
-
readonly domain: string;
|
|
16
|
-
readonly operationIds?: ReadonlyArray<string>;
|
|
17
|
-
readonly plan: DnsPlan;
|
|
18
|
-
}) => Effect.Effect<{
|
|
19
|
-
allowPartial: boolean;
|
|
20
|
-
operationIds: string[];
|
|
21
|
-
planDigest: string;
|
|
22
|
-
version: "domainkit.plan-authorization.v1";
|
|
23
|
-
}, AuthorizationError | Error$1 | AuthorizeError, Crypto.Crypto>;
|
|
24
|
-
type Error = AuthorizationError | Error$1 | CryptoError;
|
|
25
|
-
type Requirements = Crypto.Crypto;
|
|
26
|
-
declare namespace dns_data_d_exports {
|
|
27
|
-
export { parse };
|
|
28
|
-
}
|
|
29
|
-
declare function parse(type: Type, input: unknown): string;
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region src/effect.d.ts
|
|
32
|
-
/** The current package version from the package manifest. */
|
|
33
|
-
declare const VERSION: string;
|
|
34
|
-
//#endregion
|
|
35
|
-
export { lifecycle_repository_d_exports as AuthorizationLifecycle, index_d_exports as Cloudflare, cloudflare_doh_d_exports as CloudflareDnsOverHttps, connection_api_d_exports as Connection, connection_authorization_d_exports as ConnectionAuthorization, deletion_d_exports as Deletion, diagnostic_d_exports as Diagnostic, canonical_json_d_exports as Digest, dns_data_d_exports as DnsData, doh_d_exports as DnsOverHttps, types_d_exports as DnsPlan, provider_d_exports as DnsProvider, dns_record_d_exports as DnsRecord, resolver_d_exports as DnsResolver, resolver_pool_d_exports as DnsResolverPool, domain_name_d_exports as DomainName, google_doh_d_exports as GoogleDnsOverHttps, invalid_input_d_exports as InvalidInput, manifest_d_exports as ProviderAuth, authorization_d_exports as ProviderAuthorization, provider_context_d_exports as ProviderContext, selection_d_exports as ProviderDiscovery, plan_d_exports as Provisioning, secret_d_exports as Secret, VERSION, index_d_exports$1 as Vercel, verify_d_exports as Verification, zone_discovery_d_exports as ZoneDiscovery, zones_d_exports as Zones };
|
|
36
|
-
//# sourceMappingURL=effect.d.mts.map
|
package/dist/effect.mjs
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import { A as invalid_input_exports, C as provider_exports, D as domain_name_exports, N as lifecycle_repository_exports, g as dns_record_exports } from "./dns-record-BLeqo56C.mjs";
|
|
3
|
-
import { _ as StartResult, b as start, d as provider_context_exports, g as Method, h as Error, m as secret_exports, o as authorization_exports, v as complete, y as extend } from "./authorization-OeaSR47S.mjs";
|
|
4
|
-
import { d as make, l as client_exports, t as auth_exports, u as discovery } from "./auth-BR-19zj-.mjs";
|
|
5
|
-
import { n as zones_exports } from "./zones-DKHTpX9C.mjs";
|
|
6
|
-
import { a as authorizationError, c as validate, i as assertGrant, n as Grant, o as decode, r as Schema, s as encode, t as AuthorizationError } from "./connection-CjNQe_E-.mjs";
|
|
7
|
-
import { t as canonical_json_exports } from "./canonical-json-CpvqGMcr.mjs";
|
|
8
|
-
import { C as selection_exports, D as manifest_exports, O as diagnostic_exports, S as connection_authorization_exports, b as dns_data_exports, g as cloudflare_doh_exports, k as version, m as google_doh_exports, p as resolver_pool_exports, s as verify_exports, v as doh_exports } from "./verify-BKbvq7IN.mjs";
|
|
9
|
-
import { C as plan_exports, L as zone_discovery_exports, N as types_exports, m as deletion_exports, r as resolver_exports } from "./resolver-CxE-VDw4.mjs";
|
|
10
|
-
import { c as client_exports$1, l as discovery$1, t as auth_exports$1, u as make$1 } from "./auth-g-waCHcz.mjs";
|
|
11
|
-
//#region src/providers/cloudflare/index.ts
|
|
12
|
-
var cloudflare_exports = /* @__PURE__ */ __exportAll({
|
|
13
|
-
Auth: () => auth_exports,
|
|
14
|
-
Client: () => client_exports,
|
|
15
|
-
discovery: () => discovery,
|
|
16
|
-
make: () => make
|
|
17
|
-
});
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/auth/connection-api.ts
|
|
20
|
-
var connection_api_exports = /* @__PURE__ */ __exportAll({
|
|
21
|
-
AuthorizationError: () => AuthorizationError,
|
|
22
|
-
Error: () => Error,
|
|
23
|
-
Grant: () => Grant,
|
|
24
|
-
Method: () => Method,
|
|
25
|
-
Schema: () => Schema,
|
|
26
|
-
StartResult: () => StartResult,
|
|
27
|
-
assertGrant: () => assertGrant,
|
|
28
|
-
authorizationError: () => authorizationError,
|
|
29
|
-
complete: () => complete,
|
|
30
|
-
decode: () => decode,
|
|
31
|
-
encode: () => encode,
|
|
32
|
-
extend: () => extend,
|
|
33
|
-
start: () => start,
|
|
34
|
-
validate: () => validate
|
|
35
|
-
});
|
|
36
|
-
//#endregion
|
|
37
|
-
//#region src/providers/vercel/index.ts
|
|
38
|
-
var vercel_exports = /* @__PURE__ */ __exportAll({
|
|
39
|
-
Auth: () => auth_exports$1,
|
|
40
|
-
Client: () => client_exports$1,
|
|
41
|
-
discovery: () => discovery$1,
|
|
42
|
-
make: () => make$1
|
|
43
|
-
});
|
|
44
|
-
//#endregion
|
|
45
|
-
//#region src/effect.ts
|
|
46
|
-
/** The current package version from the package manifest. */
|
|
47
|
-
const VERSION = version;
|
|
48
|
-
//#endregion
|
|
49
|
-
export { lifecycle_repository_exports as AuthorizationLifecycle, cloudflare_exports as Cloudflare, cloudflare_doh_exports as CloudflareDnsOverHttps, connection_api_exports as Connection, connection_authorization_exports as ConnectionAuthorization, deletion_exports as Deletion, diagnostic_exports as Diagnostic, canonical_json_exports as Digest, dns_data_exports as DnsData, doh_exports as DnsOverHttps, types_exports as DnsPlan, provider_exports as DnsProvider, dns_record_exports as DnsRecord, resolver_exports as DnsResolver, resolver_pool_exports as DnsResolverPool, domain_name_exports as DomainName, google_doh_exports as GoogleDnsOverHttps, invalid_input_exports as InvalidInput, manifest_exports as ProviderAuth, authorization_exports as ProviderAuthorization, provider_context_exports as ProviderContext, selection_exports as ProviderDiscovery, plan_exports as Provisioning, secret_exports as Secret, VERSION, vercel_exports as Vercel, verify_exports as Verification, zone_discovery_exports as ZoneDiscovery, zones_exports as Zones };
|
|
50
|
-
|
|
51
|
-
//# sourceMappingURL=effect.mjs.map
|
package/dist/effect.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"effect.mjs","names":["packageJson.version"],"sources":["../src/providers/cloudflare/index.ts","../src/auth/connection-api.ts","../src/providers/vercel/index.ts","../src/effect.ts"],"sourcesContent":["export * as Auth from \"./auth.ts\";\nexport * as Client from \"./client.ts\";\n\nexport { discovery, make } from \"./client.ts\";\nexport type { Account, Fetch, Interface, ListZonesInput, Options, Zone } from \"./client.ts\";\n","export {\n assertGrant,\n authorizationError,\n AuthorizationError,\n decode,\n encode,\n Grant,\n Schema,\n validate,\n} from \"./connection.ts\";\nexport type { Connection, StoredCredential } from \"./connection.ts\";\nexport { complete, Error, extend, Method, start, StartResult } from \"./connect.ts\";\nexport type {\n Authentication,\n AuthenticationFailure,\n BaseInput,\n CompleteInput,\n Continuation,\n ContinuationStore,\n Failure,\n InteractiveFlow,\n InteractiveStart,\n ExtendInput,\n Method as ConnectionMethod,\n Requirements,\n StartResult as ConnectionStartResult,\n} from \"./connect.ts\";\n","export * as Auth from \"./auth.ts\";\nexport * as Client from \"./client.ts\";\n\nexport { discovery, make } from \"./client.ts\";\nexport type {\n Account,\n AccountContext,\n Fetch,\n Interface,\n ListZonesInput,\n Options,\n Zone,\n} from \"./client.ts\";\n","import packageJson from \"../package.json\" with { type: \"json\" };\n\n/** The current package version from the package manifest. */\nexport const VERSION = packageJson.version;\n\nexport * as Connection from \"./auth/connection-api.ts\";\nexport * as AuthorizationLifecycle from \"./auth/lifecycle-repository.ts\";\nexport * as Diagnostic from \"./auth/diagnostic.ts\";\nexport * as ProviderAuth from \"./auth/manifest.ts\";\nexport * as ProviderAuthorization from \"./auth/authorization.ts\";\nexport * as ProviderContext from \"./auth/provider-context.ts\";\nexport * as Secret from \"./auth/secret.ts\";\nexport * as ProviderDiscovery from \"./discovery/selection.ts\";\nexport * as ZoneDiscovery from \"./discovery/zone-discovery.ts\";\nexport * as Zones from \"./discovery/zones.ts\";\nexport * as DnsRecord from \"./domain/dns-record.ts\";\nexport * as DomainName from \"./domain/domain-name.ts\";\nexport * as InvalidInput from \"./invalid-input.ts\";\nexport * as DnsProvider from \"./provider/provider.ts\";\nexport * as ConnectionAuthorization from \"./plan/connection-authorization.ts\";\nexport * as Digest from \"./plan/canonical-json.ts\";\nexport * as Deletion from \"./plan/deletion.ts\";\nexport * as Provisioning from \"./plan/plan.ts\";\nexport * as DnsPlan from \"./plan/types.ts\";\nexport * as Cloudflare from \"./providers/cloudflare/index.ts\";\nexport * as Vercel from \"./providers/vercel/index.ts\";\nexport * as CloudflareDnsOverHttps from \"./verification/cloudflare-doh.ts\";\nexport * as DnsData from \"./verification/dns-data.ts\";\nexport * as DnsOverHttps from \"./verification/doh.ts\";\nexport * as GoogleDnsOverHttps from \"./verification/google-doh.ts\";\nexport * as DnsResolverPool from \"./verification/resolver-pool.ts\";\nexport * as DnsResolver from \"./verification/resolver.ts\";\nexport * as Verification from \"./verification/verify.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AGGA,MAAa,UAAUA"}
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { C as Envelope, Ft as DomainName, S as Codec, ct as Value, et as Manifest, ft as Error, g as Method, it as OAuthSubjectResolver, m as InteractiveFlow, nt as OAuthClientConfiguration, ot as TokenValidation, pt as Interface$1, r as Source, rt as OAuthMethod, zt as Error$1 } from "./zone-discovery-BPnH3sLU.mjs";
|
|
2
|
-
import { Effect, Schema } from "effect";
|
|
3
|
-
import * as oauth from "oauth4webapi";
|
|
4
|
-
//#region src/providers/cloudflare/protocol.d.ts
|
|
5
|
-
declare const Account$1: Schema.Struct<{
|
|
6
|
-
readonly id: Schema.String;
|
|
7
|
-
readonly name: Schema.String;
|
|
8
|
-
}>;
|
|
9
|
-
interface Account$1 extends Schema.Schema.Type<typeof Account$1> {}
|
|
10
|
-
declare namespace client_d_exports {
|
|
11
|
-
export { Account, Fetch, Interface, ListZonesInput, Options, Zone, discoverAuthorizationAccount, discovery, make, validateDomainToken };
|
|
12
|
-
}
|
|
13
|
-
type Fetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
14
|
-
/** Configuration for an Effect-native Cloudflare authoritative-DNS client. */
|
|
15
|
-
interface Options {
|
|
16
|
-
readonly accountId: string;
|
|
17
|
-
readonly baseUrl?: string;
|
|
18
|
-
/** Capabilities the host required when issuing or authorizing this credential. */
|
|
19
|
-
readonly capabilities: TokenValidation["capabilities"];
|
|
20
|
-
readonly fetch?: Fetch;
|
|
21
|
-
readonly token: Value;
|
|
22
|
-
readonly tokenKind?: "account" | "user";
|
|
23
|
-
}
|
|
24
|
-
interface ListZonesInput {
|
|
25
|
-
readonly accountId?: string;
|
|
26
|
-
readonly name?: DomainName;
|
|
27
|
-
}
|
|
28
|
-
type Account = Account$1;
|
|
29
|
-
/** A portable Cloudflare authoritative zone with normalized nameserver evidence. */
|
|
30
|
-
interface Zone {
|
|
31
|
-
readonly accountId: string;
|
|
32
|
-
readonly id: string;
|
|
33
|
-
readonly name: DomainName;
|
|
34
|
-
readonly nameservers: ReadonlyArray<DomainName>;
|
|
35
|
-
readonly status: string | null;
|
|
36
|
-
}
|
|
37
|
-
interface Interface extends Interface$1 {
|
|
38
|
-
readonly listAccounts: () => Effect.Effect<ReadonlyArray<Account>, Error>;
|
|
39
|
-
readonly listZones: (input?: ListZonesInput) => Effect.Effect<ReadonlyArray<Zone>, Error>;
|
|
40
|
-
readonly validateToken: () => Effect.Effect<TokenValidation, Error>;
|
|
41
|
-
}
|
|
42
|
-
/** Exposes Cloudflare zone lookup as the optional provider discovery capability. */
|
|
43
|
-
declare function discovery(client: Interface): Source;
|
|
44
|
-
interface CredentialOptions$1 {
|
|
45
|
-
readonly baseUrl?: string;
|
|
46
|
-
readonly fetch?: Fetch;
|
|
47
|
-
readonly token: Value;
|
|
48
|
-
}
|
|
49
|
-
interface DomainCredentialOptions extends CredentialOptions$1 {
|
|
50
|
-
readonly capabilities: TokenValidation["capabilities"];
|
|
51
|
-
readonly domain: DomainName;
|
|
52
|
-
readonly tokenKind?: "account" | "user";
|
|
53
|
-
}
|
|
54
|
-
declare const discoverAuthorizationAccount: (options: CredentialOptions$1 & {
|
|
55
|
-
readonly domain: DomainName;
|
|
56
|
-
}) => Effect.Effect<{
|
|
57
|
-
readonly id: string;
|
|
58
|
-
readonly name: string;
|
|
59
|
-
}, Error, never>;
|
|
60
|
-
declare const validateDomainToken: (options: DomainCredentialOptions) => Effect.Effect<{
|
|
61
|
-
accountId: string;
|
|
62
|
-
capabilities: readonly ("dns:read" | "dns:write")[];
|
|
63
|
-
expiresAt: Date | null;
|
|
64
|
-
scopes: never[];
|
|
65
|
-
}, Error, never>;
|
|
66
|
-
/** Creates an Effect-native Cloudflare client without owning the credential lifecycle. */
|
|
67
|
-
declare function make(options: Options): Interface;
|
|
68
|
-
declare namespace auth_d_exports {
|
|
69
|
-
export { Context$1 as Context, CredentialTarget, OAuthFlowOptions, OAuthMethodOptions, SubjectResolverOptions, TokenConnectionOptions, TokenValidatorOptions, contextCodec, manifest, oauthAuthentication, oauthFlow, oauthMethod, subjectResolver, tokenConnectionMethod, tokenMethod, tokenValidator };
|
|
70
|
-
}
|
|
71
|
-
declare const Context$1: Schema.Struct<{
|
|
72
|
-
readonly tokenKind: Schema.Literals<readonly ["account", "user"]>;
|
|
73
|
-
}>;
|
|
74
|
-
type Context$1 = typeof Context$1.Type;
|
|
75
|
-
declare const contextCodec: Codec<{
|
|
76
|
-
readonly tokenKind: "account" | "user";
|
|
77
|
-
}>;
|
|
78
|
-
/** Describes Cloudflare's caller-created API-token authorization method. */
|
|
79
|
-
declare function tokenMethod(capabilities: TokenValidation["capabilities"]): Extract<Manifest["methods"][number], {
|
|
80
|
-
readonly _tag: "token";
|
|
81
|
-
}>;
|
|
82
|
-
interface OAuthMethodOptions {
|
|
83
|
-
/** Scope IDs assigned to the OAuth client by Cloudflare. */
|
|
84
|
-
readonly scopes: ReadonlyArray<string>;
|
|
85
|
-
/** Capabilities represented by those assigned scope IDs. */
|
|
86
|
-
readonly capabilities: TokenValidation["capabilities"];
|
|
87
|
-
readonly clientAuth: OAuthMethod["clientAuth"];
|
|
88
|
-
}
|
|
89
|
-
/** Describes a registered Cloudflare OAuth client and its assigned scope IDs. */
|
|
90
|
-
declare function oauthMethod(options: OAuthMethodOptions): OAuthMethod;
|
|
91
|
-
/** Creates the Cloudflare token and OAuth authorization manifest. */
|
|
92
|
-
declare function manifest(options: OAuthMethodOptions): Manifest;
|
|
93
|
-
type CredentialOptions = Omit<Options, "accountId" | "token" | "tokenKind">;
|
|
94
|
-
/** Selects an explicit Cloudflare account or discovers it from an authorized domain. */
|
|
95
|
-
type CredentialTarget = {
|
|
96
|
-
readonly accountId: string;
|
|
97
|
-
readonly domain?: never;
|
|
98
|
-
} | {
|
|
99
|
-
readonly accountId?: never;
|
|
100
|
-
readonly domain: DomainName;
|
|
101
|
-
};
|
|
102
|
-
type SubjectResolverOptions = CredentialOptions & CredentialTarget;
|
|
103
|
-
/** Configuration for validating a Cloudflare token against an account or authorized domain. */
|
|
104
|
-
type TokenValidatorOptions = CredentialOptions & ({
|
|
105
|
-
readonly accountId: string;
|
|
106
|
-
readonly domain?: never;
|
|
107
|
-
readonly tokenKind?: "account" | "user";
|
|
108
|
-
} | {
|
|
109
|
-
readonly accountId?: never;
|
|
110
|
-
readonly domain: DomainName;
|
|
111
|
-
readonly tokenKind?: "account" | "user";
|
|
112
|
-
});
|
|
113
|
-
/** Resolves the Cloudflare account selected by a completed OAuth grant. */
|
|
114
|
-
declare function subjectResolver(options: SubjectResolverOptions): OAuthSubjectResolver;
|
|
115
|
-
/** Creates a host callback that validates a Cloudflare API token. */
|
|
116
|
-
declare function tokenValidator(options: TokenValidatorOptions): (token: Value) => ReturnType<Interface["validateToken"]>;
|
|
117
|
-
type TokenConnectionOptions = TokenValidatorOptions & {
|
|
118
|
-
readonly token: Value;
|
|
119
|
-
};
|
|
120
|
-
/** Creates a provider-independent token connection method backed by Cloudflare validation. */
|
|
121
|
-
declare function tokenConnectionMethod(options: TokenConnectionOptions): Extract<Method, {
|
|
122
|
-
readonly _tag: "Token";
|
|
123
|
-
}>;
|
|
124
|
-
/** Converts a completed Cloudflare OAuth grant into the canonical connection authentication. */
|
|
125
|
-
declare const oauthAuthentication: (options: SubjectResolverOptions & {
|
|
126
|
-
readonly accessToken: Value;
|
|
127
|
-
readonly tokens: oauth.TokenEndpointResponse;
|
|
128
|
-
}) => Effect.Effect<{
|
|
129
|
-
capabilityEvidence: {
|
|
130
|
-
capability: "dns:read" | "dns:write";
|
|
131
|
-
evidence: {
|
|
132
|
-
readonly _tag: "Introspected";
|
|
133
|
-
readonly observedAt: Date;
|
|
134
|
-
};
|
|
135
|
-
}[];
|
|
136
|
-
credential: {
|
|
137
|
-
accessToken: Value;
|
|
138
|
-
refreshToken: Value | null;
|
|
139
|
-
tokenType: Lowercase<string>;
|
|
140
|
-
};
|
|
141
|
-
expiresAt: Date | null;
|
|
142
|
-
providerAccountId: string;
|
|
143
|
-
providerContext: Envelope;
|
|
144
|
-
scopes: string[];
|
|
145
|
-
}, Error$1 | Error, never>;
|
|
146
|
-
type OAuthFlowOptions = SubjectResolverOptions & {
|
|
147
|
-
readonly client: OAuthClientConfiguration;
|
|
148
|
-
readonly clientAuth: OAuthMethod["clientAuth"];
|
|
149
|
-
readonly redirectUri: string;
|
|
150
|
-
readonly scopes: ReadonlyArray<string>;
|
|
151
|
-
};
|
|
152
|
-
/** Creates Cloudflare's OAuth implementation of the common interactive connection capability. */
|
|
153
|
-
declare function oauthFlow(options: OAuthFlowOptions): InteractiveFlow;
|
|
154
|
-
declare namespace index_d_exports {
|
|
155
|
-
export { Account, auth_d_exports as Auth, client_d_exports as Client, Fetch, Interface, ListZonesInput, Options, Zone, discovery, make };
|
|
156
|
-
}
|
|
157
|
-
//#endregion
|
|
158
|
-
export { Zone as _, SubjectResolverOptions as a, make as b, auth_d_exports as c, tokenMethod as d, Account as f, Options as g, ListZonesInput as h, OAuthMethodOptions as i, manifest as l, Interface as m, CredentialTarget as n, TokenConnectionOptions as o, Fetch as p, OAuthFlowOptions as r, TokenValidatorOptions as s, index_d_exports as t, oauthMethod as u, client_d_exports as v, discovery as y };
|
|
159
|
-
//# sourceMappingURL=index-BHWRTThN.d.mts.map
|