domain0 0.1.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.
@@ -0,0 +1,196 @@
1
+ import { $i as SelectProviderInput, At as ConnectionId, B as ResolveSharedFlowResponse, Ci as CreateConnectionInput, Cr as Domain0ConnectEvent, Di as DetectProviderResponse, E as Domain0WhiteLabelInput, Er as Domain0ConnectStepChangeEvent$1, Fi as IssueConnectionTokenInput, Fr as Domain0RequestCloseEvent$1, G as SharedFlowInvitationInput, Hr as ConnectionFlowId, I as CreateSharedFlowResponse, Jt as Domain0ErrorResponse, Li as IssueConnectionTokenResponse, Ln as CheckRecordsInput, Lr as Domain0SharedFlowSentEvent$1, Ni as GetConnectionResponse, Nr as Domain0ManualSetupDocumentationClickEvent$1, P as CreateSharedFlowInput, Qt as CheckDomainResponse, Sn as DkimGuidanceResponse, Ti as CreateConnectionResponse, Tr as Domain0ConnectStep$1, Ut as Domain0Locale, Vr as ConnectionFlow, Vt as ManualSetupDocumentationUrlInput, Wi as PreparePlanInput, Wr as ConnectionFlowResponse, Xt as CheckDomainInput, Yi as RetryConnectionInput, Z as SharedFlowUrl, Zr as CreateConnectionFlowInput, _a as VerifyPropagationInput, aa as StartManualConfigurationInput, bn as DkimGuidanceInput, ci as CancelConnectionInput, da as SubmitDomainConnectCompletionInput, et as Domain0SetupPolicyInput, hi as Connection, ii as AuthorizeWithCredentialInput, ji as DomainConnectTemplate, jr as Domain0DkimSetupDocumentationClickEvent$1, kr as Domain0ConnectSuccessEvent$1, la as StartOAuthResponse, ni as ApplyPlanInput, nt as PlatformCreateConnectionInput, ot as ListProvidersResponse, pa as SubmitManualCompletionInput, pi as ConfirmPlanInput, q as SharedFlowInvitationUrl, ra as StartDomainConnectResponse, sa as StartOAuthInput, ta as StartDomainConnectInput, vt as ProviderHealthResponse, wn as DkimSelector, xr as Domain0ConnectCloseReason$1, yr as Domain0ConnectCloseEvent$1, zn as CheckRecordsResponse } from "./index-CtQn01os.cjs";
2
+ //#region src/client/client.d.ts
3
+ interface Domain0ClientOptions {
4
+ baseUrl: string;
5
+ token: string | (() => string | Promise<string>);
6
+ fetch?: typeof globalThis.fetch;
7
+ }
8
+ interface Domain0Client {
9
+ listProviders(): Promise<ListProvidersResponse>;
10
+ getProviderHealth(): Promise<ProviderHealthResponse>;
11
+ getDkimGuidance(connectionId: ConnectionId, input: DkimGuidanceInput): Promise<DkimGuidanceResponse>;
12
+ checkDomain(input: CheckDomainInput): Promise<CheckDomainResponse>;
13
+ checkRecords(input: CheckRecordsInput): Promise<CheckRecordsResponse>;
14
+ createSharedFlow(input: CreateSharedFlowInput): Promise<CreateSharedFlowResponse>;
15
+ createConnection(input: CreateConnectionInput): Promise<CreateConnectionResponse>;
16
+ createConnectionFlow(input: CreateConnectionFlowInput): Promise<ConnectionFlowResponse>;
17
+ getConnectionFlow(flowId: ConnectionFlowId): Promise<ConnectionFlowResponse>;
18
+ getConnection(connectionId: ConnectionId): Promise<GetConnectionResponse>;
19
+ issueConnectionToken(connectionId: ConnectionId, input: IssueConnectionTokenInput): Promise<IssueConnectionTokenResponse>;
20
+ detectProvider(connectionId: ConnectionId): Promise<DetectProviderResponse>;
21
+ selectProvider(connectionId: ConnectionId, input: SelectProviderInput): Promise<GetConnectionResponse>;
22
+ startDomainConnect(connectionId: ConnectionId, input: StartDomainConnectInput): Promise<StartDomainConnectResponse>;
23
+ submitDomainConnectCompletion(connectionId: ConnectionId, input: SubmitDomainConnectCompletionInput): Promise<GetConnectionResponse>;
24
+ startOAuth(connectionId: ConnectionId, input: StartOAuthInput): Promise<StartOAuthResponse>;
25
+ authorizeWithCredential(connectionId: ConnectionId, input: AuthorizeWithCredentialInput): Promise<GetConnectionResponse>;
26
+ preparePlan(connectionId: ConnectionId, input: PreparePlanInput): Promise<GetConnectionResponse>;
27
+ confirmPlan(connectionId: ConnectionId, input: ConfirmPlanInput): Promise<GetConnectionResponse>;
28
+ applyPlan(connectionId: ConnectionId, input: ApplyPlanInput): Promise<GetConnectionResponse>;
29
+ verifyPropagation(connectionId: ConnectionId, input: VerifyPropagationInput): Promise<GetConnectionResponse>;
30
+ startManualConfiguration(connectionId: ConnectionId, input: StartManualConfigurationInput): Promise<GetConnectionResponse>;
31
+ submitManualCompletion(connectionId: ConnectionId, input: SubmitManualCompletionInput): Promise<GetConnectionResponse>;
32
+ cancelConnection(connectionId: ConnectionId, input: CancelConnectionInput): Promise<GetConnectionResponse>;
33
+ retryConnection(connectionId: ConnectionId, input: RetryConnectionInput): Promise<GetConnectionResponse>;
34
+ }
35
+ interface LoadSharedFlowOptions {
36
+ baseUrl: string;
37
+ url: SharedFlowUrl;
38
+ origin: string;
39
+ fetch?: typeof globalThis.fetch;
40
+ }
41
+ interface LoadedSharedFlow extends ResolveSharedFlowResponse {
42
+ client: Domain0Client;
43
+ }
44
+ declare function createDomain0Client(options: Domain0ClientOptions): Domain0Client;
45
+ declare function createSharedFlowUrl(baseUrl: SharedFlowUrl, token: string): SharedFlowUrl;
46
+ declare function loadSharedFlow(options: LoadSharedFlowOptions): Promise<LoadedSharedFlow>;
47
+ //#endregion
48
+ //#region src/client/error.d.ts
49
+ declare class Domain0Error extends Error {
50
+ readonly status: number;
51
+ readonly response: Domain0ErrorResponse;
52
+ constructor(status: number, response: Domain0ErrorResponse);
53
+ }
54
+ declare class Domain0ProtocolError extends Error {
55
+ readonly cause: unknown;
56
+ constructor(message: string, cause?: unknown);
57
+ }
58
+ declare class Domain0TransportError extends Error {
59
+ readonly cause: unknown;
60
+ constructor(cause: unknown);
61
+ }
62
+ //#endregion
63
+ //#region src/client/platform-client.d.ts
64
+ interface Domain0PlatformClientOptions {
65
+ /** Public platform API root, for example https://domain0.dev/api/domain0/. */
66
+ baseUrl: string;
67
+ /** Server-side API key. Never expose this value to browser code. */
68
+ apiKey: string | (() => string | Promise<string>);
69
+ fetch?: typeof globalThis.fetch;
70
+ }
71
+ interface Domain0PlatformClient {
72
+ createConnection(input: PlatformCreateConnectionInput): Promise<CreateConnectionResponse>;
73
+ getConnection(connectionId: ConnectionId): Promise<GetConnectionResponse>;
74
+ issueConnectionToken(connectionId: ConnectionId, input: IssueConnectionTokenInput): Promise<IssueConnectionTokenResponse>;
75
+ }
76
+ /**
77
+ * Creates the server-only client for Domain0's hosted platform boundary.
78
+ * The platform derives application and tenant ownership from the API key.
79
+ */
80
+ declare function createDomain0PlatformClient(options: Domain0PlatformClientOptions): Domain0PlatformClient;
81
+ //#endregion
82
+ //#region src/ui/connect.d.ts
83
+ type EventPayload<TEvent extends {
84
+ readonly type: string;
85
+ }> = Omit<TEvent, 'type'>;
86
+ type Domain0ConnectStep = Domain0ConnectStep$1;
87
+ type Domain0ConnectCloseReason = Domain0ConnectCloseReason$1;
88
+ type Domain0ActiveConnection = Domain0ConnectSuccessEvent$1['connection'];
89
+ type Domain0ConnectSuccessEvent = EventPayload<Domain0ConnectSuccessEvent$1>;
90
+ type Domain0ConnectCloseEvent = EventPayload<Domain0ConnectCloseEvent$1>;
91
+ type Domain0ConnectStepChangeEvent = EventPayload<Domain0ConnectStepChangeEvent$1>;
92
+ type Domain0ManualSetupDocumentationClickEvent = EventPayload<Domain0ManualSetupDocumentationClickEvent$1>;
93
+ type Domain0RequestCloseEvent = EventPayload<Domain0RequestCloseEvent$1>;
94
+ type Domain0SharedFlowSentEvent = EventPayload<Domain0SharedFlowSentEvent$1>;
95
+ type Domain0DkimSetupDocumentationClickEvent = EventPayload<Domain0DkimSetupDocumentationClickEvent$1>;
96
+ interface Domain0CreateSharedFlowRequest {
97
+ readonly connectionId: ConnectionId;
98
+ }
99
+ interface Domain0SharedFlowGateway {
100
+ create(request: Domain0CreateSharedFlowRequest): Promise<SharedFlowInvitationInput>;
101
+ copy?(url: SharedFlowInvitationUrl): Promise<void>;
102
+ }
103
+ interface Domain0ConnectOptions {
104
+ target: HTMLElement;
105
+ client: Domain0Client;
106
+ connectionId: ConnectionId;
107
+ applicationName?: string;
108
+ triggerLabel?: string;
109
+ triggerHidden?: boolean;
110
+ /**
111
+ * 'modal' (default) opens the dialog over the page. 'inline' renders it in
112
+ * normal flow, for embedding the flow inside a surface you already own; it
113
+ * takes no backdrop, traps no focus, and does not steal focus on open.
114
+ */
115
+ presentation?: 'modal' | 'inline';
116
+ locale?: Domain0Locale;
117
+ whiteLabel?: Domain0WhiteLabelInput;
118
+ setupPolicy?: Domain0SetupPolicyInput;
119
+ manualSetupDocumentation?: ManualSetupDocumentationUrlInput;
120
+ enableDkim?: boolean;
121
+ dkimSelectors?: readonly DkimSelector[];
122
+ domainConnectTemplate?: DomainConnectTemplate;
123
+ sharedFlowGateway?: Domain0SharedFlowGateway;
124
+ onConnectionChange?: (connection: Connection) => void;
125
+ onEvent?: (event: Domain0ConnectEvent) => void;
126
+ onSuccess?: (event: Domain0ConnectSuccessEvent) => void;
127
+ onClose?: (event: Domain0ConnectCloseEvent) => void;
128
+ onStepChange?: (event: Domain0ConnectStepChangeEvent) => void;
129
+ onManualSetupDocumentationClick?: (event: Domain0ManualSetupDocumentationClickEvent) => void;
130
+ onRequestClose?: (event: Domain0RequestCloseEvent) => void;
131
+ onSharedFlowSent?: (event: Domain0SharedFlowSentEvent) => void;
132
+ onDkimSetupDocumentationClick?: (event: Domain0DkimSetupDocumentationClickEvent) => void;
133
+ }
134
+ interface Domain0ConnectController {
135
+ open(): Promise<void>;
136
+ close(): void;
137
+ destroy(): void;
138
+ }
139
+ declare function mountDomain0Connect(options: Domain0ConnectOptions): Domain0ConnectController;
140
+ //#endregion
141
+ //#region src/ui/connection-flow.d.ts
142
+ type ChildConnectOptions = Omit<Domain0ConnectOptions, 'target' | 'client' | 'connectionId' | 'triggerHidden' | 'locale'>;
143
+ interface Domain0ConnectionFlowOptions {
144
+ target: HTMLElement;
145
+ client: Domain0Client;
146
+ flowId: ConnectionFlowId;
147
+ locale?: Domain0Locale;
148
+ connect?: ChildConnectOptions;
149
+ onTargetChange?: (event: {
150
+ flow: ConnectionFlow;
151
+ index: number;
152
+ total: number;
153
+ domain: string;
154
+ }) => void;
155
+ onSuccess?: (flow: ConnectionFlow) => void;
156
+ }
157
+ interface Domain0ConnectionFlowController {
158
+ open(): Promise<void>;
159
+ close(): void;
160
+ destroy(): void;
161
+ }
162
+ declare function mountDomain0ConnectionFlow(options: Domain0ConnectionFlowOptions): Domain0ConnectionFlowController;
163
+ //#endregion
164
+ //#region src/ui/shared-flow.d.ts
165
+ interface Domain0SharedFlowOptions extends Omit<Domain0ConnectOptions, 'target' | 'client' | 'connectionId'> {
166
+ target: HTMLElement;
167
+ apiBaseUrl: string;
168
+ url: SharedFlowUrl;
169
+ origin?: string;
170
+ fetch?: typeof globalThis.fetch;
171
+ }
172
+ declare function mountDomain0SharedFlow(options: Domain0SharedFlowOptions): Promise<Domain0ConnectController>;
173
+ //#endregion
174
+ //#region src/ui/sdk.d.ts
175
+ interface Domain0ConnectDomainOptions extends Omit<Domain0ConnectOptions, 'target' | 'triggerHidden'> {
176
+ target?: HTMLElement;
177
+ }
178
+ interface Domain0LoadSharedFlowOptions extends Omit<Domain0SharedFlowOptions, 'target' | 'triggerHidden'> {
179
+ target?: HTMLElement;
180
+ }
181
+ interface Domain0ConnectDomainsOptions extends Omit<Domain0ConnectionFlowOptions, 'target'> {
182
+ target?: HTMLElement;
183
+ }
184
+ interface Domain0SDK {
185
+ load(): Promise<void>;
186
+ connectDomain(options: Domain0ConnectDomainOptions): Promise<Domain0ConnectController>;
187
+ connectDomains(options: Domain0ConnectDomainsOptions): Promise<Domain0ConnectionFlowController>;
188
+ loadSharedFlow(options: Domain0LoadSharedFlowOptions): Promise<Domain0ConnectController>;
189
+ close(): void;
190
+ destroy(): void;
191
+ }
192
+ declare function createDomain0(): Domain0SDK;
193
+ declare const domain0: Domain0SDK;
194
+ //#endregion
195
+ export { Domain0Error as A, Domain0RequestCloseEvent as C, Domain0PlatformClient as D, mountDomain0Connect as E, LoadSharedFlowOptions as F, LoadedSharedFlow as I, createDomain0Client as L, Domain0TransportError as M, Domain0Client as N, Domain0PlatformClientOptions as O, Domain0ClientOptions as P, createSharedFlowUrl as R, Domain0ManualSetupDocumentationClickEvent as S, Domain0SharedFlowSentEvent as T, Domain0ConnectStep as _, createDomain0 as a, Domain0CreateSharedFlowRequest as b, mountDomain0SharedFlow as c, mountDomain0ConnectionFlow as d, Domain0ActiveConnection as f, Domain0ConnectOptions as g, Domain0ConnectController as h, Domain0SDK as i, Domain0ProtocolError as j, createDomain0PlatformClient as k, Domain0ConnectionFlowController as l, Domain0ConnectCloseReason as m, Domain0ConnectDomainsOptions as n, domain0 as o, Domain0ConnectCloseEvent as p, Domain0LoadSharedFlowOptions as r, Domain0SharedFlowOptions as s, Domain0ConnectDomainOptions as t, Domain0ConnectionFlowOptions as u, Domain0ConnectStepChangeEvent as v, Domain0SharedFlowGateway as w, Domain0DkimSetupDocumentationClickEvent as x, Domain0ConnectSuccessEvent as y, loadSharedFlow as z };
196
+ //# sourceMappingURL=sdk-BKtsupNk.d.cts.map