@dokebi/cli 0.4.1 → 0.4.26

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 (188) hide show
  1. package/AI.md +262 -57
  2. package/README.md +35 -10
  3. package/catalog.json +2519 -257
  4. package/describe.schema.json +748 -0
  5. package/dist/api-app.d.ts +2 -0
  6. package/dist/api-app.js +35 -0
  7. package/dist/app-urls.js +3 -2
  8. package/dist/bin.js +527 -35
  9. package/dist/capability-guide.d.ts +30 -0
  10. package/dist/capability-guide.js +122 -0
  11. package/dist/catalog.d.ts +16 -2
  12. package/dist/catalog.js +19 -7
  13. package/dist/check/asset-rules.d.ts +6 -0
  14. package/dist/check/asset-rules.js +163 -0
  15. package/dist/check/browser-sources.d.ts +20 -0
  16. package/dist/check/browser-sources.js +89 -0
  17. package/dist/check/console-rules.d.ts +6 -0
  18. package/dist/check/console-rules.js +40 -0
  19. package/dist/check/error-rules.d.ts +21 -0
  20. package/dist/check/error-rules.js +212 -0
  21. package/dist/check/form-rules.d.ts +12 -0
  22. package/dist/check/form-rules.js +69 -6
  23. package/dist/check/formatter-rules.d.ts +2 -0
  24. package/dist/check/formatter-rules.js +71 -0
  25. package/dist/check/i18n-rules.d.ts +27 -0
  26. package/dist/check/i18n-rules.js +353 -0
  27. package/dist/check/index.d.ts +15 -1
  28. package/dist/check/index.js +89 -11
  29. package/dist/check/mail-rules.d.ts +4 -0
  30. package/dist/check/mail-rules.js +72 -0
  31. package/dist/check/module-rules.d.ts +13 -0
  32. package/dist/check/module-rules.js +104 -0
  33. package/dist/check/packages.d.ts +8 -0
  34. package/dist/check/packages.js +16 -0
  35. package/dist/check/pool-rules.d.ts +8 -0
  36. package/dist/check/pool-rules.js +164 -0
  37. package/dist/check/problems.d.ts +6 -1
  38. package/dist/check/problems.js +100 -2
  39. package/dist/check/project-rules.d.ts +23 -3
  40. package/dist/check/project-rules.js +265 -23
  41. package/dist/check/seal-rules.d.ts +6 -0
  42. package/dist/check/seal-rules.js +68 -0
  43. package/dist/check/security-rules.d.ts +10 -0
  44. package/dist/check/security-rules.js +450 -0
  45. package/dist/check/shared-state-rules.d.ts +2 -0
  46. package/dist/check/shared-state-rules.js +114 -0
  47. package/dist/check/source-rules.d.ts +26 -3
  48. package/dist/check/source-rules.js +249 -28
  49. package/dist/check/structure-rules.d.ts +23 -0
  50. package/dist/check/structure-rules.js +502 -0
  51. package/dist/check/timer-rules.d.ts +7 -0
  52. package/dist/check/timer-rules.js +543 -0
  53. package/dist/check/typescript.d.ts +35 -5
  54. package/dist/check/typescript.js +163 -17
  55. package/dist/check/vite-rules.d.ts +2 -0
  56. package/dist/check/vite-rules.js +136 -0
  57. package/dist/check/wait-rules.d.ts +16 -0
  58. package/dist/check/wait-rules.js +337 -0
  59. package/dist/commands.d.ts +7 -0
  60. package/dist/commands.js +307 -31
  61. package/dist/config-diff.d.ts +42 -0
  62. package/dist/config-diff.js +289 -0
  63. package/dist/config-edit.d.ts +35 -2
  64. package/dist/config-edit.js +145 -13
  65. package/dist/config-init.d.ts +15 -0
  66. package/dist/config-init.js +61 -0
  67. package/dist/config-paths.d.ts +22 -0
  68. package/dist/config-paths.js +82 -0
  69. package/dist/config-show.d.ts +82 -0
  70. package/dist/config-show.js +563 -0
  71. package/dist/config-values.d.ts +8 -0
  72. package/dist/config-values.js +68 -0
  73. package/dist/configuration-scaffold.d.ts +42 -0
  74. package/dist/configuration-scaffold.js +258 -4
  75. package/dist/configuration.d.ts +63 -3
  76. package/dist/configuration.js +178 -4
  77. package/dist/deployment.d.ts +2 -0
  78. package/dist/deployment.js +111 -0
  79. package/dist/describe-db.d.ts +22 -0
  80. package/dist/describe-db.js +176 -0
  81. package/dist/describe.d.ts +92 -0
  82. package/dist/describe.js +417 -0
  83. package/dist/dev-compose.d.ts +20 -0
  84. package/dist/dev-compose.js +154 -0
  85. package/dist/dev-guard.js +44 -0
  86. package/dist/dev-host.d.ts +13 -0
  87. package/dist/dev-host.js +55 -0
  88. package/dist/dev-infra.d.ts +72 -4
  89. package/dist/dev-infra.js +237 -17
  90. package/dist/dev-watch.d.ts +34 -0
  91. package/dist/dev-watch.js +192 -0
  92. package/dist/diagnostics.d.ts +10 -7
  93. package/dist/diagnostics.js +22 -4
  94. package/dist/drift.d.ts +50 -0
  95. package/dist/drift.js +218 -0
  96. package/dist/env-file.d.ts +25 -1
  97. package/dist/env-file.js +64 -6
  98. package/dist/errors.d.ts +7 -1
  99. package/dist/example-config.d.ts +2 -0
  100. package/dist/example-config.js +3 -0
  101. package/dist/first-admin.d.ts +43 -0
  102. package/dist/first-admin.js +175 -0
  103. package/dist/formatter-ignore.d.ts +37 -0
  104. package/dist/formatter-ignore.js +344 -0
  105. package/dist/generator.d.ts +45 -3
  106. package/dist/generator.js +205 -15
  107. package/dist/guide.d.ts +1 -1
  108. package/dist/guide.js +42 -21
  109. package/dist/install-module.d.ts +29 -3
  110. package/dist/install-module.js +142 -13
  111. package/dist/install-plan.js +5 -3
  112. package/dist/layout.d.ts +12 -1
  113. package/dist/layout.js +19 -6
  114. package/dist/log-writer-control.d.ts +2 -0
  115. package/dist/log-writer-control.js +106 -27
  116. package/dist/log-writer.js +43 -10
  117. package/dist/logging-config.d.ts +8 -3
  118. package/dist/logging-config.js +19 -5
  119. package/dist/manifest.d.ts +29 -1
  120. package/dist/manifest.js +84 -6
  121. package/dist/merge-install-defaults.d.ts +0 -1
  122. package/dist/merge-install-defaults.js +13 -47
  123. package/dist/npm-client.d.ts +59 -4
  124. package/dist/npm-client.js +220 -16
  125. package/dist/npm-paths.js +18 -4
  126. package/dist/openapi.d.ts +27 -0
  127. package/dist/openapi.js +649 -0
  128. package/dist/option-fixes.d.ts +39 -0
  129. package/dist/option-fixes.js +130 -0
  130. package/dist/output.d.ts +1 -1
  131. package/dist/output.js +5 -5
  132. package/dist/plugin-lifecycle.d.ts +34 -2
  133. package/dist/plugin-lifecycle.js +206 -20
  134. package/dist/plugin-options.d.ts +19 -4
  135. package/dist/plugin-options.js +138 -6
  136. package/dist/plugins-command.js +44 -7
  137. package/dist/process-group.d.ts +39 -0
  138. package/dist/process-group.js +132 -0
  139. package/dist/project-guide.d.ts +19 -1
  140. package/dist/project-guide.js +119 -20
  141. package/dist/project-inspector.d.ts +15 -0
  142. package/dist/project-inspector.js +481 -33
  143. package/dist/project-state.d.ts +5 -0
  144. package/dist/project-state.js +8 -0
  145. package/dist/project.d.ts +203 -19
  146. package/dist/project.js +3016 -336
  147. package/dist/recipe-facts.d.ts +127 -0
  148. package/dist/recipe-facts.js +563 -0
  149. package/dist/recipe-login.d.ts +63 -0
  150. package/dist/recipe-login.js +464 -0
  151. package/dist/recipe-mail.d.ts +21 -0
  152. package/dist/recipe-mail.js +214 -0
  153. package/dist/recipe-members.d.ts +35 -0
  154. package/dist/recipe-members.js +178 -0
  155. package/dist/recipe-record.d.ts +82 -7
  156. package/dist/recipe-record.js +226 -22
  157. package/dist/recipe-reset.d.ts +2 -0
  158. package/dist/recipe-reset.js +117 -0
  159. package/dist/recipe-site.d.ts +48 -0
  160. package/dist/recipe-site.js +396 -0
  161. package/dist/recipe-step.d.ts +42 -0
  162. package/dist/recipe-step.js +89 -0
  163. package/dist/recipe.d.ts +56 -20
  164. package/dist/recipe.js +703 -131
  165. package/dist/registry.d.ts +98 -2
  166. package/dist/registry.js +171 -5
  167. package/dist/reloadable.d.ts +35 -0
  168. package/dist/reloadable.js +257 -0
  169. package/dist/server.d.ts +50 -4
  170. package/dist/server.js +790 -103
  171. package/dist/settings.d.ts +48 -0
  172. package/dist/settings.js +168 -0
  173. package/dist/site-auth.d.ts +39 -0
  174. package/dist/site-auth.js +195 -0
  175. package/dist/template-fixes.d.ts +26 -0
  176. package/dist/template-fixes.js +285 -0
  177. package/dist/test-reporter.d.ts +49 -0
  178. package/dist/test-reporter.js +190 -0
  179. package/dist/transaction.d.ts +67 -0
  180. package/dist/transaction.js +428 -46
  181. package/dist/verify-tests.d.ts +98 -0
  182. package/dist/verify-tests.js +449 -0
  183. package/dist/verify.d.ts +113 -4
  184. package/dist/verify.js +326 -28
  185. package/dist/view-choice.d.ts +58 -0
  186. package/dist/view-choice.js +131 -0
  187. package/dist/vite-watch.js +4 -2
  188. package/package.json +8 -6
