@usecds/server 0.0.0-stage → 0.1.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 (67) hide show
  1. package/LICENSE +201 -0
  2. package/dist/core/content-report.d.ts +37 -0
  3. package/dist/core/content-report.js +306 -0
  4. package/dist/core/content-report.js.map +1 -0
  5. package/dist/core/content-types.d.ts +40 -0
  6. package/dist/core/content-types.js +27 -0
  7. package/dist/core/content-types.js.map +1 -0
  8. package/dist/core/jsonld.d.ts +33 -0
  9. package/dist/core/jsonld.js +94 -0
  10. package/dist/core/jsonld.js.map +1 -0
  11. package/dist/core/media-metadata.d.ts +20 -0
  12. package/dist/core/media-metadata.js +53 -0
  13. package/dist/core/media-metadata.js.map +1 -0
  14. package/dist/core/media-names.d.ts +9 -0
  15. package/dist/core/media-names.js +58 -0
  16. package/dist/core/media-names.js.map +1 -0
  17. package/dist/core/menu.d.ts +33 -0
  18. package/dist/core/menu.js +89 -0
  19. package/dist/core/menu.js.map +1 -0
  20. package/dist/core/publisher.d.ts +77 -0
  21. package/dist/core/publisher.js +261 -0
  22. package/dist/core/publisher.js.map +1 -0
  23. package/dist/core/report.d.ts +54 -0
  24. package/dist/core/report.js +132 -0
  25. package/dist/core/report.js.map +1 -0
  26. package/dist/core/site.d.ts +37 -0
  27. package/dist/core/site.js +96 -0
  28. package/dist/core/site.js.map +1 -0
  29. package/dist/core/storage-report.d.ts +44 -0
  30. package/dist/core/storage-report.js +112 -0
  31. package/dist/core/storage-report.js.map +1 -0
  32. package/dist/core/targets.d.ts +63 -0
  33. package/dist/core/targets.js +213 -0
  34. package/dist/core/targets.js.map +1 -0
  35. package/dist/core/translations.d.ts +41 -0
  36. package/dist/core/translations.js +125 -0
  37. package/dist/core/translations.js.map +1 -0
  38. package/dist/index.d.ts +17 -0
  39. package/dist/index.js +18 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/sources/fixture.d.ts +9 -0
  42. package/dist/sources/fixture.js +79 -0
  43. package/dist/sources/fixture.js.map +1 -0
  44. package/dist/storage/filesystem.d.ts +23 -0
  45. package/dist/storage/filesystem.js +125 -0
  46. package/dist/storage/filesystem.js.map +1 -0
  47. package/dist/types.d.ts +223 -0
  48. package/dist/types.js +2 -0
  49. package/dist/types.js.map +1 -0
  50. package/dist/utils.d.ts +2 -0
  51. package/dist/utils.js +17 -0
  52. package/dist/utils.js.map +1 -0
  53. package/dist/validation.d.ts +21 -0
  54. package/dist/validation.js +100 -0
  55. package/dist/validation.js.map +1 -0
  56. package/package.json +28 -3
  57. package/schemas/v1/block.json +31 -0
  58. package/schemas/v1/channel-manifest.json +23 -0
  59. package/schemas/v1/collection.json +89 -0
  60. package/schemas/v1/jsonld.json +19 -0
  61. package/schemas/v1/media-metadata.json +41 -0
  62. package/schemas/v1/menu.json +21 -0
  63. package/schemas/v1/page.json +12 -0
  64. package/schemas/v1/release-manifest.json +82 -0
  65. package/schemas/v1/route.json +24 -0
  66. package/schemas/v1/target.json +98 -0
  67. package/README.md +0 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,KAAK,CAAC;AAC5B,OAAO,gBAAgB,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,GAAG,GAAI,SAAiB,CAAC,OAAO,IAAI,SAAS,CAAC;AACpD,MAAM,UAAU,GAAI,gBAAwB,CAAC,OAAO,IAAI,gBAAgB,CAAC;AAEzE,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3C,qDAAqD;AACrD,SAAS,UAAU,CAAC,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EAAE,IAAI,SAAS,MAAM,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC1G,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;AACxE,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AACrE,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;AACxE,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AASpE;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAc;IACjD,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,OAAO,CAAC,IAAS,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAE,QAAQ,CAAC,MAA+B,CAAC,CAAC;AAC1F,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,31 @@
