@intentius/sql-yodeler 0.0.0-stage → 0.2.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 (324) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +112 -2
  3. package/dist/bin.d.ts +2 -0
  4. package/dist/bin.js +29 -0
  5. package/dist/bin.js.map +1 -0
  6. package/dist/chant/apply.d.ts +59 -0
  7. package/dist/chant/apply.js +116 -0
  8. package/dist/chant/apply.js.map +1 -0
  9. package/dist/chant/build.d.ts +34 -0
  10. package/dist/chant/build.js +48 -0
  11. package/dist/chant/build.js.map +1 -0
  12. package/dist/chant/drift.d.ts +112 -0
  13. package/dist/chant/drift.js +238 -0
  14. package/dist/chant/drift.js.map +1 -0
  15. package/dist/chant/plan.d.ts +45 -0
  16. package/dist/chant/plan.js +61 -0
  17. package/dist/chant/plan.js.map +1 -0
  18. package/dist/chant/process.d.ts +41 -0
  19. package/dist/chant/process.js +87 -0
  20. package/dist/chant/process.js.map +1 -0
  21. package/dist/chant/runnable.d.ts +19 -0
  22. package/dist/chant/runnable.js +47 -0
  23. package/dist/chant/runnable.js.map +1 -0
  24. package/dist/cli.d.ts +8 -0
  25. package/dist/cli.js +99 -0
  26. package/dist/cli.js.map +1 -0
  27. package/dist/command.d.ts +23 -0
  28. package/dist/command.js +13 -0
  29. package/dist/command.js.map +1 -0
  30. package/dist/commands/apply.d.ts +3 -0
  31. package/dist/commands/apply.js +426 -0
  32. package/dist/commands/apply.js.map +1 -0
  33. package/dist/commands/approve.d.ts +5 -0
  34. package/dist/commands/approve.js +111 -0
  35. package/dist/commands/approve.js.map +1 -0
  36. package/dist/commands/drift.d.ts +14 -0
  37. package/dist/commands/drift.js +267 -0
  38. package/dist/commands/drift.js.map +1 -0
  39. package/dist/commands/index.d.ts +3 -0
  40. package/dist/commands/index.js +28 -0
  41. package/dist/commands/index.js.map +1 -0
  42. package/dist/commands/init.d.ts +6 -0
  43. package/dist/commands/init.js +139 -0
  44. package/dist/commands/init.js.map +1 -0
  45. package/dist/commands/lint.d.ts +3 -0
  46. package/dist/commands/lint.js +202 -0
  47. package/dist/commands/lint.js.map +1 -0
  48. package/dist/commands/mcp.d.ts +3 -0
  49. package/dist/commands/mcp.js +50 -0
  50. package/dist/commands/mcp.js.map +1 -0
  51. package/dist/commands/new.d.ts +5 -0
  52. package/dist/commands/new.js +292 -0
  53. package/dist/commands/new.js.map +1 -0
  54. package/dist/commands/override.d.ts +3 -0
  55. package/dist/commands/override.js +118 -0
  56. package/dist/commands/override.js.map +1 -0
  57. package/dist/commands/plan.d.ts +3 -0
  58. package/dist/commands/plan.js +183 -0
  59. package/dist/commands/plan.js.map +1 -0
  60. package/dist/commands/rebase.d.ts +3 -0
  61. package/dist/commands/rebase.js +167 -0
  62. package/dist/commands/rebase.js.map +1 -0
  63. package/dist/commands/repair.d.ts +14 -0
  64. package/dist/commands/repair.js +125 -0
  65. package/dist/commands/repair.js.map +1 -0
  66. package/dist/commands/status.d.ts +7 -0
  67. package/dist/commands/status.js +54 -0
  68. package/dist/commands/status.js.map +1 -0
  69. package/dist/config/define.d.ts +148 -0
  70. package/dist/config/define.js +20 -0
  71. package/dist/config/define.js.map +1 -0
  72. package/dist/config/index.d.ts +11 -0
  73. package/dist/config/index.js +12 -0
  74. package/dist/config/index.js.map +1 -0
  75. package/dist/config/load.d.ts +17 -0
  76. package/dist/config/load.js +162 -0
  77. package/dist/config/load.js.map +1 -0
  78. package/dist/config/settings.d.ts +53 -0
  79. package/dist/config/settings.js +116 -0
  80. package/dist/config/settings.js.map +1 -0
  81. package/dist/env-args.d.ts +24 -0
  82. package/dist/env-args.js +92 -0
  83. package/dist/env-args.js.map +1 -0
  84. package/dist/exit.d.ts +20 -0
  85. package/dist/exit.js +28 -0
  86. package/dist/exit.js.map +1 -0
  87. package/dist/history/client.d.ts +25 -0
  88. package/dist/history/client.js +42 -0
  89. package/dist/history/client.js.map +1 -0
  90. package/dist/history/ddl.d.ts +58 -0
  91. package/dist/history/ddl.js +100 -0
  92. package/dist/history/ddl.js.map +1 -0
  93. package/dist/history/index.d.ts +25 -0
  94. package/dist/history/index.js +26 -0
  95. package/dist/history/index.js.map +1 -0
  96. package/dist/history/lock.d.ts +104 -0
  97. package/dist/history/lock.js +230 -0
  98. package/dist/history/lock.js.map +1 -0
  99. package/dist/history/postgres/ddl.d.ts +22 -0
  100. package/dist/history/postgres/ddl.js +47 -0
  101. package/dist/history/postgres/ddl.js.map +1 -0
  102. package/dist/history/postgres/index.d.ts +12 -0
  103. package/dist/history/postgres/index.js +13 -0
  104. package/dist/history/postgres/index.js.map +1 -0
  105. package/dist/history/postgres/lock.d.ts +48 -0
  106. package/dist/history/postgres/lock.js +95 -0
  107. package/dist/history/postgres/lock.js.map +1 -0
  108. package/dist/history/postgres/store.d.ts +39 -0
  109. package/dist/history/postgres/store.js +68 -0
  110. package/dist/history/postgres/store.js.map +1 -0
  111. package/dist/history/rows.d.ts +96 -0
  112. package/dist/history/rows.js +73 -0
  113. package/dist/history/rows.js.map +1 -0
  114. package/dist/history/store.d.ts +72 -0
  115. package/dist/history/store.js +134 -0
  116. package/dist/history/store.js.map +1 -0
  117. package/dist/history/topology.d.ts +41 -0
  118. package/dist/history/topology.js +54 -0
  119. package/dist/history/topology.js.map +1 -0
  120. package/dist/index.d.ts +10 -0
  121. package/dist/index.js +10 -0
  122. package/dist/index.js.map +1 -0
  123. package/dist/init/adopt.d.ts +70 -0
  124. package/dist/init/adopt.js +143 -0
  125. package/dist/init/adopt.js.map +1 -0
  126. package/dist/init/baseline.d.ts +61 -0
  127. package/dist/init/baseline.js +88 -0
  128. package/dist/init/baseline.js.map +1 -0
  129. package/dist/init/files.d.ts +23 -0
  130. package/dist/init/files.js +77 -0
  131. package/dist/init/files.js.map +1 -0
  132. package/dist/init/index.d.ts +16 -0
  133. package/dist/init/index.js +17 -0
  134. package/dist/init/index.js.map +1 -0
  135. package/dist/init/live.d.ts +39 -0
  136. package/dist/init/live.js +68 -0
  137. package/dist/init/live.js.map +1 -0
  138. package/dist/lint/check.d.ts +88 -0
  139. package/dist/lint/check.js +227 -0
  140. package/dist/lint/check.js.map +1 -0
  141. package/dist/lint/config.d.ts +21 -0
  142. package/dist/lint/config.js +43 -0
  143. package/dist/lint/config.js.map +1 -0
  144. package/dist/lint/index.d.ts +31 -0
  145. package/dist/lint/index.js +43 -0
  146. package/dist/lint/index.js.map +1 -0
  147. package/dist/lint/project-rules.d.ts +19 -0
  148. package/dist/lint/project-rules.js +32 -0
  149. package/dist/lint/project-rules.js.map +1 -0
  150. package/dist/lint/report.d.ts +7 -0
  151. package/dist/lint/report.js +48 -0
  152. package/dist/lint/report.js.map +1 -0
  153. package/dist/lint/rules.d.ts +53 -0
  154. package/dist/lint/rules.js +42 -0
  155. package/dist/lint/rules.js.map +1 -0
  156. package/dist/lint/silences.d.ts +49 -0
  157. package/dist/lint/silences.js +91 -0
  158. package/dist/lint/silences.js.map +1 -0
  159. package/dist/lint/statements.d.ts +38 -0
  160. package/dist/lint/statements.js +120 -0
  161. package/dist/lint/statements.js.map +1 -0
  162. package/dist/mcp/server.d.ts +40 -0
  163. package/dist/mcp/server.js +106 -0
  164. package/dist/mcp/server.js.map +1 -0
  165. package/dist/mcp/tools.d.ts +72 -0
  166. package/dist/mcp/tools.js +178 -0
  167. package/dist/mcp/tools.js.map +1 -0
  168. package/dist/migrations/checks.d.ts +28 -0
  169. package/dist/migrations/checks.js +97 -0
  170. package/dist/migrations/checks.js.map +1 -0
  171. package/dist/migrations/checksum.d.ts +56 -0
  172. package/dist/migrations/checksum.js +72 -0
  173. package/dist/migrations/checksum.js.map +1 -0
  174. package/dist/migrations/create.d.ts +75 -0
  175. package/dist/migrations/create.js +120 -0
  176. package/dist/migrations/create.js.map +1 -0
  177. package/dist/migrations/directory.d.ts +119 -0
  178. package/dist/migrations/directory.js +229 -0
  179. package/dist/migrations/directory.js.map +1 -0
  180. package/dist/migrations/document.d.ts +106 -0
  181. package/dist/migrations/document.js +83 -0
  182. package/dist/migrations/document.js.map +1 -0
  183. package/dist/migrations/index.d.ts +21 -0
  184. package/dist/migrations/index.js +22 -0
  185. package/dist/migrations/index.js.map +1 -0
  186. package/dist/pr/comment.d.ts +32 -0
  187. package/dist/pr/comment.js +99 -0
  188. package/dist/pr/comment.js.map +1 -0
  189. package/dist/pr/forge.d.ts +54 -0
  190. package/dist/pr/forge.js +119 -0
  191. package/dist/pr/forge.js.map +1 -0
  192. package/dist/pr/issue.d.ts +68 -0
  193. package/dist/pr/issue.js +107 -0
  194. package/dist/pr/issue.js.map +1 -0
  195. package/dist/pr/model.d.ts +99 -0
  196. package/dist/pr/model.js +137 -0
  197. package/dist/pr/model.js.map +1 -0
  198. package/dist/pr/render.d.ts +29 -0
  199. package/dist/pr/render.js +279 -0
  200. package/dist/pr/render.js.map +1 -0
  201. package/dist/project.d.ts +62 -0
  202. package/dist/project.js +92 -0
  203. package/dist/project.js.map +1 -0
  204. package/dist/rebase/index.d.ts +121 -0
  205. package/dist/rebase/index.js +390 -0
  206. package/dist/rebase/index.js.map +1 -0
  207. package/dist/rebase/repair.d.ts +41 -0
  208. package/dist/rebase/repair.js +68 -0
  209. package/dist/rebase/repair.js.map +1 -0
  210. package/dist/replay/clickhouse.d.ts +33 -0
  211. package/dist/replay/clickhouse.js +106 -0
  212. package/dist/replay/clickhouse.js.map +1 -0
  213. package/dist/replay/index.d.ts +39 -0
  214. package/dist/replay/index.js +57 -0
  215. package/dist/replay/index.js.map +1 -0
  216. package/dist/replay/postgres.d.ts +31 -0
  217. package/dist/replay/postgres.js +140 -0
  218. package/dist/replay/postgres.js.map +1 -0
  219. package/dist/replay/replay.d.ts +114 -0
  220. package/dist/replay/replay.js +98 -0
  221. package/dist/replay/replay.js.map +1 -0
  222. package/dist/replay/report.d.ts +18 -0
  223. package/dist/replay/report.js +72 -0
  224. package/dist/replay/report.js.map +1 -0
  225. package/dist/replay/shared.d.ts +28 -0
  226. package/dist/replay/shared.js +77 -0
  227. package/dist/replay/shared.js.map +1 -0
  228. package/dist/schemas.d.ts +34 -0
  229. package/dist/schemas.js +38 -0
  230. package/dist/schemas.js.map +1 -0
  231. package/dist/server.d.ts +40 -0
  232. package/dist/server.js +87 -0
  233. package/dist/server.js.map +1 -0
  234. package/dist/steps/backfill.d.ts +132 -0
  235. package/dist/steps/backfill.js +307 -0
  236. package/dist/steps/backfill.js.map +1 -0
  237. package/dist/steps/index.d.ts +52 -0
  238. package/dist/steps/index.js +52 -0
  239. package/dist/steps/index.js.map +1 -0
  240. package/dist/steps/kinds.d.ts +101 -0
  241. package/dist/steps/kinds.js +143 -0
  242. package/dist/steps/kinds.js.map +1 -0
  243. package/dist/steps/postgres-migration.d.ts +95 -0
  244. package/dist/steps/postgres-migration.js +149 -0
  245. package/dist/steps/postgres-migration.js.map +1 -0
  246. package/dist/steps/rebuild.d.ts +97 -0
  247. package/dist/steps/rebuild.js +155 -0
  248. package/dist/steps/rebuild.js.map +1 -0
  249. package/dist/steps/run.d.ts +45 -0
  250. package/dist/steps/run.js +72 -0
  251. package/dist/steps/run.js.map +1 -0
  252. package/dist/topology/render.d.ts +17 -0
  253. package/dist/topology/render.js +17 -0
  254. package/dist/topology/render.js.map +1 -0
  255. package/dist/version.d.ts +2 -0
  256. package/dist/version.js +11 -0
  257. package/dist/version.js.map +1 -0
  258. package/dist/versioned/approval.d.ts +35 -0
  259. package/dist/versioned/approval.js +53 -0
  260. package/dist/versioned/approval.js.map +1 -0
  261. package/dist/versioned/checks.d.ts +29 -0
  262. package/dist/versioned/checks.js +54 -0
  263. package/dist/versioned/checks.js.map +1 -0
  264. package/dist/versioned/clickhouse.d.ts +24 -0
  265. package/dist/versioned/clickhouse.js +42 -0
  266. package/dist/versioned/clickhouse.js.map +1 -0
  267. package/dist/versioned/digest.d.ts +77 -0
  268. package/dist/versioned/digest.js +69 -0
  269. package/dist/versioned/digest.js.map +1 -0
  270. package/dist/versioned/driver.d.ts +51 -0
  271. package/dist/versioned/driver.js +13 -0
  272. package/dist/versioned/driver.js.map +1 -0
  273. package/dist/versioned/engine.d.ts +206 -0
  274. package/dist/versioned/engine.js +370 -0
  275. package/dist/versioned/engine.js.map +1 -0
  276. package/dist/versioned/explain.d.ts +123 -0
  277. package/dist/versioned/explain.js +294 -0
  278. package/dist/versioned/explain.js.map +1 -0
  279. package/dist/versioned/index.d.ts +46 -0
  280. package/dist/versioned/index.js +77 -0
  281. package/dist/versioned/index.js.map +1 -0
  282. package/dist/versioned/op.d.ts +72 -0
  283. package/dist/versioned/op.js +185 -0
  284. package/dist/versioned/op.js.map +1 -0
  285. package/dist/versioned/policy.d.ts +67 -0
  286. package/dist/versioned/policy.js +161 -0
  287. package/dist/versioned/policy.js.map +1 -0
  288. package/dist/versioned/postgres/catalog.d.ts +33 -0
  289. package/dist/versioned/postgres/catalog.js +34 -0
  290. package/dist/versioned/postgres/catalog.js.map +1 -0
  291. package/dist/versioned/postgres/driver.d.ts +71 -0
  292. package/dist/versioned/postgres/driver.js +140 -0
  293. package/dist/versioned/postgres/driver.js.map +1 -0
  294. package/dist/versioned/postgres/executor.d.ts +104 -0
  295. package/dist/versioned/postgres/executor.js +172 -0
  296. package/dist/versioned/postgres/executor.js.map +1 -0
  297. package/dist/versioned/postgres/index.d.ts +11 -0
  298. package/dist/versioned/postgres/index.js +12 -0
  299. package/dist/versioned/postgres/index.js.map +1 -0
  300. package/dist/versioned/postgres/waits.d.ts +46 -0
  301. package/dist/versioned/postgres/waits.js +78 -0
  302. package/dist/versioned/postgres/waits.js.map +1 -0
  303. package/dist/versioned/report.d.ts +25 -0
  304. package/dist/versioned/report.js +84 -0
  305. package/dist/versioned/report.js.map +1 -0
  306. package/dist/versioned/stand-down.d.ts +30 -0
  307. package/dist/versioned/stand-down.js +56 -0
  308. package/dist/versioned/stand-down.js.map +1 -0
  309. package/dist/versioned/state.d.ts +108 -0
  310. package/dist/versioned/state.js +153 -0
  311. package/dist/versioned/state.js.map +1 -0
  312. package/package.json +61 -4
  313. package/schemas/apply.schema.json +269 -0
  314. package/schemas/common.schema.json +213 -0
  315. package/schemas/drift.schema.json +36 -0
  316. package/schemas/init.schema.json +31 -0
  317. package/schemas/lint-rules.schema.json +54 -0
  318. package/schemas/lint.schema.json +290 -0
  319. package/schemas/mcp.schema.json +70 -0
  320. package/schemas/new.schema.json +71 -0
  321. package/schemas/plan.schema.json +371 -0
  322. package/schemas/rebase.schema.json +54 -0
  323. package/schemas/repair.schema.json +20 -0
  324. package/schemas/status.schema.json +310 -0
