@thegetty/quire-cli 1.0.0-rc.34 → 1.0.0-rc.36

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 (159) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +9 -0
  3. package/bin/cli.js +19 -1
  4. package/package.json +21 -8
  5. package/schemas/config.schema.json +194 -0
  6. package/schemas/figures.schema.json +56 -0
  7. package/schemas/layout.schema.json +5 -0
  8. package/schemas/objects.schema.json +62 -0
  9. package/schemas/publication.schema.json +140 -0
  10. package/schemas/references.schema.json +29 -0
  11. package/src/Command.js +26 -6
  12. package/src/Command.spec.js +99 -0
  13. package/src/commands/README.md +213 -122
  14. package/src/commands/build.js +46 -37
  15. package/src/commands/build.spec.js +113 -0
  16. package/src/commands/build.test.js +402 -0
  17. package/src/commands/clean.js +25 -19
  18. package/src/commands/clean.spec.js +108 -0
  19. package/src/commands/clean.test.js +260 -0
  20. package/src/commands/config.js +251 -0
  21. package/src/commands/config.spec.js +107 -0
  22. package/src/commands/config.test.js +715 -0
  23. package/src/commands/create.js +42 -14
  24. package/src/commands/create.spec.js +112 -0
  25. package/src/commands/create.test.js +415 -0
  26. package/src/commands/epub.js +59 -30
  27. package/src/commands/epub.spec.js +114 -0
  28. package/src/commands/epub.test.js +503 -0
  29. package/src/commands/index.js +9 -2
  30. package/src/commands/info.js +18 -24
  31. package/src/commands/info.spec.js +64 -0
  32. package/src/commands/info.test.js +415 -0
  33. package/src/commands/pdf.js +58 -84
  34. package/src/commands/pdf.spec.js +114 -0
  35. package/src/commands/pdf.test.js +464 -0
  36. package/src/commands/preview.js +26 -31
  37. package/src/commands/preview.spec.js +97 -0
  38. package/src/commands/preview.test.js +250 -0
  39. package/src/commands/use.js +56 -0
  40. package/src/commands/use.spec.js +61 -0
  41. package/src/commands/use.test.js +280 -0
  42. package/src/commands/validate.js +31 -19
  43. package/src/commands/validate.spec.js +82 -0
  44. package/src/commands/validate.test.js +234 -0
  45. package/src/commands/workflows.js +70 -0
  46. package/src/errors/build/build-failed-error.js +19 -0
  47. package/src/errors/build/config-field-missing-error.js +20 -0
  48. package/src/errors/build/config-file-not-found-error.js +20 -0
  49. package/src/errors/build/index.js +11 -0
  50. package/src/errors/index.js +48 -0
  51. package/src/errors/install/dependency-install-error.js +19 -0
  52. package/src/errors/install/directory-not-empty-error.js +25 -0
  53. package/src/errors/install/index.js +12 -0
  54. package/src/errors/install/invalid-path-error.js +31 -0
  55. package/src/errors/install/invalid-starter-error.js +27 -0
  56. package/src/errors/install/version-not-found-error.js +35 -0
  57. package/src/errors/output/epub-generation-error.js +19 -0
  58. package/src/errors/output/index.js +14 -0
  59. package/src/errors/output/invalid-epub-library-error.js +20 -0
  60. package/src/errors/output/invalid-pdf-library-error.js +20 -0
  61. package/src/errors/output/missing-build-output-error.js +21 -0
  62. package/src/errors/output/pdf-generation-error.js +24 -0
  63. package/src/errors/output/tool-not-found-error.js +37 -0
  64. package/src/errors/project/index.js +10 -0
  65. package/src/errors/project/not-in-project-error.js +20 -0
  66. package/src/errors/project/project-create-error.js +21 -0
  67. package/src/errors/quire-error.js +27 -0
  68. package/src/errors/validation/validation-error.js +20 -11
  69. package/src/helpers/clean.js +1 -1
  70. package/src/helpers/docs-url.js +32 -0
  71. package/src/helpers/test-cwd.js +5 -6
  72. package/src/helpers/test-cwd.test.js +192 -0
  73. package/src/helpers/which.js +10 -4
  74. package/src/lib/11ty/README.md +135 -19
  75. package/src/lib/11ty/api.js +176 -93
  76. package/src/lib/11ty/cli.js +77 -35
  77. package/src/lib/11ty/index.js +64 -5
  78. package/src/lib/11ty/index.test.js +655 -0
  79. package/src/lib/README.md +275 -0
  80. package/src/lib/commander/index.js +100 -0
  81. package/src/lib/commander/index.test.js +86 -0
  82. package/src/lib/commander/options.js +195 -0
  83. package/src/lib/commander/options.test.js +109 -0
  84. package/src/lib/conf/README.md +84 -73
  85. package/src/lib/conf/config.js +5 -3
  86. package/src/lib/conf/config.test.js +281 -0
  87. package/src/lib/conf/defaults.js +44 -0
  88. package/src/lib/conf/format.js +60 -0
  89. package/src/lib/conf/format.test.js +106 -0
  90. package/src/lib/conf/helpers.js +91 -0
  91. package/src/lib/conf/helpers.test.js +136 -0
  92. package/src/lib/conf/index.js +22 -0
  93. package/src/lib/conf/schema.js +53 -8
  94. package/src/lib/epub/README.md +133 -2
  95. package/src/lib/epub/engines.js +46 -0
  96. package/src/lib/epub/epub.js +36 -11
  97. package/src/lib/epub/index.js +111 -21
  98. package/src/lib/epub/index.test.js +518 -0
  99. package/src/lib/epub/pandoc.js +33 -4
  100. package/src/lib/epub/pandoc.test.js +122 -0
  101. package/src/lib/epub/schema.js +21 -0
  102. package/src/lib/error/README.md +170 -0
  103. package/src/lib/error/handler.js +107 -0
  104. package/src/lib/git/README.md +151 -2
  105. package/src/lib/git/index.js +217 -13
  106. package/src/lib/git/index.spec.js +80 -0
  107. package/src/lib/git/index.test.js +453 -0
  108. package/src/lib/installer/index.js +309 -0
  109. package/src/lib/installer/index.spec.js +83 -0
  110. package/src/lib/installer/index.test.js +545 -0
  111. package/src/lib/logger/README.md +424 -0
  112. package/src/lib/logger/debug.js +90 -0
  113. package/src/lib/logger/debug.spec.js +130 -0
  114. package/src/lib/logger/index.js +228 -0
  115. package/src/lib/logger/index.spec.js +131 -0
  116. package/src/lib/logger/index.test.js +477 -0
  117. package/src/lib/npm/README.md +127 -0
  118. package/src/lib/npm/index.js +198 -0
  119. package/src/lib/npm/index.spec.js +60 -0
  120. package/src/lib/npm/index.test.js +355 -0
  121. package/src/lib/pdf/README.md +131 -0
  122. package/src/lib/pdf/engines.js +46 -0
  123. package/src/lib/pdf/index.js +124 -21
  124. package/src/lib/pdf/index.test.js +708 -0
  125. package/src/lib/pdf/paged.js +100 -52
  126. package/src/lib/pdf/paged.test.js +366 -0
  127. package/src/lib/pdf/prince.js +115 -37
  128. package/src/lib/pdf/prince.test.js +202 -0
  129. package/src/lib/pdf/schema.js +21 -0
  130. package/src/lib/pdf/split.js +61 -33
  131. package/src/lib/pdf/split.test.js +445 -0
  132. package/src/lib/process/manager.js +110 -0
  133. package/src/lib/process/manager.test.js +55 -0
  134. package/src/lib/project/build.js +143 -0
  135. package/src/lib/project/build.test.js +253 -0
  136. package/src/lib/project/config.js +48 -0
  137. package/src/lib/project/config.test.js +134 -0
  138. package/src/{helpers/is-quire.js → lib/project/detect.js} +5 -3
  139. package/src/lib/project/detect.test.js +157 -0
  140. package/src/lib/project/index.js +40 -0
  141. package/src/lib/project/paths.js +224 -0
  142. package/src/lib/project/version.js +110 -0
  143. package/src/lib/project/version.test.js +350 -0
  144. package/src/lib/reporter/README.md +211 -2
  145. package/src/lib/reporter/index.js +512 -0
  146. package/src/lib/reporter/index.test.js +593 -0
  147. package/src/main.js +134 -47
  148. package/src/main.spec.js +61 -0
  149. package/src/main.test.js +347 -0
  150. package/src/validators/utils.js +2 -1
  151. package/src/commands/conf.js +0 -43
  152. package/src/commands/version.js +0 -43
  153. package/src/lib/11ty/paths.js +0 -103
  154. package/src/lib/i18n/README.md +0 -3
  155. package/src/lib/i18n/config.js +0 -53
  156. package/src/lib/i18n/index.js +0 -43
  157. package/src/lib/i18n/localeService.js +0 -58
  158. package/src/lib/quire/README.md +0 -19
  159. package/src/lib/quire/index.js +0 -350
