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
package/dist/effect.d.mts
CHANGED
|
@@ -1,47 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as index_d_exports } from "./index-
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { A as Connection, At as dns_record_d_exports, Ft as domain_name_d_exports, J as CryptoError, K as authorization_d_exports, Lt as Error$1, O as lifecycle_repository_d_exports, Ot as Type, Rt as invalid_input_d_exports, S as provider_context_d_exports, W as ProviderAuthorization, Y as canonical_json_d_exports, at as manifest_d_exports, i as zone_discovery_d_exports, k as AuthorizationError, pt as provider_d_exports, st as secret_d_exports } from "./zone-discovery-BA5I24vu.mjs";
|
|
2
|
+
import { t as index_d_exports } from "./index-B1opsgls.mjs";
|
|
3
|
+
import { t as connection_api_d_exports } from "./connection-api-DftK7eHo.mjs";
|
|
4
|
+
import { t as index_d_exports$1 } from "./index-Ewc__bQu.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-DZWLM91T.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-CJOR9mQ8.mjs";
|
|
6
7
|
import { Crypto, Effect } from "effect";
|
|
7
|
-
declare namespace token_d_exports {
|
|
8
|
-
export { Error$1 as Error, Input, Requirements$1 as Requirements, connect };
|
|
9
|
-
}
|
|
10
|
-
interface Input {
|
|
11
|
-
readonly grant: Grant;
|
|
12
|
-
readonly ownerId: string;
|
|
13
|
-
readonly providerId: string;
|
|
14
|
-
readonly subjectId: string;
|
|
15
|
-
readonly token: Value;
|
|
16
|
-
readonly validate: (token: Value) => Effect.Effect<TokenValidation, Error$2 | Error$3>;
|
|
17
|
-
}
|
|
18
|
-
declare const connect: (input: Input) => Effect.Effect<{
|
|
19
|
-
authorization: {
|
|
20
|
-
readonly accountId: string;
|
|
21
|
-
readonly capabilities: readonly ("dns:read" | "dns:write")[];
|
|
22
|
-
readonly createdAt: Date;
|
|
23
|
-
readonly expiresAt: Date | null;
|
|
24
|
-
readonly id: string;
|
|
25
|
-
readonly kind: "oauth2" | "token";
|
|
26
|
-
readonly providerId: string;
|
|
27
|
-
readonly scopes: readonly string[];
|
|
28
|
-
readonly subjectId: string;
|
|
29
|
-
};
|
|
30
|
-
connection: {
|
|
31
|
-
readonly authorizationId: string;
|
|
32
|
-
readonly createdAt: Date;
|
|
33
|
-
readonly grant: {
|
|
34
|
-
readonly _tag: "account";
|
|
35
|
-
} | {
|
|
36
|
-
readonly _tag: "domains";
|
|
37
|
-
readonly domains: readonly (string & import("effect/Brand").Brand<"DomainName">)[];
|
|
38
|
-
};
|
|
39
|
-
readonly id: string;
|
|
40
|
-
readonly ownerId: string;
|
|
41
|
-
};
|
|
42
|
-
}, CryptoError | Error$3 | Error$2 | Error$4, Crypto.Crypto | Service | Service$1 | Service$2>;
|
|
43
|
-
type Error$1 = Error$2 | Error$3 | CryptoError | Error$4;
|
|
44
|
-
type Requirements$1 = Service$2 | Service | Service$1 | Crypto.Crypto;
|
|
45
8
|
declare namespace connection_authorization_d_exports {
|
|
46
9
|
export { Error, Requirements, authorize };
|
|
47
10
|
}
|
|
@@ -57,8 +20,8 @@ declare const authorize: (input: {
|
|
|
57
20
|
operationIds: string[];
|
|
58
21
|
planDigest: string;
|
|
59
22
|
version: "domainkit.plan-authorization.v1";
|
|
60
|
-
}, AuthorizationError | Error$
|
|
61
|
-
type Error = AuthorizationError | Error$
|
|
23
|
+
}, AuthorizationError | Error$1 | AuthorizeError, Crypto.Crypto>;
|
|
24
|
+
type Error = AuthorizationError | Error$1 | CryptoError;
|
|
62
25
|
type Requirements = Crypto.Crypto;
|
|
63
26
|
declare namespace dns_data_d_exports {
|
|
64
27
|
export { parse };
|
|
@@ -69,5 +32,5 @@ declare function parse(type: Type, input: unknown): string;
|
|
|
69
32
|
/** The current package version from the package manifest. */
|
|
70
33
|
declare const VERSION: string;
|
|
71
34
|
//#endregion
|
|
72
|
-
export { index_d_exports as Cloudflare, cloudflare_doh_d_exports as CloudflareDnsOverHttps,
|
|
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 };
|
|
73
36
|
//# sourceMappingURL=effect.d.mts.map
|
package/dist/effect.mjs
CHANGED
|
@@ -1,21 +1,43 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { o as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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, d as provider_context_exports, g as Method, h as Error, m as secret_exports, o as authorization_exports, v as complete, y as start } from "./authorization-DOg2Re1D.mjs";
|
|
4
|
+
import { d as make, l as client_exports, t as auth_exports, u as discovery } from "./auth-CZ1pZHMZ.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-BWrBwqjk.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-BzpiA0Es.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-CzhZ3Cuc.mjs";
|
|
8
11
|
//#region src/providers/cloudflare/index.ts
|
|
9
12
|
var cloudflare_exports = /* @__PURE__ */ __exportAll({
|
|
10
13
|
Auth: () => auth_exports,
|
|
11
14
|
Client: () => client_exports,
|
|
15
|
+
discovery: () => discovery,
|
|
12
16
|
make: () => make
|
|
13
17
|
});
|
|
14
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
|
+
start: () => start,
|
|
33
|
+
validate: () => validate
|
|
34
|
+
});
|
|
35
|
+
//#endregion
|
|
15
36
|
//#region src/providers/vercel/index.ts
|
|
16
37
|
var vercel_exports = /* @__PURE__ */ __exportAll({
|
|
17
38
|
Auth: () => auth_exports$1,
|
|
18
39
|
Client: () => client_exports$1,
|
|
40
|
+
discovery: () => discovery$1,
|
|
19
41
|
make: () => make$1
|
|
20
42
|
});
|
|
21
43
|
//#endregion
|
|
@@ -23,6 +45,6 @@ var vercel_exports = /* @__PURE__ */ __exportAll({
|
|
|
23
45
|
/** The current package version from the package manifest. */
|
|
24
46
|
const VERSION = version;
|
|
25
47
|
//#endregion
|
|
26
|
-
export { cloudflare_exports as Cloudflare, cloudflare_doh_exports as CloudflareDnsOverHttps,
|
|
48
|
+
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 };
|
|
27
49
|
|
|
28
50
|
//# sourceMappingURL=effect.mjs.map
|
package/dist/effect.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effect.mjs","names":["packageJson.version"],"sources":["../src/providers/cloudflare/index.ts","../src/providers/vercel/index.ts","../src/effect.ts"],"sourcesContent":["export * as Auth from \"./auth.ts\";\nexport * as Client from \"./client.ts\";\n\nexport { make } from \"./client.ts\";\nexport type { Account, Fetch, Interface, ListZonesInput, Options, Zone } from \"./client.ts\";\n","export * as Auth from \"./auth.ts\";\nexport * as Client from \"./client.ts\";\n\nexport { 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.ts\";\nexport * as
|
|
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, 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 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"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { Lt as Error$1, Nt as DomainName, Q as Manifest, b as Codec, dt as Interface$1, et as OAuthClientConfiguration, h as Method, it as TokenValidation, nt as OAuthSubjectResolver, ot as Value, p as InteractiveFlow, r as Source, tt as OAuthMethod, ut as Error, x as Envelope } from "./zone-discovery-BA5I24vu.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-B1opsgls.d.mts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Effect } from "effect";
|
|
1
|
+
import { B as Capability, Lt as Error$1, Nt as DomainName, Q as Manifest, Z as IntegrationMethod, b as Codec, dt as Interface$1, h as Method, it as TokenValidation, ot as Value, p as InteractiveFlow, r as Source, ut as Error, x as Envelope } from "./zone-discovery-BA5I24vu.mjs";
|
|
2
|
+
import { Effect, Schema } from "effect";
|
|
3
3
|
declare namespace client_d_exports {
|
|
4
|
-
export { Account, AccountContext, Fetch, Interface, ListZonesInput, Options, Zone, make };
|
|
4
|
+
export { Account, AccountContext, Fetch, Interface, ListZonesInput, Options, Zone, discovery, make };
|
|
5
5
|
}
|
|
6
6
|
type Fetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
7
7
|
/** Selects whether Vercel requests operate on a personal account or a team. */
|
|
@@ -42,11 +42,31 @@ interface Interface extends Interface$1 {
|
|
|
42
42
|
readonly listZones: (input?: ListZonesInput) => Effect.Effect<ReadonlyArray<Zone>, Error>;
|
|
43
43
|
readonly validateToken: () => Effect.Effect<TokenValidation, Error>;
|
|
44
44
|
}
|
|
45
|
+
/** Exposes Vercel zone lookup as the optional provider discovery capability. */
|
|
46
|
+
declare function discovery(client: Interface): Source;
|
|
45
47
|
/** Creates an Effect-native Vercel client without owning the credential lifecycle. */
|
|
46
48
|
declare function make(options: Options): Interface;
|
|
47
49
|
declare namespace auth_d_exports {
|
|
48
|
-
export { ExchangeCodeOptions, IntegrationCredential, IntegrationMethodOptions, exchangeCode, integrationMethod, manifest, tokenMethod };
|
|
50
|
+
export { Context$1 as Context, ExchangeCodeOptions, IntegrationCredential, IntegrationFlowOptions, IntegrationMethodOptions, TokenConnectionOptions, contextCodec, exchangeCode, integrationAuthentication, integrationFlow, integrationMethod, manifest, tokenConnectionMethod, tokenMethod };
|
|
49
51
|
}
|
|
52
|
+
declare const Context$1: Schema.TaggedUnion<{
|
|
53
|
+
readonly personal: Schema.TaggedStruct<"personal", {
|
|
54
|
+
readonly installationId: Schema.NullOr<Schema.String>;
|
|
55
|
+
}>;
|
|
56
|
+
readonly team: Schema.TaggedStruct<"team", {
|
|
57
|
+
readonly installationId: Schema.NullOr<Schema.String>;
|
|
58
|
+
readonly teamId: Schema.String;
|
|
59
|
+
}>;
|
|
60
|
+
}>;
|
|
61
|
+
type Context$1 = typeof Context$1.Type;
|
|
62
|
+
declare const contextCodec: Codec<{
|
|
63
|
+
readonly _tag: "personal";
|
|
64
|
+
readonly installationId: string | null;
|
|
65
|
+
} | {
|
|
66
|
+
readonly _tag: "team";
|
|
67
|
+
readonly installationId: string | null;
|
|
68
|
+
readonly teamId: string;
|
|
69
|
+
}>;
|
|
50
70
|
/** Describes Vercel's caller-created personal access-token method. */
|
|
51
71
|
declare function tokenMethod(capabilities: TokenValidation["capabilities"]): Extract<Manifest["methods"][number], {
|
|
52
72
|
readonly _tag: "token";
|
|
@@ -86,9 +106,40 @@ declare const exchangeCode: (options: ExchangeCodeOptions) => Effect.Effect<{
|
|
|
86
106
|
installationId: string | null;
|
|
87
107
|
userId: string;
|
|
88
108
|
}, Error, never>;
|
|
109
|
+
interface TokenConnectionOptions extends Omit<Options, "token"> {
|
|
110
|
+
readonly token: Value;
|
|
111
|
+
}
|
|
112
|
+
/** Creates a provider-independent token connection method backed by Vercel validation. */
|
|
113
|
+
declare function tokenConnectionMethod(options: TokenConnectionOptions): Extract<Method, {
|
|
114
|
+
readonly _tag: "Token";
|
|
115
|
+
}>;
|
|
116
|
+
/** Converts a completed Vercel Integration exchange into canonical connection authentication. */
|
|
117
|
+
declare const integrationAuthentication: (options: ExchangeCodeOptions & {
|
|
118
|
+
readonly capabilities: ReadonlyArray<Capability>;
|
|
119
|
+
}) => Effect.Effect<{
|
|
120
|
+
capabilityEvidence: {
|
|
121
|
+
capability: "dns:read" | "dns:write";
|
|
122
|
+
evidence: {
|
|
123
|
+
readonly _tag: "Introspected";
|
|
124
|
+
readonly observedAt: Date;
|
|
125
|
+
};
|
|
126
|
+
}[];
|
|
127
|
+
credential: {
|
|
128
|
+
accessToken: Value;
|
|
129
|
+
refreshToken: null;
|
|
130
|
+
tokenType: string;
|
|
131
|
+
};
|
|
132
|
+
expiresAt: null;
|
|
133
|
+
providerAccountId: string;
|
|
134
|
+
providerContext: Envelope;
|
|
135
|
+
scopes: never[];
|
|
136
|
+
}, Error$1 | Error, never>;
|
|
137
|
+
interface IntegrationFlowOptions extends Omit<ExchangeCodeOptions, "code">, IntegrationMethodOptions {}
|
|
138
|
+
/** Creates Vercel Integration's implementation of the common interactive connection capability. */
|
|
139
|
+
declare function integrationFlow(options: IntegrationFlowOptions): InteractiveFlow;
|
|
89
140
|
declare namespace index_d_exports {
|
|
90
|
-
export { Account, AccountContext, auth_d_exports as Auth, client_d_exports as Client, Fetch, Interface, ListZonesInput, Options, Zone, make };
|
|
141
|
+
export { Account, AccountContext, auth_d_exports as Auth, client_d_exports as Client, Fetch, Interface, ListZonesInput, Options, Zone, discovery, make };
|
|
91
142
|
}
|
|
92
143
|
//#endregion
|
|
93
|
-
export {
|
|
94
|
-
//# sourceMappingURL=index-
|
|
144
|
+
export { Zone as _, IntegrationMethodOptions as a, make as b, integrationMethod as c, Account as d, AccountContext as f, Options as g, ListZonesInput as h, IntegrationFlowOptions as i, manifest as l, Interface as m, ExchangeCodeOptions as n, TokenConnectionOptions as o, Fetch as p, IntegrationCredential as r, auth_d_exports as s, index_d_exports as t, tokenMethod as u, client_d_exports as v, discovery as y };
|
|
145
|
+
//# sourceMappingURL=index-Ewc__bQu.d.mts.map
|