@rathnasgala2/schemas 3.7.0 → 3.8.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.
Files changed (51) hide show
  1. package/THIRD_PARTY_LICENSES.json +1 -1
  2. package/diagnostics/diagnostic-map.json +845 -20
  3. package/docs/catalogs/schema-inventory.json +10 -10
  4. package/examples/valid/build-input/rules.json +24 -2
  5. package/examples/valid/template-composition/rules.json +769 -0
  6. package/examples/valid/theme-contract/rules.json +1107 -5
  7. package/fixtures/boundary/build-input/rules.json +24 -2
  8. package/fixtures/boundary/template-composition/rules.json +769 -0
  9. package/fixtures/boundary/theme-contract/rules.json +1107 -5
  10. package/fixtures/invalid/build-input/SCHEMA_PATTERN_INVALID/cases.json +22 -11
  11. package/fixtures/invalid/build-input/SCHEMA_TYPE_INVALID/cases.json +22 -0
  12. package/fixtures/invalid/build-input/SCHEMA_UNION_INVALID/cases.json +11 -0
  13. package/fixtures/invalid/template-composition/SCHEMA_CONSTANT_INVALID/cases.json +497 -0
  14. package/fixtures/invalid/template-composition/SCHEMA_ENUM_INVALID/cases.json +83 -0
  15. package/fixtures/invalid/template-composition/SCHEMA_NEGATED_RULE_MATCHED/cases.json +11 -0
  16. package/fixtures/invalid/template-composition/SCHEMA_REQUIRED_FIELD_MISSING/cases.json +909 -0
  17. package/fixtures/invalid/template-composition/SCHEMA_UNION_INVALID/cases.json +20 -0
  18. package/fixtures/invalid/theme-contract/REQUEST_FIELD_UNKNOWN/cases.json +120 -0
  19. package/fixtures/invalid/theme-contract/SCHEMA_CONSTANT_INVALID/cases.json +680 -0
  20. package/fixtures/invalid/theme-contract/SCHEMA_NEGATED_RULE_MATCHED/cases.json +11 -0
  21. package/fixtures/invalid/theme-contract/SCHEMA_PATTERN_INVALID/cases.json +33 -9
  22. package/fixtures/invalid/theme-contract/SCHEMA_REQUIRED_FIELD_MISSING/cases.json +1383 -3
  23. package/fixtures/invalid/theme-contract/SCHEMA_TYPE_INVALID/cases.json +77 -0
  24. package/fixtures/invalid/theme-contract/SCHEMA_UNION_INVALID/cases.json +18 -0
  25. package/fixtures/invalid/theme-contract/SCHEMA_VERSION_UNSUPPORTED/cases.json +110 -0
  26. package/fixtures/manifest.json +7414 -1089
  27. package/fixtures/s2/manifest.json +1 -1
  28. package/fixtures/unknown-field/build-input/rules.json +5 -1
  29. package/fixtures/unknown-field/template-composition/rules.json +111 -0
  30. package/fixtures/unknown-field/theme-contract/rules.json +276 -1
  31. package/generated/browser/validator-core.mjs +3 -3
  32. package/generated/typescript/contracts/artifact-manifest.d.ts +4 -2
  33. package/generated/typescript/contracts/build-input.d.ts +3 -2
  34. package/generated/typescript/contracts/build-provenance.d.ts +4 -2
  35. package/generated/typescript/contracts/deployment-intent.d.ts +1 -0
  36. package/generated/typescript/contracts/deployment-receipt.d.ts +1 -0
  37. package/generated/typescript/contracts/lock.d.ts +2 -1
  38. package/generated/typescript/contracts/template-composition.d.ts +75 -4
  39. package/generated/typescript/contracts/theme-contract.d.ts +75 -2
  40. package/openapi/http-catalog.json +2 -2
  41. package/openapi/openapi.yaml +41 -10
  42. package/package.json +1 -1
  43. package/sbom.cdx.json +23 -23
  44. package/schemas/artifact-manifest.schema.json +4 -2
  45. package/schemas/build-input.schema.json +12 -2
  46. package/schemas/build-provenance.schema.json +4 -2
  47. package/schemas/deployment-intent.schema.json +1 -0
  48. package/schemas/deployment-receipt.schema.json +1 -0
  49. package/schemas/lock.schema.json +2 -1
  50. package/schemas/template-composition.schema.json +179 -2
  51. package/schemas/theme-contract.schema.json +282 -1
