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.
- package/README.md +629 -0
- package/dist/contracts.cjs +1773 -0
- package/dist/contracts.cjs.map +1 -0
- package/dist/contracts.d.cts +2 -0
- package/dist/contracts.d.mts +2 -0
- package/dist/contracts.mjs +1627 -0
- package/dist/contracts.mjs.map +1 -0
- package/dist/error-BB4-lyc4.cjs +48 -0
- package/dist/error-BB4-lyc4.cjs.map +1 -0
- package/dist/error-Cyd6a9ay.mjs +31 -0
- package/dist/error-Cyd6a9ay.mjs.map +1 -0
- package/dist/index-CtQn01os.d.cts +6930 -0
- package/dist/index-CtQn01os.d.mts +6930 -0
- package/dist/index.cjs +246 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.mjs +91 -0
- package/dist/index.mjs.map +1 -0
- package/dist/sdk-7CglngBt.d.mts +196 -0
- package/dist/sdk-BHIxsxUT.mjs +3997 -0
- package/dist/sdk-BHIxsxUT.mjs.map +1 -0
- package/dist/sdk-BKtsupNk.d.cts +196 -0
- package/dist/sdk-C0q5dV-6.cjs +4074 -0
- package/dist/sdk-C0q5dV-6.cjs.map +1 -0
- package/dist/server.cjs +103 -0
- package/dist/server.cjs.map +1 -0
- package/dist/server.d.cts +19 -0
- package/dist/server.d.mts +19 -0
- package/dist/server.mjs +102 -0
- package/dist/server.mjs.map +1 -0
- package/dist/ui.cjs +12 -0
- package/dist/ui.d.cts +286 -0
- package/dist/ui.d.mts +286 -0
- package/dist/ui.mjs +2 -0
- package/package.json +112 -0
package/dist/server.cjs
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_contracts = require("./contracts.cjs");
|
|
3
|
+
const require_error = require("./error-BB4-lyc4.cjs");
|
|
4
|
+
//#region src/server/connection-proxy.ts
|
|
5
|
+
const connectionIdPattern = /^[A-Za-z0-9_-]{1,200}$/;
|
|
6
|
+
const connectionActions = /* @__PURE__ */ new Set([
|
|
7
|
+
"cancellation",
|
|
8
|
+
"change-application",
|
|
9
|
+
"change-plan",
|
|
10
|
+
"credential-authorization",
|
|
11
|
+
"dkim-guidance",
|
|
12
|
+
"domain-connect-completion",
|
|
13
|
+
"domain-connect-handoff",
|
|
14
|
+
"manual-completion",
|
|
15
|
+
"manual-configuration",
|
|
16
|
+
"oauth-authorization",
|
|
17
|
+
"plan-confirmation",
|
|
18
|
+
"propagation-verification",
|
|
19
|
+
"provider-detection",
|
|
20
|
+
"provider-selection",
|
|
21
|
+
"retry"
|
|
22
|
+
]);
|
|
23
|
+
const maximumBodyBytes = 1048576;
|
|
24
|
+
/**
|
|
25
|
+
* Forwards only the browser-safe connection routes used by Domain0 Connect.
|
|
26
|
+
* Cookies, API keys, and unrelated headers are never forwarded.
|
|
27
|
+
*/
|
|
28
|
+
async function forwardDomain0ConnectionRequest(options) {
|
|
29
|
+
const method = options.request.method.toUpperCase();
|
|
30
|
+
if (!isAllowedPath(method, options.path)) return jsonError(404, "This route is not exposed by the connection bridge.");
|
|
31
|
+
const authorization = options.request.headers.get("authorization");
|
|
32
|
+
if (authorization === null || authorization.length > 8200 || !/^Bearer [A-Za-z0-9._~+\/-]+=*$/.test(authorization)) return jsonError(401, "A valid connection token is required.");
|
|
33
|
+
const originResult = require_contracts.IssueConnectionTokenInputSchema.safeParse({ origin: options.origin ?? new URL(options.request.url).origin });
|
|
34
|
+
if (!originResult.success) throw new require_error.Domain0ProtocolError("The connection bridge origin is invalid", originResult.error);
|
|
35
|
+
const upstreamBaseUrl = parseBaseUrl(options.upstreamBaseUrl);
|
|
36
|
+
const fetchImplementation = options.fetch ?? globalThis.fetch;
|
|
37
|
+
if (fetchImplementation === void 0) throw new require_error.Domain0ProtocolError("No fetch implementation is available");
|
|
38
|
+
let body;
|
|
39
|
+
if (method === "POST") {
|
|
40
|
+
const contentLength = Number(options.request.headers.get("content-length") ?? 0);
|
|
41
|
+
if (Number.isFinite(contentLength) && contentLength > maximumBodyBytes) return jsonError(413, "The request body is too large.");
|
|
42
|
+
const bytes = await options.request.arrayBuffer();
|
|
43
|
+
if (bytes.byteLength > maximumBodyBytes) return jsonError(413, "The request body is too large.");
|
|
44
|
+
body = bytes;
|
|
45
|
+
}
|
|
46
|
+
let upstream;
|
|
47
|
+
try {
|
|
48
|
+
upstream = await fetchImplementation(new URL(options.path.map(encodeURIComponent).join("/"), upstreamBaseUrl), {
|
|
49
|
+
method,
|
|
50
|
+
headers: {
|
|
51
|
+
accept: "application/json",
|
|
52
|
+
authorization,
|
|
53
|
+
origin: originResult.data.origin,
|
|
54
|
+
...body === void 0 ? {} : { "content-type": "application/json" }
|
|
55
|
+
},
|
|
56
|
+
...body === void 0 ? {} : { body },
|
|
57
|
+
cache: "no-store"
|
|
58
|
+
});
|
|
59
|
+
} catch (cause) {
|
|
60
|
+
throw new require_error.Domain0TransportError(cause);
|
|
61
|
+
}
|
|
62
|
+
return new Response(upstream.body, {
|
|
63
|
+
status: upstream.status,
|
|
64
|
+
headers: {
|
|
65
|
+
"cache-control": "no-store",
|
|
66
|
+
"content-type": upstream.headers.get("content-type") ?? "application/json"
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function isAllowedPath(method, path) {
|
|
71
|
+
if (method === "GET" && path[0] === "v1" && path[1] === "providers" && (path.length === 2 || path.length === 3 && path[2] === "health")) return true;
|
|
72
|
+
if (path[0] !== "v1" || path[1] !== "connections" || path[2] === void 0 || !connectionIdPattern.test(path[2])) return false;
|
|
73
|
+
if (method === "GET") return path.length === 3;
|
|
74
|
+
return method === "POST" && path.length === 4 && path[3] !== void 0 && connectionActions.has(path[3]);
|
|
75
|
+
}
|
|
76
|
+
function parseBaseUrl(value) {
|
|
77
|
+
let url;
|
|
78
|
+
try {
|
|
79
|
+
url = new URL(value);
|
|
80
|
+
} catch (error) {
|
|
81
|
+
throw new require_error.Domain0ProtocolError("Domain0 upstreamBaseUrl must be an absolute URL", error);
|
|
82
|
+
}
|
|
83
|
+
if (url.protocol !== "https:" && !isLoopback(url.hostname)) throw new require_error.Domain0ProtocolError("Domain0 upstreamBaseUrl must use HTTPS outside local development");
|
|
84
|
+
if (url.username !== "" || url.password !== "" || url.search !== "" || url.hash !== "") throw new require_error.Domain0ProtocolError("Domain0 upstreamBaseUrl must not contain credentials, a query, or a fragment");
|
|
85
|
+
url.pathname = `${url.pathname.replace(/\/$/, "")}/`;
|
|
86
|
+
return url;
|
|
87
|
+
}
|
|
88
|
+
function isLoopback(hostname) {
|
|
89
|
+
return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]";
|
|
90
|
+
}
|
|
91
|
+
function jsonError(status, message) {
|
|
92
|
+
return Response.json({ error: {
|
|
93
|
+
code: status === 401 ? "unauthorized" : "invalid_request",
|
|
94
|
+
message
|
|
95
|
+
} }, {
|
|
96
|
+
status,
|
|
97
|
+
headers: { "cache-control": "no-store" }
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
exports.forwardDomain0ConnectionRequest = forwardDomain0ConnectionRequest;
|
|
102
|
+
|
|
103
|
+
//# sourceMappingURL=server.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.cjs","names":["IssueConnectionTokenInputSchema","Domain0ProtocolError","Domain0TransportError"],"sources":["../src/server/connection-proxy.ts"],"sourcesContent":["import { IssueConnectionTokenInputSchema } from '../contracts'\nimport { Domain0ProtocolError, Domain0TransportError } from '../client/error'\n\nconst connectionIdPattern = /^[A-Za-z0-9_-]{1,200}$/\nconst connectionActions = new Set([\n 'cancellation',\n 'change-application',\n 'change-plan',\n 'credential-authorization',\n 'dkim-guidance',\n 'domain-connect-completion',\n 'domain-connect-handoff',\n 'manual-completion',\n 'manual-configuration',\n 'oauth-authorization',\n 'plan-confirmation',\n 'propagation-verification',\n 'provider-detection',\n 'provider-selection',\n 'retry',\n])\nconst maximumBodyBytes = 1_048_576\n\nexport interface ForwardDomain0ConnectionRequestOptions {\n request: Request\n /** Catch-all route segments after the same-origin Domain0 bridge. */\n path: readonly string[]\n /** Hosted Domain0 platform API root. */\n upstreamBaseUrl: string\n /** Exact public origin that received the browser request. */\n origin?: string\n fetch?: typeof globalThis.fetch\n}\n\n/**\n * Forwards only the browser-safe connection routes used by Domain0 Connect.\n * Cookies, API keys, and unrelated headers are never forwarded.\n */\nexport async function forwardDomain0ConnectionRequest(\n options: ForwardDomain0ConnectionRequestOptions,\n): Promise<Response> {\n const method = options.request.method.toUpperCase()\n if (!isAllowedPath(method, options.path)) {\n return jsonError(404, 'This route is not exposed by the connection bridge.')\n }\n\n const authorization = options.request.headers.get('authorization')\n if (\n authorization === null ||\n authorization.length > 8200 ||\n !/^Bearer [A-Za-z0-9._~+\\/-]+=*$/.test(authorization)\n ) {\n return jsonError(401, 'A valid connection token is required.')\n }\n\n const originResult = IssueConnectionTokenInputSchema.safeParse({\n origin: options.origin ?? new URL(options.request.url).origin,\n })\n if (!originResult.success) {\n throw new Domain0ProtocolError('The connection bridge origin is invalid', originResult.error)\n }\n\n const upstreamBaseUrl = parseBaseUrl(options.upstreamBaseUrl)\n const fetchImplementation = options.fetch ?? globalThis.fetch\n if (fetchImplementation === undefined) {\n throw new Domain0ProtocolError('No fetch implementation is available')\n }\n\n let body: ArrayBuffer | undefined\n if (method === 'POST') {\n const contentLength = Number(options.request.headers.get('content-length') ?? 0)\n if (Number.isFinite(contentLength) && contentLength > maximumBodyBytes) {\n return jsonError(413, 'The request body is too large.')\n }\n const bytes = await options.request.arrayBuffer()\n if (bytes.byteLength > maximumBodyBytes) {\n return jsonError(413, 'The request body is too large.')\n }\n body = bytes\n }\n\n let upstream: Response\n try {\n upstream = await fetchImplementation(\n new URL(options.path.map(encodeURIComponent).join('/'), upstreamBaseUrl),\n {\n method,\n headers: {\n accept: 'application/json',\n authorization,\n origin: originResult.data.origin,\n ...(body === undefined ? {} : { 'content-type': 'application/json' }),\n },\n ...(body === undefined ? {} : { body }),\n cache: 'no-store',\n },\n )\n } catch (cause) {\n throw new Domain0TransportError(cause)\n }\n\n return new Response(upstream.body, {\n status: upstream.status,\n headers: {\n 'cache-control': 'no-store',\n 'content-type': upstream.headers.get('content-type') ?? 'application/json',\n },\n })\n}\n\nfunction isAllowedPath(method: string, path: readonly string[]): boolean {\n if (\n method === 'GET' &&\n path[0] === 'v1' &&\n path[1] === 'providers' &&\n (path.length === 2 || (path.length === 3 && path[2] === 'health'))\n ) {\n return true\n }\n if (\n path[0] !== 'v1' ||\n path[1] !== 'connections' ||\n path[2] === undefined ||\n !connectionIdPattern.test(path[2])\n ) {\n return false\n }\n if (method === 'GET') return path.length === 3\n return (\n method === 'POST' &&\n path.length === 4 &&\n path[3] !== undefined &&\n connectionActions.has(path[3])\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 upstreamBaseUrl must be an absolute URL', error)\n }\n if (url.protocol !== 'https:' && !isLoopback(url.hostname)) {\n throw new Domain0ProtocolError(\n 'Domain0 upstreamBaseUrl must use HTTPS outside local development',\n )\n }\n if (url.username !== '' || url.password !== '' || url.search !== '' || url.hash !== '') {\n throw new Domain0ProtocolError(\n 'Domain0 upstreamBaseUrl must not contain credentials, a query, or a fragment',\n )\n }\n url.pathname = `${url.pathname.replace(/\\/$/, '')}/`\n return url\n}\n\nfunction isLoopback(hostname: string): boolean {\n return hostname === 'localhost' || hostname === '127.0.0.1' || hostname === '[::1]'\n}\n\nfunction jsonError(status: number, message: string): Response {\n return Response.json(\n { error: { code: status === 401 ? 'unauthorized' : 'invalid_request', message } },\n { status, headers: { 'cache-control': 'no-store' } },\n )\n}\n"],"mappings":";;;;AAGA,MAAM,sBAAsB;AAC5B,MAAM,oCAAoB,IAAI,IAAI;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;C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7C,OAAO,aAAa,eAAe,aAAa,eAAe,aAAa;AAC9E;AAEA,SAAS,UAAU,QAAgB,SAA2B;CAC5D,OAAO,SAAS,KACd,EAAE,OAAO;EAAE,MAAM,WAAW,MAAM,iBAAiB;EAAmB;CAAQ,EAAE,GAChF;EAAE;EAAQ,SAAS,EAAE,iBAAiB,WAAW;CAAE,CACrD;AACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/server/connection-proxy.d.ts
|
|
2
|
+
interface ForwardDomain0ConnectionRequestOptions {
|
|
3
|
+
request: Request;
|
|
4
|
+
/** Catch-all route segments after the same-origin Domain0 bridge. */
|
|
5
|
+
path: readonly string[];
|
|
6
|
+
/** Hosted Domain0 platform API root. */
|
|
7
|
+
upstreamBaseUrl: string;
|
|
8
|
+
/** Exact public origin that received the browser request. */
|
|
9
|
+
origin?: string;
|
|
10
|
+
fetch?: typeof globalThis.fetch;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Forwards only the browser-safe connection routes used by Domain0 Connect.
|
|
14
|
+
* Cookies, API keys, and unrelated headers are never forwarded.
|
|
15
|
+
*/
|
|
16
|
+
declare function forwardDomain0ConnectionRequest(options: ForwardDomain0ConnectionRequestOptions): Promise<Response>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { ForwardDomain0ConnectionRequestOptions, forwardDomain0ConnectionRequest };
|
|
19
|
+
//# sourceMappingURL=server.d.cts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/server/connection-proxy.d.ts
|
|
2
|
+
interface ForwardDomain0ConnectionRequestOptions {
|
|
3
|
+
request: Request;
|
|
4
|
+
/** Catch-all route segments after the same-origin Domain0 bridge. */
|
|
5
|
+
path: readonly string[];
|
|
6
|
+
/** Hosted Domain0 platform API root. */
|
|
7
|
+
upstreamBaseUrl: string;
|
|
8
|
+
/** Exact public origin that received the browser request. */
|
|
9
|
+
origin?: string;
|
|
10
|
+
fetch?: typeof globalThis.fetch;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Forwards only the browser-safe connection routes used by Domain0 Connect.
|
|
14
|
+
* Cookies, API keys, and unrelated headers are never forwarded.
|
|
15
|
+
*/
|
|
16
|
+
declare function forwardDomain0ConnectionRequest(options: ForwardDomain0ConnectionRequestOptions): Promise<Response>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { ForwardDomain0ConnectionRequestOptions, forwardDomain0ConnectionRequest };
|
|
19
|
+
//# sourceMappingURL=server.d.mts.map
|
package/dist/server.mjs
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { IssueConnectionTokenInputSchema } from "./contracts.mjs";
|
|
2
|
+
import { n as Domain0ProtocolError, r as Domain0TransportError } from "./error-Cyd6a9ay.mjs";
|
|
3
|
+
//#region src/server/connection-proxy.ts
|
|
4
|
+
const connectionIdPattern = /^[A-Za-z0-9_-]{1,200}$/;
|
|
5
|
+
const connectionActions = /* @__PURE__ */ new Set([
|
|
6
|
+
"cancellation",
|
|
7
|
+
"change-application",
|
|
8
|
+
"change-plan",
|
|
9
|
+
"credential-authorization",
|
|
10
|
+
"dkim-guidance",
|
|
11
|
+
"domain-connect-completion",
|
|
12
|
+
"domain-connect-handoff",
|
|
13
|
+
"manual-completion",
|
|
14
|
+
"manual-configuration",
|
|
15
|
+
"oauth-authorization",
|
|
16
|
+
"plan-confirmation",
|
|
17
|
+
"propagation-verification",
|
|
18
|
+
"provider-detection",
|
|
19
|
+
"provider-selection",
|
|
20
|
+
"retry"
|
|
21
|
+
]);
|
|
22
|
+
const maximumBodyBytes = 1048576;
|
|
23
|
+
/**
|
|
24
|
+
* Forwards only the browser-safe connection routes used by Domain0 Connect.
|
|
25
|
+
* Cookies, API keys, and unrelated headers are never forwarded.
|
|
26
|
+
*/
|
|
27
|
+
async function forwardDomain0ConnectionRequest(options) {
|
|
28
|
+
const method = options.request.method.toUpperCase();
|
|
29
|
+
if (!isAllowedPath(method, options.path)) return jsonError(404, "This route is not exposed by the connection bridge.");
|
|
30
|
+
const authorization = options.request.headers.get("authorization");
|
|
31
|
+
if (authorization === null || authorization.length > 8200 || !/^Bearer [A-Za-z0-9._~+\/-]+=*$/.test(authorization)) return jsonError(401, "A valid connection token is required.");
|
|
32
|
+
const originResult = IssueConnectionTokenInputSchema.safeParse({ origin: options.origin ?? new URL(options.request.url).origin });
|
|
33
|
+
if (!originResult.success) throw new Domain0ProtocolError("The connection bridge origin is invalid", originResult.error);
|
|
34
|
+
const upstreamBaseUrl = parseBaseUrl(options.upstreamBaseUrl);
|
|
35
|
+
const fetchImplementation = options.fetch ?? globalThis.fetch;
|
|
36
|
+
if (fetchImplementation === void 0) throw new Domain0ProtocolError("No fetch implementation is available");
|
|
37
|
+
let body;
|
|
38
|
+
if (method === "POST") {
|
|
39
|
+
const contentLength = Number(options.request.headers.get("content-length") ?? 0);
|
|
40
|
+
if (Number.isFinite(contentLength) && contentLength > maximumBodyBytes) return jsonError(413, "The request body is too large.");
|
|
41
|
+
const bytes = await options.request.arrayBuffer();
|
|
42
|
+
if (bytes.byteLength > maximumBodyBytes) return jsonError(413, "The request body is too large.");
|
|
43
|
+
body = bytes;
|
|
44
|
+
}
|
|
45
|
+
let upstream;
|
|
46
|
+
try {
|
|
47
|
+
upstream = await fetchImplementation(new URL(options.path.map(encodeURIComponent).join("/"), upstreamBaseUrl), {
|
|
48
|
+
method,
|
|
49
|
+
headers: {
|
|
50
|
+
accept: "application/json",
|
|
51
|
+
authorization,
|
|
52
|
+
origin: originResult.data.origin,
|
|
53
|
+
...body === void 0 ? {} : { "content-type": "application/json" }
|
|
54
|
+
},
|
|
55
|
+
...body === void 0 ? {} : { body },
|
|
56
|
+
cache: "no-store"
|
|
57
|
+
});
|
|
58
|
+
} catch (cause) {
|
|
59
|
+
throw new Domain0TransportError(cause);
|
|
60
|
+
}
|
|
61
|
+
return new Response(upstream.body, {
|
|
62
|
+
status: upstream.status,
|
|
63
|
+
headers: {
|
|
64
|
+
"cache-control": "no-store",
|
|
65
|
+
"content-type": upstream.headers.get("content-type") ?? "application/json"
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function isAllowedPath(method, path) {
|
|
70
|
+
if (method === "GET" && path[0] === "v1" && path[1] === "providers" && (path.length === 2 || path.length === 3 && path[2] === "health")) return true;
|
|
71
|
+
if (path[0] !== "v1" || path[1] !== "connections" || path[2] === void 0 || !connectionIdPattern.test(path[2])) return false;
|
|
72
|
+
if (method === "GET") return path.length === 3;
|
|
73
|
+
return method === "POST" && path.length === 4 && path[3] !== void 0 && connectionActions.has(path[3]);
|
|
74
|
+
}
|
|
75
|
+
function parseBaseUrl(value) {
|
|
76
|
+
let url;
|
|
77
|
+
try {
|
|
78
|
+
url = new URL(value);
|
|
79
|
+
} catch (error) {
|
|
80
|
+
throw new Domain0ProtocolError("Domain0 upstreamBaseUrl must be an absolute URL", error);
|
|
81
|
+
}
|
|
82
|
+
if (url.protocol !== "https:" && !isLoopback(url.hostname)) throw new Domain0ProtocolError("Domain0 upstreamBaseUrl must use HTTPS outside local development");
|
|
83
|
+
if (url.username !== "" || url.password !== "" || url.search !== "" || url.hash !== "") throw new Domain0ProtocolError("Domain0 upstreamBaseUrl must not contain credentials, a query, or a fragment");
|
|
84
|
+
url.pathname = `${url.pathname.replace(/\/$/, "")}/`;
|
|
85
|
+
return url;
|
|
86
|
+
}
|
|
87
|
+
function isLoopback(hostname) {
|
|
88
|
+
return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]";
|
|
89
|
+
}
|
|
90
|
+
function jsonError(status, message) {
|
|
91
|
+
return Response.json({ error: {
|
|
92
|
+
code: status === 401 ? "unauthorized" : "invalid_request",
|
|
93
|
+
message
|
|
94
|
+
} }, {
|
|
95
|
+
status,
|
|
96
|
+
headers: { "cache-control": "no-store" }
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
export { forwardDomain0ConnectionRequest };
|
|
101
|
+
|
|
102
|
+
//# sourceMappingURL=server.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.mjs","names":[],"sources":["../src/server/connection-proxy.ts"],"sourcesContent":["import { IssueConnectionTokenInputSchema } from '../contracts'\nimport { Domain0ProtocolError, Domain0TransportError } from '../client/error'\n\nconst connectionIdPattern = /^[A-Za-z0-9_-]{1,200}$/\nconst connectionActions = new Set([\n 'cancellation',\n 'change-application',\n 'change-plan',\n 'credential-authorization',\n 'dkim-guidance',\n 'domain-connect-completion',\n 'domain-connect-handoff',\n 'manual-completion',\n 'manual-configuration',\n 'oauth-authorization',\n 'plan-confirmation',\n 'propagation-verification',\n 'provider-detection',\n 'provider-selection',\n 'retry',\n])\nconst maximumBodyBytes = 1_048_576\n\nexport interface ForwardDomain0ConnectionRequestOptions {\n request: Request\n /** Catch-all route segments after the same-origin Domain0 bridge. */\n path: readonly string[]\n /** Hosted Domain0 platform API root. */\n upstreamBaseUrl: string\n /** Exact public origin that received the browser request. */\n origin?: string\n fetch?: typeof globalThis.fetch\n}\n\n/**\n * Forwards only the browser-safe connection routes used by Domain0 Connect.\n * Cookies, API keys, and unrelated headers are never forwarded.\n */\nexport async function forwardDomain0ConnectionRequest(\n options: ForwardDomain0ConnectionRequestOptions,\n): Promise<Response> {\n const method = options.request.method.toUpperCase()\n if (!isAllowedPath(method, options.path)) {\n return jsonError(404, 'This route is not exposed by the connection bridge.')\n }\n\n const authorization = options.request.headers.get('authorization')\n if (\n authorization === null ||\n authorization.length > 8200 ||\n !/^Bearer [A-Za-z0-9._~+\\/-]+=*$/.test(authorization)\n ) {\n return jsonError(401, 'A valid connection token is required.')\n }\n\n const originResult = IssueConnectionTokenInputSchema.safeParse({\n origin: options.origin ?? new URL(options.request.url).origin,\n })\n if (!originResult.success) {\n throw new Domain0ProtocolError('The connection bridge origin is invalid', originResult.error)\n }\n\n const upstreamBaseUrl = parseBaseUrl(options.upstreamBaseUrl)\n const fetchImplementation = options.fetch ?? globalThis.fetch\n if (fetchImplementation === undefined) {\n throw new Domain0ProtocolError('No fetch implementation is available')\n }\n\n let body: ArrayBuffer | undefined\n if (method === 'POST') {\n const contentLength = Number(options.request.headers.get('content-length') ?? 0)\n if (Number.isFinite(contentLength) && contentLength > maximumBodyBytes) {\n return jsonError(413, 'The request body is too large.')\n }\n const bytes = await options.request.arrayBuffer()\n if (bytes.byteLength > maximumBodyBytes) {\n return jsonError(413, 'The request body is too large.')\n }\n body = bytes\n }\n\n let upstream: Response\n try {\n upstream = await fetchImplementation(\n new URL(options.path.map(encodeURIComponent).join('/'), upstreamBaseUrl),\n {\n method,\n headers: {\n accept: 'application/json',\n authorization,\n origin: originResult.data.origin,\n ...(body === undefined ? {} : { 'content-type': 'application/json' }),\n },\n ...(body === undefined ? {} : { body }),\n cache: 'no-store',\n },\n )\n } catch (cause) {\n throw new Domain0TransportError(cause)\n }\n\n return new Response(upstream.body, {\n status: upstream.status,\n headers: {\n 'cache-control': 'no-store',\n 'content-type': upstream.headers.get('content-type') ?? 'application/json',\n },\n })\n}\n\nfunction isAllowedPath(method: string, path: readonly string[]): boolean {\n if (\n method === 'GET' &&\n path[0] === 'v1' &&\n path[1] === 'providers' &&\n (path.length === 2 || (path.length === 3 && path[2] === 'health'))\n ) {\n return true\n }\n if (\n path[0] !== 'v1' ||\n path[1] !== 'connections' ||\n path[2] === undefined ||\n !connectionIdPattern.test(path[2])\n ) {\n return false\n }\n if (method === 'GET') return path.length === 3\n return (\n method === 'POST' &&\n path.length === 4 &&\n path[3] !== undefined &&\n connectionActions.has(path[3])\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 upstreamBaseUrl must be an absolute URL', error)\n }\n if (url.protocol !== 'https:' && !isLoopback(url.hostname)) {\n throw new Domain0ProtocolError(\n 'Domain0 upstreamBaseUrl must use HTTPS outside local development',\n )\n }\n if (url.username !== '' || url.password !== '' || url.search !== '' || url.hash !== '') {\n throw new Domain0ProtocolError(\n 'Domain0 upstreamBaseUrl must not contain credentials, a query, or a fragment',\n )\n }\n url.pathname = `${url.pathname.replace(/\\/$/, '')}/`\n return url\n}\n\nfunction isLoopback(hostname: string): boolean {\n return hostname === 'localhost' || hostname === '127.0.0.1' || hostname === '[::1]'\n}\n\nfunction jsonError(status: number, message: string): Response {\n return Response.json(\n { error: { code: status === 401 ? 'unauthorized' : 'invalid_request', message } },\n { status, headers: { 'cache-control': 'no-store' } },\n )\n}\n"],"mappings":";;;AAGA,MAAM,sBAAsB;AAC5B,MAAM,oCAAoB,IAAI,IAAI;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,MAAM,mBAAmB;;;;;AAiBzB,eAAsB,gCACpB,SACmB;CACnB,MAAM,SAAS,QAAQ,QAAQ,OAAO,YAAY;CAClD,IAAI,CAAC,cAAc,QAAQ,QAAQ,IAAI,GACrC,OAAO,UAAU,KAAK,qDAAqD;CAG7E,MAAM,gBAAgB,QAAQ,QAAQ,QAAQ,IAAI,eAAe;CACjE,IACE,kBAAkB,QAClB,cAAc,SAAS,QACvB,CAAC,iCAAiC,KAAK,aAAa,GAEpD,OAAO,UAAU,KAAK,uCAAuC;CAG/D,MAAM,eAAe,gCAAgC,UAAU,EAC7D,QAAQ,QAAQ,UAAU,IAAI,IAAI,QAAQ,QAAQ,GAAG,CAAC,CAAC,OACzD,CAAC;CACD,IAAI,CAAC,aAAa,SAChB,MAAM,IAAI,qBAAqB,2CAA2C,aAAa,KAAK;CAG9F,MAAM,kBAAkB,aAAa,QAAQ,eAAe;CAC5D,MAAM,sBAAsB,QAAQ,SAAS,WAAW;CACxD,IAAI,wBAAwB,KAAA,GAC1B,MAAM,IAAI,qBAAqB,sCAAsC;CAGvE,IAAI;CACJ,IAAI,WAAW,QAAQ;EACrB,MAAM,gBAAgB,OAAO,QAAQ,QAAQ,QAAQ,IAAI,gBAAgB,KAAK,C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AAS,OAAO;EACd,MAAM,IAAI,qBAAqB,mDAAmD,KAAK;CACzF;CACA,IAAI,IAAI,aAAa,YAAY,CAAC,WAAW,IAAI,QAAQ,GACvD,MAAM,IAAI,qBACR,kEACF;CAEF,IAAI,IAAI,aAAa,MAAM,IAAI,aAAa,MAAM,IAAI,WAAW,MAAM,IAAI,SAAS,IAClF,MAAM,IAAI,qBACR,8EACF;CAEF,IAAI,WAAW,GAAG,IAAI,SAAS,QAAQ,OAAO,EAAE,EAAE;CAClD,OAAO;AACT;AAEA,SAAS,WAAW,UAA2B;CAC7C,OAAO,aAAa,eAAe,aAAa,eAAe,aAAa;AAC9E;AAEA,SAAS,UAAU,QAAgB,SAA2B;CAC5D,OAAO,SAAS,KACd,EAAE,OAAO;EAAE,MAAM,WAAW,MAAM,iBAAiB;EAAmB;CAAQ,EAAE,GAChF;EAAE;EAAQ,SAAS,EAAE,iBAAiB,WAAW;CAAE,CACrD;AACF"}
|
package/dist/ui.cjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_sdk = require("./sdk-C0q5dV-6.cjs");
|
|
3
|
+
exports.applyWhiteLabel = require_sdk.applyWhiteLabel;
|
|
4
|
+
exports.createDomain0 = require_sdk.createDomain0;
|
|
5
|
+
exports.createDomain0Localizer = require_sdk.createDomain0Localizer;
|
|
6
|
+
exports.domain0 = require_sdk.domain0;
|
|
7
|
+
exports.domain0TranslatedLocales = require_sdk.domain0TranslatedLocales;
|
|
8
|
+
exports.interpolateWhiteLabelCopy = require_sdk.interpolateWhiteLabelCopy;
|
|
9
|
+
exports.localizedCopy = require_sdk.localizedCopy;
|
|
10
|
+
exports.mountDomain0Connect = require_sdk.mountDomain0Connect;
|
|
11
|
+
exports.mountDomain0ConnectionFlow = require_sdk.mountDomain0ConnectionFlow;
|
|
12
|
+
exports.mountDomain0SharedFlow = require_sdk.mountDomain0SharedFlow;
|
package/dist/ui.d.cts
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { Hi as PlanWarningCode, Kt as Domain0ErrorCode, Ut as Domain0Locale, pt as ProviderDetectionUnavailableReasonCode, xi as ConnectionState, y as Domain0WhiteLabel } from "./index-CtQn01os.cjs";
|
|
2
|
+
import { C as Domain0RequestCloseEvent, E as mountDomain0Connect, S as Domain0ManualSetupDocumentationClickEvent, T as Domain0SharedFlowSentEvent, _ as Domain0ConnectStep, a as createDomain0, b as Domain0CreateSharedFlowRequest, c as mountDomain0SharedFlow, d as mountDomain0ConnectionFlow, f as Domain0ActiveConnection, g as Domain0ConnectOptions, h as Domain0ConnectController, i as Domain0SDK, l as Domain0ConnectionFlowController, m as Domain0ConnectCloseReason, n as Domain0ConnectDomainsOptions, o as domain0, p as Domain0ConnectCloseEvent, r as Domain0LoadSharedFlowOptions, s as Domain0SharedFlowOptions, t as Domain0ConnectDomainOptions, u as Domain0ConnectionFlowOptions, v as Domain0ConnectStepChangeEvent, w as Domain0SharedFlowGateway, x as Domain0DkimSetupDocumentationClickEvent, y as Domain0ConnectSuccessEvent } from "./sdk-BKtsupNk.cjs";
|
|
3
|
+
//#region src/ui/localization.d.ts
|
|
4
|
+
declare const englishMessages: {
|
|
5
|
+
readonly triggerConnectDomain: "Connect domain";
|
|
6
|
+
readonly headingConnectDomain: "Connect your domain";
|
|
7
|
+
readonly headingConnectDomains: "Connect your domains";
|
|
8
|
+
readonly initialSubtitle: "Choose your DNS provider. Domain0 will show the verified connection path available for it.";
|
|
9
|
+
readonly cancelConnection: "Cancel connection";
|
|
10
|
+
readonly close: "Close";
|
|
11
|
+
readonly loadingConnection: "Loading connection details…";
|
|
12
|
+
readonly detectingProvider: "Detecting your DNS provider…";
|
|
13
|
+
readonly detectionUnavailable: "Automatic provider detection is temporarily unavailable. Choose your DNS provider below.";
|
|
14
|
+
readonly connectionStatus: (state: string) => string;
|
|
15
|
+
readonly manualInstructionsReady: "Guided manual DNS instructions are ready.";
|
|
16
|
+
readonly forcedManualBlocked: "This connection already entered an automatic provider workflow. Forced manual mode will not resume or advance it. Cancel this connection and create a new manual connection.";
|
|
17
|
+
readonly forcedManualIncompatible: "The existing connection is incompatible with forced manual setup";
|
|
18
|
+
readonly missingConfirmationPlan: "The server returned a confirmation state without a change plan";
|
|
19
|
+
readonly missingApplyingPlan: "The server returned an applying state without a confirmed plan";
|
|
20
|
+
readonly missingFailureDetails: "The server returned a retryable state without failure details";
|
|
21
|
+
readonly successDescription: (domain: string) => string;
|
|
22
|
+
readonly dkimHeading: "Secure outgoing email with DKIM";
|
|
23
|
+
readonly dkimCheckingProvider: "Checking public MX and selector-specific DKIM DNS records…";
|
|
24
|
+
readonly dkimGuidanceUnavailable: "Email-provider detection is temporarily unavailable. No DNS changes were made.";
|
|
25
|
+
readonly dkimDomainMismatch: "The server returned DKIM guidance for a different domain";
|
|
26
|
+
readonly dkimProviderDetected: (provider: string) => string;
|
|
27
|
+
readonly dkimProviderAmbiguous: "MX records point to more than one supported email provider. Review the mail routing before changing DKIM.";
|
|
28
|
+
readonly dkimProviderUnknown: "Domain0 could not identify Google Workspace, Microsoft 365, or Zoho Mail from the public MX records.";
|
|
29
|
+
readonly dkimRecordObserved: (selectors: string) => string;
|
|
30
|
+
readonly dkimNoRecordObserved: (selectors: string) => string;
|
|
31
|
+
readonly dkimNotChecked: "This provider uses an account-defined DKIM selector, so no selector record was checked automatically.";
|
|
32
|
+
readonly dkimLookupUnavailable: "The selector-specific DKIM DNS check was temporarily unavailable.";
|
|
33
|
+
readonly dkimEvidenceBoundary: "A published DNS record does not prove that outgoing mail is being signed. Verify the final DKIM status in the email provider admin.";
|
|
34
|
+
readonly dkimOpenGuide: (provider: string) => string;
|
|
35
|
+
readonly cancelledDescription: (domain: string) => string;
|
|
36
|
+
readonly selectedProvider: (provider: string, support: string) => string;
|
|
37
|
+
readonly currentState: (state: string) => string;
|
|
38
|
+
readonly refreshConnection: "Refresh connection";
|
|
39
|
+
readonly domainConnectHeading: "Connect through Domain Connect";
|
|
40
|
+
readonly domainConnectGuidance: "Your DNS provider will show the exact service template and ask for consent before applying it.";
|
|
41
|
+
readonly domainConnectResumeUnavailable: "This host application must provide the same Domain Connect service template to resume this handoff.";
|
|
42
|
+
readonly domainConnectUnavailable: "This host application has not configured its Domain Connect service template. Guided manual setup remains available.";
|
|
43
|
+
readonly continueSecurely: (provider: string) => string;
|
|
44
|
+
readonly continueSecurelyNewTab: (provider: string) => string;
|
|
45
|
+
readonly completedDomainConnect: "I completed Domain Connect";
|
|
46
|
+
readonly preparingAuthoritativeVerification: "Preparing authoritative DNS verification…";
|
|
47
|
+
readonly readyToVerifyPropagation: "Ready to verify DNS propagation.";
|
|
48
|
+
readonly resumeDomainConnect: (provider: string) => string;
|
|
49
|
+
readonly connectWithProvider: (provider: string) => string;
|
|
50
|
+
readonly checkingDomainConnectTemplate: "Checking that your DNS provider supports this exact service template…";
|
|
51
|
+
readonly domainConnectReady: "Domain Connect is ready. Continue with your DNS provider in a new tab.";
|
|
52
|
+
readonly followProviderGuide: (provider: string) => string;
|
|
53
|
+
readonly openApplicationManualSetupGuide: "Open this application's step-by-step DNS guide";
|
|
54
|
+
readonly requestManualSetupHelp: "Get step-by-step DNS help";
|
|
55
|
+
readonly openProviderReference: (provider: string) => string;
|
|
56
|
+
readonly opensInNewTab: (label: string) => string;
|
|
57
|
+
readonly sharedFlowHeading: "Ask someone else to finish setup";
|
|
58
|
+
readonly sharedFlowGuidance: "Copy a time-limited link for a trusted person who can update this domain. The link grants access only to this connection.";
|
|
59
|
+
readonly copySecureSetupLink: "Copy secure setup link";
|
|
60
|
+
readonly creatingSecureSetupLink: "Creating a secure setup link…";
|
|
61
|
+
readonly secureSetupLinkCopied: "Secure setup link copied.";
|
|
62
|
+
readonly copySetupLinkAgain: "Copy setup link again";
|
|
63
|
+
readonly expiredSharedFlow: "The host returned an expired shared-flow invitation";
|
|
64
|
+
readonly clipboardUnavailable: "Clipboard access is unavailable; configure sharedFlowGateway.copy";
|
|
65
|
+
readonly oauthHeading: "Authorize securely with the provider";
|
|
66
|
+
readonly oauthGuidance: "Domain0 uses OAuth with PKCE. Your provider password is never shared with Domain0.";
|
|
67
|
+
readonly continueToProvider: (provider: string) => string;
|
|
68
|
+
readonly authorizationExpires: "This authorization link expires at {DATE}.";
|
|
69
|
+
readonly completedAuthorization: "I completed authorization";
|
|
70
|
+
readonly resumeAuthorization: (provider: string) => string;
|
|
71
|
+
readonly authorizeWithProvider: (provider: string) => string;
|
|
72
|
+
readonly authorizeProviderCredentials: (provider: string) => string;
|
|
73
|
+
readonly preparingAuthorizationLink: "Preparing a secure provider authorization link…";
|
|
74
|
+
readonly authorizationLinkReady: "Authorization link ready. Continue with the provider in a new tab.";
|
|
75
|
+
readonly credentialGuidance: "Use a minimally scoped provider credential. Domain0 encrypts it server-side and never returns it to the browser.";
|
|
76
|
+
readonly credentialHeadingApiToken: "Authorize with an API token";
|
|
77
|
+
readonly credentialHeadingAccessKey: "Authorize with API keys";
|
|
78
|
+
readonly credentialHeadingUsernamePassword: "Authorize with provider credentials";
|
|
79
|
+
readonly credentialHeadingAccountToken: "Authorize with an account token";
|
|
80
|
+
readonly credentialHeadingUsernameToken: "Authorize with a user token";
|
|
81
|
+
readonly credentialHeadingOvh: "Authorize with OVH API credentials";
|
|
82
|
+
readonly credentialHeadingPrivateKey: "Authorize with a private key";
|
|
83
|
+
readonly credentialHeadingAwsSession: "Authorize with a temporary AWS session";
|
|
84
|
+
readonly credentialHeadingCpanel: "Authorize with a cPanel API token";
|
|
85
|
+
readonly credentialHeadingClientCredentials: "Authorize with OpenSRS Storefront credentials";
|
|
86
|
+
readonly fieldApiToken: "API token";
|
|
87
|
+
readonly fieldAccessKeyId: "Access key ID";
|
|
88
|
+
readonly fieldApiSecret: "API secret";
|
|
89
|
+
readonly fieldUsername: "Username";
|
|
90
|
+
readonly fieldPassword: "Password";
|
|
91
|
+
readonly fieldAccountId: "Account ID";
|
|
92
|
+
readonly fieldOvhRegion: "OVH API region";
|
|
93
|
+
readonly fieldApplicationKey: "Application key";
|
|
94
|
+
readonly fieldApplicationSecret: "Application secret";
|
|
95
|
+
readonly fieldConsumerKey: "Consumer key";
|
|
96
|
+
readonly fieldProviderLogin: "Provider login";
|
|
97
|
+
readonly fieldPemPrivateKey: "PEM private key";
|
|
98
|
+
readonly fieldAwsAccessKeyId: "AWS access key ID";
|
|
99
|
+
readonly fieldAwsSecretAccessKey: "AWS secret access key";
|
|
100
|
+
readonly fieldAwsSessionToken: "AWS session token";
|
|
101
|
+
readonly fieldRoute53ZoneId: "Route 53 hosted zone ID";
|
|
102
|
+
readonly fieldSessionExpiration: "Session expiration";
|
|
103
|
+
readonly fieldCpanelEndpoint: "cPanel HTTPS endpoint";
|
|
104
|
+
readonly fieldCpanelUsername: "cPanel username";
|
|
105
|
+
readonly fieldCpanelApiToken: "cPanel API token";
|
|
106
|
+
readonly fieldStorefrontClientId: "Storefront client ID";
|
|
107
|
+
readonly fieldStorefrontClientSecret: "Storefront client secret";
|
|
108
|
+
readonly regionOvhEurope: "OVH Europe";
|
|
109
|
+
readonly regionOvhUnitedStates: "OVH United States";
|
|
110
|
+
readonly regionOvhCanada: "OVH Canada";
|
|
111
|
+
readonly regionKimsufiEurope: "Kimsufi Europe";
|
|
112
|
+
readonly regionKimsufiCanada: "Kimsufi Canada";
|
|
113
|
+
readonly regionSoYouStartEurope: "So You Start Europe";
|
|
114
|
+
readonly regionSoYouStartCanada: "So You Start Canada";
|
|
115
|
+
readonly authorizeApiToken: "Authorize API token";
|
|
116
|
+
readonly encryptingAuthorization: "Encrypting and validating provider authorization…";
|
|
117
|
+
readonly authorizationCompleted: "Provider authorization completed.";
|
|
118
|
+
readonly existingRecordPolicy: "Existing DNS record policy";
|
|
119
|
+
readonly existingRecordPolicyHelp: "Preserve is safest. Replacement policies may propose destructive changes that require separate confirmation.";
|
|
120
|
+
readonly preserveExistingRecords: "Preserve existing records";
|
|
121
|
+
readonly replaceSameNameAndType: "Replace records with the same host and type";
|
|
122
|
+
readonly replaceAllAtName: "Replace all conflicting records at the host";
|
|
123
|
+
readonly replaceSpf: "Replace an existing SPF policy instead of merging it";
|
|
124
|
+
readonly replaceSpfHelp: "Merging is the safe default. Replacement removes the provider's current SPF mechanisms and always requires destructive-change confirmation.";
|
|
125
|
+
readonly readingRecords: "Reading current provider records and preparing a change plan…";
|
|
126
|
+
readonly recordsAlreadyExist: "The required DNS records already exist. Ready to verify propagation.";
|
|
127
|
+
readonly reviewChanges: "Review the proposed DNS changes before confirmation.";
|
|
128
|
+
readonly reviewDnsChanges: "Review DNS changes";
|
|
129
|
+
readonly recalculateChangePlan: "Recalculate change plan";
|
|
130
|
+
readonly proposedChangesRegion: "Proposed DNS changes";
|
|
131
|
+
readonly proposedChangesCaption: (domain: string) => string;
|
|
132
|
+
readonly columnAction: "Action";
|
|
133
|
+
readonly columnCurrentRecord: "Current record";
|
|
134
|
+
readonly columnResultingRecord: "Resulting record";
|
|
135
|
+
readonly columnRisk: "Risk";
|
|
136
|
+
readonly changeCreate: "Create";
|
|
137
|
+
readonly changeUpdate: "Update";
|
|
138
|
+
readonly changeDelete: "Delete";
|
|
139
|
+
readonly destructive: "Destructive";
|
|
140
|
+
readonly nonDestructive: "Non-destructive";
|
|
141
|
+
readonly planWarnings: "Plan warnings";
|
|
142
|
+
readonly planWarningSpfPolicyReplaced: "The existing SPF policy will be replaced by the requested SPF policy.";
|
|
143
|
+
readonly planWarningSpfPolicyMerged: "The existing SPF policy was merged into the requested SPF record.";
|
|
144
|
+
readonly planExpires: "This plan expires at {DATE}.";
|
|
145
|
+
readonly destructiveAcknowledgement: "I understand that the marked existing DNS records will be replaced or deleted.";
|
|
146
|
+
readonly confirmChangePlan: "Confirm change plan";
|
|
147
|
+
readonly confirmingChangePlan: "Confirming this exact change plan…";
|
|
148
|
+
readonly planConfirmed: "Plan confirmed. DNS changes have not been applied yet.";
|
|
149
|
+
readonly applyDnsChanges: "Apply DNS changes";
|
|
150
|
+
readonly applyingDnsChanges: "Applying the confirmed DNS changes…";
|
|
151
|
+
readonly dnsChangesApplied: "DNS changes were applied. Ready to verify authoritative propagation.";
|
|
152
|
+
readonly detectionReasonNoStablePublicProviderIdentity: "This provider does not publish a stable public identity that Domain0 can safely detect from DNS.";
|
|
153
|
+
readonly manualGuidance: "Use guided manual setup to add the exact required DNS records without sharing provider credentials.";
|
|
154
|
+
readonly manualSetupUnavailableHeading: "Manual setup unavailable";
|
|
155
|
+
readonly manualSetupUnavailableDescription: "Manual DNS setup is disabled by this application. Use another available verified path, or cancel or close this connection.";
|
|
156
|
+
readonly showDnsRecords: "Show DNS records";
|
|
157
|
+
readonly preparingDnsInstructions: "Preparing DNS instructions…";
|
|
158
|
+
readonly dnsInstructionsReady: "DNS instructions are ready.";
|
|
159
|
+
readonly addResolvedRecords: "Add these resolved records in your DNS provider, then continue.";
|
|
160
|
+
readonly authoritativeRecordGuidance: "These are the records Domain0 checks directly on every authoritative nameserver.";
|
|
161
|
+
readonly dnsRecordsRegion: "DNS records";
|
|
162
|
+
readonly dnsRecordsCaption: (domain: string) => string;
|
|
163
|
+
readonly thisDomain: "this domain";
|
|
164
|
+
readonly columnType: "Type";
|
|
165
|
+
readonly columnHost: "Host";
|
|
166
|
+
readonly columnValue: "Value";
|
|
167
|
+
readonly columnTtl: "TTL";
|
|
168
|
+
readonly columnPriority: "Priority";
|
|
169
|
+
readonly columnRequirement: "Requirement";
|
|
170
|
+
readonly optional: "Optional";
|
|
171
|
+
readonly required: "Required";
|
|
172
|
+
readonly noRecordChanges: "The existing DNS policy satisfies this request. No DNS record changes are required.";
|
|
173
|
+
readonly addedRecords: "I added these records";
|
|
174
|
+
readonly continue: "Continue";
|
|
175
|
+
readonly savingConfirmation: "Saving your confirmation…";
|
|
176
|
+
readonly verifyDnsRecords: "Verify DNS records";
|
|
177
|
+
readonly finishConnection: "Finish connection";
|
|
178
|
+
readonly checkingNameservers: "Checking authoritative nameservers…";
|
|
179
|
+
readonly requiredRecordsActive: "Required DNS records are active.";
|
|
180
|
+
readonly propagationPending: "DNS changes have not reached every authoritative nameserver yet. You can check again.";
|
|
181
|
+
readonly providerFailureHeading: "Provider operation needs attention";
|
|
182
|
+
readonly snapshotTimeout: "Domain0 timed out while reading provider DNS records. No DNS changes were made. Retry restores the prior review step so you can request a fresh snapshot.";
|
|
183
|
+
readonly applyTimeout: "The provider did not confirm the DNS update before the deadline, so the outcome is ambiguous. Retry restores the confirmed application step; Domain0 reconciles current provider records before another write.";
|
|
184
|
+
readonly timeoutRecorded: "The timeout was recorded at {DATE}.";
|
|
185
|
+
readonly retryConnection: "Retry connection";
|
|
186
|
+
readonly restoringConnection: "Restoring the connection to its pre-failure state…";
|
|
187
|
+
readonly connectionRestored: (state: string) => string;
|
|
188
|
+
readonly cancelHeading: "Cancel this connection?";
|
|
189
|
+
readonly cancelGuidance: "Cancellation stops this Domain0 workflow. It does not remove DNS records that were already applied.";
|
|
190
|
+
readonly keepConnection: "Keep connection";
|
|
191
|
+
readonly confirmCancellation: "Confirm cancellation";
|
|
192
|
+
readonly cancellingConnection: "Cancelling connection…";
|
|
193
|
+
readonly connectionCancelled: "Connection cancelled.";
|
|
194
|
+
readonly dnsProvider: "DNS provider";
|
|
195
|
+
readonly providerHelp: "Select the company where you manage DNS records for this domain.";
|
|
196
|
+
readonly detectedProviderHelp: "Domain0 found possible providers from public DNS information. Confirm the company where you manage DNS records.";
|
|
197
|
+
readonly chooseProvider: "Choose a provider";
|
|
198
|
+
readonly suggestedFromDns: "Suggested from DNS";
|
|
199
|
+
readonly allOtherProviders: "All other providers";
|
|
200
|
+
readonly continueWithProvider: "Continue with provider";
|
|
201
|
+
readonly savingProviderSelection: "Saving provider selection…";
|
|
202
|
+
readonly preparingProviderSelection: "Preparing provider selection…";
|
|
203
|
+
readonly providerDetected: (provider: string) => string;
|
|
204
|
+
readonly providerSelected: (provider: string) => string;
|
|
205
|
+
readonly preparingManualInstructions: "Preparing guided manual DNS instructions…";
|
|
206
|
+
readonly manualSetupNotEntered: "The server did not enter guided manual setup";
|
|
207
|
+
readonly noProviderDetected: "No provider was identified automatically. Choose your DNS provider below.";
|
|
208
|
+
readonly possibleProviderFound: "1 possible DNS provider was found. Confirm your provider below.";
|
|
209
|
+
readonly possibleProvidersFound: (count: string) => string;
|
|
210
|
+
readonly supportAutomatic: "automatic";
|
|
211
|
+
readonly supportDomainConnect: "Domain Connect";
|
|
212
|
+
readonly supportManual: "guided manual";
|
|
213
|
+
readonly supportUnverified: "not yet verified";
|
|
214
|
+
readonly supportAutomaticDescription: "Its automatic adapter is verified; guided manual setup is also available.";
|
|
215
|
+
readonly supportDomainConnectDescription: "Its Domain Connect path is verified; guided manual setup is also available.";
|
|
216
|
+
readonly supportManualDescription: "Its guided manual path is verified.";
|
|
217
|
+
readonly supportUnverifiedDescription: "Provider-specific automation is not verified; guided manual setup remains available.";
|
|
218
|
+
readonly recordSummary: (type: string, host: string, value: string, ttl: string, priority: string) => string;
|
|
219
|
+
readonly recordPriority: (priority: string) => string;
|
|
220
|
+
readonly errorPrefix: (message: string) => string;
|
|
221
|
+
readonly unknownError: "Unknown error";
|
|
222
|
+
readonly transportError: "Domain0 could not be reached. Check your connection and try again.";
|
|
223
|
+
readonly protocolError: "Domain0 returned an invalid response. Try again or contact the application operator.";
|
|
224
|
+
readonly apiErrorInvalidRequest: "The request is invalid.";
|
|
225
|
+
readonly apiErrorUnauthorized: "Authentication failed. Reopen the connection flow and try again.";
|
|
226
|
+
readonly apiErrorForbidden: "You are not allowed to perform this operation.";
|
|
227
|
+
readonly apiErrorNotFound: "The requested connection resource was not found or has expired.";
|
|
228
|
+
readonly apiErrorConflict: "The connection changed before this operation completed. Refresh and try again.";
|
|
229
|
+
readonly apiErrorRateLimited: "Too many requests were made. Wait briefly and try again.";
|
|
230
|
+
readonly apiErrorDnsUnavailable: "Authoritative DNS is temporarily unavailable. Try again.";
|
|
231
|
+
readonly apiErrorProviderUnavailable: "The DNS provider is temporarily unavailable. Try again.";
|
|
232
|
+
readonly apiErrorProviderAuthorizationFailed: "The DNS provider authorization failed or expired.";
|
|
233
|
+
readonly apiErrorProviderLimitation: "The selected provider cannot complete this operation automatically.";
|
|
234
|
+
readonly apiErrorPlanExpired: "The DNS change plan expired. Prepare and review a new plan.";
|
|
235
|
+
readonly apiErrorPropagationPending: "The DNS changes have not reached every authoritative nameserver yet.";
|
|
236
|
+
readonly apiErrorInternal: "Domain0 encountered an unexpected error. Try again.";
|
|
237
|
+
readonly loadingFlow: "Loading domain connection flow…";
|
|
238
|
+
readonly flowNotReady: "Domain connections are still being prepared. Reopen this flow to retry.";
|
|
239
|
+
readonly flowStep: (index: string, domain: string) => string;
|
|
240
|
+
readonly flowStepConnected: (index: string, domain: string) => string;
|
|
241
|
+
readonly allDomainsConnected: (count: string) => string;
|
|
242
|
+
readonly domainProgress: (index: string, total: string, domain: string) => string;
|
|
243
|
+
readonly connectionStateRequested: "requested";
|
|
244
|
+
readonly connectionStateDetectingProvider: "detecting provider";
|
|
245
|
+
readonly connectionStateProviderSelected: "provider selected";
|
|
246
|
+
readonly connectionStateDomainConnectPending: "Domain Connect pending";
|
|
247
|
+
readonly connectionStateAuthorizationPending: "authorization pending";
|
|
248
|
+
readonly connectionStateAuthorized: "authorized";
|
|
249
|
+
readonly connectionStatePlanning: "planning";
|
|
250
|
+
readonly connectionStateAwaitingConfirmation: "awaiting confirmation";
|
|
251
|
+
readonly connectionStateApplying: "applying";
|
|
252
|
+
readonly connectionStatePropagationPending: "propagation pending";
|
|
253
|
+
readonly connectionStateActive: "active";
|
|
254
|
+
readonly connectionStateManualRequired: "manual setup required";
|
|
255
|
+
readonly connectionStateFailedRetryable: "temporarily failed";
|
|
256
|
+
readonly connectionStateFailedTerminal: "failed";
|
|
257
|
+
readonly connectionStateCancelled: "cancelled";
|
|
258
|
+
};
|
|
259
|
+
type WidenMessage<T> = T extends ((...arguments_: infer Arguments) => string) ? (...arguments_: Arguments) => string : string;
|
|
260
|
+
type Domain0Messages = { readonly [Key in keyof typeof englishMessages]: WidenMessage<(typeof englishMessages)[Key]>; };
|
|
261
|
+
declare const domain0TranslatedLocales: readonly ["en", "es", "pt-br", "pt-pt", "fr", "de"];
|
|
262
|
+
type Domain0TranslatedLocale = (typeof domain0TranslatedLocales)[number];
|
|
263
|
+
interface Domain0Localizer {
|
|
264
|
+
readonly locale: Domain0Locale;
|
|
265
|
+
readonly translatedLocale: Domain0TranslatedLocale;
|
|
266
|
+
readonly languageTag: string;
|
|
267
|
+
readonly direction: 'ltr';
|
|
268
|
+
readonly messages: Domain0Messages;
|
|
269
|
+
formatInteger(value: number): string;
|
|
270
|
+
formatDateTime(value: string): string;
|
|
271
|
+
connectionState(state: ConnectionState): string;
|
|
272
|
+
providerDetectionReason(code: ProviderDetectionUnavailableReasonCode): string;
|
|
273
|
+
planWarning(code: PlanWarningCode): string;
|
|
274
|
+
apiError(code: Domain0ErrorCode): string;
|
|
275
|
+
}
|
|
276
|
+
declare function createDomain0Localizer(input?: unknown): Domain0Localizer;
|
|
277
|
+
declare function localizedCopy(copy: Readonly<{
|
|
278
|
+
en: string;
|
|
279
|
+
} & Partial<Record<Domain0Locale, string | undefined>>> | undefined, locale: Domain0Locale): string | undefined;
|
|
280
|
+
//#endregion
|
|
281
|
+
//#region src/ui/white-label.d.ts
|
|
282
|
+
declare function applyWhiteLabel(root: HTMLElement, whiteLabel: Domain0WhiteLabel): void;
|
|
283
|
+
declare function interpolateWhiteLabelCopy(template: string, replacements: Readonly<Record<string, string>>): string;
|
|
284
|
+
//#endregion
|
|
285
|
+
export { Domain0ActiveConnection, Domain0ConnectCloseEvent, Domain0ConnectCloseReason, Domain0ConnectController, Domain0ConnectDomainOptions, Domain0ConnectDomainsOptions, Domain0ConnectOptions, Domain0ConnectStep, Domain0ConnectStepChangeEvent, Domain0ConnectSuccessEvent, Domain0ConnectionFlowController, Domain0ConnectionFlowOptions, Domain0CreateSharedFlowRequest, Domain0DkimSetupDocumentationClickEvent, Domain0LoadSharedFlowOptions, Domain0Localizer, Domain0ManualSetupDocumentationClickEvent, Domain0Messages, Domain0RequestCloseEvent, Domain0SDK, Domain0SharedFlowGateway, Domain0SharedFlowOptions, Domain0SharedFlowSentEvent, Domain0TranslatedLocale, applyWhiteLabel, createDomain0, createDomain0Localizer, domain0, domain0TranslatedLocales, interpolateWhiteLabelCopy, localizedCopy, mountDomain0Connect, mountDomain0ConnectionFlow, mountDomain0SharedFlow };
|
|
286
|
+
//# sourceMappingURL=ui.d.cts.map
|