@fifthbell/brokaw 0.1.70 → 0.1.73
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 +112 -0
- package/dist/captured-catalog-browser.d.ts +26 -0
- package/dist/captured-catalog-browser.js +42 -0
- package/dist/captured-catalog-reader.d.ts +16 -0
- package/dist/captured-catalog-reader.js +113 -0
- package/dist/captured-catalog.d.ts +28 -0
- package/dist/captured-catalog.js +124 -0
- package/dist/components/live-program/LiveProgram.js +119 -311
- package/dist/components/live-program/components/WorldClocks.js +2 -1
- package/dist/components/live-program/components/slides/LiveEventSlide.js +2 -4
- package/dist/components/live-program/events.d.ts +7 -0
- package/dist/components/live-program/events.js +28 -5
- package/dist/components/live-program/hooks/useSSE.js +1 -2
- package/dist/components/live-program/i18n.js +1 -1
- package/dist/components/live-program/live-program-config.d.ts +70 -0
- package/dist/components/live-program/live-program-config.js +228 -0
- package/dist/components/live-program/program-data.d.ts +22 -0
- package/dist/components/live-program/program-data.js +23 -0
- package/dist/components/live-program/program-reload.d.ts +11 -0
- package/dist/components/live-program/program-reload.js +21 -0
- package/dist/components/live-program/segments/ArticlesSegment.d.ts +5 -0
- package/dist/components/live-program/segments/ArticlesSegment.js +15 -11
- package/dist/components/live-program/segments/EarthquakeSegment.d.ts +4 -0
- package/dist/components/live-program/segments/EarthquakeSegment.js +13 -10
- package/dist/components/live-program/segments/MarketsSegment.js +7 -2
- package/dist/components/live-program/segments/WeatherSegment.d.ts +5 -0
- package/dist/components/live-program/segments/WeatherSegment.js +7 -2
- package/dist/components/live-program/segments/fetchLiveEvents.d.ts +6 -0
- package/dist/components/live-program/segments/fetchLiveEvents.js +42 -27
- package/dist/components/live-program/source-retention.d.ts +14 -0
- package/dist/components/live-program/source-retention.js +26 -0
- package/dist/cronkite-manifest.d.ts +35 -0
- package/dist/cronkite-manifest.js +5 -26
- package/dist/cronkite-manifest.json +48 -1
- package/dist/layouts.d.ts +1 -1
- package/dist/live-program-page/index.html +2 -2
- package/dist/live-program-page/live-program-manifest.json +8 -8
- package/dist/live-program-page/live-program.v0.1.73.css +3 -0
- package/dist/live-program-page/live-program.v0.1.73.js +76 -0
- package/dist/manifest-validation.js +3 -1
- package/dist/renderer.browser.js +2 -0
- package/dist/renderer.core.js +3 -7
- package/dist/schemas/canonical-document.schema.json +69 -1
- package/dist/system-pages.d.ts +66 -0
- package/dist/system-pages.js +35 -0
- package/dist/types/canonical-article.js +3 -2
- package/dist/types/canonical-document-schema.generated.d.ts +132 -0
- package/dist/types/canonical-document-schema.generated.js +146 -0
- package/dist/types/canonical-document.generated.d.ts +34 -0
- package/package.json +10 -4
- package/src/partial-deps.json +9 -0
- package/src/styles/compiled.css +1 -1
- package/src/templates/partials/components/article-main.hbs +6 -5
- package/src/templates/partials/components/media/main.hbs +4 -3
- package/src/templates/partials/components/search/main.hbs +3 -3
- package/src/templates/partials/headers/header-main.hbs +11 -19
- package/src/templates/partials/shell/captured-catalog.hbs +1 -0
- package/dist/live-program-page/live-program.v0.1.70.css +0 -3
- package/dist/live-program-page/live-program.v0.1.70.js +0 -76
|
@@ -18,6 +18,8 @@ export function assertManifestAlignment(manifest, sources) {
|
|
|
18
18
|
if (!rendering.renderables[page.renderable]) {
|
|
19
19
|
throw new Error(`system page uses undeclared renderable: ${page.renderable}`);
|
|
20
20
|
}
|
|
21
|
-
assertSameOrderedValues(`system page ${page.renderable} languages`, page.variants.map((variant) => String(variant.document.language)).sort(),
|
|
21
|
+
assertSameOrderedValues(`system page ${page.renderable} languages`, page.variants.map((variant) => String(variant.document.language)).sort(), page.renderable === 'media-page'
|
|
22
|
+
? [sources.defaultLanguage]
|
|
23
|
+
: [...sources.languages].sort());
|
|
22
24
|
}
|
|
23
25
|
}
|
package/dist/renderer.browser.js
CHANGED
|
@@ -15,6 +15,7 @@ import shellDocStartStandardHbs from './templates/partials/shell/doc-start-stand
|
|
|
15
15
|
import shellDocStart404Hbs from './templates/partials/shell/doc-start-404.hbs?raw';
|
|
16
16
|
import shellRumLoaderHbs from './templates/partials/shell/rum-loader.hbs?raw';
|
|
17
17
|
import shellDocEndHbs from './templates/partials/shell/doc-end.hbs?raw';
|
|
18
|
+
import shellCapturedCatalogHbs from './templates/partials/shell/captured-catalog.hbs?raw';
|
|
18
19
|
import blockRichTextHbs from './templates/partials/blocks/rich-text.hbs?raw';
|
|
19
20
|
import blockHeadingHbs from './templates/partials/blocks/heading.hbs?raw';
|
|
20
21
|
import blockImageHbs from './templates/partials/blocks/image.hbs?raw';
|
|
@@ -88,6 +89,7 @@ const assets = {
|
|
|
88
89
|
'shell/doc-start-404': shellDocStart404Hbs,
|
|
89
90
|
'shell/rum-loader': shellRumLoaderHbs,
|
|
90
91
|
'shell/doc-end': shellDocEndHbs,
|
|
92
|
+
'shell/captured-catalog': shellCapturedCatalogHbs,
|
|
91
93
|
'blocks/rich-text': blockRichTextHbs,
|
|
92
94
|
'blocks/heading': blockHeadingHbs,
|
|
93
95
|
'blocks/image': blockImageHbs,
|
package/dist/renderer.core.js
CHANGED
|
@@ -129,13 +129,9 @@ export function renderWithAssets(doc, assets) {
|
|
|
129
129
|
initializeHandlebars(assets);
|
|
130
130
|
}
|
|
131
131
|
const requestedLayout = doc.layout;
|
|
132
|
-
|
|
133
|
-
throw new Error(`Unknown layout "${requestedLayout ?? 'undefined'}". Expected one of: ${layoutNames.join(', ')}`);
|
|
134
|
-
}
|
|
135
|
-
const parsed = canonicalArticleSchema.parse(normalizeDocument(doc));
|
|
136
|
-
const template = layoutCache.get(parsed.layout);
|
|
132
|
+
const template = requestedLayout ? layoutCache.get(requestedLayout) : undefined;
|
|
137
133
|
if (!template) {
|
|
138
|
-
throw new Error(`
|
|
134
|
+
throw new Error(`Unknown layout "${requestedLayout ?? 'undefined'}". Expected one of: ${layoutNames.join(', ')}`);
|
|
139
135
|
}
|
|
140
|
-
return template(
|
|
136
|
+
return template(canonicalArticleSchema.parse(normalizeDocument(doc)));
|
|
141
137
|
}
|
|
@@ -36,6 +36,29 @@
|
|
|
36
36
|
"description": "An open language tag. The active renderer declares the allowed set for each request.",
|
|
37
37
|
"examples": ["en", "pt-BR", "zh-Hant-TW"]
|
|
38
38
|
},
|
|
39
|
+
"capturedSelection": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"description": "CMS-issued captured-catalog selection (Brokaw captured-catalog contract v1). When present, every runtime reader on the page reads this selection instead of its current source; the browser adapter validates it in full.",
|
|
42
|
+
"properties": {
|
|
43
|
+
"selectionId": { "type": "string", "minLength": 1, "maxLength": 200 },
|
|
44
|
+
"catalogUrl": { "type": "string", "format": "uri", "pattern": "^https://" },
|
|
45
|
+
"context": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"properties": {
|
|
48
|
+
"rendererVersion": { "type": "string", "minLength": 1, "maxLength": 200 },
|
|
49
|
+
"templateVersion": { "type": "string", "minLength": 1, "maxLength": 200 },
|
|
50
|
+
"tenant": { "type": "string", "minLength": 1, "maxLength": 200 },
|
|
51
|
+
"origin": { "type": "string", "format": "uri", "pattern": "^https://" },
|
|
52
|
+
"build": { "type": "string", "minLength": 1, "maxLength": 200 }
|
|
53
|
+
},
|
|
54
|
+
"required": ["rendererVersion", "templateVersion", "tenant", "origin", "build"],
|
|
55
|
+
"additionalProperties": false
|
|
56
|
+
},
|
|
57
|
+
"locale": { "type": "string", "enum": ["en", "es", "it"] }
|
|
58
|
+
},
|
|
59
|
+
"required": ["selectionId", "catalogUrl", "context", "locale"],
|
|
60
|
+
"additionalProperties": false
|
|
61
|
+
},
|
|
39
62
|
"rumConfig": {
|
|
40
63
|
"type": "object",
|
|
41
64
|
"properties": {
|
|
@@ -571,6 +594,29 @@
|
|
|
571
594
|
"description": "An open language tag. The active renderer declares the allowed set for each request.",
|
|
572
595
|
"examples": ["en", "pt-BR", "zh-Hant-TW"]
|
|
573
596
|
},
|
|
597
|
+
"capturedSelection": {
|
|
598
|
+
"type": "object",
|
|
599
|
+
"description": "CMS-issued captured-catalog selection (Brokaw captured-catalog contract v1). When present, every runtime reader on the page reads this selection instead of its current source; the browser adapter validates it in full.",
|
|
600
|
+
"properties": {
|
|
601
|
+
"selectionId": { "type": "string", "minLength": 1, "maxLength": 200 },
|
|
602
|
+
"catalogUrl": { "type": "string", "format": "uri", "pattern": "^https://" },
|
|
603
|
+
"context": {
|
|
604
|
+
"type": "object",
|
|
605
|
+
"properties": {
|
|
606
|
+
"rendererVersion": { "type": "string", "minLength": 1, "maxLength": 200 },
|
|
607
|
+
"templateVersion": { "type": "string", "minLength": 1, "maxLength": 200 },
|
|
608
|
+
"tenant": { "type": "string", "minLength": 1, "maxLength": 200 },
|
|
609
|
+
"origin": { "type": "string", "format": "uri", "pattern": "^https://" },
|
|
610
|
+
"build": { "type": "string", "minLength": 1, "maxLength": 200 }
|
|
611
|
+
},
|
|
612
|
+
"required": ["rendererVersion", "templateVersion", "tenant", "origin", "build"],
|
|
613
|
+
"additionalProperties": false
|
|
614
|
+
},
|
|
615
|
+
"locale": { "type": "string", "enum": ["en", "es", "it"] }
|
|
616
|
+
},
|
|
617
|
+
"required": ["selectionId", "catalogUrl", "context", "locale"],
|
|
618
|
+
"additionalProperties": false
|
|
619
|
+
},
|
|
574
620
|
"rumConfig": {
|
|
575
621
|
"type": "object",
|
|
576
622
|
"properties": {
|
|
@@ -1046,6 +1092,10 @@
|
|
|
1046
1092
|
"standalone-page"
|
|
1047
1093
|
]
|
|
1048
1094
|
},
|
|
1095
|
+
"assignmentMediaBaseUrl": {
|
|
1096
|
+
"type": "string",
|
|
1097
|
+
"description": "Completed assignment JSON directory supplied by the media-page producer."
|
|
1098
|
+
},
|
|
1049
1099
|
"authors": {
|
|
1050
1100
|
"type": "array",
|
|
1051
1101
|
"items": {
|
|
@@ -1083,7 +1133,25 @@
|
|
|
1083
1133
|
"body",
|
|
1084
1134
|
"layout"
|
|
1085
1135
|
],
|
|
1086
|
-
"additionalProperties": {}
|
|
1136
|
+
"additionalProperties": {},
|
|
1137
|
+
"allOf": [
|
|
1138
|
+
{
|
|
1139
|
+
"if": {
|
|
1140
|
+
"properties": { "layout": { "const": "media-page" } },
|
|
1141
|
+
"required": ["layout"]
|
|
1142
|
+
},
|
|
1143
|
+
"then": {
|
|
1144
|
+
"required": ["assignmentMediaBaseUrl"],
|
|
1145
|
+
"properties": {
|
|
1146
|
+
"assignmentMediaBaseUrl": {
|
|
1147
|
+
"type": "string",
|
|
1148
|
+
"format": "uri",
|
|
1149
|
+
"pattern": "^[Hh][Tt][Tt][Pp][Ss]?://[^/?#@\\s\\\\]+(?:/[^?#\\s\\\\]*)?/contents/assignments/(?![\\s\\S])"
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
]
|
|
1087
1155
|
}
|
|
1088
1156
|
],
|
|
1089
1157
|
"title": "Cronkite canonical document",
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { searchCopyByLanguage } from './search-copy.js';
|
|
2
|
+
export type Language = keyof typeof searchCopyByLanguage;
|
|
3
|
+
export declare const systemDocument: (layout: "404" | "search-page" | "media-page", language: Language, slug: string, title: string, excerpt: string, extra?: Record<string, unknown>) => {
|
|
4
|
+
id: string;
|
|
5
|
+
slug: string;
|
|
6
|
+
canonicalUrl: string;
|
|
7
|
+
contentVersion: string;
|
|
8
|
+
publishedAt: string;
|
|
9
|
+
updatedAt: string;
|
|
10
|
+
status: string;
|
|
11
|
+
title: string;
|
|
12
|
+
excerpt: string;
|
|
13
|
+
language: "en" | "es" | "it";
|
|
14
|
+
featured: boolean;
|
|
15
|
+
body: never[];
|
|
16
|
+
layout: "404" | "search-page" | "media-page";
|
|
17
|
+
authors: {
|
|
18
|
+
name: string;
|
|
19
|
+
slug: string;
|
|
20
|
+
}[];
|
|
21
|
+
categories: never[];
|
|
22
|
+
navigation: {
|
|
23
|
+
categories: never[];
|
|
24
|
+
};
|
|
25
|
+
logoLink: string;
|
|
26
|
+
seo: {
|
|
27
|
+
metaTitle: string;
|
|
28
|
+
metaDescription: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export declare const mediathekSystemPage: {
|
|
32
|
+
readonly renderable: "media-page";
|
|
33
|
+
readonly contentType: "text/html; charset=utf-8";
|
|
34
|
+
readonly cacheControl: "public, max-age=0, must-revalidate";
|
|
35
|
+
readonly variants: [{
|
|
36
|
+
readonly key: "html/mediathek/index.html";
|
|
37
|
+
readonly document: {
|
|
38
|
+
id: string;
|
|
39
|
+
slug: string;
|
|
40
|
+
canonicalUrl: string;
|
|
41
|
+
contentVersion: string;
|
|
42
|
+
publishedAt: string;
|
|
43
|
+
updatedAt: string;
|
|
44
|
+
status: string;
|
|
45
|
+
title: string;
|
|
46
|
+
excerpt: string;
|
|
47
|
+
language: "en" | "es" | "it";
|
|
48
|
+
featured: boolean;
|
|
49
|
+
body: never[];
|
|
50
|
+
layout: "404" | "search-page" | "media-page";
|
|
51
|
+
authors: {
|
|
52
|
+
name: string;
|
|
53
|
+
slug: string;
|
|
54
|
+
}[];
|
|
55
|
+
categories: never[];
|
|
56
|
+
navigation: {
|
|
57
|
+
categories: never[];
|
|
58
|
+
};
|
|
59
|
+
logoLink: string;
|
|
60
|
+
seo: {
|
|
61
|
+
metaTitle: string;
|
|
62
|
+
metaDescription: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
}];
|
|
66
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const systemDocument = (layout, language, slug, title, excerpt, extra = {}) => ({
|
|
2
|
+
id: `system-${layout}-${language}`,
|
|
3
|
+
slug,
|
|
4
|
+
canonicalUrl: `https://fifthbell.com${slug}`,
|
|
5
|
+
contentVersion: '2026-09-21T00:00:00.000Z',
|
|
6
|
+
publishedAt: '2026-09-21T00:00:00.000Z',
|
|
7
|
+
updatedAt: '2026-09-21T00:00:00.000Z',
|
|
8
|
+
status: 'published',
|
|
9
|
+
title,
|
|
10
|
+
excerpt,
|
|
11
|
+
language,
|
|
12
|
+
featured: false,
|
|
13
|
+
body: [],
|
|
14
|
+
layout,
|
|
15
|
+
authors: [{ name: 'Fifthbell Newsroom', slug: 'fifthbell-newsroom' }],
|
|
16
|
+
categories: [],
|
|
17
|
+
navigation: { categories: [] },
|
|
18
|
+
logoLink: language === 'en' ? '/' : `/${language}`,
|
|
19
|
+
seo: {
|
|
20
|
+
metaTitle: `${title} | fifthbell`,
|
|
21
|
+
metaDescription: excerpt,
|
|
22
|
+
},
|
|
23
|
+
...extra,
|
|
24
|
+
});
|
|
25
|
+
export const mediathekSystemPage = {
|
|
26
|
+
renderable: 'media-page',
|
|
27
|
+
contentType: 'text/html; charset=utf-8',
|
|
28
|
+
cacheControl: 'public, max-age=0, must-revalidate',
|
|
29
|
+
variants: [{
|
|
30
|
+
key: 'html/mediathek/index.html',
|
|
31
|
+
document: systemDocument('media-page', 'en', '/mediathek', 'Mediathek', 'Browse photos from Fifthbell assignments.', {
|
|
32
|
+
assignmentMediaBaseUrl: 'https://cdn.fifthbell.com/contents/assignments/',
|
|
33
|
+
}),
|
|
34
|
+
}],
|
|
35
|
+
};
|
|
@@ -4,10 +4,11 @@ import { canonicalDocumentSchema } from "./canonical-document-schema.generated.j
|
|
|
4
4
|
const ajv = new Ajv2020({ allErrors: true, strict: false, useDefaults: true });
|
|
5
5
|
addContractFormats(ajv);
|
|
6
6
|
const validateCanonicalDocument = ajv.compile(canonicalDocumentSchema);
|
|
7
|
+
// After a failed validation Ajv always sets errors, each with a message.
|
|
7
8
|
function summarizeValidationErrors(errors) {
|
|
8
|
-
return
|
|
9
|
+
return errors
|
|
9
10
|
.slice(0, 8)
|
|
10
|
-
.map((error) => `${error.instancePath || "/"} ${error.message
|
|
11
|
+
.map((error) => `${error.instancePath || "/"} ${error.message}`)
|
|
11
12
|
.join("; ");
|
|
12
13
|
}
|
|
13
14
|
export const canonicalArticleSchema = {
|
|
@@ -54,6 +54,60 @@ export declare const canonicalDocumentSchema: {
|
|
|
54
54
|
readonly description: "An open language tag. The active renderer declares the allowed set for each request.";
|
|
55
55
|
readonly examples: readonly ["en", "pt-BR", "zh-Hant-TW"];
|
|
56
56
|
};
|
|
57
|
+
readonly capturedSelection: {
|
|
58
|
+
readonly type: "object";
|
|
59
|
+
readonly description: "CMS-issued captured-catalog selection (Brokaw captured-catalog contract v1). When present, every runtime reader on the page reads this selection instead of its current source; the browser adapter validates it in full.";
|
|
60
|
+
readonly properties: {
|
|
61
|
+
readonly selectionId: {
|
|
62
|
+
readonly type: "string";
|
|
63
|
+
readonly minLength: 1;
|
|
64
|
+
readonly maxLength: 200;
|
|
65
|
+
};
|
|
66
|
+
readonly catalogUrl: {
|
|
67
|
+
readonly type: "string";
|
|
68
|
+
readonly format: "uri";
|
|
69
|
+
readonly pattern: "^https://";
|
|
70
|
+
};
|
|
71
|
+
readonly context: {
|
|
72
|
+
readonly type: "object";
|
|
73
|
+
readonly properties: {
|
|
74
|
+
readonly rendererVersion: {
|
|
75
|
+
readonly type: "string";
|
|
76
|
+
readonly minLength: 1;
|
|
77
|
+
readonly maxLength: 200;
|
|
78
|
+
};
|
|
79
|
+
readonly templateVersion: {
|
|
80
|
+
readonly type: "string";
|
|
81
|
+
readonly minLength: 1;
|
|
82
|
+
readonly maxLength: 200;
|
|
83
|
+
};
|
|
84
|
+
readonly tenant: {
|
|
85
|
+
readonly type: "string";
|
|
86
|
+
readonly minLength: 1;
|
|
87
|
+
readonly maxLength: 200;
|
|
88
|
+
};
|
|
89
|
+
readonly origin: {
|
|
90
|
+
readonly type: "string";
|
|
91
|
+
readonly format: "uri";
|
|
92
|
+
readonly pattern: "^https://";
|
|
93
|
+
};
|
|
94
|
+
readonly build: {
|
|
95
|
+
readonly type: "string";
|
|
96
|
+
readonly minLength: 1;
|
|
97
|
+
readonly maxLength: 200;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
readonly required: readonly ["rendererVersion", "templateVersion", "tenant", "origin", "build"];
|
|
101
|
+
readonly additionalProperties: false;
|
|
102
|
+
};
|
|
103
|
+
readonly locale: {
|
|
104
|
+
readonly type: "string";
|
|
105
|
+
readonly enum: readonly ["en", "es", "it"];
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
readonly required: readonly ["selectionId", "catalogUrl", "context", "locale"];
|
|
109
|
+
readonly additionalProperties: false;
|
|
110
|
+
};
|
|
57
111
|
readonly rumConfig: {
|
|
58
112
|
readonly type: "object";
|
|
59
113
|
readonly properties: {
|
|
@@ -888,6 +942,60 @@ export declare const canonicalDocumentSchema: {
|
|
|
888
942
|
readonly description: "An open language tag. The active renderer declares the allowed set for each request.";
|
|
889
943
|
readonly examples: readonly ["en", "pt-BR", "zh-Hant-TW"];
|
|
890
944
|
};
|
|
945
|
+
readonly capturedSelection: {
|
|
946
|
+
readonly type: "object";
|
|
947
|
+
readonly description: "CMS-issued captured-catalog selection (Brokaw captured-catalog contract v1). When present, every runtime reader on the page reads this selection instead of its current source; the browser adapter validates it in full.";
|
|
948
|
+
readonly properties: {
|
|
949
|
+
readonly selectionId: {
|
|
950
|
+
readonly type: "string";
|
|
951
|
+
readonly minLength: 1;
|
|
952
|
+
readonly maxLength: 200;
|
|
953
|
+
};
|
|
954
|
+
readonly catalogUrl: {
|
|
955
|
+
readonly type: "string";
|
|
956
|
+
readonly format: "uri";
|
|
957
|
+
readonly pattern: "^https://";
|
|
958
|
+
};
|
|
959
|
+
readonly context: {
|
|
960
|
+
readonly type: "object";
|
|
961
|
+
readonly properties: {
|
|
962
|
+
readonly rendererVersion: {
|
|
963
|
+
readonly type: "string";
|
|
964
|
+
readonly minLength: 1;
|
|
965
|
+
readonly maxLength: 200;
|
|
966
|
+
};
|
|
967
|
+
readonly templateVersion: {
|
|
968
|
+
readonly type: "string";
|
|
969
|
+
readonly minLength: 1;
|
|
970
|
+
readonly maxLength: 200;
|
|
971
|
+
};
|
|
972
|
+
readonly tenant: {
|
|
973
|
+
readonly type: "string";
|
|
974
|
+
readonly minLength: 1;
|
|
975
|
+
readonly maxLength: 200;
|
|
976
|
+
};
|
|
977
|
+
readonly origin: {
|
|
978
|
+
readonly type: "string";
|
|
979
|
+
readonly format: "uri";
|
|
980
|
+
readonly pattern: "^https://";
|
|
981
|
+
};
|
|
982
|
+
readonly build: {
|
|
983
|
+
readonly type: "string";
|
|
984
|
+
readonly minLength: 1;
|
|
985
|
+
readonly maxLength: 200;
|
|
986
|
+
};
|
|
987
|
+
};
|
|
988
|
+
readonly required: readonly ["rendererVersion", "templateVersion", "tenant", "origin", "build"];
|
|
989
|
+
readonly additionalProperties: false;
|
|
990
|
+
};
|
|
991
|
+
readonly locale: {
|
|
992
|
+
readonly type: "string";
|
|
993
|
+
readonly enum: readonly ["en", "es", "it"];
|
|
994
|
+
};
|
|
995
|
+
};
|
|
996
|
+
readonly required: readonly ["selectionId", "catalogUrl", "context", "locale"];
|
|
997
|
+
readonly additionalProperties: false;
|
|
998
|
+
};
|
|
891
999
|
readonly rumConfig: {
|
|
892
1000
|
readonly type: "object";
|
|
893
1001
|
readonly properties: {
|
|
@@ -1635,6 +1743,10 @@ export declare const canonicalDocumentSchema: {
|
|
|
1635
1743
|
readonly type: "string";
|
|
1636
1744
|
readonly enum: readonly ["homepage", "category-page", "search-page", "404", "coming-soon", "live-story", "link-in-bio", "media-page", "standalone-page"];
|
|
1637
1745
|
};
|
|
1746
|
+
readonly assignmentMediaBaseUrl: {
|
|
1747
|
+
readonly type: "string";
|
|
1748
|
+
readonly description: "Completed assignment JSON directory supplied by the media-page producer.";
|
|
1749
|
+
};
|
|
1638
1750
|
readonly authors: {
|
|
1639
1751
|
readonly type: "array";
|
|
1640
1752
|
readonly items: {
|
|
@@ -1672,6 +1784,26 @@ export declare const canonicalDocumentSchema: {
|
|
|
1672
1784
|
};
|
|
1673
1785
|
readonly required: readonly ["id", "slug", "canonicalUrl", "contentVersion", "publishedAt", "updatedAt", "status", "title", "language", "featured", "body", "layout"];
|
|
1674
1786
|
readonly additionalProperties: {};
|
|
1787
|
+
readonly allOf: readonly [{
|
|
1788
|
+
readonly if: {
|
|
1789
|
+
readonly properties: {
|
|
1790
|
+
readonly layout: {
|
|
1791
|
+
readonly const: "media-page";
|
|
1792
|
+
};
|
|
1793
|
+
};
|
|
1794
|
+
readonly required: readonly ["layout"];
|
|
1795
|
+
};
|
|
1796
|
+
readonly then: {
|
|
1797
|
+
readonly required: readonly ["assignmentMediaBaseUrl"];
|
|
1798
|
+
readonly properties: {
|
|
1799
|
+
readonly assignmentMediaBaseUrl: {
|
|
1800
|
+
readonly type: "string";
|
|
1801
|
+
readonly format: "uri";
|
|
1802
|
+
readonly pattern: "^[Hh][Tt][Tt][Pp][Ss]?://[^/?#@\\s\\\\]+(?:/[^?#\\s\\\\]*)?/contents/assignments/(?![\\s\\S])";
|
|
1803
|
+
};
|
|
1804
|
+
};
|
|
1805
|
+
};
|
|
1806
|
+
}];
|
|
1675
1807
|
}];
|
|
1676
1808
|
readonly title: "Cronkite canonical document";
|
|
1677
1809
|
readonly description: "Version 1 of the provider-neutral canonical document contract accepted by Cronkite.";
|
|
@@ -56,6 +56,66 @@ export const canonicalDocumentSchema = {
|
|
|
56
56
|
description: "An open language tag. The active renderer declares the allowed set for each request.",
|
|
57
57
|
examples: ["en", "pt-BR", "zh-Hant-TW"],
|
|
58
58
|
},
|
|
59
|
+
capturedSelection: {
|
|
60
|
+
type: "object",
|
|
61
|
+
description: "CMS-issued captured-catalog selection (Brokaw captured-catalog contract v1). When present, every runtime reader on the page reads this selection instead of its current source; the browser adapter validates it in full.",
|
|
62
|
+
properties: {
|
|
63
|
+
selectionId: {
|
|
64
|
+
type: "string",
|
|
65
|
+
minLength: 1,
|
|
66
|
+
maxLength: 200,
|
|
67
|
+
},
|
|
68
|
+
catalogUrl: {
|
|
69
|
+
type: "string",
|
|
70
|
+
format: "uri",
|
|
71
|
+
pattern: "^https://",
|
|
72
|
+
},
|
|
73
|
+
context: {
|
|
74
|
+
type: "object",
|
|
75
|
+
properties: {
|
|
76
|
+
rendererVersion: {
|
|
77
|
+
type: "string",
|
|
78
|
+
minLength: 1,
|
|
79
|
+
maxLength: 200,
|
|
80
|
+
},
|
|
81
|
+
templateVersion: {
|
|
82
|
+
type: "string",
|
|
83
|
+
minLength: 1,
|
|
84
|
+
maxLength: 200,
|
|
85
|
+
},
|
|
86
|
+
tenant: {
|
|
87
|
+
type: "string",
|
|
88
|
+
minLength: 1,
|
|
89
|
+
maxLength: 200,
|
|
90
|
+
},
|
|
91
|
+
origin: {
|
|
92
|
+
type: "string",
|
|
93
|
+
format: "uri",
|
|
94
|
+
pattern: "^https://",
|
|
95
|
+
},
|
|
96
|
+
build: {
|
|
97
|
+
type: "string",
|
|
98
|
+
minLength: 1,
|
|
99
|
+
maxLength: 200,
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
required: [
|
|
103
|
+
"rendererVersion",
|
|
104
|
+
"templateVersion",
|
|
105
|
+
"tenant",
|
|
106
|
+
"origin",
|
|
107
|
+
"build",
|
|
108
|
+
],
|
|
109
|
+
additionalProperties: false,
|
|
110
|
+
},
|
|
111
|
+
locale: {
|
|
112
|
+
type: "string",
|
|
113
|
+
enum: ["en", "es", "it"],
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
required: ["selectionId", "catalogUrl", "context", "locale"],
|
|
117
|
+
additionalProperties: false,
|
|
118
|
+
},
|
|
59
119
|
rumConfig: {
|
|
60
120
|
type: "object",
|
|
61
121
|
properties: {
|
|
@@ -933,6 +993,66 @@ export const canonicalDocumentSchema = {
|
|
|
933
993
|
description: "An open language tag. The active renderer declares the allowed set for each request.",
|
|
934
994
|
examples: ["en", "pt-BR", "zh-Hant-TW"],
|
|
935
995
|
},
|
|
996
|
+
capturedSelection: {
|
|
997
|
+
type: "object",
|
|
998
|
+
description: "CMS-issued captured-catalog selection (Brokaw captured-catalog contract v1). When present, every runtime reader on the page reads this selection instead of its current source; the browser adapter validates it in full.",
|
|
999
|
+
properties: {
|
|
1000
|
+
selectionId: {
|
|
1001
|
+
type: "string",
|
|
1002
|
+
minLength: 1,
|
|
1003
|
+
maxLength: 200,
|
|
1004
|
+
},
|
|
1005
|
+
catalogUrl: {
|
|
1006
|
+
type: "string",
|
|
1007
|
+
format: "uri",
|
|
1008
|
+
pattern: "^https://",
|
|
1009
|
+
},
|
|
1010
|
+
context: {
|
|
1011
|
+
type: "object",
|
|
1012
|
+
properties: {
|
|
1013
|
+
rendererVersion: {
|
|
1014
|
+
type: "string",
|
|
1015
|
+
minLength: 1,
|
|
1016
|
+
maxLength: 200,
|
|
1017
|
+
},
|
|
1018
|
+
templateVersion: {
|
|
1019
|
+
type: "string",
|
|
1020
|
+
minLength: 1,
|
|
1021
|
+
maxLength: 200,
|
|
1022
|
+
},
|
|
1023
|
+
tenant: {
|
|
1024
|
+
type: "string",
|
|
1025
|
+
minLength: 1,
|
|
1026
|
+
maxLength: 200,
|
|
1027
|
+
},
|
|
1028
|
+
origin: {
|
|
1029
|
+
type: "string",
|
|
1030
|
+
format: "uri",
|
|
1031
|
+
pattern: "^https://",
|
|
1032
|
+
},
|
|
1033
|
+
build: {
|
|
1034
|
+
type: "string",
|
|
1035
|
+
minLength: 1,
|
|
1036
|
+
maxLength: 200,
|
|
1037
|
+
},
|
|
1038
|
+
},
|
|
1039
|
+
required: [
|
|
1040
|
+
"rendererVersion",
|
|
1041
|
+
"templateVersion",
|
|
1042
|
+
"tenant",
|
|
1043
|
+
"origin",
|
|
1044
|
+
"build",
|
|
1045
|
+
],
|
|
1046
|
+
additionalProperties: false,
|
|
1047
|
+
},
|
|
1048
|
+
locale: {
|
|
1049
|
+
type: "string",
|
|
1050
|
+
enum: ["en", "es", "it"],
|
|
1051
|
+
},
|
|
1052
|
+
},
|
|
1053
|
+
required: ["selectionId", "catalogUrl", "context", "locale"],
|
|
1054
|
+
additionalProperties: false,
|
|
1055
|
+
},
|
|
936
1056
|
rumConfig: {
|
|
937
1057
|
type: "object",
|
|
938
1058
|
properties: {
|
|
@@ -1717,6 +1837,10 @@ export const canonicalDocumentSchema = {
|
|
|
1717
1837
|
"standalone-page",
|
|
1718
1838
|
],
|
|
1719
1839
|
},
|
|
1840
|
+
assignmentMediaBaseUrl: {
|
|
1841
|
+
type: "string",
|
|
1842
|
+
description: "Completed assignment JSON directory supplied by the media-page producer.",
|
|
1843
|
+
},
|
|
1720
1844
|
authors: {
|
|
1721
1845
|
type: "array",
|
|
1722
1846
|
items: {
|
|
@@ -1767,6 +1891,28 @@ export const canonicalDocumentSchema = {
|
|
|
1767
1891
|
"layout",
|
|
1768
1892
|
],
|
|
1769
1893
|
additionalProperties: {},
|
|
1894
|
+
allOf: [
|
|
1895
|
+
{
|
|
1896
|
+
if: {
|
|
1897
|
+
properties: {
|
|
1898
|
+
layout: {
|
|
1899
|
+
const: "media-page",
|
|
1900
|
+
},
|
|
1901
|
+
},
|
|
1902
|
+
required: ["layout"],
|
|
1903
|
+
},
|
|
1904
|
+
then: {
|
|
1905
|
+
required: ["assignmentMediaBaseUrl"],
|
|
1906
|
+
properties: {
|
|
1907
|
+
assignmentMediaBaseUrl: {
|
|
1908
|
+
type: "string",
|
|
1909
|
+
format: "uri",
|
|
1910
|
+
pattern: "^[Hh][Tt][Tt][Pp][Ss]?://[^/?#@\\s\\\\]+(?:/[^?#\\s\\\\]*)?/contents/assignments/(?![\\s\\S])",
|
|
1911
|
+
},
|
|
1912
|
+
},
|
|
1913
|
+
},
|
|
1914
|
+
},
|
|
1915
|
+
],
|
|
1770
1916
|
},
|
|
1771
1917
|
],
|
|
1772
1918
|
title: "Cronkite canonical document",
|
|
@@ -14,6 +14,21 @@ export type CronkiteCanonicalDocument = {
|
|
|
14
14
|
dek?: string;
|
|
15
15
|
excerpt?: string;
|
|
16
16
|
language: BCP47LanguageTag;
|
|
17
|
+
/**
|
|
18
|
+
* CMS-issued captured-catalog selection (Brokaw captured-catalog contract v1). When present, every runtime reader on the page reads this selection instead of its current source; the browser adapter validates it in full.
|
|
19
|
+
*/
|
|
20
|
+
capturedSelection?: {
|
|
21
|
+
selectionId: string;
|
|
22
|
+
catalogUrl: string;
|
|
23
|
+
context: {
|
|
24
|
+
rendererVersion: string;
|
|
25
|
+
templateVersion: string;
|
|
26
|
+
tenant: string;
|
|
27
|
+
origin: string;
|
|
28
|
+
build: string;
|
|
29
|
+
};
|
|
30
|
+
locale: "en" | "es" | "it";
|
|
31
|
+
};
|
|
17
32
|
rumConfig?: {
|
|
18
33
|
appMonitorId: string;
|
|
19
34
|
applicationVersion: string;
|
|
@@ -285,6 +300,21 @@ export type CronkiteCanonicalDocument = {
|
|
|
285
300
|
dek?: string;
|
|
286
301
|
excerpt?: string;
|
|
287
302
|
language: BCP47LanguageTag1;
|
|
303
|
+
/**
|
|
304
|
+
* CMS-issued captured-catalog selection (Brokaw captured-catalog contract v1). When present, every runtime reader on the page reads this selection instead of its current source; the browser adapter validates it in full.
|
|
305
|
+
*/
|
|
306
|
+
capturedSelection?: {
|
|
307
|
+
selectionId: string;
|
|
308
|
+
catalogUrl: string;
|
|
309
|
+
context: {
|
|
310
|
+
rendererVersion: string;
|
|
311
|
+
templateVersion: string;
|
|
312
|
+
tenant: string;
|
|
313
|
+
origin: string;
|
|
314
|
+
build: string;
|
|
315
|
+
};
|
|
316
|
+
locale: "en" | "es" | "it";
|
|
317
|
+
};
|
|
288
318
|
rumConfig?: {
|
|
289
319
|
appMonitorId: string;
|
|
290
320
|
applicationVersion: string;
|
|
@@ -533,6 +563,10 @@ export type CronkiteCanonicalDocument = {
|
|
|
533
563
|
[k: string]: unknown;
|
|
534
564
|
};
|
|
535
565
|
layout: "homepage" | "category-page" | "search-page" | "404" | "coming-soon" | "live-story" | "link-in-bio" | "media-page" | "standalone-page";
|
|
566
|
+
/**
|
|
567
|
+
* Completed assignment JSON directory supplied by the media-page producer.
|
|
568
|
+
*/
|
|
569
|
+
assignmentMediaBaseUrl?: string;
|
|
536
570
|
authors?: {
|
|
537
571
|
name: string;
|
|
538
572
|
slug: string;
|