domainkit 0.9.0 → 0.10.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 +3 -1
- package/dist/Cloudflare.mjs +1 -0
- package/dist/Cloudflare.mjs.map +1 -1
- package/dist/Connect.mjs +17 -2
- package/dist/Connect.mjs.map +1 -1
- package/dist/Provider.mjs.map +1 -1
- package/dist/Resolver.mjs +1 -1
- package/dist/Resolver.mjs.map +1 -1
- package/dist/Server.mjs +9 -2
- package/dist/Server.mjs.map +1 -1
- package/dist/Testing.mjs +20 -18
- package/dist/Testing.mjs.map +1 -1
- package/dist/Transport.mjs +1 -1
- package/dist/Transport.mjs.map +1 -1
- package/dist/Vercel.mjs +3 -1
- package/dist/Vercel.mjs.map +1 -1
- package/dist/internal/cloudflare/client.mjs +10 -5
- package/dist/internal/cloudflare/client.mjs.map +1 -1
- package/dist/internal/conformance/provider.mjs +31 -18
- package/dist/internal/conformance/provider.mjs.map +1 -1
- package/dist/internal/doh.mjs +2 -1
- package/dist/internal/doh.mjs.map +1 -1
- package/dist/internal/http.mjs +9 -3
- package/dist/internal/http.mjs.map +1 -1
- package/dist/package.mjs +1 -1
- package/dist/types/Connect.d.ts +28 -0
- package/dist/types/Provider.d.ts +6 -0
- package/dist/types/Server.d.ts +4 -0
- package/dist/types/Testing.d.ts +3 -1
- package/dist/types/Vercel.d.ts +1 -1
- package/dist/types/internal/cloudflare/client.d.ts +4 -2
- package/dist/types/internal/conformance/provider.d.ts +10 -3
- package/dist/types/internal/http.d.ts +5 -0
- package/package.json +1 -1
|
@@ -12,8 +12,10 @@ export interface Options {
|
|
|
12
12
|
type Fx<A> = Effect.Effect<A, Errors.DomainKitError>;
|
|
13
13
|
/** Every zone the credential can see, across accounts; internal zones cannot host records. */
|
|
14
14
|
export declare const listZones: (options: Options, accountId?: string) => Fx<ReadonlyArray<Protocol.Zone>>;
|
|
15
|
-
/**
|
|
16
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Token status and expiry from a verify endpoint; `null` expiry means the token never expires. An
|
|
17
|
+
* inactive token, or a 403 from the verify endpoint, is `Unauthenticated`.
|
|
18
|
+
*/
|
|
17
19
|
export declare const verifyToken: (options: Options, path: string) => Fx<DateTime.Utc | null>;
|
|
18
20
|
export declare const tokenExpiry: (options: Options, accountId: string | null) => Fx<{
|
|
19
21
|
readonly expiresAt: DateTime.Utc | null;
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import * as Errors from "../error.ts";
|
|
3
3
|
import * as Provider from "../../Provider.ts";
|
|
4
|
-
export declare const cases: readonly ["create-readback-cleanup", "exact-noop", "conflict", "stale-plan", "partial-apply-cleanup"];
|
|
4
|
+
export declare const cases: readonly ["create-readback-cleanup", "exact-noop", "conflict", "stale-plan", "partial-apply-cleanup", "rejected-token"];
|
|
5
5
|
export type Case = (typeof cases)[number];
|
|
6
6
|
/**
|
|
7
|
-
* Runs create/readback/cleanup, exact-noop, conflict, stale-plan,
|
|
8
|
-
* real provider definition, through the same Provision and Cleanup
|
|
7
|
+
* Runs create/readback/cleanup, exact-noop, conflict, stale-plan, partial-apply, and
|
|
8
|
+
* rejected-token against a real provider definition, through the same Provision and Cleanup
|
|
9
|
+
* services hosts use.
|
|
9
10
|
*/
|
|
10
11
|
export declare const provider: (definition: Provider.Definition, credential: Provider.Credential, zone: string, options?: {
|
|
11
12
|
readonly prefix?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Token values the provider rejects, for the `rejected-token` case. Default: every required
|
|
15
|
+
* field set to an empty secret, which needs a token method whose required fields are all
|
|
16
|
+
* secrets.
|
|
17
|
+
*/
|
|
18
|
+
readonly rejectedToken?: Provider.TokenValues;
|
|
12
19
|
}) => Effect.Effect<void, Errors.DomainKitError>;
|
|
@@ -23,5 +23,10 @@ export declare const headersFrom: (source: HeadersInit | (() => HeadersInit | Pr
|
|
|
23
23
|
* conflict code -> ProviderConflict, 429/5xx -> ProviderUnavailable, else ProviderRejected.
|
|
24
24
|
*/
|
|
25
25
|
export declare const classify: (provider: string, status: number, headers: Headers, message: string, code?: string) => Reason.Model;
|
|
26
|
+
/**
|
|
27
|
+
* During token verification a `Forbidden` answer means the provider did not accept the token, so
|
|
28
|
+
* it reads as `Unauthenticated` with the provider's own message.
|
|
29
|
+
*/
|
|
30
|
+
export declare const rejectedToken: <A, R>(verification: Effect.Effect<A, Errors.DomainKitError, R>) => Effect.Effect<A, Errors.DomainKitError, R>;
|
|
26
31
|
export declare const rejected: (provider: string, message: string, code?: string) => Errors.DomainKitError;
|
|
27
32
|
export declare const bearer: (token: string, init?: RequestInit) => RequestInit;
|