domainkit 0.1.0 → 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.
- package/README.md +91 -71
- package/dist/{auth-Vi-hhXbV.mjs → auth-CZ1pZHMZ.mjs} +301 -38
- package/dist/auth-CZ1pZHMZ.mjs.map +1 -0
- package/dist/{client-BnD7QLRF.mjs → auth-CzhZ3Cuc.mjs} +235 -131
- package/dist/auth-CzhZ3Cuc.mjs.map +1 -0
- package/dist/authorization-DOg2Re1D.mjs +247 -0
- package/dist/authorization-DOg2Re1D.mjs.map +1 -0
- package/dist/canonical-json-CpvqGMcr.mjs +57 -0
- package/dist/canonical-json-CpvqGMcr.mjs.map +1 -0
- package/dist/{cloudflare-C6ryPlCZ.mjs → cloudflare-BedFw4cX.mjs} +28 -7
- package/dist/cloudflare-BedFw4cX.mjs.map +1 -0
- package/dist/cloudflare-FDl5q7Dm.d.mts +32 -0
- package/dist/cloudflare.d.mts +3 -3
- package/dist/cloudflare.mjs +2 -2
- package/dist/connection-BWrBwqjk.mjs +58 -0
- package/dist/connection-BWrBwqjk.mjs.map +1 -0
- package/dist/connection-CEqadXSm.d.mts +182 -0
- package/dist/connection-CcQokgrd.mjs +186 -0
- package/dist/connection-CcQokgrd.mjs.map +1 -0
- package/dist/connection-api-DftK7eHo.d.mts +7 -0
- package/dist/{dns-record-C_KwGPLf.mjs → dns-record-BLeqo56C.mjs} +23 -3
- package/dist/dns-record-BLeqo56C.mjs.map +1 -0
- package/dist/effect-cloudflare.d.mts +2 -2
- package/dist/effect-cloudflare.mjs +2 -2
- package/dist/effect-vercel.d.mts +2 -2
- package/dist/effect-vercel.mjs +2 -2
- package/dist/effect.d.mts +9 -46
- package/dist/effect.mjs +29 -7
- package/dist/effect.mjs.map +1 -1
- package/dist/index-B1opsgls.d.mts +159 -0
- package/dist/{index-CEzk2gbZ.d.mts → index-Ewc__bQu.d.mts} +58 -7
- package/dist/index.d.mts +169 -113
- package/dist/index.mjs +201 -138
- package/dist/index.mjs.map +1 -1
- package/dist/{resolver-BHPsADzE.d.mts → resolver-CJOR9mQ8.d.mts} +620 -263
- package/dist/resolver-CxE-VDw4.mjs +598 -0
- package/dist/resolver-CxE-VDw4.mjs.map +1 -0
- package/dist/testing.d.mts +53 -44
- package/dist/testing.mjs +379 -107
- package/dist/testing.mjs.map +1 -1
- package/dist/{vercel-DD89DCqH.mjs → vercel-CWZ33NUS.mjs} +23 -3
- package/dist/vercel-CWZ33NUS.mjs.map +1 -0
- package/dist/vercel-DgJaUX9D.d.mts +31 -0
- package/dist/vercel.d.mts +3 -3
- package/dist/vercel.mjs +2 -2
- package/dist/verify-BzpiA0Es.mjs +642 -0
- package/dist/verify-BzpiA0Es.mjs.map +1 -0
- package/dist/verify-DZWLM91T.d.mts +805 -0
- package/dist/zone-discovery-BA5I24vu.d.mts +1390 -0
- package/dist/zones-DKHTpX9C.mjs +19 -0
- package/dist/zones-DKHTpX9C.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/auth-Vi-hhXbV.mjs.map +0 -1
- package/dist/client-BnD7QLRF.mjs.map +0 -1
- package/dist/cloudflare-C6ryPlCZ.mjs.map +0 -1
- package/dist/cloudflare-tdjNS8vE.d.mts +0 -23
- package/dist/dns-record-C_KwGPLf.mjs.map +0 -1
- package/dist/index-CS9Rl5LQ.d.mts +0 -71
- package/dist/manifest-CP85ePFn.d.mts +0 -583
- package/dist/receipt-CGSnfZQ6.mjs +0 -28
- package/dist/receipt-CGSnfZQ6.mjs.map +0 -1
- package/dist/resolver-tEXpKxmH.mjs +0 -200
- package/dist/resolver-tEXpKxmH.mjs.map +0 -1
- package/dist/vercel-D-E2aqb1.d.mts +0 -22
- package/dist/vercel-DD89DCqH.mjs.map +0 -1
- package/dist/verify-B80xCBh2.d.mts +0 -1407
- package/dist/verify-BjrR_4NF.mjs +0 -1401
- package/dist/verify-BjrR_4NF.mjs.map +0 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { O as parse, T as Schema$2, k as Error$1 } from "./dns-record-BLeqo56C.mjs";
|
|
2
|
+
import { l as evidenceFor } from "./authorization-DOg2Re1D.mjs";
|
|
3
|
+
import { Effect, Schema } from "effect";
|
|
4
|
+
//#region src/auth/connection.ts
|
|
5
|
+
const Grant = Schema.TaggedUnion({
|
|
6
|
+
account: {},
|
|
7
|
+
domains: { domains: Schema.Array(Schema$2) }
|
|
8
|
+
});
|
|
9
|
+
/** An owner-scoped grant bound to one provider authorization. */
|
|
10
|
+
const Schema$1 = Schema.Struct({
|
|
11
|
+
authorizationId: Schema.String,
|
|
12
|
+
createdAt: Schema.DateFromString,
|
|
13
|
+
grant: Grant,
|
|
14
|
+
id: Schema.String,
|
|
15
|
+
ownerId: Schema.String
|
|
16
|
+
});
|
|
17
|
+
const decode = Effect.fn("Connection.decode")((input) => Schema.decodeUnknownEffect(Schema$1)(input).pipe(Effect.mapError((cause) => new Error$1({ message: cause.message }))));
|
|
18
|
+
const validate = Effect.fn("Connection.validate")((input) => Schema.decodeUnknownEffect(Schema.toType(Schema$1))(input).pipe(Effect.mapError((cause) => new Error$1({ message: cause.message }))));
|
|
19
|
+
const encode = Schema.encodeSync(Schema$1);
|
|
20
|
+
var AuthorizationError = class extends Schema.TaggedError()("AuthorizationError", {
|
|
21
|
+
category: Schema.Literal("authorization"),
|
|
22
|
+
message: Schema.String,
|
|
23
|
+
operation: Schema.String,
|
|
24
|
+
retry: Schema.Literals([
|
|
25
|
+
"never",
|
|
26
|
+
"after-user-action",
|
|
27
|
+
"safe",
|
|
28
|
+
"unknown"
|
|
29
|
+
])
|
|
30
|
+
}) {};
|
|
31
|
+
const authorizationError = (message, operation) => new AuthorizationError({
|
|
32
|
+
category: "authorization",
|
|
33
|
+
message,
|
|
34
|
+
operation,
|
|
35
|
+
retry: "after-user-action"
|
|
36
|
+
});
|
|
37
|
+
function assertGrant(connection, authorization, request) {
|
|
38
|
+
if (connection.authorizationId !== authorization.id || authorization.providerId !== request.providerId || authorization.revocation._tag !== "Active") throw authorizationError("Connection does not grant this provider account", "Connection.assertGrant");
|
|
39
|
+
if (authorization.expiresAt !== null) {
|
|
40
|
+
if (Number.isNaN(authorization.expiresAt.getTime())) throw authorizationError("Connection expiration is invalid", "Connection.assertGrant");
|
|
41
|
+
if (authorization.expiresAt <= (request.now ?? /* @__PURE__ */ new Date())) throw authorizationError("Connection has expired", "Connection.assertGrant");
|
|
42
|
+
}
|
|
43
|
+
if (!authorization.requiredCapabilities.includes(request.capability)) throw authorizationError(`Connection lacks the ${request.capability} capability`, "Connection.assertGrant");
|
|
44
|
+
if (evidenceFor(authorization, request.capability) === void 0) throw authorizationError(`Connection has no evidence for the ${request.capability} capability`, "Connection.assertGrant");
|
|
45
|
+
let domain;
|
|
46
|
+
try {
|
|
47
|
+
domain = parse(request.domain);
|
|
48
|
+
} catch (cause) {
|
|
49
|
+
if (cause instanceof Error$1) throw cause;
|
|
50
|
+
throw new Error$1({ message: cause instanceof Error ? cause.message : String(cause) });
|
|
51
|
+
}
|
|
52
|
+
if (connection.grant._tag === "domains" && !connection.grant.domains.includes(domain)) throw authorizationError("Connection does not grant this domain", "Connection.assertGrant");
|
|
53
|
+
return domain;
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { authorizationError as a, validate as c, assertGrant as i, Grant as n, decode as o, Schema$1 as r, encode as s, AuthorizationError as t };
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=connection-BWrBwqjk.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-BWrBwqjk.mjs","names":["S","DomainName.Schema","Schema","InvalidInputError","ProviderAuthorization.evidenceFor","DomainName.parse"],"sources":["../src/auth/connection.ts"],"sourcesContent":["import { Effect, Schema as S } from \"effect\";\n\nimport * as DomainName from \"../domain/domain-name.ts\";\nimport { Error as InvalidInputError } from \"../invalid-input.ts\";\nimport type { Value as Secret } from \"./secret.ts\";\nimport type { OAuthMethod } from \"./manifest.ts\";\nimport * as ProviderAuthorization from \"./authorization.ts\";\n\nexport const Grant = S.TaggedUnion({\n account: {},\n domains: { domains: S.Array(DomainName.Schema) },\n});\nexport type Grant = typeof Grant.Type;\n\n/** An owner-scoped grant bound to one provider authorization. */\nexport const Schema = S.Struct({\n authorizationId: S.String,\n createdAt: S.DateFromString,\n grant: Grant,\n id: S.String,\n ownerId: S.String,\n});\nexport interface Connection extends S.Schema.Type<typeof Schema> {}\n\nexport const decode = Effect.fn(\"Connection.decode\")((input: unknown) =>\n S.decodeUnknownEffect(Schema)(input).pipe(\n Effect.mapError((cause) => new InvalidInputError({ message: cause.message })),\n ),\n);\n\nexport const validate = Effect.fn(\"Connection.validate\")((input: unknown) =>\n S.decodeUnknownEffect(S.toType(Schema))(input).pipe(\n Effect.mapError((cause) => new InvalidInputError({ message: cause.message })),\n ),\n);\n\nexport const encode = S.encodeSync(Schema);\n\nexport interface OAuthContinuation {\n readonly clientId: string;\n readonly codeVerifier: Secret;\n readonly expiresAt: Date;\n readonly grant: Grant;\n readonly method: OAuthMethod;\n readonly ownerId: string;\n readonly redirectUri: string;\n readonly stateHash: string;\n readonly authorizedById: string;\n}\n\nexport interface StoredCredential {\n readonly accessToken: Secret;\n readonly refreshToken: Secret | null;\n readonly tokenType: string;\n}\n\nexport class AuthorizationError extends S.TaggedError<AuthorizationError>()(\"AuthorizationError\", {\n category: S.Literal(\"authorization\"),\n message: S.String,\n operation: S.String,\n retry: S.Literals([\"never\", \"after-user-action\", \"safe\", \"unknown\"]),\n}) {}\n\nexport const authorizationError = (message: string, operation: string): AuthorizationError =>\n new AuthorizationError({\n category: \"authorization\",\n message,\n operation,\n retry: \"after-user-action\",\n });\n\nexport function assertGrant(\n connection: Connection,\n authorization: ProviderAuthorization.ProviderAuthorization,\n request: {\n readonly capability: ProviderAuthorization.Capability;\n readonly domain: string;\n readonly now?: Date;\n readonly providerId: string;\n },\n): DomainName.DomainName {\n if (\n connection.authorizationId !== authorization.id ||\n authorization.providerId !== request.providerId ||\n authorization.revocation._tag !== \"Active\"\n ) {\n throw authorizationError(\n \"Connection does not grant this provider account\",\n \"Connection.assertGrant\",\n );\n }\n if (authorization.expiresAt !== null) {\n if (Number.isNaN(authorization.expiresAt.getTime())) {\n throw authorizationError(\"Connection expiration is invalid\", \"Connection.assertGrant\");\n }\n if (authorization.expiresAt <= (request.now ?? new Date())) {\n throw authorizationError(\"Connection has expired\", \"Connection.assertGrant\");\n }\n }\n if (!authorization.requiredCapabilities.includes(request.capability)) {\n throw authorizationError(\n `Connection lacks the ${request.capability} capability`,\n \"Connection.assertGrant\",\n );\n }\n if (ProviderAuthorization.evidenceFor(authorization, request.capability) === undefined) {\n throw authorizationError(\n `Connection has no evidence for the ${request.capability} capability`,\n \"Connection.assertGrant\",\n );\n }\n let domain: DomainName.DomainName;\n try {\n domain = DomainName.parse(request.domain);\n } catch (cause) {\n if (cause instanceof InvalidInputError) throw cause;\n throw new InvalidInputError({\n message: cause instanceof Error ? cause.message : String(cause),\n });\n }\n if (connection.grant._tag === \"domains\" && !connection.grant.domains.includes(domain)) {\n throw authorizationError(\"Connection does not grant this domain\", \"Connection.assertGrant\");\n }\n return domain;\n}\n"],"mappings":";;;;AAQA,MAAa,QAAQA,OAAE,YAAY;CACjC,SAAS,CAAC;CACV,SAAS,EAAE,SAASA,OAAE,MAAMC,QAAiB,EAAE;AACjD,CAAC;;AAID,MAAaC,WAASF,OAAE,OAAO;CAC7B,iBAAiBA,OAAE;CACnB,WAAWA,OAAE;CACb,OAAO;CACP,IAAIA,OAAE;CACN,SAASA,OAAE;AACb,CAAC;AAGD,MAAa,SAAS,OAAO,GAAG,mBAAmB,CAAC,EAAE,UACpDA,OAAE,oBAAoBE,QAAM,CAAC,CAAC,KAAK,CAAC,CAAC,KACnC,OAAO,UAAU,UAAU,IAAIC,QAAkB,EAAE,SAAS,MAAM,QAAQ,CAAC,CAAC,CAC9E,CACF;AAEA,MAAa,WAAW,OAAO,GAAG,qBAAqB,CAAC,EAAE,UACxDH,OAA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BAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,EAChE,CAAC;CACH;CACA,IAAI,WAAW,MAAM,SAAS,aAAa,CAAC,WAAW,MAAM,QAAQ,SAAS,MAAM,GAClF,MAAM,mBAAmB,yCAAyC,wBAAwB;CAE5F,OAAO;AACT"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { A as Connection, B as Capability, C as Aggregate, D as Service, E as Interface, F as assertGrant, M as OAuthContinuation, N as Schema$1, Nt as DomainName, P as StoredCredential, R as encode, T as Error, V as CapabilityEvidence, _ as StartResult, a as Authentication, ct as AsyncInterface, d as Error$1, h as Method$1, j as Grant, k as AuthorizationError, l as Continuation, m as InteractiveStart, ot as Value, p as InteractiveFlow$1, r as Source$1, s as BaseInput, t as Candidate, u as ContinuationStore$1, w as DetachResult } from "./zone-discovery-BA5I24vu.mjs";
|
|
2
|
+
import "./connection-api-DftK7eHo.mjs";
|
|
3
|
+
import { Data, Layer } from "effect";
|
|
4
|
+
declare namespace zone_discovery_d_exports {
|
|
5
|
+
export { Candidate, Outcome, Source, discover, toEffectSource };
|
|
6
|
+
}
|
|
7
|
+
interface Source {
|
|
8
|
+
readonly listZones: (name: DomainName) => Promise<ReadonlyArray<Omit<Candidate, "providerId">>>;
|
|
9
|
+
readonly provider: AsyncInterface;
|
|
10
|
+
}
|
|
11
|
+
type Outcome = {
|
|
12
|
+
readonly _tag: "NotFound";
|
|
13
|
+
readonly domain: DomainName;
|
|
14
|
+
} | {
|
|
15
|
+
readonly _tag: "Resolved";
|
|
16
|
+
readonly candidate: Candidate;
|
|
17
|
+
} | {
|
|
18
|
+
readonly _tag: "SelectionRequired";
|
|
19
|
+
readonly candidates: ReadonlyArray<Candidate>;
|
|
20
|
+
};
|
|
21
|
+
declare function discover(input: {
|
|
22
|
+
readonly domain: DomainName;
|
|
23
|
+
readonly sources: ReadonlyArray<Source>;
|
|
24
|
+
}): Promise<Outcome>;
|
|
25
|
+
declare function toEffectSource(source: Source): Source$1;
|
|
26
|
+
declare namespace authorization_lifecycle_d_exports {
|
|
27
|
+
export { Aggregate, DetachResult, Error, Repository, from, layerFrom, toAsync };
|
|
28
|
+
}
|
|
29
|
+
interface Repository {
|
|
30
|
+
readonly bind: (authorizationId: string, binding: Connection) => Promise<Aggregate>;
|
|
31
|
+
readonly connect: (aggregate: Aggregate) => Promise<Aggregate>;
|
|
32
|
+
readonly detach: (input: {
|
|
33
|
+
readonly connectionId: string;
|
|
34
|
+
readonly revoke: (aggregate: Aggregate) => Promise<void>;
|
|
35
|
+
}) => Promise<DetachResult>;
|
|
36
|
+
readonly findByProviderAccount: (providerId: string, providerAccountId: string) => Promise<Aggregate | null>;
|
|
37
|
+
readonly get: (authorizationId: string) => Promise<Aggregate | null>;
|
|
38
|
+
readonly getByConnectionId: (connectionId: string) => Promise<Aggregate | null>;
|
|
39
|
+
readonly promoteEvidence: (authorizationId: string, evidence: ReadonlyArray<CapabilityEvidence>) => Promise<Aggregate>;
|
|
40
|
+
readonly recover: (input: {
|
|
41
|
+
readonly authorizationId: string;
|
|
42
|
+
readonly revoke: (aggregate: Aggregate) => Promise<void>;
|
|
43
|
+
}) => Promise<DetachResult>;
|
|
44
|
+
readonly rotate: (authorizationId: string, credential: StoredCredential, expiresAt: Date | null) => Promise<Aggregate>;
|
|
45
|
+
}
|
|
46
|
+
declare const layerFrom: (repository: Repository) => Layer.Layer<Service>;
|
|
47
|
+
declare const toAsync: (repository: Interface) => Repository;
|
|
48
|
+
declare const from: (repository: Repository) => Repository;
|
|
49
|
+
declare namespace connection_d_exports {
|
|
50
|
+
export { Authentication, AuthorizationError, Connection, StartResult as ConnectionStartResult, ContinuationStore, Error$1 as Error, Grant, InteractiveFlow, Method, OAuthContinuation, Schema$1 as Schema, StartResult, StoredCredential, assertGrant, complete, decode, encode, fromEffectFlow, fromEffectTokenMethod, start, toAsyncContinuations };
|
|
51
|
+
}
|
|
52
|
+
declare function decode(input: unknown): Promise<Connection>;
|
|
53
|
+
type Method = Data.TaggedEnum<{
|
|
54
|
+
Interactive: {
|
|
55
|
+
readonly continuations: ContinuationStore;
|
|
56
|
+
readonly flow: InteractiveFlow;
|
|
57
|
+
readonly ttlMs?: number;
|
|
58
|
+
};
|
|
59
|
+
Token: {
|
|
60
|
+
readonly authenticate: (token: Value) => Promise<Authentication>;
|
|
61
|
+
readonly providerId: string;
|
|
62
|
+
readonly requiredCapabilities: ReadonlyArray<Capability>;
|
|
63
|
+
readonly token: Value;
|
|
64
|
+
};
|
|
65
|
+
}>;
|
|
66
|
+
declare const Method: {
|
|
67
|
+
readonly $is: <Tag extends "Interactive" | "Token">(tag: Tag) => (u: unknown) => u is Extract<{
|
|
68
|
+
readonly _tag: "Interactive";
|
|
69
|
+
readonly continuations: ContinuationStore;
|
|
70
|
+
readonly flow: InteractiveFlow;
|
|
71
|
+
readonly ttlMs?: number;
|
|
72
|
+
}, {
|
|
73
|
+
readonly _tag: Tag;
|
|
74
|
+
}> | Extract<{
|
|
75
|
+
readonly _tag: "Token";
|
|
76
|
+
readonly authenticate: (token: Value) => Promise<Authentication>;
|
|
77
|
+
readonly providerId: string;
|
|
78
|
+
readonly requiredCapabilities: ReadonlyArray<Capability>;
|
|
79
|
+
readonly token: Value;
|
|
80
|
+
}, {
|
|
81
|
+
readonly _tag: Tag;
|
|
82
|
+
}>;
|
|
83
|
+
readonly $match: {
|
|
84
|
+
<Cases extends { readonly [Tag in "Interactive" | "Token"]: (args: Extract<{
|
|
85
|
+
readonly _tag: "Interactive";
|
|
86
|
+
readonly continuations: ContinuationStore;
|
|
87
|
+
readonly flow: InteractiveFlow;
|
|
88
|
+
readonly ttlMs?: number;
|
|
89
|
+
} | {
|
|
90
|
+
readonly _tag: "Token";
|
|
91
|
+
readonly authenticate: (token: Value) => Promise<Authentication>;
|
|
92
|
+
readonly providerId: string;
|
|
93
|
+
readonly requiredCapabilities: ReadonlyArray<Capability>;
|
|
94
|
+
readonly token: Value;
|
|
95
|
+
}, {
|
|
96
|
+
readonly _tag: Tag;
|
|
97
|
+
}>) => any; }>(cases: Cases): (value: {
|
|
98
|
+
readonly _tag: "Interactive";
|
|
99
|
+
readonly continuations: ContinuationStore;
|
|
100
|
+
readonly flow: InteractiveFlow;
|
|
101
|
+
readonly ttlMs?: number;
|
|
102
|
+
} | {
|
|
103
|
+
readonly _tag: "Token";
|
|
104
|
+
readonly authenticate: (token: Value) => Promise<Authentication>;
|
|
105
|
+
readonly providerId: string;
|
|
106
|
+
readonly requiredCapabilities: ReadonlyArray<Capability>;
|
|
107
|
+
readonly token: Value;
|
|
108
|
+
}) => import("effect/Unify").Unify<ReturnType<Cases["Interactive" | "Token"]>>;
|
|
109
|
+
<Cases extends { readonly [Tag in "Interactive" | "Token"]: (args: Extract<{
|
|
110
|
+
readonly _tag: "Interactive";
|
|
111
|
+
readonly continuations: ContinuationStore;
|
|
112
|
+
readonly flow: InteractiveFlow;
|
|
113
|
+
readonly ttlMs?: number;
|
|
114
|
+
} | {
|
|
115
|
+
readonly _tag: "Token";
|
|
116
|
+
readonly authenticate: (token: Value) => Promise<Authentication>;
|
|
117
|
+
readonly providerId: string;
|
|
118
|
+
readonly requiredCapabilities: ReadonlyArray<Capability>;
|
|
119
|
+
readonly token: Value;
|
|
120
|
+
}, {
|
|
121
|
+
readonly _tag: Tag;
|
|
122
|
+
}>) => any; }>(value: {
|
|
123
|
+
readonly _tag: "Interactive";
|
|
124
|
+
readonly continuations: ContinuationStore;
|
|
125
|
+
readonly flow: InteractiveFlow;
|
|
126
|
+
readonly ttlMs?: number;
|
|
127
|
+
} | {
|
|
128
|
+
readonly _tag: "Token";
|
|
129
|
+
readonly authenticate: (token: Value) => Promise<Authentication>;
|
|
130
|
+
readonly providerId: string;
|
|
131
|
+
readonly requiredCapabilities: ReadonlyArray<Capability>;
|
|
132
|
+
readonly token: Value;
|
|
133
|
+
}, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Interactive" | "Token"]>>;
|
|
134
|
+
};
|
|
135
|
+
readonly Interactive: Data.TaggedEnum.ConstructorFrom<{
|
|
136
|
+
readonly _tag: "Interactive";
|
|
137
|
+
readonly continuations: ContinuationStore;
|
|
138
|
+
readonly flow: InteractiveFlow;
|
|
139
|
+
readonly ttlMs?: number;
|
|
140
|
+
}, "_tag">;
|
|
141
|
+
readonly Token: Data.TaggedEnum.ConstructorFrom<{
|
|
142
|
+
readonly _tag: "Token";
|
|
143
|
+
readonly authenticate: (token: Value) => Promise<Authentication>;
|
|
144
|
+
readonly providerId: string;
|
|
145
|
+
readonly requiredCapabilities: ReadonlyArray<Capability>;
|
|
146
|
+
readonly token: Value;
|
|
147
|
+
}, "_tag">;
|
|
148
|
+
};
|
|
149
|
+
interface ContinuationStore {
|
|
150
|
+
readonly consume: (id: string, now: Date) => Promise<Continuation | null>;
|
|
151
|
+
readonly put: (continuation: Continuation) => Promise<void>;
|
|
152
|
+
}
|
|
153
|
+
interface InteractiveFlow {
|
|
154
|
+
readonly complete: (payload: Value, callbackUrl: URL) => Promise<Authentication>;
|
|
155
|
+
readonly method: "integration" | "oauth2";
|
|
156
|
+
readonly providerId: string;
|
|
157
|
+
readonly requiredCapabilities: ReadonlyArray<Capability>;
|
|
158
|
+
readonly start: (continuationId: string) => Promise<InteractiveStart>;
|
|
159
|
+
}
|
|
160
|
+
declare const toAsyncContinuations: (store: ContinuationStore$1) => ContinuationStore;
|
|
161
|
+
/** Adapts an Effect-native provider flow to the Promise facade. */
|
|
162
|
+
declare const fromEffectFlow: (flow: InteractiveFlow$1) => InteractiveFlow;
|
|
163
|
+
/** Adapts an Effect-native token method to the Promise facade. */
|
|
164
|
+
declare function fromEffectTokenMethod(method: Extract<Method$1, {
|
|
165
|
+
readonly _tag: "Token";
|
|
166
|
+
}>): Extract<Method, {
|
|
167
|
+
readonly _tag: "Token";
|
|
168
|
+
}>;
|
|
169
|
+
declare function start(input: BaseInput & {
|
|
170
|
+
readonly method: Method;
|
|
171
|
+
readonly repository: Repository;
|
|
172
|
+
}): Promise<StartResult>;
|
|
173
|
+
declare function complete(input: {
|
|
174
|
+
readonly callbackUrl: URL;
|
|
175
|
+
readonly continuationId: string;
|
|
176
|
+
readonly continuations: ContinuationStore;
|
|
177
|
+
readonly flow: InteractiveFlow;
|
|
178
|
+
readonly repository: Repository;
|
|
179
|
+
}): Promise<Aggregate>;
|
|
180
|
+
//#endregion
|
|
181
|
+
export { Source as a, authorization_lifecycle_d_exports as i, Method as n, zone_discovery_d_exports as o, connection_d_exports as r, InteractiveFlow as t };
|
|
182
|
+
//# sourceMappingURL=connection-CEqadXSm.d.mts.map
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { M as Service, j as Error } from "./dns-record-BLeqo56C.mjs";
|
|
3
|
+
import { _ as StartResult, g as Method$1, h as Error$1, v as complete$1, y as start$1 } from "./authorization-DOg2Re1D.mjs";
|
|
4
|
+
import { i as assertGrant, n as Grant, o as decode$1, r as Schema$1, s as encode, t as AuthorizationError } from "./connection-BWrBwqjk.mjs";
|
|
5
|
+
import { i as webCryptoLayer } from "./canonical-json-CpvqGMcr.mjs";
|
|
6
|
+
import { Data, Effect, Layer } from "effect";
|
|
7
|
+
//#region src/promise/authorization-lifecycle.ts
|
|
8
|
+
var authorization_lifecycle_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
+
Error: () => Error,
|
|
10
|
+
from: () => from,
|
|
11
|
+
layerFrom: () => layerFrom,
|
|
12
|
+
toAsync: () => toAsync
|
|
13
|
+
});
|
|
14
|
+
const failure = (operation, cause) => cause instanceof Error ? cause : new Error({
|
|
15
|
+
category: "storage",
|
|
16
|
+
message: cause instanceof globalThis.Error ? cause.message : String(cause),
|
|
17
|
+
operation,
|
|
18
|
+
retry: "safe"
|
|
19
|
+
});
|
|
20
|
+
const layerFrom = (repository) => Layer.succeed(Service, {
|
|
21
|
+
bind: Effect.fn("AuthorizationLifecycleRepository.bind")((authorizationId, binding) => Effect.tryPromise({
|
|
22
|
+
try: () => repository.bind(authorizationId, binding),
|
|
23
|
+
catch: (cause) => failure("AuthorizationLifecycleRepository.bind", cause)
|
|
24
|
+
})),
|
|
25
|
+
connect: Effect.fn("AuthorizationLifecycleRepository.connect")((aggregate) => Effect.tryPromise({
|
|
26
|
+
try: () => repository.connect(aggregate),
|
|
27
|
+
catch: (cause) => failure("AuthorizationLifecycleRepository.connect", cause)
|
|
28
|
+
})),
|
|
29
|
+
detach: ({ connectionId, revoke }) => Effect.tryPromise({
|
|
30
|
+
try: () => repository.detach({
|
|
31
|
+
connectionId,
|
|
32
|
+
revoke: (aggregate) => Effect.runPromise(revoke(aggregate))
|
|
33
|
+
}),
|
|
34
|
+
catch: (cause) => failure("AuthorizationLifecycleRepository.detach", cause)
|
|
35
|
+
}),
|
|
36
|
+
findByProviderAccount: Effect.fn("AuthorizationLifecycleRepository.findByProviderAccount")((providerId, providerAccountId) => Effect.tryPromise({
|
|
37
|
+
try: () => repository.findByProviderAccount(providerId, providerAccountId),
|
|
38
|
+
catch: (cause) => failure("AuthorizationLifecycleRepository.findByProviderAccount", cause)
|
|
39
|
+
})),
|
|
40
|
+
get: Effect.fn("AuthorizationLifecycleRepository.get")((authorizationId) => Effect.tryPromise({
|
|
41
|
+
try: () => repository.get(authorizationId),
|
|
42
|
+
catch: (cause) => failure("AuthorizationLifecycleRepository.get", cause)
|
|
43
|
+
})),
|
|
44
|
+
getByConnectionId: Effect.fn("AuthorizationLifecycleRepository.getByConnectionId")((connectionId) => Effect.tryPromise({
|
|
45
|
+
try: () => repository.getByConnectionId(connectionId),
|
|
46
|
+
catch: (cause) => failure("AuthorizationLifecycleRepository.getByConnectionId", cause)
|
|
47
|
+
})),
|
|
48
|
+
promoteEvidence: Effect.fn("AuthorizationLifecycleRepository.promoteEvidence")((authorizationId, evidence) => Effect.tryPromise({
|
|
49
|
+
try: () => repository.promoteEvidence(authorizationId, evidence),
|
|
50
|
+
catch: (cause) => failure("AuthorizationLifecycleRepository.promoteEvidence", cause)
|
|
51
|
+
})),
|
|
52
|
+
recover: ({ authorizationId, revoke }) => Effect.tryPromise({
|
|
53
|
+
try: () => repository.recover({
|
|
54
|
+
authorizationId,
|
|
55
|
+
revoke: (aggregate) => Effect.runPromise(revoke(aggregate))
|
|
56
|
+
}),
|
|
57
|
+
catch: (cause) => failure("AuthorizationLifecycleRepository.recover", cause)
|
|
58
|
+
}),
|
|
59
|
+
rotate: Effect.fn("AuthorizationLifecycleRepository.rotate")((authorizationId, credential, expiresAt) => Effect.tryPromise({
|
|
60
|
+
try: () => repository.rotate(authorizationId, credential, expiresAt),
|
|
61
|
+
catch: (cause) => failure("AuthorizationLifecycleRepository.rotate", cause)
|
|
62
|
+
}))
|
|
63
|
+
});
|
|
64
|
+
const toAsync = (repository) => ({
|
|
65
|
+
bind: (authorizationId, binding) => Effect.runPromise(repository.bind(authorizationId, binding)),
|
|
66
|
+
connect: (aggregate) => Effect.runPromise(repository.connect(aggregate)),
|
|
67
|
+
detach: ({ connectionId, revoke }) => Effect.runPromise(repository.detach({
|
|
68
|
+
connectionId,
|
|
69
|
+
revoke: (aggregate) => Effect.tryPromise(() => revoke(aggregate))
|
|
70
|
+
})),
|
|
71
|
+
findByProviderAccount: (providerId, providerAccountId) => Effect.runPromise(repository.findByProviderAccount(providerId, providerAccountId)),
|
|
72
|
+
get: (authorizationId) => Effect.runPromise(repository.get(authorizationId)),
|
|
73
|
+
getByConnectionId: (connectionId) => Effect.runPromise(repository.getByConnectionId(connectionId)),
|
|
74
|
+
promoteEvidence: (authorizationId, evidence) => Effect.runPromise(repository.promoteEvidence(authorizationId, evidence)),
|
|
75
|
+
recover: ({ authorizationId, revoke }) => Effect.runPromise(repository.recover({
|
|
76
|
+
authorizationId,
|
|
77
|
+
revoke: (aggregate) => Effect.tryPromise(() => revoke(aggregate))
|
|
78
|
+
})),
|
|
79
|
+
rotate: (authorizationId, credential, expiresAt) => Effect.runPromise(repository.rotate(authorizationId, credential, expiresAt))
|
|
80
|
+
});
|
|
81
|
+
const from = (repository) => repository;
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/promise/connection.ts
|
|
84
|
+
var connection_exports = /* @__PURE__ */ __exportAll({
|
|
85
|
+
AuthorizationError: () => AuthorizationError,
|
|
86
|
+
Error: () => Error$1,
|
|
87
|
+
Grant: () => Grant,
|
|
88
|
+
Method: () => Method,
|
|
89
|
+
Schema: () => Schema$1,
|
|
90
|
+
StartResult: () => StartResult,
|
|
91
|
+
assertGrant: () => assertGrant,
|
|
92
|
+
complete: () => complete,
|
|
93
|
+
decode: () => decode,
|
|
94
|
+
encode: () => encode,
|
|
95
|
+
fromEffectFlow: () => fromEffectFlow,
|
|
96
|
+
fromEffectTokenMethod: () => fromEffectTokenMethod,
|
|
97
|
+
start: () => start,
|
|
98
|
+
toAsyncContinuations: () => toAsyncContinuations
|
|
99
|
+
});
|
|
100
|
+
function decode(input) {
|
|
101
|
+
return Effect.runPromise(decode$1(input));
|
|
102
|
+
}
|
|
103
|
+
const Method = Data.taggedEnum();
|
|
104
|
+
const connectionFailure = (operation, cause) => cause instanceof Error$1 ? cause : new Error$1({
|
|
105
|
+
category: "provider",
|
|
106
|
+
message: cause instanceof globalThis.Error ? cause.message : String(cause),
|
|
107
|
+
operation,
|
|
108
|
+
retry: "unknown"
|
|
109
|
+
});
|
|
110
|
+
const effectMethod = (method) => method._tag === "Interactive" ? Method$1.Interactive({
|
|
111
|
+
continuations: effectContinuations(method.continuations),
|
|
112
|
+
flow: effectFlow(method.flow),
|
|
113
|
+
...method.ttlMs === void 0 ? {} : { ttlMs: method.ttlMs }
|
|
114
|
+
}) : Method$1.Token({
|
|
115
|
+
authenticate: (token) => Effect.tryPromise({
|
|
116
|
+
try: () => method.authenticate(token),
|
|
117
|
+
catch: (cause) => connectionFailure("Connection.start", cause)
|
|
118
|
+
}),
|
|
119
|
+
providerId: method.providerId,
|
|
120
|
+
requiredCapabilities: method.requiredCapabilities,
|
|
121
|
+
token: method.token
|
|
122
|
+
});
|
|
123
|
+
const effectContinuations = (store) => ({
|
|
124
|
+
consume: (id, now) => Effect.tryPromise({
|
|
125
|
+
try: () => store.consume(id, now),
|
|
126
|
+
catch: (cause) => connectionFailure("ConnectionContinuations.consume", cause)
|
|
127
|
+
}),
|
|
128
|
+
put: (continuation) => Effect.tryPromise({
|
|
129
|
+
try: () => store.put(continuation),
|
|
130
|
+
catch: (cause) => connectionFailure("ConnectionContinuations.put", cause)
|
|
131
|
+
})
|
|
132
|
+
});
|
|
133
|
+
const toAsyncContinuations = (store) => ({
|
|
134
|
+
consume: (id, now) => Effect.runPromise(store.consume(id, now)),
|
|
135
|
+
put: (continuation) => Effect.runPromise(store.put(continuation))
|
|
136
|
+
});
|
|
137
|
+
const effectFlow = (flow) => ({
|
|
138
|
+
complete: (payload, callbackUrl) => Effect.tryPromise({
|
|
139
|
+
try: () => flow.complete(payload, callbackUrl),
|
|
140
|
+
catch: (cause) => connectionFailure("Connection.complete", cause)
|
|
141
|
+
}),
|
|
142
|
+
method: flow.method,
|
|
143
|
+
providerId: flow.providerId,
|
|
144
|
+
requiredCapabilities: flow.requiredCapabilities,
|
|
145
|
+
start: (continuationId) => Effect.tryPromise({
|
|
146
|
+
try: () => flow.start(continuationId),
|
|
147
|
+
catch: (cause) => connectionFailure("Connection.start", cause)
|
|
148
|
+
})
|
|
149
|
+
});
|
|
150
|
+
/** Adapts an Effect-native provider flow to the Promise facade. */
|
|
151
|
+
const fromEffectFlow = (flow) => ({
|
|
152
|
+
complete: (payload, callbackUrl) => Effect.runPromise(flow.complete(payload, callbackUrl)),
|
|
153
|
+
method: flow.method,
|
|
154
|
+
providerId: flow.providerId,
|
|
155
|
+
requiredCapabilities: flow.requiredCapabilities,
|
|
156
|
+
start: (continuationId) => Effect.runPromise(flow.start(continuationId).pipe(Effect.provide(webCryptoLayer)))
|
|
157
|
+
});
|
|
158
|
+
/** Adapts an Effect-native token method to the Promise facade. */
|
|
159
|
+
function fromEffectTokenMethod(method) {
|
|
160
|
+
return Method.Token({
|
|
161
|
+
authenticate: (token) => Effect.runPromise(method.authenticate(token)),
|
|
162
|
+
providerId: method.providerId,
|
|
163
|
+
requiredCapabilities: method.requiredCapabilities,
|
|
164
|
+
token: method.token
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
async function start(input) {
|
|
168
|
+
return Effect.runPromise(start$1({
|
|
169
|
+
authorizedById: input.authorizedById,
|
|
170
|
+
grant: input.grant,
|
|
171
|
+
method: effectMethod(input.method),
|
|
172
|
+
ownerId: input.ownerId
|
|
173
|
+
}).pipe(Effect.provide(Layer.merge(layerFrom(input.repository), webCryptoLayer))));
|
|
174
|
+
}
|
|
175
|
+
async function complete(input) {
|
|
176
|
+
return Effect.runPromise(complete$1({
|
|
177
|
+
callbackUrl: input.callbackUrl,
|
|
178
|
+
continuationId: input.continuationId,
|
|
179
|
+
continuations: effectContinuations(input.continuations),
|
|
180
|
+
flow: effectFlow(input.flow)
|
|
181
|
+
}).pipe(Effect.provide(Layer.merge(layerFrom(input.repository), webCryptoLayer))));
|
|
182
|
+
}
|
|
183
|
+
//#endregion
|
|
184
|
+
export { authorization_lifecycle_exports as i, fromEffectFlow as n, fromEffectTokenMethod as r, connection_exports as t };
|
|
185
|
+
|
|
186
|
+
//# sourceMappingURL=connection-CcQokgrd.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-CcQokgrd.mjs","names":["Lifecycle.Error","Lifecycle.Service","Connection.decode","Connect.Error","Connect.start","LifecycleRepository.layerFrom","Connect.complete"],"sources":["../src/promise/authorization-lifecycle.ts","../src/promise/connection.ts"],"sourcesContent":["import { Effect, Layer } from \"effect\";\n\nimport type * as ProviderAuthorization from \"../auth/authorization.ts\";\nimport type * as Connection from \"../auth/connection.ts\";\nimport * as Lifecycle from \"../auth/lifecycle-repository.ts\";\n\nexport interface Repository {\n readonly bind: (\n authorizationId: string,\n binding: Connection.Connection,\n ) => Promise<Lifecycle.Aggregate>;\n readonly connect: (aggregate: Lifecycle.Aggregate) => Promise<Lifecycle.Aggregate>;\n readonly detach: (input: {\n readonly connectionId: string;\n readonly revoke: (aggregate: Lifecycle.Aggregate) => Promise<void>;\n }) => Promise<Lifecycle.DetachResult>;\n readonly findByProviderAccount: (\n providerId: string,\n providerAccountId: string,\n ) => Promise<Lifecycle.Aggregate | null>;\n readonly get: (authorizationId: string) => Promise<Lifecycle.Aggregate | null>;\n readonly getByConnectionId: (connectionId: string) => Promise<Lifecycle.Aggregate | null>;\n readonly promoteEvidence: (\n authorizationId: string,\n evidence: ReadonlyArray<ProviderAuthorization.CapabilityEvidence>,\n ) => Promise<Lifecycle.Aggregate>;\n readonly recover: (input: {\n readonly authorizationId: string;\n readonly revoke: (aggregate: Lifecycle.Aggregate) => Promise<void>;\n }) => Promise<Lifecycle.DetachResult>;\n readonly rotate: (\n authorizationId: string,\n credential: Connection.StoredCredential,\n expiresAt: Date | null,\n ) => Promise<Lifecycle.Aggregate>;\n}\n\nconst failure = (operation: string, cause: unknown): Lifecycle.Error =>\n cause instanceof Lifecycle.Error\n ? cause\n : new Lifecycle.Error({\n category: \"storage\",\n message: cause instanceof globalThis.Error ? cause.message : String(cause),\n operation,\n retry: \"safe\",\n });\n\nexport const layerFrom = (repository: Repository): Layer.Layer<Lifecycle.Service> =>\n Layer.succeed(Lifecycle.Service, {\n bind: Effect.fn(\"AuthorizationLifecycleRepository.bind\")((authorizationId, binding) =>\n Effect.tryPromise({\n try: () => repository.bind(authorizationId, binding),\n catch: (cause) => failure(\"AuthorizationLifecycleRepository.bind\", cause),\n }),\n ),\n connect: Effect.fn(\"AuthorizationLifecycleRepository.connect\")((aggregate) =>\n Effect.tryPromise({\n try: () => repository.connect(aggregate),\n catch: (cause) => failure(\"AuthorizationLifecycleRepository.connect\", cause),\n }),\n ),\n detach: ({ connectionId, revoke }) =>\n Effect.tryPromise({\n try: () =>\n repository.detach({\n connectionId,\n revoke: (aggregate) => Effect.runPromise(revoke(aggregate)),\n }),\n catch: (cause) => failure(\"AuthorizationLifecycleRepository.detach\", cause),\n }),\n findByProviderAccount: Effect.fn(\"AuthorizationLifecycleRepository.findByProviderAccount\")(\n (providerId, providerAccountId) =>\n Effect.tryPromise({\n try: () => repository.findByProviderAccount(providerId, providerAccountId),\n catch: (cause) =>\n failure(\"AuthorizationLifecycleRepository.findByProviderAccount\", cause),\n }),\n ),\n get: Effect.fn(\"AuthorizationLifecycleRepository.get\")((authorizationId) =>\n Effect.tryPromise({\n try: () => repository.get(authorizationId),\n catch: (cause) => failure(\"AuthorizationLifecycleRepository.get\", cause),\n }),\n ),\n getByConnectionId: Effect.fn(\"AuthorizationLifecycleRepository.getByConnectionId\")(\n (connectionId) =>\n Effect.tryPromise({\n try: () => repository.getByConnectionId(connectionId),\n catch: (cause) => failure(\"AuthorizationLifecycleRepository.getByConnectionId\", cause),\n }),\n ),\n promoteEvidence: Effect.fn(\"AuthorizationLifecycleRepository.promoteEvidence\")(\n (authorizationId, evidence) =>\n Effect.tryPromise({\n try: () => repository.promoteEvidence(authorizationId, evidence),\n catch: (cause) => failure(\"AuthorizationLifecycleRepository.promoteEvidence\", cause),\n }),\n ),\n recover: ({ authorizationId, revoke }) =>\n Effect.tryPromise({\n try: () =>\n repository.recover({\n authorizationId,\n revoke: (aggregate) => Effect.runPromise(revoke(aggregate)),\n }),\n catch: (cause) => failure(\"AuthorizationLifecycleRepository.recover\", cause),\n }),\n rotate: Effect.fn(\"AuthorizationLifecycleRepository.rotate\")(\n (authorizationId, credential, expiresAt) =>\n Effect.tryPromise({\n try: () => repository.rotate(authorizationId, credential, expiresAt),\n catch: (cause) => failure(\"AuthorizationLifecycleRepository.rotate\", cause),\n }),\n ),\n });\n\nexport const toAsync = (repository: Lifecycle.Interface): Repository => ({\n bind: (authorizationId, binding) => Effect.runPromise(repository.bind(authorizationId, binding)),\n connect: (aggregate) => Effect.runPromise(repository.connect(aggregate)),\n detach: ({ connectionId, revoke }) =>\n Effect.runPromise(\n repository.detach({\n connectionId,\n revoke: (aggregate) => Effect.tryPromise(() => revoke(aggregate)),\n }),\n ),\n findByProviderAccount: (providerId, providerAccountId) =>\n Effect.runPromise(repository.findByProviderAccount(providerId, providerAccountId)),\n get: (authorizationId) => Effect.runPromise(repository.get(authorizationId)),\n getByConnectionId: (connectionId) =>\n Effect.runPromise(repository.getByConnectionId(connectionId)),\n promoteEvidence: (authorizationId, evidence) =>\n Effect.runPromise(repository.promoteEvidence(authorizationId, evidence)),\n recover: ({ authorizationId, revoke }) =>\n Effect.runPromise(\n repository.recover({\n authorizationId,\n revoke: (aggregate) => Effect.tryPromise(() => revoke(aggregate)),\n }),\n ),\n rotate: (authorizationId, credential, expiresAt) =>\n Effect.runPromise(repository.rotate(authorizationId, credential, expiresAt)),\n});\n\nexport const from = (repository: Repository): Repository => repository;\n\nexport { Error } from \"../auth/lifecycle-repository.ts\";\nexport type { Aggregate, DetachResult } from \"../auth/lifecycle-repository.ts\";\n","import { Data, Effect, Layer } from \"effect\";\n\nimport * as Connection from \"../auth/connection.ts\";\nimport * as Connect from \"../auth/connect.ts\";\nimport type * as Repository from \"./authorization-lifecycle.ts\";\nimport type * as ProviderAuthorization from \"../auth/authorization.ts\";\nimport { webCryptoLayer } from \"../plan/canonical-json.ts\";\nimport * as LifecycleRepository from \"./authorization-lifecycle.ts\";\nimport type * as Secret from \"../auth/secret.ts\";\n\nexport { assertGrant, AuthorizationError, encode, Grant, Schema } from \"../auth/connection.ts\";\nexport type { Connection, OAuthContinuation, StoredCredential } from \"../auth/connection.ts\";\n\nexport function decode(input: unknown): Promise<Connection.Connection> {\n return Effect.runPromise(Connection.decode(input));\n}\n\nexport type Method = Data.TaggedEnum<{\n Interactive: {\n readonly continuations: ContinuationStore;\n readonly flow: InteractiveFlow;\n readonly ttlMs?: number;\n };\n Token: {\n readonly authenticate: (token: Secret.Value) => Promise<Connect.Authentication>;\n readonly providerId: string;\n readonly requiredCapabilities: ReadonlyArray<ProviderAuthorization.Capability>;\n readonly token: Secret.Value;\n };\n}>;\nexport const Method = Data.taggedEnum<Method>();\n\nexport interface ContinuationStore {\n readonly consume: (id: string, now: Date) => Promise<Connect.Continuation | null>;\n readonly put: (continuation: Connect.Continuation) => Promise<void>;\n}\n\nexport interface InteractiveFlow {\n readonly complete: (payload: Secret.Value, callbackUrl: URL) => Promise<Connect.Authentication>;\n readonly method: \"integration\" | \"oauth2\";\n readonly providerId: string;\n readonly requiredCapabilities: ReadonlyArray<ProviderAuthorization.Capability>;\n readonly start: (continuationId: string) => Promise<Connect.InteractiveStart>;\n}\n\nconst connectionFailure = (operation: string, cause: unknown): Connect.Error =>\n cause instanceof Connect.Error\n ? cause\n : new Connect.Error({\n category: \"provider\",\n message: cause instanceof globalThis.Error ? cause.message : String(cause),\n operation,\n retry: \"unknown\",\n });\n\nconst effectMethod = (method: Method): Connect.Method =>\n method._tag === \"Interactive\"\n ? Connect.Method.Interactive({\n continuations: effectContinuations(method.continuations),\n flow: effectFlow(method.flow),\n ...(method.ttlMs === undefined ? {} : { ttlMs: method.ttlMs }),\n })\n : Connect.Method.Token({\n authenticate: (token) =>\n Effect.tryPromise({\n try: () => method.authenticate(token),\n catch: (cause) => connectionFailure(\"Connection.start\", cause),\n }),\n providerId: method.providerId,\n requiredCapabilities: method.requiredCapabilities,\n token: method.token,\n });\n\nconst effectContinuations = (store: ContinuationStore): Connect.ContinuationStore => ({\n consume: (id, now) =>\n Effect.tryPromise({\n try: () => store.consume(id, now),\n catch: (cause) => connectionFailure(\"ConnectionContinuations.consume\", cause),\n }),\n put: (continuation) =>\n Effect.tryPromise({\n try: () => store.put(continuation),\n catch: (cause) => connectionFailure(\"ConnectionContinuations.put\", cause),\n }),\n});\n\nexport const toAsyncContinuations = (store: Connect.ContinuationStore): ContinuationStore => ({\n consume: (id, now) => Effect.runPromise(store.consume(id, now)),\n put: (continuation) => Effect.runPromise(store.put(continuation)),\n});\n\nconst effectFlow = (flow: InteractiveFlow): Connect.InteractiveFlow => ({\n complete: (payload, callbackUrl) =>\n Effect.tryPromise({\n try: () => flow.complete(payload, callbackUrl),\n catch: (cause) => connectionFailure(\"Connection.complete\", cause),\n }),\n method: flow.method,\n providerId: flow.providerId,\n requiredCapabilities: flow.requiredCapabilities,\n start: (continuationId) =>\n Effect.tryPromise({\n try: () => flow.start(continuationId),\n catch: (cause) => connectionFailure(\"Connection.start\", cause),\n }),\n});\n\n/** Adapts an Effect-native provider flow to the Promise facade. */\nexport const fromEffectFlow = (flow: Connect.InteractiveFlow): InteractiveFlow => ({\n complete: (payload, callbackUrl) => Effect.runPromise(flow.complete(payload, callbackUrl)),\n method: flow.method,\n providerId: flow.providerId,\n requiredCapabilities: flow.requiredCapabilities,\n start: (continuationId) =>\n Effect.runPromise(flow.start(continuationId).pipe(Effect.provide(webCryptoLayer))),\n});\n\n/** Adapts an Effect-native token method to the Promise facade. */\nexport function fromEffectTokenMethod(\n method: Extract<Connect.Method, { readonly _tag: \"Token\" }>,\n): Extract<Method, { readonly _tag: \"Token\" }> {\n return Method.Token({\n authenticate: (token) => Effect.runPromise(method.authenticate(token)),\n providerId: method.providerId,\n requiredCapabilities: method.requiredCapabilities,\n token: method.token,\n });\n}\n\nexport async function start(\n input: Connect.BaseInput & {\n readonly method: Method;\n readonly repository: Repository.Repository;\n },\n): Promise<Connect.StartResult> {\n return Effect.runPromise(\n Connect.start({\n authorizedById: input.authorizedById,\n grant: input.grant,\n method: effectMethod(input.method),\n ownerId: input.ownerId,\n }).pipe(\n Effect.provide(Layer.merge(LifecycleRepository.layerFrom(input.repository), webCryptoLayer)),\n ),\n );\n}\n\nexport async function complete(input: {\n readonly callbackUrl: URL;\n readonly continuationId: string;\n readonly continuations: ContinuationStore;\n readonly flow: InteractiveFlow;\n readonly repository: Repository.Repository;\n}): Promise<Repository.Aggregate> {\n return Effect.runPromise(\n Connect.complete({\n callbackUrl: input.callbackUrl,\n continuationId: input.continuationId,\n continuations: effectContinuations(input.continuations),\n flow: effectFlow(input.flow),\n }).pipe(\n Effect.provide(Layer.merge(LifecycleRepository.layerFrom(input.repository), webCryptoLayer)),\n ),\n );\n}\n\nexport { Error, StartResult } from \"../auth/connect.ts\";\nexport type { Authentication, ConnectionStartResult } from \"../auth/connection-api.ts\";\n"],"mappings":";;;;;;;;;;;;;AAqCA,MAAM,WAAW,WAAmB,UAClC,iBAAiBA,QACb,QACA,IAAIA,MAAgB;CAClB,UAAU;CACV,SAAS,iBAAiB,WAAW,QAAQ,MAAM,UAAU,OAAO,KAAK;CACzE;CACA,OAAO;AACT,CAAC;AAEP,MAAa,aAAa,eACxB,MAAM,QAAQC,SAAmB;CAC/B,MAAM,OAAO,GAAG,uCAAuC,CAAC,EAAE,iBAAiB,YACzE,OAAO,WAAW;EAChB,WAAW,WAAW,KAAK,iBAAiB,OAAO;EACnD,QAAQ,UAAU,QAAQ,yCAAyC,KAAK;CAC1E,CAAC,CACH;CACA,SAAS,OAAO,GAAG,0CAA0C,CAAC,EAAE,cAC9D,OAAO,WAAW;EAChB,WAAW,WAAW,QAAQ,SAAS;EACvC,QAAQ,UAAU,QAAQ,4CAA4C,KAAK;CAC7E,CAAC,CACH;CACA,SAAS,EAAE,cAAc,aACvB,OAAO,WAAW;EAChB,WACE,WAAW,OAAO;GAChB;GACA,SAAS,cAAc,OAAO,WAAW,OAAO,SAAS,CAAC;EAC5D,CAAC;EACH,QAAQ,UAAU,QAAQ,2CAA2C,KAAK;CAC5E,CAAC;CACH,uBAAuB,OAAO,GAAG,wDAAwD,CAAC,EACvF,YAAY,sBACX,OAAO,WAAW;EAChB,WAAW,WAAW,sBAAsB,YAAY,iBAAiB;EACzE,QAAQ,UACN,QAAQ,0DAA0D,KAAK;CAC3E,CAAC,CACL;CACA,KAAK,OAAO,GAAG,sCAAsC,CAAC,EAAE,oBACtD,OAAO,WAAW;EAChB,WAAW,WAAW,IAAI,eAAe;EACzC,QAAQ,UAAU,QAAQ,wCAAwC,KAAK;CACzE,CAAC,CACH;CACA,mBAAmB,OAAO,GAAG,oDAAoD,CAAC,EAC/E,iBACC,OAAO,WAAW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MAAM;EACtB,eAAe,oBAAoB,MAAM,aAAa;EACtD,MAAM,WAAW,MAAM,IAAI;CAC7B,CAAC,CAAC,CAAC,KACD,OAAO,QAAQ,MAAM,MAAMD,UAA8B,MAAM,UAAU,GAAG,cAAc,CAAC,CAC7F,CACF;AACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { A as Connection, F as assertGrant, I as authorizationError, L as decode, N as Schema, P as StoredCredential, R as encode, _ as StartResult, a as Authentication, c as CompleteInput, d as Error, f as Failure, g as Requirements, h as Method, j as Grant, k as AuthorizationError, l as Continuation, m as InteractiveStart, o as AuthenticationFailure, p as InteractiveFlow, s as BaseInput, u as ContinuationStore, v as complete, y as start, z as validate } from "./zone-discovery-BA5I24vu.mjs";
|
|
2
|
+
declare namespace connection_api_d_exports {
|
|
3
|
+
export { Authentication, AuthenticationFailure, AuthorizationError, BaseInput, CompleteInput, Connection, Method as ConnectionMethod, StartResult as ConnectionStartResult, Continuation, ContinuationStore, Error, Failure, Grant, InteractiveFlow, InteractiveStart, Method, Requirements, Schema, StartResult, StoredCredential, assertGrant, authorizationError, complete, decode, encode, start, validate };
|
|
4
|
+
}
|
|
5
|
+
//#endregion
|
|
6
|
+
export { connection_api_d_exports as t };
|
|
7
|
+
//# sourceMappingURL=connection-api-DftK7eHo.d.mts.map
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
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
|
|
3
21
|
//#region src/invalid-input.ts
|
|
4
22
|
var invalid_input_exports = /* @__PURE__ */ __exportAll({ Error: () => Error$2 });
|
|
5
23
|
var Error$2 = class extends Schema.TaggedError()("InvalidInputError", { message: Schema.String }) {};
|
|
@@ -42,6 +60,7 @@ var provider_exports = /* @__PURE__ */ __exportAll({
|
|
|
42
60
|
Error: () => Error$1,
|
|
43
61
|
ErrorReason: () => ErrorReason,
|
|
44
62
|
Service: () => Service,
|
|
63
|
+
fromAsync: () => fromAsync,
|
|
45
64
|
layerFromAsync: () => layerFromAsync,
|
|
46
65
|
toAsync: () => toAsync
|
|
47
66
|
});
|
|
@@ -67,7 +86,7 @@ var Error$1 = class extends Schema.TaggedError()("ProviderError", {
|
|
|
67
86
|
status: Schema.optionalKey(Schema.Number)
|
|
68
87
|
}) {};
|
|
69
88
|
var Service = class extends Context.Service()("@domainkit/DnsProvider") {};
|
|
70
|
-
const
|
|
89
|
+
const fromAsync = (provider) => Service.of({
|
|
71
90
|
id: provider.id,
|
|
72
91
|
createRecord: Effect.fn("DnsProvider.createRecord")((zone, record) => Effect.tryPromise({
|
|
73
92
|
try: () => provider.createRecord(zone, record),
|
|
@@ -86,6 +105,7 @@ const layerFromAsync = (provider) => Layer.succeed(Service, {
|
|
|
86
105
|
catch: (cause) => failure(provider, "listRecords", cause)
|
|
87
106
|
}))
|
|
88
107
|
});
|
|
108
|
+
const layerFromAsync = (provider) => Layer.succeed(Service, fromAsync(provider));
|
|
89
109
|
const toAsync = (provider) => ({
|
|
90
110
|
id: provider.id,
|
|
91
111
|
createRecord: (zone, record) => Effect.runPromise(provider.createRecord(zone, record)),
|
|
@@ -264,6 +284,6 @@ function isIpv6(value) {
|
|
|
264
284
|
}
|
|
265
285
|
}
|
|
266
286
|
//#endregion
|
|
267
|
-
export {
|
|
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 };
|
|
268
288
|
|
|
269
|
-
//# sourceMappingURL=dns-record-
|
|
289
|
+
//# sourceMappingURL=dns-record-BLeqo56C.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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":";;;;;;;AAiBA,IAAaA,UAAb,cAA2B,OAAO,YAAmB,CAAC,CAAC,4BAA4B;CACjF,UAAU,OAAO,QAAQ,SAAS;CAClC,SAAS,OAAO;CAChB,WAAW,OAAO;CAClB,OAAO,OAAO,SAAS;EAAC;EAAS;EAAqB;EAAQ;CAAS,CAAC;AAC1E,CAAC,CAAC,CAAC,CAAC;AAiCJ,IAAaC,YAAb,cAA6B,QAAQ,QAA4B,CAAC,CAChE,6CACF,CAAC,CAAC,CAAC;;;;ACvDH,IAAaC,UAAb,cAA2B,OAAO,YAAmB,CAAC,CAAC,qBAAqB,EAC1E,SAAS,OAAO,OAClB,CAAC,CAAC,CAAC,CAAC;;;;;;;;ACAJ,MAAM,eAAe;AAErB,MAAMC,SAAO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,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 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { type Account, auth_d_exports as Auth, client_d_exports as Client, type Fetch, type Interface, type ListZonesInput, type Options, type Zone, make };
|
|
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-B1opsgls.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 };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { auth_exports as Auth, client_exports as Client, make };
|
|
1
|
+
import { d as make, l as client_exports, t as auth_exports, u as discovery } from "./auth-CZ1pZHMZ.mjs";
|
|
2
|
+
export { auth_exports as Auth, client_exports as Client, discovery, make };
|
package/dist/effect-vercel.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as
|
|
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, make };
|
|
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-Ewc__bQu.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
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { auth_exports as Auth, client_exports as Client, make };
|
|
1
|
+
import { c as client_exports, l as discovery, t as auth_exports, u as make } from "./auth-CzhZ3Cuc.mjs";
|
|
2
|
+
export { auth_exports as Auth, client_exports as Client, discovery, make };
|