@rathnasgala2/schemas 3.19.1 → 3.21.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 (25) hide show
  1. package/THIRD_PARTY_LICENSES.json +1 -1
  2. package/diagnostics/diagnostic-map.json +30 -0
  3. package/docs/catalogs/schema-inventory.json +4 -4
  4. package/examples/valid/build-input/rules.json +41 -0
  5. package/examples/valid/content-frontmatter/rules.json +41 -0
  6. package/fixtures/boundary/build-input/rules.json +41 -0
  7. package/fixtures/boundary/content-frontmatter/rules.json +41 -0
  8. package/fixtures/invalid/build-input/SCHEMA_CONSTANT_INVALID/cases.json +11 -0
  9. package/fixtures/invalid/build-input/SCHEMA_NEGATED_RULE_MATCHED/cases.json +11 -0
  10. package/fixtures/invalid/build-input/SCHEMA_REQUIRED_FIELD_MISSING/cases.json +33 -0
  11. package/fixtures/invalid/content-frontmatter/SCHEMA_CONSTANT_INVALID/cases.json +11 -0
  12. package/fixtures/invalid/content-frontmatter/SCHEMA_NEGATED_RULE_MATCHED/cases.json +9 -0
  13. package/fixtures/invalid/content-frontmatter/SCHEMA_REQUIRED_FIELD_MISSING/cases.json +31 -0
  14. package/fixtures/manifest.json +234 -4
  15. package/fixtures/unknown-field/build-input/rules.json +5 -0
  16. package/fixtures/unknown-field/content-frontmatter/rules.json +5 -0
  17. package/generated/browser/validator-core.mjs +3 -3
  18. package/generated/typescript/contracts/build-input.d.ts +1 -0
  19. package/generated/typescript/contracts/content-frontmatter.d.ts +1 -0
  20. package/openapi/http-catalog.json +2 -2
  21. package/openapi/openapi.yaml +26 -4
  22. package/package.json +1 -1
  23. package/sbom.cdx.json +23 -23
  24. package/schemas/build-input.schema.json +13 -1
  25. package/schemas/content-frontmatter.schema.json +12 -0
@@ -166,6 +166,7 @@ export type BuildInputContentFrontmatterNormalized = Readonly<{
166
166
  readonly status: 'published' | 'unlisted';
167
167
  readonly tags: ReadonlyArray<BuildInputPlainLabel>;
168
168
  readonly title: BuildInputPlainText;
169
+ readonly translationOf?: BuildInputSlug;
169
170
  readonly updatedAt?: BuildInputRfc3339;
170
171
  }> &
171
172
  unknown;
@@ -96,6 +96,7 @@ export type ContentFrontmatterDocument = Readonly<{
96
96
  readonly status: 'draft' | 'published' | 'unlisted' | 'archived';
97
97
  readonly tags: ReadonlyArray<ContentFrontmatterPlainLabel>;
98
98
  readonly title: ContentFrontmatterPlainText;
99
+ readonly translationOf?: ContentFrontmatterSlug;
99
100
  readonly updatedAt?: ContentFrontmatterRfc3339;
100
101
  }> &
101
102
  unknown;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": "2.0.0",
3
3
  "sourceDesignRevision": "a53052955ceb6c1aa10c886289dc832eedfe6de0a00004df07d353ac19c4403a",
4
- "openApiDigest": "sha256:ad69bd463734d47aa91cb5544634209587658435564fbb9e96ceb3d302c15226",
4
+ "openApiDigest": "sha256:f015c933c536a3a0030eeb06986d014debd8c929b968c82df9817976492fd6d3",
5
5
  "operations": [
6
6
  {
7
7
  "operationId": "getInternalHealth",
@@ -2699,5 +2699,5 @@
2699
2699
  "sourceFragment": "workloads"
2700
2700
  }
2701
2701
  ],
2702
- "digest": "sha256:df68ea5a261750bcbd7c6449ab1fb9b5d0329859cc6d73c7a3e17142430d3918"
2702
+ "digest": "sha256:02efa2a51a27ec6907da974e1d7b4b6baaf18efe8783dcdf8f432c8e91f2efea"
2703
2703
  }
