@fifthbell/brokaw 0.1.65 → 0.1.66

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.
Files changed (44) hide show
  1. package/README.md +31 -5
  2. package/dist/cronkite-manifest.d.ts +80 -0
  3. package/dist/cronkite-manifest.js +124 -0
  4. package/dist/cronkite-manifest.json +139 -0
  5. package/dist/json-schema-formats.d.ts +2 -0
  6. package/dist/json-schema-formats.js +19 -0
  7. package/dist/layouts.d.ts +13 -0
  8. package/dist/layouts.js +12 -0
  9. package/dist/live-program-page/index.html +2 -2
  10. package/dist/live-program-page/live-program-manifest.json +4 -4
  11. package/dist/live-program-release.d.ts +3 -0
  12. package/dist/live-program-release.js +76 -0
  13. package/dist/manifest-validation.d.ts +10 -0
  14. package/dist/manifest-validation.js +27 -0
  15. package/dist/renderer.core.d.ts +2 -1
  16. package/dist/renderer.core.js +2 -1
  17. package/dist/renderer.d.ts +3 -0
  18. package/dist/renderer.js +2 -0
  19. package/dist/renderer.node.js +7 -12
  20. package/dist/schemas/canonical-document.schema.json +1071 -0
  21. package/dist/schemas/cronkite-manifest.schema.json +501 -0
  22. package/dist/schemas/feed-renderable-input.schema.json +16 -0
  23. package/dist/schemas/live-program-release-input.schema.json +34 -0
  24. package/dist/types/canonical-article.d.ts +8 -262
  25. package/dist/types/canonical-article.js +21 -245
  26. package/dist/types/canonical-document-schema.generated.d.ts +1634 -0
  27. package/dist/types/canonical-document-schema.generated.js +1730 -0
  28. package/dist/types/canonical-document.generated.d.ts +541 -0
  29. package/dist/types/canonical-document.generated.js +3 -0
  30. package/dist/types/cronkite-manifest.generated.d.ts +339 -0
  31. package/dist/types/cronkite-manifest.generated.js +3 -0
  32. package/dist/types/live-program-release-input.generated.d.ts +5 -0
  33. package/dist/types/live-program-release-input.generated.js +3 -0
  34. package/dist/video/Root.d.ts +1 -0
  35. package/dist/video/Root.js +40 -0
  36. package/dist/video/ShortVideo.d.ts +3 -0
  37. package/dist/video/ShortVideo.js +92 -0
  38. package/dist/video/index.d.ts +2 -0
  39. package/dist/video/index.js +4 -0
  40. package/dist/video/types.d.ts +37 -0
  41. package/dist/video/types.js +1 -0
  42. package/package.json +19 -4
  43. /package/dist/live-program-page/{live-program.v0.1.65.css → live-program.v0.1.66.css} +0 -0
  44. /package/dist/live-program-page/{live-program.v0.1.65.js → live-program.v0.1.66.js} +0 -0
