@kubuild/schema 0.0.1

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/dist/index.js ADDED
@@ -0,0 +1,862 @@
1
+ // src/document.ts
2
+ import { z } from "zod";
3
+ var SCHEMA_NAME = "stora.page";
4
+ var CURRENT_SCHEMA_VERSION = "1.0.0";
5
+ var AssetReferenceSchema = z.object({
6
+ type: z.literal("asset"),
7
+ assetId: z.string().min(1, "Asset ID cannot be empty"),
8
+ filename: z.string().optional(),
9
+ mimeType: z.string().optional(),
10
+ fallbackUrl: z.string().url().optional()
11
+ });
12
+ var VariableBindingSchema = z.object({
13
+ type: z.literal("variable"),
14
+ key: z.string().min(1, "Variable key cannot be empty"),
15
+ fallback: z.unknown().optional()
16
+ });
17
+ var ActionBindingSchema = z.object({
18
+ type: z.string().min(1, "Action type cannot be empty"),
19
+ payload: z.record(z.string(), z.unknown()).optional()
20
+ });
21
+ var DANGEROUS_STYLE_VALUE_PATTERN = /javascript:|expression\(|@import|<script|vbscript:|data:text\/html/i;
22
+ var StyleValueSchema = z.union([
23
+ z.string().refine((value) => !DANGEROUS_STYLE_VALUE_PATTERN.test(value), {
24
+ message: "Style value contains a disallowed or unsafe pattern"
25
+ }),
26
+ z.number(),
27
+ z.boolean(),
28
+ z.null(),
29
+ z.undefined()
30
+ ]);
31
+ var StyleDefinitionSchema = z.record(z.string(), StyleValueSchema);
32
+ var PseudoStateStylesSchema = z.record(z.string(), StyleDefinitionSchema);
33
+ var ResponsiveStylesSchema = z.object({
34
+ base: StyleDefinitionSchema.optional(),
35
+ desktop: StyleDefinitionSchema.optional(),
36
+ tablet: StyleDefinitionSchema.optional(),
37
+ mobile: StyleDefinitionSchema.optional(),
38
+ states: PseudoStateStylesSchema.optional()
39
+ }).catchall(StyleDefinitionSchema).default({});
40
+ var NodeSchema = z.lazy(
41
+ () => z.object({
42
+ id: z.string().min(1, "Node ID must be a non-empty string"),
43
+ type: z.string().min(1, "Node type must be a non-empty string"),
44
+ props: z.record(z.string(), z.unknown()).optional().default({}),
45
+ styles: ResponsiveStylesSchema.optional().default({}),
46
+ children: z.array(NodeSchema).optional().default([])
47
+ })
48
+ );
49
+ var RootPageNodeSchema = NodeSchema.refine(
50
+ (node) => node.type === "page",
51
+ {
52
+ message: 'Root node must have type "page"',
53
+ path: ["type"]
54
+ }
55
+ );
56
+ var DocumentMetadataSchema = z.object({
57
+ title: z.string().min(1, "Title is required").default("Untitled Page"),
58
+ description: z.string().optional().default(""),
59
+ author: z.string().optional().default(""),
60
+ createdAt: z.string().optional(),
61
+ updatedAt: z.string().optional(),
62
+ tags: z.array(z.string()).optional().default([]),
63
+ category: z.string().optional().default("general"),
64
+ version: z.string().optional().default("1.0.0"),
65
+ custom: z.record(z.string(), z.unknown()).optional()
66
+ });
67
+ var PageDocumentSchema = z.object({
68
+ schema: z.literal(SCHEMA_NAME),
69
+ version: z.string().min(1, "Schema version is required").default(CURRENT_SCHEMA_VERSION),
70
+ metadata: DocumentMetadataSchema.optional(),
71
+ document: RootPageNodeSchema
72
+ });
73
+ function isAssetReference(value) {
74
+ return AssetReferenceSchema.safeParse(value).success;
75
+ }
76
+ function isVariableBinding(value) {
77
+ return VariableBindingSchema.safeParse(value).success;
78
+ }
79
+ function isActionBinding(value) {
80
+ return ActionBindingSchema.safeParse(value).success;
81
+ }
82
+ function generateDeterministicNodeId(prefix, indexOrKey) {
83
+ const cleanPrefix = prefix.toLowerCase().replace(/[^a-z0-9_-]/g, "-");
84
+ return `${cleanPrefix}_${indexOrKey}`;
85
+ }
86
+ function collectNodeIds(node) {
87
+ const ids = [node.id];
88
+ if (node.children && Array.isArray(node.children)) {
89
+ for (const child of node.children) {
90
+ ids.push(...collectNodeIds(child));
91
+ }
92
+ }
93
+ return ids;
94
+ }
95
+ function validateNodeIdUniqueness(node) {
96
+ const allIds = collectNodeIds(node);
97
+ const seen = /* @__PURE__ */ new Set();
98
+ const duplicates = /* @__PURE__ */ new Set();
99
+ for (const id of allIds) {
100
+ if (seen.has(id)) {
101
+ duplicates.add(id);
102
+ } else {
103
+ seen.add(id);
104
+ }
105
+ }
106
+ return {
107
+ valid: duplicates.size === 0,
108
+ duplicateIds: Array.from(duplicates)
109
+ };
110
+ }
111
+
112
+ // src/manifest.ts
113
+ import { z as z2 } from "zod";
114
+ var ManifestAssetItemSchema = z2.object({
115
+ id: z2.string().min(1, "Asset ID cannot be empty"),
116
+ path: z2.string().min(1, "Asset archive path cannot be empty"),
117
+ mimeType: z2.string().min(1, "MIME type cannot be empty"),
118
+ size: z2.number().nonnegative("Asset size must be non-negative"),
119
+ checksum: z2.string().optional()
120
+ });
121
+ var ManifestSchema = z2.object({
122
+ schema: z2.literal(SCHEMA_NAME).default(SCHEMA_NAME),
123
+ schemaVersion: z2.string().min(1, "Schema version cannot be empty").default("1.0.0"),
124
+ packageVersion: z2.string().min(1, "Package version cannot be empty").default("1.0.0"),
125
+ builderCompatibility: z2.string().default(">=0.1.0"),
126
+ requiredComponents: z2.array(z2.string()).default([]),
127
+ requiredCapabilities: z2.array(z2.string()).default([]),
128
+ assets: z2.array(ManifestAssetItemSchema).default([]),
129
+ createdAt: z2.string().optional()
130
+ });
131
+ function isManifest(value) {
132
+ return ManifestSchema.safeParse(value).success;
133
+ }
134
+
135
+ // src/template.ts
136
+ import { z as z3 } from "zod";
137
+ var DANGEROUS_URI_PATTERN = /^(javascript:|vbscript:|data:(?!image\/))|<script/i;
138
+ function isSafeThumbnailUrl(url) {
139
+ if (!url || typeof url !== "string") return false;
140
+ const trimmed = url.trim();
141
+ if (trimmed.length === 0) return false;
142
+ if (DANGEROUS_URI_PATTERN.test(trimmed)) return false;
143
+ return true;
144
+ }
145
+ var SafeThumbnailUrlSchema = z3.string().min(1, "Thumbnail URL cannot be empty").refine(
146
+ (url) => isSafeThumbnailUrl(url),
147
+ { message: "Thumbnail URL contains an unsafe protocol or payload" }
148
+ );
149
+ var SafeThumbnailObjectSchema = z3.object({
150
+ url: SafeThumbnailUrlSchema,
151
+ alt: z3.string().optional(),
152
+ width: z3.number().positive().optional(),
153
+ height: z3.number().positive().optional()
154
+ });
155
+ var SafeThumbnailSchema = z3.union([
156
+ AssetReferenceSchema,
157
+ SafeThumbnailObjectSchema,
158
+ SafeThumbnailUrlSchema
159
+ ]);
160
+ var TemplatePackageRefSchema = z3.object({
161
+ path: z3.string().optional(),
162
+ url: SafeThumbnailUrlSchema.optional(),
163
+ checksum: z3.string().optional(),
164
+ format: z3.enum(["stora", "json"]).default("stora")
165
+ });
166
+ var TemplateRequirementsSchema = z3.object({
167
+ requiredComponents: z3.array(z3.string()).default([]),
168
+ requiredCapabilities: z3.array(z3.string()).default([])
169
+ });
170
+ var TemplateRecordSchema = z3.object({
171
+ id: z3.string().min(1, "Template ID must be a non-empty string"),
172
+ name: z3.string().min(1, "Template name must be a non-empty string"),
173
+ description: z3.string().optional().default(""),
174
+ category: z3.string().optional().default("general"),
175
+ tags: z3.array(z3.string()).optional().default([]),
176
+ thumbnail: SafeThumbnailSchema.optional(),
177
+ author: z3.string().optional().default(""),
178
+ version: z3.string().optional().default("1.0.0"),
179
+ document: PageDocumentSchema.optional(),
180
+ packageReference: TemplatePackageRefSchema.optional(),
181
+ requirements: TemplateRequirementsSchema.default({
182
+ requiredComponents: [],
183
+ requiredCapabilities: []
184
+ }),
185
+ createdAt: z3.string().optional(),
186
+ updatedAt: z3.string().optional(),
187
+ custom: z3.record(z3.string(), z3.unknown()).optional()
188
+ });
189
+ function isTemplateRecord(value) {
190
+ return TemplateRecordSchema.safeParse(value).success;
191
+ }
192
+ function isSafeThumbnail(value) {
193
+ return SafeThumbnailSchema.safeParse(value).success;
194
+ }
195
+
196
+ // src/fixtures/starter-page.json
197
+ var starter_page_default = {
198
+ schema: "stora.page",
199
+ version: "1.0.0",
200
+ metadata: {
201
+ title: "Welcome to KUBUILD",
202
+ description: "A starter template built with KUBUILD portable web builder",
203
+ author: "KUBUILD Team",
204
+ tags: ["landing-page", "starter", "portable"],
205
+ category: "landing",
206
+ version: "1.0.0",
207
+ createdAt: "2026-08-22T00:00:00.000Z",
208
+ updatedAt: "2026-08-22T00:00:00.000Z"
209
+ },
210
+ document: {
211
+ id: "root-page",
212
+ type: "page",
213
+ props: {
214
+ title: "KUBUILD Starter Page"
215
+ },
216
+ styles: {
217
+ base: {
218
+ backgroundColor: "#ffffff",
219
+ fontFamily: "Inter, sans-serif",
220
+ color: "#111827",
221
+ minHeight: "100vh"
222
+ }
223
+ },
224
+ children: [
225
+ {
226
+ id: "hero-section",
227
+ type: "section",
228
+ props: {},
229
+ styles: {
230
+ base: {
231
+ paddingTop: "64px",
232
+ paddingBottom: "64px",
233
+ paddingLeft: "24px",
234
+ paddingRight: "24px",
235
+ backgroundColor: "#f8fafc"
236
+ }
237
+ },
238
+ children: [
239
+ {
240
+ id: "hero-container",
241
+ type: "container",
242
+ props: {
243
+ maxWidth: "1200px"
244
+ },
245
+ styles: {
246
+ base: {
247
+ margin: "0 auto",
248
+ display: "flex",
249
+ flexDirection: "column",
250
+ alignItems: "center",
251
+ textAlign: "center",
252
+ gap: "24px"
253
+ }
254
+ },
255
+ children: [
256
+ {
257
+ id: "hero-heading",
258
+ type: "heading",
259
+ props: {
260
+ text: "Build Once, Render Anywhere",
261
+ level: 1
262
+ },
263
+ styles: {
264
+ base: {
265
+ fontSize: "48px",
266
+ fontWeight: "800",
267
+ color: "#0f172a",
268
+ lineHeight: "1.2"
269
+ },
270
+ mobile: {
271
+ fontSize: "32px"
272
+ }
273
+ },
274
+ children: []
275
+ },
276
+ {
277
+ id: "hero-text",
278
+ type: "text",
279
+ props: {
280
+ content: "KUBUILD is an open, portable web page builder engine designed for modern web applications."
281
+ },
282
+ styles: {
283
+ base: {
284
+ fontSize: "18px",
285
+ color: "#475569",
286
+ maxWidth: "680px",
287
+ lineHeight: "1.6"
288
+ }
289
+ },
290
+ children: []
291
+ },
292
+ {
293
+ id: "hero-image",
294
+ type: "image",
295
+ props: {
296
+ src: "https://picsum.photos/200/300",
297
+ asset: {
298
+ type: "asset",
299
+ assetId: "asset_hero_graphic",
300
+ filename: "hero.webp",
301
+ mimeType: "image/webp"
302
+ },
303
+ alt: "KUBUILD Platform Graphic",
304
+ width: 640,
305
+ height: 360
306
+ },
307
+ styles: {
308
+ base: {
309
+ borderRadius: "12px",
310
+ maxWidth: "100%",
311
+ height: "auto",
312
+ boxShadow: "0 20px 25px -5px rgba(0, 0, 0, 0.1)"
313
+ }
314
+ },
315
+ children: []
316
+ },
317
+ {
318
+ id: "hero-button",
319
+ type: "button",
320
+ props: {
321
+ label: "Get Started",
322
+ action: {
323
+ type: "navigate",
324
+ payload: {
325
+ url: "/docs"
326
+ }
327
+ }
328
+ },
329
+ styles: {
330
+ base: {
331
+ backgroundColor: "#2563eb",
332
+ color: "#ffffff",
333
+ paddingTop: "12px",
334
+ paddingBottom: "12px",
335
+ paddingLeft: "28px",
336
+ paddingRight: "28px",
337
+ borderRadius: "8px",
338
+ fontWeight: "600",
339
+ fontSize: "16px",
340
+ cursor: "pointer",
341
+ border: "none"
342
+ }
343
+ },
344
+ children: []
345
+ }
346
+ ]
347
+ }
348
+ ]
349
+ }
350
+ ]
351
+ }
352
+ };
353
+
354
+ // src/fixtures.ts
355
+ var starterPageFixture = starter_page_default;
356
+
357
+ // src/json-schema.ts
358
+ var PAGE_DOCUMENT_JSON_SCHEMA_V1 = {
359
+ $schema: "http://json-schema.org/draft-07/schema#",
360
+ $id: "https://schema.stora.page/v1/page.json",
361
+ title: "StoraPageDocument",
362
+ description: "Portable Web Page Document v1 schema definition for KUBUILD",
363
+ type: "object",
364
+ required: ["schema", "version", "document"],
365
+ additionalProperties: false,
366
+ properties: {
367
+ schema: {
368
+ type: "string",
369
+ const: "stora.page",
370
+ description: "Identifies the document type format"
371
+ },
372
+ version: {
373
+ type: "string",
374
+ pattern: "^\\d+(\\.\\d+)*$",
375
+ description: "Schema version of the document",
376
+ default: "1.0.0"
377
+ },
378
+ metadata: {
379
+ $ref: "#/definitions/documentMetadata"
380
+ },
381
+ document: {
382
+ $ref: "#/definitions/rootPageNode"
383
+ }
384
+ },
385
+ definitions: {
386
+ styleValue: {
387
+ type: ["string", "number", "boolean", "null"],
388
+ description: "A CSS property or design token value"
389
+ },
390
+ styleDefinition: {
391
+ type: "object",
392
+ additionalProperties: {
393
+ $ref: "#/definitions/styleValue"
394
+ },
395
+ description: "Key-value map of style properties"
396
+ },
397
+ responsiveStyles: {
398
+ type: "object",
399
+ properties: {
400
+ base: { $ref: "#/definitions/styleDefinition" },
401
+ desktop: { $ref: "#/definitions/styleDefinition" },
402
+ tablet: { $ref: "#/definitions/styleDefinition" },
403
+ mobile: { $ref: "#/definitions/styleDefinition" }
404
+ },
405
+ additionalProperties: {
406
+ $ref: "#/definitions/styleDefinition"
407
+ }
408
+ },
409
+ assetReference: {
410
+ type: "object",
411
+ required: ["type", "assetId"],
412
+ properties: {
413
+ type: {
414
+ type: "string",
415
+ const: "asset"
416
+ },
417
+ assetId: {
418
+ type: "string",
419
+ minLength: 1
420
+ },
421
+ filename: {
422
+ type: "string"
423
+ },
424
+ mimeType: {
425
+ type: "string"
426
+ },
427
+ fallbackUrl: {
428
+ type: "string",
429
+ format: "uri"
430
+ }
431
+ },
432
+ additionalProperties: false
433
+ },
434
+ variableBinding: {
435
+ type: "object",
436
+ required: ["type", "key"],
437
+ properties: {
438
+ type: {
439
+ type: "string",
440
+ const: "variable"
441
+ },
442
+ key: {
443
+ type: "string",
444
+ minLength: 1
445
+ },
446
+ fallback: {}
447
+ },
448
+ additionalProperties: false
449
+ },
450
+ actionBinding: {
451
+ type: "object",
452
+ required: ["type"],
453
+ properties: {
454
+ type: {
455
+ type: "string",
456
+ minLength: 1
457
+ },
458
+ payload: {
459
+ type: "object"
460
+ }
461
+ },
462
+ additionalProperties: false
463
+ },
464
+ node: {
465
+ type: "object",
466
+ required: ["id", "type"],
467
+ properties: {
468
+ id: {
469
+ type: "string",
470
+ minLength: 1,
471
+ description: "Unique deterministic node identifier"
472
+ },
473
+ type: {
474
+ type: "string",
475
+ minLength: 1,
476
+ description: "Component type identifier"
477
+ },
478
+ props: {
479
+ type: "object",
480
+ description: "Component props payload and bindings",
481
+ default: {}
482
+ },
483
+ styles: {
484
+ $ref: "#/definitions/responsiveStyles"
485
+ },
486
+ children: {
487
+ type: "array",
488
+ items: {
489
+ $ref: "#/definitions/node"
490
+ },
491
+ default: []
492
+ }
493
+ },
494
+ additionalProperties: false
495
+ },
496
+ rootPageNode: {
497
+ allOf: [
498
+ { $ref: "#/definitions/node" },
499
+ {
500
+ type: "object",
501
+ properties: {
502
+ type: {
503
+ type: "string",
504
+ const: "page",
505
+ description: 'The root node type must be "page"'
506
+ }
507
+ }
508
+ }
509
+ ]
510
+ },
511
+ documentMetadata: {
512
+ type: "object",
513
+ required: ["title"],
514
+ properties: {
515
+ title: {
516
+ type: "string",
517
+ minLength: 1,
518
+ default: "Untitled Page"
519
+ },
520
+ description: {
521
+ type: "string",
522
+ default: ""
523
+ },
524
+ author: {
525
+ type: "string",
526
+ default: ""
527
+ },
528
+ createdAt: {
529
+ type: "string",
530
+ format: "date-time"
531
+ },
532
+ updatedAt: {
533
+ type: "string",
534
+ format: "date-time"
535
+ },
536
+ tags: {
537
+ type: "array",
538
+ items: { type: "string" },
539
+ default: []
540
+ },
541
+ category: {
542
+ type: "string",
543
+ default: "general"
544
+ },
545
+ version: {
546
+ type: "string",
547
+ default: "1.0.0"
548
+ },
549
+ custom: {
550
+ type: "object"
551
+ }
552
+ },
553
+ additionalProperties: false
554
+ }
555
+ }
556
+ };
557
+ function getPageDocumentJsonSchema() {
558
+ return PAGE_DOCUMENT_JSON_SCHEMA_V1;
559
+ }
560
+ var MANIFEST_JSON_SCHEMA_V1 = {
561
+ $schema: "http://json-schema.org/draft-07/schema#",
562
+ $id: "https://schema.stora.page/v1/manifest.json",
563
+ title: "StoraPackageManifest",
564
+ description: "Portable Package Manifest v1 schema definition for KUBUILD (.stora)",
565
+ type: "object",
566
+ required: ["schemaVersion", "packageVersion", "builderCompatibility", "requiredComponents", "requiredCapabilities", "assets"],
567
+ additionalProperties: false,
568
+ properties: {
569
+ schema: {
570
+ type: "string",
571
+ const: "stora.page",
572
+ description: "Schema identifier",
573
+ default: "stora.page"
574
+ },
575
+ schemaVersion: {
576
+ type: "string",
577
+ pattern: "^\\d+(\\.\\d+)*$",
578
+ description: "Document schema version",
579
+ default: "1.0.0"
580
+ },
581
+ packageVersion: {
582
+ type: "string",
583
+ pattern: "^\\d+(\\.\\d+)*$",
584
+ description: "Package version",
585
+ default: "1.0.0"
586
+ },
587
+ builderCompatibility: {
588
+ type: "string",
589
+ description: "Minimum or range of builder versions compatible with this package",
590
+ default: ">=0.1.0"
591
+ },
592
+ requiredComponents: {
593
+ type: "array",
594
+ items: { type: "string" },
595
+ description: "List of custom component types required by the page",
596
+ default: []
597
+ },
598
+ requiredCapabilities: {
599
+ type: "array",
600
+ items: { type: "string" },
601
+ description: "List of capabilities required by components in the page",
602
+ default: []
603
+ },
604
+ assets: {
605
+ type: "array",
606
+ items: { $ref: "#/definitions/manifestAssetItem" },
607
+ description: "Inventory of local assets packaged within the archive",
608
+ default: []
609
+ },
610
+ createdAt: {
611
+ type: "string",
612
+ format: "date-time",
613
+ description: "ISO timestamp when the package was created"
614
+ }
615
+ },
616
+ definitions: {
617
+ manifestAssetItem: {
618
+ type: "object",
619
+ required: ["id", "path", "mimeType", "size"],
620
+ properties: {
621
+ id: {
622
+ type: "string",
623
+ minLength: 1,
624
+ description: "Unique asset identifier"
625
+ },
626
+ path: {
627
+ type: "string",
628
+ minLength: 1,
629
+ description: "Relative archive path to asset file (e.g. assets/hero.png)"
630
+ },
631
+ mimeType: {
632
+ type: "string",
633
+ minLength: 1,
634
+ description: "MIME type of the asset"
635
+ },
636
+ size: {
637
+ type: "number",
638
+ minimum: 0,
639
+ description: "Asset size in bytes"
640
+ },
641
+ checksum: {
642
+ type: "string",
643
+ description: "SHA-256 or algorithm-prefixed checksum (e.g. sha256:...)"
644
+ }
645
+ },
646
+ additionalProperties: false
647
+ }
648
+ }
649
+ };
650
+ function getManifestJsonSchema() {
651
+ return MANIFEST_JSON_SCHEMA_V1;
652
+ }
653
+ var TEMPLATE_RECORD_JSON_SCHEMA_V1 = {
654
+ $schema: "http://json-schema.org/draft-07/schema#",
655
+ $id: "https://schema.stora.page/v1/template.json",
656
+ title: "StoraTemplateRecord",
657
+ description: "Reusable Page Template Record v1 schema definition for KUBUILD",
658
+ type: "object",
659
+ required: ["id", "name"],
660
+ additionalProperties: false,
661
+ properties: {
662
+ id: {
663
+ type: "string",
664
+ minLength: 1,
665
+ description: "Unique template identifier"
666
+ },
667
+ name: {
668
+ type: "string",
669
+ minLength: 1,
670
+ description: "Human-readable name of the template"
671
+ },
672
+ description: {
673
+ type: "string",
674
+ default: "",
675
+ description: "Detailed description of the template purpose and contents"
676
+ },
677
+ category: {
678
+ type: "string",
679
+ default: "general",
680
+ description: "Template category grouping"
681
+ },
682
+ tags: {
683
+ type: "array",
684
+ items: { type: "string" },
685
+ default: [],
686
+ description: "Search and filter tags"
687
+ },
688
+ thumbnail: {
689
+ oneOf: [
690
+ { $ref: "#/definitions/assetReference" },
691
+ { $ref: "#/definitions/safeThumbnailObject" },
692
+ { type: "string", minLength: 1 }
693
+ ],
694
+ description: "Safe preview image asset reference or URL"
695
+ },
696
+ author: {
697
+ type: "string",
698
+ default: "",
699
+ description: "Template creator or team"
700
+ },
701
+ version: {
702
+ type: "string",
703
+ default: "1.0.0",
704
+ description: "Semantic version of the template"
705
+ },
706
+ document: {
707
+ $ref: "https://schema.stora.page/v1/page.json#",
708
+ description: "Embedded PageDocument snapshot (optional if packageReference provided)"
709
+ },
710
+ packageReference: {
711
+ $ref: "#/definitions/templatePackageRef",
712
+ description: "External package/archive reference (optional if document provided)"
713
+ },
714
+ requirements: {
715
+ $ref: "#/definitions/templateRequirements",
716
+ description: "Component and capability requirements for this template"
717
+ },
718
+ createdAt: {
719
+ type: "string",
720
+ format: "date-time",
721
+ description: "ISO creation timestamp"
722
+ },
723
+ updatedAt: {
724
+ type: "string",
725
+ format: "date-time",
726
+ description: "ISO last updated timestamp"
727
+ },
728
+ custom: {
729
+ type: "object",
730
+ description: "Custom host-specific serializable metadata"
731
+ }
732
+ },
733
+ definitions: {
734
+ assetReference: {
735
+ type: "object",
736
+ required: ["type", "assetId"],
737
+ properties: {
738
+ type: {
739
+ type: "string",
740
+ const: "asset"
741
+ },
742
+ assetId: {
743
+ type: "string",
744
+ minLength: 1
745
+ },
746
+ filename: {
747
+ type: "string"
748
+ },
749
+ mimeType: {
750
+ type: "string"
751
+ },
752
+ fallbackUrl: {
753
+ type: "string",
754
+ format: "uri"
755
+ }
756
+ },
757
+ additionalProperties: false
758
+ },
759
+ safeThumbnailObject: {
760
+ type: "object",
761
+ required: ["url"],
762
+ properties: {
763
+ url: {
764
+ type: "string",
765
+ minLength: 1
766
+ },
767
+ alt: {
768
+ type: "string"
769
+ },
770
+ width: {
771
+ type: "number",
772
+ minimum: 1
773
+ },
774
+ height: {
775
+ type: "number",
776
+ minimum: 1
777
+ }
778
+ },
779
+ additionalProperties: false
780
+ },
781
+ templatePackageRef: {
782
+ type: "object",
783
+ properties: {
784
+ path: {
785
+ type: "string"
786
+ },
787
+ url: {
788
+ type: "string"
789
+ },
790
+ checksum: {
791
+ type: "string"
792
+ },
793
+ format: {
794
+ type: "string",
795
+ enum: ["stora", "json"],
796
+ default: "stora"
797
+ }
798
+ },
799
+ additionalProperties: false
800
+ },
801
+ templateRequirements: {
802
+ type: "object",
803
+ properties: {
804
+ requiredComponents: {
805
+ type: "array",
806
+ items: { type: "string" },
807
+ default: []
808
+ },
809
+ requiredCapabilities: {
810
+ type: "array",
811
+ items: { type: "string" },
812
+ default: []
813
+ }
814
+ },
815
+ additionalProperties: false
816
+ }
817
+ }
818
+ };
819
+ function getTemplateRecordJsonSchema() {
820
+ return TEMPLATE_RECORD_JSON_SCHEMA_V1;
821
+ }
822
+ export {
823
+ ActionBindingSchema,
824
+ AssetReferenceSchema,
825
+ CURRENT_SCHEMA_VERSION,
826
+ DocumentMetadataSchema,
827
+ MANIFEST_JSON_SCHEMA_V1,
828
+ ManifestAssetItemSchema,
829
+ ManifestSchema,
830
+ NodeSchema,
831
+ PAGE_DOCUMENT_JSON_SCHEMA_V1,
832
+ PageDocumentSchema,
833
+ PseudoStateStylesSchema,
834
+ ResponsiveStylesSchema,
835
+ RootPageNodeSchema,
836
+ SCHEMA_NAME,
837
+ SafeThumbnailObjectSchema,
838
+ SafeThumbnailSchema,
839
+ SafeThumbnailUrlSchema,
840
+ StyleDefinitionSchema,
841
+ StyleValueSchema,
842
+ TEMPLATE_RECORD_JSON_SCHEMA_V1,
843
+ TemplatePackageRefSchema,
844
+ TemplateRecordSchema,
845
+ TemplateRequirementsSchema,
846
+ VariableBindingSchema,
847
+ collectNodeIds,
848
+ generateDeterministicNodeId,
849
+ getManifestJsonSchema,
850
+ getPageDocumentJsonSchema,
851
+ getTemplateRecordJsonSchema,
852
+ isActionBinding,
853
+ isAssetReference,
854
+ isManifest,
855
+ isSafeThumbnail,
856
+ isSafeThumbnailUrl,
857
+ isTemplateRecord,
858
+ isVariableBinding,
859
+ starterPageFixture,
860
+ validateNodeIdUniqueness
861
+ };
862
+ //# sourceMappingURL=index.js.map