@@ -0,0 +1,748 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://dokebi.dev/schemas/cli/describe.schema.json",
4
+ "title": "dokebi describe --json result",
5
+ "description": "The result field of the `dokebi describe --json` envelope (D-0077 B), schemaVersion 1. Names only: no value of an option, a secret or an environment variable.",
6
+ "type": "object",
7
+ "required": [
8
+ "schemaVersion",
9
+ "app",
10
+ "routes",
11
+ "pages",
12
+ "jobs",
13
+ "schedules",
14
+ "errors",
15
+ "config",
16
+ "db",
17
+ "unavailable",
18
+ "ms"
19
+ ],
20
+ "additionalProperties": false,
21
+ "properties": {
22
+ "schemaVersion": {
23
+ "const": 1
24
+ },
25
+ "app": {
26
+ "type": "object",
27
+ "description": "The project: its plugins and every object section plugins gave (apps and domains of dokebi-app, web, session, auth, csrf, redis, nats, ...).",
28
+ "required": ["name", "core", "plugins"],
29
+ "properties": {
30
+ "name": {
31
+ "type": ["string", "null"]
32
+ },
33
+ "core": {
34
+ "type": "string"
35
+ },
36
+ "plugins": {
37
+ "type": "array",
38
+ "items": {
39
+ "type": "object",
40
+ "required": ["name", "version", "described"],
41
+ "additionalProperties": false,
42
+ "properties": {
43
+ "name": {
44
+ "type": "string"
45
+ },
46
+ "version": {
47
+ "type": "string"
48
+ },
49
+ "described": {
50
+ "type": "boolean"
51
+ },
52
+ "contributes": {
53
+ "type": "array",
54
+ "description": "Contribution points the plugin (or module) contributes to, when it declares any (D-0130)",
55
+ "items": { "type": "string" }
56
+ },
57
+ "collects": {
58
+ "type": "array",
59
+ "description": "Contribution points the plugin collects, when it declares any",
60
+ "items": { "type": "string" }
61
+ }
62
+ }
63
+ }
64
+ },
65
+ "apps": {
66
+ "type": "array",
67
+ "items": {
68
+ "type": "object",
69
+ "required": [
70
+ "name",
71
+ "engine",
72
+ "views",
73
+ "templates",
74
+ "modules",
75
+ "requires",
76
+ "namespaces"
77
+ ],
78
+ "additionalProperties": false,
79
+ "properties": {
80
+ "name": {
81
+ "type": "string"
82
+ },
83
+ "engine": {
84
+ "enum": ["ejs", "inertia", null]
85
+ },
86
+ "views": {
87
+ "type": ["string", "null"]
88
+ },
89
+ "templates": {
90
+ "type": "array",
91
+ "items": {
92
+ "type": "string"
93
+ }
94
+ },
95
+ "modules": {
96
+ "type": "array",
97
+ "items": {
98
+ "type": "object",
99
+ "required": ["prefix", "module"],
100
+ "additionalProperties": false,
101
+ "properties": {
102
+ "prefix": {
103
+ "type": "string"
104
+ },
105
+ "module": {
106
+ "type": "string"
107
+ }
108
+ }
109
+ }
110
+ },
111
+ "requires": {
112
+ "type": "array",
113
+ "items": {
114
+ "type": "string"
115
+ }
116
+ },
117
+ "namespaces": {
118
+ "type": "array",
119
+ "items": {
120
+ "type": "string"
121
+ }
122
+ }
123
+ }
124
+ }
125
+ },
126
+ "domains": {
127
+ "type": "array",
128
+ "items": {
129
+ "type": "object",
130
+ "required": ["host", "app", "template", "seal"],
131
+ "additionalProperties": false,
132
+ "properties": {
133
+ "host": {
134
+ "type": "string"
135
+ },
136
+ "app": {
137
+ "type": "string"
138
+ },
139
+ "template": {
140
+ "type": "string"
141
+ },
142
+ "seal": {
143
+ "type": "boolean"
144
+ }
145
+ }
146
+ }
147
+ },
148
+ "unknownDomain": {
149
+ "type": "string"
150
+ }
151
+ }
152
+ },
153
+ "routes": {
154
+ "type": "array",
155
+ "items": {
156
+ "type": "object",
157
+ "required": ["method", "url"],
158
+ "additionalProperties": false,
159
+ "properties": {
160
+ "method": {
161
+ "type": "string",
162
+ "description": "GET, POST, ... (several joined with commas)"
163
+ },
164
+ "url": {
165
+ "type": "string"
166
+ },
167
+ "id": {
168
+ "type": "string",
169
+ "description": "The route's config.id"
170
+ },
171
+ "app": {
172
+ "type": "string",
173
+ "description": "The dokebi-app app the route belongs to"
174
+ },
175
+ "host": {
176
+ "type": "string",
177
+ "description": "A Fastify host constraint"
178
+ },
179
+ "constraints": {
180
+ "type": "object"
181
+ },
182
+ "schema": {
183
+ "type": "object",
184
+ "additionalProperties": false,
185
+ "properties": {
186
+ "body": {},
187
+ "querystring": {},
188
+ "params": {},
189
+ "headers": {},
190
+ "response": {}
191
+ }
192
+ },
193
+ "config": {
194
+ "type": "object",
195
+ "description": "Route config keys other plugins read: auth, can, roles, csrf, ..."
196
+ },
197
+ "auth": {
198
+ "type": "object",
199
+ "description": "The effective login rule of dokebi-auth: mode (required, optional, guest, off), realm, via, can, roles",
200
+ "required": ["mode", "realm"],
201
+ "properties": {
202
+ "mode": { "enum": ["required", "optional", "guest", "off"] },
203
+ "realm": { "type": "string" },
204
+ "via": { "type": "string" },
205
+ "can": { "type": "string" },
206
+ "roles": {
207
+ "type": "array",
208
+ "items": { "type": "string" },
209
+ "description": "config.roles: any one of these roles is needed"
210
+ }
211
+ }
212
+ },
213
+ "seal": {
214
+ "enum": [true, false, "function"]
215
+ },
216
+ "health": {
217
+ "const": true
218
+ },
219
+ "plugin": {
220
+ "type": "string",
221
+ "description": "The plugin that added the route itself (D-0142), for example dokebi-mcp; absent on the app's own routes"
222
+ }
223
+ }
224
+ }
225
+ },
226
+ "pages": {
227
+ "type": "array",
228
+ "items": {
229
+ "type": "object",
230
+ "required": ["app", "engine", "template", "name", "file"],
231
+ "additionalProperties": false,
232
+ "properties": {
233
+ "app": {
234
+ "type": "string"
235
+ },
236
+ "engine": {
237
+ "enum": ["ejs", "inertia"]
238
+ },
239
+ "template": {
240
+ "type": "string"
241
+ },
242
+ "name": {
243
+ "type": "string"
244
+ },
245
+ "file": {
246
+ "type": "string"
247
+ }
248
+ }
249
+ }
250
+ },
251
+ "jobs": {
252
+ "type": "array",
253
+ "items": {
254
+ "type": "object",
255
+ "required": ["queue", "connection", "stream", "consumer", "subject", "types"],
256
+ "properties": {
257
+ "queue": {
258
+ "type": "string"
259
+ },
260
+ "connection": {
261
+ "type": "string"
262
+ },
263
+ "stream": {
264
+ "type": "string"
265
+ },
266
+ "consumer": {
267
+ "type": "string"
268
+ },
269
+ "subject": {
270
+ "type": "string"
271
+ },
272
+ "types": {
273
+ "type": "array",
274
+ "items": {
275
+ "type": "string"
276
+ }
277
+ }
278
+ }
279
+ }
280
+ },
281
+ "schedules": {
282
+ "type": "array",
283
+ "items": {
284
+ "type": "object",
285
+ "required": ["name", "queue", "type", "mode"],
286
+ "properties": {
287
+ "name": {
288
+ "type": "string"
289
+ },
290
+ "id": {
291
+ "type": "string"
292
+ },
293
+ "queue": {
294
+ "type": "string"
295
+ },
296
+ "type": {
297
+ "type": "string"
298
+ },
299
+ "cron": {
300
+ "type": "string"
301
+ },
302
+ "timezone": {
303
+ "type": "string"
304
+ },
305
+ "intervalMs": {
306
+ "type": "integer"
307
+ },
308
+ "mode": {
309
+ "enum": ["local", "distributed"]
310
+ }
311
+ }
312
+ }
313
+ },
314
+ "errors": {
315
+ "type": "array",
316
+ "description": "The error codes of src/shared/errors.ts (errorCatalog of @dokebi/web over its defineErrors results)",
317
+ "items": {
318
+ "type": "object",
319
+ "required": ["code", "status", "message"],
320
+ "additionalProperties": false,
321
+ "properties": {
322
+ "code": {
323
+ "type": "string"
324
+ },
325
+ "status": {
326
+ "type": "number"
327
+ },
328
+ "message": {
329
+ "type": "string"
330
+ },
331
+ "hint": {
332
+ "type": "string"
333
+ }
334
+ }
335
+ }
336
+ },
337
+ "config": {
338
+ "type": "object",
339
+ "required": ["keys", "env"],
340
+ "additionalProperties": false,
341
+ "properties": {
342
+ "keys": {
343
+ "type": "array",
344
+ "description": "Every option path set in dokebi.yaml (dokebi-web.port), never a value",
345
+ "items": {
346
+ "type": "string"
347
+ }
348
+ },
349
+ "env": {
350
+ "type": "array",
351
+ "description": "Environment variables the app and its plugins read, by name",
352
+ "items": {
353
+ "type": "object",
354
+ "required": ["name", "plugin"],
355
+ "properties": {
356
+ "name": {
357
+ "type": "string"
358
+ },
359
+ "plugin": {
360
+ "type": "string"
361
+ },
362
+ "purpose": {
363
+ "type": "string"
364
+ }
365
+ }
366
+ }
367
+ }
368
+ }
369
+ },
370
+ "db": {
371
+ "type": "object",
372
+ "description": "The dokebi-db connections. Without --with-db: names and adapters, and unavailable says the tables were not read (describe mode never connects). With --with-db: each connection with the shape dokebi-migrate schema read (D-0077 F), or its own unavailable reason.",
373
+ "additionalProperties": false,
374
+ "properties": {
375
+ "connections": {
376
+ "type": "array",
377
+ "items": {
378
+ "$ref": "#/$defs/dbConnection"
379
+ }
380
+ },
381
+ "unavailable": {
382
+ "type": "string"
383
+ }
384
+ }
385
+ },
386
+ "unavailable": {
387
+ "type": "array",
388
+ "description": "Plugins (or one part of a plugin) that could not be described, and why",
389
+ "items": {
390
+ "type": "object",
391
+ "required": ["plugin", "code", "reason"],
392
+ "additionalProperties": false,
393
+ "properties": {
394
+ "plugin": {
395
+ "type": "string"
396
+ },
397
+ "section": {
398
+ "type": "string"
399
+ },
400
+ "code": {
401
+ "type": "string"
402
+ },
403
+ "reason": {
404
+ "type": "string"
405
+ }
406
+ }
407
+ }
408
+ },
409
+ "warnings": {
410
+ "type": "array",
411
+ "items": {
412
+ "type": "object",
413
+ "required": ["code", "message"],
414
+ "additionalProperties": false,
415
+ "properties": {
416
+ "code": {
417
+ "type": "string"
418
+ },
419
+ "message": {
420
+ "type": "string"
421
+ }
422
+ }
423
+ }
424
+ },
425
+ "ms": {
426
+ "type": "integer",
427
+ "minimum": 0
428
+ }
429
+ },
430
+ "$defs": {
431
+ "dbConnection": {
432
+ "type": "object",
433
+ "required": ["name", "adapter"],
434
+ "additionalProperties": false,
435
+ "properties": {
436
+ "name": {
437
+ "type": "string"
438
+ },
439
+ "adapter": {
440
+ "type": "string"
441
+ },
442
+ "startup": {
443
+ "description": "D-0127: present (optional) only when dokebi.yaml sets startup: optional; the default required is left out",
444
+ "enum": ["optional"]
445
+ },
446
+ "dialect": {
447
+ "enum": ["postgres", "mysql", "mariadb", "mongodb"]
448
+ },
449
+ "schemas": {
450
+ "type": "array",
451
+ "items": {
452
+ "type": "string"
453
+ }
454
+ },
455
+ "tables": {
456
+ "type": "array",
457
+ "items": {
458
+ "$ref": "#/$defs/table"
459
+ }
460
+ },
461
+ "collections": {
462
+ "type": "array",
463
+ "items": {
464
+ "$ref": "#/$defs/collection"
465
+ }
466
+ },
467
+ "unavailable": {
468
+ "type": "string",
469
+ "description": "Why this connection's shape could not be read (not listed in options.dokebi-migrate.connections, @dokebi/migrate missing, the database refused, a timeout); never a URL or password"
470
+ }
471
+ }
472
+ },
473
+ "table": {
474
+ "type": "object",
475
+ "required": ["name", "columns", "primaryKey", "unique", "indexes", "foreignKeys", "checks"],
476
+ "additionalProperties": false,
477
+ "properties": {
478
+ "schema": {
479
+ "type": "string",
480
+ "description": "PostgreSQL only"
481
+ },
482
+ "name": {
483
+ "type": "string"
484
+ },
485
+ "isMigrationHistory": {
486
+ "const": true,
487
+ "description": "The dokebi-migrate history table (dokebi_migrations); never edit it by hand"
488
+ },
489
+ "engine": {
490
+ "type": "string",
491
+ "description": "MySQL and MariaDB"
492
+ },
493
+ "collation": {
494
+ "type": "string",
495
+ "description": "MySQL and MariaDB: the table default"
496
+ },
497
+ "comment": {
498
+ "type": "string"
499
+ },
500
+ "columns": {
501
+ "type": "array",
502
+ "items": {
503
+ "$ref": "#/$defs/column"
504
+ }
505
+ },
506
+ "primaryKey": {
507
+ "oneOf": [
508
+ {
509
+ "$ref": "#/$defs/key"
510
+ },
511
+ {
512
+ "type": "null"
513
+ }
514
+ ]
515
+ },
516
+ "unique": {
517
+ "type": "array",
518
+ "items": {
519
+ "$ref": "#/$defs/key"
520
+ }
521
+ },
522
+ "indexes": {
523
+ "type": "array",
524
+ "description": "Indexes that do not back the primary key or a unique constraint",
525
+ "items": {
526
+ "$ref": "#/$defs/index"
527
+ }
528
+ },
529
+ "foreignKeys": {
530
+ "type": "array",
531
+ "items": {
532
+ "$ref": "#/$defs/foreignKey"
533
+ }
534
+ },
535
+ "checks": {
536
+ "type": "array",
537
+ "items": {
538
+ "type": "object",
539
+ "required": ["name", "expression"],
540
+ "additionalProperties": false,
541
+ "properties": {
542
+ "name": {
543
+ "type": "string"
544
+ },
545
+ "expression": {
546
+ "type": "string",
547
+ "description": "As the database prints it"
548
+ }
549
+ }
550
+ }
551
+ }
552
+ }
553
+ },
554
+ "column": {
555
+ "type": "object",
556
+ "required": ["name", "type", "nullable"],
557
+ "additionalProperties": false,
558
+ "properties": {
559
+ "name": {
560
+ "type": "string"
561
+ },
562
+ "type": {
563
+ "type": "string",
564
+ "description": "As the database prints it, with length or precision (character varying(190), int, decimal(10,2))"
565
+ },
566
+ "nullable": {
567
+ "type": "boolean"
568
+ },
569
+ "default": {
570
+ "type": "string",
571
+ "description": "The default as an SQL expression ('author', now(), CURRENT_TIMESTAMP); absent when there is none"
572
+ },
573
+ "identity": {
574
+ "enum": ["always", "byDefault"],
575
+ "description": "PostgreSQL identity"
576
+ },
577
+ "autoIncrement": {
578
+ "const": true,
579
+ "description": "MySQL and MariaDB"
580
+ },
581
+ "generated": {
582
+ "type": "object",
583
+ "required": ["expression", "stored"],
584
+ "additionalProperties": false,
585
+ "properties": {
586
+ "expression": {
587
+ "type": "string"
588
+ },
589
+ "stored": {
590
+ "type": "boolean"
591
+ }
592
+ }
593
+ },
594
+ "comment": {
595
+ "type": "string"
596
+ }
597
+ }
598
+ },
599
+ "key": {
600
+ "type": "object",
601
+ "required": ["name", "columns"],
602
+ "additionalProperties": false,
603
+ "properties": {
604
+ "name": {
605
+ "type": "string"
606
+ },
607
+ "columns": {
608
+ "type": "array",
609
+ "items": {
610
+ "type": "string"
611
+ }
612
+ }
613
+ }
614
+ },
615
+ "index": {
616
+ "type": "object",
617
+ "required": ["name", "columns", "unique", "method"],
618
+ "additionalProperties": false,
619
+ "properties": {
620
+ "name": {
621
+ "type": "string"
622
+ },
623
+ "columns": {
624
+ "type": "array",
625
+ "description": "Column names, or the expression of an expression index",
626
+ "items": {
627
+ "type": "string"
628
+ }
629
+ },
630
+ "unique": {
631
+ "type": "boolean"
632
+ },
633
+ "method": {
634
+ "type": "string",
635
+ "description": "btree, hash, gin, ... (PostgreSQL); BTREE, FULLTEXT, SPATIAL, HASH (MySQL, MariaDB)"
636
+ },
637
+ "where": {
638
+ "type": "string",
639
+ "description": "PostgreSQL partial index predicate"
640
+ }
641
+ }
642
+ },
643
+ "foreignKey": {
644
+ "type": "object",
645
+ "required": ["name", "columns", "references", "onDelete", "onUpdate"],
646
+ "additionalProperties": false,
647
+ "properties": {
648
+ "name": {
649
+ "type": "string"
650
+ },
651
+ "columns": {
652
+ "type": "array",
653
+ "items": {
654
+ "type": "string"
655
+ }
656
+ },
657
+ "references": {
658
+ "type": "object",
659
+ "required": ["table", "columns"],
660
+ "additionalProperties": false,
661
+ "properties": {
662
+ "schema": {
663
+ "type": "string",
664
+ "description": "PostgreSQL always; MySQL and MariaDB only for another database"
665
+ },
666
+ "table": {
667
+ "type": "string"
668
+ },
669
+ "columns": {
670
+ "type": "array",
671
+ "items": {
672
+ "type": "string"
673
+ }
674
+ }
675
+ }
676
+ },
677
+ "onDelete": {
678
+ "$ref": "#/$defs/action"
679
+ },
680
+ "onUpdate": {
681
+ "$ref": "#/$defs/action"
682
+ }
683
+ }
684
+ },
685
+ "action": {
686
+ "enum": ["NO ACTION", "RESTRICT", "CASCADE", "SET NULL", "SET DEFAULT"]
687
+ },
688
+ "collection": {
689
+ "type": "object",
690
+ "required": ["name", "indexes"],
691
+ "additionalProperties": false,
692
+ "properties": {
693
+ "name": {
694
+ "type": "string"
695
+ },
696
+ "type": {
697
+ "const": "timeseries"
698
+ },
699
+ "isMigrationHistory": {
700
+ "const": true,
701
+ "description": "dokebi_migrations and its lock collection dokebi_migrations_lock"
702
+ },
703
+ "capped": {
704
+ "const": true
705
+ },
706
+ "jsonSchema": {
707
+ "type": "object",
708
+ "description": "The $jsonSchema of the collection validator, when it has one"
709
+ },
710
+ "validationLevel": {
711
+ "type": "string"
712
+ },
713
+ "validationAction": {
714
+ "type": "string"
715
+ },
716
+ "indexes": {
717
+ "type": "array",
718
+ "items": {
719
+ "type": "object",
720
+ "required": ["name", "key", "unique"],
721
+ "additionalProperties": false,
722
+ "properties": {
723
+ "name": {
724
+ "type": "string"
725
+ },
726
+ "key": {
727
+ "type": "object",
728
+ "description": "The index key as MongoDB keeps it ({ field: 1 | -1 | 'text' | ... })"
729
+ },
730
+ "unique": {
731
+ "type": "boolean"
732
+ },
733
+ "sparse": {
734
+ "const": true
735
+ },
736
+ "expireAfterSeconds": {
737
+ "type": "number"
738
+ },
739
+ "partialFilterExpression": {
740
+ "type": "object"
741
+ }
742
+ }
743
+ }
744
+ }
745
+ }
746
+ }
747
+ }
748
+ }