@@ -0,0 +1,501 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://contracts.example/cronkite/cls/v1/cronkite-manifest.schema.json",
4
+ "title": "Cronkite CLS manifest",
5
+ "description": "Machine-readable structural contract for a Cronkite-compatible Component Library System manifest. Semantic cross-field and package checks are specified in ../validation.md.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "contract",
10
+ "contractVersion",
11
+ "package",
12
+ "version",
13
+ "layouts",
14
+ "languages"
15
+ ],
16
+ "properties": {
17
+ "contract": {
18
+ "const": "cronkite.cls",
19
+ "description": "Required contract discriminator. No omission default."
20
+ },
21
+ "contractVersion": {
22
+ "const": 1,
23
+ "description": "Required manifest contract version. No omission default."
24
+ },
25
+ "package": {
26
+ "type": "string",
27
+ "minLength": 1,
28
+ "maxLength": 214,
29
+ "pattern": "^(?:@[a-z0-9][a-z0-9._-]*/)?[a-z0-9][a-z0-9._-]*$",
30
+ "description": "Required npm package name without a version. No omission default."
31
+ },
32
+ "version": {
33
+ "type": "string",
34
+ "maxLength": 256,
35
+ "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-((?:0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*)(?:\\.(?:0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*))*))?(?:\\+([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?$",
36
+ "description": "Required exact SemVer package version. No omission default."
37
+ },
38
+ "layouts": {
39
+ "type": "array",
40
+ "minItems": 1,
41
+ "uniqueItems": true,
42
+ "items": { "$ref": "#/$defs/name" },
43
+ "description": "Required authoritative set of page layouts. No omission default."
44
+ },
45
+ "languages": {
46
+ "type": "array",
47
+ "minItems": 1,
48
+ "uniqueItems": true,
49
+ "items": { "$ref": "#/$defs/languageTag" },
50
+ "description": "Required supported BCP 47 language tags. No omission default."
51
+ },
52
+ "collections": {
53
+ "type": "object",
54
+ "minProperties": 1,
55
+ "propertyNames": { "$ref": "#/$defs/name" },
56
+ "additionalProperties": { "$ref": "#/$defs/safePrefix" },
57
+ "default": {
58
+ "article-page": "json/articles",
59
+ "standalone-page": "json/pages"
60
+ },
61
+ "description": "Optional layout-to-canonical-JSON-prefix map. Supplying the object replaces the whole default map."
62
+ },
63
+ "routing": {
64
+ "$ref": "#/$defs/routing",
65
+ "default": {
66
+ "htmlKeyTemplate": "html/{path}/index.html",
67
+ "rootKey": "html/index.html"
68
+ },
69
+ "description": "Optional HTML object-key derivation rules."
70
+ },
71
+ "systemPages": {
72
+ "type": "array",
73
+ "items": { "$ref": "#/$defs/systemPage" },
74
+ "default": [],
75
+ "description": "Optional system-generated pages. Expanded route/key uniqueness is a semantic validation rule."
76
+ },
77
+ "renderables": {
78
+ "type": "object",
79
+ "propertyNames": { "$ref": "#/$defs/name" },
80
+ "additionalProperties": { "$ref": "#/$defs/renderable" },
81
+ "default": {},
82
+ "description": "Optional explicit page or asset renderables in the same namespace as layouts."
83
+ },
84
+ "capabilities": {
85
+ "type": "object",
86
+ "additionalProperties": false,
87
+ "properties": {
88
+ "fonts": { "$ref": "#/$defs/capability" },
89
+ "assets": { "$ref": "#/$defs/capability" }
90
+ },
91
+ "default": {},
92
+ "description": "Optional package file capabilities recognized by contract version 1."
93
+ },
94
+ "writeOrdering": {
95
+ "type": "object",
96
+ "propertyNames": { "$ref": "#/$defs/name" },
97
+ "additionalProperties": { "$ref": "#/$defs/writeOrderingRule" },
98
+ "default": {},
99
+ "description": "Optional operation-local final-write declarations."
100
+ }
101
+ },
102
+ "$defs": {
103
+ "name": {
104
+ "type": "string",
105
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
106
+ "minLength": 1,
107
+ "maxLength": 128
108
+ },
109
+ "languageTag": {
110
+ "type": "string",
111
+ "pattern": "^[A-Za-z0-9]{1,8}(?:-[A-Za-z0-9]{1,8})*$",
112
+ "minLength": 1,
113
+ "maxLength": 63,
114
+ "description": "Permissive lexical envelope including grandfathered and private-use tags; a standards-compliant BCP 47 parser is authoritative."
115
+ },
116
+ "javascriptIdentifier": {
117
+ "type": "string",
118
+ "pattern": "^[A-Za-z_$][A-Za-z0-9_$]*$",
119
+ "minLength": 1,
120
+ "maxLength": 128
121
+ },
122
+ "safePrefix": {
123
+ "type": "string",
124
+ "pattern": "^(?!/)(?!\\.{1,2}(?:/|$))(?!.*(?:/\\.{1,2})(?:/|$))(?!.*//)(?!.*[\\\\?#\\u0000\\r\\n])(?!.*\\{)[^/]+(?:/[^/]+)*$",
125
+ "minLength": 1,
126
+ "maxLength": 1024
127
+ },
128
+ "safeKey": {
129
+ "type": "string",
130
+ "pattern": "^(?!/)(?!\\.{1,2}(?:/|$))(?!.*(?:/\\.{1,2})(?:/|$))(?!.*//)(?!.*[\\\\?#\\u0000\\r\\n])(?!.*\\{)[^/]+(?:/[^/]+)*$",
131
+ "minLength": 1,
132
+ "maxLength": 1024
133
+ },
134
+ "safeKeyWithLanguage": {
135
+ "type": "string",
136
+ "pattern": "^(?!/)(?!\\.{1,2}(?:/|$))(?!.*(?:/\\.{1,2})(?:/|$))(?!.*//)(?!.*[\\\\?#\\u0000\\r\\n])(?!(?:.*\\{language\\}){2})(?!.*\\{(?!language\\})[^}]*\\})[^/]+(?:/[^/]+)*$",
137
+ "minLength": 1,
138
+ "maxLength": 1024
139
+ },
140
+ "siteRouteWithLanguage": {
141
+ "type": "string",
142
+ "pattern": "^/(?:$|(?!/)(?!\\.{1,2}(?:/|$))(?!.*(?:/\\.{1,2})(?:/|$))(?!.*//)(?!.*[\\\\?#\\u0000\\r\\n])(?!(?:.*\\{language\\}){2})(?!.*\\{(?!language\\})[^}]*\\})[^/?#]+(?:/[^/?#]+)*)$",
143
+ "minLength": 1,
144
+ "maxLength": 2048
145
+ },
146
+ "packageEntry": {
147
+ "type": "string",
148
+ "pattern": "^(?!/)(?!\\.{1,2}(?:/|$))(?!.*(?:/\\.{1,2})(?:/|$))(?!.*//)(?!.*[\\\\?#\\u0000\\r\\n])(?!.*\\{)[^/]+(?:/[^/]+)*$",
149
+ "minLength": 1,
150
+ "maxLength": 1024
151
+ },
152
+ "mediaType": {
153
+ "type": "string",
154
+ "pattern": "^[A-Za-z0-9!#$&^_.+-]+/[A-Za-z0-9!#$&^_.+-]+(?:\\s*;\\s*[A-Za-z0-9!#$&^_.+-]+=(?:[A-Za-z0-9!#$&^_.+-]+|\"[^\"\\r\\n]*\"))*$",
155
+ "maxLength": 256
156
+ },
157
+ "routing": {
158
+ "type": "object",
159
+ "additionalProperties": false,
160
+ "properties": {
161
+ "htmlKeyTemplate": {
162
+ "type": "string",
163
+ "pattern": "^(?!/)(?=.*\\{path\\})(?!\\.{1,2}(?:/|$))(?!.*(?:/\\.{1,2})(?:/|$))(?!.*//)(?!.*[\\\\?#\\u0000\\r\\n])(?!(?:.*\\{path\\}){2})(?!.*\\{(?!path\\})[^}]*\\})[^/]+(?:/[^/]+)*$",
164
+ "minLength": 6,
165
+ "maxLength": 1024,
166
+ "default": "html/{path}/index.html",
167
+ "description": "Optional safe relative template containing {path} exactly once."
168
+ },
169
+ "rootKey": {
170
+ "$ref": "#/$defs/safeKey",
171
+ "default": "html/index.html",
172
+ "description": "Optional safe relative root-route object key."
173
+ }
174
+ }
175
+ },
176
+ "copy": {
177
+ "type": "object",
178
+ "additionalProperties": false,
179
+ "required": ["title", "description"],
180
+ "properties": {
181
+ "title": {
182
+ "type": "string",
183
+ "minLength": 1,
184
+ "maxLength": 512,
185
+ "pattern": "\\S",
186
+ "description": "Required non-empty fictional or outlet-owned page title. No omission default."
187
+ },
188
+ "description": {
189
+ "type": "string",
190
+ "minLength": 1,
191
+ "maxLength": 2048,
192
+ "pattern": "\\S",
193
+ "description": "Required non-empty fictional or outlet-owned page description. No omission default."
194
+ }
195
+ }
196
+ },
197
+ "systemPage": {
198
+ "type": "object",
199
+ "additionalProperties": false,
200
+ "required": [
201
+ "layout",
202
+ "route",
203
+ "key",
204
+ "cacheControl",
205
+ "perLanguage",
206
+ "copy"
207
+ ],
208
+ "properties": {
209
+ "layout": {
210
+ "$ref": "#/$defs/name",
211
+ "description": "Required layout that must occur in the top-level layouts array. No omission default."
212
+ },
213
+ "route": {
214
+ "$ref": "#/$defs/siteRouteWithLanguage",
215
+ "description": "Required public route, optionally with one {language} token. No omission default."
216
+ },
217
+ "key": {
218
+ "$ref": "#/$defs/safeKeyWithLanguage",
219
+ "description": "Required safe relative object key, optionally with one {language} token. No omission default."
220
+ },
221
+ "cacheControl": {
222
+ "type": "string",
223
+ "minLength": 1,
224
+ "maxLength": 1024,
225
+ "pattern": "^[^\\r\\n]+$",
226
+ "description": "Required Cache-Control field value. No omission default."
227
+ },
228
+ "perLanguage": {
229
+ "type": "boolean",
230
+ "description": "Required switch controlling language expansion. No omission default."
231
+ },
232
+ "copy": {
233
+ "type": "object",
234
+ "minProperties": 1,
235
+ "propertyNames": { "$ref": "#/$defs/languageTag" },
236
+ "additionalProperties": { "$ref": "#/$defs/copy" },
237
+ "description": "Required language-to-copy map. No omission default."
238
+ }
239
+ },
240
+ "allOf": [
241
+ {
242
+ "if": {
243
+ "properties": { "perLanguage": { "const": true } },
244
+ "required": ["perLanguage"]
245
+ },
246
+ "then": {
247
+ "properties": {
248
+ "route": { "type": "string", "pattern": "\\{language\\}" },
249
+ "key": { "type": "string", "pattern": "\\{language\\}" }
250
+ }
251
+ },
252
+ "else": {
253
+ "properties": {
254
+ "route": {
255
+ "type": "string",
256
+ "not": { "type": "string", "pattern": "\\{language\\}" }
257
+ },
258
+ "key": {
259
+ "type": "string",
260
+ "not": { "type": "string", "pattern": "\\{language\\}" }
261
+ }
262
+ }
263
+ }
264
+ }
265
+ ]
266
+ },
267
+ "opaqueContract": {
268
+ "type": "object",
269
+ "required": ["kind", "version"],
270
+ "properties": {
271
+ "kind": {
272
+ "type": "string",
273
+ "minLength": 1,
274
+ "maxLength": 256,
275
+ "pattern": "\\S"
276
+ },
277
+ "version": {
278
+ "type": "integer",
279
+ "minimum": 1
280
+ }
281
+ },
282
+ "additionalProperties": true,
283
+ "description": "Producer-owned contract metadata. The CPS validates kind/version and treats every other member as opaque."
284
+ },
285
+ "resource": {
286
+ "type": "object",
287
+ "additionalProperties": false,
288
+ "required": ["key", "schema", "contentType"],
289
+ "properties": {
290
+ "key": {
291
+ "$ref": "#/$defs/safeKeyWithLanguage",
292
+ "description": "Required CMS-owned resource key, optionally with one {language} token."
293
+ },
294
+ "schema": {
295
+ "$ref": "#/$defs/packageEntry",
296
+ "description": "Required packed draft-2020-12 JSON Schema path."
297
+ },
298
+ "contentType": {
299
+ "$ref": "#/$defs/mediaType",
300
+ "description": "Required resource media type."
301
+ },
302
+ "perLanguage": {
303
+ "type": "boolean",
304
+ "default": false,
305
+ "description": "Optional language-expansion switch."
306
+ }
307
+ },
308
+ "allOf": [
309
+ {
310
+ "if": {
311
+ "properties": { "perLanguage": { "const": true } },
312
+ "required": ["perLanguage"]
313
+ },
314
+ "then": {
315
+ "properties": {
316
+ "key": { "type": "string", "pattern": "\\{language\\}" }
317
+ }
318
+ },
319
+ "else": {
320
+ "properties": {
321
+ "key": {
322
+ "type": "string",
323
+ "not": { "type": "string", "pattern": "\\{language\\}" }
324
+ }
325
+ }
326
+ }
327
+ }
328
+ ]
329
+ },
330
+ "resources": {
331
+ "type": "object",
332
+ "propertyNames": { "$ref": "#/$defs/name" },
333
+ "additionalProperties": { "$ref": "#/$defs/resource" },
334
+ "default": {}
335
+ },
336
+ "renderable": {
337
+ "type": "object",
338
+ "additionalProperties": false,
339
+ "required": ["engine"],
340
+ "properties": {
341
+ "engine": {
342
+ "enum": ["handlebars", "html-raster", "remotion"],
343
+ "description": "Required bounded CPS rendering engine. No omission default."
344
+ },
345
+ "export": {
346
+ "$ref": "#/$defs/javascriptIdentifier",
347
+ "description": "Function export required by handlebars and html-raster. No omission default."
348
+ },
349
+ "entry": {
350
+ "$ref": "#/$defs/packageEntry",
351
+ "description": "Packed package entry required by remotion. No omission default."
352
+ },
353
+ "compositionId": {
354
+ "type": "string",
355
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$",
356
+ "minLength": 1,
357
+ "maxLength": 128,
358
+ "description": "Composition selector required by remotion. No omission default."
359
+ },
360
+ "outputMode": {
361
+ "enum": ["single", "files"],
362
+ "default": "single",
363
+ "description": "Optional result mode; files uses the FileEntry array ABI."
364
+ },
365
+ "lifecycle": {
366
+ "enum": ["request", "basement"],
367
+ "default": "request",
368
+ "description": "Optional request-derived or CLS-version-derived lifecycle."
369
+ },
370
+ "contentType": {
371
+ "$ref": "#/$defs/mediaType",
372
+ "description": "Media type required for a single output and forbidden for a file set."
373
+ },
374
+ "width": {
375
+ "type": "integer",
376
+ "minimum": 1,
377
+ "maximum": 16384,
378
+ "description": "Positive pixel width required by html-raster."
379
+ },
380
+ "height": {
381
+ "type": "integer",
382
+ "minimum": 1,
383
+ "maximum": 16384,
384
+ "description": "Positive pixel height required by html-raster."
385
+ },
386
+ "key": {
387
+ "$ref": "#/$defs/safeKey",
388
+ "description": "Output key required only for a basement single output."
389
+ },
390
+ "inputSchema": {
391
+ "$ref": "#/$defs/packageEntry",
392
+ "description": "Optional packed draft-2020-12 input-schema path."
393
+ },
394
+ "resources": {
395
+ "$ref": "#/$defs/resources"
396
+ },
397
+ "contract": {
398
+ "$ref": "#/$defs/opaqueContract"
399
+ }
400
+ },
401
+ "allOf": [
402
+ {
403
+ "oneOf": [
404
+ {
405
+ "properties": {
406
+ "engine": { "const": "handlebars" },
407
+ "outputMode": { "const": "single" },
408
+ "contentType": { "type": "string", "pattern": "^text/" },
409
+ "export": true,
410
+ "entry": false,
411
+ "compositionId": false,
412
+ "width": false,
413
+ "height": false
414
+ },
415
+ "required": ["export", "contentType"]
416
+ },
417
+ {
418
+ "properties": {
419
+ "engine": { "const": "handlebars" },
420
+ "outputMode": { "const": "files" },
421
+ "export": true,
422
+ "entry": false,
423
+ "compositionId": false,
424
+ "contentType": false,
425
+ "width": false,
426
+ "height": false,
427
+ "key": false
428
+ },
429
+ "required": ["export", "outputMode"]
430
+ },
431
+ {
432
+ "properties": {
433
+ "engine": { "const": "html-raster" },
434
+ "outputMode": { "const": "single" },
435
+ "contentType": { "type": "string", "pattern": "^image/" },
436
+ "export": true,
437
+ "width": true,
438
+ "height": true,
439
+ "entry": false,
440
+ "compositionId": false
441
+ },
442
+ "required": ["export", "contentType", "width", "height"]
443
+ },
444
+ {
445
+ "properties": {
446
+ "engine": { "const": "remotion" },
447
+ "outputMode": { "const": "single" },
448
+ "contentType": { "type": "string", "pattern": "^video/" },
449
+ "entry": true,
450
+ "compositionId": true,
451
+ "export": false,
452
+ "width": false,
453
+ "height": false
454
+ },
455
+ "required": ["entry", "compositionId", "contentType"]
456
+ }
457
+ ]
458
+ },
459
+ {
460
+ "if": {
461
+ "properties": {
462
+ "lifecycle": { "const": "basement" },
463
+ "outputMode": { "const": "single" }
464
+ },
465
+ "required": ["lifecycle"]
466
+ },
467
+ "then": {
468
+ "properties": { "key": true },
469
+ "required": ["key"]
470
+ },
471
+ "else": { "properties": { "key": false } }
472
+ }
473
+ ]
474
+ },
475
+ "capability": {
476
+ "type": "object",
477
+ "additionalProperties": false,
478
+ "required": ["export"],
479
+ "properties": {
480
+ "export": {
481
+ "$ref": "#/$defs/javascriptIdentifier",
482
+ "description": "Required function export. No omission default."
483
+ }
484
+ }
485
+ },
486
+ "writeOrderingRule": {
487
+ "type": "object",
488
+ "additionalProperties": false,
489
+ "required": ["last"],
490
+ "properties": {
491
+ "last": {
492
+ "type": "array",
493
+ "minItems": 1,
494
+ "uniqueItems": true,
495
+ "items": { "$ref": "#/$defs/safeKey" },
496
+ "description": "Required ordered final-write keys. No omission default."
497
+ }
498
+ }
499
+ }
500
+ }
501
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.fifthbell.com/brokaw/feed-renderable-input.schema.json",
4
+ "title": "Brokaw feed renderable input",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["document"],
8
+ "properties": {
9
+ "document": {
10
+ "type": "object"
11
+ },
12
+ "feed": {
13
+ "type": "object"
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://fifthbell.invalid/schemas/live-program-release-input-v1.schema.json",
4
+ "title": "Fifthbell live-program release input",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["programId", "apiBaseUrl"],
8
+ "properties": {
9
+ "programId": {
10
+ "type": "string",
11
+ "minLength": 1,
12
+ "maxLength": 128,
13
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
14
+ },
15
+ "apiBaseUrl": {
16
+ "type": "string",
17
+ "format": "uri",
18
+ "anyOf": [
19
+ {
20
+ "type": "string",
21
+ "pattern": "^https://[^/?#@]+(?:/[^?#]*)?$"
22
+ },
23
+ {
24
+ "type": "string",
25
+ "pattern": "^http://localhost(?::[0-9]+)?(?:/[^?#]*)?$"
26
+ },
27
+ {
28
+ "type": "string",
29
+ "pattern": "^http://127\\.0\\.0\\.1(?::[0-9]+)?(?:/[^?#]*)?$"
30
+ }
31
+ ]
32
+ }
33
+ }
34
+ }