@@ -1210,7 +1210,7 @@ components:
1210
1210
  path:
1211
1211
  maxLength: 512
1212
1212
  minLength: 1
1213
- pattern: ^(?!/)(?!.*(?:^|/)\.)(?!gala(?:/|$))(?!gala\.lock\.json$)[^\x00-\x1f\x7f\\]+$
1213
+ pattern: ^(?!/)(?!.*(?:^|/)\.)(?!gala\.lock\.json$)(?:gala/theme-pages/[^\x00-\x1f\x7f\\/]+|(?!gala(?:/|$))[^\x00-\x1f\x7f\\]+)$
1214
1214
  type: string
1215
1215
  text:
1216
1216
  maxLength: 1048576
@@ -1287,7 +1287,7 @@ components:
1287
1287
  path:
1288
1288
  maxLength: 512
1289
1289
  minLength: 1
1290
- pattern: ^(?!/)(?!.*(?:^|/)\.)(?!gala(?:/|$))(?!gala\.lock\.json$)[^\x00-\x1f\x7f\\]+$
1290
+ pattern: ^(?!/)(?!.*(?:^|/)\.)(?!gala\.lock\.json$)(?:gala/theme-pages/[^\x00-\x1f\x7f\\/]+|(?!gala(?:/|$))[^\x00-\x1f\x7f\\]+)$
1291
1291
  type: string
1292
1292
  size:
1293
1293
  format: int64
@@ -1334,6 +1334,11 @@ components:
1334
1334
  x-gala-graphemeLength:
1335
1335
  maximum: 200
1336
1336
  minimum: 1
1337
+ translationOf:
1338
+ description: "SCHEMA-3.21.0: the slug of the primary article this document translates; null on a primary."
1339
+ oneOf:
1340
+ - $ref: "#/components/schemas/PortableContentFrontmatterSlug"
1341
+ - type: "null"
1337
1342
  updatedAt:
1338
1343
  $ref: "#/components/schemas/PortableContentFrontmatterRfc3339"
1339
1344
  required:
@@ -2890,7 +2895,7 @@ components:
2890
2895
  path:
2891
2896
  maxLength: 512
2892
2897
  minLength: 1
2893
- pattern: ^(?!/)(?!.*(?:^|/)\.)(?!gala(?:/|$))(?!gala\.lock\.json$)[^\x00-\x1f\x7f\\]+$
2898
+ pattern: ^(?!/)(?!.*(?:^|/)\.)(?!gala\.lock\.json$)(?:gala/theme-pages/[^\x00-\x1f\x7f\\/]+|(?!gala(?:/|$))[^\x00-\x1f\x7f\\]+)$
2894
2899
  type: string
2895
2900
  revision:
2896
2901
  pattern: ^(?:sha1:[0-9a-f]{40}|sha256:[0-9a-f]{64})$
@@ -8166,6 +8171,20 @@ components:
8166
8171
  then:
8167
8172
  required:
8168
8173
  - edition
8174
+ - if:
8175
+ required:
8176
+ - translationOf
8177
+ then:
8178
+ not:
8179
+ required:
8180
+ - edition
8181
+ properties:
8182
+ kind:
8183
+ pattern: ^article$
8184
+ type: string
8185
+ x-gala-const: article
8186
+ required:
8187
+ - kind
8169
8188
  dependentRequired:
8170
8189
  seriesOrder:
8171
8190
  - series
@@ -8253,6 +8272,9 @@ components:
8253
8272
  x-gala-graphemeLength:
8254
8273
  maximum: 200
8255
8274
  minimum: 1
8275
+ translationOf:
8276
+ $ref: "#/components/schemas/PortableContentFrontmatterSlug"
8277
+ description: "SCHEMA-3.21.0: the slug of the article this document translates. The group is that article (the primary, in the publication's default language) plus every document naming it. The target must exist in the same content root, be `kind: article`, carry a different `language`, and must not itself carry `translationOf`; at most one document per language per group. A translation's default route is `/<language lowercased>/<primary slug>/` unless `route` is set. The API enforces the cross-document rules; the schema only fixes the shape: `translationOf` is allowed only when `kind` is `article` and never together with `edition`."
8256
8278
  updatedAt:
