@rathnasgala2/schemas 3.8.0 → 3.10.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 (55) hide show
  1. package/THIRD_PARTY_LICENSES.json +1 -1
  2. package/diagnostics/diagnostic-map.json +277 -9
  3. package/docs/catalogs/schema-inventory.json +6 -6
  4. package/examples/valid/appearance/rules.json +105 -1
  5. package/examples/valid/build-input/rules.json +105 -1
  6. package/examples/valid/problem/rules.json +35 -0
  7. package/examples/valid/theme-contract/rules.json +276 -2
  8. package/fixtures/boundary/appearance/rules.json +105 -12
  9. package/fixtures/boundary/build-input/rules.json +105 -12
  10. package/fixtures/boundary/problem/rules.json +83 -0
  11. package/fixtures/boundary/theme-contract/rules.json +386 -2
  12. package/fixtures/invalid/appearance/REQUEST_FIELD_UNKNOWN/cases.json +33 -0
  13. package/fixtures/invalid/appearance/SCHEMA_OBJECT_TOO_LARGE/cases.json +0 -13
  14. package/fixtures/invalid/appearance/SCHEMA_PATTERN_INVALID/cases.json +68 -0
  15. package/fixtures/invalid/appearance/SCHEMA_REQUIRED_FIELD_MISSING/cases.json +66 -0
  16. package/fixtures/invalid/appearance/SCHEMA_TYPE_INVALID/cases.json +99 -0
  17. package/fixtures/invalid/build-input/REQUEST_FIELD_UNKNOWN/cases.json +33 -0
  18. package/fixtures/invalid/build-input/SCHEMA_PATTERN_INVALID/cases.json +66 -0
  19. package/fixtures/invalid/build-input/SCHEMA_REQUIRED_FIELD_MISSING/cases.json +66 -0
  20. package/fixtures/invalid/build-input/SCHEMA_TYPE_INVALID/cases.json +99 -0
  21. package/fixtures/invalid/problem/SCHEMA_ARRAY_TOO_LONG/cases.json +13 -0
  22. package/fixtures/invalid/problem/SCHEMA_ENUM_INVALID/cases.json +11 -0
  23. package/fixtures/invalid/problem/SCHEMA_STRING_TOO_LONG/cases.json +11 -0
  24. package/fixtures/invalid/problem/SCHEMA_STRING_TOO_SHORT/cases.json +11 -0
  25. package/fixtures/invalid/problem/SCHEMA_TYPE_INVALID/cases.json +29 -0
  26. package/fixtures/invalid/theme-contract/REQUEST_FIELD_UNKNOWN/cases.json +33 -0
  27. package/fixtures/invalid/theme-contract/SCHEMA_ARRAY_TOO_LONG/cases.json +165 -0
  28. package/fixtures/invalid/theme-contract/SCHEMA_CONSTANT_INVALID/cases.json +11 -11
  29. package/fixtures/invalid/theme-contract/SCHEMA_ENUM_INVALID/cases.json +88 -0
  30. package/fixtures/invalid/theme-contract/SCHEMA_REQUIRED_FIELD_MISSING/cases.json +93 -0
  31. package/fixtures/invalid/theme-contract/SCHEMA_TYPE_INVALID/cases.json +51 -0
  32. package/fixtures/manifest.json +2137 -37
  33. package/fixtures/unknown-field/appearance/rules.json +54 -1
  34. package/fixtures/unknown-field/build-input/rules.json +54 -1
  35. package/fixtures/unknown-field/problem/rules.json +8 -0
  36. package/fixtures/unknown-field/theme-contract/rules.json +70 -1
  37. package/generated/browser/validator-core.mjs +3 -3
  38. package/generated/typescript/contracts/appearance.d.ts +14 -1
  39. package/generated/typescript/contracts/build-input.d.ts +14 -1
  40. package/generated/typescript/contracts/problem.d.ts +9 -0
  41. package/generated/typescript/contracts/theme-contract.d.ts +51 -0
  42. package/openapi/http-catalog.json +2 -2
  43. package/openapi/openapi.yaml +97 -3
  44. package/package.json +10 -1
  45. package/parity/palette/golden-vectors.json +883 -0
  46. package/parity/palette/stress-corpus.json +521 -0
  47. package/parity/palette/theme-default.fixture.json +698 -0
  48. package/sbom.cdx.json +23 -23
  49. package/schemas/appearance.schema.json +30 -3
  50. package/schemas/build-input.schema.json +30 -3
  51. package/schemas/problem.schema.json +21 -1
  52. package/schemas/theme-contract.schema.json +185 -1
  53. package/src/palette.js +919 -0
  54. package/types/palette.d.ts +305 -0
  55. package/fixtures/invalid/build-input/SCHEMA_OBJECT_TOO_LARGE/cases.json +0 -15
