domainkit 0.10.0 → 0.12.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/dist/Cloudflare.mjs +35 -12
- package/dist/Cloudflare.mjs.map +1 -1
- package/dist/Connect.mjs +159 -35
- package/dist/Connect.mjs.map +1 -1
- package/dist/Provider.mjs +12 -13
- package/dist/Provider.mjs.map +1 -1
- package/dist/Server.mjs +139 -22
- package/dist/Server.mjs.map +1 -1
- package/dist/Storage.mjs +2 -0
- package/dist/Storage.mjs.map +1 -1
- package/dist/Testing.mjs +8 -7
- package/dist/Testing.mjs.map +1 -1
- package/dist/Transport.mjs +25 -2
- package/dist/Transport.mjs.map +1 -1
- package/dist/internal/conformance/storage.mjs +16 -0
- package/dist/internal/conformance/storage.mjs.map +1 -1
- package/dist/internal/oauth.mjs +35 -7
- package/dist/internal/oauth.mjs.map +1 -1
- package/dist/internal/storage-memory.mjs +1 -0
- package/dist/internal/storage-memory.mjs.map +1 -1
- package/dist/package.mjs +1 -1
- package/dist/types/Cloudflare.d.ts +21 -0
- package/dist/types/Connect.d.ts +65 -0
- package/dist/types/Provider.d.ts +5 -0
- package/dist/types/Server.d.ts +954 -26
- package/dist/types/Storage.d.ts +4 -0
- package/dist/types/Testing.d.ts +12 -3
- package/dist/types/Transport.d.ts +16 -1
- package/dist/types/internal/oauth.d.ts +4 -0
- package/package.json +1 -1
package/dist/types/Storage.d.ts
CHANGED
|
@@ -60,6 +60,8 @@ declare const Attachment_base: Schema.Class<Attachment, Schema.Struct<{
|
|
|
60
60
|
readonly connectionId: Schema.String;
|
|
61
61
|
readonly domain: Schema.String;
|
|
62
62
|
readonly zone: Schema.String;
|
|
63
|
+
/** The target's label as the provider gave it at attach time, so a UI names the account without a provider call. */
|
|
64
|
+
readonly label: Schema.String;
|
|
63
65
|
/** Provider zone identity (zone id, account id) decoded by the provider's `context` schema. */
|
|
64
66
|
readonly target: Schema.Unknown;
|
|
65
67
|
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
@@ -178,6 +180,7 @@ export interface Interface {
|
|
|
178
180
|
readonly connectionId: string;
|
|
179
181
|
readonly domain: string;
|
|
180
182
|
readonly zone: string;
|
|
183
|
+
readonly label: string;
|
|
181
184
|
readonly target: unknown;
|
|
182
185
|
}) => Fx<Attachment>;
|
|
183
186
|
readonly get: (id: string) => Fx<Attachment>;
|
|
@@ -273,6 +276,7 @@ export interface AsyncInterface {
|
|
|
273
276
|
readonly connectionId: string;
|
|
274
277
|
readonly domain: string;
|
|
275
278
|
readonly zone: string;
|
|
279
|
+
readonly label: string;
|
|
276
280
|
readonly target: unknown;
|
|
277
281
|
}) => Promise<Attachment>;
|
|
278
282
|
readonly get: (principal: Principal.Interface, id: string) => Promise<Attachment>;
|
package/dist/types/Testing.d.ts
CHANGED
|
@@ -16,8 +16,12 @@ export declare const storage: Layer.Layer<Storage.Service>;
|
|
|
16
16
|
export declare const principal: Principal.Interface;
|
|
17
17
|
export interface FakeProviderOptions {
|
|
18
18
|
readonly id?: string;
|
|
19
|
+
/** The name a customer reads. Default `Fake <id>`; a fixture that ships screenshots sets it. */
|
|
20
|
+
readonly name?: string;
|
|
19
21
|
/** Zones the fake credential can reach. Default: `example.com`. */
|
|
20
22
|
readonly zones?: ReadonlyArray<string>;
|
|
23
|
+
/** The label each zone carries, keyed by zone. Default: the zone name. */
|
|
24
|
+
readonly labels?: Readonly<Record<string, string>>;
|
|
21
25
|
/** Pre-existing records, to produce `Noop` and `Conflict` operations. */
|
|
22
26
|
readonly records?: ReadonlyArray<{
|
|
23
27
|
readonly zone: string;
|
|
@@ -49,18 +53,23 @@ type FakeContext = typeof Context.Type;
|
|
|
49
53
|
export declare const provider: (options?: FakeProviderOptions) => FakeProvider;
|
|
50
54
|
/** Records every fake provider currently holds for `name`, across all fake zones. */
|
|
51
55
|
export declare const fakeRecords: (name: string) => ReadonlyArray<DnsRecord.Observed>;
|
|
56
|
+
export interface FakeResolverOptions {
|
|
57
|
+
/** The name every answer carries. A UI reads it as the observer. Default `fake`. */
|
|
58
|
+
readonly id?: string;
|
|
59
|
+
}
|
|
52
60
|
/**
|
|
53
|
-
* A resolver answering from the fake providers' zones, or from an explicit table. Every answer
|
|
54
|
-
*
|
|
61
|
+
* A resolver answering from the fake providers' zones, or from an explicit table. Every answer is
|
|
62
|
+
* attributed to `options.id`, which a fixture that ships screenshots names after a real resolver.
|
|
55
63
|
*/
|
|
56
64
|
export declare const resolver: (answers?: ReadonlyArray<{
|
|
57
65
|
readonly name: string;
|
|
58
66
|
readonly records: ReadonlyArray<DnsRecord.Observed>;
|
|
59
|
-
}
|
|
67
|
+
}>, options?: FakeResolverOptions) => Layer.Layer<Resolver.Service>;
|
|
60
68
|
export interface TransportOptions {
|
|
61
69
|
/** Which groups the fake server exposes, so a UI can be tested against a partial host. */
|
|
62
70
|
readonly capabilities?: ReadonlyArray<Transport.Capability>;
|
|
63
71
|
readonly provider?: FakeProviderOptions;
|
|
72
|
+
readonly resolver?: FakeResolverOptions;
|
|
64
73
|
}
|
|
65
74
|
export interface RecordedCall {
|
|
66
75
|
/** `connection.inspect`, `provisioning.approve`, ... */
|
|
@@ -23,6 +23,9 @@ export type Readiness = Server.Readiness;
|
|
|
23
23
|
export type Attempt = Server.Attempt;
|
|
24
24
|
export type Candidate = Server.Candidate;
|
|
25
25
|
export type Discovery = Server.Discovery;
|
|
26
|
+
export type Zone = Server.Zone;
|
|
27
|
+
export type Zones = Server.Zones;
|
|
28
|
+
export type Attachment = Server.Attachment;
|
|
26
29
|
export type Field = Server.Field;
|
|
27
30
|
export type MethodDescriptor = Server.MethodDescriptor;
|
|
28
31
|
export type Method = Server.Method;
|
|
@@ -41,11 +44,21 @@ export interface ConnectionGroup {
|
|
|
41
44
|
readonly inspect: (domain: string) => Fx<Snapshot>;
|
|
42
45
|
/** Which of this owner's existing connections already reaches the domain. */
|
|
43
46
|
readonly discover: (domain: string) => Fx<Discovery>;
|
|
47
|
+
/** Every zone this owner's connections reach, and where each connection stands. */
|
|
48
|
+
readonly zones: (options?: {
|
|
49
|
+
readonly provider?: string;
|
|
50
|
+
}) => Fx<Zones>;
|
|
51
|
+
/** Connect a provider. Without a domain the account connects alone and attaches nothing. */
|
|
44
52
|
readonly start: (input: {
|
|
45
|
-
readonly domain
|
|
53
|
+
readonly domain?: string;
|
|
46
54
|
readonly provider: string;
|
|
47
55
|
readonly method: Method;
|
|
48
56
|
}) => Fx<Started>;
|
|
57
|
+
/** Prove an account again for a connection this owner holds, keeping its domains. */
|
|
58
|
+
readonly reconnect: (input: {
|
|
59
|
+
readonly connectionId: string;
|
|
60
|
+
readonly method: Method;
|
|
61
|
+
}) => Fx<Started>;
|
|
49
62
|
readonly attach: (input: {
|
|
50
63
|
readonly connectionId: string;
|
|
51
64
|
readonly domain: string;
|
|
@@ -71,6 +84,8 @@ export interface ProvisioningGroup {
|
|
|
71
84
|
readonly apply: (approvalId: Approval.ApprovalId) => Fx<Receipt.Model>;
|
|
72
85
|
/** The stored plan with its status, approval, receipt, and rejection. */
|
|
73
86
|
readonly attempt: (planId: Plan.PlanId) => Fx<Attempt>;
|
|
87
|
+
/** What one apply landed, by receipt id, for a surface that holds the id and not the attempt. */
|
|
88
|
+
readonly receipt: (receiptId: Receipt.ReceiptId) => Fx<Receipt.Model>;
|
|
74
89
|
}
|
|
75
90
|
export interface VerificationGroup {
|
|
76
91
|
/**
|
|
@@ -41,6 +41,8 @@ export declare const exchangeCode: (input: {
|
|
|
41
41
|
readonly callbackUrl: string;
|
|
42
42
|
readonly codeVerifier: string;
|
|
43
43
|
readonly fetch?: Fetch;
|
|
44
|
+
/** Permit an `http:` endpoint that is not loopback. Development only; see `insecureAllowed`. */
|
|
45
|
+
readonly allowPlaintext?: boolean;
|
|
44
46
|
}) => Effect.Effect<Tokens, Errors.DomainKitError>;
|
|
45
47
|
export declare const refresh: (input: {
|
|
46
48
|
readonly provider: string;
|
|
@@ -48,6 +50,7 @@ export declare const refresh: (input: {
|
|
|
48
50
|
readonly client: Client;
|
|
49
51
|
readonly refreshToken: string;
|
|
50
52
|
readonly fetch?: Fetch;
|
|
53
|
+
readonly allowPlaintext?: boolean;
|
|
51
54
|
}) => Effect.Effect<Tokens, Errors.DomainKitError>;
|
|
52
55
|
export declare const revoke: (input: {
|
|
53
56
|
readonly provider: string;
|
|
@@ -55,4 +58,5 @@ export declare const revoke: (input: {
|
|
|
55
58
|
readonly client: Client;
|
|
56
59
|
readonly token: string;
|
|
57
60
|
readonly fetch?: Fetch;
|
|
61
|
+
readonly allowPlaintext?: boolean;
|
|
58
62
|
}) => Effect.Effect<void, Errors.DomainKitError>;
|