@aglyn/tenant-data-admin 1.20.1 → 1.20.3

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../libs/tenant/data/admin/src/lib/server/tenant-dns-check.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CNAME_TARGET, HOST_APEX_ADDRESSES } from '@aglyn/aglyn/app-utils/tenant-dns-targets'\nimport { promises as dns, Resolver as CallbackResolver } from 'dns'\nimport { PUBLIC_DNS_RESOLVERS as PUBLIC_RESOLVERS } from './dns-probe'\n\n/**\n * WHETHER A NAME POINTS AT THE TENANT EDGE: the check behind\n * `/api/domains/verify`, here so a caller with no request of its own reads\n * the same answer (AGL-3963). The domains plugin's one-click DNS asks it after\n * a DNS provider wrote the records, and its sweep asks it again for a session\n * whose owner closed the tab; neither can import the console app, and a\n * second copy of this rule is how the displayed target and the accepted one\n * came apart before (AGL-733).\n *\n * The targets are `@aglyn/aglyn/app-utils/tenant-dns-targets`, the values the\n * connect card prints.\n */\n\n/** A domain as the check accepts one: labels of letters, digits and hyphens. */\nexport const TENANT_DNS_DOMAIN_PATTERN = /^(?!-)[a-z0-9-]{1,63}(\\.[a-z0-9-]{1,63})+$/i\n\n/**\n * Resolve against public resolvers rather than the runtime's default (AGL-734).\n *\n * A stale zone left over from a nameserver migration made Vercel's own resolver\n * return NXDOMAIN for records that every public resolver could see — so a\n * correctly-configured domain reported \"no CNAME record found\" indefinitely,\n * while `dig` from anywhere else resolved it fine. Pinning the resolver makes\n * the check depend on public DNS, which is what the customer's browser will use\n * anyway, instead of on whatever cache a given lambda inherited.\n *\n * Falls back to the default resolver if the pinned ones are unreachable, so a\n * blocked egress path degrades to today's behaviour rather than failing shut.\n */\n\nasync function resolveCnameRecords(domain: string): Promise<string[]> {\n const normalise = (records: string[]) =>\n records.map((record) => record.toLowerCase().replace(/\\.$/, ''))\n try {\n const resolver = new CallbackResolver()\n resolver.setServers(PUBLIC_RESOLVERS)\n const records = await new Promise<string[]>((resolve, reject) => {\n resolver.resolveCname(domain, (error, addresses) =>\n error ? reject(error) : resolve(addresses),\n )\n })\n return normalise(records)\n } catch (error) {\n // ENOTFOUND/ENODATA are real answers — the name has no CNAME. Only fall\n // back when the pinned resolvers could not be reached at all.\n const code = (error as NodeJS.ErrnoException)?.code\n if (code === 'ENOTFOUND' || code === 'ENODATA' || code === 'NXDOMAIN') {\n return []\n }\n try {\n return normalise(await dns.resolveCname(domain))\n } catch {\n return []\n }\n }\n}\n\nasync function resolveARecords(domain: string): Promise<string[]> {\n const lookup = async (resolver?: CallbackResolver) =>\n resolver\n ? new Promise<string[]>((resolve, reject) => {\n resolver.resolve4(domain, (error, addresses) =>\n error ? reject(error) : resolve(addresses),\n )\n })\n : dns.resolve4(domain)\n try {\n const resolver = new CallbackResolver()\n resolver.setServers(PUBLIC_RESOLVERS)\n return await lookup(resolver)\n } catch (error) {\n const code = (error as NodeJS.ErrnoException)?.code\n if (code === 'ENOTFOUND' || code === 'ENODATA' || code === 'NXDOMAIN') {\n return []\n }\n try {\n return await lookup()\n } catch {\n return []\n }\n }\n}\n\n/**\n * An apex (`aglyn.com`) cannot carry a CNAME — RFC 1034 forbids one alongside\n * the SOA/NS records every zone apex must have. So the CNAME check below can\n * never pass for a bare domain, and until this existed the wizard simply\n * refused every apex: customers could connect `www.` and nothing else.\n *\n * Instead, compare where the domain actually lands against where the CNAME\n * target lands. Both sides are resolved at check time rather than compared to\n * a hardcoded address list, because the edge IPs behind `sites.aglyn.app` are\n * the host's to change — pinning them here would turn a routine infrastructure\n * change into every customer's domain reporting itself broken.\n *\n * An intersection, not equality: the two names legitimately return different\n * subsets of the same anycast pool from one lookup to the next.\n *\n * `HOST_APEX_ADDRESSES` covers the case the intersection cannot: our platform\n * host publishes a small anycast pool for every apex it serves, routing by\n * `Host` rather than by IP. An apex pointed there therefore never shares an\n * address with `sites.aglyn.app`, yet is configured correctly.\n *\n * The list has to span the host's WHOLE pool, not just the address we happen\n * to have used. It shipped with only `76.76.21.21` — the host's legacy\n * address, which still resolves but is no longer what a newly-pointed apex\n * lands on, so every new customer would have failed the very check this\n * fallback exists to let them pass. Our own zones are the proof: after taking\n * the host's recommended records, `aglyn.com` and `aglyn.io` resolve into the\n * `216.198.79.x` / `64.29.17.x` range and not one of them is the legacy\n * address. Keep the legacy entry — zones still pointed at it work fine.\n *\n * Accepting an address match is deliberately a weaker claim — \"this domain\n * resolves to our platform\" rather than \"to this account\". That is sound\n * because it is not the ownership check: attaching a domain to the project is,\n * and the platform performs that itself. This only answers \"has DNS been\n * pointed yet\", which is what the customer is actually stuck on. Configurable\n * so the next range expansion is an env edit rather than a patch.\n *\n * The list itself lives in `tenant-dns-targets.ts` beside `CNAME_TARGET`, so the\n * wizard prints an address this check will actually accept rather than keeping\n * its own copy under a different env var (AGL-1275) — that env edit is exactly\n * the move which used to leave the two disagreeing.\n */\n/**\n * The `stray` half exists because the intersection above is deliberately an\n * `some`, and a name can answer with our addresses AND somebody else's at the\n * same time (AGL-1913).\n *\n * That is the shape a stale A record makes: a previous host's address left in\n * the zone answers alongside a correct ALIAS, the resolver hands out whichever\n * it likes, and the site loads for one visitor and not the next. Every check we\n * had reported that domain as verified, because it is — some of the time — and\n * \"it works when I try it\" is exactly why nobody finds it.\n *\n * Reported, not refused. Refusing would mean treating \"an address we do not\n * recognise\" as proof of misconfiguration, and the recognised set is an env var\n * plus a live lookup of one hostname: the day the platform widens its pool\n * ahead of our config, refusing would fail every correctly-pointed apex at\n * once. A warning costs a confused customer nothing and cannot take the flow\n * down.\n */\nasync function apexPointsAtTenantEdge(\n domain: string,\n): Promise<{ matched: boolean; stray: string[] }> {\n const [domainAddresses, targetAddresses] = await Promise.all([\n resolveARecords(domain),\n resolveARecords(CNAME_TARGET),\n ])\n if (!domainAddresses.length) return { matched: false, stray: [] }\n const acceptable = new Set([...targetAddresses, ...HOST_APEX_ADDRESSES])\n return {\n matched: domainAddresses.some((address) => acceptable.has(address)),\n stray: domainAddresses.filter((address) => !acceptable.has(address)),\n }\n}\n\n/** What the check found for one name, as `/api/domains/verify` answers it. */\nexport interface TenantDnsCheck {\n domain: string\n /** The name's CNAME targets, lowercased; empty when it carries none. */\n records: string[]\n /** The CNAME target a subdomain must name. */\n expected: string\n verified: boolean\n /** Set when an apex passed by the addresses it lands on. */\n matchedBy?: 'apex-address'\n /** Addresses answering for the name that are not ours (AGL-1913). */\n strayAddresses?: string[]\n}\n\n/**\n * Resolves `domain` and answers whether it points at the tenant edge: its\n * CNAME names `CNAME_TARGET`, or, carrying no CNAME, its addresses are ours.\n *\n * `softPass` accepts ANY CNAME and belongs to local development alone, where\n * nothing points at the edge. A caller passes `isDevelopmentRuntime()` and\n * never a guess: a soft pass that keys on a missing hosting variable is the\n * AGL-2180 hole, where any domain with any CNAME verified on a container.\n *\n * Expects a lowercased name that matched {@link TENANT_DNS_DOMAIN_PATTERN}.\n * Never throws: an unreachable resolver reads as no records.\n */\nexport async function checkTenantDnsPointing(\n domain: string,\n options: { softPass?: boolean } = {},\n): Promise<TenantDnsCheck> {\n // NXDOMAIN / no CNAME comes back as an empty list — reported as unverified.\n const records = await resolveCnameRecords(domain)\n const cnameVerified =\n records.includes(CNAME_TARGET) || (options.softPass === true && records.length > 0)\n // Only fall back to the address comparison when there is no CNAME at all.\n // A domain that DOES carry a CNAME but points somewhere else must keep\n // failing — otherwise \"pointed at the wrong place\" and \"pointed at an apex\"\n // would verify identically.\n const apex = records.length\n ? { matched: false, stray: [] as string[] }\n : await apexPointsAtTenantEdge(domain)\n return {\n domain,\n records,\n expected: CNAME_TARGET,\n verified: cnameVerified || apex.matched,\n // Which rule passed, so the wizard can explain itself rather than just\n // showing a tick.\n ...(apex.matched && { matchedBy: 'apex-address' as const }),\n // Addresses answering for the name that are not ours. A verified domain\n // with a non-empty list here is the one that loads intermittently.\n ...(apex.stray.length ? { strayAddresses: apex.stray } : {}),\n }\n}\n"],"names":["CNAME_TARGET","HOST_APEX_ADDRESSES","promises","dns","Resolver","CallbackResolver","PUBLIC_DNS_RESOLVERS","PUBLIC_RESOLVERS","TENANT_DNS_DOMAIN_PATTERN","resolveCnameRecords","domain","normalise","records","map","record","toLowerCase","replace","resolver","setServers","Promise","resolve","reject","resolveCname","error","addresses","code","resolveARecords","lookup","resolve4","apexPointsAtTenantEdge","domainAddresses","targetAddresses","all","length","matched","stray","acceptable","Set","some","address","has","filter","checkTenantDnsPointing","options","cnameVerified","includes","softPass","apex","expected","verified","matchedBy","strayAddresses"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,YAAY,EAAEC,mBAAmB,QAAQ,4CAA2C;AAC7F,SAASC,YAAYC,GAAG,EAAEC,YAAYC,gBAAgB,QAAQ,MAAK;AACnE,SAASC,wBAAwBC,gBAAgB,QAAQ,iBAAa;AAEtE;;;;;;;;;;;CAWC,GAED,8EAA8E,GAC9E,OAAO,MAAMC,4BAA4B,8CAA6C;AAEtF;;;;;;;;;;;;CAYC,GAED,eAAeC,oBAAoBC,MAAc;IAC/C,MAAMC,YAAY,CAACC,UACjBA,QAAQC,GAAG,CAAC,CAACC,SAAWA,OAAOC,WAAW,GAAGC,OAAO,CAAC,OAAO;IAC9D,IAAI;QACF,MAAMC,WAAW,IAAIZ;QACrBY,SAASC,UAAU,CAACX;QACpB,MAAMK,UAAU,MAAM,IAAIO,QAAkB,CAACC,SAASC;YACpDJ,SAASK,YAAY,CAACZ,QAAQ,CAACa,OAAOC,YACpCD,QAAQF,OAAOE,SAASH,QAA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QACLiC,SAASJ,gBAAgBQ,IAAI,CAAC,CAACC,UAAYH,WAAWI,GAAG,CAACD;QAC1DJ,OAAOL,gBAAgBW,MAAM,CAAC,CAACF,UAAY,CAACH,WAAWI,GAAG,CAACD;IAC7D;AACF;AAgBA;;;;;;;;;;;CAWC,GACD,OAAO,eAAeG,uBACpBhC,MAAc,EACdiC,UAAkC,CAAC,CAAC;IAEpC,4EAA4E;IAC5E,MAAM/B,UAAU,MAAMH,oBAAoBC;IAC1C,MAAMkC,gBACJhC,QAAQiC,QAAQ,CAAC7C,iBAAkB2C,QAAQG,QAAQ,KAAK,QAAQlC,QAAQqB,MAAM,GAAG;IACnF,0EAA0E;IAC1E,uEAAuE;IACvE,4EAA4E;IAC5E,4BAA4B;IAC5B,MAAMc,OAAOnC,QAAQqB,MAAM,GACvB;QAAEC,SAAS;QAAOC,OAAO,EAAE;IAAa,IACxC,MAAMN,uBAAuBnB;IACjC,OAAO;QACLA;QACAE;QACAoC,UAAUhD;QACViD,UAAUL,iBAAiBG,KAAKb,OAAO;OAGnCa,KAAKb,OAAO,IAAI;QAAEgB,WAAW;IAAwB,GAGrDH,KAAKZ,KAAK,CAACF,MAAM,GAAG;QAAEkB,gBAAgBJ,KAAKZ,KAAK;IAAC,IAAI,CAAC;AAE9D"}
1
+ {"version":3,"sources":["../../../../../../../../libs/tenant/data/admin/src/lib/server/tenant-dns-check.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CNAME_TARGET, HOST_APEX_ADDRESSES } from '@aglyn/aglyn/app-utils/tenant-dns-targets'\nimport { promises as dns, Resolver as CallbackResolver } from 'dns'\nimport { PUBLIC_DNS_RESOLVERS as PUBLIC_RESOLVERS } from './dns-probe'\n\n/**\n * WHETHER A NAME POINTS AT THE TENANT EDGE: the check behind\n * `/api/domains/verify`, here so a caller with no request of its own reads\n * the same answer (AGL-3963). The domains plugin's one-click DNS asks it after\n * a DNS provider wrote the records, and its sweep asks it again for a session\n * whose owner closed the tab; neither can import the console app, and a\n * second copy of this rule is how the displayed target and the accepted one\n * came apart before (AGL-733).\n *\n * The targets are `@aglyn/aglyn/app-utils/tenant-dns-targets`, the values the\n * connect card prints.\n */\n\n/** A domain as the check accepts one: labels of letters, digits and hyphens. */\nexport const TENANT_DNS_DOMAIN_PATTERN = /^(?!-)[a-z0-9-]{1,63}(\\.[a-z0-9-]{1,63})+$/i\n\n/**\n * Resolve against public resolvers rather than the runtime's default (AGL-734).\n *\n * A stale zone left over from a nameserver migration made Vercel's own resolver\n * return NXDOMAIN for records that every public resolver could see — so a\n * correctly-configured domain reported \"no CNAME record found\" indefinitely,\n * while `dig` from anywhere else resolved it fine. Pinning the resolver makes\n * the check depend on public DNS, which is what the customer's browser will use\n * anyway, instead of on whatever cache a given lambda inherited.\n *\n * Falls back to the default resolver if the pinned ones are unreachable, so a\n * blocked egress path degrades to today's behaviour rather than failing shut.\n */\n\nasync function resolveCnameRecords(domain: string): Promise<string[]> {\n const normalise = (records: string[]) =>\n records.map((record) => record.toLowerCase().replace(/\\.$/, ''))\n try {\n const resolver = new CallbackResolver()\n resolver.setServers(PUBLIC_RESOLVERS)\n const records = await new Promise<string[]>((resolve, reject) => {\n resolver.resolveCname(domain, (error, addresses) =>\n error ? reject(error) : resolve(addresses),\n )\n })\n return normalise(records)\n } catch (error) {\n // ENOTFOUND/ENODATA are real answers — the name has no CNAME. Only fall\n // back when the pinned resolvers could not be reached at all.\n const code = (error as NodeJS.ErrnoException)?.code\n if (code === 'ENOTFOUND' || code === 'ENODATA' || code === 'NXDOMAIN') {\n return []\n }\n try {\n return normalise(await dns.resolveCname(domain))\n } catch {\n return []\n }\n }\n}\n\nasync function resolveARecords(domain: string): Promise<string[]> {\n const lookup = async (resolver?: CallbackResolver) =>\n resolver\n ? new Promise<string[]>((resolve, reject) => {\n resolver.resolve4(domain, (error, addresses) =>\n error ? reject(error) : resolve(addresses),\n )\n })\n : dns.resolve4(domain)\n try {\n const resolver = new CallbackResolver()\n resolver.setServers(PUBLIC_RESOLVERS)\n return await lookup(resolver)\n } catch (error) {\n const code = (error as NodeJS.ErrnoException)?.code\n if (code === 'ENOTFOUND' || code === 'ENODATA' || code === 'NXDOMAIN') {\n return []\n }\n try {\n return await lookup()\n } catch {\n return []\n }\n }\n}\n\n/**\n * The most an IPv6 check may add to a request (AGL-3963). It is advice beside\n * a check that already answered, so a slow resolver gives up and reads as\n * \"nothing found\" rather than holding the domain card or the button.\n */\nconst IPV6_LOOKUP_BUDGET_MS = 2_000\n\nfunction withinIpv6Budget<T>(work: Promise<T>, fallback: T): Promise<T> {\n let timer: ReturnType<typeof setTimeout> | undefined\n const late = new Promise<T>((resolve) => {\n timer = setTimeout(() => resolve(fallback), IPV6_LOOKUP_BUDGET_MS)\n })\n return Promise.race([work.catch(() => fallback), late]).finally(() => clearTimeout(timer))\n}\n\n/** One spelling per address, so `2001:DB8:0::1` and `2001:db8::1` match. */\nfunction normaliseIpv6(address: string): string {\n const trimmed = address.trim()\n try {\n return new URL(`http://[${trimmed}]`).hostname.replace(/^\\[|\\]$/g, '')\n } catch {\n return trimmed.toLowerCase()\n }\n}\n\n/**\n * AAAA records on the public resolvers, one short try each. No fallback to\n * the runtime's resolver, unlike the A check: this is advice, and a second\n * slow lookup would only spend the budget.\n */\nasync function resolveAaaaRecords(domain: string): Promise<string[]> {\n try {\n const resolver = new CallbackResolver({ timeout: 1_500, tries: 1 })\n resolver.setServers(PUBLIC_RESOLVERS)\n const records = await new Promise<string[]>((resolve, reject) => {\n resolver.resolve6(domain, (error, addresses) => (error ? reject(error) : resolve(addresses)))\n })\n return records.map(normaliseIpv6)\n } catch {\n return []\n }\n}\n\n/**\n * Each name's IPv6 addresses that the tenant edge does not answer with, with\n * the edge looked up once. A name carrying a CNAME is skipped: a resolver\n * follows the CNAME, so those addresses are its target's, and the record to\n * fix is the CNAME, which the A side already reports.\n */\nasync function strayIpv6ByName(names: readonly string[]): Promise<Map<string, string[]>> {\n const work = (async () => {\n const [edge, ...answers] = await Promise.all([\n resolveAaaaRecords(CNAME_TARGET),\n ...names.map(async (name) => {\n const [cnames, addresses] = await Promise.all([resolveCnameRecords(name), resolveAaaaRecords(name)])\n return { name, addresses: cnames.length ? [] : addresses }\n }),\n ])\n const ours = new Set(edge as string[])\n const found = new Map<string, string[]>()\n for (const answer of answers as Array<{ name: string; addresses: string[] }>) {\n const strays = answer.addresses.filter((address) => !ours.has(address))\n if (strays.length) found.set(answer.name, strays)\n }\n return found\n })()\n return withinIpv6Budget(work, new Map<string, string[]>())\n}\n\n/**\n * IPv6 addresses answering for `domain` that the tenant edge does not answer\n * with: the AAAA record a previous host left on the zone root (AGL-3963).\n *\n * Pointing a domain here replaces its A record (by hand, or through Domain\n * Connect, whose `website` template writes `A @`), and nothing replaces the\n * AAAA beside it. A visitor on IPv6 then reaches the previous host, and the\n * edge's certificate challenge over IPv6 can fail with it. Cloudflare named\n * this case when it onboarded our templates (2026-10-29).\n *\n * Today the edge answers no AAAA at all, so any AAAA on the name is a stray.\n * The edge's own answer is subtracted anyway, so an edge that starts\n * publishing IPv6 on `CNAME_TARGET` does not warn every customer at once; an\n * IPv6 apex pool like `HOST_APEX_ADDRESSES` would need adding here too.\n * Reported, never refused, for the same reason as `stray` below. Never throws,\n * and gives up after `IPV6_LOOKUP_BUDGET_MS`: no answer reads as none.\n */\nexport async function strayIpv6Addresses(domain: string): Promise<string[]> {\n return (await strayIpv6ByName([domain])).get(domain) ?? []\n}\n\n/** A record answering for a name that is not ours, as the status card lists it. */\nexport interface TenantDnsConflict {\n type?: string\n name?: string\n value?: string\n}\n\nfunction conflictKey(type: unknown, name: unknown, value: unknown): string {\n const kind = String(type ?? '').toUpperCase()\n const host = String(name ?? '').trim().toLowerCase().replace(/\\.+$/, '')\n const data = kind === 'AAAA' ? normaliseIpv6(String(value ?? '')) : String(value ?? '').trim().toLowerCase()\n return [kind, host, data].join('|')\n}\n\n/**\n * `conflicts` with each stray IPv6 address of `names` added as an AAAA entry,\n * unless the platform already listed it (AGL-3963). The platform's own DNS\n * check is not relied on to name these: it is the A record it checks. Never\n * throws; within `IPV6_LOOKUP_BUDGET_MS`.\n */\nexport async function withStrayIpv6Conflicts(\n names: readonly string[],\n conflicts: readonly TenantDnsConflict[],\n): Promise<TenantDnsConflict[]> {\n const merged = [...conflicts]\n const listed = new Set(conflicts.map((conflict) => conflictKey(conflict.type, conflict.name, conflict.value)))\n const strays = await strayIpv6ByName(names)\n for (const [name, addresses] of strays) {\n for (const value of addresses) {\n const key = conflictKey('AAAA', name, value)\n if (listed.has(key)) continue\n listed.add(key)\n merged.push({ type: 'AAAA', name, value })\n }\n }\n return merged\n}\n\n/**\n * An apex (`aglyn.com`) cannot carry a CNAME — RFC 1034 forbids one alongside\n * the SOA/NS records every zone apex must have. So the CNAME check below can\n * never pass for a bare domain, and until this existed the wizard simply\n * refused every apex: customers could connect `www.` and nothing else.\n *\n * Instead, compare where the domain actually lands against where the CNAME\n * target lands. Both sides are resolved at check time rather than compared to\n * a hardcoded address list, because the edge IPs behind `sites.aglyn.app` are\n * the host's to change — pinning them here would turn a routine infrastructure\n * change into every customer's domain reporting itself broken.\n *\n * An intersection, not equality: the two names legitimately return different\n * subsets of the same anycast pool from one lookup to the next.\n *\n * `HOST_APEX_ADDRESSES` covers the case the intersection cannot: our platform\n * host publishes a small anycast pool for every apex it serves, routing by\n * `Host` rather than by IP. An apex pointed there therefore never shares an\n * address with `sites.aglyn.app`, yet is configured correctly.\n *\n * The list has to span the host's WHOLE pool, not just the address we happen\n * to have used. It shipped with only `76.76.21.21` — the host's legacy\n * address, which still resolves but is no longer what a newly-pointed apex\n * lands on, so every new customer would have failed the very check this\n * fallback exists to let them pass. Our own zones are the proof: after taking\n * the host's recommended records, `aglyn.com` and `aglyn.io` resolve into the\n * `216.198.79.x` / `64.29.17.x` range and not one of them is the legacy\n * address. Keep the legacy entry — zones still pointed at it work fine.\n *\n * Accepting an address match is deliberately a weaker claim — \"this domain\n * resolves to our platform\" rather than \"to this account\". That is sound\n * because it is not the ownership check: attaching a domain to the project is,\n * and the platform performs that itself. This only answers \"has DNS been\n * pointed yet\", which is what the customer is actually stuck on. Configurable\n * so the next range expansion is an env edit rather than a patch.\n *\n * The list itself lives in `tenant-dns-targets.ts` beside `CNAME_TARGET`, so the\n * wizard prints an address this check will actually accept rather than keeping\n * its own copy under a different env var (AGL-1275) — that env edit is exactly\n * the move which used to leave the two disagreeing.\n */\n/**\n * The `stray` half exists because the intersection above is deliberately an\n * `some`, and a name can answer with our addresses AND somebody else's at the\n * same time (AGL-1913).\n *\n * That is the shape a stale A record makes: a previous host's address left in\n * the zone answers alongside a correct ALIAS, the resolver hands out whichever\n * it likes, and the site loads for one visitor and not the next. Every check we\n * had reported that domain as verified, because it is — some of the time — and\n * \"it works when I try it\" is exactly why nobody finds it.\n *\n * Reported, not refused. Refusing would mean treating \"an address we do not\n * recognise\" as proof of misconfiguration, and the recognised set is an env var\n * plus a live lookup of one hostname: the day the platform widens its pool\n * ahead of our config, refusing would fail every correctly-pointed apex at\n * once. A warning costs a confused customer nothing and cannot take the flow\n * down.\n */\nasync function apexPointsAtTenantEdge(\n domain: string,\n): Promise<{ matched: boolean; stray: string[] }> {\n const [domainAddresses, targetAddresses] = await Promise.all([\n resolveARecords(domain),\n resolveARecords(CNAME_TARGET),\n ])\n if (!domainAddresses.length) return { matched: false, stray: [] }\n const acceptable = new Set([...targetAddresses, ...HOST_APEX_ADDRESSES])\n return {\n matched: domainAddresses.some((address) => acceptable.has(address)),\n stray: domainAddresses.filter((address) => !acceptable.has(address)),\n }\n}\n\n/** What the check found for one name, as `/api/domains/verify` answers it. */\nexport interface TenantDnsCheck {\n domain: string\n /** The name's CNAME targets, lowercased; empty when it carries none. */\n records: string[]\n /** The CNAME target a subdomain must name. */\n expected: string\n verified: boolean\n /** Set when an apex passed by the addresses it lands on. */\n matchedBy?: 'apex-address'\n /** Addresses answering for the name that are not ours (AGL-1913). */\n strayAddresses?: string[]\n /** IPv6 addresses answering for the name that are not ours (AGL-3963). */\n strayIpv6Addresses?: string[]\n}\n\n/**\n * Resolves `domain` and answers whether it points at the tenant edge: its\n * CNAME names `CNAME_TARGET`, or, carrying no CNAME, its addresses are ours.\n *\n * `softPass` accepts ANY CNAME and belongs to local development alone, where\n * nothing points at the edge. A caller passes `isDevelopmentRuntime()` and\n * never a guess: a soft pass that keys on a missing hosting variable is the\n * AGL-2180 hole, where any domain with any CNAME verified on a container.\n *\n * Expects a lowercased name that matched {@link TENANT_DNS_DOMAIN_PATTERN}.\n * Never throws: an unreachable resolver reads as no records.\n */\nexport async function checkTenantDnsPointing(\n domain: string,\n options: { softPass?: boolean } = {},\n): Promise<TenantDnsCheck> {\n // NXDOMAIN / no CNAME comes back as an empty list — reported as unverified.\n const records = await resolveCnameRecords(domain)\n const cnameVerified =\n records.includes(CNAME_TARGET) || (options.softPass === true && records.length > 0)\n // Only fall back to the address comparison when there is no CNAME at all.\n // A domain that DOES carry a CNAME but points somewhere else must keep\n // failing — otherwise \"pointed at the wrong place\" and \"pointed at an apex\"\n // would verify identically.\n const [apex, strayIpv6] = records.length\n ? [{ matched: false, stray: [] as string[] }, [] as string[]]\n : await Promise.all([apexPointsAtTenantEdge(domain), strayIpv6Addresses(domain)])\n return {\n domain,\n records,\n expected: CNAME_TARGET,\n verified: cnameVerified || apex.matched,\n // Which rule passed, so the wizard can explain itself rather than just\n // showing a tick.\n ...(apex.matched && { matchedBy: 'apex-address' as const }),\n // Addresses answering for the name that are not ours. A verified domain\n // with a non-empty list here is the one that loads intermittently.\n ...(apex.stray.length ? { strayAddresses: apex.stray } : {}),\n // The previous host's AAAA, which pointing the A record here left in\n // place: IPv6 visitors still reach that host (AGL-3963).\n ...(strayIpv6.length ? { strayIpv6Addresses: strayIpv6 } : {}),\n }\n}\n"],"names":["CNAME_TARGET","HOST_APEX_ADDRESSES","promises","dns","Resolver","CallbackResolver","PUBLIC_DNS_RESOLVERS","PUBLIC_RESOLVERS","TENANT_DNS_DOMAIN_PATTERN","resolveCnameRecords","domain","normalise","records","map","record","toLowerCase","replace","resolver","setServers","Promise","resolve","reject","resolveCname","error","addresses","code","resolveARecords","lookup","resolve4","IPV6_LOOKUP_BUDGET_MS","withinIpv6Budget","work","fallback","timer","late","setTimeout","race","catch","finally","clearTimeout","normaliseIpv6","address","trimmed","trim","URL","hostname","resolveAaaaRecords","timeout","tries","resolve6","strayIpv6ByName","names","edge","answers","all","name","cnames","length","ours","Set","found","Map","answer","strays","filter","has","set","strayIpv6Addresses","get","conflictKey","type","value","kind","String","toUpperCase","host","data","join","withStrayIpv6Conflicts","conflicts","merged","listed","conflict","key","add","push","apexPointsAtTenantEdge","domainAddresses","targetAddresses","matched","stray","acceptable","some","checkTenantDnsPointing","options","cnameVerified","includes","softPass","apex","strayIpv6","expected","verified","matchedBy","strayAddresses"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,YAAY,EAAEC,mBAAmB,QAAQ,4CAA2C;AAC7F,SAASC,YAAYC,GAAG,EAAEC,YAAYC,gBAAgB,QAAQ,MAAK;AACnE,SAASC,wBAAwBC,gBAAgB,QAAQ,iBAAa;AAEtE;;;;;;;;;;;CAWC,GAED,8EAA8E,GAC9E,OAAO,MAAMC,4BAA4B,8CAA6C;AAEtF;;;;;;;;;;;;CAYC,GAED,eAAeC,oBAAoBC,MAAc;IAC/C,MAAMC,YAAY,CAACC,UACjBA,QAAQC,GAAG,CAAC,CAACC,SAAWA,OAAOC,WAAW,GAAGC,OAAO,CAAC,OAAO;IAC9D,IAAI;QACF,MAAMC,WAAW,IAAIZ;QACrBY,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ACAwF,UAAUpG;QACVqG,UAAUN,iBAAiBG,KAAKT,OAAO;OAGnCS,KAAKT,OAAO,IAAI;QAAEa,WAAW;IAAwB,GAGrDJ,KAAKR,KAAK,CAACjC,MAAM,GAAG;QAAE8C,gBAAgBL,KAAKR,KAAK;IAAC,IAAI,CAAC,GAGtDS,UAAU1C,MAAM,GAAG;QAAEU,oBAAoBgC;IAAU,IAAI,CAAC;AAEhE"}
package/src/tenancy.d.ts CHANGED
@@ -20,7 +20,7 @@ export * from './lib/server/api-keys';
20
20
  export * from './lib/server/account-emails';
21
21
  export * from './lib/server/auth-pools';
22
22
  export * from './lib/server/client-error-report';
23
- export { accountChargeModel, connectedAccountHeader, DIRECT_CHARGE_ACCOUNT_PARAMS, directChargeParams, merchantAccountIsReady, merchantAccountReadiness, paymentProvider, saleChargeModel, } from './lib/server/payment-provider';
23
+ export { accountChargeModel, connectedAccountHeader, DIRECT_CHARGE_ACCOUNT_PARAMS, directChargeParams, merchantAccountInOtherMode, merchantAccountIsReady, merchantAccountReadiness, merchantAccountReplacement, paymentProvider, PREVIOUS_MERCHANT_ACCOUNTS_FIELD, saleChargeModel, } from './lib/server/payment-provider';
24
24
  export type { SaleChargeModel, MerchantAccountReadiness, MerchantAccountReadinessInput, PaymentMode, PaymentProvider, PaymentProviderEvent, } from './lib/server/payment-provider';
25
25
  export * from './lib/server/auth-handoff';
26
26
  export * from './lib/server/console-domains';
package/src/tenancy.js CHANGED
@@ -23,7 +23,7 @@ export * from "./lib/server/client-error-report.js";
23
23
  // a plugin asks the contract, and the doors that only need the readiness rule
24
24
  // import `@aglyn/tenant-data-admin/server/payment-provider` directly, which
25
25
  // loads no Firebase.
26
- export { accountChargeModel, connectedAccountHeader, DIRECT_CHARGE_ACCOUNT_PARAMS, directChargeParams, merchantAccountIsReady, merchantAccountReadiness, paymentProvider, saleChargeModel } from "./lib/server/payment-provider.js";
26
+ export { accountChargeModel, connectedAccountHeader, DIRECT_CHARGE_ACCOUNT_PARAMS, directChargeParams, merchantAccountInOtherMode, merchantAccountIsReady, merchantAccountReadiness, merchantAccountReplacement, paymentProvider, PREVIOUS_MERCHANT_ACCOUNTS_FIELD, saleChargeModel } from "./lib/server/payment-provider.js";
27
27
  export * from "./lib/server/auth-handoff.js";
28
28
  export * from "./lib/server/console-domains.js";
29
29
  export * from "./lib/server/dns-probe.js";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../libs/tenant/data/admin/src/tenancy.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './lib/server/analytics-retention'\nexport * from './lib/server/api-http'\nexport * from './lib/server/api-keys'\nexport * from './lib/server/account-emails'\nexport * from './lib/server/auth-pools'\nexport * from './lib/server/client-error-report'\n// The merchant's payment account, as a contract. Its adapter is not exported:\n// a plugin asks the contract, and the doors that only need the readiness rule\n// import `@aglyn/tenant-data-admin/server/payment-provider` directly, which\n// loads no Firebase.\nexport {\n accountChargeModel,\n connectedAccountHeader,\n DIRECT_CHARGE_ACCOUNT_PARAMS,\n directChargeParams,\n merchantAccountIsReady,\n merchantAccountReadiness,\n paymentProvider,\n saleChargeModel,\n} from './lib/server/payment-provider'\nexport type {\n SaleChargeModel,\n MerchantAccountReadiness,\n MerchantAccountReadinessInput,\n PaymentMode,\n PaymentProvider,\n PaymentProviderEvent,\n} from './lib/server/payment-provider'\nexport * from './lib/server/auth-handoff'\nexport * from './lib/server/console-domains'\nexport * from './lib/server/dns-probe'\n// Whether a name points at the tenant edge, for the verify route and the\n// domains plugin's one-click DNS (AGL-3963).\nexport * from './lib/server/tenant-dns-check'\nexport * from './lib/server/sending-domains'\nexport * from './lib/server/sender-readiness'\nexport * from './lib/server/host-sending-domain'\nexport * from './lib/server/sending-domain-debt'\nexport * from './lib/server/sending-domain-recheck'\n// The hosting seam itself, so a door can ask whether this deployment is able\n// to register a name at all before it promises the caller one.\n// `workspace-domains` re-exports the pieces its own callers share with it; the\n// provider behind it is not among them.\nexport { domainProvider } from './lib/server/domain-provider'\nexport type {\n DomainProvider,\n DomainProviderId,\n DomainScope,\n} from './lib/server/domain-provider'\nexport * from './lib/server/platform-domain-names'\nexport * from './lib/server/consume-once'\nexport * from './lib/server/csp-aggregate'\nexport * from './lib/server/data-storage-gate'\nexport * from './lib/server/contact-suppression'\nexport * from './lib/server/email-suppression'\n// The double opt-in quarantine, after the module whose keying it shares and\n// whose `filterTopicSendable` is the reader that makes it a quarantine rather\n// than a stored fact.\nexport * from './lib/server/topic-subscriptions'\nexport * from './lib/server/email-unsubscribe-link'\nexport * from './lib/server/email-flow-gate'\n// Side-effecting on purpose, for the reason `email-send-rate` below is:\n// evaluating this module INSTALLS the marketing gate on `sendEmail`, so the\n// unsubscribe header, the suppression check and the frequency ceiling reach\n// every bulk sender without a call at each server entrypoint.\nexport * from './lib/server/email-marketing-gate'\n// A consent group change (AGL-3320): the carries of the three stores above,\n// and the executor that runs a change around them.\nexport * from './lib/server/consent-group-carry'\nexport * from './lib/server/consent-group-change'\n// A person's refusal kept after the record it was written on is deleted\n// (AGL-3338): the delete's write, the list gate's read, and the change's carry.\nexport * from './lib/server/retained-refusals'\nexport * from './lib/server/sms-keywords'\nexport * from './lib/server/document-id'\nexport * from './lib/server/collection-preview-token'\nexport * from './lib/server/edit-access-authz'\nexport * from './lib/server/edit-access-token'\nexport * from './lib/server/edit-hint-token'\nexport * from './lib/server/email-metering'\n// Side-effecting on purpose (AGL-2409): evaluating this module INSTALLS the\n// platform send-rate governor on `sendEmail`. Every server surface already\n// imports this barrel, so nothing has to remember to call an installer.\nexport * from './lib/server/email-send-rate'\n// Side-effecting on purpose, for the same reason (AGL-4145): evaluating this\n// module INSTALLS the daily transactional ceiling on `sendEmail`, so a site's\n// non-campaign mail is counted per organization per UTC day on every send\n// path at once.\nexport * from './lib/server/email-transactional-ceiling'\n// Side-effecting on purpose, for the same reason (AGL-3328): evaluating this\n// module INSTALLS the deliverability preflight on `sendEmail`, so a recipient\n// whose domain takes no mail is refused, and bulk mail behind a gateway that\n// refused its sending domain twice is held, on every send path at once.\nexport * from './lib/server/email-deliverability'\nexport * from './lib/server/email-sender-reputation'\nexport * from './lib/server/erase'\nexport * from './lib/server/erase-person'\nexport * from './lib/server/dynamic-list-materialize'\nexport * from './lib/server/firebase-admin'\nexport * from './lib/server/free-workspace-cap'\nexport * from './lib/server/ga4-measurement-protocol'\nexport * from './lib/server/host-memberships'\n// Connecting a name to a site, for the attach route and for plugins that\n// bought the name (AGL-3961).\nexport * from './lib/server/host-custom-domain'\nexport * from './lib/server/custom-domain-redirects'\nexport * from './lib/server/host-visitor-records'\nexport * from './lib/server/list-members'\nexport * from './lib/server/lockdown'\nexport * from './lib/server/token-revocation'\nexport * from './lib/server/tenant-write-lockdown'\nexport * from './lib/server/outbound-send-review'\n// The same review for a published page, read where it is composed (AGL-3356).\nexport * from './lib/server/hosted-page-review'\n// Every hold, flag, lock and pause tells owners and staff through one seam (AGL-3368).\nexport * from './lib/server/risk-notice'\nexport * from './lib/server/host-email-tokens'\nexport * from './lib/server/notifications'\n// Every operator alert raises through one entry point, and every health check\n// remembers its state (AGL-3377).\nexport * from './lib/server/operator-alerts'\nexport * from './lib/server/operator-health'\nexport * from './lib/server/org-billing'\nexport * from './lib/server/organizations'\n// Per-member permission overrides, org-wide and per site (AGL-4047).\nexport * from './lib/server/member-permission-overrides'\n// Platform staff take no customer seat, and a workspace is asked to upgrade\n// as a separate step after it is handed over (AGL-3466).\nexport * from './lib/server/staff-seat'\nexport * from './lib/server/upgrade-proposal'\nexport * from './lib/server/duplicate-activity'\nexport * from './lib/server/duplicate-resource'\nexport * from './lib/server/workspace-domains'\nexport * from './lib/server/membership-recover-throttle'\nexport * from './lib/server/password-reset-throttle'\nexport * from './lib/server/rate-limit-store'\nexport * from './lib/server/verify-email-cooldown'\nexport * from './lib/server/vercel-drain-signature'\nexport * from './lib/server/vercel-log-drain'\nexport * from './lib/server/visitor-write-rate-limit'\nexport * from './lib/server/card-payment-velocity'\nexport * from './lib/server/console-api-rate-limit'\nexport * from './lib/server/realm-plugins'\nexport * from './lib/server/release-flags'\nexport * from './lib/server/resolve-people'\nexport * from './lib/server/member-photo'\nexport * from './lib/server/personal-data-export'\nexport * from './lib/server/media-delivery'\nexport * from './lib/server/media-download-tokens'\nexport * from './lib/server/media-quarantine'\nexport * from './lib/server/media-signing'\nexport * from './lib/server/media-storage-path'\nexport * from './lib/server/safe-equal'\nexport * from './lib/server/media-strong-digest'\nexport * from './lib/server/media-tombstone'\nexport * from './lib/server/media-delivery-regeneration'\nexport * from './lib/server/media-variants'\nexport * from './lib/server/media-photo-links'\n// The one-screen build for a client (AGL-3958): staff hold its record.\nexport * from './lib/server/client-build'\nexport * from './lib/server/serve-media-cdn'\nexport * from './lib/server/serve-plugin-fetch'\nexport * from './lib/server/configured-url-fetch'\nexport * from './lib/server/sso-break-glass-owners'\nexport * from './lib/server/sso-domain-policy'\nexport * from './lib/server/sso-enforcement'\nexport * from './lib/server/sso-provisioning'\nexport * from './lib/server/update-existing'\nexport * from './lib/server/contact-company-link'\nexport * from './lib/server/contact-email-index'\nexport * from './lib/server/upsert-contact'\nexport * from './lib/server/crm-records'\n// The `nextTaskAtMs` a contact, a company and a deal carry, recomputed from\n// their open tasks by every server-side task writer (AGL-2661).\n// Where a one-to-one email's activity row lives and how the delivery\n// webhook advances it (AGL-2615).\n// A member's own addresses in a workspace, and the signed link that\n// confirms one (AGL-2975).\nexport * from './lib/server/member-email-aliases'\nexport * from './lib/server/user-profiles'\n// One answer to an account's name and photo, and the SSO sign-in fill of a\n// blank Auth record (AGL-3721).\nexport * from './lib/server/account-identity'\n// The one \"New account\" staff notice per account, keyed on the auth\n// record's creation (AGL-3225).\nexport * from './lib/server/new-account-announcement'\nexport * from './lib/server/legal-acceptance'\n// The person's decision about the platform's own product email, on their\n// document and on the operator's marketing contact (AGL-3185).\nexport * from './lib/server/platform-marketing-consent'\n"],"names":["accountChargeModel","connectedAccountHeader","DIRECT_CHARGE_ACCOUNT_PARAMS","directChargeParams","merchantAccountIsReady","merchantAccountReadiness","paymentProvider","saleChargeModel","domainProvider"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,cAAc,sCAAkC;AAChD,cAAc,2BAAuB;AACrC,cAAc,2BAAuB;AACrC,cAAc,iCAA6B;AAC3C,cAAc,6BAAyB;AACvC,cAAc,sCAAkC;AAChD,8EAA8E;AAC9E,8EAA8E;AAC9E,4EAA4E;AAC5E,qBAAqB;AACrB,SACEA,kBAAkB,EAClBC,sBAAsB,EACtBC,4BAA4B,EAC5BC,kBAAkB,EAClBC,sBAAsB,EACtBC,wBAAwB,EACxBC,eAAe,EACfC,eAAe,QACV,mCAA+B;AAStC,cAAc,+BAA2B;AACzC,cAAc,kCAA8B;AAC5C,cAAc,4BAAwB;AACtC,yEAAyE;AACzE,6CAA6C;AAC7C,cAAc,mCAA+B;AAC7C,cAAc,kCAA8B;AAC5C,cAAc,mCAA+B;AAC7C,cAAc,sCAAkC;AAChD,cAAc,sCAAkC;AAChD,cAAc,yCAAqC;AACnD,6EAA6E;AAC7E,+DAA+D;AAC/D,+EAA+E;AAC/E,wCAAwC;AACxC,SAASC,cAAc,QAAQ,kCAA8B;AAM7D,cAAc,wCAAoC;AAClD,cAAc,+BAA2B;AACzC,cAAc,gCAA4B;AAC1C,cAAc,oCAAgC;AAC9C,cAAc,sCAAkC;AAChD,cAAc,oCAAgC;AAC9C,4EAA4E;AAC5E,8EAA8E;AAC9E,sBAAsB;AACtB,cAAc,sCAAkC;AAChD,cAAc,yCAAqC;AACnD,cAAc,kCAA8B;AAC5C,wEAAwE;A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3,"sources":["../../../../../../libs/tenant/data/admin/src/tenancy.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './lib/server/analytics-retention'\nexport * from './lib/server/api-http'\nexport * from './lib/server/api-keys'\nexport * from './lib/server/account-emails'\nexport * from './lib/server/auth-pools'\nexport * from './lib/server/client-error-report'\n// The merchant's payment account, as a contract. Its adapter is not exported:\n// a plugin asks the contract, and the doors that only need the readiness rule\n// import `@aglyn/tenant-data-admin/server/payment-provider` directly, which\n// loads no Firebase.\nexport {\n accountChargeModel,\n connectedAccountHeader,\n DIRECT_CHARGE_ACCOUNT_PARAMS,\n directChargeParams,\n merchantAccountInOtherMode,\n merchantAccountIsReady,\n merchantAccountReadiness,\n merchantAccountReplacement,\n paymentProvider,\n PREVIOUS_MERCHANT_ACCOUNTS_FIELD,\n saleChargeModel,\n} from './lib/server/payment-provider'\nexport type {\n SaleChargeModel,\n MerchantAccountReadiness,\n MerchantAccountReadinessInput,\n PaymentMode,\n PaymentProvider,\n PaymentProviderEvent,\n} from './lib/server/payment-provider'\nexport * from './lib/server/auth-handoff'\nexport * from './lib/server/console-domains'\nexport * from './lib/server/dns-probe'\n// Whether a name points at the tenant edge, for the verify route and the\n// domains plugin's one-click DNS (AGL-3963).\nexport * from './lib/server/tenant-dns-check'\nexport * from './lib/server/sending-domains'\nexport * from './lib/server/sender-readiness'\nexport * from './lib/server/host-sending-domain'\nexport * from './lib/server/sending-domain-debt'\nexport * from './lib/server/sending-domain-recheck'\n// The hosting seam itself, so a door can ask whether this deployment is able\n// to register a name at all before it promises the caller one.\n// `workspace-domains` re-exports the pieces its own callers share with it; the\n// provider behind it is not among them.\nexport { domainProvider } from './lib/server/domain-provider'\nexport type {\n DomainProvider,\n DomainProviderId,\n DomainScope,\n} from './lib/server/domain-provider'\nexport * from './lib/server/platform-domain-names'\nexport * from './lib/server/consume-once'\nexport * from './lib/server/csp-aggregate'\nexport * from './lib/server/data-storage-gate'\nexport * from './lib/server/contact-suppression'\nexport * from './lib/server/email-suppression'\n// The double opt-in quarantine, after the module whose keying it shares and\n// whose `filterTopicSendable` is the reader that makes it a quarantine rather\n// than a stored fact.\nexport * from './lib/server/topic-subscriptions'\nexport * from './lib/server/email-unsubscribe-link'\nexport * from './lib/server/email-flow-gate'\n// Side-effecting on purpose, for the reason `email-send-rate` below is:\n// evaluating this module INSTALLS the marketing gate on `sendEmail`, so the\n// unsubscribe header, the suppression check and the frequency ceiling reach\n// every bulk sender without a call at each server entrypoint.\nexport * from './lib/server/email-marketing-gate'\n// A consent group change (AGL-3320): the carries of the three stores above,\n// and the executor that runs a change around them.\nexport * from './lib/server/consent-group-carry'\nexport * from './lib/server/consent-group-change'\n// A person's refusal kept after the record it was written on is deleted\n// (AGL-3338): the delete's write, the list gate's read, and the change's carry.\nexport * from './lib/server/retained-refusals'\nexport * from './lib/server/sms-keywords'\nexport * from './lib/server/document-id'\nexport * from './lib/server/collection-preview-token'\nexport * from './lib/server/edit-access-authz'\nexport * from './lib/server/edit-access-token'\nexport * from './lib/server/edit-hint-token'\nexport * from './lib/server/email-metering'\n// Side-effecting on purpose (AGL-2409): evaluating this module INSTALLS the\n// platform send-rate governor on `sendEmail`. Every server surface already\n// imports this barrel, so nothing has to remember to call an installer.\nexport * from './lib/server/email-send-rate'\n// Side-effecting on purpose, for the same reason (AGL-4145): evaluating this\n// module INSTALLS the daily transactional ceiling on `sendEmail`, so a site's\n// non-campaign mail is counted per organization per UTC day on every send\n// path at once.\nexport * from './lib/server/email-transactional-ceiling'\n// Side-effecting on purpose, for the same reason (AGL-3328): evaluating this\n// module INSTALLS the deliverability preflight on `sendEmail`, so a recipient\n// whose domain takes no mail is refused, and bulk mail behind a gateway that\n// refused its sending domain twice is held, on every send path at once.\nexport * from './lib/server/email-deliverability'\nexport * from './lib/server/email-sender-reputation'\nexport * from './lib/server/erase'\nexport * from './lib/server/erase-person'\nexport * from './lib/server/dynamic-list-materialize'\nexport * from './lib/server/firebase-admin'\nexport * from './lib/server/free-workspace-cap'\nexport * from './lib/server/ga4-measurement-protocol'\nexport * from './lib/server/host-memberships'\n// Connecting a name to a site, for the attach route and for plugins that\n// bought the name (AGL-3961).\nexport * from './lib/server/host-custom-domain'\nexport * from './lib/server/custom-domain-redirects'\nexport * from './lib/server/host-visitor-records'\nexport * from './lib/server/list-members'\nexport * from './lib/server/lockdown'\nexport * from './lib/server/token-revocation'\nexport * from './lib/server/tenant-write-lockdown'\nexport * from './lib/server/outbound-send-review'\n// The same review for a published page, read where it is composed (AGL-3356).\nexport * from './lib/server/hosted-page-review'\n// Every hold, flag, lock and pause tells owners and staff through one seam (AGL-3368).\nexport * from './lib/server/risk-notice'\nexport * from './lib/server/host-email-tokens'\nexport * from './lib/server/notifications'\n// Every operator alert raises through one entry point, and every health check\n// remembers its state (AGL-3377).\nexport * from './lib/server/operator-alerts'\nexport * from './lib/server/operator-health'\nexport * from './lib/server/org-billing'\nexport * from './lib/server/organizations'\n// Per-member permission overrides, org-wide and per site (AGL-4047).\nexport * from './lib/server/member-permission-overrides'\n// Platform staff take no customer seat, and a workspace is asked to upgrade\n// as a separate step after it is handed over (AGL-3466).\nexport * from './lib/server/staff-seat'\nexport * from './lib/server/upgrade-proposal'\nexport * from './lib/server/duplicate-activity'\nexport * from './lib/server/duplicate-resource'\nexport * from './lib/server/workspace-domains'\nexport * from './lib/server/membership-recover-throttle'\nexport * from './lib/server/password-reset-throttle'\nexport * from './lib/server/rate-limit-store'\nexport * from './lib/server/verify-email-cooldown'\nexport * from './lib/server/vercel-drain-signature'\nexport * from './lib/server/vercel-log-drain'\nexport * from './lib/server/visitor-write-rate-limit'\nexport * from './lib/server/card-payment-velocity'\nexport * from './lib/server/console-api-rate-limit'\nexport * from './lib/server/realm-plugins'\nexport * from './lib/server/release-flags'\nexport * from './lib/server/resolve-people'\nexport * from './lib/server/member-photo'\nexport * from './lib/server/personal-data-export'\nexport * from './lib/server/media-delivery'\nexport * from './lib/server/media-download-tokens'\nexport * from './lib/server/media-quarantine'\nexport * from './lib/server/media-signing'\nexport * from './lib/server/media-storage-path'\nexport * from './lib/server/safe-equal'\nexport * from './lib/server/media-strong-digest'\nexport * from './lib/server/media-tombstone'\nexport * from './lib/server/media-delivery-regeneration'\nexport * from './lib/server/media-variants'\nexport * from './lib/server/media-photo-links'\n// The one-screen build for a client (AGL-3958): staff hold its record.\nexport * from './lib/server/client-build'\nexport * from './lib/server/serve-media-cdn'\nexport * from './lib/server/serve-plugin-fetch'\nexport * from './lib/server/configured-url-fetch'\nexport * from './lib/server/sso-break-glass-owners'\nexport * from './lib/server/sso-domain-policy'\nexport * from './lib/server/sso-enforcement'\nexport * from './lib/server/sso-provisioning'\nexport * from './lib/server/update-existing'\nexport * from './lib/server/contact-company-link'\nexport * from './lib/server/contact-email-index'\nexport * from './lib/server/upsert-contact'\nexport * from './lib/server/crm-records'\n// The `nextTaskAtMs` a contact, a company and a deal carry, recomputed from\n// their open tasks by every server-side task writer (AGL-2661).\n// Where a one-to-one email's activity row lives and how the delivery\n// webhook advances it (AGL-2615).\n// A member's own addresses in a workspace, and the signed link that\n// confirms one (AGL-2975).\nexport * from './lib/server/member-email-aliases'\nexport * from './lib/server/user-profiles'\n// One answer to an account's name and photo, and the SSO sign-in fill of a\n// blank Auth record (AGL-3721).\nexport * from './lib/server/account-identity'\n// The one \"New account\" staff notice per account, keyed on the auth\n// record's creation (AGL-3225).\nexport * from './lib/server/new-account-announcement'\nexport * from './lib/server/legal-acceptance'\n// The person's decision about the platform's own product email, on their\n// document and on the operator's marketing contact (AGL-3185).\nexport * from './lib/server/platform-marketing-consent'\n"],"names":["accountChargeModel","connectedAccountHeader","DIRECT_CHARGE_ACCOUNT_PARAMS","directChargeParams","merchantAccountInOtherMode","merchantAccountIsReady","merchantAccountReadiness","merchantAccountReplacement","paymentProvider","PREVIOUS_MERCHANT_ACCOUNTS_FIELD","saleChargeModel","domainProvider"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,cAAc,sCAAkC;AAChD,cAAc,2BAAuB;AACrC,cAAc,2BAAuB;AACrC,cAAc,iCAA6B;AAC3C,cAAc,6BAAyB;AACvC,cAAc,sCAAkC;AAChD,8EAA8E;AAC9E,8EAA8E;AAC9E,4EAA4E;AAC5E,qBAAqB;AACrB,SACEA,kBAAkB,EAClBC,sBAAsB,EACtBC,4BAA4B,EAC5BC,kBAAkB,EAClBC,0BAA0B,EAC1BC,sBAAsB,EACtBC,wBAAwB,EACxBC,0BAA0B,EAC1BC,eAAe,EACfC,gCAAgC,EAChCC,eAAe,QACV,mCAA+B;AAStC,cAAc,+BAA2B;AACzC,cAAc,kCAA8B;AAC5C,cAAc,4BAAwB;AACtC,yEAAyE;AACzE,6CAA6C;AAC7C,cAAc,mCAA+B;AAC7C,cAAc,kCAA8B;AAC5C,cAAc,mCAA+B;AAC7C,cAAc,sCAAkC;AAChD,cAAc,sCAAkC;AAChD,cAAc,yCAAqC;AACnD,6EAA6E;AAC7E,+DAA+D;AAC/D,+EAA+E;AAC/E,wCAAwC;AACxC,SAASC,cAAc,QAAQ,kCAA8B;AAM7D,cAAc,wCAAoC;AAClD,cAAc,+BAA2B;AACzC,cAAc,gCAA4B;AAC1C,cAAc,oCAAgC;AAC9C,cAAc,sCAAkC;AAChD,cAAc,oCAAgC;AAC9C,4EAA4E;AAC5E,8EAA8E;AAC9E,sBAAsB;AACtB,cAAc,sCAAkC;AAChD,cAAc,yCAAqC;AACnD,cAAc,kCAA8B;AAC5C,wEAAwE;AACxE,4EAA4E;AAC5E,4EAA4E;AAC5E,8DAA8D;AAC9D,cAAc,u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