@@ -6,7 +6,32 @@
6
6
  "required": ["schemaId", "schemaVersion"],
7
7
  "properties": {
8
8
  "schemaId": { "const": "urn:gala:schema:template-composition:2.0.0" },
9
- "schemaVersion": { "const": "2.0.0" }
9
+ "schemaVersion": { "const": "2.0.0" },
10
+ "profile": {
11
+ "enum": ["editorial", "newsletter", "visual", "personal", "developer"]
12
+ },
13
+ "homeLayout": {
14
+ "enum": [
15
+ "magazine",
16
+ "newspaper",
17
+ "gallery",
18
+ "chronological",
19
+ "topic-index"
20
+ ]
21
+ },
22
+ "articleLayout": {
23
+ "enum": ["editorial", "issue", "full-bleed", "prose", "technical"]
24
+ },
25
+ "authorLayout": {
26
+ "enum": ["portrait", "profile", "portfolio", "biography"]
27
+ },
28
+ "listingLayout": { "enum": ["rows", "issues", "image-grid", "dated-rows"] },
29
+ "headerLayout": {
30
+ "enum": ["masthead", "publication", "minimal", "compact", "utility"]
31
+ },
32
+ "footerLayout": { "enum": ["expanded", "compact"] },
33
+ "mediaRatio": { "enum": ["landscape", "mixed"] },
34
+ "density": { "enum": ["comfortable", "spacious", "compact"] }
10
35
  },
11
36
  "additionalProperties": false,
12
37
  "$defs": {
@@ -129,5 +154,157 @@
129
154
  "description": "Reverse-DNS extension namespace that cannot shadow a core key."
130
155
  }
131
156
  },