package/CHANGELOG.md CHANGED
@@ -12,6 +12,42 @@ Changelog entries are classified using the following labels:
12
12
  - `Fixed`: for any bug fixes
13
13
  - `Removed`: for deprecated features removed in this release
14
14
 
15
+ ## [Unreleased]
16
+
17
+ ### Added
18
+
19
+ - New `quire validate` command to check YAML syntax in `content/_data/` directory
20
+ - New `quire use <version>` command (renamed from `quire version`) to change quire-11ty version
21
+ - Config settings for default PDF and EPUB engines via `quire settings set pdfEngine <engine>` and `quire settings set epubEngine <engine>`
22
+ - Config settings for default log level via `quire settings set logLevel <level>`
23
+ - Debug logger module with namespace support (`DEBUG=quire:*`)
24
+ - Process manager for graceful shutdown handling (Ctrl+C) during long-running operations
25
+ - `--build` flag for `quire pdf` and `quire epub` commands to run build first if output is missing
26
+ - `--engine` option for `quire pdf` and `quire epub` commands (deprecates `--lib`)
27
+ - Helper functions for build output detection (`hasSiteOutput`, `hasEpubOutput`, `hasPdfOutput`)
28
+ - Comprehensive error handling system with domain-specific error classes
29
+ - Documentation for CLI architecture, error handling, and testing
30
+
31
+ ### Changed
32
+
33
+ - Renamed `quire conf` command to `quire config` (aliased as `quire settings`)
34
+ - Renamed `quire version` command to `quire use`
35
+ - Refactored error handling to use thrown errors instead of `process.exit()` for better testability
36
+ - Commands now inherit `debug()` and `logger` methods from base Command class
37
+ - Improved log output with configurable log levels (trace, debug, info, warn, error, silent)
38
+ - Replaced `simple-git` dependency with a lightweight git façade module
39
+ - Replaced `execaCommand` with `execa` for improved command execution
40
+ - Encapsulated project concerns into dedicated `lib/project` module
41
+ - Encapsulated 11ty interactions into a façade module with process lifecycle management
42
+
43
+ ### Fixed
44
+
45
+ - `quire new` command arguments and options validation
46
+ - Command lifecycle hook errors are now correctly handled and reported
47
+ - Disabled auto-deletion of project directory on `quire new` failures to prevent accidental data loss
48
+ - Package schema files validation
49
+ - Process manager import paths for logger module
50
+
15
51
  ## [1.0.0-rc.33]