@@ -0,0 +1,269 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://intentius.io/sql-yodeler/schemas/v1/apply.schema.json",
4
+ "title": "yodel apply <env> --json",
5
+ "description": "Version 1. On a project with migrations, the status (status.schema.json) with mode \"versioned\" and what apply did; with --execute (the migrations Op's Apply step), what the step applied; on a project without migrations, the declarative outcome with chant's plan. Within a version, fields are only added; a reader ignores fields it does not know.",
6
+ "oneOf": [
7
+ {
8
+ "$ref": "#/$defs/versioned"
9
+ },
10
+ {
11
+ "$ref": "#/$defs/execute"
12
+ },
13
+ {
14
+ "$ref": "#/$defs/declarative"
15
+ }
16
+ ],
17
+ "$defs": {
18
+ "lock": {
19
+ "type": "object",
20
+ "additionalProperties": false,
21
+ "required": [
22
+ "kind",
23
+ "where"
24
+ ],
25
+ "properties": {
26
+ "kind": {
27
+ "enum": [
28
+ "keeper",
29
+ "local",
30
+ "advisory"
31
+ ]
32
+ },
33
+ "where": {
34
+ "type": "string"
35
+ },
36
+ "notice": {
37
+ "type": "string"
38
+ }
39
+ }
40
+ },
41
+ "versioned": {
42
+ "type": "object",
43
+ "$ref": "status.schema.json#/$defs/report",
44
+ "required": [
45
+ "mode",
46
+ "status"
47
+ ],
48
+ "unevaluatedProperties": false,
49
+ "properties": {
50
+ "mode": {
51
+ "const": "versioned"
52
+ },
53
+ "status": {
54
+ "description": "planned (--plan, something pending), unchanged, refused, denied (a policy rule denies the plan, with no override), gated (waiting at the Op's gate for a person's approval), failed, applied.",
55
+ "enum": [
56
+ "planned",
57
+ "unchanged",
58
+ "refused",
59
+ "denied",
60
+ "gated",
61
+ "failed",
62
+ "applied"
63
+ ]
64
+ },
65
+ "preChecks": {
66
+ "description": "The first pending migration's checks, when one failed before the gate.",
67
+ "type": "object",
68
+ "additionalProperties": false,
69
+ "required": [
70
+ "migration",
71
+ "checks"
72
+ ],
73
+ "properties": {
74
+ "migration": {
75
+ "type": "string"
76
+ },
77
+ "checks": {
78
+ "type": "array",
79
+ "items": {
80
+ "$ref": "common.schema.json#/$defs/checkOutcome"
81
+ }
82
+ }
83
+ }
84
+ },
85
+ "policy": {
86
+ "description": "denied: each policy rule's outcome.",
87
+ "$ref": "common.schema.json#/$defs/policy"
88
+ },
89
+ "op": {
90
+ "type": "string"
91
+ },
92
+ "gate": {
93
+ "type": "string"
94
+ },
95
+ "approve": {
96
+ "description": "gated: the command a person runs to approve. An agent prints it and never runs it.",
97
+ "type": "string"
98
+ },
99
+ "gatePlanDigest": {
100
+ "type": "string"
101
+ },
102
+ "moved": {
103
+ "description": "gated: the gate's newest approval does not hold, and what moved since it.",
104
+ "type": "object",
105
+ "additionalProperties": false,
106
+ "required": [
107
+ "approved",
108
+ "by",
109
+ "at",
110
+ "confirmed",
111
+ "changes"
112
+ ],
113
+ "properties": {
114
+ "approved": {
115
+ "type": "string"
116
+ },
117
+ "by": {
118
+ "type": "string"
119
+ },
120
+ "at": {
121
+ "type": "string"
122
+ },
123
+ "confirmed": {
124
+ "type": "boolean"
125
+ },
126
+ "changes": {
127
+ "$ref": "plan.schema.json#/$defs/moved"
128
+ },
129
+ "askedAgain": {
130
+ "type": "object",
131
+ "additionalProperties": false,
132
+ "required": [
133
+ "at"
134
+ ],
135
+ "properties": {
136
+ "at": {
137
+ "type": "string"
138
+ },
139
+ "digest": {
140
+ "type": "string"
141
+ }
142
+ }
143
+ }
144
+ }
145
+ },
146
+ "exitCode": {
147
+ "description": "failed: yodel apply's exit code, the Apply step's own when it had one.",
148
+ "type": "integer"
149
+ },
150
+ "chantExitCode": {
151
+ "description": "failed: chant run's exit code.",
152
+ "type": "integer"
153
+ },
154
+ "appliedNow": {
155
+ "description": "applied: the migrations this run applied.",
156
+ "$ref": "common.schema.json#/$defs/stringList"
157
+ }
158
+ }
159
+ },
160
+ "execute": {
161
+ "type": "object",
162
+ "additionalProperties": false,
163
+ "required": [
164
+ "environment",
165
+ "status",
166
+ "planDigest",
167
+ "applied",
168
+ "skipped",
169
+ "lock"
170
+ ],
171
+ "properties": {
172
+ "environment": {
173
+ "type": "string"
174
+ },
175
+ "status": {
176
+ "const": "applied"
177
+ },
178
+ "planDigest": {
179
+ "description": "The digest the gate approved.",
180
+ "type": "string"
181
+ },
182
+ "applied": {
183
+ "$ref": "common.schema.json#/$defs/stringList"
184
+ },
185
+ "skipped": {
186
+ "description": "Statements not sent because an earlier run had already succeeded with them.",
187
+ "type": "array",
188
+ "items": {
189
+ "type": "object",
190
+ "additionalProperties": false,
191
+ "required": [
192
+ "id",
193
+ "statement"
194
+ ],
195
+ "properties": {
196
+ "id": {
197
+ "type": "string"
198
+ },
199
+ "statement": {
200
+ "type": "integer"
201
+ }
202
+ }
203
+ }
204
+ },
205
+ "lock": {
206
+ "$ref": "#/$defs/lock"
207
+ }
208
+ }
209
+ },
210
+ "declarative": {
211
+ "type": "object",
212
+ "additionalProperties": false,
213
+ "required": [
214
+ "environment",
215
+ "dialect",
216
+ "op",
217
+ "status",
218
+ "plan"
219
+ ],
220
+ "properties": {
221
+ "environment": {
222
+ "type": "string"
223
+ },
224
+ "dialect": {
225
+ "$ref": "common.schema.json#/$defs/dialect"
226
+ },
227
+ "server": {
228
+ "$ref": "common.schema.json#/$defs/server"
229
+ },
230
+ "op": {
231
+ "description": "The ApplyOp.",
232
+ "type": "string"
233
+ },
234
+ "status": {
235
+ "enum": [
236
+ "refused",
237
+ "unchanged",
238
+ "gated",
239
+ "failed",
240
+ "incomplete",
241
+ "applied"
242
+ ]
243
+ },
244
+ "gate": {
245
+ "type": "string"
246
+ },
247
+ "approve": {
248
+ "description": "gated: the command a person runs to approve. An agent prints it and never runs it.",
249
+ "type": "string"
250
+ },
251
+ "planDigest": {
252
+ "type": "string"
253
+ },
254
+ "exitCode": {
255
+ "description": "failed: chant run's exit code.",
256
+ "type": "integer"
257
+ },
258
+ "plan": {
259
+ "description": "The plan before the run.",
260
+ "$ref": "plan.schema.json#/$defs/declarative"
261
+ },
262
+ "remaining": {
263
+ "description": "incomplete: the plan after the Op completed.",
264
+ "$ref": "plan.schema.json#/$defs/declarative"
265
+ }
266
+ }
267
+ }
268
+ }
269
+ }
@@ -0,0 +1,213 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://intentius.io/sql-yodeler/schemas/v1/common.schema.json",
4
+ "title": "Definitions the yodel --json schemas share",
5
+ "description": "Version 1. Shared by the other schemas in this directory; no command prints this document on its own.",
6
+ "$defs": {
7
+ "dialect": {
8
+ "enum": [
9
+ "clickhouse",
10
+ "postgres"
11
+ ]
12
+ },
13
+ "server": {
14
+ "description": "The server read from: its dialect, its address (host:port on ClickHouse, host:port/database on Postgres) and its version, when it answered.",
15
+ "type": "object",
16
+ "additionalProperties": false,
17
+ "required": [
18
+ "dialect",
19
+ "address"
20
+ ],
21
+ "properties": {
22
+ "dialect": {
23
+ "$ref": "#/$defs/dialect"
24
+ },
25
+ "address": {
26
+ "type": "string"
27
+ },
28
+ "version": {
29
+ "type": "string"
30
+ }
31
+ }
32
+ },
33
+ "refusal": {
34
+ "description": "Why yodel apply would refuse, and the exit code it would refuse with.",
35
+ "type": "object",
36
+ "additionalProperties": false,
37
+ "required": [
38
+ "exitCode",
39
+ "message"
40
+ ],
41
+ "properties": {
42
+ "exitCode": {
43
+ "type": "integer"
44
+ },
45
+ "message": {
46
+ "type": "string"
47
+ }
48
+ }
49
+ },
50
+ "change": {
51
+ "description": "One classified change, as chant's sql lexicon reports it. chant owns this object: fields beyond the required ones may appear.",
52
+ "type": "object",
53
+ "required": [
54
+ "object",
55
+ "field",
56
+ "rule",
57
+ "class"
58
+ ],
59
+ "properties": {
60
+ "object": {
61
+ "type": "string"
62
+ },
63
+ "field": {
64
+ "type": "string"
65
+ },
66
+ "before": {
67
+ "type": "string"
68
+ },
69
+ "after": {
70
+ "type": "string"
71
+ },
72
+ "rule": {
73
+ "type": "string"
74
+ },
75
+ "class": {
76
+ "type": "string"
77
+ },
78
+ "destructive": {
79
+ "type": "boolean"
80
+ },
81
+ "note": {
82
+ "type": "string"
83
+ }
84
+ }
85
+ },
86
+ "check": {
87
+ "description": "A pre-migration check from migration.json.",
88
+ "type": "object",
89
+ "additionalProperties": false,
90
+ "required": [
91
+ "name",
92
+ "sql"
93
+ ],
94
+ "properties": {
95
+ "name": {
96
+ "type": "string"
97
+ },
98
+ "sql": {
99
+ "type": "string"
100
+ },
101
+ "expect": {
102
+ "oneOf": [
103
+ {
104
+ "enum": [
105
+ "empty",
106
+ "true"
107
+ ]
108
+ },
109
+ {
110
+ "type": "object",
111
+ "additionalProperties": false,
112
+ "properties": {
113
+ "min": {
114
+ "type": "number"
115
+ },
116
+ "max": {
117
+ "type": "number"
118
+ }
119
+ }
120
+ }
121
+ ]
122
+ }
123
+ }
124
+ },
125
+ "checkOutcome": {
126
+ "type": "object",
127
+ "additionalProperties": false,
128
+ "required": [
129
+ "name",
130
+ "passed",
131
+ "detail"
132
+ ],
133
+ "properties": {
134
+ "name": {
135
+ "type": "string"
136
+ },
137
+ "passed": {
138
+ "type": "boolean"
139
+ },
140
+ "detail": {
141
+ "type": "string"
142
+ }
143
+ }
144
+ },
145
+ "stringList": {
146
+ "type": "array",
147
+ "items": {
148
+ "type": "string"
149
+ }
150
+ },
151
+ "policy": {
152
+ "description": "The outcome of each rule of yodel.config.ts policy.rules over the plan.",
153
+ "type": "array",
154
+ "items": {
155
+ "type": "object",
156
+ "additionalProperties": false,
157
+ "required": [
158
+ "id",
159
+ "outcome",
160
+ "reasons"
161
+ ],
162
+ "properties": {
163
+ "id": {
164
+ "type": "string"
165
+ },
166
+ "description": {
167
+ "type": "string"
168
+ },
169
+ "outcome": {
170
+ "description": "denied stands; overridden was denied, and an override counts.",
171
+ "enum": [
172
+ "allowed",
173
+ "denied",
174
+ "overridden"
175
+ ]
176
+ },
177
+ "reasons": {
178
+ "description": "Why it denies the plan, one line each.",
179
+ "$ref": "#/$defs/stringList"
180
+ },
181
+ "override": {
182
+ "type": "object",
183
+ "additionalProperties": false,
184
+ "required": [
185
+ "rule",
186
+ "by",
187
+ "at",
188
+ "reason",
189
+ "digest"
190
+ ],
191
+ "properties": {
192
+ "rule": {
193
+ "type": "string"
194
+ },
195
+ "by": {
196
+ "type": "string"
197
+ },
198
+ "at": {
199
+ "type": "string"
200
+ },
201
+ "reason": {
202
+ "type": "string"
203
+ },
204
+ "digest": {
205
+ "type": "string"
206
+ }
207
+ }
208
+ }
209
+ }
210
+ }
211
+ }
212
+ }
213
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://intentius.io/sql-yodeler/schemas/v1/drift.schema.json",
4
+ "title": "yodel drift <env> --json",
5
+ "description": "Version 1. The declared objects changed out of band (changed) or gone (missing), and those chant could not read (unobserved: not drift, and not clean). Objects the project does not declare are never reported. Within a version, fields are only added; a reader ignores fields it does not know.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["environment", "dialect", "changed", "missing", "unobserved", "drifted"],
9
+ "properties": {
10
+ "environment": { "type": "string" },
11
+ "dialect": { "$ref": "common.schema.json#/$defs/dialect" },
12
+ "server": { "$ref": "common.schema.json#/$defs/server" },
13
+ "changed": {
14
+ "description": "chant's deep drift for each changed object: its name, kind and the properties that differ, declared against live. chant owns this object: fields beyond the required ones may appear.",
15
+ "type": "array",
16
+ "items": {
17
+ "type": "object",
18
+ "required": ["changes"],
19
+ "properties": { "changes": { "type": "array", "items": { "type": "object" } } }
20
+ }
21
+ },
22
+ "missing": { "$ref": "common.schema.json#/$defs/stringList" },
23
+ "unobserved": {
24
+ "description": "Declared objects chant could not read, each with its name and why.",
25
+ "type": "array",
26
+ "items": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string" } } }
27
+ },
28
+ "lockWait": { "description": "Postgres: a read gave up at the lock timeout, and what it waited on.", "type": "string" },
29
+ "columns": {
30
+ "description": "Each changed table's declared column names, by position.",
31
+ "type": "object",
32
+ "additionalProperties": { "$ref": "common.schema.json#/$defs/stringList" }
33
+ },
34
+ "drifted": { "description": "A declared object changed or is gone: the command exits 2.", "type": "boolean" }
35
+ }
36
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://intentius.io/sql-yodeler/schemas/v1/init.schema.json",
4
+ "title": "yodel init --from <env> --json",
5
+ "description": "Version 1. What adopting a live database wrote: the declarations, the baseline migration, and the history row that records it applied. Within a version, fields are only added; a reader ignores fields it does not know.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["environment", "dialect", "status", "objects", "schemaFiles", "migration", "recorded", "warnings"],
9
+ "properties": {
10
+ "environment": { "type": "string" },
11
+ "dialect": { "$ref": "common.schema.json#/$defs/dialect" },
12
+ "status": { "const": "adopted" },
13
+ "objects": { "description": "The objects read, as <kind> <name>.", "$ref": "common.schema.json#/$defs/stringList" },
14
+ "schemaFiles": { "description": "The declaration files written, relative to the project.", "$ref": "common.schema.json#/$defs/stringList" },
15
+ "migration": {
16
+ "description": "The baseline migration.",
17
+ "type": "object",
18
+ "additionalProperties": false,
19
+ "required": ["path", "id", "checksum", "statements"],
20
+ "properties": { "path": { "type": "string" }, "id": { "type": "string" }, "checksum": { "type": "string" }, "statements": { "type": "integer" } }
21
+ },
22
+ "recorded": {
23
+ "description": "The baseline's history row.",
24
+ "type": "object",
25
+ "additionalProperties": false,
26
+ "required": ["history", "seq", "note", "appliedBy"],
27
+ "properties": { "history": { "type": "string" }, "seq": { "type": "integer" }, "note": { "type": "string" }, "appliedBy": { "type": "string" } }
28
+ },
29
+ "warnings": { "$ref": "common.schema.json#/$defs/stringList" }
30
+ }
31
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://intentius.io/sql-yodeler/schemas/v1/lint-rules.schema.json",
4
+ "title": "yodel lint --rules --json",
5
+ "description": "Version 1. Every lint rule, with the level yodel.config.ts sets for it in this project. Within a version, fields are only added; a reader ignores fields it does not know.",
6
+ "type": "array",
7
+ "items": {
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "required": [
11
+ "id",
12
+ "summary",
13
+ "level",
14
+ "silenceable",
15
+ "configurable",
16
+ "configured"
17
+ ],
18
+ "properties": {
19
+ "id": {
20
+ "type": "string"
21
+ },
22
+ "summary": {
23
+ "type": "string"
24
+ },
25
+ "level": {
26
+ "description": "The rule's default level.",
27
+ "enum": [
28
+ "error",
29
+ "warning"
30
+ ]
31
+ },
32
+ "silenceable": {
33
+ "description": "A -- yodel:allow <id> <reason> line can silence it for one statement.",
34
+ "type": "boolean"
35
+ },
36
+ "configurable": {
37
+ "description": "yodel.config.ts lint.rules may change its level.",
38
+ "type": "boolean"
39
+ },
40
+ "dialect": {
41
+ "description": "The dialect it applies to; both when absent.",
42
+ "$ref": "common.schema.json#/$defs/dialect"
43
+ },
44
+ "configured": {
45
+ "description": "The level in this project.",
46
+ "enum": [
47
+ "error",
48
+ "warning",
49
+ "off"
50
+ ]
51
+ }
52
+ }
53
+ }
54
+ }