@brandlab-digital/site-core 3.14.0 → 3.15.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 +33 -1
- package/dist/area-map.d.ts +36 -3
- package/dist/area-map.d.ts.map +1 -1
- package/dist/area-map.js +71 -11
- package/dist/area-map.js.map +1 -1
- package/dist/business.d.ts +17 -1
- package/dist/business.d.ts.map +1 -1
- package/dist/business.js +14 -2
- package/dist/business.js.map +1 -1
- package/dist/geography.js +2 -2
- package/dist/geography.js.map +1 -1
- package/dist/jobs.d.ts +6 -3
- package/dist/jobs.d.ts.map +1 -1
- package/dist/jobs.js +12 -3
- package/dist/jobs.js.map +1 -1
- package/dist/project.d.ts +23 -0
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +33 -1
- package/dist/project.js.map +1 -1
- package/dist/section-order.d.ts +3 -2
- package/dist/section-order.d.ts.map +1 -1
- package/dist/section-order.js +15 -3
- package/dist/section-order.js.map +1 -1
- package/dist/strategy.d.ts +36 -0
- package/dist/strategy.d.ts.map +1 -1
- package/dist/strategy.js +40 -0
- package/dist/strategy.js.map +1 -1
- package/package.json +1 -1
package/dist/jobs.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* The job log (`src/data/jobs.ts`, 3.14.0): one row per completed job the owner has confirmed, shared by `NearbyJobs`,
|
|
3
3
|
* project cards, the area map's job places and head-tier decisions. A job names its suburb (registry slug), service
|
|
4
4
|
* and what was done; its month is optional, because owners often remember the job but not when (a card then shows the
|
|
5
|
-
* suburb without a date: "
|
|
5
|
+
* suburb without "Recent" or a date: "Tree removal nearby: Ryde"). Photos are media-manifest ids, so each carries its
|
|
6
6
|
* provenance; only genuine photos of that job may illustrate it.
|
|
7
7
|
*
|
|
8
8
|
* Distances rank job cards and are never printed: location copy carries no kilometre figures (L10).
|
|
@@ -41,13 +41,16 @@ export declare function jobPhotos(job: BrandlabJob, media: BrandlabMediaManifest
|
|
|
41
41
|
readonly id: string;
|
|
42
42
|
})[];
|
|
43
43
|
/**
|
|
44
|
-
* A job card's label: "
|
|
45
|
-
*
|
|
44
|
+
* A job card's label: "{Service} in {Suburb}" for the page's own suburb, "{Service} nearby: {Suburb}" for any other
|
|
45
|
+
* (L4 needs the "nearby" label). Only a dated job says "Recent" (or `prefix`; `''` for none) and ends with
|
|
46
|
+
* ", {Month Year}": "Recent tree removal nearby: Ryde, May 2026", but "Tree removal nearby: Ryde" when the month is
|
|
47
|
+
* unknown, because an undated job may not be recent.
|
|
46
48
|
*/
|
|
47
49
|
export declare function jobCardLabel(job: BrandlabJob, options: {
|
|
48
50
|
readonly service: string;
|
|
49
51
|
readonly suburbName: string;
|
|
50
52
|
readonly pageSuburb?: string;
|
|
53
|
+
readonly prefix?: string;
|
|
51
54
|
}): string;
|
|
52
55
|
export interface BrandlabNearbyJob<T extends BrandlabJob = BrandlabJob> {
|
|
53
56
|
readonly job: T;
|
package/dist/jobs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobs.d.ts","sourceRoot":"","sources":["../src/jobs.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAExD,OAAO,KAAK,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAE3E,MAAM,WAAW,WAAW;IAC1B,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,oDAAoD;IACpD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,wDAAwD;IACxD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,wCAAwC;IACxC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,wDAAwD;IACxD,QAAQ,CAAC,MAAM,CAAC,EAAE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,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9H,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAiBxB;AAED,mHAAmH;AACnH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,WAAW,EAAE,GAAG,MAAM,EAAE,CAEhE"}
|
package/dist/jobs.js
CHANGED
|
@@ -65,13 +65,22 @@ function formatMonth(month) {
|
|
|
65
65
|
return new Intl.DateTimeFormat('en-AU', { month: 'long', year: 'numeric', timeZone: 'UTC' }).format(new Date(`${month}-01T00:00:00Z`));
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
|
-
* A job card's label: "
|
|
69
|
-
*
|
|
68
|
+
* A job card's label: "{Service} in {Suburb}" for the page's own suburb, "{Service} nearby: {Suburb}" for any other
|
|
69
|
+
* (L4 needs the "nearby" label). Only a dated job says "Recent" (or `prefix`; `''` for none) and ends with
|
|
70
|
+
* ", {Month Year}": "Recent tree removal nearby: Ryde, May 2026", but "Tree removal nearby: Ryde" when the month is
|
|
71
|
+
* unknown, because an undated job may not be recent.
|
|
70
72
|
*/
|
|
71
73
|
export function jobCardLabel(job, options) {
|
|
72
74
|
const service = options.service.trim().toLowerCase();
|
|
73
75
|
const where = job.suburb === options.pageSuburb ? `in ${options.suburbName}` : `nearby: ${options.suburbName}`;
|
|
74
|
-
|
|
76
|
+
if (!job.month)
|
|
77
|
+
return `${capitalise(service)} ${where}`;
|
|
78
|
+
const prefix = (options.prefix ?? 'Recent').trim();
|
|
79
|
+
const lead = prefix ? `${prefix} ${service}` : capitalise(service);
|
|
80
|
+
return `${lead} ${where}, ${formatMonth(job.month)}`;
|
|
81
|
+
}
|
|
82
|
+
function capitalise(text) {
|
|
83
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
75
84
|
}
|
|
76
85
|
/**
|
|
77
86
|
* The job cards for a page about `origin`: its own suburb's jobs first, then other jobs by real distance between
|
package/dist/jobs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobs.js","sourceRoot":"","sources":["../src/jobs.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAoBzD,sGAAsG;AACtG,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAA;AACjC,yCAAyC;AACzC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAA;AAE/B,MAAM,IAAI,GAAG,4BAA4B,CAAA;AACzC,MAAM,KAAK,GAAG,2BAA2B,CAAA;AACzC,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAA;AAEpF,SAAS,UAAU,CAAC,KAAc,EAAE,KAAa,EAAE,OAAe;IAChE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,OAAO,IAAI,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1I,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,iCAAiC,CAAC,CAAA;IAC5D,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAyC,IAAO,EAAE,UAAsD,EAAE;IAClI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;IACxE,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU,CAAA;IAC7B,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QAC1B,MAAM,KAAK,GAAG,QAAQ,KAAK,GAAG,CAAA;QAC9B,IAAI,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H,MAAM,UAAU,SAAS,CAAC,IAA4B;IACpD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;AACtC,CAAC","sourcesContent":["/**\n * The job log (`src/data/jobs.ts`, 3.14.0): one row per completed job the owner has confirmed, shared by `NearbyJobs`,\n * project cards, the area map's job places and head-tier decisions. A job names its suburb (registry slug), service\n * and what was done; its month is optional, because owners often remember the job but not when (a card then shows the\n * suburb without a date: \"Recent tree removal nearby: Ryde\"). Photos are media-manifest ids, so each carries its\n * provenance; only genuine photos of that job may illustrate it.\n *\n * Distances rank job cards and are never printed: location copy carries no kilometre figures (L10).\n */\nimport type { SuburbCentreLookup } from './locations.js'\nimport { distanceBetweenCentresKm } from './locations.js'\nimport type { BrandlabMediaEntry, BrandlabMediaManifest } from './media.js'\n\nexport interface BrandlabJob {\n /** A stable kebab-case id; genuine photos of the job name it in their media entry's `job`. */\n readonly id: string\n /** The registry suburb slug, for example \"ryde\". */\n readonly suburb: string\n /** The service slug, as the site's service catalogue names it. */\n readonly service: string\n /** What was done, in one line of Australian English. */\n readonly outcome: string\n /** YYYY-MM, when the owner knows it. */\n readonly month?: string\n /** Media-manifest ids of genuine photos of this job. */\n readonly photos?: readonly string[]\n /** Who confirmed the job and when, for example \"Owner, WhatsApp 3 Oct 2026\". */\n readonly source: string\n}\n\n/** Job cards show jobs within this distance of the page's suburb (v2: the 10 km cap on job cards). */\nexport const JOB_CARD_MAX_KM = 10\n/** Cards per page (playbook: 1 to 3). */\nexport const JOB_CARD_LIMIT = 3\n\nconst SLUG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/\nconst MONTH = /^\\d{4}-(?:0[1-9]|1[0-2])$/\nconst JOB_KEYS = ['id', 'suburb', 'service', 'outcome', 'month', 'photos', 'source']\n\nfunction assertText(value: unknown, field: string, maximum: number) {\n if (typeof value !== 'string' || !value.trim() || value.trim() !== value || value.length > maximum || /[\\u0000-\\u001f\\u007f]/.test(value)) {\n throw new Error(`${field} must be bounded, trimmed text.`)\n }\n}\n\n/**\n * Validates the job log. With the media manifest, every photo must exist, be `genuine` (stock and AI images never\n * stand for the client's work) and, when its entry names a job, name this one.\n */\nexport function defineJobs<const T extends readonly BrandlabJob[]>(jobs: T, options: { readonly media?: BrandlabMediaManifest } = {}): T {\n if (!Array.isArray(jobs)) throw new Error('The job log must be a list.')\n const ids = new Set<string>()\n jobs.forEach((job, index) => {\n const field = `jobs[${index}]`\n if (!job || typeof job !== 'object' || Array.isArray(job)) throw new Error(`${field} must be a record.`)\n const unknown = Object.keys(job).find((key) => !JOB_KEYS.includes(key))\n if (unknown) throw new Error(`${field}.${unknown} is not a job field.`)\n if (typeof job.id !== 'string' || !SLUG.test(job.id)) throw new Error(`${field}.id must be a kebab-case id.`)\n if (ids.has(job.id)) throw new Error(`The job log lists \"${job.id}\" more than once.`)\n ids.add(job.id)\n if (typeof job.suburb !== 'string' || !SLUG.test(job.suburb)) throw new Error(`${field}.suburb must be the registry suburb slug.`)\n if (typeof job.service !== 'string' || !SLUG.test(job.service)) throw new Error(`${field}.service must be the service slug.`)\n assertText(job.outcome, `${field}.outcome`, 300)\n assertText(job.source, `${field}.source`, 200)\n if (job.month !== undefined && (typeof job.month !== 'string' || !MONTH.test(job.month))) throw new Error(`${field}.month must be YYYY-MM, or left out.`)\n if (job.photos !== undefined) {\n if (!Array.isArray(job.photos)) throw new Error(`${field}.photos must be a list of media ids.`)\n for (const id of job.photos) {\n if (!options.media) continue\n const entry = Object.hasOwn(options.media, id) ? options.media[id] : undefined\n if (!entry) throw new Error(`${field}.photos: \"${id}\" is not in the media manifest.`)\n if (entry.provenance !== 'genuine') throw new Error(`${field}.photos: \"${id}\" is ${entry.provenance}; only genuine photos show a job.`)\n if (entry.job !== undefined && entry.job !== job.id) throw new Error(`${field}.photos: \"${id}\" is a photo of ${entry.job}, not ${job.id}.`)\n }\n }\n })\n return jobs\n}\n\n/** A job's photos from the media manifest, in order, with their ids and provenance. */\nexport function jobPhotos(job: BrandlabJob, media: BrandlabMediaManifest): (BrandlabMediaEntry & { readonly id: string })[] {\n return (job.photos ?? []).flatMap((id) => (Object.hasOwn(media, id) ? [{ id, ...media[id]! }] : []))\n}\n\nfunction formatMonth(month: string): string {\n return new Intl.DateTimeFormat('en-AU', { month: 'long', year: 'numeric', timeZone: 'UTC' }).format(new Date(`${month}-01T00:00:00Z`))\n}\n\n/**\n * A job card's label: \"Recent {service} in {Suburb}\" for the page's own suburb, \"Recent {service} nearby: {Suburb}\"\n * for any other (L4 needs the \"nearby\" label), with \", {Month Year}\" only when the month is known.\n */\nexport function jobCardLabel(job: BrandlabJob, options: { readonly service: string; readonly suburbName: string; readonly pageSuburb?: string }): string {\n const service = options.service.trim().toLowerCase()\n const where = job.suburb === options.pageSuburb ? `in ${options.suburbName}` : `nearby: ${options.suburbName}`\n return `Recent ${service} ${where}${job.month ? `, ${formatMonth(job.month)}` : ''}`\n}\n\nexport interface BrandlabNearbyJob<T extends BrandlabJob = BrandlabJob> {\n readonly job: T\n /** For ranking only; never printed. */\n readonly distanceKm: number\n readonly sameSuburb: boolean\n}\n\n/**\n * The job cards for a page about `origin`: its own suburb's jobs first, then other jobs by real distance between\n * registry centres, within `maxKm` (10) and at most `limit` (3); newest first among equals, undated last. Jobs whose\n * suburb has no centre are left out. Filter by `service` for a service-in-suburb page.\n */\nexport function nearbyJobs<T extends BrandlabJob>(\n origin: string,\n jobs: readonly T[],\n options: { readonly centreOf: SuburbCentreLookup; readonly service?: string; readonly maxKm?: number; readonly limit?: number },\n): BrandlabNearbyJob<T>[] {\n const from = options.centreOf(origin)\n if (!from) return []\n const maxKm = options.maxKm ?? JOB_CARD_MAX_KM\n const limit = options.limit ?? JOB_CARD_LIMIT\n const found: BrandlabNearbyJob<T>[] = []\n for (const job of jobs) {\n if (options.service !== undefined && job.service !== options.service) continue\n const sameSuburb = job.suburb === origin\n const to = sameSuburb ? from : options.centreOf(job.suburb)\n if (!to) continue\n const distanceKm = sameSuburb ? 0 : distanceBetweenCentresKm(from, to)\n if (distanceKm <= maxKm) found.push({ job, distanceKm, sameSuburb })\n }\n return found\n .sort((left, right) => left.distanceKm - right.distanceKm || (right.job.month ?? '').localeCompare(left.job.month ?? ''))\n .slice(0, limit)\n}\n\n/** One place per job, for the area map's job markers (`overviewMap`, `regionMap`, `suburbLocator` take `jobs`). */\nexport function jobPlaces(jobs: readonly BrandlabJob[]): string[] {\n return jobs.map((job) => job.suburb)\n}\n"]}
|
|
1
|
+
{"version":3,"file":"jobs.js","sourceRoot":"","sources":["../src/jobs.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAoBzD,sGAAsG;AACtG,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAA;AACjC,yCAAyC;AACzC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAA;AAE/B,MAAM,IAAI,GAAG,4BAA4B,CAAA;AACzC,MAAM,KAAK,GAAG,2BAA2B,CAAA;AACzC,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAA;AAEpF,SAAS,UAAU,CAAC,KAAc,EAAE,KAAa,EAAE,OAAe;IAChE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,OAAO,IAAI,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1I,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,iCAAiC,CAAC,CAAA;IAC5D,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAyC,IAAO,EAAE,UAAsD,EAAE;IAClI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,I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Q,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAC3D,IAAI,CAAC,EAAE;YAAE,SAAQ;QACjB,MAAM,UAAU,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,wBAAwB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;QACtE,IAAI,UAAU,IAAI,KAAK;YAAE,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAAA;IACtE,CAAC;IACD,OAAO,KAAK;SACT,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;SACxH,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;AACpB,CAAC;AAED,mHAAmH;AACnH,MAAM,UAAU,SAAS,CAAC,IAA4B;IACpD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;AACtC,CAAC","sourcesContent":["/**\n * The job log (`src/data/jobs.ts`, 3.14.0): one row per completed job the owner has confirmed, shared by `NearbyJobs`,\n * project cards, the area map's job places and head-tier decisions. A job names its suburb (registry slug), service\n * and what was done; its month is optional, because owners often remember the job but not when (a card then shows the\n * suburb without \"Recent\" or a date: \"Tree removal nearby: Ryde\"). Photos are media-manifest ids, so each carries its\n * provenance; only genuine photos of that job may illustrate it.\n *\n * Distances rank job cards and are never printed: location copy carries no kilometre figures (L10).\n */\nimport type { SuburbCentreLookup } from './locations.js'\nimport { distanceBetweenCentresKm } from './locations.js'\nimport type { BrandlabMediaEntry, BrandlabMediaManifest } from './media.js'\n\nexport interface BrandlabJob {\n /** A stable kebab-case id; genuine photos of the job name it in their media entry's `job`. */\n readonly id: string\n /** The registry suburb slug, for example \"ryde\". */\n readonly suburb: string\n /** The service slug, as the site's service catalogue names it. */\n readonly service: string\n /** What was done, in one line of Australian English. */\n readonly outcome: string\n /** YYYY-MM, when the owner knows it. */\n readonly month?: string\n /** Media-manifest ids of genuine photos of this job. */\n readonly photos?: readonly string[]\n /** Who confirmed the job and when, for example \"Owner, WhatsApp 3 Oct 2026\". */\n readonly source: string\n}\n\n/** Job cards show jobs within this distance of the page's suburb (v2: the 10 km cap on job cards). */\nexport const JOB_CARD_MAX_KM = 10\n/** Cards per page (playbook: 1 to 3). */\nexport const JOB_CARD_LIMIT = 3\n\nconst SLUG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/\nconst MONTH = /^\\d{4}-(?:0[1-9]|1[0-2])$/\nconst JOB_KEYS = ['id', 'suburb', 'service', 'outcome', 'month', 'photos', 'source']\n\nfunction assertText(value: unknown, field: string, maximum: number) {\n if (typeof value !== 'string' || !value.trim() || value.trim() !== value || value.length > maximum || /[\\u0000-\\u001f\\u007f]/.test(value)) {\n throw new Error(`${field} must be bounded, trimmed text.`)\n }\n}\n\n/**\n * Validates the job log. With the media manifest, every photo must exist, be `genuine` (stock and AI images never\n * stand for the client's work) and, when its entry names a job, name this one.\n */\nexport function defineJobs<const T extends readonly BrandlabJob[]>(jobs: T, options: { readonly media?: BrandlabMediaManifest } = {}): T {\n if (!Array.isArray(jobs)) throw new Error('The job log must be a list.')\n const ids = new Set<string>()\n jobs.forEach((job, index) => {\n const field = `jobs[${index}]`\n if (!job || typeof job !== 'object' || Array.isArray(job)) throw new Error(`${field} must be a record.`)\n const unknown = Object.keys(job).find((key) => !JOB_KEYS.includes(key))\n if (unknown) throw new Error(`${field}.${unknown} is not a job field.`)\n if (typeof job.id !== 'string' || !SLUG.test(job.id)) throw new Error(`${field}.id must be a kebab-case id.`)\n if (ids.has(job.id)) throw new Error(`The job log lists \"${job.id}\" more than once.`)\n ids.add(job.id)\n if (typeof job.suburb !== 'string' || !SLUG.test(job.suburb)) throw new Error(`${field}.suburb must be the registry suburb slug.`)\n if (typeof job.service !== 'string' || !SLUG.test(job.service)) throw new Error(`${field}.service must be the service slug.`)\n assertText(job.outcome, `${field}.outcome`, 300)\n assertText(job.source, `${field}.source`, 200)\n if (job.month !== undefined && (typeof job.month !== 'string' || !MONTH.test(job.month))) throw new Error(`${field}.month must be YYYY-MM, or left out.`)\n if (job.photos !== undefined) {\n if (!Array.isArray(job.photos)) throw new Error(`${field}.photos must be a list of media ids.`)\n for (const id of job.photos) {\n if (!options.media) continue\n const entry = Object.hasOwn(options.media, id) ? options.media[id] : undefined\n if (!entry) throw new Error(`${field}.photos: \"${id}\" is not in the media manifest.`)\n if (entry.provenance !== 'genuine') throw new Error(`${field}.photos: \"${id}\" is ${entry.provenance}; only genuine photos show a job.`)\n if (entry.job !== undefined && entry.job !== job.id) throw new Error(`${field}.photos: \"${id}\" is a photo of ${entry.job}, not ${job.id}.`)\n }\n }\n })\n return jobs\n}\n\n/** A job's photos from the media manifest, in order, with their ids and provenance. */\nexport function jobPhotos(job: BrandlabJob, media: BrandlabMediaManifest): (BrandlabMediaEntry & { readonly id: string })[] {\n return (job.photos ?? []).flatMap((id) => (Object.hasOwn(media, id) ? [{ id, ...media[id]! }] : []))\n}\n\nfunction formatMonth(month: string): string {\n return new Intl.DateTimeFormat('en-AU', { month: 'long', year: 'numeric', timeZone: 'UTC' }).format(new Date(`${month}-01T00:00:00Z`))\n}\n\n/**\n * A job card's label: \"{Service} in {Suburb}\" for the page's own suburb, \"{Service} nearby: {Suburb}\" for any other\n * (L4 needs the \"nearby\" label). Only a dated job says \"Recent\" (or `prefix`; `''` for none) and ends with\n * \", {Month Year}\": \"Recent tree removal nearby: Ryde, May 2026\", but \"Tree removal nearby: Ryde\" when the month is\n * unknown, because an undated job may not be recent.\n */\nexport function jobCardLabel(\n job: BrandlabJob,\n options: { readonly service: string; readonly suburbName: string; readonly pageSuburb?: string; readonly prefix?: string },\n): string {\n const service = options.service.trim().toLowerCase()\n const where = job.suburb === options.pageSuburb ? `in ${options.suburbName}` : `nearby: ${options.suburbName}`\n if (!job.month) return `${capitalise(service)} ${where}`\n const prefix = (options.prefix ?? 'Recent').trim()\n const lead = prefix ? `${prefix} ${service}` : capitalise(service)\n return `${lead} ${where}, ${formatMonth(job.month)}`\n}\n\nfunction capitalise(text: string): string {\n return text.charAt(0).toUpperCase() + text.slice(1)\n}\n\nexport interface BrandlabNearbyJob<T extends BrandlabJob = BrandlabJob> {\n readonly job: T\n /** For ranking only; never printed. */\n readonly distanceKm: number\n readonly sameSuburb: boolean\n}\n\n/**\n * The job cards for a page about `origin`: its own suburb's jobs first, then other jobs by real distance between\n * registry centres, within `maxKm` (10) and at most `limit` (3); newest first among equals, undated last. Jobs whose\n * suburb has no centre are left out. Filter by `service` for a service-in-suburb page.\n */\nexport function nearbyJobs<T extends BrandlabJob>(\n origin: string,\n jobs: readonly T[],\n options: { readonly centreOf: SuburbCentreLookup; readonly service?: string; readonly maxKm?: number; readonly limit?: number },\n): BrandlabNearbyJob<T>[] {\n const from = options.centreOf(origin)\n if (!from) return []\n const maxKm = options.maxKm ?? JOB_CARD_MAX_KM\n const limit = options.limit ?? JOB_CARD_LIMIT\n const found: BrandlabNearbyJob<T>[] = []\n for (const job of jobs) {\n if (options.service !== undefined && job.service !== options.service) continue\n const sameSuburb = job.suburb === origin\n const to = sameSuburb ? from : options.centreOf(job.suburb)\n if (!to) continue\n const distanceKm = sameSuburb ? 0 : distanceBetweenCentresKm(from, to)\n if (distanceKm <= maxKm) found.push({ job, distanceKm, sameSuburb })\n }\n return found\n .sort((left, right) => left.distanceKm - right.distanceKm || (right.job.month ?? '').localeCompare(left.job.month ?? ''))\n .slice(0, limit)\n}\n\n/** One place per job, for the area map's job markers (`overviewMap`, `regionMap`, `suburbLocator` take `jobs`). */\nexport function jobPlaces(jobs: readonly BrandlabJob[]): string[] {\n return jobs.map((job) => job.suburb)\n}\n"]}
|
package/dist/project.d.ts
CHANGED
|
@@ -53,7 +53,30 @@ export interface BrandlabSiteSystemConfig {
|
|
|
53
53
|
* and the recorded decision. Without an entry, a full-tier estate family refreshes at most weekly.
|
|
54
54
|
*/
|
|
55
55
|
refreshExceptions?: readonly BrandlabEstateRefreshException[];
|
|
56
|
+
/**
|
|
57
|
+
* What the thank-you page promises about a reply (check C7, 3.15.0). Absent or `{ promise: true }`: the page names a
|
|
58
|
+
* specific reply time ("within one business day"). `{ promise: false, ... }` records a decision to promise no time
|
|
59
|
+
* and the exact wording the page uses instead.
|
|
60
|
+
*/
|
|
61
|
+
replyTime?: BrandlabReplyTimeRecord;
|
|
56
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* The thank-you page's reply promise. A no-promise record carries the page's own wording (no time in it), who decided
|
|
65
|
+
* (the owner, or Romie for the owner) and the day the decision was made.
|
|
66
|
+
*/
|
|
67
|
+
export type BrandlabReplyTimeRecord = {
|
|
68
|
+
promise: true;
|
|
69
|
+
} | {
|
|
70
|
+
promise: false;
|
|
71
|
+
wording: string;
|
|
72
|
+
decidedBy: 'owner' | 'romie';
|
|
73
|
+
decidedOn: string;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Wording that still promises a time: a digit, minutes or hours, "same day", "next day", a business or working day,
|
|
77
|
+
* "end of the day", "today" or "tomorrow". A no-promise record's wording must not match.
|
|
78
|
+
*/
|
|
79
|
+
export declare const BRANDLAB_REPLY_TIME_PROMISE: RegExp;
|
|
57
80
|
/** The location estate families check W3 covers. */
|
|
58
81
|
export declare const BRANDLAB_ESTATE_REFRESH_FAMILIES: readonly ["suburb", "service-in-suburb", "region", "council"];
|
|
59
82
|
export type BrandlabEstateRefreshFamily = (typeof BRANDLAB_ESTATE_REFRESH_FAMILIES)[number];
|
package/dist/project.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAEA,OAAO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M,CAAA;YAChB,OAAO,CAAC,EAAE,MAAM,CAAA;YAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;YACjB,IAAI,CAAC,EAAE,MAAM,CAAA;SACd,CAAA;KACF,CAAA;IACD,UAAU,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAA;IACzC,UAAU,CAAC,EAAE,wBAAwB,CAAA;IACrC,oEAAoE;IACpE,OAAO,CAAC,EAAE,qBAAqB,CAAA;CAChC;AA0ED,qHAAqH;AACrH,wBAAgB,iCAAiC,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAS3E;AAED,qGAAqG;AACrG,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,EAAE,cAAc,CAAC,GAAG,oBAAoB,EAAE,CAGnH;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CA6EjF;AA4FD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,CAAC,CAAC,SAAS,qBAAqB,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAyLzF"}
|
package/dist/project.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { normalizeBrandlabRoutePath } from './routes.js';
|
|
2
2
|
import { assertBrandlabCanonicalEntityId } from './entity-id.js';
|
|
3
|
+
/**
|
|
4
|
+
* Wording that still promises a time: a digit, minutes or hours, "same day", "next day", a business or working day,
|
|
5
|
+
* "end of the day", "today" or "tomorrow". A no-promise record's wording must not match.
|
|
6
|
+
*/
|
|
7
|
+
export const BRANDLAB_REPLY_TIME_PROMISE = /\d|\b(?:minutes?|mins?|hours?|hrs?|today|tomorrow|overnight)\b|\b(?:same|next)[-\s]+(?:business[-\s]+|working[-\s]+)?day\b|\b(?:business|working)[-\s]+days?\b|\bend\s+of\s+(?:the\s+)?(?:business\s+)?day\b/i;
|
|
3
8
|
/** The location estate families check W3 covers. */
|
|
4
9
|
export const BRANDLAB_ESTATE_REFRESH_FAMILIES = ['suburb', 'service-in-suburb', 'region', 'council'];
|
|
5
10
|
/** The shortest refresh an estate family may use without an exception: 7 days, in seconds. */
|
|
@@ -58,7 +63,8 @@ const BUSINESS_PROFILE_REVIEWS_SELECTIONS = new Set([
|
|
|
58
63
|
'five-star',
|
|
59
64
|
]);
|
|
60
65
|
const SITE_SYSTEM_TIERS = new Set(['shell', 'enquiry', 'full']);
|
|
61
|
-
const SITE_SYSTEM_KEYS = ['tier', 'newBuild', 'samples', 'labels', 'freeQuotes', 'thirdParties', 'phones', 'refreshExceptions'];
|
|
66
|
+
const SITE_SYSTEM_KEYS = ['tier', 'newBuild', 'samples', 'labels', 'freeQuotes', 'thirdParties', 'phones', 'refreshExceptions', 'replyTime'];
|
|
67
|
+
const REPLY_TIME_KEYS = ['promise', 'wording', 'decidedBy', 'decidedOn'];
|
|
62
68
|
const REFRESH_EXCEPTION_KEYS = ['family', 'revalidateSeconds', 'reason', 'decisionId'];
|
|
63
69
|
const HOSTNAME_PATTERN = /^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;
|
|
64
70
|
const TEL_HREF_PATTERN = /^tel:\+?\d{6,15}$/;
|
|
@@ -238,6 +244,29 @@ function assertRefreshExceptions(value) {
|
|
|
238
244
|
});
|
|
239
245
|
assertUnique(value.map((entry) => entry.family), `${field}.family`);
|
|
240
246
|
}
|
|
247
|
+
function assertReplyTime(value) {
|
|
248
|
+
const field = 'siteSystem.replyTime';
|
|
249
|
+
if (!value || typeof value !== 'object' || Array.isArray(value) || typeof value.promise !== 'boolean') {
|
|
250
|
+
throw new Error(`${field} must be { promise: true } or { promise: false, wording, decidedBy, decidedOn }.`);
|
|
251
|
+
}
|
|
252
|
+
const record = value;
|
|
253
|
+
if (record.promise === true) {
|
|
254
|
+
assertKnownKeys(record, ['promise'], field);
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
assertKnownKeys(record, REPLY_TIME_KEYS, field);
|
|
258
|
+
if (typeof record.wording !== 'string')
|
|
259
|
+
throw new Error(`${field}.wording must be text.`);
|
|
260
|
+
assertNonEmpty(record.wording, `${field}.wording`);
|
|
261
|
+
if (BRANDLAB_REPLY_TIME_PROMISE.test(record.wording)) {
|
|
262
|
+
throw new Error(`${field}.wording promises a reply time; a no-promise record uses wording such as "We will call you back as soon as possible."`);
|
|
263
|
+
}
|
|
264
|
+
if (record.decidedBy !== 'owner' && record.decidedBy !== 'romie') {
|
|
265
|
+
throw new Error(`${field}.decidedBy must be owner or romie.`);
|
|
266
|
+
}
|
|
267
|
+
if (isoDay(record.decidedOn) === null)
|
|
268
|
+
throw new Error(`${field}.decidedOn must be a YYYY-MM-DD date.`);
|
|
269
|
+
}
|
|
241
270
|
function assertStringList(value, field, check) {
|
|
242
271
|
if (!Array.isArray(value)) {
|
|
243
272
|
throw new Error(`${field} must be a list.`);
|
|
@@ -388,6 +417,9 @@ export function defineBrandlabProject(config) {
|
|
|
388
417
|
if (siteSystem.refreshExceptions !== undefined) {
|
|
389
418
|
assertRefreshExceptions(siteSystem.refreshExceptions);
|
|
390
419
|
}
|
|
420
|
+
if (siteSystem.replyTime !== undefined) {
|
|
421
|
+
assertReplyTime(siteSystem.replyTime);
|
|
422
|
+
}
|
|
391
423
|
}
|
|
392
424
|
if (config.hosting !== undefined) {
|
|
393
425
|
// The date-bound lapse is the ready gate's (W5): a lapsed decision must not stop a build or a rollback.
|
package/dist/project.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAA;AA+EhE,oDAAoD;AACpD,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,QAAQ,EAAE,mBAAmB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AC,CAAA;IACvD,CAAC;IAED,YAAY,CACV,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,EAC9D,mBAAmB,CACpB,CAEA;IAAA,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE;QACtD,cAAc,CAAC,SAAS,CAAC,MAAM,EAAE,cAAc,KAAK,UAAU,CAAC,CAAA;QAC/D,cAAc,CAAC,SAAS,CAAC,SAAS,EAAE,cAAc,KAAK,aAAa,CAAC,CAAA;QACrE,cAAc,CAAC,SAAS,CAAC,QAAQ,EAAE,cAAc,KAAK,YAAY,CAAC,CAAA;QACnE,cAAc,CAAC,SAAS,CAAC,aAAa,EAAE,cAAc,KAAK,iBAAiB,CAAC,CAAA;QAC7E,IAAI,SAAS,CAAC,KAAK,KAAK,OAAO,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,cAAc,KAAK,0BAA0B,CAAC,CAAA;QAChE,CAAC;QAED,IAAI,SAAS,CAAC,SAAS,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;YACzE,MAAM,IAAI,KAAK,CAAC,cAAc,KAAK,mCAAmC,CAAC,CAAA;QACzE,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { normalizeBrandlabRoutePath } from './routes.js'\nimport { assertBrandlabCanonicalEntityId } from './entity-id.js'\nimport type { GooglePlaceReviewsSelection } from './google-reviews.js'\nimport type { BusinessProfileReviewsPolicy } from './google-business-reviews.js'\n\nexport type BrandlabRouteFamily =\n | 'services'\n | 'locations'\n | 'service-locations'\n | 'blog'\n | 'projects'\n | 'legal'\n\nexport type BrandlabBlogAdapter = 'none' | 'mdx' | 'structured'\nexport type BrandlabContactAttachmentMode =\n | 'none'\n | 'images-optional'\n | 'images-required'\n | 'images-and-pdfs-optional'\nexport type BrandlabLocationStrategy =\n | 'none'\n | 'approved-service-area'\n | 'physical-location'\n | 'multi-location'\nexport type BrandlabReviewsProvider = 'google-places' | 'google-business-profile' | 'project-owned'\nexport type BrandlabGoogleReviewsMode = 'link-only' | 'summary' | 'full'\n\nexport type BrandlabReviewsCapability =\n | { provider: 'project-owned' }\n | {\n /** 3.5.0: Google reviews read on the server from the Brandlab reviews feed (site-next/google-business-reviews/server). */\n provider: 'google-business-profile'\n /** Optional presentation policy: the newest reviews, or the newest five-star ones. */\n selection?: BusinessProfileReviewsPolicy\n }\n | {\n provider: 'google-places'\n mode: BrandlabGoogleReviewsMode\n /** Optional presentation policy. Five-star selection is valid only in full mode. */\n selection?: GooglePlaceReviewsSelection\n /** Stable route IDs where review proof is intentionally presented. */\n routeIds: readonly string[]\n }\n\nexport interface BrandlabException {\n ruleId: string\n rationale: string\n owner: 'Romie'\n evidence: string\n expiresAt?: string\n reviewTrigger: string\n}\n\nexport type BrandlabSiteSystemTier = 'shell' | 'enquiry' | 'full'\n\n/**\n * Site System v2 adoption. `brandlab-ready` blocks on the declared tier's checks and the tiers below it; higher\n * tiers report without blocking. Absent means the site has not adopted v2 and nothing in the ready gate blocks.\n */\nexport interface BrandlabSiteSystemConfig {\n tier: BrandlabSiteSystemTier\n /** A new build or redesign: the same-trade distinctness check (D4) blocks whatever the tier. */\n newBuild?: boolean\n /** Extra pages the ready gate samples, beyond home, the contact page and one page per route. */\n samples?: readonly string[]\n /** Quote and call-to-action labels Romie recorded for this site, beyond the closed list. */\n labels?: readonly string[]\n /** Whether the business offers free quotes (\"Get a free quote\" rather than \"Get a quote\"). */\n freeQuotes?: boolean\n /** Third-party hostnames the site may load, for example www.youtube.com. */\n thirdParties?: readonly string[]\n /** Extra tel: links the site legitimately shows, for example a second line. */\n phones?: readonly string[]\n /**\n * Estate families allowed to refresh more often than every 7 days (check W3, from 3.13.0), each with the reason\n * and the recorded decision. Without an entry, a full-tier estate family refreshes at most weekly.\n */\n refreshExceptions?: readonly BrandlabEstateRefreshException[]\n}\n\n/** The location estate families check W3 covers. */\nexport const BRANDLAB_ESTATE_REFRESH_FAMILIES = ['suburb', 'service-in-suburb', 'region', 'council'] as const\nexport type BrandlabEstateRefreshFamily = (typeof BRANDLAB_ESTATE_REFRESH_FAMILIES)[number]\n\n/** The shortest refresh an estate family may use without an exception: 7 days, in seconds. */\nexport const BRANDLAB_ESTATE_MIN_REFRESH_SECONDS = 604_800\n\nexport interface BrandlabEstateRefreshException {\n family: BrandlabEstateRefreshFamily\n /** The shortest refresh the family may use, in whole seconds (60 to 604,799). */\n revalidateSeconds: number\n /** Why the family needs to refresh more often than weekly. */\n reason: string\n /** The recorded decision that allows it, for example a Notion decision id. */\n decisionId: string\n}\n\n/** A Vercel function region a Brandlab site may run in: Sydney, or Washington with a recorded decision. */\nexport type BrandlabOriginRegion = 'syd1' | 'iad1'\n\n/** `hosting.originRegion`: one region, or both (`['syd1', 'iad1']`; the ISR store then always goes to iad1). */\nexport type BrandlabOriginRegionSetting = BrandlabOriginRegion | readonly BrandlabOriginRegion[]\n\n/** The region every site runs in unless a decision records another: Sydney, where the visitors are. */\nexport const BRANDLAB_DEFAULT_ORIGIN_REGION = 'syd1' satisfies BrandlabOriginRegion\n\n/** The longest a non-Sydney origin decision lasts before it is reviewed: six calendar months. */\nexport const BRANDLAB_ORIGIN_DECISION_MAX_MONTHS = 6\n\n/**\n * A recorded origin-region decision under rule `origin-region-v1` (operations/shared-platform/ORIGIN_REGION.md).\n * Any region other than Sydney needs one; it lapses on `reviewBy`, at most six months after `decidedOn`.\n */\nexport interface BrandlabOriginRegionDecision {\n rule: 'origin-region-v1'\n /** YYYY-MM-DD. */\n decidedOn: string\n /** Where the benchmark and the decision are recorded (a Notion page, a PR or a report path). */\n evidence: string\n /** The expected saving per billing cycle in US dollars (at least US$2 under the rule). */\n savingUsdPerCycle: number\n /** How much slower a cold miss was in the benchmark, in milliseconds (at most 250 under the rule). */\n coldMissDeltaMs: number\n /** YYYY-MM-DD, after `decidedOn` and no more than six months after it. The ready gate fails once it passes. */\n reviewBy: string\n}\n\n/** A firewall rule recorded for the ready gate's crawler guard (W10): what it matches in the user agent and does. */\nexport interface BrandlabFirewallRuleRecord {\n /** The rule's name or id in the Vercel or Cloudflare firewall. */\n id: string\n action: 'deny' | 'challenge' | 'rate-limit' | 'log' | 'bypass'\n /** How the rule matches the User-Agent header, as the firewall writes it. */\n userAgent: { match: 'contains' | 'equals' | 'regex'; value: string }\n}\n\n/**\n * Where the site's server functions run (3.13.0). `vercel.json` `regions` must equal `originRegion`; the default is\n * Sydney. Firewall rules that match on the user agent are recorded here so the ready gate can check them.\n */\nexport interface BrandlabHostingConfig {\n originRegion: BrandlabOriginRegionSetting\n decision?: BrandlabOriginRegionDecision\n firewall?: readonly BrandlabFirewallRuleRecord[]\n}\n\nexport type BrandlabSitemapConfig =\n | { mode: 'single' }\n | {\n mode: 'split'\n families: readonly string[]\n reason: string\n }\n\nexport interface BrandlabProjectConfig {\n projectId: string\n routes: {\n families: readonly BrandlabRouteFamily[]\n }\n capabilities?: {\n blog?: { adapter: BrandlabBlogAdapter }\n contact?: {\n fieldProfile: string\n attachments: BrandlabContactAttachmentMode\n }\n locations?: { strategy: BrandlabLocationStrategy }\n reviews?: BrandlabReviewsCapability\n }\n sitemap?: BrandlabSitemapConfig\n searchCertification: {\n representativeRoutes: {\n home: string\n contact?: string\n service?: string\n location?: string\n blog?: string\n }\n }\n exceptions?: readonly BrandlabException[]\n siteSystem?: BrandlabSiteSystemConfig\n /** Where the server functions run; absent means Sydney (`syd1`). */\n hosting?: BrandlabHostingConfig\n}\n\nconst PROJECT_CONFIG_KEYS = [\n 'projectId',\n 'routes',\n 'capabilities',\n 'sitemap',\n 'searchCertification',\n 'exceptions',\n 'siteSystem',\n 'hosting',\n] as const\nconst ROUTE_FAMILIES = new Set<BrandlabRouteFamily>([\n 'services',\n 'locations',\n 'service-locations',\n 'blog',\n 'projects',\n 'legal',\n])\nconst BLOG_ADAPTERS = new Set<BrandlabBlogAdapter>(['none', 'mdx', 'structured'])\nconst ATTACHMENT_MODES = new Set<BrandlabContactAttachmentMode>([\n 'none',\n 'images-optional',\n 'images-required',\n 'images-and-pdfs-optional',\n])\nconst LOCATION_STRATEGIES = new Set<BrandlabLocationStrategy>([\n 'none',\n 'approved-service-area',\n 'physical-location',\n 'multi-location',\n])\nconst REVIEWS_PROVIDERS = new Set<BrandlabReviewsProvider>([\n 'google-places',\n 'google-business-profile',\n 'project-owned',\n])\nconst GOOGLE_REVIEWS_MODES = new Set<BrandlabGoogleReviewsMode>([\n 'link-only',\n 'summary',\n 'full',\n])\nconst GOOGLE_REVIEWS_SELECTIONS = new Set<GooglePlaceReviewsSelection>([\n 'relevance',\n 'five-star-featured',\n])\nconst BUSINESS_PROFILE_REVIEWS_SELECTIONS = new Set<BusinessProfileReviewsPolicy>([\n 'recent',\n 'five-star',\n])\nconst SITE_SYSTEM_TIERS = new Set<BrandlabSiteSystemTier>(['shell', 'enquiry', 'full'])\nconst SITE_SYSTEM_KEYS = ['tier', 'newBuild', 'samples', 'labels', 'freeQuotes', 'thirdParties', 'phones', 'refreshExceptions']\nconst REFRESH_EXCEPTION_KEYS = ['family', 'revalidateSeconds', 'reason', 'decisionId']\nconst HOSTNAME_PATTERN = /^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$/\nconst TEL_HREF_PATTERN = /^tel:\\+?\\d{6,15}$/\n\nconst ORIGIN_REGIONS = new Set<BrandlabOriginRegion>(['syd1', 'iad1'])\nconst HOSTING_KEYS = ['originRegion', 'decision', 'firewall']\nconst DECISION_KEYS = ['rule', 'decidedOn', 'evidence', 'savingUsdPerCycle', 'coldMissDeltaMs', 'reviewBy']\nconst FIREWALL_ACTIONS = new Set(['deny', 'challenge', 'rate-limit', 'log', 'bypass'])\nconst FIREWALL_MATCHES = new Set(['contains', 'equals', 'regex'])\nconst ISO_DAY = /^(\\d{4})-(\\d{2})-(\\d{2})$/\n\n/** A YYYY-MM-DD calendar day as a UTC timestamp, or null when it is not a real day. */\nfunction isoDay(value: unknown): number | null {\n if (typeof value !== 'string') return null\n const match = ISO_DAY.exec(value)\n if (!match) return null\n const time = Date.UTC(Number(match[1]), Number(match[2]) - 1, Number(match[3]))\n return new Date(time).toISOString().slice(0, 10) === value ? time : null\n}\n\n/** The last day a decision taken on `decidedOn` may be reviewed by: the same day six months later (or month end). */\nexport function brandlabOriginDecisionReviewLimit(decidedOn: string): string {\n const start = isoDay(decidedOn)\n if (start === null) throw new Error('decidedOn must be a YYYY-MM-DD date.')\n const date = new Date(start)\n const day = date.getUTCDate()\n const target = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + BRANDLAB_ORIGIN_DECISION_MAX_MONTHS, 1))\n const lastDay = new Date(Date.UTC(target.getUTCFullYear(), target.getUTCMonth() + 1, 0)).getUTCDate()\n target.setUTCDate(Math.min(day, lastDay))\n return target.toISOString().slice(0, 10)\n}\n\n/** The regions `hosting.originRegion` names, sorted; Sydney alone when there is no hosting block. */\nexport function brandlabOriginRegions(hosting?: Pick<BrandlabHostingConfig, 'originRegion'>): BrandlabOriginRegion[] {\n const setting = hosting?.originRegion ?? BRANDLAB_DEFAULT_ORIGIN_REGION\n return [...new Set(typeof setting === 'string' ? [setting] : setting)].sort()\n}\n\n/**\n * Problems with a site's hosting record on `today` (YYYY-MM-DD): the ready gate (W5) fails on any. A region other\n * than Sydney needs an `origin-region-v1` decision whose `reviewBy` has not passed and is no more than six months\n * after `decidedOn`. The shape is checked too, because the gate reads the config without running it.\n */\nexport function brandlabHostingProblems(hosting: unknown, today: string): string[] {\n if (hosting === undefined) return []\n if (!hosting || typeof hosting !== 'object' || Array.isArray(hosting)) return ['hosting must be an object with an originRegion.']\n const record = hosting as Record<string, unknown>\n const problems: string[] = []\n const unknown = Object.keys(record).filter((key) => !HOSTING_KEYS.includes(key))\n if (unknown.length > 0) problems.push(`hosting contains unsupported keys: ${unknown.join(', ')}.`)\n const setting = record.originRegion\n const list = typeof setting === 'string' ? [setting] : Array.isArray(setting) ? setting : null\n if (\n !list ||\n list.length === 0 ||\n list.some((region) => !ORIGIN_REGIONS.has(region as BrandlabOriginRegion)) ||\n new Set(list).size !== list.length\n ) {\n problems.push(`hosting.originRegion must be 'syd1', 'iad1' or ['syd1', 'iad1'] (found ${JSON.stringify(setting)}).`)\n return problems\n }\n const sydneyOnly = list.length === 1 && list[0] === BRANDLAB_DEFAULT_ORIGIN_REGION\n const decision = record.decision\n if (decision === undefined) {\n if (!sydneyOnly) {\n problems.push(`hosting.originRegion ${JSON.stringify(setting)} needs a recorded origin-region-v1 decision (hosting.decision); only syd1 runs without one.`)\n }\n } else if (!decision || typeof decision !== 'object' || Array.isArray(decision)) {\n problems.push('hosting.decision must be an object.')\n } else {\n const entry = decision as Record<string, unknown>\n const extra = Object.keys(entry).filter((key) => !DECISION_KEYS.includes(key))\n if (extra.length > 0) problems.push(`hosting.decision contains unsupported keys: ${extra.join(', ')}.`)\n if (entry.rule !== 'origin-region-v1') problems.push(`hosting.decision.rule must be 'origin-region-v1' (found ${JSON.stringify(entry.rule)}).`)\n if (typeof entry.evidence !== 'string' || !entry.evidence.trim()) problems.push('hosting.decision.evidence must name where the benchmark and decision are recorded.')\n for (const key of ['savingUsdPerCycle', 'coldMissDeltaMs'] as const) {\n if (typeof entry[key] !== 'number' || !Number.isFinite(entry[key])) problems.push(`hosting.decision.${key} must be a number.`)\n }\n const decided = isoDay(entry.decidedOn)\n const review = isoDay(entry.reviewBy)\n if (decided === null) problems.push('hosting.decision.decidedOn must be a YYYY-MM-DD date.')\n if (review === null) problems.push('hosting.decision.reviewBy must be a YYYY-MM-DD date.')\n if (decided !== null && review !== null) {\n const limit = brandlabOriginDecisionReviewLimit(entry.decidedOn as string)\n if (review <= decided) problems.push(`hosting.decision.reviewBy (${entry.reviewBy}) must be after decidedOn (${entry.decidedOn}).`)\n else if ((entry.reviewBy as string) > limit) {\n problems.push(`hosting.decision.reviewBy (${entry.reviewBy}) is more than ${BRANDLAB_ORIGIN_DECISION_MAX_MONTHS} months after decidedOn (${entry.decidedOn}); review by ${limit} at the latest.`)\n }\n if (!sydneyOnly && isoDay(today) !== null && today > (entry.reviewBy as string)) {\n problems.push(`The origin-region decision for ${JSON.stringify(setting)} lapsed on ${entry.reviewBy}: review it under origin-region-v1 and record a new reviewBy, or move back to syd1.`)\n }\n }\n }\n const firewall = record.firewall\n if (firewall !== undefined) {\n if (!Array.isArray(firewall)) problems.push('hosting.firewall must be a list of recorded rules.')\n else {\n firewall.forEach((rule: unknown, index) => {\n const field = `hosting.firewall[${index}]`\n if (!rule || typeof rule !== 'object' || Array.isArray(rule)) {\n problems.push(`${field} must be an object.`)\n return\n }\n const entry = rule as Record<string, unknown>\n if (typeof entry.id !== 'string' || !entry.id.trim()) problems.push(`${field}.id must name the firewall rule.`)\n if (!FIREWALL_ACTIONS.has(entry.action as string)) problems.push(`${field}.action must be one of ${[...FIREWALL_ACTIONS].join(', ')}.`)\n const userAgent = entry.userAgent as Record<string, unknown> | undefined\n if (!userAgent || typeof userAgent !== 'object' || !FIREWALL_MATCHES.has(userAgent.match as string) || typeof userAgent.value !== 'string' || !userAgent.value) {\n problems.push(`${field}.userAgent must be { match: 'contains' | 'equals' | 'regex', value }.`)\n } else if (userAgent.match === 'regex') {\n try {\n new RegExp(userAgent.value)\n } catch {\n problems.push(`${field}.userAgent.value is not a valid regular expression.`)\n }\n }\n })\n }\n }\n return problems\n}\n\nfunction assertNonEmpty(value: string, field: string) {\n if (!value.trim()) {\n throw new Error(`${field} cannot be empty.`)\n }\n}\n\nfunction assertRootRelativePath(path: string, field: string) {\n try {\n normalizeBrandlabRoutePath(path)\n } catch {\n throw new Error(`${field} must be a root-relative path without a query string or hash.`)\n }\n}\n\nfunction assertKnownKeys(value: object, allowed: readonly string[], field: string, hint = '') {\n const unsupported = Object.keys(value).filter((key) => !allowed.includes(key))\n if (unsupported.length > 0) {\n throw new Error(`${field} contains unsupported keys: ${unsupported.join(', ')}.${hint}`)\n }\n}\n\nfunction assertRefreshExceptions(value: unknown) {\n const field = 'siteSystem.refreshExceptions'\n if (!Array.isArray(value)) throw new Error(`${field} must be a list.`)\n value.forEach((entry: unknown, index) => {\n const itemField = `${field}[${index}]`\n if (!entry || typeof entry !== 'object' || Array.isArray(entry)) {\n throw new Error(`${itemField} must be an object with family, revalidateSeconds, reason and decisionId.`)\n }\n assertKnownKeys(entry, REFRESH_EXCEPTION_KEYS, itemField)\n const exception = entry as Record<string, unknown>\n if (!(BRANDLAB_ESTATE_REFRESH_FAMILIES as readonly unknown[]).includes(exception.family)) {\n throw new Error(`${itemField}.family must be one of ${BRANDLAB_ESTATE_REFRESH_FAMILIES.join(', ')}.`)\n }\n const seconds = exception.revalidateSeconds\n if (!Number.isSafeInteger(seconds) || (seconds as number) < 60 || (seconds as number) >= BRANDLAB_ESTATE_MIN_REFRESH_SECONDS) {\n throw new Error(`${itemField}.revalidateSeconds must be whole seconds from 60 to 604799; weekly or slower needs no exception.`)\n }\n for (const key of ['reason', 'decisionId'] as const) {\n if (typeof exception[key] !== 'string') throw new Error(`${itemField}.${key} must be text.`)\n assertNonEmpty(exception[key] as string, `${itemField}.${key}`)\n }\n })\n assertUnique(value.map((entry: { family: string }) => entry.family), `${field}.family`)\n}\n\nfunction assertStringList(\n value: unknown,\n field: string,\n check: (item: string, itemField: string) => void,\n) {\n if (!Array.isArray(value)) {\n throw new Error(`${field} must be a list.`)\n }\n value.forEach((item, index) => {\n if (typeof item !== 'string') throw new Error(`${field}[${index}] must be text.`)\n check(item, `${field}[${index}]`)\n })\n assertUnique(value as string[], field)\n}\n\nfunction assertUnique(values: readonly string[], field: string) {\n const duplicate = values.find((value, index) => values.indexOf(value) !== index)\n if (duplicate) {\n throw new Error(`${field} contains duplicate value \"${duplicate}\".`)\n }\n}\n\n/**\n * Defines project-owned variation only. Runtime versions and global Brandlab\n * policy deliberately do not belong in this object.\n */\nexport function defineBrandlabProject<const T extends BrandlabProjectConfig>(config: T): T {\n if (!config || typeof config !== 'object' || Array.isArray(config)) {\n throw new TypeError('defineBrandlabProject requires a project configuration.')\n }\n assertKnownKeys(config, PROJECT_CONFIG_KEYS, 'Project configuration')\n assertNonEmpty(config.projectId, 'projectId')\n\n assertBrandlabCanonicalEntityId(config.projectId)\n\n if (!config.routes || typeof config.routes !== 'object') {\n throw new Error('routes.families is required.')\n }\n assertKnownKeys(\n config.routes,\n ['families'],\n 'routes',\n ' Redirects belong in the src/data/redirects.ts table.',\n )\n assertUnique(config.routes.families, 'routes.families')\n config.routes.families.forEach((family, index) => {\n if (!ROUTE_FAMILIES.has(family)) {\n throw new Error(`routes.families[${index}] is unsupported.`)\n }\n })\n\n const representativeRoutes = config.searchCertification.representativeRoutes\n Object.entries(representativeRoutes).forEach(([name, path]) => {\n if (path) assertRootRelativePath(path, `searchCertification.representativeRoutes.${name}`)\n })\n if (representativeRoutes.home !== '/') {\n throw new Error('searchCertification.representativeRoutes.home must be \"/\".')\n }\n\n if (config.capabilities?.contact) {\n assertNonEmpty(config.capabilities.contact.fieldProfile, 'contact.fieldProfile')\n if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(config.capabilities.contact.fieldProfile)) {\n throw new Error('contact.fieldProfile must be lowercase kebab-case.')\n }\n if (!ATTACHMENT_MODES.has(config.capabilities.contact.attachments)) {\n throw new Error('contact.attachments is unsupported.')\n }\n }\n if (\n config.capabilities?.blog &&\n !BLOG_ADAPTERS.has(config.capabilities.blog.adapter)\n ) {\n throw new Error('blog.adapter is unsupported.')\n }\n if (\n config.capabilities?.locations &&\n !LOCATION_STRATEGIES.has(config.capabilities.locations.strategy)\n ) {\n throw new Error('locations.strategy is unsupported.')\n }\n if (\n config.capabilities?.reviews &&\n !REVIEWS_PROVIDERS.has(config.capabilities.reviews.provider)\n ) {\n throw new Error('reviews.provider is unsupported.')\n }\n if (\n config.capabilities?.reviews?.provider === 'google-places' &&\n !config.routes.families.includes('legal')\n ) {\n throw new Error('Google Places reviews require the legal route family.')\n }\n if (config.capabilities?.reviews?.provider === 'google-places') {\n const reviews = config.capabilities.reviews\n if (!GOOGLE_REVIEWS_MODES.has(reviews.mode)) {\n throw new Error('reviews.mode is unsupported.')\n }\n if (reviews.selection && !GOOGLE_REVIEWS_SELECTIONS.has(reviews.selection)) {\n throw new Error('reviews.selection is unsupported.')\n }\n if (reviews.selection === 'five-star-featured' && reviews.mode !== 'full') {\n throw new Error('Five-star featured reviews require full mode.')\n }\n if (!Array.isArray(reviews.routeIds) || reviews.routeIds.length === 0) {\n throw new Error('Google Places reviews require at least one approved route ID.')\n }\n assertUnique(reviews.routeIds, 'reviews.routeIds')\n reviews.routeIds.forEach((routeId, index) => {\n if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(routeId)) {\n throw new Error(`reviews.routeIds[${index}] must be lowercase kebab-case.`)\n }\n })\n }\n\n if (config.capabilities?.reviews?.provider === 'google-business-profile') {\n const reviews = config.capabilities.reviews\n if (\n reviews.selection !== undefined &&\n !BUSINESS_PROFILE_REVIEWS_SELECTIONS.has(reviews.selection)\n ) {\n throw new Error('reviews.selection is unsupported.')\n }\n if ('exclude' in reviews) {\n throw new Error(\n 'reviews.exclude belongs in src/config/reviews.ts (reviews.exclude, passed to selectBusinessProfileReviews), not brandlab.config.',\n )\n }\n }\n\n if (config.sitemap?.mode === 'split') {\n if (config.sitemap.families.length === 0) {\n throw new Error('Split sitemap configuration requires at least one family.')\n }\n assertUnique(config.sitemap.families, 'sitemap.families')\n config.sitemap.families.forEach((path, index) =>\n assertRootRelativePath(path, `sitemap.families[${index}]`),\n )\n assertNonEmpty(config.sitemap.reason, 'sitemap.reason')\n }\n\n if (config.siteSystem !== undefined) {\n const siteSystem = config.siteSystem\n if (!siteSystem || typeof siteSystem !== 'object' || Array.isArray(siteSystem)) {\n throw new Error('siteSystem must be an object with a tier.')\n }\n assertKnownKeys(siteSystem, SITE_SYSTEM_KEYS, 'siteSystem')\n if (!SITE_SYSTEM_TIERS.has(siteSystem.tier)) {\n throw new Error('siteSystem.tier is unsupported.')\n }\n if (siteSystem.newBuild !== undefined && typeof siteSystem.newBuild !== 'boolean') {\n throw new Error('siteSystem.newBuild must be true or false.')\n }\n if (siteSystem.samples !== undefined) {\n if (!Array.isArray(siteSystem.samples)) {\n throw new Error('siteSystem.samples must be a list of paths.')\n }\n assertUnique(siteSystem.samples, 'siteSystem.samples')\n siteSystem.samples.forEach((path, index) =>\n assertRootRelativePath(path, `siteSystem.samples[${index}]`),\n )\n }\n if (siteSystem.labels !== undefined) {\n assertStringList(siteSystem.labels, 'siteSystem.labels', (label, field) => assertNonEmpty(label, field))\n }\n if (siteSystem.freeQuotes !== undefined && typeof siteSystem.freeQuotes !== 'boolean') {\n throw new Error('siteSystem.freeQuotes must be true or false.')\n }\n if (siteSystem.thirdParties !== undefined) {\n assertStringList(siteSystem.thirdParties, 'siteSystem.thirdParties', (host, field) => {\n if (!HOSTNAME_PATTERN.test(host)) throw new Error(`${field} must be a hostname such as www.youtube.com.`)\n })\n }\n if (siteSystem.phones !== undefined) {\n assertStringList(siteSystem.phones, 'siteSystem.phones', (href, field) => {\n if (!TEL_HREF_PATTERN.test(href)) throw new Error(`${field} must be a tel: link such as tel:+61290001234.`)\n })\n }\n if (siteSystem.refreshExceptions !== undefined) {\n assertRefreshExceptions(siteSystem.refreshExceptions)\n }\n }\n\n if (config.hosting !== undefined) {\n // The date-bound lapse is the ready gate's (W5): a lapsed decision must not stop a build or a rollback.\n const problems = brandlabHostingProblems(config.hosting, '0000-01-01')\n if (problems.length > 0) throw new Error(problems[0])\n }\n\n assertUnique(\n (config.exceptions ?? []).map((exception) => exception.ruleId),\n 'exceptions.ruleId',\n )\n\n ;(config.exceptions ?? []).forEach((exception, index) => {\n assertNonEmpty(exception.ruleId, `exceptions[${index}].ruleId`)\n assertNonEmpty(exception.rationale, `exceptions[${index}].rationale`)\n assertNonEmpty(exception.evidence, `exceptions[${index}].evidence`)\n assertNonEmpty(exception.reviewTrigger, `exceptions[${index}].reviewTrigger`)\n if (exception.owner !== 'Romie') {\n throw new Error(`exceptions[${index}].owner must be \"Romie\".`)\n }\n\n if (exception.expiresAt && Number.isNaN(Date.parse(exception.expiresAt))) {\n throw new Error(`exceptions[${index}].expiresAt must be a valid date.`)\n }\n })\n\n return config\n}\n"]}
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAA;AA6FhE;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GACtC,+MAA+M,CAAA;AAEjN,oDAAoD;AACpD,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,QAAQ,EAAE,mBAAmB,EAAE,QAAQ,EAAE,SAAS,CAAU,CAAA;AAG7G,8FAA8F;AAC9F,MAAM,CAAC,MAAM,mCAAmC,GAAG,OAAO,CAAA;AAkB1D,uGAAuG;AACvG,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAqC,CAAA;AAEnF,iGAAiG;AACjG,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,CAAA;AA6EpD,MAAM,mBAAmB,GAAG;IAC1B,WAAW;IACX,QAAQ;IACR,cAAc;IACd,SAAS;IACT,qBAAqB;IACrB,YAAY;IACZ,YAAY;IACZ,SAAS;CACD,CAAA;AACV,MAAM,cAAc,GAAG,IAAI,GAAG,CAAsB;IAClD,UAAU;IACV,WAAW;IACX,mBAAmB;IACnB,MAAM;IACN,UAAU;IACV,OAAO;CACR,CAAC,CAAA;AACF,MAAM,aAAa,GAAG,IAAI,GAAG,CAAsB,CAAC,MAAM,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAA;AACjF,MAA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C,QAAQ,EAAE,cAAc,KAAK,YAAY,CAAC,CAAA;QACnE,cAAc,CAAC,SAAS,CAAC,aAAa,EAAE,cAAc,KAAK,iBAAiB,CAAC,CAAA;QAC7E,IAAI,SAAS,CAAC,KAAK,KAAK,OAAO,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,cAAc,KAAK,0BAA0B,CAAC,CAAA;QAChE,CAAC;QAED,IAAI,SAAS,CAAC,SAAS,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;YACzE,MAAM,IAAI,KAAK,CAAC,cAAc,KAAK,mCAAmC,CAAC,CAAA;QACzE,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { normalizeBrandlabRoutePath } from './routes.js'\nimport { assertBrandlabCanonicalEntityId } from './entity-id.js'\nimport type { GooglePlaceReviewsSelection } from './google-reviews.js'\nimport type { BusinessProfileReviewsPolicy } from './google-business-reviews.js'\n\nexport type BrandlabRouteFamily =\n | 'services'\n | 'locations'\n | 'service-locations'\n | 'blog'\n | 'projects'\n | 'legal'\n\nexport type BrandlabBlogAdapter = 'none' | 'mdx' | 'structured'\nexport type BrandlabContactAttachmentMode =\n | 'none'\n | 'images-optional'\n | 'images-required'\n | 'images-and-pdfs-optional'\nexport type BrandlabLocationStrategy =\n | 'none'\n | 'approved-service-area'\n | 'physical-location'\n | 'multi-location'\nexport type BrandlabReviewsProvider = 'google-places' | 'google-business-profile' | 'project-owned'\nexport type BrandlabGoogleReviewsMode = 'link-only' | 'summary' | 'full'\n\nexport type BrandlabReviewsCapability =\n | { provider: 'project-owned' }\n | {\n /** 3.5.0: Google reviews read on the server from the Brandlab reviews feed (site-next/google-business-reviews/server). */\n provider: 'google-business-profile'\n /** Optional presentation policy: the newest reviews, or the newest five-star ones. */\n selection?: BusinessProfileReviewsPolicy\n }\n | {\n provider: 'google-places'\n mode: BrandlabGoogleReviewsMode\n /** Optional presentation policy. Five-star selection is valid only in full mode. */\n selection?: GooglePlaceReviewsSelection\n /** Stable route IDs where review proof is intentionally presented. */\n routeIds: readonly string[]\n }\n\nexport interface BrandlabException {\n ruleId: string\n rationale: string\n owner: 'Romie'\n evidence: string\n expiresAt?: string\n reviewTrigger: string\n}\n\nexport type BrandlabSiteSystemTier = 'shell' | 'enquiry' | 'full'\n\n/**\n * Site System v2 adoption. `brandlab-ready` blocks on the declared tier's checks and the tiers below it; higher\n * tiers report without blocking. Absent means the site has not adopted v2 and nothing in the ready gate blocks.\n */\nexport interface BrandlabSiteSystemConfig {\n tier: BrandlabSiteSystemTier\n /** A new build or redesign: the same-trade distinctness check (D4) blocks whatever the tier. */\n newBuild?: boolean\n /** Extra pages the ready gate samples, beyond home, the contact page and one page per route. */\n samples?: readonly string[]\n /** Quote and call-to-action labels Romie recorded for this site, beyond the closed list. */\n labels?: readonly string[]\n /** Whether the business offers free quotes (\"Get a free quote\" rather than \"Get a quote\"). */\n freeQuotes?: boolean\n /** Third-party hostnames the site may load, for example www.youtube.com. */\n thirdParties?: readonly string[]\n /** Extra tel: links the site legitimately shows, for example a second line. */\n phones?: readonly string[]\n /**\n * Estate families allowed to refresh more often than every 7 days (check W3, from 3.13.0), each with the reason\n * and the recorded decision. Without an entry, a full-tier estate family refreshes at most weekly.\n */\n refreshExceptions?: readonly BrandlabEstateRefreshException[]\n /**\n * What the thank-you page promises about a reply (check C7, 3.15.0). Absent or `{ promise: true }`: the page names a\n * specific reply time (\"within one business day\"). `{ promise: false, ... }` records a decision to promise no time\n * and the exact wording the page uses instead.\n */\n replyTime?: BrandlabReplyTimeRecord\n}\n\n/**\n * The thank-you page's reply promise. A no-promise record carries the page's own wording (no time in it), who decided\n * (the owner, or Romie for the owner) and the day the decision was made.\n */\nexport type BrandlabReplyTimeRecord =\n | { promise: true }\n | { promise: false; wording: string; decidedBy: 'owner' | 'romie'; decidedOn: string }\n\n/**\n * Wording that still promises a time: a digit, minutes or hours, \"same day\", \"next day\", a business or working day,\n * \"end of the day\", \"today\" or \"tomorrow\". A no-promise record's wording must not match.\n */\nexport const BRANDLAB_REPLY_TIME_PROMISE =\n /\\d|\\b(?:minutes?|mins?|hours?|hrs?|today|tomorrow|overnight)\\b|\\b(?:same|next)[-\\s]+(?:business[-\\s]+|working[-\\s]+)?day\\b|\\b(?:business|working)[-\\s]+days?\\b|\\bend\\s+of\\s+(?:the\\s+)?(?:business\\s+)?day\\b/i\n\n/** The location estate families check W3 covers. */\nexport const BRANDLAB_ESTATE_REFRESH_FAMILIES = ['suburb', 'service-in-suburb', 'region', 'council'] as const\nexport type BrandlabEstateRefreshFamily = (typeof BRANDLAB_ESTATE_REFRESH_FAMILIES)[number]\n\n/** The shortest refresh an estate family may use without an exception: 7 days, in seconds. */\nexport const BRANDLAB_ESTATE_MIN_REFRESH_SECONDS = 604_800\n\nexport interface BrandlabEstateRefreshException {\n family: BrandlabEstateRefreshFamily\n /** The shortest refresh the family may use, in whole seconds (60 to 604,799). */\n revalidateSeconds: number\n /** Why the family needs to refresh more often than weekly. */\n reason: string\n /** The recorded decision that allows it, for example a Notion decision id. */\n decisionId: string\n}\n\n/** A Vercel function region a Brandlab site may run in: Sydney, or Washington with a recorded decision. */\nexport type BrandlabOriginRegion = 'syd1' | 'iad1'\n\n/** `hosting.originRegion`: one region, or both (`['syd1', 'iad1']`; the ISR store then always goes to iad1). */\nexport type BrandlabOriginRegionSetting = BrandlabOriginRegion | readonly BrandlabOriginRegion[]\n\n/** The region every site runs in unless a decision records another: Sydney, where the visitors are. */\nexport const BRANDLAB_DEFAULT_ORIGIN_REGION = 'syd1' satisfies BrandlabOriginRegion\n\n/** The longest a non-Sydney origin decision lasts before it is reviewed: six calendar months. */\nexport const BRANDLAB_ORIGIN_DECISION_MAX_MONTHS = 6\n\n/**\n * A recorded origin-region decision under rule `origin-region-v1` (operations/shared-platform/ORIGIN_REGION.md).\n * Any region other than Sydney needs one; it lapses on `reviewBy`, at most six months after `decidedOn`.\n */\nexport interface BrandlabOriginRegionDecision {\n rule: 'origin-region-v1'\n /** YYYY-MM-DD. */\n decidedOn: string\n /** Where the benchmark and the decision are recorded (a Notion page, a PR or a report path). */\n evidence: string\n /** The expected saving per billing cycle in US dollars (at least US$2 under the rule). */\n savingUsdPerCycle: number\n /** How much slower a cold miss was in the benchmark, in milliseconds (at most 250 under the rule). */\n coldMissDeltaMs: number\n /** YYYY-MM-DD, after `decidedOn` and no more than six months after it. The ready gate fails once it passes. */\n reviewBy: string\n}\n\n/** A firewall rule recorded for the ready gate's crawler guard (W10): what it matches in the user agent and does. */\nexport interface BrandlabFirewallRuleRecord {\n /** The rule's name or id in the Vercel or Cloudflare firewall. */\n id: string\n action: 'deny' | 'challenge' | 'rate-limit' | 'log' | 'bypass'\n /** How the rule matches the User-Agent header, as the firewall writes it. */\n userAgent: { match: 'contains' | 'equals' | 'regex'; value: string }\n}\n\n/**\n * Where the site's server functions run (3.13.0). `vercel.json` `regions` must equal `originRegion`; the default is\n * Sydney. Firewall rules that match on the user agent are recorded here so the ready gate can check them.\n */\nexport interface BrandlabHostingConfig {\n originRegion: BrandlabOriginRegionSetting\n decision?: BrandlabOriginRegionDecision\n firewall?: readonly BrandlabFirewallRuleRecord[]\n}\n\nexport type BrandlabSitemapConfig =\n | { mode: 'single' }\n | {\n mode: 'split'\n families: readonly string[]\n reason: string\n }\n\nexport interface BrandlabProjectConfig {\n projectId: string\n routes: {\n families: readonly BrandlabRouteFamily[]\n }\n capabilities?: {\n blog?: { adapter: BrandlabBlogAdapter }\n contact?: {\n fieldProfile: string\n attachments: BrandlabContactAttachmentMode\n }\n locations?: { strategy: BrandlabLocationStrategy }\n reviews?: BrandlabReviewsCapability\n }\n sitemap?: BrandlabSitemapConfig\n searchCertification: {\n representativeRoutes: {\n home: string\n contact?: string\n service?: string\n location?: string\n blog?: string\n }\n }\n exceptions?: readonly BrandlabException[]\n siteSystem?: BrandlabSiteSystemConfig\n /** Where the server functions run; absent means Sydney (`syd1`). */\n hosting?: BrandlabHostingConfig\n}\n\nconst PROJECT_CONFIG_KEYS = [\n 'projectId',\n 'routes',\n 'capabilities',\n 'sitemap',\n 'searchCertification',\n 'exceptions',\n 'siteSystem',\n 'hosting',\n] as const\nconst ROUTE_FAMILIES = new Set<BrandlabRouteFamily>([\n 'services',\n 'locations',\n 'service-locations',\n 'blog',\n 'projects',\n 'legal',\n])\nconst BLOG_ADAPTERS = new Set<BrandlabBlogAdapter>(['none', 'mdx', 'structured'])\nconst ATTACHMENT_MODES = new Set<BrandlabContactAttachmentMode>([\n 'none',\n 'images-optional',\n 'images-required',\n 'images-and-pdfs-optional',\n])\nconst LOCATION_STRATEGIES = new Set<BrandlabLocationStrategy>([\n 'none',\n 'approved-service-area',\n 'physical-location',\n 'multi-location',\n])\nconst REVIEWS_PROVIDERS = new Set<BrandlabReviewsProvider>([\n 'google-places',\n 'google-business-profile',\n 'project-owned',\n])\nconst GOOGLE_REVIEWS_MODES = new Set<BrandlabGoogleReviewsMode>([\n 'link-only',\n 'summary',\n 'full',\n])\nconst GOOGLE_REVIEWS_SELECTIONS = new Set<GooglePlaceReviewsSelection>([\n 'relevance',\n 'five-star-featured',\n])\nconst BUSINESS_PROFILE_REVIEWS_SELECTIONS = new Set<BusinessProfileReviewsPolicy>([\n 'recent',\n 'five-star',\n])\nconst SITE_SYSTEM_TIERS = new Set<BrandlabSiteSystemTier>(['shell', 'enquiry', 'full'])\nconst SITE_SYSTEM_KEYS = ['tier', 'newBuild', 'samples', 'labels', 'freeQuotes', 'thirdParties', 'phones', 'refreshExceptions', 'replyTime']\nconst REPLY_TIME_KEYS = ['promise', 'wording', 'decidedBy', 'decidedOn']\nconst REFRESH_EXCEPTION_KEYS = ['family', 'revalidateSeconds', 'reason', 'decisionId']\nconst HOSTNAME_PATTERN = /^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$/\nconst TEL_HREF_PATTERN = /^tel:\\+?\\d{6,15}$/\n\nconst ORIGIN_REGIONS = new Set<BrandlabOriginRegion>(['syd1', 'iad1'])\nconst HOSTING_KEYS = ['originRegion', 'decision', 'firewall']\nconst DECISION_KEYS = ['rule', 'decidedOn', 'evidence', 'savingUsdPerCycle', 'coldMissDeltaMs', 'reviewBy']\nconst FIREWALL_ACTIONS = new Set(['deny', 'challenge', 'rate-limit', 'log', 'bypass'])\nconst FIREWALL_MATCHES = new Set(['contains', 'equals', 'regex'])\nconst ISO_DAY = /^(\\d{4})-(\\d{2})-(\\d{2})$/\n\n/** A YYYY-MM-DD calendar day as a UTC timestamp, or null when it is not a real day. */\nfunction isoDay(value: unknown): number | null {\n if (typeof value !== 'string') return null\n const match = ISO_DAY.exec(value)\n if (!match) return null\n const time = Date.UTC(Number(match[1]), Number(match[2]) - 1, Number(match[3]))\n return new Date(time).toISOString().slice(0, 10) === value ? time : null\n}\n\n/** The last day a decision taken on `decidedOn` may be reviewed by: the same day six months later (or month end). */\nexport function brandlabOriginDecisionReviewLimit(decidedOn: string): string {\n const start = isoDay(decidedOn)\n if (start === null) throw new Error('decidedOn must be a YYYY-MM-DD date.')\n const date = new Date(start)\n const day = date.getUTCDate()\n const target = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + BRANDLAB_ORIGIN_DECISION_MAX_MONTHS, 1))\n const lastDay = new Date(Date.UTC(target.getUTCFullYear(), target.getUTCMonth() + 1, 0)).getUTCDate()\n target.setUTCDate(Math.min(day, lastDay))\n return target.toISOString().slice(0, 10)\n}\n\n/** The regions `hosting.originRegion` names, sorted; Sydney alone when there is no hosting block. */\nexport function brandlabOriginRegions(hosting?: Pick<BrandlabHostingConfig, 'originRegion'>): BrandlabOriginRegion[] {\n const setting = hosting?.originRegion ?? BRANDLAB_DEFAULT_ORIGIN_REGION\n return [...new Set(typeof setting === 'string' ? [setting] : setting)].sort()\n}\n\n/**\n * Problems with a site's hosting record on `today` (YYYY-MM-DD): the ready gate (W5) fails on any. A region other\n * than Sydney needs an `origin-region-v1` decision whose `reviewBy` has not passed and is no more than six months\n * after `decidedOn`. The shape is checked too, because the gate reads the config without running it.\n */\nexport function brandlabHostingProblems(hosting: unknown, today: string): string[] {\n if (hosting === undefined) return []\n if (!hosting || typeof hosting !== 'object' || Array.isArray(hosting)) return ['hosting must be an object with an originRegion.']\n const record = hosting as Record<string, unknown>\n const problems: string[] = []\n const unknown = Object.keys(record).filter((key) => !HOSTING_KEYS.includes(key))\n if (unknown.length > 0) problems.push(`hosting contains unsupported keys: ${unknown.join(', ')}.`)\n const setting = record.originRegion\n const list = typeof setting === 'string' ? [setting] : Array.isArray(setting) ? setting : null\n if (\n !list ||\n list.length === 0 ||\n list.some((region) => !ORIGIN_REGIONS.has(region as BrandlabOriginRegion)) ||\n new Set(list).size !== list.length\n ) {\n problems.push(`hosting.originRegion must be 'syd1', 'iad1' or ['syd1', 'iad1'] (found ${JSON.stringify(setting)}).`)\n return problems\n }\n const sydneyOnly = list.length === 1 && list[0] === BRANDLAB_DEFAULT_ORIGIN_REGION\n const decision = record.decision\n if (decision === undefined) {\n if (!sydneyOnly) {\n problems.push(`hosting.originRegion ${JSON.stringify(setting)} needs a recorded origin-region-v1 decision (hosting.decision); only syd1 runs without one.`)\n }\n } else if (!decision || typeof decision !== 'object' || Array.isArray(decision)) {\n problems.push('hosting.decision must be an object.')\n } else {\n const entry = decision as Record<string, unknown>\n const extra = Object.keys(entry).filter((key) => !DECISION_KEYS.includes(key))\n if (extra.length > 0) problems.push(`hosting.decision contains unsupported keys: ${extra.join(', ')}.`)\n if (entry.rule !== 'origin-region-v1') problems.push(`hosting.decision.rule must be 'origin-region-v1' (found ${JSON.stringify(entry.rule)}).`)\n if (typeof entry.evidence !== 'string' || !entry.evidence.trim()) problems.push('hosting.decision.evidence must name where the benchmark and decision are recorded.')\n for (const key of ['savingUsdPerCycle', 'coldMissDeltaMs'] as const) {\n if (typeof entry[key] !== 'number' || !Number.isFinite(entry[key])) problems.push(`hosting.decision.${key} must be a number.`)\n }\n const decided = isoDay(entry.decidedOn)\n const review = isoDay(entry.reviewBy)\n if (decided === null) problems.push('hosting.decision.decidedOn must be a YYYY-MM-DD date.')\n if (review === null) problems.push('hosting.decision.reviewBy must be a YYYY-MM-DD date.')\n if (decided !== null && review !== null) {\n const limit = brandlabOriginDecisionReviewLimit(entry.decidedOn as string)\n if (review <= decided) problems.push(`hosting.decision.reviewBy (${entry.reviewBy}) must be after decidedOn (${entry.decidedOn}).`)\n else if ((entry.reviewBy as string) > limit) {\n problems.push(`hosting.decision.reviewBy (${entry.reviewBy}) is more than ${BRANDLAB_ORIGIN_DECISION_MAX_MONTHS} months after decidedOn (${entry.decidedOn}); review by ${limit} at the latest.`)\n }\n if (!sydneyOnly && isoDay(today) !== null && today > (entry.reviewBy as string)) {\n problems.push(`The origin-region decision for ${JSON.stringify(setting)} lapsed on ${entry.reviewBy}: review it under origin-region-v1 and record a new reviewBy, or move back to syd1.`)\n }\n }\n }\n const firewall = record.firewall\n if (firewall !== undefined) {\n if (!Array.isArray(firewall)) problems.push('hosting.firewall must be a list of recorded rules.')\n else {\n firewall.forEach((rule: unknown, index) => {\n const field = `hosting.firewall[${index}]`\n if (!rule || typeof rule !== 'object' || Array.isArray(rule)) {\n problems.push(`${field} must be an object.`)\n return\n }\n const entry = rule as Record<string, unknown>\n if (typeof entry.id !== 'string' || !entry.id.trim()) problems.push(`${field}.id must name the firewall rule.`)\n if (!FIREWALL_ACTIONS.has(entry.action as string)) problems.push(`${field}.action must be one of ${[...FIREWALL_ACTIONS].join(', ')}.`)\n const userAgent = entry.userAgent as Record<string, unknown> | undefined\n if (!userAgent || typeof userAgent !== 'object' || !FIREWALL_MATCHES.has(userAgent.match as string) || typeof userAgent.value !== 'string' || !userAgent.value) {\n problems.push(`${field}.userAgent must be { match: 'contains' | 'equals' | 'regex', value }.`)\n } else if (userAgent.match === 'regex') {\n try {\n new RegExp(userAgent.value)\n } catch {\n problems.push(`${field}.userAgent.value is not a valid regular expression.`)\n }\n }\n })\n }\n }\n return problems\n}\n\nfunction assertNonEmpty(value: string, field: string) {\n if (!value.trim()) {\n throw new Error(`${field} cannot be empty.`)\n }\n}\n\nfunction assertRootRelativePath(path: string, field: string) {\n try {\n normalizeBrandlabRoutePath(path)\n } catch {\n throw new Error(`${field} must be a root-relative path without a query string or hash.`)\n }\n}\n\nfunction assertKnownKeys(value: object, allowed: readonly string[], field: string, hint = '') {\n const unsupported = Object.keys(value).filter((key) => !allowed.includes(key))\n if (unsupported.length > 0) {\n throw new Error(`${field} contains unsupported keys: ${unsupported.join(', ')}.${hint}`)\n }\n}\n\nfunction assertRefreshExceptions(value: unknown) {\n const field = 'siteSystem.refreshExceptions'\n if (!Array.isArray(value)) throw new Error(`${field} must be a list.`)\n value.forEach((entry: unknown, index) => {\n const itemField = `${field}[${index}]`\n if (!entry || typeof entry !== 'object' || Array.isArray(entry)) {\n throw new Error(`${itemField} must be an object with family, revalidateSeconds, reason and decisionId.`)\n }\n assertKnownKeys(entry, REFRESH_EXCEPTION_KEYS, itemField)\n const exception = entry as Record<string, unknown>\n if (!(BRANDLAB_ESTATE_REFRESH_FAMILIES as readonly unknown[]).includes(exception.family)) {\n throw new Error(`${itemField}.family must be one of ${BRANDLAB_ESTATE_REFRESH_FAMILIES.join(', ')}.`)\n }\n const seconds = exception.revalidateSeconds\n if (!Number.isSafeInteger(seconds) || (seconds as number) < 60 || (seconds as number) >= BRANDLAB_ESTATE_MIN_REFRESH_SECONDS) {\n throw new Error(`${itemField}.revalidateSeconds must be whole seconds from 60 to 604799; weekly or slower needs no exception.`)\n }\n for (const key of ['reason', 'decisionId'] as const) {\n if (typeof exception[key] !== 'string') throw new Error(`${itemField}.${key} must be text.`)\n assertNonEmpty(exception[key] as string, `${itemField}.${key}`)\n }\n })\n assertUnique(value.map((entry: { family: string }) => entry.family), `${field}.family`)\n}\n\nfunction assertReplyTime(value: unknown) {\n const field = 'siteSystem.replyTime'\n if (!value || typeof value !== 'object' || Array.isArray(value) || typeof (value as { promise?: unknown }).promise !== 'boolean') {\n throw new Error(`${field} must be { promise: true } or { promise: false, wording, decidedBy, decidedOn }.`)\n }\n const record = value as Record<string, unknown>\n if (record.promise === true) {\n assertKnownKeys(record, ['promise'], field)\n return\n }\n assertKnownKeys(record, REPLY_TIME_KEYS, field)\n if (typeof record.wording !== 'string') throw new Error(`${field}.wording must be text.`)\n assertNonEmpty(record.wording, `${field}.wording`)\n if (BRANDLAB_REPLY_TIME_PROMISE.test(record.wording)) {\n throw new Error(`${field}.wording promises a reply time; a no-promise record uses wording such as \"We will call you back as soon as possible.\"`)\n }\n if (record.decidedBy !== 'owner' && record.decidedBy !== 'romie') {\n throw new Error(`${field}.decidedBy must be owner or romie.`)\n }\n if (isoDay(record.decidedOn) === null) throw new Error(`${field}.decidedOn must be a YYYY-MM-DD date.`)\n}\n\nfunction assertStringList(\n value: unknown,\n field: string,\n check: (item: string, itemField: string) => void,\n) {\n if (!Array.isArray(value)) {\n throw new Error(`${field} must be a list.`)\n }\n value.forEach((item, index) => {\n if (typeof item !== 'string') throw new Error(`${field}[${index}] must be text.`)\n check(item, `${field}[${index}]`)\n })\n assertUnique(value as string[], field)\n}\n\nfunction assertUnique(values: readonly string[], field: string) {\n const duplicate = values.find((value, index) => values.indexOf(value) !== index)\n if (duplicate) {\n throw new Error(`${field} contains duplicate value \"${duplicate}\".`)\n }\n}\n\n/**\n * Defines project-owned variation only. Runtime versions and global Brandlab\n * policy deliberately do not belong in this object.\n */\nexport function defineBrandlabProject<const T extends BrandlabProjectConfig>(config: T): T {\n if (!config || typeof config !== 'object' || Array.isArray(config)) {\n throw new TypeError('defineBrandlabProject requires a project configuration.')\n }\n assertKnownKeys(config, PROJECT_CONFIG_KEYS, 'Project configuration')\n assertNonEmpty(config.projectId, 'projectId')\n\n assertBrandlabCanonicalEntityId(config.projectId)\n\n if (!config.routes || typeof config.routes !== 'object') {\n throw new Error('routes.families is required.')\n }\n assertKnownKeys(\n config.routes,\n ['families'],\n 'routes',\n ' Redirects belong in the src/data/redirects.ts table.',\n )\n assertUnique(config.routes.families, 'routes.families')\n config.routes.families.forEach((family, index) => {\n if (!ROUTE_FAMILIES.has(family)) {\n throw new Error(`routes.families[${index}] is unsupported.`)\n }\n })\n\n const representativeRoutes = config.searchCertification.representativeRoutes\n Object.entries(representativeRoutes).forEach(([name, path]) => {\n if (path) assertRootRelativePath(path, `searchCertification.representativeRoutes.${name}`)\n })\n if (representativeRoutes.home !== '/') {\n throw new Error('searchCertification.representativeRoutes.home must be \"/\".')\n }\n\n if (config.capabilities?.contact) {\n assertNonEmpty(config.capabilities.contact.fieldProfile, 'contact.fieldProfile')\n if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(config.capabilities.contact.fieldProfile)) {\n throw new Error('contact.fieldProfile must be lowercase kebab-case.')\n }\n if (!ATTACHMENT_MODES.has(config.capabilities.contact.attachments)) {\n throw new Error('contact.attachments is unsupported.')\n }\n }\n if (\n config.capabilities?.blog &&\n !BLOG_ADAPTERS.has(config.capabilities.blog.adapter)\n ) {\n throw new Error('blog.adapter is unsupported.')\n }\n if (\n config.capabilities?.locations &&\n !LOCATION_STRATEGIES.has(config.capabilities.locations.strategy)\n ) {\n throw new Error('locations.strategy is unsupported.')\n }\n if (\n config.capabilities?.reviews &&\n !REVIEWS_PROVIDERS.has(config.capabilities.reviews.provider)\n ) {\n throw new Error('reviews.provider is unsupported.')\n }\n if (\n config.capabilities?.reviews?.provider === 'google-places' &&\n !config.routes.families.includes('legal')\n ) {\n throw new Error('Google Places reviews require the legal route family.')\n }\n if (config.capabilities?.reviews?.provider === 'google-places') {\n const reviews = config.capabilities.reviews\n if (!GOOGLE_REVIEWS_MODES.has(reviews.mode)) {\n throw new Error('reviews.mode is unsupported.')\n }\n if (reviews.selection && !GOOGLE_REVIEWS_SELECTIONS.has(reviews.selection)) {\n throw new Error('reviews.selection is unsupported.')\n }\n if (reviews.selection === 'five-star-featured' && reviews.mode !== 'full') {\n throw new Error('Five-star featured reviews require full mode.')\n }\n if (!Array.isArray(reviews.routeIds) || reviews.routeIds.length === 0) {\n throw new Error('Google Places reviews require at least one approved route ID.')\n }\n assertUnique(reviews.routeIds, 'reviews.routeIds')\n reviews.routeIds.forEach((routeId, index) => {\n if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(routeId)) {\n throw new Error(`reviews.routeIds[${index}] must be lowercase kebab-case.`)\n }\n })\n }\n\n if (config.capabilities?.reviews?.provider === 'google-business-profile') {\n const reviews = config.capabilities.reviews\n if (\n reviews.selection !== undefined &&\n !BUSINESS_PROFILE_REVIEWS_SELECTIONS.has(reviews.selection)\n ) {\n throw new Error('reviews.selection is unsupported.')\n }\n if ('exclude' in reviews) {\n throw new Error(\n 'reviews.exclude belongs in src/config/reviews.ts (reviews.exclude, passed to selectBusinessProfileReviews), not brandlab.config.',\n )\n }\n }\n\n if (config.sitemap?.mode === 'split') {\n if (config.sitemap.families.length === 0) {\n throw new Error('Split sitemap configuration requires at least one family.')\n }\n assertUnique(config.sitemap.families, 'sitemap.families')\n config.sitemap.families.forEach((path, index) =>\n assertRootRelativePath(path, `sitemap.families[${index}]`),\n )\n assertNonEmpty(config.sitemap.reason, 'sitemap.reason')\n }\n\n if (config.siteSystem !== undefined) {\n const siteSystem = config.siteSystem\n if (!siteSystem || typeof siteSystem !== 'object' || Array.isArray(siteSystem)) {\n throw new Error('siteSystem must be an object with a tier.')\n }\n assertKnownKeys(siteSystem, SITE_SYSTEM_KEYS, 'siteSystem')\n if (!SITE_SYSTEM_TIERS.has(siteSystem.tier)) {\n throw new Error('siteSystem.tier is unsupported.')\n }\n if (siteSystem.newBuild !== undefined && typeof siteSystem.newBuild !== 'boolean') {\n throw new Error('siteSystem.newBuild must be true or false.')\n }\n if (siteSystem.samples !== undefined) {\n if (!Array.isArray(siteSystem.samples)) {\n throw new Error('siteSystem.samples must be a list of paths.')\n }\n assertUnique(siteSystem.samples, 'siteSystem.samples')\n siteSystem.samples.forEach((path, index) =>\n assertRootRelativePath(path, `siteSystem.samples[${index}]`),\n )\n }\n if (siteSystem.labels !== undefined) {\n assertStringList(siteSystem.labels, 'siteSystem.labels', (label, field) => assertNonEmpty(label, field))\n }\n if (siteSystem.freeQuotes !== undefined && typeof siteSystem.freeQuotes !== 'boolean') {\n throw new Error('siteSystem.freeQuotes must be true or false.')\n }\n if (siteSystem.thirdParties !== undefined) {\n assertStringList(siteSystem.thirdParties, 'siteSystem.thirdParties', (host, field) => {\n if (!HOSTNAME_PATTERN.test(host)) throw new Error(`${field} must be a hostname such as www.youtube.com.`)\n })\n }\n if (siteSystem.phones !== undefined) {\n assertStringList(siteSystem.phones, 'siteSystem.phones', (href, field) => {\n if (!TEL_HREF_PATTERN.test(href)) throw new Error(`${field} must be a tel: link such as tel:+61290001234.`)\n })\n }\n if (siteSystem.refreshExceptions !== undefined) {\n assertRefreshExceptions(siteSystem.refreshExceptions)\n }\n if (siteSystem.replyTime !== undefined) {\n assertReplyTime(siteSystem.replyTime)\n }\n }\n\n if (config.hosting !== undefined) {\n // The date-bound lapse is the ready gate's (W5): a lapsed decision must not stop a build or a rollback.\n const problems = brandlabHostingProblems(config.hosting, '0000-01-01')\n if (problems.length > 0) throw new Error(problems[0])\n }\n\n assertUnique(\n (config.exceptions ?? []).map((exception) => exception.ruleId),\n 'exceptions.ruleId',\n )\n\n ;(config.exceptions ?? []).forEach((exception, index) => {\n assertNonEmpty(exception.ruleId, `exceptions[${index}].ruleId`)\n assertNonEmpty(exception.rationale, `exceptions[${index}].rationale`)\n assertNonEmpty(exception.evidence, `exceptions[${index}].evidence`)\n assertNonEmpty(exception.reviewTrigger, `exceptions[${index}].reviewTrigger`)\n if (exception.owner !== 'Romie') {\n throw new Error(`exceptions[${index}].owner must be \"Romie\".`)\n }\n\n if (exception.expiresAt && Number.isNaN(Date.parse(exception.expiresAt))) {\n throw new Error(`exceptions[${index}].expiresAt must be a valid date.`)\n }\n })\n\n return config\n}\n"]}
|
package/dist/section-order.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* checks: skip what has nothing true to show, enforce the cap (only optional and recommended sections drop),
|
|
10
10
|
* alternate the light tones so neighbours differ (at most one `band` and one `photo`) and write the per-page manifest.
|
|
11
11
|
*/
|
|
12
|
-
export declare const BRANDLAB_SECTION_IDS: readonly ["hero", "page-header", "article-header", "answer", "proof-strip", "emergency", "services", "local-facts", "nearby-jobs", "service-detail", "price-guide", "projects", "before-after", "gallery", "reviews", "comparison", "about-owner", "signature", "process", "guarantee", "licences", "partners", "team", "coverage", "area-map", "faqs", "nearby-areas", "related-services", "guides", "contact", "cta"];
|
|
12
|
+
export declare const BRANDLAB_SECTION_IDS: readonly ["hero", "page-header", "article-header", "answer", "proof-strip", "emergency", "services", "local-facts", "council-rules", "nearby-jobs", "service-detail", "price-guide", "projects", "before-after", "gallery", "reviews", "comparison", "about-owner", "signature", "process", "guarantee", "licences", "partners", "team", "coverage", "area-map", "faqs", "nearby-areas", "related-services", "guides", "contact", "cta"];
|
|
13
13
|
export type BrandlabSectionId = (typeof BRANDLAB_SECTION_IDS)[number];
|
|
14
14
|
export declare const BRANDLAB_PAGE_FAMILIES: readonly ["home", "service", "service-in-suburb", "region", "suburb", "cost-guide", "services-hub", "locations-hub", "projects-hub", "project", "gallery", "reviews", "about", "faqs", "contact", "guides-hub", "guide", "council", "emergency"];
|
|
15
15
|
export type BrandlabPageFamily = (typeof BRANDLAB_PAGE_FAMILIES)[number];
|
|
@@ -82,7 +82,8 @@ export declare function defineTradeProfiles<const T extends Readonly<Record<Bran
|
|
|
82
82
|
/**
|
|
83
83
|
* Matrix part B, as confirmed (3.14.0). Trees: no NSW licence for tree work, so the licence block is optional and the
|
|
84
84
|
* about page's owner block carries the qualifications and insurance lines; the council permit note is required on
|
|
85
|
-
* suburb and service-in-suburb pages (hidden, with its reason, once the council record is stale)
|
|
85
|
+
* suburb and service-in-suburb pages (hidden, with its reason, once the council record is stale), and council pages
|
|
86
|
+
* show the council's rules whenever the register holds a current record (3.15.0). The other trades
|
|
86
87
|
* stay on the defaults until their rules are confirmed.
|
|
87
88
|
*/
|
|
88
89
|
export declare const SECTION_TRADE_PROFILES: Readonly<Record<BrandlabTrade, BrandlabTradeProfile>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section-order.d.ts","sourceRoot":"","sources":["../src/section-order.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"section-order.d.ts","sourceRoot":"","sources":["../src/section-order.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,oBAAoB,0aAiCvB,CAAA;AACV,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AAErE,eAAO,MAAM,sBAAsB,kPAoBzB,CAAA;AACV,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAA;AAExE,mHAAmH;AACnH,eAAO,MAAM,6BAA6B,iCAAkC,CAAA;AAC5E,MAAM,MAAM,0BAA0B,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvF,mGAAmG;AACnG,eAAO,MAAM,sBAAsB,iDAAkD,CAAA;AACrF,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEzE,uHAAuH;AACvH,MAAM,MAAM,0BAA0B,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;AAElE,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,EAAE,EAAE,iBAAiB,CAAA;IAC9B,QAAQ,CAAC,WAAW,EAAE,0BAA0B,CAAA;IAChD,4FAA4F;IAC5F,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAA;IACpD,qGAAqG;IACrG,Q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