16
52
 
17
53
  ### Bumped
package/README.md CHANGED
@@ -24,3 +24,12 @@ npm install quire-cli --install-strategy=nested
24
24
  ```sh
25
25
  npx quire-cli --help
26
26
  ```
27
+
28
+ ### Testing
29
+
30
+ The CLI uses two types of test files for commands:
31
+
32
+ - **`*.spec.js`** - Contract/interface tests that verify the command definition is correctly transformed into Commander.js Command object instance and the public API is correct
33
+ - **`*.test.js`** - Integration/behavior tests that verify command execution with real dependencies
34
+
35
+ See [docs/testing-commands.md](docs/testing-commands.md) for the complete testing guide and patterns.
package/bin/cli.js CHANGED
@@ -1,11 +1,29 @@
1
1
  #!/usr/bin/env -S node --no-warnings
2
- import cli from '#src/main.js'
3
2
  import config from '#src/lib/conf/config.js'
4
3
  import packageConfig from '#src/packageConfig.js'
5
4
  import updateNotifier from 'update-notifier'
6
5
 
6
+ // Import process manager to register signal handlers for graceful shutdown
7
+ import '#lib/process/manager.js'
8
+
7
9
  process.removeAllListeners('warning')
8
10
 
11
+ /**
12
+ * Set log level from config before importing CLI modules
13
+ *
14
+ * This env var is read by the logger at module creation time.
15
+ * Setting it here ensures all loggers (including module-level ones)
16
+ * use the configured level.
17
+ *
18
+ * @see lib/logger/index.js
19
+ */
20
+ process.env.QUIRE_LOG_LEVEL = config.get('logLevel') || 'info'
21
+
22
+ /**
23
+ * Dynamic import ensures env var is set before logger modules are loaded
24
+ */
25
+ const { default: cli } = await import('#src/main.js')
26
+
9
27
  /**
10
28
  * Interval constants in milliseconds
11
29
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@thegetty/quire-cli",
3
3
  "description": "Quire command-line interface",
4
- "version": "1.0.0-rc.34",
4
+ "version": "1.0.0-rc.36",
5
5
  "author": "Getty Digital",
6
6
  "license": "SEE LICENSE IN https://github.com/thegetty/quire/blob/main/LICENSE",
7
7
  "bugs": {
@@ -20,6 +20,7 @@
20
20
  "files": [
21
21
  "bin/",
22
22
  "patches/",
23
+ "schemas/",
23
24
  "scripts/",
24
25
  "src/",
25
26
  "CHANGELOG.md",
@@ -38,21 +39,28 @@
38
39
  "docs": "jsdoc2md --configure jsdoc.json --files src/**/*.js > docs/cli.md",
