@brandlab-digital/site-core 1.0.0-rc.8 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brandlab-digital/site-core",
3
- "version": "1.0.0-rc.8",
3
+ "version": "1.0.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/RomieDandan/brandlab.git",
@@ -13,7 +13,7 @@
13
13
  "dist"
14
14
  ],
15
15
  "scripts": {
16
- "build": "tsc -p tsconfig.json",
16
+ "build": "rm -rf dist && tsc -p tsconfig.json",
17
17
  "test": "vitest run",
18
18
  "typecheck": "tsc --noEmit -p tsconfig.json"
19
19
  },
@@ -26,10 +26,6 @@
26
26
  "types": "./dist/project.d.ts",
27
27
  "import": "./dist/project.js"
28
28
  },
29
- "./platform-contract": {
30
- "types": "./dist/platform-contract.d.ts",
31
- "import": "./dist/platform-contract.js"
32
- },
33
29
  "./business": {
34
30
  "types": "./dist/business.d.ts",
35
31
  "import": "./dist/business.js"
@@ -1,30 +0,0 @@
1
- import { type BrandlabAnalyticsContract } from './analytics.js';
2
- import { type BrandlabBusiness } from './business.js';
3
- import { type BrandlabContactContract } from './contact.js';
4
- import { type BrandlabProjectConfig } from './project.js';
5
- import { type BrandlabRouteCatalog } from './routes.js';
6
- export declare const BRANDLAB_PLATFORM_CONTRACT_VERSION: "brandlab.platform-contract.v1";
7
- export interface BrandlabPlatformContractInput {
8
- project: BrandlabProjectConfig;
9
- business: BrandlabBusiness;
10
- routes: BrandlabRouteCatalog;
11
- contact?: BrandlabContactContract;
12
- analytics: BrandlabAnalyticsContract;
13
- }
14
- export interface BrandlabBoundPlatformContract {
15
- schemaVersion: typeof BRANDLAB_PLATFORM_CONTRACT_VERSION;
16
- project: BrandlabProjectConfig;
17
- business: BrandlabBusiness;
18
- routes: BrandlabRouteCatalog;
19
- contact?: BrandlabContactContract;
20
- analytics: BrandlabAnalyticsContract;
21
- }
22
- /**
23
- * Binds every project-config-v2 control-plane input into one validated,
24
- * serializable artifact. Consumers must use this value to drive runtime
25
- * adapters; a disconnected call is not conformance evidence.
26
- */
27
- export declare function defineBrandlabPlatformContract<const T extends BrandlabPlatformContractInput>(input: T): BrandlabBoundPlatformContract;
28
- /** Canonical digest input; hash this exact string with SHA-256 in control-plane code. */
29
- export declare function serializeBrandlabPlatformContract(contract: BrandlabBoundPlatformContract): string;
30
- //# sourceMappingURL=platform-contract.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform-contract.d.ts","sourceRoot":"","sources":["../src/platform-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAA;AACtB,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,cAAc,CAAA;AACrB,OAAO,EAEL,KAAK,qBAAqB,EAE3B,MAAM,cAAc,CAAA;AACrB,OAAO,EAKL,KAAK,oBAAoB,EAE1B,MAAM,aAAa,CAAA;AAMpB,eAAO,MAAM,kCAAkC,EAC7C,+BAAwC,CAAA;AAE1C,MAAM,WAAW,6BAA6B;IAC5C,OAAO,EAAE,qBAAqB,CAAA;IAC9B,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,MAAM,EAAE,oBAAoB,CAAA;IAC5B,OAAO,CAAC,EAAE,uBAAuB,CAAA;IACjC,SAAS,EAAE,yBAAyB,CAAA;CACrC;AAED,MAAM,WAAW,6BAA6B;IAC5C,aAAa,EAAE,OAAO,kCAAkC,CAAA;IACxD,OAAO,EAAE,qBAAqB,CAAA;IAC9B,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,MAAM,EAAE,oBAAoB,CAAA;IAC5B,OAAO,CAAC,EAAE,uBAAuB,CAAA;IACjC,SAAS,EAAE,yBAAyB,CAAA;CACrC;AAgRD;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,CAAC,CAAC,SAAS,6BAA6B,EAC7C,KAAK,EAAE,CAAC,GAAG,6BAA6B,CA0BzC;AAwCD,yFAAyF;AACzF,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,6BAA6B,UAGxC"}
@@ -1,254 +0,0 @@
1
- import { defineAnalyticsContract, } from './analytics.js';
2
- import { defineBrandlabBusiness, } from './business.js';
3
- import { defineContactContract, } from './contact.js';
4
- import { defineBrandlabProject, } from './project.js';
5
- import { defineRouteCatalog, getBrandlabRoutePathIdentity, getRouteByPath, normalizeBrandlabRoutePath, } from './routes.js';
6
- import { getProofLevelFromAssetIds, resolveIndexationStatus, } from './locations.js';
7
- export const BRANDLAB_PLATFORM_CONTRACT_VERSION = 'brandlab.platform-contract.v1';
8
- const ROUTE_KINDS_BY_FAMILY = {
9
- services: ['service-index', 'service'],
10
- locations: ['location-index', 'location'],
11
- 'service-locations': ['service-location'],
12
- blog: ['blog-index', 'blog-post'],
13
- projects: ['project-index', 'project'],
14
- legal: ['legal'],
15
- };
16
- const REPRESENTATIVE_ROUTE_KINDS = {
17
- home: ['home'],
18
- contact: ['contact'],
19
- service: ['service'],
20
- location: ['location', 'service-location'],
21
- blog: ['blog-post'],
22
- };
23
- function assertRouteFamilies(project, routes) {
24
- for (const family of project.routes.families) {
25
- const allowedKinds = ROUTE_KINDS_BY_FAMILY[family];
26
- if (!routes.some((route) => allowedKinds.includes(route.kind))) {
27
- throw new Error(`Project route family "${family}" has no matching route-catalog record.`);
28
- }
29
- }
30
- const declaredFamilies = new Set(project.routes.families);
31
- for (const route of routes) {
32
- const owningFamily = Object.entries(ROUTE_KINDS_BY_FAMILY).find(([, kinds]) => kinds.includes(route.kind))?.[0];
33
- if (owningFamily && !declaredFamilies.has(owningFamily)) {
34
- throw new Error(`Route-catalog kind "${route.kind}" requires project route family "${owningFamily}".`);
35
- }
36
- }
37
- }
38
- function assertRepresentativeRoutes(project, routes) {
39
- for (const [name, path] of Object.entries(project.searchCertification.representativeRoutes)) {
40
- if (!path)
41
- continue;
42
- const route = getRouteByPath(routes, path);
43
- if (!route) {
44
- throw new Error(`Search Certification representative route "${name}" is absent from the route catalog.`);
45
- }
46
- const allowedKinds = REPRESENTATIVE_ROUTE_KINDS[name];
47
- if (!allowedKinds?.includes(route.kind)) {
48
- throw new Error(`Search Certification representative route "${name}" has route kind "${route.kind}".`);
49
- }
50
- }
51
- const representativeRoutes = project.searchCertification.representativeRoutes;
52
- const requiredByFamilies = [
53
- ['services', 'service'],
54
- ['locations', 'location'],
55
- ['service-locations', 'location'],
56
- ['blog', 'blog'],
57
- ];
58
- for (const [family, representative] of requiredByFamilies) {
59
- if (project.routes.families.includes(family) &&
60
- !representativeRoutes[representative]) {
61
- throw new Error(`Project route family "${family}" requires Search Certification representative route "${representative}".`);
62
- }
63
- }
64
- if (routes.some((route) => route.kind === 'contact') &&
65
- !representativeRoutes.contact) {
66
- throw new Error('A contact route requires Search Certification representative route "contact".');
67
- }
68
- }
69
- function assertAliasBinding(project, routes) {
70
- const routePathIdentities = new Set(routes.map((route) => getBrandlabRoutePathIdentity(route.path)));
71
- const canonicalPaths = new Set(routes.map((route) => normalizeBrandlabRoutePath(route.canonicalPath ?? route.path)));
72
- const ownedPathIdentities = new Set([
73
- ...routePathIdentities,
74
- ...Array.from(canonicalPaths, getBrandlabRoutePathIdentity),
75
- ]);
76
- for (const alias of project.routes.aliases ?? []) {
77
- const from = normalizeBrandlabRoutePath(alias.from);
78
- const to = normalizeBrandlabRoutePath(alias.to);
79
- if (ownedPathIdentities.has(getBrandlabRoutePathIdentity(from))) {
80
- throw new Error(`Route alias source "${from}" collides with a current route-catalog path.`);
81
- }
82
- if (!canonicalPaths.has(to)) {
83
- throw new Error(`Route alias target "${to}" does not resolve to a current canonical route.`);
84
- }
85
- }
86
- }
87
- function assertContactBinding(project, contact, routes) {
88
- const capability = project.capabilities?.contact;
89
- const hasContactRoute = routes.some((route) => route.kind === 'contact');
90
- if (hasContactRoute && !capability) {
91
- throw new Error('A contact route requires a declared project contact capability.');
92
- }
93
- if (capability && !hasContactRoute) {
94
- throw new Error('The declared project contact capability requires a contact route.');
95
- }
96
- if (!capability && contact) {
97
- throw new Error('A contact contract requires a declared project contact capability.');
98
- }
99
- if (capability && !contact) {
100
- throw new Error('The declared project contact capability requires a contact contract.');
101
- }
102
- if (!capability || !contact)
103
- return;
104
- if (contact.projectId !== project.projectId) {
105
- throw new Error('The contact contract projectId does not match the project config.');
106
- }
107
- if (contact.fieldProfile !== capability.fieldProfile) {
108
- throw new Error('The contact contract fieldProfile does not match the project config.');
109
- }
110
- if (contact.attachments.mode !== capability.attachments) {
111
- throw new Error('The contact attachment mode does not match the project config.');
112
- }
113
- }
114
- function assertBlogBinding(project) {
115
- const hasBlogFamily = project.routes.families.includes('blog');
116
- const adapter = project.capabilities?.blog?.adapter ?? 'none';
117
- if (hasBlogFamily && adapter === 'none') {
118
- throw new Error('The blog route family requires an enabled blog adapter.');
119
- }
120
- if (!hasBlogFamily && adapter !== 'none') {
121
- throw new Error('An enabled blog adapter requires the blog route family.');
122
- }
123
- }
124
- function assertLocationBinding(project, business, routes) {
125
- const hasLocationRoutes = project.routes.families.some((family) => family === 'locations' || family === 'service-locations');
126
- const strategy = project.capabilities?.locations?.strategy;
127
- if (hasLocationRoutes && (!strategy || strategy === 'none')) {
128
- throw new Error('Location route families require an enabled location strategy.');
129
- }
130
- if (!hasLocationRoutes && strategy && strategy !== 'none') {
131
- throw new Error('An enabled location strategy requires a location route family.');
132
- }
133
- if (!strategy || strategy === 'none')
134
- return;
135
- if (strategy === 'approved-service-area') {
136
- if (!['service-area', 'hybrid'].includes(business.location.model) ||
137
- business.location.serviceAreas.status !== 'verified' ||
138
- business.location.serviceAreas.value.length === 0) {
139
- throw new Error('The approved service-area strategy requires verified service areas.');
140
- }
141
- }
142
- else if (strategy === 'physical-location') {
143
- if (!['physical-location', 'hybrid'].includes(business.location.model) ||
144
- business.location.addressVisibility !== 'public' ||
145
- business.location.address.status !== 'verified') {
146
- throw new Error('The physical-location strategy requires a verified public address.');
147
- }
148
- }
149
- else if (strategy === 'multi-location' &&
150
- (business.location.serviceAreas.status !== 'verified' ||
151
- business.location.serviceAreas.value.length < 2)) {
152
- throw new Error('The multi-location strategy requires at least two verified areas.');
153
- }
154
- for (const route of routes) {
155
- if (route.kind !== 'location' && route.kind !== 'service-location')
156
- continue;
157
- if (!route.locationQuality || route.locationQuality === 'unknown')
158
- continue;
159
- const proofLevel = getProofLevelFromAssetIds(route.locationQuality.proofAssetIds, business.proof);
160
- if (route.locationQuality.proofLevel !== proofLevel) {
161
- throw new Error('Location quality proofLevel must be derived from its verified business.proof records.');
162
- }
163
- const indexationStatus = resolveIndexationStatus({
164
- ...route.locationQuality,
165
- proofLevel,
166
- });
167
- if (route.locationQuality.indexationStatus !== indexationStatus) {
168
- throw new Error('Location quality indexationStatus must be derived from its verified proof signals.');
169
- }
170
- }
171
- }
172
- function assertReviewsBinding(project, routes) {
173
- if (project.capabilities?.reviews?.provider !== 'google-places')
174
- return;
175
- const terms = routes.find((route) => route.kind === 'legal' && route.legalPurpose === 'terms');
176
- const privacy = routes.find((route) => route.kind === 'legal' && route.legalPurpose === 'privacy');
177
- if (!terms?.legalReferences?.includes('google-maps-platform-terms')) {
178
- throw new Error('Google Places reviews require a Terms route referencing Google Maps Platform terms.');
179
- }
180
- if (!privacy?.legalReferences?.includes('google-privacy-policy')) {
181
- throw new Error('Google Places reviews require a Privacy route referencing the Google privacy policy.');
182
- }
183
- }
184
- /**
185
- * Binds every project-config-v2 control-plane input into one validated,
186
- * serializable artifact. Consumers must use this value to drive runtime
187
- * adapters; a disconnected call is not conformance evidence.
188
- */
189
- export function defineBrandlabPlatformContract(input) {
190
- const project = defineBrandlabProject(input.project);
191
- const business = defineBrandlabBusiness(input.business);
192
- const routes = defineRouteCatalog(input.routes);
193
- const contact = input.contact ? defineContactContract(input.contact) : undefined;
194
- const analytics = defineAnalyticsContract(input.analytics);
195
- if (analytics.projectId !== project.projectId) {
196
- throw new Error('The analytics contract projectId does not match the project config.');
197
- }
198
- assertRouteFamilies(project, routes);
199
- assertRepresentativeRoutes(project, routes);
200
- assertAliasBinding(project, routes);
201
- assertContactBinding(project, contact, routes);
202
- assertBlogBinding(project);
203
- assertLocationBinding(project, business, routes);
204
- assertReviewsBinding(project, routes);
205
- return {
206
- schemaVersion: BRANDLAB_PLATFORM_CONTRACT_VERSION,
207
- project,
208
- business,
209
- routes,
210
- ...(contact ? { contact } : {}),
211
- analytics,
212
- };
213
- }
214
- function canonicalize(value, seen = new Set()) {
215
- if (value === null ||
216
- typeof value === 'string' ||
217
- typeof value === 'boolean') {
218
- return value;
219
- }
220
- if (typeof value === 'number') {
221
- if (!Number.isFinite(value))
222
- throw new Error('Platform contract numbers must be finite.');
223
- return value;
224
- }
225
- if (Array.isArray(value)) {
226
- if (seen.has(value))
227
- throw new Error('Platform contract cannot contain cycles.');
228
- seen.add(value);
229
- const output = value.map((entry) => canonicalize(entry, seen));
230
- seen.delete(value);
231
- return output;
232
- }
233
- if (typeof value === 'object') {
234
- if (seen.has(value))
235
- throw new Error('Platform contract cannot contain cycles.');
236
- const prototype = Object.getPrototypeOf(value);
237
- if (prototype !== Object.prototype && prototype !== null) {
238
- throw new Error('Platform contract must contain plain serializable objects.');
239
- }
240
- seen.add(value);
241
- const output = Object.fromEntries(Object.entries(value)
242
- .filter(([, entry]) => entry !== undefined)
243
- .sort(([left], [right]) => left.localeCompare(right))
244
- .map(([key, entry]) => [key, canonicalize(entry, seen)]));
245
- seen.delete(value);
246
- return output;
247
- }
248
- throw new Error('Platform contract contains a non-serializable value.');
249
- }
250
- /** Canonical digest input; hash this exact string with SHA-256 in control-plane code. */
251
- export function serializeBrandlabPlatformContract(contract) {
252
- return JSON.stringify(canonicalize(contract));
253
- }
254
- //# sourceMappingURL=platform-contract.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform-contract.js","sourceRoot":"","sources":["../src/platform-contract.ts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