132
- "$comment": "MVP composition is intentionally empty: deferred module properties and every unknown property reject."
157
+ "oneOf": [
158
+ {
159
+ "not": {
160
+ "anyOf": [
161
+ { "properties": { "profile": {} }, "required": ["profile"] },
162
+ { "properties": { "homeLayout": {} }, "required": ["homeLayout"] },
163
+ {
164
+ "properties": { "articleLayout": {} },
165
+ "required": ["articleLayout"]
166
+ },
167
+ {
168
+ "properties": { "authorLayout": {} },
169
+ "required": ["authorLayout"]
170
+ },
171
+ {
172
+ "properties": { "listingLayout": {} },
173
+ "required": ["listingLayout"]
174
+ },
175
+ {
176
+ "properties": { "headerLayout": {} },
177
+ "required": ["headerLayout"]
178
+ },
179
+ {
180
+ "properties": { "footerLayout": {} },
181
+ "required": ["footerLayout"]
182
+ },
183
+ { "properties": { "mediaRatio": {} }, "required": ["mediaRatio"] },
184
+ { "properties": { "density": {} }, "required": ["density"] }
185
+ ]
186
+ }
187
+ },
188
+ {
189
+ "properties": {
190
+ "profile": { "const": "editorial" },
191
+ "homeLayout": { "const": "magazine" },
192
+ "articleLayout": { "const": "editorial" },
193
+ "authorLayout": { "const": "portrait" },
194
+ "listingLayout": { "const": "rows" },
195
+ "headerLayout": { "const": "masthead" },
196
+ "footerLayout": { "const": "expanded" },
197
+ "mediaRatio": { "const": "landscape" },
198
+ "density": { "const": "comfortable" }
199
+ },
200
+ "required": [
201
+ "profile",
202
+ "homeLayout",
203
+ "articleLayout",
204
+ "authorLayout",
205
+ "listingLayout",
206
+ "headerLayout",
207
+ "footerLayout",
208
+ "mediaRatio",
209
+ "density"
210
+ ]
211
+ },
212
+ {
213
+ "properties": {
214
+ "profile": { "const": "newsletter" },
215
+ "homeLayout": { "const": "newspaper" },
216
+ "articleLayout": { "const": "issue" },
217
+ "authorLayout": { "const": "profile" },
218
+ "listingLayout": { "const": "issues" },
219
+ "headerLayout": { "const": "publication" },
220
+ "footerLayout": { "const": "expanded" },
221
+ "mediaRatio": { "const": "landscape" },
222
+ "density": { "const": "comfortable" }
223
+ },
224
+ "required": [
225
+ "profile",
226
+ "homeLayout",
227
+ "articleLayout",
228
+ "authorLayout",
229
+ "listingLayout",
230
+ "headerLayout",
231
+ "footerLayout",
232
+ "mediaRatio",
233
+ "density"
234
+ ]
235
+ },
236
+ {
237
+ "properties": {
238
+ "profile": { "const": "visual" },
239
+ "homeLayout": { "const": "gallery" },
240
+ "articleLayout": { "const": "full-bleed" },
241
+ "authorLayout": { "const": "portfolio" },
242
+ "listingLayout": { "const": "image-grid" },
243
+ "headerLayout": { "const": "minimal" },
244
+ "footerLayout": { "const": "compact" },
245
+ "mediaRatio": { "const": "mixed" },
246
+ "density": { "const": "comfortable" }
247
+ },
248
+ "required": [
249
+ "profile",
250
+ "homeLayout",
251
+ "articleLayout",
252
+ "authorLayout",
253
+ "listingLayout",
254
+ "headerLayout",
255
+ "footerLayout",
256
+ "mediaRatio",
257
+ "density"
258
+ ]
259
+ },
260
+ {
261
+ "properties": {
262
+ "profile": { "const": "personal" },
263
+ "homeLayout": { "const": "chronological" },
264
+ "articleLayout": { "const": "prose" },
265
+ "authorLayout": { "const": "biography" },
266
+ "listingLayout": { "const": "dated-rows" },
267
+ "headerLayout": { "const": "compact" },
268
+ "footerLayout": { "const": "compact" },
269
+ "mediaRatio": { "const": "landscape" },
270
+ "density": { "const": "spacious" }
271
+ },
272
+ "required": [
273
+ "profile",
274
+ "homeLayout",
275
+ "articleLayout",
276
+ "authorLayout",
277
+ "listingLayout",
278
+ "headerLayout",
279
+ "footerLayout",
280
+ "mediaRatio",
281
+ "density"
282
+ ]
283
+ },
284
+ {
285
+ "properties": {
286
+ "profile": { "const": "developer" },
287
+ "homeLayout": { "const": "topic-index" },
288
+ "articleLayout": { "const": "technical" },
289
+ "authorLayout": { "const": "biography" },
290
+ "listingLayout": { "const": "rows" },
291
+ "headerLayout": { "const": "utility" },
292
+ "footerLayout": { "const": "compact" },
293
+ "mediaRatio": { "const": "landscape" },
294
+ "density": { "const": "compact" }
295
+ },
296
+ "required": [
297
+ "profile",
298
+ "homeLayout",
299
+ "articleLayout",
300
+ "authorLayout",
301
+ "listingLayout",
302
+ "headerLayout",
303
+ "footerLayout",
304
+ "mediaRatio",
305
+ "density"
306
+ ]
307
+ }
308
+ ],
309
+ "$comment": "The legacy composition remains empty. Generation 4 adds five closed, all-fields-required branches; fields from different profiles cannot be mixed and theme options remain deferred."
133
310
  }