39
40
  "lint": "eslint src --ext .js",
40
41
  "lint:fix": "npm run lint -- --fix",
41
- "test": "echo \"No test specified\" && exit 0"
42
+ "test": "ava",
43
+ "test:watch": "ava --watch",
44
+ "test:unit": "ava src/commands/**/*.spec.js src/lib/**/*.spec.js",
45
+ "test:integration": "ava src/commands/**/*.test.js src/helpers/**/*.test.js src/lib/**/*.test.js",
46
+ "test:e2e": "ava test/e2e/**/*.e2e.js",
47
+ "test:coverage": "c8 ava"
42
48
  },
43
49
  "imports": {
44
50
  "#root/*": "./*",
45
51
  "#src/*.js": "./src/*.js",
46
52
  "#helpers/*.js": "./src/helpers/*.js",
47
- "#lib/*.js": "./src/lib/*.js"
53
+ "#lib/*.js": "./src/lib/*.js",
54
+ "#debug": "./src/lib/logger/debug.js"
48
55
  },
49
56
  "dependencies": {
50
57
  "ajv": "^8.16.0",
51
58
  "boxen": "^7.0.1",
52
59
  "chalk": "^5.2.0",
53
- "commander": "^12.1.0",
54
- "conf": "^13.1.0",
60
+ "commander": "^14.0.2",
61
+ "conf": "^15.0.2",
55
62
  "cross-env": "^7.0.3",
63
+ "debug": "^4.4.0",
56
64
  "del": "^7.0.0",
57
65
  "epubjs-cli": "^0.1.6",
58
66
  "execa": "^6.1.0",
@@ -66,14 +74,19 @@
66
74
  "open": "^8.4.0",
67
75
  "ora": "^6.1.2",
68
76
  "pagedjs-cli": "^0.4.3",
77
+ "pdf-lib": "^1.17.1",
69
78
  "read-package-up": "^11.0.0",
70
79
  "semver": "^7.3.8",
71
- "simple-git": "^3.16.0",
72
- "update-notifier": "^7.3.1"
80
+ "update-notifier": "^7.3.1",
81
+ "which": "^2.0.2"
73
82
  },