1
1
  {
2
2
  "name": "@usecds/server",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "dependencies": {
8
+ "ajv": "^8.17.1",
9
+ "ajv-formats": "^3.0.1"
10
+ },
11
+ "devDependencies": {
12
+ "typescript": "^5.5.4"
13
+ },
14
+ "license": "Apache-2.0",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/usecds/cds.git",
18
+ "directory": "server"
19
+ },
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "schemas"
26
+ ],
27
+ "scripts": {
28
+ "build": "tsc",
29
+ "clean": "rimraf dist"
30
+ }
6
31
  }
@@ -0,0 +1,31 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Block",
4
+ "description": "An item of the optional _blocks collection: one section of a page. CDS doesn't interpret type or settings.",
5
+ "type": "object",
6
+ "properties": {
7
+ "id": { "type": "string", "minLength": 1 },
8
+ "type": { "type": "string", "minLength": 1 },
9
+ "items": {
10
+ "type": "array",
11
+ "description": "Explicit, ordered items",
12
+ "items": {
13
+ "type": "object",
14
+ "properties": { "collection": { "type": "string" }, "id": { "type": "string" } },
15
+ "required": ["collection", "id"],
16
+ "additionalProperties": true
17
+ }
18
+ },
19
+ "source": {
20
+ "type": "object",
21
+ "description": "All items of a collection, in its order",
22
+ "properties": { "collection": { "type": "string" } },
23
+ "required": ["collection"],
24
+ "additionalProperties": true
25
+ },
26
+ "links": { "type": "array", "items": { "type": "string" }, "description": "_menu link item ids" },
27
+ "settings": { "type": "object", "description": "Presentation settings for the renderer" }
28
+ },
29
+ "required": ["id", "type"],
30
+ "additionalProperties": true
31
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "ChannelManifest",
4
+ "type": "object",
5
+ "properties": {
6
+ "schemaVersion": {
7
+ "type": "integer",
8
+ "const": 1
9
+ },
10
+ "channel": {
11
+ "type": "string"
12
+ },
13
+ "releaseId": {
14
+ "type": "string"
15
+ },
16
+ "updatedAt": {
17
+ "type": "string",
18
+ "format": "date-time"
19
+ }
20
+ },
21
+ "required": ["schemaVersion", "channel", "releaseId", "updatedAt"],
22
+ "additionalProperties": true
23
+ }
@@ -0,0 +1,89 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Collection",
4
+ "type": "object",
5
+ "properties": {
6
+ "schemaVersion": {
7
+ "type": "integer",
8
+ "const": 1
9
+ },
10
+ "collection": {
11
+ "type": "string"
12
+ },
13
+ "items": {
14
+ "type": "array",
15
+ "items": {
16
+ "type": "object",
17
+ "properties": {
18
+ "id": { "type": "string" },
19
+ "key": { "type": "string" },
20
+ "translations": {
21
+ "type": "object",
22
+ "additionalProperties": {
23
+ "type": "object",
24
+ "properties": {
25
+ "media": {
26
+ "type": "array",
27
+ "items": { "type": "string" }
28
+ }
29
+ },
30
+ "additionalProperties": true
31
+ }
32
+ },
33
+ "references": {
34
+ "type": "array",
35
+ "items": {
36
+ "type": "object",
37
+ "properties": {
38
+ "collection": { "type": "string" },
39
+ "id": { "type": "string" }
40
+ },
41
+ "required": ["collection", "id"],
42
+ "additionalProperties": true
43
+ }
44
+ },
45
+ "media": {
46
+ "type": "array",
47
+ "items": {
48
+ "type": "string"
49
+ }
50
+ },
51
+ "_provenance": {
52
+ "type": "object",
53
+ "properties": {
54
+ "translations": {
55
+ "type": "object",
56
+ "additionalProperties": {
57
+ "type": "object",
58
+ "additionalProperties": { "$ref": "#/definitions/provenanceMarker" }
59
+ }
60
+ },
61
+ "fields": {
62
+ "type": "object",
63
+ "additionalProperties": { "$ref": "#/definitions/provenanceMarker" }
64
+ }
65
+ },
66
+ "additionalProperties": true
67
+ }
68
+ },
69
+ "required": ["id", "key", "translations"],
70
+ "additionalProperties": true
71
+ }
72
+ }
73
+ },
74
+ "definitions": {
75
+ "provenanceMarker": {
76
+ "type": "object",
77
+ "properties": {
78
+ "status": { "enum": ["original", "human", "machine", "reviewed"] },
79
+ "from": { "type": "string" },
80
+ "sourceHash": { "type": "string" },
81
+ "model": { "type": "string" }
82
+ },
83
+ "required": ["status"],
84
+ "additionalProperties": true
85
+ }
86
+ },
87
+ "required": ["schemaVersion", "collection", "items"],
88
+ "additionalProperties": true
89
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "JsonLdDefinition",
4
+ "description": "An item of the reserved _jsonld collection: how content items are described as schema.org JSON-LD.",
5
+ "type": "object",
6
+ "properties": {
7
+ "id": { "type": "string", "minLength": 1 },
8
+ "type": { "type": "string", "minLength": 1, "description": "schema.org type, e.g. Hotel" },
9
+ "appliesTo": { "type": "string", "description": "Collection this definition is the default for" },
10
+ "values": { "type": "object", "description": "Fixed values; localized ones go in translations[locale]" },
11
+ "map": {
12
+ "type": "object",
13
+ "description": "schema.org property (dots for nesting, e.g. author.name) -> field path",
14
+ "additionalProperties": { "type": "string" }
15
+ }
16
+ },
17
+ "required": ["id", "type"],
18
+ "additionalProperties": true
19
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "MediaMetadataItem",
4
+ "description": "An item of the reserved _media collection. id = the media file's virtual path.",
5
+ "type": "object",
6
+ "properties": {
7
+ "id": { "type": "string", "minLength": 1 },
8
+ "name": { "type": "string", "description": "Readable output file name (slug); defaults to the original file name" },
9
+ "translations": {
10
+ "type": "object",
11
+ "additionalProperties": {
12
+ "type": "object",
13
+ "properties": {
14
+ "alt": { "type": ["string", "null"] },
15
+ "description": { "type": ["string", "null"] }
16
+ },
17
+ "additionalProperties": true
18
+ }
19
+ },
20
+ "focalPoint": { "$ref": "#/definitions/point" },
21
+ "focalPoints": {
22
+ "type": "object",
23
+ "additionalProperties": { "$ref": "#/definitions/point" }
24
+ },
25
+ "width": { "type": "integer", "minimum": 1 },
26
+ "height": { "type": "integer", "minimum": 1 }
27
+ },
28
+ "definitions": {
29
+ "point": {
30
+ "type": "object",
31
+ "properties": {
32
+ "x": { "type": "number", "minimum": 0, "maximum": 1 },
33
+ "y": { "type": "number", "minimum": 0, "maximum": 1 }
34
+ },
35
+ "required": ["x", "y"],
36
+ "additionalProperties": true
37
+ }
38
+ },
39
+ "required": ["id"],
40
+ "additionalProperties": true
41
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "MenuItem",
4
+ "description": "An item of the optional _menu collection. Items no other item lists in children are menus (e.g. key main); entries carry a link and translations[locale].label.",
5
+ "type": "object",
6
+ "properties": {
7
+ "id": { "type": "string", "minLength": 1 },
8
+ "children": { "type": "array", "items": { "type": "string" }, "description": "_menu ids in order" },
9
+ "link": {
10
+ "type": "object",
11
+ "properties": {
12
+ "route": { "type": "string", "description": "_routes id" },
13
+ "block": { "type": "string", "description": "_blocks id on the route's page (anchor)" },
14
+ "url": { "type": "string", "description": "External URL" }
15
+ },
16
+ "additionalProperties": true
17
+ }
18
+ },
19
+ "required": ["id"],
20
+ "additionalProperties": true
21
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Page",
4
+ "description": "An item of the optional _pages collection: page metadata (translations[locale].title / description) and its blocks in order.",
5
+ "type": "object",
6
+ "properties": {
7
+ "id": { "type": "string", "minLength": 1 },
8
+ "blocks": { "type": "array", "items": { "type": "string" } }
9
+ },
10
+ "required": ["id"],
11
+ "additionalProperties": true
12
+ }
@@ -0,0 +1,82 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "ReleaseManifest",
4
+ "type": "object",
5
+ "properties": {
6
+ "schemaVersion": {
7
+ "type": "integer",
8
+ "const": 1
9
+ },
10
+ "releaseId": {
11
+ "type": "string"
12
+ },
13
+ "createdAt": {
14
+ "type": "string",
15
+ "format": "date-time"
16
+ },
17
+ "sourceReadAt": {
18
+ "type": "string",
19
+ "format": "date-time",
20
+ "description": "When the publisher started reading the source: the content is at least this recent"
21
+ },
22
+ "collections": {
23
+ "type": "object",
24
+ "additionalProperties": {
25
+ "type": "object",
26
+ "properties": {
27
+ "hash": { "type": "string" },
28
+ "itemCount": { "type": "integer", "minimum": 0 },
29
+ "size": { "type": "integer", "minimum": 0 }
30
+ },
31
+ "required": ["hash", "itemCount", "size"],
32
+ "additionalProperties": true
33
+ }
34
+ },
35
+ "media": {
36
+ "type": "object",
37
+ "additionalProperties": {
38
+ "type": "object",
39
+ "properties": {
40
+ "hash": { "type": "string" },
41
+ "size": { "type": "integer", "minimum": 0 },
42
+ "mimeType": { "type": "string" }
43
+ },
44
+ "required": ["hash", "size", "mimeType"],
45
+ "additionalProperties": true
46
+ }
47
+ },
48
+ "translations": {
49
+ "type": "object",
50
+ "properties": {
51
+ "sourceLocale": { "type": "string" },
52
+ "locales": {
53
+ "type": "object",
54
+ "additionalProperties": { "$ref": "#/definitions/translationCounts" }
55
+ },
56
+ "overall": { "$ref": "#/definitions/translationCounts" }
57
+ },
58
+ "required": ["sourceLocale", "locales", "overall"],
59
+ "additionalProperties": true
60
+ },
61
+ "targets": {
62
+ "type": "array",
63
+ "items": { "type": "string" }
64
+ }
65
+ },
66
+ "definitions": {
67
+ "translationCounts": {
68
+ "type": "object",
69
+ "properties": {
70
+ "expected": { "type": "integer", "minimum": 0 },
71
+ "translated": { "type": "integer", "minimum": 0 },
72
+ "missing": { "type": "integer", "minimum": 0 },
73
+ "stale": { "type": "integer", "minimum": 0 },
74
+ "machine": { "type": "integer", "minimum": 0 }
75
+ },
76
+ "required": ["expected", "translated", "missing", "stale", "machine"],
77
+ "additionalProperties": true
78
+ }
79
+ },
80
+ "required": ["schemaVersion", "releaseId", "createdAt", "collections", "media"],
81
+ "additionalProperties": true
82
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Route",
4
+ "description": "An item of the optional _routes collection: one URL, with its path per language in translations[locale].path.",
5
+ "type": "object",
6
+ "properties": {
7
+ "id": { "type": "string", "minLength": 1 },
8
+ "page": { "type": "string", "description": "_pages id this route shows" },
9
+ "redirect": { "type": "string", "description": "_routes id to redirect to, instead of a page" },
10
+ "status": { "enum": [301, 302], "description": "Redirect status (default 301)" },
11
+ "translations": {
12
+ "type": "object",
13
+ "additionalProperties": {
14
+ "type": "object",
15
+ "properties": {
16
+ "path": { "type": "string", "pattern": "^/" }
17
+ },
18
+ "additionalProperties": true
19
+ }
20
+ }
21
+ },
22
+ "required": ["id"],
23
+ "additionalProperties": true
24
+ }
@@ -0,0 +1,98 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "TargetDefinition",
4
+ "type": "object",
5
+ "properties": {
6
+ "id": { "type": "string", "pattern": "^[a-zA-Z0-9_-]+$" },
7
+ "scope": {
8
+ "type": "array",
9
+ "items": { "type": "string" }
10
+ },
11
+ "locales": {
12
+ "type": "object",
13
+ "properties": {
14
+ "required": { "type": "array", "items": { "type": "string" } },
15
+ "minCompleteness": { "type": "number", "minimum": 0, "maximum": 1 },
16
+ "maxStale": { "type": "integer", "minimum": 0 }
17
+ },
18
+ "additionalProperties": true
19
+ },
20
+ "collections": {
21
+ "type": "object",
22
+ "additionalProperties": {
23
+ "type": "object",
24
+ "properties": {
25
+ "minItems": { "type": "integer", "minimum": 0 },
26
+ "localized": { "type": "object" },
27
+ "fields": { "type": "object" },
28
+ "presets": { "type": "array", "items": { "type": "string" } }
29
+ },
30
+ "additionalProperties": true
31
+ }
32
+ },
33
+ "items": {
34
+ "type": "array",
35
+ "items": {
36
+ "type": "object",
37
+ "properties": {
38
+ "collection": { "type": "string" },
39
+ "key": { "type": "string" }
40
+ },
41
+ "required": ["collection", "key"],
42
+ "additionalProperties": true
43
+ }
44
+ },
45
+ "recommendations": {
46
+ "type": "object",
47
+ "additionalProperties": {
48
+ "type": "object",
49
+ "properties": {
50
+ "localized": { "type": "object" },
51
+ "fields": { "type": "object" }
52
+ },
53
+ "additionalProperties": true
54
+ }
55
+ },
56
+ "media": {
57
+ "type": "object",
58
+ "properties": {
59
+ "breakpoints": {
60
+ "type": "object",
61
+ "description": "Breakpoint name -> minimum screen width in CSS pixels",
62
+ "additionalProperties": { "type": "integer", "minimum": 0 }
63
+ },
64
+ "dpr": { "type": "array", "items": { "type": "number", "exclusiveMinimum": 0 } },
65
+ "presets": {
66
+ "type": "object",
67
+ "additionalProperties": {
68
+ "type": "object",
69
+ "properties": {
70
+ "aspect": { "type": "string", "pattern": "^[0-9]+(\\.[0-9]+)?:[0-9]+(\\.[0-9]+)?$" },
71
+ "fit": { "enum": ["fill", "fit"] },
72
+ "widths": {
73
+ "type": "object",
74
+ "description": "Breakpoint name -> rendered width in CSS pixels",
75
+ "additionalProperties": { "type": "integer", "minimum": 1 }
76
+ },
77
+ "formats": {
78
+ "type": "array",
79
+ "description": "Formats to render; the last one is the universal fallback",
80
+ "items": { "enum": ["avif", "webp", "jpeg", "png"] },
81
+ "minItems": 1,
82
+ "uniqueItems": true
83
+ },
84
+ "quality": { "type": "integer", "minimum": 1, "maximum": 100 },
85
+ "lossless": { "type": "boolean" },
86
+ "background": { "type": "string" }
87
+ },
88
+ "required": ["widths"],
89
+ "additionalProperties": true
90
+ }
91
+ }
92
+ },
93
+ "additionalProperties": true
94
+ }
95
+ },
96
+ "required": ["id"],
97
+ "additionalProperties": true
98
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.