@intentius/sql-yodeler 0.2.0 → 0.3.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.
- package/README.md +3 -3
- package/dist/chant/build.js +7 -0
- package/dist/chant/build.js.map +1 -1
- package/dist/ci/render.d.ts +289 -0
- package/dist/ci/render.js +688 -0
- package/dist/ci/render.js.map +1 -0
- package/dist/ci/replay.d.ts +17 -0
- package/dist/ci/replay.js +69 -0
- package/dist/ci/replay.js.map +1 -0
- package/dist/commands/apply.d.ts +113 -0
- package/dist/commands/apply.js +228 -21
- package/dist/commands/apply.js.map +1 -1
- package/dist/commands/approve.js +44 -0
- package/dist/commands/approve.js.map +1 -1
- package/dist/commands/checkpoint.d.ts +3 -0
- package/dist/commands/checkpoint.js +78 -0
- package/dist/commands/checkpoint.js.map +1 -0
- package/dist/commands/ci.d.ts +3 -0
- package/dist/commands/ci.js +118 -0
- package/dist/commands/ci.js.map +1 -0
- package/dist/commands/docs.d.ts +11 -0
- package/dist/commands/docs.js +108 -0
- package/dist/commands/docs.js.map +1 -0
- package/dist/commands/drift.d.ts +13 -1
- package/dist/commands/drift.js +18 -2
- package/dist/commands/drift.js.map +1 -1
- package/dist/commands/index.js +10 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/init.js +1 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/lint.js +11 -3
- package/dist/commands/lint.js.map +1 -1
- package/dist/commands/override.js +48 -16
- package/dist/commands/override.js.map +1 -1
- package/dist/commands/plan.js +5 -1
- package/dist/commands/plan.js.map +1 -1
- package/dist/commands/report.d.ts +13 -0
- package/dist/commands/report.js +121 -0
- package/dist/commands/report.js.map +1 -0
- package/dist/commands/revert.d.ts +20 -0
- package/dist/commands/revert.js +246 -0
- package/dist/commands/revert.js.map +1 -0
- package/dist/commands/status.js +32 -5
- package/dist/commands/status.js.map +1 -1
- package/dist/config/base.d.ts +69 -0
- package/dist/config/base.js +121 -0
- package/dist/config/base.js.map +1 -0
- package/dist/config/define.d.ts +123 -1
- package/dist/config/define.js +2 -0
- package/dist/config/define.js.map +1 -1
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.js +2 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/load.d.ts +1 -1
- package/dist/config/load.js +90 -5
- package/dist/config/load.js.map +1 -1
- package/dist/config/settings.d.ts +4 -1
- package/dist/config/settings.js +8 -2
- package/dist/config/settings.js.map +1 -1
- package/dist/exit.js +1 -1
- package/dist/exit.js.map +1 -1
- package/dist/history/postgres/ddl.d.ts +18 -0
- package/dist/history/postgres/ddl.js +27 -2
- package/dist/history/postgres/ddl.js.map +1 -1
- package/dist/history/postgres/store.d.ts +2 -0
- package/dist/history/postgres/store.js +7 -1
- package/dist/history/postgres/store.js.map +1 -1
- package/dist/history/rows.d.ts +16 -3
- package/dist/history/rows.js +30 -1
- package/dist/history/rows.js.map +1 -1
- package/dist/history/store.d.ts +2 -0
- package/dist/history/store.js +2 -2
- package/dist/history/store.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lint/check.js +17 -2
- package/dist/lint/check.js.map +1 -1
- package/dist/lint/report.js +1 -1
- package/dist/lint/report.js.map +1 -1
- package/dist/lint/routines.d.ts +26 -0
- package/dist/lint/routines.js +65 -0
- package/dist/lint/routines.js.map +1 -0
- package/dist/lint/rules.d.ts +16 -4
- package/dist/lint/rules.js +9 -4
- package/dist/lint/rules.js.map +1 -1
- package/dist/mcp/tools.d.ts +1 -1
- package/dist/mcp/tools.js +1 -1
- package/dist/mcp/tools.js.map +1 -1
- package/dist/migrations/checkpoint.d.ts +45 -0
- package/dist/migrations/checkpoint.js +110 -0
- package/dist/migrations/checkpoint.js.map +1 -0
- package/dist/migrations/create.js +2 -0
- package/dist/migrations/create.js.map +1 -1
- package/dist/migrations/document.d.ts +10 -0
- package/dist/migrations/document.js +1 -0
- package/dist/migrations/document.js.map +1 -1
- package/dist/migrations/index.d.ts +2 -0
- package/dist/migrations/index.js +2 -0
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/routines.d.ts +31 -0
- package/dist/migrations/routines.js +55 -0
- package/dist/migrations/routines.js.map +1 -0
- package/dist/notify/index.d.ts +124 -0
- package/dist/notify/index.js +210 -0
- package/dist/notify/index.js.map +1 -0
- package/dist/notify/verify.d.ts +53 -0
- package/dist/notify/verify.js +71 -0
- package/dist/notify/verify.js.map +1 -0
- package/dist/pr/model.d.ts +3 -0
- package/dist/pr/model.js +16 -2
- package/dist/pr/model.js.map +1 -1
- package/dist/pr/render.js +27 -1
- package/dist/pr/render.js.map +1 -1
- package/dist/project.d.ts +19 -2
- package/dist/project.js +33 -1
- package/dist/project.js.map +1 -1
- package/dist/replay/replay.d.ts +9 -1
- package/dist/replay/replay.js +62 -31
- package/dist/replay/replay.js.map +1 -1
- package/dist/replay/report.js +1 -1
- package/dist/replay/report.js.map +1 -1
- package/dist/report/audit.d.ts +138 -0
- package/dist/report/audit.js +202 -0
- package/dist/report/audit.js.map +1 -0
- package/dist/report/jsonl.d.ts +21 -0
- package/dist/report/jsonl.js +52 -0
- package/dist/report/jsonl.js.map +1 -0
- package/dist/report/model.d.ts +68 -0
- package/dist/report/model.js +127 -0
- package/dist/report/model.js.map +1 -0
- package/dist/report/render.d.ts +18 -0
- package/dist/report/render.js +127 -0
- package/dist/report/render.js.map +1 -0
- package/dist/schema-docs/render.d.ts +49 -0
- package/dist/schema-docs/render.js +359 -0
- package/dist/schema-docs/render.js.map +1 -0
- package/dist/schemas.d.ts +5 -2
- package/dist/schemas.js +5 -2
- package/dist/schemas.js.map +1 -1
- package/dist/sources/ddl.d.ts +53 -0
- package/dist/sources/ddl.js +347 -0
- package/dist/sources/ddl.js.map +1 -0
- package/dist/sources/index.d.ts +69 -0
- package/dist/sources/index.js +170 -0
- package/dist/sources/index.js.map +1 -0
- package/dist/steps/postgres-migration.d.ts +35 -25
- package/dist/steps/postgres-migration.js +42 -29
- package/dist/steps/postgres-migration.js.map +1 -1
- package/dist/tenants/index.d.ts +40 -0
- package/dist/tenants/index.js +122 -0
- package/dist/tenants/index.js.map +1 -0
- package/dist/tenants/target.d.ts +23 -0
- package/dist/tenants/target.js +29 -0
- package/dist/tenants/target.js.map +1 -0
- package/dist/versioned/engine.d.ts +6 -0
- package/dist/versioned/engine.js +12 -2
- package/dist/versioned/engine.js.map +1 -1
- package/dist/versioned/index.d.ts +1 -0
- package/dist/versioned/index.js +1 -0
- package/dist/versioned/index.js.map +1 -1
- package/dist/versioned/op.d.ts +6 -1
- package/dist/versioned/op.js +7 -2
- package/dist/versioned/op.js.map +1 -1
- package/dist/versioned/policy.d.ts +33 -2
- package/dist/versioned/policy.js +59 -8
- package/dist/versioned/policy.js.map +1 -1
- package/dist/versioned/report.js +9 -0
- package/dist/versioned/report.js.map +1 -1
- package/dist/versioned/revert.d.ts +128 -0
- package/dist/versioned/revert.js +251 -0
- package/dist/versioned/revert.js.map +1 -0
- package/dist/versioned/state.d.ts +25 -0
- package/dist/versioned/state.js +36 -3
- package/dist/versioned/state.js.map +1 -1
- package/dist/waves/index.d.ts +179 -0
- package/dist/waves/index.js +268 -0
- package/dist/waves/index.js.map +1 -0
- package/dist/waves/promotion.d.ts +56 -0
- package/dist/waves/promotion.js +108 -0
- package/dist/waves/promotion.js.map +1 -0
- package/dist/waves/record.d.ts +24 -0
- package/dist/waves/record.js +20 -0
- package/dist/waves/record.js.map +1 -0
- package/package.json +11 -7
- package/schemas/apply.schema.json +162 -3
- package/schemas/checkpoint.schema.json +19 -0
- package/schemas/drift.schema.json +26 -1
- package/schemas/event.schema.json +36 -0
- package/schemas/lint.schema.json +4 -0
- package/schemas/plan.schema.json +118 -0
- package/schemas/report.schema.json +114 -0
- package/schemas/revert.schema.json +69 -0
- package/schemas/status.schema.json +64 -3
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/sql-yodeler/schemas/v1/revert.schema.json",
|
|
4
|
+
"title": "yodel revert <env> <id> --json",
|
|
5
|
+
"description": "Version 1. The revert of a migration: the statements that take the schema from its recorded schema back to its parent's (a hand-written revert step's first), the digest its gate binds, and what happened: planned (--dry-run), denied by a policy rule, gated (waiting for approval), reverted, or failed. Within a version, fields are only added; a reader ignores fields it does not know.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["environment", "migration", "to", "planDigest", "statements", "dataSteps", "status"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"environment": { "type": "string" },
|
|
11
|
+
"migration": { "type": "string" },
|
|
12
|
+
"to": { "description": "The migration it goes back to; null when the first migration is reverted.", "type": ["string", "null"] },
|
|
13
|
+
"planDigest": { "type": "string" },
|
|
14
|
+
"statements": {
|
|
15
|
+
"type": "array",
|
|
16
|
+
"items": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"additionalProperties": false,
|
|
19
|
+
"required": ["index", "source", "sql", "rule", "class", "done"],
|
|
20
|
+
"properties": {
|
|
21
|
+
"index": { "type": "integer", "minimum": 0 },
|
|
22
|
+
"source": { "description": "step: the hand-written revert step; reverse: diffed from the recorded schemas.", "enum": ["step", "reverse"] },
|
|
23
|
+
"sql": { "type": "string" },
|
|
24
|
+
"rule": { "type": "string" },
|
|
25
|
+
"class": { "type": "string" },
|
|
26
|
+
"destructive": { "const": true },
|
|
27
|
+
"done": { "description": "It succeeded in an earlier run of this revert and is not sent again.", "type": "boolean" }
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"dataSteps": { "description": "The migration's data steps, which the hand-written revert step undoes.", "$ref": "common.schema.json#/$defs/stringList" },
|
|
32
|
+
"step": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"additionalProperties": false,
|
|
35
|
+
"required": ["file", "sha", "statements"],
|
|
36
|
+
"properties": { "file": { "type": "string" }, "sha": { "type": "string" }, "statements": { "type": "integer", "minimum": 1 } }
|
|
37
|
+
},
|
|
38
|
+
"status": { "enum": ["planned", "denied", "gated", "reverted", "failed"] },
|
|
39
|
+
"policy": {
|
|
40
|
+
"description": "Each policy rule's outcome over the revert, the policy as the base commit has it; denied when a rule denies the revert and no override is recorded for its digest.",
|
|
41
|
+
"$ref": "common.schema.json#/$defs/policy"
|
|
42
|
+
},
|
|
43
|
+
"wave": {
|
|
44
|
+
"description": "When yodel.config.ts waves names the environment: the wave's gate policy at the base commit, the revert's statements it counts as destructive, and whether it asks for an approval of the revert. The revert waits at the migrations Op's gate either way.",
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": ["gate", "base", "destructiveSteps", "policyWaits"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"gate": { "enum": ["always", "on-destructive", "never"] },
|
|
50
|
+
"base": { "type": "string" },
|
|
51
|
+
"destructiveSteps": {
|
|
52
|
+
"type": "array",
|
|
53
|
+
"items": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"required": ["migration", "step", "what", "why"],
|
|
57
|
+
"properties": { "migration": { "type": "string" }, "step": { "type": "integer", "minimum": 0 }, "what": { "type": "string" }, "why": { "type": "string" } }
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"policyWaits": { "type": "boolean" }
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"op": { "type": "string" },
|
|
64
|
+
"gate": { "type": "string" },
|
|
65
|
+
"approve": { "description": "The chant approve command that approves this revert.", "type": "string" },
|
|
66
|
+
"gatePlanDigest": { "type": "string" },
|
|
67
|
+
"exitCode": { "type": "integer" }
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -2,10 +2,18 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://intentius.io/sql-yodeler/schemas/v1/status.schema.json",
|
|
4
4
|
"title": "yodel status <env> --json",
|
|
5
|
-
"description": "Version 1. The environment's migrations against its history. Within a version, fields are only added; a reader ignores fields it does not know. yodel apply --json carries the same fields (apply.schema.json).",
|
|
5
|
+
"description": "Version 1. The environment's migrations against its history; for an environment with a tenant set (yodel.config.ts environments.<env>.tenants), each tenant's, against its own history. Within a version, fields are only added; a reader ignores fields it does not know. yodel apply --json carries the same fields (apply.schema.json).",
|
|
6
6
|
"type": "object",
|
|
7
|
-
"
|
|
8
|
-
|
|
7
|
+
"oneOf": [
|
|
8
|
+
{
|
|
9
|
+
"type": "object",
|
|
10
|
+
"$ref": "#/$defs/report",
|
|
11
|
+
"unevaluatedProperties": false
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"$ref": "#/$defs/tenants"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
9
17
|
"$defs": {
|
|
10
18
|
"step": {
|
|
11
19
|
"type": "object",
|
|
@@ -164,6 +172,13 @@
|
|
|
164
172
|
"outOfOrder": {
|
|
165
173
|
"type": "boolean"
|
|
166
174
|
},
|
|
175
|
+
"reverted": {
|
|
176
|
+
"description": "It was applied, then yodel revert undid it: who reverted it and when. Applied again, every statement runs again.",
|
|
177
|
+
"type": "object",
|
|
178
|
+
"additionalProperties": false,
|
|
179
|
+
"required": ["by", "at"],
|
|
180
|
+
"properties": { "by": { "type": "string" }, "at": { "type": "string" } }
|
|
181
|
+
},
|
|
167
182
|
"partWay": {
|
|
168
183
|
"oneOf": [
|
|
169
184
|
{
|
|
@@ -297,6 +312,20 @@
|
|
|
297
312
|
}
|
|
298
313
|
}
|
|
299
314
|
},
|
|
315
|
+
"skipped": {
|
|
316
|
+
"description": "The migrations a checkpoint leaves out in this environment, in chain order: covered (before the checkpoint the environment starts from, named) or checkpoint (a checkpoint the environment does not start from). Absent when there are none.",
|
|
317
|
+
"type": "array",
|
|
318
|
+
"items": {
|
|
319
|
+
"type": "object",
|
|
320
|
+
"additionalProperties": false,
|
|
321
|
+
"required": ["id", "reason"],
|
|
322
|
+
"properties": {
|
|
323
|
+
"id": { "type": "string" },
|
|
324
|
+
"reason": { "enum": ["covered", "checkpoint"] },
|
|
325
|
+
"checkpoint": { "type": "string" }
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
},
|
|
300
329
|
"planDigest": {
|
|
301
330
|
"description": "The digest yodel apply would ask approval for, when it would not refuse.",
|
|
302
331
|
"type": "string"
|
|
@@ -305,6 +334,38 @@
|
|
|
305
334
|
"$ref": "common.schema.json#/$defs/refusal"
|
|
306
335
|
}
|
|
307
336
|
}
|
|
337
|
+
},
|
|
338
|
+
"tenants": {
|
|
339
|
+
"type": "object",
|
|
340
|
+
"additionalProperties": false,
|
|
341
|
+
"required": [
|
|
342
|
+
"environment",
|
|
343
|
+
"tenants",
|
|
344
|
+
"upToDate",
|
|
345
|
+
"total"
|
|
346
|
+
],
|
|
347
|
+
"description": "A tenant set: each tenant's status, named <env>/<tenant>, and how many are up to date.",
|
|
348
|
+
"properties": {
|
|
349
|
+
"environment": {
|
|
350
|
+
"type": "string"
|
|
351
|
+
},
|
|
352
|
+
"tenants": {
|
|
353
|
+
"type": "array",
|
|
354
|
+
"items": {
|
|
355
|
+
"type": "object",
|
|
356
|
+
"$ref": "#/$defs/report",
|
|
357
|
+
"unevaluatedProperties": false
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
"upToDate": {
|
|
361
|
+
"type": "integer",
|
|
362
|
+
"minimum": 0
|
|
363
|
+
},
|
|
364
|
+
"total": {
|
|
365
|
+
"type": "integer",
|
|
366
|
+
"minimum": 0
|
|
367
|
+
}
|
|
368
|
+
}
|
|
308
369
|
}
|
|
309
370
|
}
|
|
310
371
|
}
|