74
83
  "devDependencies": {
84
+ "ava": "^6.2.0",
75
85
  "eslint": "^8.32.0",
76
- "jsdoc-to-markdown": "^9.1.1"
86
+ "esmock": "^2.7.3",
87
+ "jsdoc-to-markdown": "^9.1.1",
88
+ "memfs": "^4.51.1",
89
+ "sinon": "^17.0.1"
77
90
  },
78
91
  "engines": {
79
92
  "node": ">=22"
@@ -0,0 +1,194 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Quire Config Schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "accordion": {
7
+ "type": "object",
8
+ "properties": {
9
+ "controls": {
10
+ "type": "string",
11
+ "enum": ["arrow", "plus-minus"]
12
+ },
13
+ "copyButton": {
14
+ "type": "object",
15
+ "properties": {
16
+ "ariaLabel": { "type": "string" },
17
+ "successText": { "type": "string" },
18
+ "symbol": { "type": "string" }
19
+ },
20
+ "required": ["ariaLabel", "successText", "symbol"]
21
+ },
22
+ "globalControls": {
23
+ "type": "object",
24
+ "properties": {
25
+ "collapseText": { "type": "string" },
26
+ "expandText": { "type": "string" }
27
+ },
28
+ "required": ["collapseText", "expandText"]
29
+ }
30
+ },
31
+ "required": ["controls", "copyButton", "globalControls"]
32
+ },
33
+ "analytics": {
34
+ "type": "object",
35
+ "properties": {
36
+ "googleId": { "type": "string" }
37
+ },
38
+ "required": ["googleId"]
39
+ },
40
+ "bylineFormat": {
41
+ "oneOf": [
42
+ { "type": "string", "enum": ["name", "name-title"] },
43
+ { "type": "boolean", "enum": [false] }
44
+ ]
45
+ },
46
+ "bibliography": {
47
+ "type": "object",
48
+ "properties": {
49
+ "displayOnPage": { "type": "boolean" },
50
+ "displayShort": { "type": "boolean" },
51
+ "heading": { "type": "string" }
52
+ },
53
+ "required": ["displayOnPage", "displayShort", "heading"]
54
+ },
55
+ "citations": {
56
+ "type": "object",
57
+ "properties": {
58
+ "divider": { "type": "string" },
59
+ "popupStyle": {
60
+ "type": "string",
61
+ "enum": ["text", "icon"]
62
+ }
63
+ },
64
+ "required": ["divider", "popupStyle"]
65
+ },
66
+ "entryPage": {
67
+ "type": "object",
68
+ "properties": {
69
+ "sideBySide": { "type": "boolean" },
70
+ "objectLinkText": { "type": "string" }
71
+ },
72
+ "required": ["sideBySide", "objectLinkText"]
73
+ },
74
+ "epub": {
75
+ "type": "object",
76
+ "properties": {
77
+ "defaultCoverImage": { "type": "string" },
78
+ "outputDir": { "type": "string" }
79
+ },
80
+ "required": ["defaultCoverImage", "outputDir"]
81
+ },
82
+ "footnotes": {
83
+ "type": "object",
84
+ "properties": {
85
+ "backlinkSymbol": { "type": "string" }
86
+ },
87
+ "required": ["backlinkSymbol"]
88
+ },
89
+ "figures": {
90
+ "type": "object",
91
+ "properties": {
92
+ "assetDir": { "type": "string" },
93
+ "enableModal": { "type": "boolean" },
94
+ "imageDir": { "type": "string" }
95
+ },
96
+ "required": ["assetDir", "enableModal", "imageDir"]
97
+ },
98
+ "licenseIcons": { "type": "boolean" },
99
+ "localization": {
100
+ "type": "object",
101
+ "properties": {
102
+ "defaultLocale": { "type": "string" }
103
+ },
104
+ "required": ["defaultLocale"]
105
+ },
106
+ "menuType": {
107
+ "type": "string",
108
+ "enum": ["full", "brief"]
109
+ },
110
+ "navigation": {
111
+ "type": "object",
112
+ "properties": {
113
+ "nextButtonText": { "type": "string" },
114
+ "prevButtonText": { "type": "string" }
115
+ },
116
+ "required": ["nextButtonText", "prevButtonText"]
117
+ },
118
+ "pageTitle": {
119
+ "type": "object",
120
+ "properties": {
121
+ "labelDivider": { "type": "string" }
122
+ },
123
+ "required": ["labelDivider"]
124
+ },
125
+ "pdf": {
126
+ "type": "object",
127
+ "properties": {
128
+ "filename": { "type": "string" },
129
+ "outputDir": { "type": "string" },
130
+ "pagePDF": {
131
+ "type": "object",
132
+ "properties": {
133
+ "accessLinks": {
134
+ "type": "array",
135
+ "items": {
136
+ "type": "object",
137
+ "properties": {
138
+ "header": { "type": "boolean" },
139
+ "footer": { "type": "boolean" },
140
+ "label": { "type": "string" }
141
+ }
142
+ }
143
+ },
144
+ "coverPage": { "type": "boolean" },
145
+ "output": { "type": "boolean" }
146
+ },
147
+ "required": ["accessLinks", "coverPage", "output"]
148
+ },
149
+ "publicationPDF": {
150
+ "type": "object",
151
+ "properties": {
152
+ "output": { "type": "boolean" }
153
+ },
154
+ "required": ["output"]
155
+ }
156
+ },
157
+ "required": ["filename", "outputDir", "pagePDF", "publicationPDF"]
158
+ },
159
+ "ref": {
160
+ "type": "object",
161
+ "properties": {
162
+ "sequenceTransition": { "type": "number" }
163
+ },
164
+ "required": ["sequenceTransition"]
165
+ },
166
+ "searchEnabled": { "type": "boolean" },
167
+ "tableOfContents": {
168
+ "type": "object",
169
+ "properties": {
170
+ "contributorDivider": { "type": "string" }
171
+ },
172
+ "required": ["contributorDivider"]
173
+ }
174
+ },
175
+ "required": [
176
+ "accordion",
177
+ "bylineFormat",
178
+ "bibliography",
179
+ "citations",
180
+ "entryPage",
181
+ "epub",
182
+ "footnotes",
183
+ "figures",
184
+ "licenseIcons",
185
+ "localization",
186
+ "menuType",
187
+ "navigation",
188
+ "pageTitle",
189
+ "pdf",
190
+ "ref",
191
+ "searchEnabled",
192
+ "tableOfContents"
193
+ ]
194
+ }
@@ -0,0 +1,56 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Figures YAML Schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "figure_list": {
7
+ "type": "array",
8
+ "items": {
9
+ "type": "object",
10
+ "required": ["id"],
11
+ "properties": {
12
+ "id": { "type": "string" },
13
+ "label": { "type": "string" },
14
+ "src": { "type": "string" },
15
+ "caption": { "type": "string" },
16
+ "credit": { "type": ["string", "null"] },
17
+ "alt": { "type": ["string", "null"] },
18
+ "poster": { "type": "string" },
19
+ "download": { "type": "boolean" },
20
+ "zoom": { "type": "boolean" },
21
+ "media_id": { "type": "string" },
22
+ "media_type": {
23
+ "type": "string",
24
+ "enum": ["youtube", "soundcloud", "table"]
25
+ },
26
+ "annotations": {
27
+ "type": "array",
28
+ "items": {
29
+ "type": "object",
30
+ "required": ["input", "items"],
31
+ "properties": {
32
+ "input": {
33
+ "type": "string",
34
+ "enum": ["radio", "checkbox"]
35
+ },
36
+ "items": {
37
+ "type": "array",
38
+ "items": {
39
+ "type": "object",
40
+ "properties": {
41
+ "src": { "type": "string" },
42
+ "label": { "type": "string" },
43
+ "selected": { "type": "boolean" }
44
+ },
45
+ "required": ["src"]
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ },
55
+ "required": ["figure_list"]
56
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Layout Schema",
4
+ "type": "string"
5
+ }
@@ -0,0 +1,62 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Objects Schema",
4
+ "type": "object",
5
+ "required": [
6
+ "object_card",
7
+ "object_display_order",
8
+ "object_filters",
9
+ "object_list"
10
+ ],
11
+ "properties": {
12
+ "object_filters": {
13
+ "type": "array",
14
+ "items": { "type": "string" },
15
+ "minItems": 0
16
+ },
17
+ "object_card": {
18
+ "type": "array",
19
+ "items": { "type": "string" },
20
+ "minItems": 0
21
+ },
22
+ "object_display_order": {
23
+ "type": "array",
24
+ "items": { "type": "string" },
25
+ "minItems": 0
26
+ },
27
+ "object_list": {
28
+ "type": "array",
29
+ "items": {
30
+ "type": "object",
31
+ "properties": {
32
+ "id": { "type": "string" },
33
+ "title": { "type": "string" },
34
+ "artist": { "type": "string" },
35
+ "year": { "type": "string" },
36
+ "medium": { "type": "string" },
37
+ "dimensions": { "type": "string" },
38
+ "location": { "type": "string" },
39
+ "link": { "type": "string", "format": "uri" },
40
+ "figure": {
41
+ "type": "array",
42
+ "items": {
43
+ "type": "object",
44
+ "properties": {
45
+ "id": { "type": "string" }
46
+ },
47
+ "required": [
48
+ "id"
49
+ ]
50
+ },
51
+ "minItems": 0
52
+ }
53
+ },
54
+ "required": [
55
+ "id",
56
+ "title"
57
+ ]
58
+ },
59
+ "minItems": 0
60
+ }
61
+ }
62
+ }
@@ -0,0 +1,140 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Publication Schema",
4
+ "type": "object",
5
+ "required": [
6
+ "url",
7
+ "title",
8
+ "subtitle",
9
+ "description",
10
+ "pub_date",
11
+ "language",
12
+ "pub_type",
13
+ "identifier",
14
+ "publisher",
15
+ "contributor",
16
+ "copyright",
17
+ "license",
18
+ "resource_link",
19
+ "subject",
20
+ "revision_history",
21
+ "promo_image"
22
+ ],
23
+ "properties": {
24
+ "url": { "type": "string" },
25
+ "title": { "type": "string" },
26
+ "subtitle": { "type": "string" },
27
+ "reading_line": { "type": ["string", "null"] },
28
+ "short_title": { "type": ["string", "null"] },
29
+ "description": {
30
+ "type": "object",
31
+ "required": ["full"],
32
+ "properties": {
33
+ "one_line": { "type": ["string", "null"] },
34
+ "full": { "type": "string" }
35
+ }
36
+ },
37
+ "pub_date": {
38
+ "oneOf": [
39
+ { "type": "string" },
40
+ { "type": "object" }
41
+ ] },
42
+ "language": { "type": "string" },
43
+ "pub_type": { "type": "string" },
44
+ "identifier": {
45
+ "type": "object",
46
+ "properties": {
47
+ "isbn": { "type": ["string", "null"] }
48
+ }
49
+ },
50
+ "publisher": {
51
+ "type": "array",
52
+ "items": { "$ref": "#/definitions/publisher" }
53
+ },
54
+ "contributor_as_it_appears": { "type": ["string", "null"] },
55
+ "contributor": {
56
+ "type": "array",
57
+ "items": { "$ref": "#/definitions/contributor" }
58
+ },
59
+ "copyright": { "type": "string" },
60
+ "license": { "$ref": "#/definitions/license" },
61
+ "resource_link": {
62
+ "type": "array",
63
+ "items": { "$ref": "#/definitions/resourceLink" }
64
+ },
65
+ "subject": {
66
+ "type": "array",
67
+ "items": { "$ref": "#/definitions/subject" }
68
+ },
69
+ "revision_history": {
70
+ "type": "array",
71
+ "items": { "$ref": "#/definitions/revision" }
72
+ },
73
+ "repository_url": { "type": ["string", "null"] },
74
+ "promo_image": { "type": "string" }
75
+ },
76
+ "definitions": {
77
+ "publisher": {
78
+ "type": "object",
79
+ "required": ["name"],
80
+ "properties": {
81
+ "name": { "type": "string" },
82
+ "location": { "type": ["string", "null"] },
83
+ "url": { "type": ["string", "null"] },
84
+ "logo": { "type": ["string", "null"] }
85
+ }
86
+ },
87
+ "contributor": {
88
+ "type": "object",
89
+ "required": ["id", "type", "first_name", "last_name"],
90
+ "properties": {
91
+ "id": { "type": "string" },
92
+ "type": { "type": "string" },
93
+ "first_name": { "type": "string" },
94
+ "last_name": { "type": "string" },
95
+ "title": { "type": ["string", "null"] },
96
+ "affiliation": { "type": ["string", "null"] },
97
+ "bio": { "type": ["string", "null"] },
98
+ "url": { "type": ["string", "null"] },
99
+ "image": { "type": ["string", "null"] }
100
+ }
101
+ },
102
+ "license": {
103
+ "type": "object",
104
+ "required": ["name", "abbreviation", "url", "scope"],
105
+ "properties": {
106
+ "name": { "type": "string" },
107
+ "abbreviation": { "type": "string" },
108
+ "url": { "type": "string" },
109
+ "scope": { "type": "string" }
110
+ }
111
+ },
112
+ "resourceLink": {
113
+ "type": "object",
114
+ "required": ["type", "name", "link_relation"],
115
+ "properties": {
116
+ "type": { "type": "string" },
117
+ "name": { "type": "string" },
118
+ "media_type": { "type": ["string", "null"] },
119
+ "link_relation": { "type": "string" },
120
+ "url": { "type": ["string", "null"] }
121
+ }
122
+ },
123
+ "subject": {
124
+ "type": "object",
125
+ "required": ["type", "name"],
126
+ "properties": {
127
+ "type": { "type": "string" },
128
+ "name": { "type": "string" },
129
+ "identifier": { "type": ["string", "null"] }
130
+ }
131
+ },
132
+ "revision": {
133
+ "type": "object",
134
+ "properties": {
135
+ "date": { "type": ["string", "null"] },
136
+ "summary": { "type": ["string", "null"] }
137
+ }
138
+ }
139
+ }
140
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "References Schema",
4
+ "type": "object",
5
+ "required": [
6
+ "entries"
7
+ ],
8
+ "properties": {
9
+ "entries": {
10
+ "type": "array",
11
+ "items": {
12
+ "type": "object",
13
+ "properties": {
14
+ "id": {
15
+ "type": "string"
16
+ },
17
+ "full": {
18
+ "type": "string"
19
+ }
20
+ },
21
+ "required": [
22
+ "full",
23
+ "id"
24
+ ]
25
+ },
26
+ "minItems": 0
27
+ }
28
+ }
29
+ }