@@ -32,12 +32,19 @@
32
32
  "allOf": [
33
33
  { "$ref": "#/$defs/packageExact" },
34
34
  {
35
- "pattern": "^@rathnasgala2/theme-(?:default|amaze|flashy|minimal|zebra)@"
35
+ "anyOf": [
36
+ {
37
+ "type": "string",
38
+ "pattern": "^@rathnasgala2/theme-(?:default|amaze|flashy|minimal|zebra)@"
39
+ },
40
+ { "type": "string", "pattern": "^@rathnasgala2/theme-editorial@" }
41
+ ]
36
42
  }
37
43
  ]
38
44
  },
39
45
  "contractVersion": { "$ref": "#/$defs/semver" },
40
46
  "templateRange": { "$ref": "#/$defs/semverRange" },
47
+ "composition": { "$ref": "#/$defs/templateComposition" },
41
48
  "stylesheets": {
42
49
  "type": "array",
43
50
  "items": { "$ref": "#/$defs/repoRelativePath" },
@@ -1526,6 +1533,170 @@
1526
1533
  "format": "gala-spdx-expression",
1527
1534
  "x-gala-utf8ByteLength": { "minimum": 1, "maximum": 128 }
1528
1535
  },
1536
+ "templateComposition": {
1537
+ "oneOf": [
1538
+ {
1539
+ "type": "object",
1540
+ "required": [
1541
+ "schemaId",
1542
+ "schemaVersion",
1543
+ "profile",
1544
+ "homeLayout",
1545
+ "articleLayout",
1546
+ "authorLayout",
1547
+ "listingLayout",
1548
+ "headerLayout",
1549
+ "footerLayout",
1550
+ "mediaRatio",
1551
+ "density"
1552
+ ],
1553
+ "properties": {
1554
+ "schemaId": {
1555
+ "const": "urn:gala:schema:template-composition:2.0.0"
1556
+ },
1557
+ "schemaVersion": { "const": "2.0.0" },
1558
+ "profile": { "const": "editorial" },
1559
+ "homeLayout": { "const": "magazine" },
1560
+ "articleLayout": { "const": "editorial" },
1561
+ "authorLayout": { "const": "portrait" },
1562
+ "listingLayout": { "const": "rows" },
1563
+ "headerLayout": { "const": "masthead" },
1564
+ "footerLayout": { "const": "expanded" },
1565
+ "mediaRatio": { "const": "landscape" },
1566
+ "density": { "const": "comfortable" }
1567
+ },
1568
+ "additionalProperties": false
1569
+ },
1570
+ {
1571
+ "type": "object",
1572
+ "required": [
1573
+ "schemaId",
1574
+ "schemaVersion",
1575
+ "profile",
1576
+ "homeLayout",
1577
+ "articleLayout",
1578
+ "authorLayout",
1579
+ "listingLayout",
1580
+ "headerLayout",
1581
+ "footerLayout",
1582
+ "mediaRatio",
1583
+ "density"
1584
+ ],
1585
+ "properties": {
1586
+ "schemaId": {
1587
+ "const": "urn:gala:schema:template-composition:2.0.0"
1588
+ },
1589
+ "schemaVersion": { "const": "2.0.0" },
1590
+ "profile": { "const": "newsletter" },
1591
+ "homeLayout": { "const": "newspaper" },
1592
+ "articleLayout": { "const": "issue" },
1593
+ "authorLayout": { "const": "profile" },
1594
+ "listingLayout": { "const": "issues" },
1595
+ "headerLayout": { "const": "publication" },
1596
+ "footerLayout": { "const": "expanded" },
1597
+ "mediaRatio": { "const": "landscape" },
1598
+ "density": { "const": "comfortable" }
1599
+ },
1600
+ "additionalProperties": false
1601
+ },
1602
+ {
1603
+ "type": "object",
1604
+ "required": [
1605
+ "schemaId",
1606
+ "schemaVersion",
1607
+ "profile",
1608
+ "homeLayout",
1609
+ "articleLayout",
1610
+ "authorLayout",
1611
+ "listingLayout",
1612
+ "headerLayout",
1613
+ "footerLayout",
1614
+ "mediaRatio",
1615
+ "density"
1616
+ ],
1617
+ "properties": {
1618
+ "schemaId": {
1619
+ "const": "urn:gala:schema:template-composition:2.0.0"
1620
+ },
1621
+ "schemaVersion": { "const": "2.0.0" },
1622
+ "profile": { "const": "visual" },
1623
+ "homeLayout": { "const": "gallery" },
1624
+ "articleLayout": { "const": "full-bleed" },
1625
+ "authorLayout": { "const": "portfolio" },
1626
+ "listingLayout": { "const": "image-grid" },
1627
+ "headerLayout": { "const": "minimal" },
1628
+ "footerLayout": { "const": "compact" },
1629
+ "mediaRatio": { "const": "mixed" },
1630
+ "density": { "const": "comfortable" }
1631
+ },
1632
+ "additionalProperties": false
1633
+ },
1634
+ {
1635
+ "type": "object",
1636
+ "required": [
1637
+ "schemaId",
1638
+ "schemaVersion",
1639
+ "profile",
1640
+ "homeLayout",
1641
+ "articleLayout",
1642
+ "authorLayout",
1643
+ "listingLayout",
1644
+ "headerLayout",
1645
+ "footerLayout",
1646
+ "mediaRatio",
1647
+ "density"
1648
+ ],
1649
+ "properties": {
1650
+ "schemaId": {
1651
+ "const": "urn:gala:schema:template-composition:2.0.0"
1652
+ },
1653
+ "schemaVersion": { "const": "2.0.0" },
1654
+ "profile": { "const": "personal" },
1655
+ "homeLayout": { "const": "chronological" },
1656
+ "articleLayout": { "const": "prose" },
1657
+ "authorLayout": { "const": "biography" },
1658
+ "listingLayout": { "const": "dated-rows" },
1659
+ "headerLayout": { "const": "compact" },
1660
+ "footerLayout": { "const": "compact" },
1661
+ "mediaRatio": { "const": "landscape" },
1662
+ "density": { "const": "spacious" }
1663
+ },
1664
+ "additionalProperties": false
1665
+ },
1666
+ {
1667
+ "type": "object",
1668
+ "required": [
1669
+ "schemaId",
1670
+ "schemaVersion",
1671
+ "profile",
1672
+ "homeLayout",
1673
+ "articleLayout",
1674
+ "authorLayout",
1675
+ "listingLayout",
1676
+ "headerLayout",
1677
+ "footerLayout",
1678
+ "mediaRatio",
1679
+ "density"
1680
+ ],
1681
+ "properties": {
1682
+ "schemaId": {
1683
+ "const": "urn:gala:schema:template-composition:2.0.0"
1684
+ },
1685
+ "schemaVersion": { "const": "2.0.0" },
1686
+ "profile": { "const": "developer" },
1687
+ "homeLayout": { "const": "topic-index" },
1688
+ "articleLayout": { "const": "technical" },
1689
+ "authorLayout": { "const": "biography" },
1690
+ "listingLayout": { "const": "rows" },
1691
+ "headerLayout": { "const": "utility" },
1692
+ "footerLayout": { "const": "compact" },
1693
+ "mediaRatio": { "const": "landscape" },
1694
+ "density": { "const": "compact" }
1695
+ },
1696
+ "additionalProperties": false
1697
+ }
1698
+ ]
1699
+ },
1529
1700
  "themeToken": {
1530
1701
  "type": "object",
1531
1702
  "required": ["key", "type", "light", "dark"],
@@ -1905,6 +2076,12 @@
1905
2076
  "themeId": { "const": "zebra" },
1906
2077
  "package": { "pattern": "^@rathnasgala2\\/theme-zebra@" }
1907
2078
  }