8257
8279
  $ref: "#/components/schemas/PortableContentFrontmatterRfc3339"
8258
8280
  required:
@@ -35165,7 +35187,7 @@ paths:
35165
35187
  schema:
35166
35188
  maxLength: 512
35167
35189
  minLength: 1
35168
- pattern: ^(?!/)(?!.*(?:^|/)\.)(?!gala(?:/|$))(?!gala\.lock\.json$)[^\x00-\x1f\x7f\\]+$
35190
+ pattern: ^(?!/)(?!.*(?:^|/)\.)(?!gala\.lock\.json$)(?:gala/theme-pages/[^\x00-\x1f\x7f\\/]+|(?!gala(?:/|$))[^\x00-\x1f\x7f\\]+)$
35169
35191
  type: string
35170
35192
  - example: sha1:0000000000000000000000000000000000000000
35171
35193
  in: query
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rathnasgala2/schemas",
3
- "version": "3.19.1",
3
+ "version": "3.21.0",
4
4
  "description": "Executable JSON Schema and OpenAPI contracts for Galascribe",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
package/sbom.cdx.json CHANGED
@@ -97,8 +97,8 @@
97
97
  "type": "library",
98
98
  "name": "schemas",
99
99
  "group": "@rathnasgala2",
100
- "version": "3.19.1",
101
- "bom-ref": "@rathnasgala2/schemas@3.19.1",
100
+ "version": "3.21.0",
101
+ "bom-ref": "@rathnasgala2/schemas@3.21.0",
102
102
  "description": "Executable JSON Schema and OpenAPI contracts for Galascribe",
103
103
  "licenses": [
104
104
  {
@@ -108,7 +108,7 @@
108
108
  }
109
109
  }
110
110
  ],