@@ -41,7 +41,20 @@ export type AppearanceRepoRelativePath = string;
41
41
 
42
42
  export type AppearanceRfc3339 = string;
43
43
 
44
- export type AppearanceSemanticTokens = Readonly<Record<string, never>>;
44
+ export type AppearanceSemanticTokens = Readonly<{
45
+ readonly accent?: Readonly<{
46
+ readonly dark: string;
47
+ readonly light: string;
48
+ }>;
49
+ readonly canvas?: Readonly<{
50
+ readonly dark: string;
51
+ readonly light: string;
52
+ }>;
53
+ readonly text?: Readonly<{
54
+ readonly dark: string;
55
+ readonly light: string;
56
+ }>;
57
+ }>;
45
58
 
46
59
  export type AppearanceSemver = string;
47
60
 
@@ -366,7 +366,20 @@ export type BuildInputResolvedMedia = Readonly<{
366
366
 
367
367
  export type BuildInputRfc3339 = string;
368
368
 
369
- export type BuildInputSemanticTokens = Readonly<Record<string, never>>;
369
+ export type BuildInputSemanticTokens = Readonly<{
370
+ readonly accent?: Readonly<{
371
+ readonly dark: string;
372
+ readonly light: string;
373
+ }>;
374
+ readonly canvas?: Readonly<{
375
+ readonly dark: string;
376
+ readonly light: string;
377
+ }>;
378
+ readonly text?: Readonly<{
379
+ readonly dark: string;
380
+ readonly light: string;
381
+ }>;
382
+ }>;
370
383
 
371
384
  export type BuildInputSemver = string;
372
385
 
@@ -11,7 +11,16 @@ export type ProblemExtensionKey = string;
11
11
 
12
12
  export type ProblemFieldError = Readonly<{
13
13
  readonly code: ProblemProblemCode;
14
+ readonly paths?: ReadonlyArray<string>;
14
15
  readonly pointer: string;
16
+ readonly reason?:
17
+ | 'AUTHOR_EDITED'
18
+ | 'BRANCH_PROTECTION'
19
+ | 'REPOSITORY_ARCHIVED'
20
+ | 'INSTALLATION_SUSPENDED'
21
+ | 'WORKFLOWS_PERMISSION_MISSING'
22
+ | 'AUTHORIZATION_LOST'
23
+ | 'FORBIDDEN';
15
24
  }>;
16
25
 
17
26
  export type ProblemGitObjectId = string;
@@ -21,6 +21,53 @@ export type ThemeContractPackageExact = string;
21
21
 
22
22
  export type ThemeContractPackageRange = string;
23
23
 
24
+ export type ThemeContractPaletteFollow = Readonly<{
25
+ readonly dark: ReadonlyArray<'accent' | 'canvas' | 'text' | null>;
26
+ readonly key:
27
+ | 'border-button'
28
+ | 'border-card'
29
+ | 'border-chip'
30
+ | 'border-media-divider'
31
+ | 'border-quote'
32
+ | 'border-row-divider'
33
+ | 'border-section-rule'
34
+ | 'color-accent'
35
+ | 'color-accent-2'
36
+ | 'color-border'
37
+ | 'color-btn-panel'
38
+ | 'color-btn-panel-text'
39
+ | 'color-btn-text'
40
+ | 'color-canvas'
41
+ | 'color-chip-text'
42
+ | 'color-focus'
43
+ | 'color-footer'
44
+ | 'color-header'
45
+ | 'color-icon-accent'
46
+ | 'color-link'
47
+ | 'color-link-underline'
48
+ | 'color-link-underline-hover'
49
+ | 'color-link-visited'
50
+ | 'color-on-accent'
51
+ | 'color-panel-muted'
52
+ | 'color-panel-text'
53
+ | 'color-selection'
54
+ | 'color-surface'
55
+ | 'color-surface-raised'
56
+ | 'color-text'
57
+ | 'color-text-faint'
58
+ | 'color-text-muted'
59
+ | 'color-toc-active'
60
+ | 'color-toc-active-text'
61
+ | 'paint-button'
62
+ | 'paint-chip'
63
+ | 'paint-page-decor'
64
+ | 'paint-panel'
65
+ | 'shadow-avatar-ring'
66
+ | 'shadow-button';
67
+ readonly light: ReadonlyArray<'accent' | 'canvas' | 'text' | null>;
68
+ }> &
69
+ unknown;
70
+
24
71
  export type ThemeContractPassiveAsset = Readonly<{
25
72
  readonly byteLength: ThemeContractNonNegativeInt64;
26
73
  readonly license: ThemeContractSpdxExpression;
@@ -330,6 +377,10 @@ export type ThemeContractDocument = (
330
377
  readonly integrity: ThemeContractDigest;
331
378
  readonly modes: ['dark', 'light', 'system'];
332
379
  readonly package: string & ThemeContractPackageExact;
380
+ readonly palette?: Readonly<{
381
+ readonly follow: ReadonlyArray<ThemeContractPaletteFollow>;
382
+ readonly profile: 'gala-palette-follow-v1';
383
+ }>;
333
384
  readonly schemaId: 'urn:gala:schema:theme-contract:2.0.0';
334
385
  readonly schemaVersion: '2.0.0';
335
386
  readonly slotHooks: ReadonlyArray<ThemeContractPlainLabel>;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": "2.0.0",
3
3
  "sourceDesignRevision": "a53052955ceb6c1aa10c886289dc832eedfe6de0a00004df07d353ac19c4403a",
4
- "openApiDigest": "sha256:e6fd6235d1b1a32d1f17ff8f6badc5db21f91e4b1aa3622b5fd8376faace3654",
4
+ "openApiDigest": "sha256:6cb44277f117370a70e3828a1a5fdadbfbd1ddb5df3e84b317acf205d5913aeb",
5
5
  "operations": [
6
6
  {
7
7
  "operationId": "getInternalHealth",
@@ -2121,5 +2121,5 @@
2121
2121
  "sourceFragment": "workloads"
2122
2122
  }
2123
2123
  ],
2124
- "digest": "sha256:d1e44a2e15a91541e28f86087dbe9a2369669cac422c4ce7570dd0b2e60c0c67"
2124
+ "digest": "sha256:161281d4484ec95bf4980bbd15129efca7630a14a23ba66d30b3820294df714b"
2125
2125
  }
@@ -1056,7 +1056,10 @@ components:
1056
1056
  values to change only `attribution`. `attribution` (SCHEMA-3.3.0) is
1057
1057
  optional: when present the server writes it as
1058
1058
  `gala/appearance.json`'s `attribution`; when absent the file's
1059
- `attribution` is preserved unchanged.
1059
+ `attribution` is preserved unchanged. `tokens` (SCHEMA-3.10.0) is
1060
+ optional: the author's publication palette, written as
1061
+ `gala/appearance.json`'s `tokens`; when absent the file's `tokens`
1062
+ are preserved unchanged, and `{}` resets to the theme's own colours.
1060
1063
  properties:
1061
1064
  attribution:
1062
1065
  $ref: "#/components/schemas/PortableAppearanceAttribution"
@@ -1064,6 +1067,8 @@ components:
1064
1067
  $ref: "#/components/schemas/AppearanceColorMode"
1065
1068
  themeId:
1066
1069
  $ref: "#/components/schemas/AppearanceThemeId"
1070
+ tokens:
1071
+ $ref: "#/components/schemas/PortableAppearanceSemanticTokens"
1067
1072
  required:
1068
1073
  - themeId
1069
1074
  - colorModeDefault
@@ -7038,6 +7043,51 @@ components:
7038
7043
  minLength: 3
7039
7044
  pattern: ^(?:@[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?/[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?|[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?)@(?:\S+|\S+ \S+)$
7040
7045
  type: string
7046
+ PortableAppearanceSemanticTokens:
7047
+ additionalProperties: false
7048
+ description: "SCHEMA-3.10.0: the author's publication palette. Each role (accent, canvas, text) is optional; when present it carries both light and dark as opaque lowercase #rrggbb. An absent role uses the theme's default; `{}` selects the theme's default palette entirely."
7049
+ properties:
7050
+ accent:
7051
+ additionalProperties: false
7052
+ properties:
7053
+ dark:
7054
+ pattern: ^#[0-9a-f]{6}$
7055
+ type: string
7056
+ light:
7057
+ pattern: ^#[0-9a-f]{6}$
7058
+ type: string
7059
+ required:
7060
+ - light
7061
+ - dark
7062
+ type: object
7063
+ canvas:
7064
+ additionalProperties: false
7065
+ properties:
7066
+ dark:
7067
+ pattern: ^#[0-9a-f]{6}$
7068
+ type: string
7069
+ light:
7070
+ pattern: ^#[0-9a-f]{6}$
7071
+ type: string
7072
+ required:
7073
+ - light
7074
+ - dark
7075
+ type: object
7076
+ text:
7077
+ additionalProperties: false
7078
+ properties:
7079
+ dark:
7080
+ pattern: ^#[0-9a-f]{6}$
7081
+ type: string
7082
+ light:
7083
+ pattern: ^#[0-9a-f]{6}$
7084
+ type: string
7085
+ required:
7086
+ - light
7087
+ - dark
7088
+ type: object
7089
+ required: []
7090
+ type: object
7041
7091
  PortableAuthorPlainText:
7042
7092
  description: NFC Unicode text without disallowed C0/C1 controls or bidi override/isolate controls.
7043
7093
  format: gala-plain-text
@@ -12796,10 +12846,30 @@ components:
12796
12846
  properties:
12797
12847
  code:
12798
12848
  $ref: "#/components/schemas/PortableProblemProblemCode"
12849
+ paths:
12850
+ description: "SCHEMA-3.9.0, optional: the managed repository file paths the error is about, as the App lists them. Absent from older servers."
12851
+ items:
12852
+ maxLength: 512
12853
+ minLength: 1
12854
+ type: string
12855
+ maxItems: 50
12856
+ minItems: 0
12857
+ type: array
12799
12858
  pointer:
12800
12859
  maxLength: 1024
12801
12860
  minLength: 1
12802
12861
  type: string
12862
+ reason:
12863
+ description: "SCHEMA-3.9.0, optional: why a REPOSITORY_NEEDS_UPDATE error needs the author. AUTHOR_EDITED: a managed file was changed in a way only the author may resolve. BRANCH_PROTECTION: GitHub refused Galascribe's own commit. REPOSITORY_ARCHIVED: the repository is archived. INSTALLATION_SUSPENDED: the GitHub App installation is suspended. WORKFLOWS_PERMISSION_MISSING: the installation has not accepted the workflows permission. AUTHORIZATION_LOST: Galascribe lost its GitHub authorization. FORBIDDEN: GitHub refused for another permission reason. Absent from older servers and for other codes; a client shows a generic sentence for a value it does not know."
12864
+ enum:
12865
+ - AUTHOR_EDITED
12866
+ - BRANCH_PROTECTION
12867
+ - REPOSITORY_ARCHIVED
12868
+ - INSTALLATION_SUSPENDED
12869
+ - WORKFLOWS_PERMISSION_MISSING
12870
+ - AUTHORIZATION_LOST
12871
+ - FORBIDDEN
12872
+ type: string
12803
12873
  required:
12804
12874
  - pointer
12805
12875
  - code
@@ -15657,7 +15727,9 @@ components:
15657
15727
  `themePackage` is not in the catalog. `themePackage` is the file's
15658
15728
  `theme` value, a package with its version range. `attribution`
15659
15729
  (SCHEMA-3.3.0, optional) is the file's footer attribution switch;
15660
- absent means the file has none, which renders as shown.
15730
+ absent means the file has none, which renders as shown. `tokens`
15731
+ (SCHEMA-3.10.0, optional) is the file's publication palette as read;
15732
+ absent or `{}` means the theme's own colours.
15661
15733
  properties:
15662
15734
  attribution:
15663
15735
  $ref: "#/components/schemas/PortableAppearanceAttribution"
@@ -15669,6 +15741,8 @@ components:
15669
15741
  - type: "null"
15670
15742
  themePackage:
15671
15743
  $ref: "#/components/schemas/PortableAppearancePackageRange"
15744
+ tokens:
15745
+ $ref: "#/components/schemas/PortableAppearanceSemanticTokens"
15672
15746
  required:
15673
15747
  - themeId
15674
15748
  - themePackage
@@ -17403,7 +17477,7 @@ components:
17403
17477
  type: object
17404
17478
  SiteAttentionItem:
17405
17479
  additionalProperties: false
17406
- description: "Something that needs a person to act. The list is empty when nothing does. SCHEMA-3.3.0: `SCHEDULED_PUBLISH_FAILED` means a scheduled publish could not start at its time; `relatedPublishId` names the schedule and `reasonCode` the first precondition that failed (a client maps the values it knows to a sentence and shows a generic one otherwise); nothing was merged. `DOMAIN_PUBLISH_REQUIRED` means a custom domain is live and the next publish moves the site's address to it. `DOMAIN_DEGRADED` means a live custom domain stopped working; `reasonCode` names why and the domain read carries the next step."
17480
+ description: "Something that needs a person to act. The list is empty when nothing does. SCHEMA-3.3.0: `SCHEDULED_PUBLISH_FAILED` means a scheduled publish could not start at its time; `relatedPublishId` names the schedule and `reasonCode` the first precondition that failed (a client maps the values it knows to a sentence and shows a generic one otherwise); nothing was merged. `DOMAIN_PUBLISH_REQUIRED` means a custom domain is live and the next publish moves the site's address to it. `DOMAIN_DEGRADED` means a live custom domain stopped working; `reasonCode` names why and the domain read carries the next step. SCHEMA-3.9.0: on `REPOSITORY_NEEDS_UPDATE`, `reason` names the cause and `paths` the managed repository files involved, so a client can say what to do and list the files (both are absent from older servers and for other codes; show a generic sentence for a `reason` you do not know). `AUTHOR_EDITED`: a managed file differs from the version Galascribe manages and only the author may resolve it. `BRANCH_PROTECTION`: GitHub refused Galascribe's own repair commit. `REPOSITORY_ARCHIVED`: the repository is archived. `INSTALLATION_SUSPENDED`: the GitHub App installation is suspended. `WORKFLOWS_PERMISSION_MISSING`: the installation has not accepted the workflows permission. `AUTHORIZATION_LOST`: Galascribe lost its GitHub authorization. `FORBIDDEN`: GitHub refused for another permission reason. The same `reason` and `paths` ride on the `REPOSITORY_NEEDS_UPDATE` entry of a publish refusal's `errors`."
17407
17481
  properties:
17408
17482
  code:
17409
17483
  enum:
@@ -17422,6 +17496,26 @@ components:
17422
17496
  - DOMAIN_PUBLISH_REQUIRED
17423
17497
  - DOMAIN_DEGRADED
17424
17498
  type: string
17499
+ paths:
17500
+ description: SCHEMA-3.9.0. The managed repository files a `REPOSITORY_NEEDS_UPDATE` is about; may be empty when the cause is not about a file.
17501
+ items:
17502
+ maxLength: 512
17503
+ minLength: 1
17504
+ type: string
17505
+ maxItems: 50
17506
+ minItems: 0
17507
+ type: array
17508
+ reason:
17509
+ description: SCHEMA-3.9.0. Why a `REPOSITORY_NEEDS_UPDATE` needs the author.
17510
+ enum:
17511
+ - AUTHOR_EDITED
17512
+ - BRANCH_PROTECTION
17513
+ - REPOSITORY_ARCHIVED
17514
+ - INSTALLATION_SUSPENDED
17515
+ - WORKFLOWS_PERMISSION_MISSING
17516
+ - AUTHORIZATION_LOST
17517
+ - FORBIDDEN
17518
+ type: string
17425
17519
  reasonCode:
17426
17520
  maxLength: 80
17427
17521
  minLength: 1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rathnasgala2/schemas",
3
- "version": "3.8.0",
3
+ "version": "3.10.0",
4
4
  "description": "Executable JSON Schema and OpenAPI contracts for Galascribe",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -29,6 +29,10 @@
29
29
  "types": "./types/frozen-envelope.d.ts",
30
30
  "import": "./src/frozen-envelope.js"
31
31
  },
32
+ "./palette": {
33
+ "types": "./types/palette.d.ts",
34
+ "import": "./src/palette.js"
35
+ },
32
36
  "./schemas/adapter-capability.schema.json": "./schemas/adapter-capability.schema.json",
33
37
  "./schemas/appearance.schema.json": "./schemas/appearance.schema.json",
34
38
  "./schemas/artifact-manifest.schema.json": "./schemas/artifact-manifest.schema.json",
@@ -55,6 +59,9 @@
55
59
  "import": "./generated/typescript/index.js"
56
60
  },
57
61
  "./parity/digest-record-vectors.json": "./parity/digest-record-vectors.json",
62
+ "./palette/golden-vectors.json": "./parity/palette/golden-vectors.json",
63
+ "./palette/stress-corpus.json": "./parity/palette/stress-corpus.json",
64
+ "./palette/theme-default.fixture.json": "./parity/palette/theme-default.fixture.json",
58
65
  "./catalog-sources/internal-event-actions.json": "./catalog-sources/internal-event-actions.json",
59
66
  "./docs/catalogs/app-components.json": "./docs/catalogs/app-components.json",
60
67
  "./docs/catalogs/app-routes.json": "./docs/catalogs/app-routes.json",
@@ -85,6 +92,7 @@
85
92
  "docs/catalogs/app-routes.json",
86
93
  "docs/catalogs/app-components.json",
87
94
  "parity/digest-record-vectors.json",
95
+ "parity/palette/",
88
96
  "LICENSE",
89
97
  "NOTICE",
90
98
  "README.md",
@@ -142,6 +150,7 @@
142
150
  "app-catalogs:generate": "node scripts/generate-app-catalogs.mjs",
143
151
  "app-catalogs:check": "node scripts/generate-app-catalogs.mjs --check",
144
152
  "browser-safety:check": "node scripts/check-browser-safety.mjs",
153
+ "palette-vectors:generate": "node scripts/generate-palette-vectors.mjs",
145
154
  "format": "prettier --write .",
146
155
  "format:check": "prettier --check .",
147
156
  "lint": "eslint .",