@intentius/sql-yodeler 0.1.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 +28 -26
- package/dist/bin.js +15 -0
- package/dist/bin.js.map +1 -1
- package/dist/chant/apply.d.ts +9 -1
- package/dist/chant/apply.js +13 -1
- package/dist/chant/apply.js.map +1 -1
- package/dist/chant/build.js +7 -0
- package/dist/chant/build.js.map +1 -1
- package/dist/chant/drift.d.ts +69 -1
- package/dist/chant/drift.js +152 -5
- package/dist/chant/drift.js.map +1 -1
- package/dist/chant/runnable.d.ts +19 -0
- package/dist/chant/runnable.js +47 -0
- package/dist/chant/runnable.js.map +1 -0
- 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/cli.d.ts +4 -0
- package/dist/cli.js +40 -0
- package/dist/cli.js.map +1 -1
- package/dist/command.d.ts +6 -0
- package/dist/command.js.map +1 -1
- package/dist/commands/apply.d.ts +113 -0
- package/dist/commands/apply.js +376 -49
- package/dist/commands/apply.js.map +1 -1
- package/dist/commands/approve.d.ts +5 -0
- package/dist/commands/approve.js +155 -0
- package/dist/commands/approve.js.map +1 -0
- 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 +23 -0
- package/dist/commands/drift.js +263 -18
- package/dist/commands/drift.js.map +1 -1
- package/dist/commands/index.js +16 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.js +15 -11
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/lint.js +25 -8
- package/dist/commands/lint.js.map +1 -1
- package/dist/commands/mcp.d.ts +3 -0
- package/dist/commands/mcp.js +50 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/new.d.ts +2 -0
- package/dist/commands/new.js +134 -10
- package/dist/commands/new.js.map +1 -1
- package/dist/commands/override.d.ts +3 -0
- package/dist/commands/override.js +150 -0
- package/dist/commands/override.js.map +1 -0
- package/dist/commands/plan.js +43 -27
- package/dist/commands/plan.js.map +1 -1
- package/dist/commands/repair.d.ts +11 -0
- package/dist/commands/repair.js +15 -7
- package/dist/commands/repair.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 +44 -17
- 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 +223 -3
- package/dist/config/define.js +3 -1
- 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 +150 -5
- package/dist/config/load.js.map +1 -1
- package/dist/config/settings.d.ts +18 -2
- package/dist/config/settings.js +40 -6
- package/dist/config/settings.js.map +1 -1
- package/dist/env-args.d.ts +6 -0
- package/dist/env-args.js +31 -1
- package/dist/env-args.js.map +1 -1
- package/dist/exit.d.ts +20 -0
- package/dist/exit.js +28 -0
- package/dist/exit.js.map +1 -0
- package/dist/history/client.d.ts +8 -0
- package/dist/history/client.js +24 -1
- package/dist/history/client.js.map +1 -1
- package/dist/history/lock.d.ts +5 -1
- package/dist/history/lock.js +8 -2
- package/dist/history/lock.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/init/adopt.js +8 -3
- package/dist/init/adopt.js.map +1 -1
- package/dist/init/live.d.ts +11 -0
- package/dist/init/live.js +25 -2
- package/dist/init/live.js.map +1 -1
- package/dist/lint/check.d.ts +8 -1
- package/dist/lint/check.js +38 -4
- 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/server.d.ts +40 -0
- package/dist/mcp/server.js +106 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +72 -0
- package/dist/mcp/tools.js +178 -0
- package/dist/mcp/tools.js.map +1 -0
- 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/checks.d.ts +28 -0
- package/dist/migrations/checks.js +97 -0
- package/dist/migrations/checks.js.map +1 -0
- package/dist/migrations/create.d.ts +3 -1
- package/dist/migrations/create.js +3 -0
- package/dist/migrations/create.js.map +1 -1
- package/dist/migrations/directory.js +4 -0
- package/dist/migrations/directory.js.map +1 -1
- package/dist/migrations/document.d.ts +33 -0
- package/dist/migrations/document.js +2 -0
- package/dist/migrations/document.js.map +1 -1
- package/dist/migrations/index.d.ts +3 -0
- package/dist/migrations/index.js +3 -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/forge.d.ts +4 -0
- package/dist/pr/forge.js +21 -7
- package/dist/pr/forge.js.map +1 -1
- package/dist/pr/issue.d.ts +68 -0
- package/dist/pr/issue.js +107 -0
- package/dist/pr/issue.js.map +1 -0
- package/dist/pr/model.d.ts +12 -1
- package/dist/pr/model.js +44 -6
- package/dist/pr/model.js.map +1 -1
- package/dist/pr/render.d.ts +3 -1
- package/dist/pr/render.js +63 -4
- 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/index.d.ts +3 -0
- package/dist/replay/index.js +3 -0
- package/dist/replay/index.js.map +1 -1
- package/dist/replay/replay.d.ts +9 -1
- package/dist/replay/replay.js +63 -32
- 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/replay/shared.d.ts +28 -0
- package/dist/replay/shared.js +77 -0
- package/dist/replay/shared.js.map +1 -0
- 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 +37 -0
- package/dist/schemas.js +41 -0
- package/dist/schemas.js.map +1 -0
- package/dist/server.d.ts +40 -0
- package/dist/server.js +87 -0
- package/dist/server.js.map +1 -0
- 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/backfill.d.ts +21 -17
- package/dist/steps/backfill.js +20 -20
- package/dist/steps/backfill.js.map +1 -1
- package/dist/steps/index.d.ts +2 -2
- package/dist/steps/index.js +3 -3
- package/dist/steps/index.js.map +1 -1
- 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/steps/rebuild.d.ts +15 -15
- package/dist/steps/rebuild.js +17 -24
- package/dist/steps/rebuild.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/checks.d.ts +29 -0
- package/dist/versioned/checks.js +54 -0
- package/dist/versioned/checks.js.map +1 -0
- package/dist/versioned/clickhouse.js +8 -0
- package/dist/versioned/clickhouse.js.map +1 -1
- package/dist/versioned/driver.d.ts +10 -0
- package/dist/versioned/engine.d.ts +61 -1
- package/dist/versioned/engine.js +109 -6
- package/dist/versioned/engine.js.map +1 -1
- package/dist/versioned/explain.js +7 -2
- package/dist/versioned/explain.js.map +1 -1
- package/dist/versioned/index.d.ts +10 -0
- package/dist/versioned/index.js +25 -1
- package/dist/versioned/index.js.map +1 -1
- package/dist/versioned/op.d.ts +16 -1
- package/dist/versioned/op.js +43 -6
- package/dist/versioned/op.js.map +1 -1
- package/dist/versioned/policy.d.ts +98 -0
- package/dist/versioned/policy.js +212 -0
- package/dist/versioned/policy.js.map +1 -0
- package/dist/versioned/postgres/driver.d.ts +3 -1
- package/dist/versioned/postgres/driver.js +30 -3
- package/dist/versioned/postgres/driver.js.map +1 -1
- package/dist/versioned/postgres/waits.d.ts +46 -0
- package/dist/versioned/postgres/waits.js +78 -0
- package/dist/versioned/postgres/waits.js.map +1 -0
- package/dist/versioned/report.d.ts +3 -0
- package/dist/versioned/report.js +13 -1
- 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/stand-down.d.ts +30 -0
- package/dist/versioned/stand-down.js +56 -0
- package/dist/versioned/stand-down.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 +22 -8
- package/schemas/apply.schema.json +428 -0
- package/schemas/checkpoint.schema.json +19 -0
- package/schemas/common.schema.json +213 -0
- package/schemas/drift.schema.json +61 -0
- package/schemas/event.schema.json +36 -0
- package/schemas/init.schema.json +31 -0
- package/schemas/lint-rules.schema.json +54 -0
- package/schemas/lint.schema.json +294 -0
- package/schemas/mcp.schema.json +70 -0
- package/schemas/new.schema.json +71 -0
- package/schemas/plan.schema.json +489 -0
- package/schemas/rebase.schema.json +54 -0
- package/schemas/repair.schema.json +20 -0
- package/schemas/report.schema.json +114 -0
- package/schemas/revert.schema.json +69 -0
- package/schemas/status.schema.json +371 -0
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
"against": {
|
|
35
|
+
"description": "What the server was compared with: src, the project's declarations; or history, the schema the newest applied migration records (migration null when none is applied yet).",
|
|
36
|
+
"oneOf": [
|
|
37
|
+
{ "type": "object", "additionalProperties": false, "required": ["source"], "properties": { "source": { "const": "src" } } },
|
|
38
|
+
{
|
|
39
|
+
"type": "object",
|
|
40
|
+
"additionalProperties": false,
|
|
41
|
+
"required": ["source", "migration"],
|
|
42
|
+
"properties": { "source": { "const": "history" }, "migration": { "type": ["string", "null"] } }
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"drifted": { "description": "A declared object changed or is gone: the command exits 2.", "type": "boolean" },
|
|
47
|
+
"fingerprint": { "description": "A hash of the environment and what drifted: the same for the same drift, run after run.", "type": "string" },
|
|
48
|
+
"issue": {
|
|
49
|
+
"description": "--issue: what yodel did with the environment's tracking issue, and the issue when there is one.",
|
|
50
|
+
"type": "object",
|
|
51
|
+
"additionalProperties": false,
|
|
52
|
+
"required": ["action"],
|
|
53
|
+
"properties": {
|
|
54
|
+
"action": { "enum": ["opened", "updated", "unchanged", "closed", "left", "none"] },
|
|
55
|
+
"number": { "type": "integer" },
|
|
56
|
+
"url": { "type": "string" }
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"issueError": { "description": "--issue: the tracking issue could not be written, and why.", "type": "string" }
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/sql-yodeler/schemas/v1/event.schema.json",
|
|
4
|
+
"title": "a yodel webhook event",
|
|
5
|
+
"description": "Version 1. The body yodel apply, yodel plan and yodel drift post to the webhook yodel.config.ts notify names, signed with HMAC-SHA256 over '<x-yodel-timestamp>.<body>' in the x-yodel-signature header. Within a version, fields are only added; a receiver ignores fields it does not know.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["version", "id", "event", "at", "environment", "command", "status", "summary", "migrations"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"version": { "const": 1 },
|
|
11
|
+
"id": { "type": "string", "description": "Unique per event; also the x-yodel-delivery header." },
|
|
12
|
+
"event": { "enum": ["waiting", "refused", "failed", "drift"] },
|
|
13
|
+
"at": { "type": "string", "format": "date-time" },
|
|
14
|
+
"environment": { "type": "string" },
|
|
15
|
+
"command": { "enum": ["apply", "plan", "drift"] },
|
|
16
|
+
"status": { "type": "string", "description": "The command's own word for the outcome: gated, refused, denied, failed, incomplete, drifted." },
|
|
17
|
+
"summary": { "type": "string" },
|
|
18
|
+
"migrations": { "type": "array", "items": { "type": "string" }, "description": "The pending migrations, for apply and plan." },
|
|
19
|
+
"digest": { "type": "string", "description": "The plan digest the run computed." },
|
|
20
|
+
"approve": { "type": "string", "description": "On waiting: the command that approves the plan." },
|
|
21
|
+
"reason": { "type": "string" },
|
|
22
|
+
"drift": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": false,
|
|
25
|
+
"required": ["changed", "missing"],
|
|
26
|
+
"properties": {
|
|
27
|
+
"changed": { "type": "array", "items": { "type": "string" } },
|
|
28
|
+
"missing": { "type": "array", "items": { "type": "string" } },
|
|
29
|
+
"fingerprint": { "type": "string", "description": "The same drift has the same fingerprint run after run, so a receiver can tell a repeat from new drift." }
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"runUrl": { "type": "string" },
|
|
33
|
+
"repository": { "type": "string" },
|
|
34
|
+
"commit": { "type": "string" }
|
|
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
|
+
}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/sql-yodeler/schemas/v1/lint.schema.json",
|
|
4
|
+
"title": "yodel lint --json",
|
|
5
|
+
"description": "Version 1. The findings, the silences each migration holds, and with --replay the replay check's result. yodel lint --rules --json prints lint-rules.schema.json instead. Within a version, fields are only added; a reader ignores fields it does not know.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"status",
|
|
10
|
+
"dialect",
|
|
11
|
+
"migrations",
|
|
12
|
+
"errors",
|
|
13
|
+
"warnings",
|
|
14
|
+
"silenced",
|
|
15
|
+
"findings",
|
|
16
|
+
"silences"
|
|
17
|
+
],
|
|
18
|
+
"properties": {
|
|
19
|
+
"status": {
|
|
20
|
+
"description": "failed when a finding at level error is not silenced: the command exits 3.",
|
|
21
|
+
"enum": [
|
|
22
|
+
"passed",
|
|
23
|
+
"failed"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"environment": {
|
|
27
|
+
"description": "With --env: the environment whose history the migrations were compared with.",
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
"dialect": {
|
|
31
|
+
"oneOf": [
|
|
32
|
+
{
|
|
33
|
+
"$ref": "common.schema.json#/$defs/dialect"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"type": "null"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"migrations": {
|
|
41
|
+
"description": "Every migration read, sorted by id.",
|
|
42
|
+
"$ref": "common.schema.json#/$defs/stringList"
|
|
43
|
+
},
|
|
44
|
+
"errors": {
|
|
45
|
+
"type": "integer",
|
|
46
|
+
"minimum": 0
|
|
47
|
+
},
|
|
48
|
+
"warnings": {
|
|
49
|
+
"type": "integer",
|
|
50
|
+
"minimum": 0
|
|
51
|
+
},
|
|
52
|
+
"silenced": {
|
|
53
|
+
"type": "integer",
|
|
54
|
+
"minimum": 0
|
|
55
|
+
},
|
|
56
|
+
"findings": {
|
|
57
|
+
"type": "array",
|
|
58
|
+
"items": {
|
|
59
|
+
"type": "object",
|
|
60
|
+
"additionalProperties": false,
|
|
61
|
+
"required": [
|
|
62
|
+
"rule",
|
|
63
|
+
"level",
|
|
64
|
+
"message"
|
|
65
|
+
],
|
|
66
|
+
"properties": {
|
|
67
|
+
"rule": {
|
|
68
|
+
"type": "string"
|
|
69
|
+
},
|
|
70
|
+
"level": {
|
|
71
|
+
"enum": [
|
|
72
|
+
"error",
|
|
73
|
+
"warning"
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"message": {
|
|
77
|
+
"type": "string"
|
|
78
|
+
},
|
|
79
|
+
"migration": {
|
|
80
|
+
"type": "string"
|
|
81
|
+
},
|
|
82
|
+
"step": {
|
|
83
|
+
"type": "integer"
|
|
84
|
+
},
|
|
85
|
+
"object": {
|
|
86
|
+
"type": "string"
|
|
87
|
+
},
|
|
88
|
+
"line": {
|
|
89
|
+
"type": "integer"
|
|
90
|
+
},
|
|
91
|
+
"silenced": {
|
|
92
|
+
"description": "A -- yodel:allow line silenced it: the reason given. A silenced finding fails nothing.",
|
|
93
|
+
"type": "string"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"silences": {
|
|
99
|
+
"description": "The silences each migration's migration.sql holds, by migration id.",
|
|
100
|
+
"type": "object",
|
|
101
|
+
"additionalProperties": {
|
|
102
|
+
"type": "array",
|
|
103
|
+
"items": {
|
|
104
|
+
"type": "object",
|
|
105
|
+
"additionalProperties": false,
|
|
106
|
+
"required": [
|
|
107
|
+
"step",
|
|
108
|
+
"rule",
|
|
109
|
+
"reason",
|
|
110
|
+
"line"
|
|
111
|
+
],
|
|
112
|
+
"properties": {
|
|
113
|
+
"step": {
|
|
114
|
+
"type": "integer"
|
|
115
|
+
},
|
|
116
|
+
"rule": {
|
|
117
|
+
"type": "string"
|
|
118
|
+
},
|
|
119
|
+
"reason": {
|
|
120
|
+
"type": "string"
|
|
121
|
+
},
|
|
122
|
+
"line": {
|
|
123
|
+
"type": "integer"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"replay": {
|
|
130
|
+
"$ref": "#/$defs/replay"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"$defs": {
|
|
134
|
+
"replayed": {
|
|
135
|
+
"type": "object",
|
|
136
|
+
"additionalProperties": false,
|
|
137
|
+
"required": [
|
|
138
|
+
"id",
|
|
139
|
+
"statements",
|
|
140
|
+
"ran",
|
|
141
|
+
"skipped"
|
|
142
|
+
],
|
|
143
|
+
"properties": {
|
|
144
|
+
"id": {
|
|
145
|
+
"type": "string"
|
|
146
|
+
},
|
|
147
|
+
"statements": {
|
|
148
|
+
"type": "integer"
|
|
149
|
+
},
|
|
150
|
+
"ran": {
|
|
151
|
+
"$ref": "common.schema.json#/$defs/stringList"
|
|
152
|
+
},
|
|
153
|
+
"skipped": {
|
|
154
|
+
"$ref": "common.schema.json#/$defs/stringList"
|
|
155
|
+
},
|
|
156
|
+
"checkpoint": {
|
|
157
|
+
"description": "A checkpoint, replayed on its own into an empty database after the chain.",
|
|
158
|
+
"const": true
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"replay": {
|
|
163
|
+
"description": "With --replay: the history replayed into an empty database, migration by migration, against each one's recorded schema.",
|
|
164
|
+
"type": "object",
|
|
165
|
+
"required": [
|
|
166
|
+
"dialect",
|
|
167
|
+
"where",
|
|
168
|
+
"scope",
|
|
169
|
+
"reset",
|
|
170
|
+
"kept",
|
|
171
|
+
"matched",
|
|
172
|
+
"total",
|
|
173
|
+
"outcome",
|
|
174
|
+
"ok"
|
|
175
|
+
],
|
|
176
|
+
"unevaluatedProperties": false,
|
|
177
|
+
"properties": {
|
|
178
|
+
"dialect": {
|
|
179
|
+
"$ref": "common.schema.json#/$defs/dialect"
|
|
180
|
+
},
|
|
181
|
+
"where": {
|
|
182
|
+
"type": "string"
|
|
183
|
+
},
|
|
184
|
+
"scope": {
|
|
185
|
+
"$ref": "common.schema.json#/$defs/stringList"
|
|
186
|
+
},
|
|
187
|
+
"reset": {
|
|
188
|
+
"type": "boolean"
|
|
189
|
+
},
|
|
190
|
+
"kept": {
|
|
191
|
+
"type": "boolean"
|
|
192
|
+
},
|
|
193
|
+
"matched": {
|
|
194
|
+
"type": "array",
|
|
195
|
+
"items": {
|
|
196
|
+
"$ref": "#/$defs/replayed"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"total": {
|
|
200
|
+
"type": "integer"
|
|
201
|
+
},
|
|
202
|
+
"outcome": {
|
|
203
|
+
"enum": [
|
|
204
|
+
"matches",
|
|
205
|
+
"differs",
|
|
206
|
+
"failed",
|
|
207
|
+
"unreplayable"
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
"ok": {
|
|
211
|
+
"type": "boolean"
|
|
212
|
+
},
|
|
213
|
+
"message": {
|
|
214
|
+
"type": "string"
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
"oneOf": [
|
|
218
|
+
{
|
|
219
|
+
"properties": {
|
|
220
|
+
"outcome": {
|
|
221
|
+
"const": "matches"
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"type": "object"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"required": [
|
|
228
|
+
"migration",
|
|
229
|
+
"changes"
|
|
230
|
+
],
|
|
231
|
+
"properties": {
|
|
232
|
+
"outcome": {
|
|
233
|
+
"const": "differs"
|
|
234
|
+
},
|
|
235
|
+
"migration": {
|
|
236
|
+
"$ref": "#/$defs/replayed"
|
|
237
|
+
},
|
|
238
|
+
"changes": {
|
|
239
|
+
"type": "array",
|
|
240
|
+
"items": {
|
|
241
|
+
"$ref": "common.schema.json#/$defs/change"
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
"type": "object"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"required": [
|
|
249
|
+
"migration",
|
|
250
|
+
"step",
|
|
251
|
+
"error"
|
|
252
|
+
],
|
|
253
|
+
"properties": {
|
|
254
|
+
"outcome": {
|
|
255
|
+
"const": "failed"
|
|
256
|
+
},
|
|
257
|
+
"migration": {
|
|
258
|
+
"type": "string"
|
|
259
|
+
},
|
|
260
|
+
"step": {
|
|
261
|
+
"type": "integer"
|
|
262
|
+
},
|
|
263
|
+
"error": {
|
|
264
|
+
"type": "string"
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
"type": "object"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"required": [
|
|
271
|
+
"migration",
|
|
272
|
+
"step",
|
|
273
|
+
"reason"
|
|
274
|
+
],
|
|
275
|
+
"properties": {
|
|
276
|
+
"outcome": {
|
|
277
|
+
"const": "unreplayable"
|
|
278
|
+
},
|
|
279
|
+
"migration": {
|
|
280
|
+
"type": "string"
|
|
281
|
+
},
|
|
282
|
+
"step": {
|
|
283
|
+
"type": "integer"
|
|
284
|
+
},
|
|
285
|
+
"reason": {
|
|
286
|
+
"type": "string"
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
"type": "object"
|
|
290
|
+
}
|
|
291
|
+
]
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/sql-yodeler/schemas/v1/mcp.schema.json",
|
|
4
|
+
"title": "A yodel mcp tool result",
|
|
5
|
+
"description": "Version 1. Every tool of yodel mcp returns this envelope, as the call's structuredContent and as its text. results follows the schema resultsSchema names: the command's own (status, plan, lint, drift) or a definition here (history, explain). Within a version, fields are only added; a reader ignores fields it does not know.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["schema", "tool", "command", "exit", "results", "resultsSchema"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schema": { "description": "The envelope's version.", "const": 1 },
|
|
11
|
+
"tool": { "enum": ["status", "plan", "lint", "drift", "history", "explain"] },
|
|
12
|
+
"command": { "description": "The yodel command line the tool ran.", "type": "string" },
|
|
13
|
+
"exit": { "description": "The command's exit code, the same as on a terminal (yodel --help lists them).", "type": "integer" },
|
|
14
|
+
"results": { "description": "What the command printed with --json; null when it printed nothing (it failed: see error)." },
|
|
15
|
+
"resultsSchema": { "description": "The $id of the schema results follows.", "type": "string" },
|
|
16
|
+
"error": { "description": "What the command wrote to stderr: why it failed when results is null, else notices.", "type": "string" },
|
|
17
|
+
"forPerson": {
|
|
18
|
+
"description": "Steps that belong to a person, each with the command the person runs. An agent shows them and never runs them.",
|
|
19
|
+
"type": "array",
|
|
20
|
+
"items": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"additionalProperties": false,
|
|
23
|
+
"required": ["action", "command"],
|
|
24
|
+
"properties": { "action": { "type": "string" }, "command": { "type": "string" } }
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"$defs": {
|
|
29
|
+
"history": {
|
|
30
|
+
"description": "The history tool: the migrations the environment's history records applied, from yodel status.",
|
|
31
|
+
"type": "object",
|
|
32
|
+
"additionalProperties": false,
|
|
33
|
+
"required": ["environment", "history", "applied"],
|
|
34
|
+
"properties": {
|
|
35
|
+
"environment": { "type": "string" },
|
|
36
|
+
"server": { "$ref": "common.schema.json#/$defs/server" },
|
|
37
|
+
"history": { "$ref": "status.schema.json#/$defs/report/properties/history" },
|
|
38
|
+
"applied": { "$ref": "status.schema.json#/$defs/report/properties/applied" }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"explain": {
|
|
42
|
+
"description": "The explain tool: a lint rule, or an exit code.",
|
|
43
|
+
"oneOf": [
|
|
44
|
+
{
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": ["topic", "kind", "rule", "docs"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"topic": { "type": "string" },
|
|
50
|
+
"kind": { "const": "lint-rule" },
|
|
51
|
+
"rule": { "$ref": "lint-rules.schema.json#/items" },
|
|
52
|
+
"docs": { "type": "string" }
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"type": "object",
|
|
57
|
+
"additionalProperties": false,
|
|
58
|
+
"required": ["topic", "kind", "code", "meaning", "docs"],
|
|
59
|
+
"properties": {
|
|
60
|
+
"topic": { "type": "string" },
|
|
61
|
+
"kind": { "const": "exit-code" },
|
|
62
|
+
"code": { "type": "integer" },
|
|
63
|
+
"meaning": { "type": "string" },
|
|
64
|
+
"docs": { "type": "string" }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/sql-yodeler/schemas/v1/new.schema.json",
|
|
4
|
+
"title": "yodel new <name> --json",
|
|
5
|
+
"description": "Version 1. The migration written (written true), or why none was: a backfill template to fill in, a --replace that kept the migration, or no change from the newest migration's recorded schema. Within a version, fields are only added; a reader ignores fields it does not know.",
|
|
6
|
+
"oneOf": [{ "$ref": "#/$defs/written" }, { "$ref": "#/$defs/template" }, { "$ref": "#/$defs/kept" }, { "$ref": "#/$defs/unchanged" }],
|
|
7
|
+
"$defs": {
|
|
8
|
+
"written": {
|
|
9
|
+
"type": "object",
|
|
10
|
+
"additionalProperties": false,
|
|
11
|
+
"required": ["written", "id", "path", "parent", "checksum", "dialect", "statements", "ops", "manual", "hints", "checks"],
|
|
12
|
+
"properties": {
|
|
13
|
+
"written": { "const": true },
|
|
14
|
+
"id": { "type": "string" },
|
|
15
|
+
"path": { "type": "string" },
|
|
16
|
+
"parent": { "type": ["string", "null"] },
|
|
17
|
+
"checksum": { "type": "string" },
|
|
18
|
+
"dialect": { "$ref": "common.schema.json#/$defs/dialect" },
|
|
19
|
+
"statements": { "type": "integer", "minimum": 0 },
|
|
20
|
+
"ops": {
|
|
21
|
+
"description": "The Op steps written, which yodel apply runs or refuses.",
|
|
22
|
+
"type": "array",
|
|
23
|
+
"items": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"additionalProperties": false,
|
|
26
|
+
"required": ["op", "object", "name", "rules"],
|
|
27
|
+
"properties": { "op": { "type": "string" }, "object": { "type": "string" }, "name": { "type": "string" }, "rules": { "$ref": "common.schema.json#/$defs/stringList" } }
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"manual": {
|
|
31
|
+
"description": "The manual steps written: yodel apply refuses them.",
|
|
32
|
+
"type": "array",
|
|
33
|
+
"items": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"required": ["object", "name", "rules", "detail"],
|
|
37
|
+
"properties": { "object": { "type": "string" }, "name": { "type": "string" }, "rules": { "$ref": "common.schema.json#/$defs/stringList" }, "detail": { "type": "string" } }
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"hints": { "$ref": "common.schema.json#/$defs/stringList" },
|
|
41
|
+
"checks": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/check" } }
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"template": {
|
|
45
|
+
"description": "--backfill named a file that is not there: the template was written to it, and no migration.",
|
|
46
|
+
"type": "object",
|
|
47
|
+
"additionalProperties": false,
|
|
48
|
+
"required": ["written", "template"],
|
|
49
|
+
"properties": { "written": { "const": false }, "template": { "type": "string" } }
|
|
50
|
+
},
|
|
51
|
+
"kept": {
|
|
52
|
+
"description": "--replace: the replacement would be the same, so the migration was kept.",
|
|
53
|
+
"type": "object",
|
|
54
|
+
"additionalProperties": false,
|
|
55
|
+
"required": ["written", "replaced", "kept"],
|
|
56
|
+
"properties": { "written": { "const": false }, "replaced": { "type": "null" }, "kept": { "type": "string" } }
|
|
57
|
+
},
|
|
58
|
+
"unchanged": {
|
|
59
|
+
"description": "The declared schema matches the newest migration's recorded schema.",
|
|
60
|
+
"type": "object",
|
|
61
|
+
"additionalProperties": false,
|
|
62
|
+
"required": ["written", "parent", "dialect", "hints"],
|
|
63
|
+
"properties": {
|
|
64
|
+
"written": { "const": false },
|
|
65
|
+
"parent": { "type": ["string", "null"] },
|
|
66
|
+
"dialect": { "$ref": "common.schema.json#/$defs/dialect" },
|
|
67
|
+
"hints": { "$ref": "common.schema.json#/$defs/stringList" }
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|