domain0 0.3.3 → 0.4.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 +17 -6
- 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-DzGqFq0D.d.cts} +1678 -128
- package/dist/{index-sSrRFTnm.d.mts → index-DzGqFq0D.d.mts} +1678 -128
- 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-BbUuEwzs.mjs +148 -0
- package/dist/sdk-BbUuEwzs.mjs.map +1 -0
- package/dist/{sdk-B10fN-QP.d.mts → sdk-CkEDIlsq.d.cts} +8 -9
- package/dist/{sdk-DYR5Itru.d.cts → sdk-D2QNoMIg.d.mts} +8 -9
- package/dist/sdk-Dv22iteS.cjs +148 -0
- package/dist/sdk-Dv22iteS.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/server.cjs
CHANGED
|
@@ -1,103 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
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
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./contracts.cjs"),t=require("./error-1Gob8Pup.cjs"),n=/^[A-Za-z0-9_-]{1,200}$/,r=new Set([`cancellation`,`change-application`,`change-plan`,`credential-authorization`,`dkim-guidance`,`domain-connect-completion`,`domain-connect-handoff`,`manual-completion`,`manual-configuration`,`oauth-authorization`,`plan-confirmation`,`propagation-verification`,`provider-detection`,`provider-selection`,`retry`]),i=1048576;async function a(n){let r=n.request.method.toUpperCase();if(!o(r,n.path))return l(404,`This route is not exposed by the connection bridge.`);let a=n.request.headers.get(`authorization`);if(a===null||a.length>8200||!/^Bearer [A-Za-z0-9._~+\/-]+=*$/.test(a))return l(401,`A valid connection token is required.`);let c=e.IssueConnectionTokenInputSchema.safeParse({origin:n.origin??new URL(n.request.url).origin});if(!c.success)throw new t.n(`The connection bridge origin is invalid`,c.error);let u=s(n.upstreamBaseUrl),d=n.fetch??globalThis.fetch;if(d===void 0)throw new t.n(`No fetch implementation is available`);let f;if(r===`POST`){let e=Number(n.request.headers.get(`content-length`)??0);if(Number.isFinite(e)&&e>i)return l(413,`The request body is too large.`);let t=await n.request.arrayBuffer();if(t.byteLength>i)return l(413,`The request body is too large.`);f=t}let p;try{p=await d(new URL(n.path.map(encodeURIComponent).join(`/`),u),{method:r,headers:{accept:`application/json`,authorization:a,origin:c.data.origin,...f===void 0?{}:{"content-type":`application/json`}},...f===void 0?{}:{body:f},cache:`no-store`})}catch(e){throw new t.r(e)}return new Response(p.body,{status:p.status,headers:{"cache-control":`no-store`,"content-type":p.headers.get(`content-type`)??`application/json`}})}function o(e,t){return e===`GET`&&t[0]===`v1`&&t[1]===`providers`&&(t.length===2||t.length===3&&t[2]===`health`)?!0:t[0]!==`v1`||t[1]!==`connections`||t[2]===void 0||!n.test(t[2])?!1:e===`GET`?t.length===3:e===`POST`&&t.length===4&&t[3]!==void 0&&r.has(t[3])}function s(e){let n;try{n=new URL(e)}catch(e){throw new t.n(`Domain0 upstreamBaseUrl must be an absolute URL`,e)}if(n.protocol!==`https:`&&!c(n.hostname))throw new t.n(`Domain0 upstreamBaseUrl must use HTTPS outside local development`);if(n.username!==``||n.password!==``||n.search!==``||n.hash!==``)throw new t.n(`Domain0 upstreamBaseUrl must not contain credentials, a query, or a fragment`);return n.pathname=`${n.pathname.replace(/\/$/,``)}/`,n}function c(e){return e===`localhost`||e===`127.0.0.1`||e===`[::1]`}function l(e,t){return Response.json({error:{code:e===401?`unauthorized`:`invalid_request`,message:t}},{status:e,headers:{"cache-control":`no-store`}})}exports.forwardDomain0ConnectionRequest=a;
|
|
103
2
|
//# sourceMappingURL=server.cjs.map
|
package/dist/server.cjs.map
CHANGED
|
@@ -1 +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":"
|
|
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":"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"}
|
package/dist/server.mjs
CHANGED
|
@@ -1,102 +1,2 @@
|
|
|
1
|
-
import
|
|
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
|
-
|
|
1
|
+
import{IssueConnectionTokenInputSchema as e}from"./contracts.mjs";import{n as t,r as n}from"./error-szz6-UFL.mjs";const r=/^[A-Za-z0-9_-]{1,200}$/,i=new Set([`cancellation`,`change-application`,`change-plan`,`credential-authorization`,`dkim-guidance`,`domain-connect-completion`,`domain-connect-handoff`,`manual-completion`,`manual-configuration`,`oauth-authorization`,`plan-confirmation`,`propagation-verification`,`provider-detection`,`provider-selection`,`retry`]),a=1048576;async function o(r){let i=r.request.method.toUpperCase();if(!s(i,r.path))return u(404,`This route is not exposed by the connection bridge.`);let o=r.request.headers.get(`authorization`);if(o===null||o.length>8200||!/^Bearer [A-Za-z0-9._~+\/-]+=*$/.test(o))return u(401,`A valid connection token is required.`);let l=e.safeParse({origin:r.origin??new URL(r.request.url).origin});if(!l.success)throw new t(`The connection bridge origin is invalid`,l.error);let d=c(r.upstreamBaseUrl),f=r.fetch??globalThis.fetch;if(f===void 0)throw new t(`No fetch implementation is available`);let p;if(i===`POST`){let e=Number(r.request.headers.get(`content-length`)??0);if(Number.isFinite(e)&&e>a)return u(413,`The request body is too large.`);let t=await r.request.arrayBuffer();if(t.byteLength>a)return u(413,`The request body is too large.`);p=t}let m;try{m=await f(new URL(r.path.map(encodeURIComponent).join(`/`),d),{method:i,headers:{accept:`application/json`,authorization:o,origin:l.data.origin,...p===void 0?{}:{"content-type":`application/json`}},...p===void 0?{}:{body:p},cache:`no-store`})}catch(e){throw new n(e)}return new Response(m.body,{status:m.status,headers:{"cache-control":`no-store`,"content-type":m.headers.get(`content-type`)??`application/json`}})}function s(e,t){return e===`GET`&&t[0]===`v1`&&t[1]===`providers`&&(t.length===2||t.length===3&&t[2]===`health`)?!0:t[0]!==`v1`||t[1]!==`connections`||t[2]===void 0||!r.test(t[2])?!1:e===`GET`?t.length===3:e===`POST`&&t.length===4&&t[3]!==void 0&&i.has(t[3])}function c(e){let n;try{n=new URL(e)}catch(e){throw new t(`Domain0 upstreamBaseUrl must be an absolute URL`,e)}if(n.protocol!==`https:`&&!l(n.hostname))throw new t(`Domain0 upstreamBaseUrl must use HTTPS outside local development`);if(n.username!==``||n.password!==``||n.search!==``||n.hash!==``)throw new t(`Domain0 upstreamBaseUrl must not contain credentials, a query, or a fragment`);return n.pathname=`${n.pathname.replace(/\/$/,``)}/`,n}function l(e){return e===`localhost`||e===`127.0.0.1`||e===`[::1]`}function u(e,t){return Response.json({error:{code:e===401?`unauthorized`:`invalid_request`,message:t}},{status:e,headers:{"cache-control":`no-store`}})}export{o as forwardDomain0ConnectionRequest};
|
|
102
2
|
//# sourceMappingURL=server.mjs.map
|
package/dist/server.mjs.map
CHANGED
|
@@ -1 +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":"
|
|
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":"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"}
|
package/dist/ui.cjs
CHANGED
|
@@ -1,12 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_sdk = require("./sdk-DJqGGxgC.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;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./sdk-Dv22iteS.cjs");exports.applyWhiteLabel=e.o,exports.createDomain0=e.t,exports.createDomain0Localizer=e.c,exports.domain0=e.n,exports.domain0TranslatedLocales=e.l,exports.interpolateWhiteLabelCopy=e.s,exports.localizedCopy=e.u,exports.mountDomain0Connect=e.a,exports.mountDomain0ConnectionFlow=e.i,exports.mountDomain0SharedFlow=e.r;
|
package/dist/ui.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as
|
|
1
|
+
import { Kt as Domain0ErrorCode, Ut as Domain0Locale, Xi as PlanWarningCode, ki as ConnectionState, pt as ProviderDetectionUnavailableReasonCode, y as Domain0WhiteLabel } from "./index-DzGqFq0D.cjs";
|
|
2
|
+
import { C as Domain0DkimSetupDocumentationClickEvent, D as Domain0SharedFlowSentEvent, E as Domain0SharedFlowGateway, O as mountDomain0Connect, S as Domain0CreateSharedFlowRequest, T as Domain0RequestCloseEvent, _ as Domain0ConnectFailureEvent, a as createDomain0, b as Domain0ConnectStepChangeEvent, c as mountDomain0SharedFlow, d as mountDomain0ConnectionFlow, f as Domain0ActiveConnection, g as Domain0ConnectErrorEvent, h as Domain0ConnectController, i as Domain0SDK, l as Domain0ConnectionFlowController, m as Domain0ConnectCloseTrigger, n as Domain0ConnectDomainsOptions, o as domain0, p as Domain0ConnectCloseEvent, r as Domain0LoadSharedFlowOptions, s as Domain0SharedFlowOptions, t as Domain0ConnectDomainOptions, u as Domain0ConnectionFlowOptions, v as Domain0ConnectOptions, w as Domain0ManualSetupDocumentationClickEvent, x as Domain0ConnectSuccessEvent, y as Domain0ConnectStep } from "./sdk-CkEDIlsq.cjs";
|
|
3
3
|
//#region src/ui/localization.d.ts
|
|
4
4
|
declare const englishMessages: {
|
|
5
5
|
readonly triggerConnectDomain: "Connect domain";
|
|
@@ -10,6 +10,9 @@ declare const englishMessages: {
|
|
|
10
10
|
readonly close: "Close";
|
|
11
11
|
readonly loadingConnection: "Loading connection details…";
|
|
12
12
|
readonly detectingProvider: "Detecting your DNS provider…";
|
|
13
|
+
readonly checkingDomain: (domain: string) => string;
|
|
14
|
+
readonly nameserverDetectionGuidance: "Reading the nameservers to find who runs this domain's DNS.";
|
|
15
|
+
readonly resolvingNameservers: "Resolving nameservers";
|
|
13
16
|
readonly detectionUnavailable: "Automatic provider detection is temporarily unavailable. Choose your DNS provider below.";
|
|
14
17
|
readonly connectionStatus: (state: string) => string;
|
|
15
18
|
readonly manualInstructionsReady: "Guided manual DNS instructions are ready.";
|
|
@@ -19,6 +22,10 @@ declare const englishMessages: {
|
|
|
19
22
|
readonly missingApplyingPlan: "The server returned an applying state without a confirmed plan";
|
|
20
23
|
readonly missingFailureDetails: "The server returned a retryable state without failure details";
|
|
21
24
|
readonly successDescription: (domain: string) => string;
|
|
25
|
+
readonly connectedHeading: (domain: string) => string;
|
|
26
|
+
readonly verifiedEveryNameserver: "Verified on every nameserver";
|
|
27
|
+
readonly successRecordsUntouched: "These records are live. Nothing else on the domain was touched.";
|
|
28
|
+
readonly backToApplication: (application: string) => string;
|
|
22
29
|
readonly dkimHeading: "Secure outgoing email with DKIM";
|
|
23
30
|
readonly dkimCheckingProvider: "Checking public MX and selector-specific DKIM DNS records…";
|
|
24
31
|
readonly dkimGuidanceUnavailable: "Email-provider detection is temporarily unavailable. No DNS changes were made.";
|
|
@@ -149,9 +156,14 @@ declare const englishMessages: {
|
|
|
149
156
|
readonly planConfirmed: "Plan confirmed. DNS changes have not been applied yet.";
|
|
150
157
|
readonly applyDnsChanges: "Apply DNS changes";
|
|
151
158
|
readonly applyingDnsChanges: "Applying the confirmed DNS changes…";
|
|
159
|
+
readonly applyingVerifiedChanges: "Applying verified changes";
|
|
160
|
+
readonly connectingDomain: (domain: string) => string;
|
|
161
|
+
readonly applyingProgressGuidance: "Domain0 is updating only the requested DNS records. You can safely leave this open.";
|
|
162
|
+
readonly waitingForProvider: "Waiting for provider";
|
|
152
163
|
readonly dnsChangesApplied: "DNS changes were applied. Ready to verify authoritative propagation.";
|
|
153
164
|
readonly detectionReasonNoStablePublicProviderIdentity: "This provider does not publish a stable public identity that Domain0 can safely detect from DNS.";
|
|
154
165
|
readonly manualGuidance: "Use guided manual setup to add the exact required DNS records without sharing provider credentials.";
|
|
166
|
+
readonly manualSetupLabel: "Manual setup";
|
|
155
167
|
readonly manualSetupUnavailableHeading: "Manual setup unavailable";
|
|
156
168
|
readonly manualSetupUnavailableDescription: "Manual DNS setup is disabled by this application. Use another available verified path, or cancel or close this connection.";
|
|
157
169
|
readonly showDnsRecords: "Show DNS records";
|
|
@@ -180,6 +192,8 @@ declare const englishMessages: {
|
|
|
180
192
|
readonly requiredRecordsActive: "Required DNS records are active.";
|
|
181
193
|
readonly propagationPending: "DNS changes have not reached every authoritative nameserver yet. You can check again.";
|
|
182
194
|
readonly providerFailureHeading: "Provider operation needs attention";
|
|
195
|
+
readonly needsAttention: "Needs attention";
|
|
196
|
+
readonly connectionNeedsAttention: (domain: string) => string;
|
|
183
197
|
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.";
|
|
184
198
|
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.";
|
|
185
199
|
readonly timeoutRecorded: "The timeout was recorded at {DATE}.";
|
|
@@ -203,6 +217,11 @@ declare const englishMessages: {
|
|
|
203
217
|
readonly preparingProviderSelection: "Preparing provider selection…";
|
|
204
218
|
readonly providerDetected: (provider: string) => string;
|
|
205
219
|
readonly providerSelected: (provider: string) => string;
|
|
220
|
+
readonly detectedFromNameservers: "Detected from nameservers";
|
|
221
|
+
readonly providerSelectedEyebrow: "Provider selected";
|
|
222
|
+
readonly providerConnectHeading: (provider: string) => string;
|
|
223
|
+
readonly hostApplication: "This application";
|
|
224
|
+
readonly providerApprovalGuidance: (provider: string, application: string) => string;
|
|
206
225
|
readonly preparingManualInstructions: "Preparing guided manual DNS instructions…";
|
|
207
226
|
readonly manualSetupNotEntered: "The server did not enter guided manual setup";
|
|
208
227
|
readonly noProviderDetected: "No provider was identified automatically. Choose your DNS provider below.";
|
|
@@ -283,5 +302,5 @@ declare function localizedCopy(copy: Readonly<{
|
|
|
283
302
|
declare function applyWhiteLabel(root: HTMLElement, whiteLabel: Domain0WhiteLabel): void;
|
|
284
303
|
declare function interpolateWhiteLabelCopy(template: string, replacements: Readonly<Record<string, string>>): string;
|
|
285
304
|
//#endregion
|
|
286
|
-
export { Domain0ActiveConnection, Domain0ConnectCloseEvent,
|
|
305
|
+
export { Domain0ActiveConnection, Domain0ConnectCloseEvent, Domain0ConnectCloseTrigger, Domain0ConnectController, Domain0ConnectDomainOptions, Domain0ConnectDomainsOptions, Domain0ConnectErrorEvent, Domain0ConnectFailureEvent, 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 };
|
|
287
306
|
//# sourceMappingURL=ui.d.cts.map
|
package/dist/ui.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as
|
|
1
|
+
import { Kt as Domain0ErrorCode, Ut as Domain0Locale, Xi as PlanWarningCode, ki as ConnectionState, pt as ProviderDetectionUnavailableReasonCode, y as Domain0WhiteLabel } from "./index-DzGqFq0D.mjs";
|
|
2
|
+
import { C as Domain0DkimSetupDocumentationClickEvent, D as Domain0SharedFlowSentEvent, E as Domain0SharedFlowGateway, O as mountDomain0Connect, S as Domain0CreateSharedFlowRequest, T as Domain0RequestCloseEvent, _ as Domain0ConnectFailureEvent, a as createDomain0, b as Domain0ConnectStepChangeEvent, c as mountDomain0SharedFlow, d as mountDomain0ConnectionFlow, f as Domain0ActiveConnection, g as Domain0ConnectErrorEvent, h as Domain0ConnectController, i as Domain0SDK, l as Domain0ConnectionFlowController, m as Domain0ConnectCloseTrigger, n as Domain0ConnectDomainsOptions, o as domain0, p as Domain0ConnectCloseEvent, r as Domain0LoadSharedFlowOptions, s as Domain0SharedFlowOptions, t as Domain0ConnectDomainOptions, u as Domain0ConnectionFlowOptions, v as Domain0ConnectOptions, w as Domain0ManualSetupDocumentationClickEvent, x as Domain0ConnectSuccessEvent, y as Domain0ConnectStep } from "./sdk-D2QNoMIg.mjs";
|
|
3
3
|
//#region src/ui/localization.d.ts
|
|
4
4
|
declare const englishMessages: {
|
|
5
5
|
readonly triggerConnectDomain: "Connect domain";
|
|
@@ -10,6 +10,9 @@ declare const englishMessages: {
|
|
|
10
10
|
readonly close: "Close";
|
|
11
11
|
readonly loadingConnection: "Loading connection details…";
|
|
12
12
|
readonly detectingProvider: "Detecting your DNS provider…";
|
|
13
|
+
readonly checkingDomain: (domain: string) => string;
|
|
14
|
+
readonly nameserverDetectionGuidance: "Reading the nameservers to find who runs this domain's DNS.";
|
|
15
|
+
readonly resolvingNameservers: "Resolving nameservers";
|
|
13
16
|
readonly detectionUnavailable: "Automatic provider detection is temporarily unavailable. Choose your DNS provider below.";
|
|
14
17
|
readonly connectionStatus: (state: string) => string;
|
|
15
18
|
readonly manualInstructionsReady: "Guided manual DNS instructions are ready.";
|
|
@@ -19,6 +22,10 @@ declare const englishMessages: {
|
|
|
19
22
|
readonly missingApplyingPlan: "The server returned an applying state without a confirmed plan";
|
|
20
23
|
readonly missingFailureDetails: "The server returned a retryable state without failure details";
|
|
21
24
|
readonly successDescription: (domain: string) => string;
|
|
25
|
+
readonly connectedHeading: (domain: string) => string;
|
|
26
|
+
readonly verifiedEveryNameserver: "Verified on every nameserver";
|
|
27
|
+
readonly successRecordsUntouched: "These records are live. Nothing else on the domain was touched.";
|
|
28
|
+
readonly backToApplication: (application: string) => string;
|
|
22
29
|
readonly dkimHeading: "Secure outgoing email with DKIM";
|
|
23
30
|
readonly dkimCheckingProvider: "Checking public MX and selector-specific DKIM DNS records…";
|
|
24
31
|
readonly dkimGuidanceUnavailable: "Email-provider detection is temporarily unavailable. No DNS changes were made.";
|
|
@@ -149,9 +156,14 @@ declare const englishMessages: {
|
|
|
149
156
|
readonly planConfirmed: "Plan confirmed. DNS changes have not been applied yet.";
|
|
150
157
|
readonly applyDnsChanges: "Apply DNS changes";
|
|
151
158
|
readonly applyingDnsChanges: "Applying the confirmed DNS changes…";
|
|
159
|
+
readonly applyingVerifiedChanges: "Applying verified changes";
|
|
160
|
+
readonly connectingDomain: (domain: string) => string;
|
|
161
|
+
readonly applyingProgressGuidance: "Domain0 is updating only the requested DNS records. You can safely leave this open.";
|
|
162
|
+
readonly waitingForProvider: "Waiting for provider";
|
|
152
163
|
readonly dnsChangesApplied: "DNS changes were applied. Ready to verify authoritative propagation.";
|
|
153
164
|
readonly detectionReasonNoStablePublicProviderIdentity: "This provider does not publish a stable public identity that Domain0 can safely detect from DNS.";
|
|
154
165
|
readonly manualGuidance: "Use guided manual setup to add the exact required DNS records without sharing provider credentials.";
|
|
166
|
+
readonly manualSetupLabel: "Manual setup";
|
|
155
167
|
readonly manualSetupUnavailableHeading: "Manual setup unavailable";
|
|
156
168
|
readonly manualSetupUnavailableDescription: "Manual DNS setup is disabled by this application. Use another available verified path, or cancel or close this connection.";
|
|
157
169
|
readonly showDnsRecords: "Show DNS records";
|
|
@@ -180,6 +192,8 @@ declare const englishMessages: {
|
|
|
180
192
|
readonly requiredRecordsActive: "Required DNS records are active.";
|
|
181
193
|
readonly propagationPending: "DNS changes have not reached every authoritative nameserver yet. You can check again.";
|
|
182
194
|
readonly providerFailureHeading: "Provider operation needs attention";
|
|
195
|
+
readonly needsAttention: "Needs attention";
|
|
196
|
+
readonly connectionNeedsAttention: (domain: string) => string;
|
|
183
197
|
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.";
|
|
184
198
|
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.";
|
|
185
199
|
readonly timeoutRecorded: "The timeout was recorded at {DATE}.";
|
|
@@ -203,6 +217,11 @@ declare const englishMessages: {
|
|
|
203
217
|
readonly preparingProviderSelection: "Preparing provider selection…";
|
|
204
218
|
readonly providerDetected: (provider: string) => string;
|
|
205
219
|
readonly providerSelected: (provider: string) => string;
|
|
220
|
+
readonly detectedFromNameservers: "Detected from nameservers";
|
|
221
|
+
readonly providerSelectedEyebrow: "Provider selected";
|
|
222
|
+
readonly providerConnectHeading: (provider: string) => string;
|
|
223
|
+
readonly hostApplication: "This application";
|
|
224
|
+
readonly providerApprovalGuidance: (provider: string, application: string) => string;
|
|
206
225
|
readonly preparingManualInstructions: "Preparing guided manual DNS instructions…";
|
|
207
226
|
readonly manualSetupNotEntered: "The server did not enter guided manual setup";
|
|
208
227
|
readonly noProviderDetected: "No provider was identified automatically. Choose your DNS provider below.";
|
|
@@ -283,5 +302,5 @@ declare function localizedCopy(copy: Readonly<{
|
|
|
283
302
|
declare function applyWhiteLabel(root: HTMLElement, whiteLabel: Domain0WhiteLabel): void;
|
|
284
303
|
declare function interpolateWhiteLabelCopy(template: string, replacements: Readonly<Record<string, string>>): string;
|
|
285
304
|
//#endregion
|
|
286
|
-
export { Domain0ActiveConnection, Domain0ConnectCloseEvent,
|
|
305
|
+
export { Domain0ActiveConnection, Domain0ConnectCloseEvent, Domain0ConnectCloseTrigger, Domain0ConnectController, Domain0ConnectDomainOptions, Domain0ConnectDomainsOptions, Domain0ConnectErrorEvent, Domain0ConnectFailureEvent, 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 };
|
|
287
306
|
//# sourceMappingURL=ui.d.mts.map
|
package/dist/ui.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { applyWhiteLabel, createDomain0, createDomain0Localizer, domain0, domain0TranslatedLocales, interpolateWhiteLabelCopy, localizedCopy, mountDomain0Connect, mountDomain0ConnectionFlow, mountDomain0SharedFlow };
|
|
1
|
+
import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c,u as l}from"./sdk-BbUuEwzs.mjs";export{a as applyWhiteLabel,c as createDomain0,t as createDomain0Localizer,i as domain0,r as domain0TranslatedLocales,s as interpolateWhiteLabelCopy,l as localizedCopy,e as mountDomain0Connect,n as mountDomain0ConnectionFlow,o as mountDomain0SharedFlow};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "domain0",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Type-safe SDK and embeddable UI for the open-source Domain0 domain connection platform",
|
|
5
5
|
"author": "Domain0",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -93,6 +93,10 @@
|
|
|
93
93
|
"prepublishOnly": "bun run build"
|
|
94
94
|
},
|
|
95
95
|
"dependencies": {
|
|
96
|
+
"class-variance-authority": "^0.7.1",
|
|
97
|
+
"clsx": "^2.1.1",
|
|
98
|
+
"react": "19.2.8",
|
|
99
|
+
"react-dom": "19.2.8",
|
|
96
100
|
"zod": "^4.4.3"
|
|
97
101
|
},
|
|
98
102
|
"devDependencies": {
|
|
@@ -100,6 +104,8 @@
|
|
|
100
104
|
"@asteasolutions/zod-to-openapi": "^9.1.0",
|
|
101
105
|
"@playwright/test": "1.62.1",
|
|
102
106
|
"@types/node": "^26.4.0",
|
|
107
|
+
"@types/react": "^19.2.14",
|
|
108
|
+
"@types/react-dom": "^19.2.3",
|
|
103
109
|
"axe-core": "^4.13.0",
|
|
104
110
|
"fast-check": "^4.9.0",
|
|
105
111
|
"jsdom": "^30.0.1",
|
package/dist/error-BB4-lyc4.cjs
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
//#region src/client/error.ts
|
|
2
|
-
var Domain0Error = class extends Error {
|
|
3
|
-
status;
|
|
4
|
-
response;
|
|
5
|
-
constructor(status, response) {
|
|
6
|
-
super(response.error.message);
|
|
7
|
-
this.name = "Domain0Error";
|
|
8
|
-
this.status = status;
|
|
9
|
-
this.response = response;
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
var Domain0ProtocolError = class extends Error {
|
|
13
|
-
cause;
|
|
14
|
-
constructor(message, cause) {
|
|
15
|
-
super(message);
|
|
16
|
-
this.name = "Domain0ProtocolError";
|
|
17
|
-
this.cause = cause;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
var Domain0TransportError = class extends Error {
|
|
21
|
-
cause;
|
|
22
|
-
constructor(cause) {
|
|
23
|
-
super("The Domain0 API could not be reached");
|
|
24
|
-
this.name = "Domain0TransportError";
|
|
25
|
-
this.cause = cause;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
//#endregion
|
|
29
|
-
Object.defineProperty(exports, "Domain0Error", {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
get: function() {
|
|
32
|
-
return Domain0Error;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
Object.defineProperty(exports, "Domain0ProtocolError", {
|
|
36
|
-
enumerable: true,
|
|
37
|
-
get: function() {
|
|
38
|
-
return Domain0ProtocolError;
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
Object.defineProperty(exports, "Domain0TransportError", {
|
|
42
|
-
enumerable: true,
|
|
43
|
-
get: function() {
|
|
44
|
-
return Domain0TransportError;
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
//# sourceMappingURL=error-BB4-lyc4.cjs.map
|
package/dist/error-Cyd6a9ay.mjs
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
//#region src/client/error.ts
|
|
2
|
-
var Domain0Error = class extends Error {
|
|
3
|
-
status;
|
|
4
|
-
response;
|
|
5
|
-
constructor(status, response) {
|
|
6
|
-
super(response.error.message);
|
|
7
|
-
this.name = "Domain0Error";
|
|
8
|
-
this.status = status;
|
|
9
|
-
this.response = response;
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
var Domain0ProtocolError = class extends Error {
|
|
13
|
-
cause;
|
|
14
|
-
constructor(message, cause) {
|
|
15
|
-
super(message);
|
|
16
|
-
this.name = "Domain0ProtocolError";
|
|
17
|
-
this.cause = cause;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
var Domain0TransportError = class extends Error {
|
|
21
|
-
cause;
|
|
22
|
-
constructor(cause) {
|
|
23
|
-
super("The Domain0 API could not be reached");
|
|
24
|
-
this.name = "Domain0TransportError";
|
|
25
|
-
this.cause = cause;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
//#endregion
|
|
29
|
-
export { Domain0ProtocolError as n, Domain0TransportError as r, Domain0Error as t };
|
|
30
|
-
|
|
31
|
-
//# sourceMappingURL=error-Cyd6a9ay.mjs.map
|