domain0 0.3.3 → 0.5.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 +19 -8
- package/dist/contracts.cjs +1 -1811
- package/dist/contracts.cjs.map +1 -1
- package/dist/contracts.d.cts +2 -2
- package/dist/contracts.d.mts +2 -2
- package/dist/contracts.mjs +1 -1665
- package/dist/contracts.mjs.map +1 -1
- package/dist/error-1Gob8Pup.cjs +2 -0
- package/dist/{error-BB4-lyc4.cjs.map → error-1Gob8Pup.cjs.map} +1 -1
- package/dist/error-szz6-UFL.mjs +2 -0
- package/dist/{error-Cyd6a9ay.mjs.map → error-szz6-UFL.mjs.map} +1 -1
- package/dist/{index-sSrRFTnm.d.cts → index-Cw7qOvHn.d.cts} +1913 -400
- package/dist/{index-sSrRFTnm.d.mts → index-Cw7qOvHn.d.mts} +1913 -400
- package/dist/index.cjs +1 -245
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -90
- package/dist/index.mjs.map +1 -1
- package/dist/{sdk-B10fN-QP.d.mts → sdk-BCgyva16.d.cts} +8 -9
- package/dist/sdk-BEFduVyo.mjs +148 -0
- package/dist/sdk-BEFduVyo.mjs.map +1 -0
- package/dist/{sdk-DYR5Itru.d.cts → sdk-CljceWZQ.d.mts} +8 -9
- package/dist/sdk-DwnYJ501.cjs +148 -0
- package/dist/sdk-DwnYJ501.cjs.map +1 -0
- package/dist/server.cjs +1 -102
- package/dist/server.cjs.map +1 -1
- package/dist/server.mjs +1 -101
- package/dist/server.mjs.map +1 -1
- package/dist/ui.cjs +1 -12
- package/dist/ui.d.cts +22 -3
- package/dist/ui.d.mts +22 -3
- package/dist/ui.mjs +1 -2
- package/package.json +7 -1
- package/dist/error-BB4-lyc4.cjs +0 -48
- package/dist/error-Cyd6a9ay.mjs +0 -31
- package/dist/sdk-CoOrU3ZT.mjs +0 -4178
- package/dist/sdk-CoOrU3ZT.mjs.map +0 -1
- package/dist/sdk-DJqGGxgC.cjs +0 -4255
- package/dist/sdk-DJqGGxgC.cjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,91 +1,2 @@
|
|
|
1
|
-
import { AccessKeyCredentialsSchema, AccountTokenCredentialsSchema, AdvancedDmarcOptionsSchema, ApiTokenCredentialsSchema, ApplicationIdSchema, ApplyPlanInputSchema, AuthorizationMethodSchema, AuthorizeWithCredentialInputSchema, AwsSessionCredentialsSchema, CPanelCredentialsSchema, CancelConnectionInputSchema, ChangeActionSchema, ChangePlanSchema, CheckDomainInputSchema, CheckDomainResponseSchema, CheckRecordsInputSchema, CheckRecordsResponseSchema, CheckedRecordSchema, ClientCredentialsSchema, CommandIdSchema, CompiledProviderIdSchema, ConditionalDnsRecordsSchema, ConfirmPlanInputSchema, ConflictAnalysisSchema, ConflictPolicySchema, ConnectionFailureCodeSchema, ConnectionFailureSchema, ConnectionFlowIdSchema, ConnectionFlowResponseSchema, ConnectionFlowSchema, ConnectionFlowTargetInputSchema, ConnectionFlowTargetSchema, ConnectionIdSchema, ConnectionSchema, ConnectionStateSchema, CreateConnectionFlowInputSchema, CreateConnectionInputSchema, CreateConnectionResponseSchema, CreateSharedFlowInputSchema, CreateSharedFlowResponseSchema, DOMAIN0_WEBHOOK_HEADER_NAMES, DetectProviderResponseSchema, DkimDnsEvidenceSchema, DkimDnsEvidenceStatusSchema, DkimDnsRecordEvidenceSchema, DkimDnsRecordTypeSchema, DkimGuidanceInputSchema, DkimGuidanceResponseSchema, DkimSelectorSchema, DnsIntentSchema, DnsRecordSchema, DnsRecordTypeSchema, Domain0ApplicationNameSchema, Domain0ConnectCloseEventSchema, Domain0ConnectCloseReasonSchema, Domain0ConnectConfigurationSchema, Domain0ConnectEventSchema, Domain0ConnectStepChangeEventSchema, Domain0ConnectStepSchema, Domain0ConnectSuccessEventSchema, Domain0DkimGuidanceOptionsSchema, Domain0DkimSetupDocumentationClickEventSchema, Domain0ErrorCodeSchema, Domain0ErrorResponseSchema, Domain0LocaleSchema, Domain0ManualSetupDocumentationClickEventSchema, Domain0RequestCloseEventSchema, Domain0SetupPolicySchema, Domain0SharedFlowSentEventSchema, Domain0WebhookAttributesSchema, Domain0WebhookEventIdSchema, Domain0WebhookEventSchema, Domain0WebhookEventTypeSchema, Domain0WebhookVerificationError, Domain0WebhookVerificationErrorCodeSchema, Domain0WhiteLabelCopySchema, Domain0WhiteLabelCustomPropertiesSchema, Domain0WhiteLabelLogoUrlSchema, Domain0WhiteLabelSchema, Domain0WhiteLabelThemeSchema, DomainConnectTemplateSchema, DomainDelegationStatusSchema, DomainNameSchema, DomainProviderCandidateSchema, DomainRecordConflictSchema, DomainSetupSupportSchema, EmailProviderDetectionStatusSchema, EmailProviderSchema, ExistingRecordPolicySchema, GetConnectionResponseSchema, IsoDateTimeSchema, IssueConnectionTokenInputSchema, IssueConnectionTokenResponseSchema, ListProvidersResponseSchema, ManualSetupDocumentationUrlSchema, OAuthCallbackResponseSchema, OvhCredentialsSchema, PlanWarningCodeSchema, PlannedChangeSchema, PlatformCreateConnectionInputSchema, PreparePlanInputSchema, PrivateKeyCredentialsSchema, ProviderCandidateSchema, ProviderCapabilitiesSchema, ProviderConformanceCheckNameSchema, ProviderConformanceEvidenceSchema, ProviderDetectionSchema, ProviderDetectionUnavailableReasonCodeSchema, ProviderHealthReasonSchema, ProviderHealthResponseSchema, ProviderHealthSchema, ProviderHealthStatusSchema, ProviderIdSchema, ProviderImplementationSchema, ProviderSchema, RecordConflictReasonSchema, ResolveSharedFlowInputSchema, ResolveSharedFlowResponseSchema, ResolvedDnsIntentSchema, ResolvedDnsRecordSchema, RetryConnectionInputSchema, RetryResumeStateSchema, SelectProviderInputSchema, SharedFlowIdSchema, SharedFlowInvitationSchema, SharedFlowInvitationUrlSchema, SharedFlowTokenSchema, SharedFlowUrlSchema, SpfConflictPolicySchema, StartDomainConnectInputSchema, StartDomainConnectResponseSchema, StartManualConfigurationInputSchema, StartOAuthInputSchema, StartOAuthResponseSchema, SubmitDomainConnectCompletionInputSchema, SubmitManualCompletionInputSchema, TenantIdSchema, UsernamePasswordCredentialsSchema, UsernameTokenCredentialsSchema, VerifiedProviderConformanceEvidenceSchema, VerifyPropagationInputSchema, colorContrastRatio, directCredentialKindByProvider, domain0Locales, expectedProviderConformanceChecks, verifyDomain0Webhook } from "./contracts.mjs";
|
|
2
|
-
import { n as Domain0ProtocolError, r as Domain0TransportError, t as Domain0Error } from "./error-Cyd6a9ay.mjs";
|
|
3
|
-
import { d as createDomain0Client, f as createSharedFlowUrl, n as domain0, p as loadSharedFlow, t as createDomain0 } from "./sdk-CoOrU3ZT.mjs";
|
|
4
|
-
//#region src/client/platform-client.ts
|
|
5
|
-
/**
|
|
6
|
-
* Creates the server-only client for Domain0's hosted platform boundary.
|
|
7
|
-
* The platform derives application and tenant ownership from the API key.
|
|
8
|
-
*/
|
|
9
|
-
function createDomain0PlatformClient(options) {
|
|
10
|
-
const baseUrl = parseBaseUrl(options.baseUrl);
|
|
11
|
-
const fetchImplementation = options.fetch ?? globalThis.fetch;
|
|
12
|
-
if (fetchImplementation === void 0) throw new Domain0ProtocolError("No fetch implementation is available");
|
|
13
|
-
async function request(path, init, responseSchema) {
|
|
14
|
-
const apiKey = parseApiKey(typeof options.apiKey === "function" ? await options.apiKey() : options.apiKey);
|
|
15
|
-
let response;
|
|
16
|
-
try {
|
|
17
|
-
response = await fetchImplementation(new URL(path, baseUrl), {
|
|
18
|
-
...init,
|
|
19
|
-
headers: {
|
|
20
|
-
accept: "application/json",
|
|
21
|
-
"x-api-key": apiKey,
|
|
22
|
-
...init.body === void 0 ? {} : { "content-type": "application/json" },
|
|
23
|
-
...init.headers
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
} catch (cause) {
|
|
27
|
-
throw new Domain0TransportError(cause);
|
|
28
|
-
}
|
|
29
|
-
const body = await parseJson(response);
|
|
30
|
-
if (!response.ok) {
|
|
31
|
-
const parsedError = Domain0ErrorResponseSchema.safeParse(body);
|
|
32
|
-
if (!parsedError.success) throw new Domain0ProtocolError(`Domain0 returned HTTP ${response.status} with an invalid error response`, parsedError.error);
|
|
33
|
-
throw new Domain0Error(response.status, parsedError.data);
|
|
34
|
-
}
|
|
35
|
-
const parsedResponse = responseSchema.safeParse(body);
|
|
36
|
-
if (!parsedResponse.success) throw new Domain0ProtocolError(`Domain0 returned HTTP ${response.status} with an invalid response`, parsedResponse.error);
|
|
37
|
-
return parsedResponse.data;
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
async createConnection(input) {
|
|
41
|
-
const body = PlatformCreateConnectionInputSchema.parse(input);
|
|
42
|
-
return request("v1/connections", {
|
|
43
|
-
method: "POST",
|
|
44
|
-
body: JSON.stringify(body)
|
|
45
|
-
}, CreateConnectionResponseSchema);
|
|
46
|
-
},
|
|
47
|
-
async getConnection(connectionId) {
|
|
48
|
-
const id = ConnectionIdSchema.parse(connectionId);
|
|
49
|
-
return request(`v1/connections/${encodeURIComponent(id)}`, { method: "GET" }, GetConnectionResponseSchema);
|
|
50
|
-
},
|
|
51
|
-
async issueConnectionToken(connectionId, input) {
|
|
52
|
-
const id = ConnectionIdSchema.parse(connectionId);
|
|
53
|
-
const body = IssueConnectionTokenInputSchema.parse(input);
|
|
54
|
-
return request(`v1/connections/${encodeURIComponent(id)}/access-token`, {
|
|
55
|
-
method: "POST",
|
|
56
|
-
body: JSON.stringify(body)
|
|
57
|
-
}, IssueConnectionTokenResponseSchema);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
function parseBaseUrl(value) {
|
|
62
|
-
let url;
|
|
63
|
-
try {
|
|
64
|
-
url = new URL(value);
|
|
65
|
-
} catch (error) {
|
|
66
|
-
throw new Domain0ProtocolError("Domain0 baseUrl must be an absolute URL", error);
|
|
67
|
-
}
|
|
68
|
-
if (url.protocol !== "https:" && !isLoopback(url.hostname)) throw new Domain0ProtocolError("Domain0 baseUrl must use HTTPS outside local development");
|
|
69
|
-
if (url.username !== "" || url.password !== "" || url.search !== "" || url.hash !== "") throw new Domain0ProtocolError("Domain0 baseUrl must not contain credentials, a query, or a fragment");
|
|
70
|
-
url.pathname = `${url.pathname.replace(/\/$/, "")}/`;
|
|
71
|
-
return url;
|
|
72
|
-
}
|
|
73
|
-
function parseApiKey(value) {
|
|
74
|
-
if (typeof value !== "string" || value.length < 8 || value.length > 8192 || !/^[A-Za-z0-9._~-]+$/.test(value)) throw new Domain0ProtocolError("Domain0 apiKey has an invalid format");
|
|
75
|
-
return value;
|
|
76
|
-
}
|
|
77
|
-
function isLoopback(hostname) {
|
|
78
|
-
return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]";
|
|
79
|
-
}
|
|
80
|
-
async function parseJson(response) {
|
|
81
|
-
if (!(response.headers.get("content-type") ?? "").toLowerCase().includes("application/json")) throw new Domain0ProtocolError(`Domain0 returned HTTP ${response.status} without an application/json content type`);
|
|
82
|
-
try {
|
|
83
|
-
return await response.json();
|
|
84
|
-
} catch (error) {
|
|
85
|
-
throw new Domain0ProtocolError(`Domain0 returned HTTP ${response.status} with invalid JSON`, error);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
//#endregion
|
|
89
|
-
export { AccessKeyCredentialsSchema, AccountTokenCredentialsSchema, AdvancedDmarcOptionsSchema, ApiTokenCredentialsSchema, ApplicationIdSchema, ApplyPlanInputSchema, AuthorizationMethodSchema, AuthorizeWithCredentialInputSchema, AwsSessionCredentialsSchema, CPanelCredentialsSchema, CancelConnectionInputSchema, ChangeActionSchema, ChangePlanSchema, CheckDomainInputSchema, CheckDomainResponseSchema, CheckRecordsInputSchema, CheckRecordsResponseSchema, CheckedRecordSchema, ClientCredentialsSchema, CommandIdSchema, CompiledProviderIdSchema, ConditionalDnsRecordsSchema, ConfirmPlanInputSchema, ConflictAnalysisSchema, ConflictPolicySchema, ConnectionFailureCodeSchema, ConnectionFailureSchema, ConnectionFlowIdSchema, ConnectionFlowResponseSchema, ConnectionFlowSchema, ConnectionFlowTargetInputSchema, ConnectionFlowTargetSchema, ConnectionIdSchema, ConnectionSchema, ConnectionStateSchema, CreateConnectionFlowInputSchema, CreateConnectionInputSchema, CreateConnectionResponseSchema, CreateSharedFlowInputSchema, CreateSharedFlowResponseSchema, DOMAIN0_WEBHOOK_HEADER_NAMES, DetectProviderResponseSchema, DkimDnsEvidenceSchema, DkimDnsEvidenceStatusSchema, DkimDnsRecordEvidenceSchema, DkimDnsRecordTypeSchema, DkimGuidanceInputSchema, DkimGuidanceResponseSchema, DkimSelectorSchema, DnsIntentSchema, DnsRecordSchema, DnsRecordTypeSchema, Domain0ApplicationNameSchema, Domain0ConnectCloseEventSchema, Domain0ConnectCloseReasonSchema, Domain0ConnectConfigurationSchema, Domain0ConnectEventSchema, Domain0ConnectStepChangeEventSchema, Domain0ConnectStepSchema, Domain0ConnectSuccessEventSchema, Domain0DkimGuidanceOptionsSchema, Domain0DkimSetupDocumentationClickEventSchema, Domain0Error, Domain0ErrorCodeSchema, Domain0ErrorResponseSchema, Domain0LocaleSchema, Domain0ManualSetupDocumentationClickEventSchema, Domain0ProtocolError, Domain0RequestCloseEventSchema, Domain0SetupPolicySchema, Domain0SharedFlowSentEventSchema, Domain0TransportError, Domain0WebhookAttributesSchema, Domain0WebhookEventIdSchema, Domain0WebhookEventSchema, Domain0WebhookEventTypeSchema, Domain0WebhookVerificationError, Domain0WebhookVerificationErrorCodeSchema, Domain0WhiteLabelCopySchema, Domain0WhiteLabelCustomPropertiesSchema, Domain0WhiteLabelLogoUrlSchema, Domain0WhiteLabelSchema, Domain0WhiteLabelThemeSchema, DomainConnectTemplateSchema, DomainDelegationStatusSchema, DomainNameSchema, DomainProviderCandidateSchema, DomainRecordConflictSchema, DomainSetupSupportSchema, EmailProviderDetectionStatusSchema, EmailProviderSchema, ExistingRecordPolicySchema, GetConnectionResponseSchema, IsoDateTimeSchema, IssueConnectionTokenInputSchema, IssueConnectionTokenResponseSchema, ListProvidersResponseSchema, ManualSetupDocumentationUrlSchema, OAuthCallbackResponseSchema, OvhCredentialsSchema, PlanWarningCodeSchema, PlannedChangeSchema, PlatformCreateConnectionInputSchema, PreparePlanInputSchema, PrivateKeyCredentialsSchema, ProviderCandidateSchema, ProviderCapabilitiesSchema, ProviderConformanceCheckNameSchema, ProviderConformanceEvidenceSchema, ProviderDetectionSchema, ProviderDetectionUnavailableReasonCodeSchema, ProviderHealthReasonSchema, ProviderHealthResponseSchema, ProviderHealthSchema, ProviderHealthStatusSchema, ProviderIdSchema, ProviderImplementationSchema, ProviderSchema, RecordConflictReasonSchema, ResolveSharedFlowInputSchema, ResolveSharedFlowResponseSchema, ResolvedDnsIntentSchema, ResolvedDnsRecordSchema, RetryConnectionInputSchema, RetryResumeStateSchema, SelectProviderInputSchema, SharedFlowIdSchema, SharedFlowInvitationSchema, SharedFlowInvitationUrlSchema, SharedFlowTokenSchema, SharedFlowUrlSchema, SpfConflictPolicySchema, StartDomainConnectInputSchema, StartDomainConnectResponseSchema, StartManualConfigurationInputSchema, StartOAuthInputSchema, StartOAuthResponseSchema, SubmitDomainConnectCompletionInputSchema, SubmitManualCompletionInputSchema, TenantIdSchema, UsernamePasswordCredentialsSchema, UsernameTokenCredentialsSchema, VerifiedProviderConformanceEvidenceSchema, VerifyPropagationInputSchema, colorContrastRatio, createDomain0, createDomain0Client, createDomain0PlatformClient, createSharedFlowUrl, directCredentialKindByProvider, domain0, domain0Locales, expectedProviderConformanceChecks, loadSharedFlow, verifyDomain0Webhook };
|
|
90
|
-
|
|
1
|
+
import{d as e,f as t,n,p as r,t as i}from"./sdk-BEFduVyo.mjs";import{AccessKeyCredentialsSchema as a,AccountTokenCredentialsSchema as o,AdvancedDmarcOptionsSchema as s,ApiTokenCredentialsSchema as c,ApplicationIdSchema as l,ApplyPlanInputSchema as u,AuthorizationMethodSchema as d,AuthorizeWithCredentialInputSchema as ee,AwsSessionCredentialsSchema as te,CPanelCredentialsSchema as ne,CancelConnectionInputSchema as re,ChangeActionSchema as ie,ChangePlanSchema as ae,CheckDomainInputSchema as oe,CheckDomainResponseSchema as se,CheckRecordsInputSchema as ce,CheckRecordsResponseSchema as le,CheckedRecordSchema as f,ClientCredentialsSchema as p,CommandIdSchema as m,CompiledProviderIdSchema as h,ConditionalDnsRecordsSchema as g,ConfirmPlanInputSchema as _,ConflictAnalysisSchema as v,ConflictPolicySchema as y,ConnectionFailureCodeSchema as b,ConnectionFailureSchema as x,ConnectionFlowIdSchema as S,ConnectionFlowResponseSchema as C,ConnectionFlowSchema as w,ConnectionFlowTargetInputSchema as T,ConnectionFlowTargetSchema as E,ConnectionIdSchema as D,ConnectionSchema as O,ConnectionStateSchema as k,CreateConnectionFlowInputSchema as A,CreateConnectionInputSchema as j,CreateConnectionResponseSchema as M,CreateSharedFlowInputSchema as N,CreateSharedFlowResponseSchema as P,DOMAIN0_WEBHOOK_HEADER_NAMES as F,DetectProviderResponseSchema as I,DkimDnsEvidenceSchema as L,DkimDnsEvidenceStatusSchema as R,DkimDnsRecordEvidenceSchema as z,DkimDnsRecordTypeSchema as B,DkimGuidanceInputSchema as V,DkimGuidanceResponseSchema as H,DkimSelectorSchema as U,DnsIntentSchema as W,DnsRecordSchema as ue,DnsRecordTypeSchema as de,Domain0ApplicationNameSchema as fe,Domain0ConnectCloseEventSchema as pe,Domain0ConnectCloseTriggerSchema as me,Domain0ConnectConfigurationSchema as he,Domain0ConnectErrorEventSchema as ge,Domain0ConnectErrorSchema as _e,Domain0ConnectEventSchema as ve,Domain0ConnectFailureEventSchema as ye,Domain0ConnectOutcomeSchema as be,Domain0ConnectStepChangeEventSchema as xe,Domain0ConnectStepSchema as Se,Domain0ConnectSuccessEventSchema as Ce,Domain0DkimGuidanceOptionsSchema as we,Domain0DkimSetupDocumentationClickEventSchema as Te,Domain0ErrorCodeSchema as Ee,Domain0ErrorResponseSchema as G,Domain0LocaleSchema as De,Domain0ManualSetupDocumentationClickEventSchema as Oe,Domain0RequestCloseEventSchema as ke,Domain0SetupPolicySchema as Ae,Domain0SharedFlowSentEventSchema as je,Domain0WebhookAttributesSchema as Me,Domain0WebhookEventIdSchema as Ne,Domain0WebhookEventSchema as Pe,Domain0WebhookEventTypeSchema as Fe,Domain0WebhookVerificationError as Ie,Domain0WebhookVerificationErrorCodeSchema as Le,Domain0WhiteLabelCopySchema as Re,Domain0WhiteLabelCustomPropertiesSchema as ze,Domain0WhiteLabelLogoUrlSchema as Be,Domain0WhiteLabelSchema as Ve,Domain0WhiteLabelThemeSchema as He,DomainConnectTemplateSchema as Ue,DomainDelegationStatusSchema as We,DomainNameSchema as Ge,DomainProviderCandidateSchema as Ke,DomainRecordConflictSchema as qe,DomainSetupSupportSchema as Je,EmailProviderDetectionStatusSchema as Ye,EmailProviderSchema as Xe,ExistingRecordPolicySchema as Ze,GetConnectionResponseSchema as K,IsoDateTimeSchema as Qe,IssueConnectionTokenInputSchema as q,IssueConnectionTokenResponseSchema as J,ListProvidersResponseSchema as $e,ManualSetupDocumentationUrlSchema as et,OAuthCallbackResponseSchema as tt,OvhCredentialsSchema as nt,PlanWarningCodeSchema as rt,PlannedChangeSchema as it,PlatformCreateConnectionInputSchema as Y,PreparePlanInputSchema as at,PrivateKeyCredentialsSchema as ot,ProviderCandidateSchema as st,ProviderCapabilitiesSchema as ct,ProviderConformanceCheckNameSchema as lt,ProviderConformanceEvidenceSchema as ut,ProviderDetectionSchema as dt,ProviderDetectionUnavailableReasonCodeSchema as ft,ProviderHealthReasonSchema as pt,ProviderHealthResponseSchema as mt,ProviderHealthSchema as ht,ProviderHealthStatusSchema as gt,ProviderIdSchema as _t,ProviderImplementationSchema as vt,ProviderSchema as yt,RecordConflictReasonSchema as bt,ResolveSharedFlowInputSchema as xt,ResolveSharedFlowResponseSchema as St,ResolvedDnsIntentSchema as Ct,ResolvedDnsRecordSchema as wt,RetryConnectionInputSchema as Tt,RetryResumeStateSchema as Et,SelectProviderInputSchema as Dt,SharedFlowIdSchema as Ot,SharedFlowInvitationSchema as kt,SharedFlowInvitationUrlSchema as At,SharedFlowTokenSchema as jt,SharedFlowUrlSchema as Mt,SpfConflictPolicySchema as Nt,StartDomainConnectInputSchema as Pt,StartDomainConnectResponseSchema as Ft,StartManualConfigurationInputSchema as It,StartOAuthInputSchema as Lt,StartOAuthResponseSchema as Rt,SubmitDomainConnectCompletionInputSchema as zt,SubmitManualCompletionInputSchema as Bt,TenantIdSchema as Vt,UsernamePasswordCredentialsSchema as Ht,UsernameTokenCredentialsSchema as Ut,VerifiedProviderConformanceEvidenceSchema as X,VerifyPropagationInputSchema as Wt,colorContrastRatio as Gt,directCredentialKindByProvider as Kt,domain0Locales as qt,expectedProviderConformanceChecks as Jt,verifyDomain0Webhook as Yt}from"./contracts.mjs";import{n as Z,r as Q,t as $}from"./error-szz6-UFL.mjs";function Xt(e){let t=Zt(e.baseUrl),n=e.fetch??globalThis.fetch;if(n===void 0)throw new Z(`No fetch implementation is available`);async function r(r,i,a){let o=Qt(typeof e.apiKey==`function`?await e.apiKey():e.apiKey),s;try{s=await n(new URL(r,t),{...i,headers:{accept:`application/json`,"x-api-key":o,...i.body===void 0?{}:{"content-type":`application/json`},...i.headers}})}catch(e){throw new Q(e)}let c=await en(s);if(!s.ok){let e=G.safeParse(c);throw e.success?new $(s.status,e.data):new Z(`Domain0 returned HTTP ${s.status} with an invalid error response`,e.error)}let l=a.safeParse(c);if(!l.success)throw new Z(`Domain0 returned HTTP ${s.status} with an invalid response`,l.error);return l.data}return{async createConnection(e){let t=Y.parse(e);return r(`v1/connections`,{method:`POST`,body:JSON.stringify(t)},M)},async getConnection(e){let t=D.parse(e);return r(`v1/connections/${encodeURIComponent(t)}`,{method:`GET`},K)},async issueConnectionToken(e,t){let n=D.parse(e),i=q.parse(t);return r(`v1/connections/${encodeURIComponent(n)}/access-token`,{method:`POST`,body:JSON.stringify(i)},J)}}}function Zt(e){let t;try{t=new URL(e)}catch(e){throw new Z(`Domain0 baseUrl must be an absolute URL`,e)}if(t.protocol!==`https:`&&!$t(t.hostname))throw new Z(`Domain0 baseUrl must use HTTPS outside local development`);if(t.username!==``||t.password!==``||t.search!==``||t.hash!==``)throw new Z(`Domain0 baseUrl must not contain credentials, a query, or a fragment`);return t.pathname=`${t.pathname.replace(/\/$/,``)}/`,t}function Qt(e){if(typeof e!=`string`||e.length<8||e.length>8192||!/^[A-Za-z0-9._~-]+$/.test(e))throw new Z(`Domain0 apiKey has an invalid format`);return e}function $t(e){return e===`localhost`||e===`127.0.0.1`||e===`[::1]`}async function en(e){if(!(e.headers.get(`content-type`)??``).toLowerCase().includes(`application/json`))throw new Z(`Domain0 returned HTTP ${e.status} without an application/json content type`);try{return await e.json()}catch(t){throw new Z(`Domain0 returned HTTP ${e.status} with invalid JSON`,t)}}export{a as AccessKeyCredentialsSchema,o as AccountTokenCredentialsSchema,s as AdvancedDmarcOptionsSchema,c as ApiTokenCredentialsSchema,l as ApplicationIdSchema,u as ApplyPlanInputSchema,d as AuthorizationMethodSchema,ee as AuthorizeWithCredentialInputSchema,te as AwsSessionCredentialsSchema,ne as CPanelCredentialsSchema,re as CancelConnectionInputSchema,ie as ChangeActionSchema,ae as ChangePlanSchema,oe as CheckDomainInputSchema,se as CheckDomainResponseSchema,ce as CheckRecordsInputSchema,le as CheckRecordsResponseSchema,f as CheckedRecordSchema,p as ClientCredentialsSchema,m as CommandIdSchema,h as CompiledProviderIdSchema,g as ConditionalDnsRecordsSchema,_ as ConfirmPlanInputSchema,v as ConflictAnalysisSchema,y as ConflictPolicySchema,b as ConnectionFailureCodeSchema,x as ConnectionFailureSchema,S as ConnectionFlowIdSchema,C as ConnectionFlowResponseSchema,w as ConnectionFlowSchema,T as ConnectionFlowTargetInputSchema,E as ConnectionFlowTargetSchema,D as ConnectionIdSchema,O as ConnectionSchema,k as ConnectionStateSchema,A as CreateConnectionFlowInputSchema,j as CreateConnectionInputSchema,M as CreateConnectionResponseSchema,N as CreateSharedFlowInputSchema,P as CreateSharedFlowResponseSchema,F as DOMAIN0_WEBHOOK_HEADER_NAMES,I as DetectProviderResponseSchema,L as DkimDnsEvidenceSchema,R as DkimDnsEvidenceStatusSchema,z as DkimDnsRecordEvidenceSchema,B as DkimDnsRecordTypeSchema,V as DkimGuidanceInputSchema,H as DkimGuidanceResponseSchema,U as DkimSelectorSchema,W as DnsIntentSchema,ue as DnsRecordSchema,de as DnsRecordTypeSchema,fe as Domain0ApplicationNameSchema,pe as Domain0ConnectCloseEventSchema,me as Domain0ConnectCloseTriggerSchema,he as Domain0ConnectConfigurationSchema,ge as Domain0ConnectErrorEventSchema,_e as Domain0ConnectErrorSchema,ve as Domain0ConnectEventSchema,ye as Domain0ConnectFailureEventSchema,be as Domain0ConnectOutcomeSchema,xe as Domain0ConnectStepChangeEventSchema,Se as Domain0ConnectStepSchema,Ce as Domain0ConnectSuccessEventSchema,we as Domain0DkimGuidanceOptionsSchema,Te as Domain0DkimSetupDocumentationClickEventSchema,$ as Domain0Error,Ee as Domain0ErrorCodeSchema,G as Domain0ErrorResponseSchema,De as Domain0LocaleSchema,Oe as Domain0ManualSetupDocumentationClickEventSchema,Z as Domain0ProtocolError,ke as Domain0RequestCloseEventSchema,Ae as Domain0SetupPolicySchema,je as Domain0SharedFlowSentEventSchema,Q as Domain0TransportError,Me as Domain0WebhookAttributesSchema,Ne as Domain0WebhookEventIdSchema,Pe as Domain0WebhookEventSchema,Fe as Domain0WebhookEventTypeSchema,Ie as Domain0WebhookVerificationError,Le as Domain0WebhookVerificationErrorCodeSchema,Re as Domain0WhiteLabelCopySchema,ze as Domain0WhiteLabelCustomPropertiesSchema,Be as Domain0WhiteLabelLogoUrlSchema,Ve as Domain0WhiteLabelSchema,He as Domain0WhiteLabelThemeSchema,Ue as DomainConnectTemplateSchema,We as DomainDelegationStatusSchema,Ge as DomainNameSchema,Ke as DomainProviderCandidateSchema,qe as DomainRecordConflictSchema,Je as DomainSetupSupportSchema,Ye as EmailProviderDetectionStatusSchema,Xe as EmailProviderSchema,Ze as ExistingRecordPolicySchema,K as GetConnectionResponseSchema,Qe as IsoDateTimeSchema,q as IssueConnectionTokenInputSchema,J as IssueConnectionTokenResponseSchema,$e as ListProvidersResponseSchema,et as ManualSetupDocumentationUrlSchema,tt as OAuthCallbackResponseSchema,nt as OvhCredentialsSchema,rt as PlanWarningCodeSchema,it as PlannedChangeSchema,Y as PlatformCreateConnectionInputSchema,at as PreparePlanInputSchema,ot as PrivateKeyCredentialsSchema,st as ProviderCandidateSchema,ct as ProviderCapabilitiesSchema,lt as ProviderConformanceCheckNameSchema,ut as ProviderConformanceEvidenceSchema,dt as ProviderDetectionSchema,ft as ProviderDetectionUnavailableReasonCodeSchema,pt as ProviderHealthReasonSchema,mt as ProviderHealthResponseSchema,ht as ProviderHealthSchema,gt as ProviderHealthStatusSchema,_t as ProviderIdSchema,vt as ProviderImplementationSchema,yt as ProviderSchema,bt as RecordConflictReasonSchema,xt as ResolveSharedFlowInputSchema,St as ResolveSharedFlowResponseSchema,Ct as ResolvedDnsIntentSchema,wt as ResolvedDnsRecordSchema,Tt as RetryConnectionInputSchema,Et as RetryResumeStateSchema,Dt as SelectProviderInputSchema,Ot as SharedFlowIdSchema,kt as SharedFlowInvitationSchema,At as SharedFlowInvitationUrlSchema,jt as SharedFlowTokenSchema,Mt as SharedFlowUrlSchema,Nt as SpfConflictPolicySchema,Pt as StartDomainConnectInputSchema,Ft as StartDomainConnectResponseSchema,It as StartManualConfigurationInputSchema,Lt as StartOAuthInputSchema,Rt as StartOAuthResponseSchema,zt as SubmitDomainConnectCompletionInputSchema,Bt as SubmitManualCompletionInputSchema,Vt as TenantIdSchema,Ht as UsernamePasswordCredentialsSchema,Ut as UsernameTokenCredentialsSchema,X as VerifiedProviderConformanceEvidenceSchema,Wt as VerifyPropagationInputSchema,Gt as colorContrastRatio,i as createDomain0,e as createDomain0Client,Xt as createDomain0PlatformClient,t as createSharedFlowUrl,Kt as directCredentialKindByProvider,n as domain0,qt as domain0Locales,Jt as expectedProviderConformanceChecks,r as loadSharedFlow,Yt as verifyDomain0Webhook};
|
|
91
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/client/platform-client.ts"],"sourcesContent":["import type { ZodType } from 'zod'\n\nimport {\n ConnectionIdSchema,\n CreateConnectionResponseSchema,\n Domain0ErrorResponseSchema,\n GetConnectionResponseSchema,\n IssueConnectionTokenInputSchema,\n IssueConnectionTokenResponseSchema,\n PlatformCreateConnectionInputSchema,\n} from '../contracts'\nimport type {\n ConnectionId,\n CreateConnectionResponse,\n GetConnectionResponse,\n IssueConnectionTokenInput,\n IssueConnectionTokenResponse,\n PlatformCreateConnectionInput,\n} from '../contracts'\nimport { Domain0Error, Domain0ProtocolError, Domain0TransportError } from './error'\n\nexport interface Domain0PlatformClientOptions {\n /** Public platform API root, for example https://domain0.dev/api/domain0/. */\n baseUrl: string\n /** Server-side API key. Never expose this value to browser code. */\n apiKey: string | (() => string | Promise<string>)\n fetch?: typeof globalThis.fetch\n}\n\nexport interface Domain0PlatformClient {\n createConnection(input: PlatformCreateConnectionInput): Promise<CreateConnectionResponse>\n getConnection(connectionId: ConnectionId): Promise<GetConnectionResponse>\n issueConnectionToken(\n connectionId: ConnectionId,\n input: IssueConnectionTokenInput,\n ): Promise<IssueConnectionTokenResponse>\n}\n\n/**\n * Creates the server-only client for Domain0's hosted platform boundary.\n * The platform derives application and tenant ownership from the API key.\n */\nexport function createDomain0PlatformClient(\n options: Domain0PlatformClientOptions,\n): Domain0PlatformClient {\n const baseUrl = parseBaseUrl(options.baseUrl)\n const fetchImplementation = options.fetch ?? globalThis.fetch\n if (fetchImplementation === undefined) {\n throw new Domain0ProtocolError('No fetch implementation is available')\n }\n\n async function request<TResponse>(\n path: string,\n init: RequestInit,\n responseSchema: ZodType<TResponse>,\n ): Promise<TResponse> {\n const apiKey = parseApiKey(\n typeof options.apiKey === 'function' ? await options.apiKey() : options.apiKey,\n )\n\n let response: Response\n try {\n response = await fetchImplementation(new URL(path, baseUrl), {\n ...init,\n headers: {\n accept: 'application/json',\n 'x-api-key': apiKey,\n ...(init.body === undefined ? {} : { 'content-type': 'application/json' }),\n ...init.headers,\n },\n })\n } catch (cause) {\n throw new Domain0TransportError(cause)\n }\n\n const body = await parseJson(response)\n if (!response.ok) {\n const parsedError = Domain0ErrorResponseSchema.safeParse(body)\n if (!parsedError.success) {\n throw new Domain0ProtocolError(\n `Domain0 returned HTTP ${response.status} with an invalid error response`,\n parsedError.error,\n )\n }\n throw new Domain0Error(response.status, parsedError.data)\n }\n\n const parsedResponse = responseSchema.safeParse(body)\n if (!parsedResponse.success) {\n throw new Domain0ProtocolError(\n `Domain0 returned HTTP ${response.status} with an invalid response`,\n parsedResponse.error,\n )\n }\n return parsedResponse.data\n }\n\n return {\n async createConnection(input) {\n const body = PlatformCreateConnectionInputSchema.parse(input)\n return request(\n 'v1/connections',\n { method: 'POST', body: JSON.stringify(body) },\n CreateConnectionResponseSchema,\n )\n },\n async getConnection(connectionId) {\n const id = ConnectionIdSchema.parse(connectionId)\n return request(\n `v1/connections/${encodeURIComponent(id)}`,\n { method: 'GET' },\n GetConnectionResponseSchema,\n )\n },\n async issueConnectionToken(connectionId, input) {\n const id = ConnectionIdSchema.parse(connectionId)\n const body = IssueConnectionTokenInputSchema.parse(input)\n return request(\n `v1/connections/${encodeURIComponent(id)}/access-token`,\n { method: 'POST', body: JSON.stringify(body) },\n IssueConnectionTokenResponseSchema,\n )\n },\n }\n}\n\nfunction parseBaseUrl(value: string): URL {\n let url: URL\n try {\n url = new URL(value)\n } catch (error) {\n throw new Domain0ProtocolError('Domain0 baseUrl must be an absolute URL', error)\n }\n if (url.protocol !== 'https:' && !isLoopback(url.hostname)) {\n throw new Domain0ProtocolError('Domain0 baseUrl must use HTTPS outside local development')\n }\n if (url.username !== '' || url.password !== '' || url.search !== '' || url.hash !== '') {\n throw new Domain0ProtocolError(\n 'Domain0 baseUrl must not contain credentials, a query, or a fragment',\n )\n }\n url.pathname = `${url.pathname.replace(/\\/$/, '')}/`\n return url\n}\n\nfunction parseApiKey(value: unknown): string {\n if (\n typeof value !== 'string' ||\n value.length < 8 ||\n value.length > 8192 ||\n !/^[A-Za-z0-9._~-]+$/.test(value)\n ) {\n throw new Domain0ProtocolError('Domain0 apiKey has an invalid format')\n }\n return value\n}\n\nfunction isLoopback(hostname: string): boolean {\n return hostname === 'localhost' || hostname === '127.0.0.1' || hostname === '[::1]'\n}\n\nasync function parseJson(response: Response): Promise<unknown> {\n const contentType = response.headers.get('content-type') ?? ''\n if (!contentType.toLowerCase().includes('application/json')) {\n throw new Domain0ProtocolError(\n `Domain0 returned HTTP ${response.status} without an application/json content type`,\n )\n }\n try {\n return await response.json()\n } catch (error) {\n throw new Domain0ProtocolError(\n `Domain0 returned HTTP ${response.status} with invalid JSON`,\n error,\n )\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/client/platform-client.ts"],"sourcesContent":["import type { ZodType } from 'zod'\n\nimport {\n ConnectionIdSchema,\n CreateConnectionResponseSchema,\n Domain0ErrorResponseSchema,\n GetConnectionResponseSchema,\n IssueConnectionTokenInputSchema,\n IssueConnectionTokenResponseSchema,\n PlatformCreateConnectionInputSchema,\n} from '../contracts'\nimport type {\n ConnectionId,\n CreateConnectionResponse,\n GetConnectionResponse,\n IssueConnectionTokenInput,\n IssueConnectionTokenResponse,\n PlatformCreateConnectionInput,\n} from '../contracts'\nimport { Domain0Error, Domain0ProtocolError, Domain0TransportError } from './error'\n\nexport interface Domain0PlatformClientOptions {\n /** Public platform API root, for example https://domain0.dev/api/domain0/. */\n baseUrl: string\n /** Server-side API key. Never expose this value to browser code. */\n apiKey: string | (() => string | Promise<string>)\n fetch?: typeof globalThis.fetch\n}\n\nexport interface Domain0PlatformClient {\n createConnection(input: PlatformCreateConnectionInput): Promise<CreateConnectionResponse>\n getConnection(connectionId: ConnectionId): Promise<GetConnectionResponse>\n issueConnectionToken(\n connectionId: ConnectionId,\n input: IssueConnectionTokenInput,\n ): Promise<IssueConnectionTokenResponse>\n}\n\n/**\n * Creates the server-only client for Domain0's hosted platform boundary.\n * The platform derives application and tenant ownership from the API key.\n */\nexport function createDomain0PlatformClient(\n options: Domain0PlatformClientOptions,\n): Domain0PlatformClient {\n const baseUrl = parseBaseUrl(options.baseUrl)\n const fetchImplementation = options.fetch ?? globalThis.fetch\n if (fetchImplementation === undefined) {\n throw new Domain0ProtocolError('No fetch implementation is available')\n }\n\n async function request<TResponse>(\n path: string,\n init: RequestInit,\n responseSchema: ZodType<TResponse>,\n ): Promise<TResponse> {\n const apiKey = parseApiKey(\n typeof options.apiKey === 'function' ? await options.apiKey() : options.apiKey,\n )\n\n let response: Response\n try {\n response = await fetchImplementation(new URL(path, baseUrl), {\n ...init,\n headers: {\n accept: 'application/json',\n 'x-api-key': apiKey,\n ...(init.body === undefined ? {} : { 'content-type': 'application/json' }),\n ...init.headers,\n },\n })\n } catch (cause) {\n throw new Domain0TransportError(cause)\n }\n\n const body = await parseJson(response)\n if (!response.ok) {\n const parsedError = Domain0ErrorResponseSchema.safeParse(body)\n if (!parsedError.success) {\n throw new Domain0ProtocolError(\n `Domain0 returned HTTP ${response.status} with an invalid error response`,\n parsedError.error,\n )\n }\n throw new Domain0Error(response.status, parsedError.data)\n }\n\n const parsedResponse = responseSchema.safeParse(body)\n if (!parsedResponse.success) {\n throw new Domain0ProtocolError(\n `Domain0 returned HTTP ${response.status} with an invalid response`,\n parsedResponse.error,\n )\n }\n return parsedResponse.data\n }\n\n return {\n async createConnection(input) {\n const body = PlatformCreateConnectionInputSchema.parse(input)\n return request(\n 'v1/connections',\n { method: 'POST', body: JSON.stringify(body) },\n CreateConnectionResponseSchema,\n )\n },\n async getConnection(connectionId) {\n const id = ConnectionIdSchema.parse(connectionId)\n return request(\n `v1/connections/${encodeURIComponent(id)}`,\n { method: 'GET' },\n GetConnectionResponseSchema,\n )\n },\n async issueConnectionToken(connectionId, input) {\n const id = ConnectionIdSchema.parse(connectionId)\n const body = IssueConnectionTokenInputSchema.parse(input)\n return request(\n `v1/connections/${encodeURIComponent(id)}/access-token`,\n { method: 'POST', body: JSON.stringify(body) },\n IssueConnectionTokenResponseSchema,\n )\n },\n }\n}\n\nfunction parseBaseUrl(value: string): URL {\n let url: URL\n try {\n url = new URL(value)\n } catch (error) {\n throw new Domain0ProtocolError('Domain0 baseUrl must be an absolute URL', error)\n }\n if (url.protocol !== 'https:' && !isLoopback(url.hostname)) {\n throw new Domain0ProtocolError('Domain0 baseUrl must use HTTPS outside local development')\n }\n if (url.username !== '' || url.password !== '' || url.search !== '' || url.hash !== '') {\n throw new Domain0ProtocolError(\n 'Domain0 baseUrl must not contain credentials, a query, or a fragment',\n )\n }\n url.pathname = `${url.pathname.replace(/\\/$/, '')}/`\n return url\n}\n\nfunction parseApiKey(value: unknown): string {\n if (\n typeof value !== 'string' ||\n value.length < 8 ||\n value.length > 8192 ||\n !/^[A-Za-z0-9._~-]+$/.test(value)\n ) {\n throw new Domain0ProtocolError('Domain0 apiKey has an invalid format')\n }\n return value\n}\n\nfunction isLoopback(hostname: string): boolean {\n return hostname === 'localhost' || hostname === '127.0.0.1' || hostname === '[::1]'\n}\n\nasync function parseJson(response: Response): Promise<unknown> {\n const contentType = response.headers.get('content-type') ?? ''\n if (!contentType.toLowerCase().includes('application/json')) {\n throw new Domain0ProtocolError(\n `Domain0 returned HTTP ${response.status} without an application/json content type`,\n )\n }\n try {\n return await response.json()\n } catch (error) {\n throw new Domain0ProtocolError(\n `Domain0 returned HTTP ${response.status} with invalid JSON`,\n error,\n )\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { At as ConnectionId, B as ResolveSharedFlowResponse, Ci as Connection, Dr as Domain0ConnectEvent, E as Domain0WhiteLabelInput, Fi as DetectProviderResponse, G as SharedFlowInvitationInput, Gi as IssueConnectionTokenResponse, Gr as Domain0SharedFlowSentEvent$1, I as CreateSharedFlowResponse, Jt as Domain0ErrorResponse, Ln as CheckRecordsInput, Lr as Domain0ConnectSuccessEvent$1, Ni as CreateConnectionResponse, Nr as Domain0ConnectStep$1, P as CreateSharedFlowInput, Pr as Domain0ConnectStepChangeEvent$1, Qi as PreparePlanInput, Qr as ConnectionFlowResponse, Qt as CheckDomainResponse, Sn as DkimGuidanceResponse, Ta as VerifyPropagationInput, Ui as IssueConnectionTokenInput, Ur as Domain0RequestCloseEvent$1, Ut as Domain0Locale, Vi as GetConnectionResponse, Vr as Domain0ManualSetupDocumentationClickEvent$1, Vt as ManualSetupDocumentationUrlInput, Xr as ConnectionFlowId, Xt as CheckDomainInput, Yr as ConnectionFlow, Z as SharedFlowUrl, _a as StartOAuthResponse, ai as CreateConnectionFlowInput, bn as DkimGuidanceInput, da as StartDomainConnectResponse, et as Domain0SetupPolicyInput, fi as AuthorizeWithCredentialInput, gi as CancelConnectionInput, ha as StartOAuthInput, ji as CreateConnectionInput, kr as Domain0ConnectFailureEvent$1, la as StartDomainConnectInput, nt as PlatformCreateConnectionInput, ot as ListProvidersResponse, pa as StartManualConfigurationInput, q as SharedFlowInvitationUrl, ra as RetryConnectionInput, sa as SelectProviderInput, ui as ApplyPlanInput, vt as ProviderHealthResponse, wn as DkimSelector, wr as Domain0ConnectErrorEvent$1, xa as SubmitManualCompletionInput, xi as ConfirmPlanInput, xr as Domain0ConnectCloseTrigger$1, ya as SubmitDomainConnectCompletionInput, yr as Domain0ConnectCloseEvent$1, zi as DomainConnectTemplate, zn as CheckRecordsResponse, zr as Domain0DkimSetupDocumentationClickEvent$1 } from "./index-Cw7qOvHn.cjs";
|
|
2
2
|
//#region src/client/client.d.ts
|
|
3
3
|
interface Domain0ClientOptions {
|
|
4
4
|
baseUrl: string;
|
|
@@ -84,9 +84,11 @@ type EventPayload<TEvent extends {
|
|
|
84
84
|
readonly type: string;
|
|
85
85
|
}> = Omit<TEvent, 'type'>;
|
|
86
86
|
type Domain0ConnectStep = Domain0ConnectStep$1;
|
|
87
|
-
type
|
|
87
|
+
type Domain0ConnectCloseTrigger = Domain0ConnectCloseTrigger$1;
|
|
88
88
|
type Domain0ActiveConnection = Domain0ConnectSuccessEvent$1['connection'];
|
|
89
89
|
type Domain0ConnectSuccessEvent = EventPayload<Domain0ConnectSuccessEvent$1>;
|
|
90
|
+
type Domain0ConnectFailureEvent = EventPayload<Domain0ConnectFailureEvent$1>;
|
|
91
|
+
type Domain0ConnectErrorEvent = EventPayload<Domain0ConnectErrorEvent$1>;
|
|
90
92
|
type Domain0ConnectCloseEvent = EventPayload<Domain0ConnectCloseEvent$1>;
|
|
91
93
|
type Domain0ConnectStepChangeEvent = EventPayload<Domain0ConnectStepChangeEvent$1>;
|
|
92
94
|
type Domain0ManualSetupDocumentationClickEvent = EventPayload<Domain0ManualSetupDocumentationClickEvent$1>;
|
|
@@ -107,11 +109,6 @@ interface Domain0ConnectOptions {
|
|
|
107
109
|
applicationName?: string;
|
|
108
110
|
triggerLabel?: string;
|
|
109
111
|
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
112
|
presentation?: 'modal' | 'inline';
|
|
116
113
|
locale?: Domain0Locale;
|
|
117
114
|
whiteLabel?: Domain0WhiteLabelInput;
|
|
@@ -124,6 +121,8 @@ interface Domain0ConnectOptions {
|
|
|
124
121
|
onConnectionChange?: (connection: Connection) => void;
|
|
125
122
|
onEvent?: (event: Domain0ConnectEvent) => void;
|
|
126
123
|
onSuccess?: (event: Domain0ConnectSuccessEvent) => void;
|
|
124
|
+
onFailure?: (event: Domain0ConnectFailureEvent) => void;
|
|
125
|
+
onError?: (event: Domain0ConnectErrorEvent) => void;
|
|
127
126
|
onClose?: (event: Domain0ConnectCloseEvent) => void;
|
|
128
127
|
onStepChange?: (event: Domain0ConnectStepChangeEvent) => void;
|
|
129
128
|
onManualSetupDocumentationClick?: (event: Domain0ManualSetupDocumentationClickEvent) => void;
|
|
@@ -192,5 +191,5 @@ interface Domain0SDK {
|
|
|
192
191
|
declare function createDomain0(): Domain0SDK;
|
|
193
192
|
declare const domain0: Domain0SDK;
|
|
194
193
|
//#endregion
|
|
195
|
-
export {
|
|
196
|
-
//# sourceMappingURL=sdk-
|
|
194
|
+
export { Domain0PlatformClientOptions as A, createSharedFlowUrl as B, Domain0DkimSetupDocumentationClickEvent as C, Domain0SharedFlowSentEvent as D, Domain0SharedFlowGateway as E, Domain0Client as F, Domain0ClientOptions as I, LoadSharedFlowOptions as L, Domain0Error as M, Domain0ProtocolError as N, mountDomain0Connect as O, Domain0TransportError as P, LoadedSharedFlow as R, Domain0CreateSharedFlowRequest as S, Domain0RequestCloseEvent as T, loadSharedFlow as V, Domain0ConnectFailureEvent as _, createDomain0 as a, Domain0ConnectStepChangeEvent as b, mountDomain0SharedFlow as c, mountDomain0ConnectionFlow as d, Domain0ActiveConnection as f, Domain0ConnectErrorEvent as g, Domain0ConnectController as h, Domain0SDK as i, createDomain0PlatformClient as j, Domain0PlatformClient as k, Domain0ConnectionFlowController as l, Domain0ConnectCloseTrigger as m, Domain0ConnectDomainsOptions as n, domain0 as o, Domain0ConnectCloseEvent as p, Domain0LoadSharedFlowOptions as r, Domain0SharedFlowOptions as s, Domain0ConnectDomainOptions as t, Domain0ConnectionFlowOptions as u, Domain0ConnectOptions as v, Domain0ManualSetupDocumentationClickEvent as w, Domain0ConnectSuccessEvent as x, Domain0ConnectStep as y, createDomain0Client as z };
|
|
195
|
+
//# sourceMappingURL=sdk-BCgyva16.d.cts.map
|