111
- "purl": "pkg:npm/%40rathnasgala2/schemas@3.19.1?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2Frathnasgala2%2Fschema.git",
111
+ "purl": "pkg:npm/%40rathnasgala2/schemas@3.21.0?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2Frathnasgala2%2Fschema.git",
112
112
  "externalReferences": [
113
113
  {
114
114
  "url": "https://github.com/rathnasgala2/schema/issues",
@@ -153,7 +153,7 @@
153
153
  "type": "library",
154
154
  "name": "ajv-formats",
155
155
  "version": "3.0.1",
156
- "bom-ref": "@rathnasgala2/schemas@3.19.1|ajv-formats@3.0.1",
156
+ "bom-ref": "@rathnasgala2/schemas@3.21.0|ajv-formats@3.0.1",
157
157
  "licenses": [
158
158
  {
159
159
  "license": {
@@ -187,7 +187,7 @@
187
187
  "type": "library",
188
188
  "name": "ajv",
189
189
  "version": "8.20.0",
190
- "bom-ref": "@rathnasgala2/schemas@3.19.1|ajv@8.20.0",
190
+ "bom-ref": "@rathnasgala2/schemas@3.21.0|ajv@8.20.0",
191
191
  "licenses": [
192
192
  {
193
193
  "license": {
@@ -221,7 +221,7 @@
221
221
  "type": "library",
222
222
  "name": "fast-deep-equal",
223
223
  "version": "3.1.3",
224
- "bom-ref": "@rathnasgala2/schemas@3.19.1|fast-deep-equal@3.1.3",
224
+ "bom-ref": "@rathnasgala2/schemas@3.21.0|fast-deep-equal@3.1.3",
225
225
  "licenses": [
226
226
  {
227
227
  "license": {
@@ -255,7 +255,7 @@
255
255
  "type": "library",
256
256
  "name": "fast-uri",
257
257
  "version": "3.1.8",
258
- "bom-ref": "@rathnasgala2/schemas@3.19.1|fast-uri@3.1.8",
258
+ "bom-ref": "@rathnasgala2/schemas@3.21.0|fast-uri@3.1.8",
259
259
  "licenses": [
260
260
  {
261
261
  "license": {
@@ -289,7 +289,7 @@
289
289
  "type": "library",
290
290
  "name": "json-schema-traverse",
291
291
  "version": "1.0.0",
292
- "bom-ref": "@rathnasgala2/schemas@3.19.1|json-schema-traverse@1.0.0",
292
+ "bom-ref": "@rathnasgala2/schemas@3.21.0|json-schema-traverse@1.0.0",
293
293
  "licenses": [
294
294
  {
295
295
  "license": {
@@ -323,7 +323,7 @@
323
323
  "type": "library",
324
324
  "name": "require-from-string",
325
325
  "version": "2.0.2",
326
- "bom-ref": "@rathnasgala2/schemas@3.19.1|require-from-string@2.0.2",
326
+ "bom-ref": "@rathnasgala2/schemas@3.21.0|require-from-string@2.0.2",
327
327
  "licenses": [
328
328
  {
329
329
  "license": {
@@ -1064,10 +1064,10 @@
1064
1064
  ],
1065
1065
  "dependencies": [
1066
1066
  {
1067
- "ref": "@rathnasgala2/schemas@3.19.1",
1067
+ "ref": "@rathnasgala2/schemas@3.21.0",
1068
1068
  "dependsOn": [
1069
- "@rathnasgala2/schemas@3.19.1|ajv-formats@3.0.1",
1070
- "@rathnasgala2/schemas@3.19.1|ajv@8.20.0",
1069
+ "@rathnasgala2/schemas@3.21.0|ajv-formats@3.0.1",
1070
+ "@rathnasgala2/schemas@3.21.0|ajv@8.20.0",
1071
1071
  "pkg:npm/semver@7.8.5",
1072
1072
  "urn:gala:source-data:iana-ipv4-special-registry",
1073
1073
  "urn:gala:source-data:iana-ipv6-special-registry",
@@ -1089,31 +1089,31 @@
1089
1089
  ]
1090
1090
  },
1091
1091
  {
1092
- "ref": "@rathnasgala2/schemas@3.19.1|ajv-formats@3.0.1",
1092
+ "ref": "@rathnasgala2/schemas@3.21.0|ajv-formats@3.0.1",
1093
1093
  "dependsOn": [
1094
- "@rathnasgala2/schemas@3.19.1|ajv@8.20.0"
1094
+ "@rathnasgala2/schemas@3.21.0|ajv@8.20.0"
1095
1095
  ]
1096
1096
  },
1097
1097
  {
1098
- "ref": "@rathnasgala2/schemas@3.19.1|ajv@8.20.0",
1098
+ "ref": "@rathnasgala2/schemas@3.21.0|ajv@8.20.0",
1099
1099
  "dependsOn": [
1100
- "@rathnasgala2/schemas@3.19.1|fast-deep-equal@3.1.3",
1101
- "@rathnasgala2/schemas@3.19.1|fast-uri@3.1.8",
1102
- "@rathnasgala2/schemas@3.19.1|json-schema-traverse@1.0.0",
1103
- "@rathnasgala2/schemas@3.19.1|require-from-string@2.0.2"
1100
+ "@rathnasgala2/schemas@3.21.0|fast-deep-equal@3.1.3",
1101
+ "@rathnasgala2/schemas@3.21.0|fast-uri@3.1.8",
1102
+ "@rathnasgala2/schemas@3.21.0|json-schema-traverse@1.0.0",
1103
+ "@rathnasgala2/schemas@3.21.0|require-from-string@2.0.2"
1104
1104
  ]
1105
1105
  },
1106
1106
  {
1107
- "ref": "@rathnasgala2/schemas@3.19.1|fast-deep-equal@3.1.3"
1107
+ "ref": "@rathnasgala2/schemas@3.21.0|fast-deep-equal@3.1.3"
1108
1108
  },
1109
1109
  {
1110
- "ref": "@rathnasgala2/schemas@3.19.1|fast-uri@3.1.8"
1110
+ "ref": "@rathnasgala2/schemas@3.21.0|fast-uri@3.1.8"
1111
1111
  },
1112
1112
  {
1113
- "ref": "@rathnasgala2/schemas@3.19.1|json-schema-traverse@1.0.0"
1113
+ "ref": "@rathnasgala2/schemas@3.21.0|json-schema-traverse@1.0.0"
1114
1114
  },
1115
1115
  {
1116
- "ref": "@rathnasgala2/schemas@3.19.1|require-from-string@2.0.2"
1116
+ "ref": "@rathnasgala2/schemas@3.21.0|require-from-string@2.0.2"
1117
1117
  },
1118
1118
  {
1119
1119
  "ref": "pkg:npm/semver@7.8.5"
@@ -890,7 +890,11 @@
890
890
  "uniqueItems": true
891
891
  },
892
892
  "edition": { "$ref": "#/$defs/contentEdition" },
893
- "seo": { "$ref": "#/$defs/contentSeo" }
893
+ "seo": { "$ref": "#/$defs/contentSeo" },
894
+ "translationOf": {
895
+ "$ref": "#/$defs/slug",
896
+ "description": "SCHEMA-3.21.0: the slug of the article this document translates. The group is that article (the primary, in the publication's default language) plus every document naming it. The target must exist in the same content root, be `kind: article`, carry a different `language`, and must not itself carry `translationOf`; at most one document per language per group. A translation's default route is `/<language lowercased>/<primary slug>/` unless `route` is set. The API enforces the cross-document rules; the schema only fixes the shape: `translationOf` is allowed only when `kind` is `article` and never together with `edition`."
897
+ }
894
898
  },
895
899
  "additionalProperties": false,
896
900
  "dependentRequired": { "seriesOrder": ["series"] },
@@ -902,6 +906,14 @@
902
906
  },
903
907
  "then": { "required": ["edition"] },
904
908
  "else": { "not": { "required": ["edition"] } }
909
+ },
910
+ {
911
+ "if": { "required": ["translationOf"] },
912
+ "then": {
913
+ "properties": { "kind": { "const": "article" } },
914
+ "required": ["kind"],
915
+ "not": { "required": ["edition"] }
916
+ }
905
917
  }
906
918
  ],
907
919
  "$comment": "Timestamp ordering, canonical set ordering, route derivation, and route/redirect collision rules are enforced semantically."
@@ -66,6 +66,10 @@
66
66
  "edition": { "$ref": "#/$defs/contentEdition" },
67
67
  "seo": { "$ref": "#/$defs/contentSeo" },
68
68
  "publishAfter": { "$ref": "#/$defs/publishAfterDate" },
69
+ "translationOf": {
70
+ "$ref": "#/$defs/slug",
71
+ "description": "SCHEMA-3.21.0: the slug of the article this document translates. The group is that article (the primary, in the publication's default language) plus every document naming it. The target must exist in the same content root, be `kind: article`, carry a different `language`, and must not itself carry `translationOf`; at most one document per language per group. A translation's default route is `/<language lowercased>/<primary slug>/` unless `route` is set. The API enforces the cross-document rules; the schema only fixes the shape: `translationOf` is allowed only when `kind` is `article` and never together with `edition`."
72
+ },
69
73
  "extensions": { "$ref": "#/$defs/extensionMap" }
70
74
  },
71
75
  "additionalProperties": false,
@@ -291,6 +295,14 @@
291
295
  },
292
296
  "then": { "required": ["edition"] },
293
297
  "else": { "not": { "required": ["edition"] } }
298
+ },
299
+ {
300
+ "if": { "required": ["translationOf"] },
301
+ "then": {
302
+ "properties": { "kind": { "const": "article" } },
303
+ "required": ["kind"],
304
+ "not": { "required": ["edition"] }
305
+ }
294
306
  }
295
307
  ],
296
308
  "$comment": "The content validator enforces canonical set ordering, timestamp ordering, root-kind agreement, and route/redirect collision checks."