2079
+ },
2080
+ {
2081
+ "properties": {
2082
+ "themeId": { "const": "editorial" },
2083
+ "package": { "pattern": "^@rathnasgala2\\/theme-editorial@" }
2084
+ }
1908
2085
  }
1909
2086
  ]
1910
2087
  },
@@ -1941,6 +2118,110 @@
1941
2118
  }
1942
2119
  }
1943
2120
  ]
2121
+ },
2122
+ {
2123
+ "if": {
2124
+ "properties": { "contractVersion": { "const": "4.0.0" } },
2125
+ "required": ["contractVersion"]
2126
+ },
2127
+ "then": {
2128
+ "properties": { "templateRange": { "const": "^4.0.0" } },
2129
+ "required": ["composition"],
2130
+ "allOf": [
2131
+ {
2132
+ "if": {
2133
+ "properties": { "themeId": { "const": "default" } },
2134
+ "required": ["themeId"]
2135
+ },
2136
+ "then": {
2137
+ "properties": {
2138
+ "composition": {
2139
+ "properties": { "profile": { "const": "newsletter" } },
2140
+ "required": ["profile"]
2141
+ }
2142
+ }
2143
+ }
2144
+ },
2145
+ {
2146
+ "if": {
2147
+ "properties": { "themeId": { "const": "amaze" } },
2148
+ "required": ["themeId"]
2149
+ },
2150
+ "then": {
2151
+ "properties": {
2152
+ "composition": {
2153
+ "properties": { "profile": { "const": "editorial" } },
2154
+ "required": ["profile"]
2155
+ }
2156
+ }
2157
+ }
2158
+ },
2159
+ {
2160
+ "if": {
2161
+ "properties": { "themeId": { "const": "editorial" } },
2162
+ "required": ["themeId"]
2163
+ },
2164
+ "then": {
2165
+ "properties": {
2166
+ "composition": {
2167
+ "properties": { "profile": { "const": "editorial" } },
2168
+ "required": ["profile"]
2169
+ }
2170
+ }
2171
+ }
2172
+ },
2173
+ {
2174
+ "if": {
2175
+ "properties": { "themeId": { "const": "flashy" } },
2176
+ "required": ["themeId"]
2177
+ },
2178
+ "then": {
2179
+ "properties": {
2180
+ "composition": {
2181
+ "properties": { "profile": { "const": "visual" } },
2182
+ "required": ["profile"]
2183
+ }
2184
+ }
2185
+ }
2186
+ },
2187
+ {
2188
+ "if": {
2189
+ "properties": { "themeId": { "const": "minimal" } },
2190
+ "required": ["themeId"]
2191
+ },
2192
+ "then": {
2193
+ "properties": {
2194
+ "composition": {
2195
+ "properties": { "profile": { "const": "personal" } },
2196
+ "required": ["profile"]
2197
+ }
2198
+ }
2199
+ }
2200
+ },
2201
+ {
2202
+ "if": {
2203
+ "properties": { "themeId": { "const": "zebra" } },
2204
+ "required": ["themeId"]
2205
+ },
2206
+ "then": {
2207
+ "properties": {
2208
+ "composition": {
2209
+ "properties": { "profile": { "const": "developer" } },
2210
+ "required": ["profile"]
2211
+ }
2212
+ }
2213
+ }
2214
+ }
2215
+ ]
2216
+ },
2217
+ "else": { "not": { "required": ["composition"] } }
2218
+ },
2219
+ {
2220
+ "if": {
2221
+ "properties": { "themeId": { "const": "editorial" } },
2222
+ "required": ["themeId"]
2223
+ },
2224
+ "then": { "properties": { "contractVersion": { "const": "4.0.0" } } }
1944
2225
  }
1945
2226
  ],
1946
2227
  "$comment": "The semantic validator enforces package/theme identity, slot/fixture catalogs, non-color palette equality, CSS/package admission, evidence, budgets, and every self-excluding digest."