@adminiumjs/meta 0.2.2 → 0.2.3

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 (75) hide show
  1. package/dist/ids.d.ts +2 -0
  2. package/dist/ids.d.ts.map +1 -1
  3. package/dist/ids.js +7 -0
  4. package/dist/ids.js.map +1 -1
  5. package/dist/migrations/0015_connection_tenant_config.d.ts +42 -0
  6. package/dist/migrations/0015_connection_tenant_config.d.ts.map +1 -0
  7. package/dist/migrations/0015_connection_tenant_config.js +53 -0
  8. package/dist/migrations/0015_connection_tenant_config.js.map +1 -0
  9. package/dist/migrations/0016_audit_entity.d.ts +33 -0
  10. package/dist/migrations/0016_audit_entity.d.ts.map +1 -0
  11. package/dist/migrations/0016_audit_entity.js +137 -0
  12. package/dist/migrations/0016_audit_entity.js.map +1 -0
  13. package/dist/migrations/0017_surface_binding.d.ts +23 -0
  14. package/dist/migrations/0017_surface_binding.d.ts.map +1 -0
  15. package/dist/migrations/0017_surface_binding.js +37 -0
  16. package/dist/migrations/0017_surface_binding.js.map +1 -0
  17. package/dist/migrations/0018_connection_timezone_source.d.ts +44 -0
  18. package/dist/migrations/0018_connection_timezone_source.d.ts.map +1 -0
  19. package/dist/migrations/0018_connection_timezone_source.js +51 -0
  20. package/dist/migrations/0018_connection_timezone_source.js.map +1 -0
  21. package/dist/migrations/0019_connection_disabled.d.ts +38 -0
  22. package/dist/migrations/0019_connection_disabled.d.ts.map +1 -0
  23. package/dist/migrations/0019_connection_disabled.js +43 -0
  24. package/dist/migrations/0019_connection_disabled.js.map +1 -0
  25. package/dist/migrations/0020_manifests_add_on.d.ts +71 -0
  26. package/dist/migrations/0020_manifests_add_on.d.ts.map +1 -0
  27. package/dist/migrations/0020_manifests_add_on.js +111 -0
  28. package/dist/migrations/0020_manifests_add_on.js.map +1 -0
  29. package/dist/migrations/0021_add_on_credentials.d.ts +50 -0
  30. package/dist/migrations/0021_add_on_credentials.d.ts.map +1 -0
  31. package/dist/migrations/0021_add_on_credentials.js +80 -0
  32. package/dist/migrations/0021_add_on_credentials.js.map +1 -0
  33. package/dist/migrations/0022_studio_namespace.d.ts +44 -0
  34. package/dist/migrations/0022_studio_namespace.d.ts.map +1 -0
  35. package/dist/migrations/0022_studio_namespace.js +113 -0
  36. package/dist/migrations/0022_studio_namespace.js.map +1 -0
  37. package/dist/migrations/index.d.ts.map +1 -1
  38. package/dist/migrations/index.js +16 -0
  39. package/dist/migrations/index.js.map +1 -1
  40. package/dist/repos/audit.d.ts.map +1 -1
  41. package/dist/repos/audit.js +8 -2
  42. package/dist/repos/audit.js.map +1 -1
  43. package/dist/repos/connections.d.ts +62 -0
  44. package/dist/repos/connections.d.ts.map +1 -1
  45. package/dist/repos/connections.js +104 -0
  46. package/dist/repos/connections.js.map +1 -1
  47. package/dist/repos/index.d.ts +1 -0
  48. package/dist/repos/index.d.ts.map +1 -1
  49. package/dist/repos/index.js +1 -0
  50. package/dist/repos/index.js.map +1 -1
  51. package/dist/repos/manifests.d.ts +139 -0
  52. package/dist/repos/manifests.d.ts.map +1 -0
  53. package/dist/repos/manifests.js +279 -0
  54. package/dist/repos/manifests.js.map +1 -0
  55. package/dist/repos/pages.d.ts +7 -0
  56. package/dist/repos/pages.d.ts.map +1 -1
  57. package/dist/repos/pages.js +39 -8
  58. package/dist/repos/pages.js.map +1 -1
  59. package/dist/repos/public-api.d.ts +24 -0
  60. package/dist/repos/public-api.d.ts.map +1 -1
  61. package/dist/repos/public-api.js +50 -0
  62. package/dist/repos/public-api.js.map +1 -1
  63. package/dist/schema/json-payloads.d.ts +27 -2
  64. package/dist/schema/json-payloads.d.ts.map +1 -1
  65. package/dist/schema/json-payloads.js +41 -2
  66. package/dist/schema/json-payloads.js.map +1 -1
  67. package/dist/schema/settings-registry.d.ts +26 -0
  68. package/dist/schema/settings-registry.d.ts.map +1 -1
  69. package/dist/schema/settings-registry.js +130 -0
  70. package/dist/schema/settings-registry.js.map +1 -1
  71. package/dist/schema/tables.d.ts +89 -1
  72. package/dist/schema/tables.d.ts.map +1 -1
  73. package/dist/schema/tables.js +2 -0
  74. package/dist/schema/tables.js.map +1 -1
  75. package/package.json +1 -1
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Wave 0020 — the add-on half of `adminium_manifests`, plus the attachment
3
+ * table an add-on needs and an app does not
4
+ * (26-add-on-runtime.md §4, as amended 2026-08-29).
5
+ *
6
+ * ─── This ALTERs. It does not create. ───────────────────────────────────────
7
+ *
8
+ * 26 §4 as first written said `adminium_manifests` "does not exist at all
9
+ * today, so this creates it rather than altering it", and `research/BRIEF.md`
10
+ * §6 and `16-milestones.md` M16-T02 repeated it. All three were wrong: the
11
+ * table has shipped since `0006_platform.ts:319-348`. It has no repo, no
12
+ * writer and zero rows, which is how three documents came to record a shipped
13
+ * table as absent — and it is why this migration adds two columns to something
14
+ * that is already there rather than creating a fourth copy of the idea.
15
+ *
16
+ * Three shipped columns this plan never accounted for come along for the ride:
17
+ * `connection_id`, `status`, and **`license_key_encrypted`** — a column 17
18
+ * defers by name. It is deliberately left alone rather than dropped: it is
19
+ * empty, dropping a column is the one irreversible thing a migration can do,
20
+ * and "17 defers licences" is an argument for never WRITING it, which costs
21
+ * nothing to honour. `repos/manifests.ts` never reads or writes it.
22
+ *
23
+ * ─── Why attachments are a table and not `attached_to` on the row ───────────
24
+ *
25
+ * 26 O3 asks how one add-on attaches to several hosts and recommends "two rows,
26
+ * keyed `(manifest_key, attached_to)`". **This does not do that**, and the
27
+ * reason is a cost O3 could not have weighed, because it was written believing
28
+ * the table did not exist yet:
29
+ *
30
+ * 1. **Two rows means two manifest documents.** `manifest` is the whole
31
+ * validated JSON. An add-on attached to two hosts would store it twice, and
32
+ * every upgrade would have to rewrite N rows atomically to avoid a
33
+ * deployment where one attachment is on 1.1.0 and the other on 1.0.0.
34
+ * 2. **It makes the credential FK ambiguous.** `adminium_add_on_credentials`
35
+ * (0021) is one row per CONNECTED add-on — a DHL API key belongs to the
36
+ * add-on, not to one of its attachments. With two manifest rows, that FK
37
+ * points at whichever row happened to be inserted first, and disconnecting
38
+ * "the other one" either orphans a secret or deletes a live one.
39
+ * 3. **It requires editing a shipped constraint.** `uq_adminium_manifests_manifest_key`
40
+ * is UNIQUE on `manifest_key` ALONE (`0006_platform.ts:344-348`). Two rows
41
+ * per key violates it, so O3's shape means dropping and recreating a shipped
42
+ * index across three dialects — against §4's own "never edit a shipped
43
+ * migration".
44
+ *
45
+ * An attachment is a many-to-many fact between a manifest and a host app, so it
46
+ * gets the table that models one. The shipped unique index stays true (one
47
+ * manifest, one row, one document, one credential), and `attaches` in the
48
+ * manifest stays what it always was: the set of hosts this add-on MAY attach to,
49
+ * of which the rows below record the ones it actually is attached to.
50
+ *
51
+ * ─── Why `disabled_at` and not a boolean ───────────────────────────────────
52
+ *
53
+ * §5.1's `PATCH /add-ons/:key` enables and disables per surface, and that state
54
+ * belongs on the attachment rather than on the manifest: an add-on can be
55
+ * legitimately live on one host and switched off on another. The timestamp
56
+ * follows 0019's discipline verbatim — NULL means enabled, and "how long has
57
+ * this been off" is the question that follows a disable, which a boolean cannot
58
+ * answer.
59
+ *
60
+ * ─── Backfill ──────────────────────────────────────────────────────────────
61
+ *
62
+ * None, and not for the usual reason: the table has zero rows in every
63
+ * deployment, because nothing has ever written to it. `kind` still carries a
64
+ * default so the column is honest about what a pre-existing row would have
65
+ * meant — `adminium_manifests` was introduced for installed micro-SaaS apps
66
+ * (13-marketplace.md), so an unlabelled row is an app.
67
+ */
68
+ import type { Kysely } from 'kysely';
69
+ import type { ColumnHelpers } from '../columns.js';
70
+ export declare function up(db: Kysely<unknown>, c: ColumnHelpers): Promise<void>;
71
+ //# sourceMappingURL=0020_manifests_add_on.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0020_manifests_add_on.d.ts","sourceRoot":"","sources":["../../src/migrations/0020_manifests_add_on.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,wBAAsB,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAiD7E"}
@@ -0,0 +1,111 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ /**
3
+ * Wave 0020 — the add-on half of `adminium_manifests`, plus the attachment
4
+ * table an add-on needs and an app does not
5
+ * (26-add-on-runtime.md §4, as amended 2026-08-29).
6
+ *
7
+ * ─── This ALTERs. It does not create. ───────────────────────────────────────
8
+ *
9
+ * 26 §4 as first written said `adminium_manifests` "does not exist at all
10
+ * today, so this creates it rather than altering it", and `research/BRIEF.md`
11
+ * §6 and `16-milestones.md` M16-T02 repeated it. All three were wrong: the
12
+ * table has shipped since `0006_platform.ts:319-348`. It has no repo, no
13
+ * writer and zero rows, which is how three documents came to record a shipped
14
+ * table as absent — and it is why this migration adds two columns to something
15
+ * that is already there rather than creating a fourth copy of the idea.
16
+ *
17
+ * Three shipped columns this plan never accounted for come along for the ride:
18
+ * `connection_id`, `status`, and **`license_key_encrypted`** — a column 17
19
+ * defers by name. It is deliberately left alone rather than dropped: it is
20
+ * empty, dropping a column is the one irreversible thing a migration can do,
21
+ * and "17 defers licences" is an argument for never WRITING it, which costs
22
+ * nothing to honour. `repos/manifests.ts` never reads or writes it.
23
+ *
24
+ * ─── Why attachments are a table and not `attached_to` on the row ───────────
25
+ *
26
+ * 26 O3 asks how one add-on attaches to several hosts and recommends "two rows,
27
+ * keyed `(manifest_key, attached_to)`". **This does not do that**, and the
28
+ * reason is a cost O3 could not have weighed, because it was written believing
29
+ * the table did not exist yet:
30
+ *
31
+ * 1. **Two rows means two manifest documents.** `manifest` is the whole
32
+ * validated JSON. An add-on attached to two hosts would store it twice, and
33
+ * every upgrade would have to rewrite N rows atomically to avoid a
34
+ * deployment where one attachment is on 1.1.0 and the other on 1.0.0.
35
+ * 2. **It makes the credential FK ambiguous.** `adminium_add_on_credentials`
36
+ * (0021) is one row per CONNECTED add-on — a DHL API key belongs to the
37
+ * add-on, not to one of its attachments. With two manifest rows, that FK
38
+ * points at whichever row happened to be inserted first, and disconnecting
39
+ * "the other one" either orphans a secret or deletes a live one.
40
+ * 3. **It requires editing a shipped constraint.** `uq_adminium_manifests_manifest_key`
41
+ * is UNIQUE on `manifest_key` ALONE (`0006_platform.ts:344-348`). Two rows
42
+ * per key violates it, so O3's shape means dropping and recreating a shipped
43
+ * index across three dialects — against §4's own "never edit a shipped
44
+ * migration".
45
+ *
46
+ * An attachment is a many-to-many fact between a manifest and a host app, so it
47
+ * gets the table that models one. The shipped unique index stays true (one
48
+ * manifest, one row, one document, one credential), and `attaches` in the
49
+ * manifest stays what it always was: the set of hosts this add-on MAY attach to,
50
+ * of which the rows below record the ones it actually is attached to.
51
+ *
52
+ * ─── Why `disabled_at` and not a boolean ───────────────────────────────────
53
+ *
54
+ * §5.1's `PATCH /add-ons/:key` enables and disables per surface, and that state
55
+ * belongs on the attachment rather than on the manifest: an add-on can be
56
+ * legitimately live on one host and switched off on another. The timestamp
57
+ * follows 0019's discipline verbatim — NULL means enabled, and "how long has
58
+ * this been off" is the question that follows a disable, which a boolean cannot
59
+ * answer.
60
+ *
61
+ * ─── Backfill ──────────────────────────────────────────────────────────────
62
+ *
63
+ * None, and not for the usual reason: the table has zero rows in every
64
+ * deployment, because nothing has ever written to it. `kind` still carries a
65
+ * default so the column is honest about what a pre-existing row would have
66
+ * meant — `adminium_manifests` was introduced for installed micro-SaaS apps
67
+ * (13-marketplace.md), so an unlabelled row is an app.
68
+ */
69
+ import { metaTable } from '../prefix.js';
70
+ export async function up(db, c) {
71
+ // `kind` — 'app' | 'add-on' (@adminium/manifest MANIFEST_KINDS). An add-on IS
72
+ // a manifest (26 §4), so install, upgrade, uninstall and the audit trail need
73
+ // no parallel code path; this column is what tells the two apart.
74
+ await db.schema
75
+ .alterTable(metaTable('manifests'))
76
+ .addColumn('kind', c.str(12), (col) => col.notNull().defaultTo('app'))
77
+ .execute();
78
+ await db.schema
79
+ .createTable(metaTable('manifest_attachments'))
80
+ .ifNotExists()
81
+ .addColumn('id', c.id, (col) => col.primaryKey())
82
+ .addColumn('manifest_id', c.id, (col) => col.notNull())
83
+ // The host app's `manifest_key` (24 §5.7) — 80 to match
84
+ // `adminium_manifests.manifest_key`, the column it points at by value.
85
+ .addColumn('attached_to', c.str(80), (col) => col.notNull())
86
+ /** NULL = enabled on this host. Epoch ms, never a native datetime. */
87
+ .addColumn('disabled_at', c.ts)
88
+ .addColumn('created_at', c.ts, (col) => col.notNull())
89
+ // CASCADE, unlike the shipped manifests FKs' `set null`: an attachment with
90
+ // no manifest is not a degraded row, it is a row that means nothing. A
91
+ // named table-level constraint because MySQL parses an inline column-level
92
+ // `REFERENCES` and silently discards it (the 2026-07-20 CI onion).
93
+ .addForeignKeyConstraint('fk_adminium_manifest_attachments_manifest_id', ['manifest_id'], metaTable('manifests'), ['id'], (cb) => cb.onDelete('cascade'))
94
+ .execute();
95
+ // One attachment per (manifest, host). Re-attaching is idempotent rather than
96
+ // a second row, and the enable/disable state has one home.
97
+ await db.schema
98
+ .createIndex('uq_adminium_manifest_attachments_pair')
99
+ .on(metaTable('manifest_attachments'))
100
+ .columns(['manifest_id', 'attached_to'])
101
+ .unique()
102
+ .execute();
103
+ // The read the runtime actually makes: "what is attached to this host app,
104
+ // and is it on?" — `GET /api/v1/add-ons` runs it on every host page load.
105
+ await db.schema
106
+ .createIndex('ix_adminium_manifest_attachments_host')
107
+ .on(metaTable('manifest_attachments'))
108
+ .columns(['attached_to'])
109
+ .execute();
110
+ }
111
+ //# sourceMappingURL=0020_manifests_add_on.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0020_manifests_add_on.js","sourceRoot":"","sources":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,EAAE,CAAC;QACtD,4EAA4E;QAC5E,uEAAuE;QACvE,2EAA2E;QAC3E,mEAAmE;SAClE,uBAAuB,CACtB,8CAA8C,EAC9C,CAAC,aAAa,CAAC,EACf,SAAS,CAAC,WAAW,CAAC,EACtB,CAAC,IAAI,CAAC,EACN,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAC/B;SACA,OAAO,EAAE,CAAC;IAEb,8EAA8E;IAC9E,2DAA2D;IAC3D,MAAM,EAAE,CAAC,MAAM;SACZ,WAAW,CAAC,uCAAuC,CAAC;SACpD,EAAE,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC;SACrC,OAAO,CAAC,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;SACvC,MAAM,EAAE;SACR,OAAO,EAAE,CAAC;IAEb,2EAA2E;IAC3E,0EAA0E;IAC1E,MAAM,EAAE,CAAC,MAAM;SACZ,WAAW,CAAC,uCAAuC,CAAC;SACpD,EAAE,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC;SACrC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC;SACxB,OAAO,EAAE,CAAC;AACf,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Wave 0021 — `adminium_add_on_credentials`: the secret a connected add-on was
3
+ * given, and nothing else (26-add-on-runtime.md §4, D2, D5).
4
+ *
5
+ * ─── One row per connected add-on ──────────────────────────────────────────
6
+ *
7
+ * Not per attachment. A DHL API key belongs to the add-on the operator
8
+ * connected, not to each host app it happens to be mounted on — connecting it
9
+ * twice because it is attached twice would mean two copies of one secret, two
10
+ * places to revoke, and a disconnect that leaves one behind. The unique index
11
+ * on `manifest_id` is what makes "connected" a boolean fact about an add-on.
12
+ *
13
+ * ─── What is stored, and what is deliberately not ──────────────────────────
14
+ *
15
+ * `payload` is AES-256-GCM ciphertext over the whole credential envelope,
16
+ * encrypted with a key derived from `ADMINIUM_SECRET` — the same discipline
17
+ * `adminium_connections` uses for DSNs, reached through the same
18
+ * `config/secrets.ts` helpers rather than a second crypto path. Its plaintext
19
+ * shape is a JSON object whose keys differ per `kind`, which is precisely why
20
+ * it is one opaque column and not a set of typed ones: an `api-key` credential
21
+ * and an `oauth2` token pair have nothing in common worth normalising, and
22
+ * columns named `access_token` invite a log line that prints them.
23
+ *
24
+ * `expires_at` and `scopes` sit OUTSIDE the ciphertext on purpose. Both are
25
+ * needed to decide whether to refresh and what the consent dialog should say,
26
+ * and neither is a secret — putting them inside would mean decrypting a token
27
+ * to find out it had expired, on every request.
28
+ *
29
+ * There is no `refresh_token` column. It lives inside `payload` with the access
30
+ * token, because a refresh token IS the credential once an access token lapses,
31
+ * and a schema that stores it beside the ciphertext rather than inside it is a
32
+ * schema that will eventually have it read by something that thought it was
33
+ * metadata.
34
+ *
35
+ * ─── D5: disconnect deletes this row, and only this row ────────────────────
36
+ *
37
+ * 24 D16 / 26 D5 — disconnecting keeps every table the add-on brought and
38
+ * destroys the keys. That is a DELETE here plus nothing anywhere else, which is
39
+ * a property the schema should make easy to get right: this table holds only
40
+ * secrets, so "delete the secrets" is one statement and cannot take data with
41
+ * it by accident.
42
+ *
43
+ * The FK cascades for the uninstall path — a credential outliving its manifest
44
+ * is an orphaned secret nothing can reach to revoke, which is strictly worse
45
+ * than one that is gone.
46
+ */
47
+ import type { Kysely } from 'kysely';
48
+ import type { ColumnHelpers } from '../columns.js';
49
+ export declare function up(db: Kysely<unknown>, c: ColumnHelpers): Promise<void>;
50
+ //# sourceMappingURL=0021_add_on_credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0021_add_on_credentials.d.ts","sourceRoot":"","sources":["../../src/migrations/0021_add_on_credentials.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,wBAAsB,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAqC7E"}
@@ -0,0 +1,80 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ /**
3
+ * Wave 0021 — `adminium_add_on_credentials`: the secret a connected add-on was
4
+ * given, and nothing else (26-add-on-runtime.md §4, D2, D5).
5
+ *
6
+ * ─── One row per connected add-on ──────────────────────────────────────────
7
+ *
8
+ * Not per attachment. A DHL API key belongs to the add-on the operator
9
+ * connected, not to each host app it happens to be mounted on — connecting it
10
+ * twice because it is attached twice would mean two copies of one secret, two
11
+ * places to revoke, and a disconnect that leaves one behind. The unique index
12
+ * on `manifest_id` is what makes "connected" a boolean fact about an add-on.
13
+ *
14
+ * ─── What is stored, and what is deliberately not ──────────────────────────
15
+ *
16
+ * `payload` is AES-256-GCM ciphertext over the whole credential envelope,
17
+ * encrypted with a key derived from `ADMINIUM_SECRET` — the same discipline
18
+ * `adminium_connections` uses for DSNs, reached through the same
19
+ * `config/secrets.ts` helpers rather than a second crypto path. Its plaintext
20
+ * shape is a JSON object whose keys differ per `kind`, which is precisely why
21
+ * it is one opaque column and not a set of typed ones: an `api-key` credential
22
+ * and an `oauth2` token pair have nothing in common worth normalising, and
23
+ * columns named `access_token` invite a log line that prints them.
24
+ *
25
+ * `expires_at` and `scopes` sit OUTSIDE the ciphertext on purpose. Both are
26
+ * needed to decide whether to refresh and what the consent dialog should say,
27
+ * and neither is a secret — putting them inside would mean decrypting a token
28
+ * to find out it had expired, on every request.
29
+ *
30
+ * There is no `refresh_token` column. It lives inside `payload` with the access
31
+ * token, because a refresh token IS the credential once an access token lapses,
32
+ * and a schema that stores it beside the ciphertext rather than inside it is a
33
+ * schema that will eventually have it read by something that thought it was
34
+ * metadata.
35
+ *
36
+ * ─── D5: disconnect deletes this row, and only this row ────────────────────
37
+ *
38
+ * 24 D16 / 26 D5 — disconnecting keeps every table the add-on brought and
39
+ * destroys the keys. That is a DELETE here plus nothing anywhere else, which is
40
+ * a property the schema should make easy to get right: this table holds only
41
+ * secrets, so "delete the secrets" is one statement and cannot take data with
42
+ * it by accident.
43
+ *
44
+ * The FK cascades for the uninstall path — a credential outliving its manifest
45
+ * is an orphaned secret nothing can reach to revoke, which is strictly worse
46
+ * than one that is gone.
47
+ */
48
+ import { metaTable } from '../prefix.js';
49
+ export async function up(db, c) {
50
+ await db.schema
51
+ .createTable(metaTable('add_on_credentials'))
52
+ .ifNotExists()
53
+ .addColumn('id', c.id, (col) => col.primaryKey())
54
+ .addColumn('manifest_id', c.id, (col) => col.notNull())
55
+ /** `api-key` | `oauth2` — `none` never reaches this table (D2). */
56
+ .addColumn('kind', c.str(12), (col) => col.notNull())
57
+ /** AES-256-GCM ciphertext over the whole envelope. Never logged, never served. */
58
+ .addColumn('payload', c.text, (col) => col.notNull())
59
+ /** Epoch ms; NULL for a credential that does not expire (an API key). */
60
+ .addColumn('expires_at', c.ts)
61
+ /** The granted OAuth scopes, for the consent surface. Not a secret. */
62
+ .addColumn('scopes', c.json)
63
+ .addColumn('created_at', c.ts, (col) => col.notNull())
64
+ .addColumn('updated_at', c.ts, (col) => col.notNull())
65
+ // Named and table-level: MySQL parses an inline column-level `REFERENCES`
66
+ // and silently discards it, which would leave the cascade below existing
67
+ // only in this file (the 2026-07-20 CI onion).
68
+ .addForeignKeyConstraint('fk_adminium_add_on_credentials_manifest_id', ['manifest_id'], metaTable('manifests'), ['id'], (cb) => cb.onDelete('cascade'))
69
+ .execute();
70
+ // One credential per add-on — see the header. Unique rather than merely
71
+ // indexed, so a second connect is an upsert and can never become a duplicate
72
+ // secret the disconnect path would miss.
73
+ await db.schema
74
+ .createIndex('uq_adminium_add_on_credentials_manifest')
75
+ .on(metaTable('add_on_credentials'))
76
+ .columns(['manifest_id'])
77
+ .unique()
78
+ .execute();
79
+ }
80
+ //# sourceMappingURL=0021_add_on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G,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QACtD,0EAA0E;QAC1E,yEAAyE;QACzE,+CAA+C;SAC9C,uBAAuB,CACtB,4CAA4C,EAC5C,CAAC,aAAa,CAAC,EACf,SAAS,CAAC,WAAW,CAAC,EACtB,CAAC,IAAI,CAAC,EACN,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAC/B;SACA,OAAO,EAAE,CAAC;IAEb,wEAAwE;IACxE,6EAA6E;IAC7E,yCAAyC;IACzC,MAAM,EAAE,CAAC,MAAM;SACZ,WAAW,CAAC,yCAAyC,CAAC;SACtD,EAAE,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC;SACnC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC;SACxB,MAAM,EAAE;SACR,OAAO,EAAE,CAAC;AACf,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Wave 0022 — the Studio's messages moved namespace, so the operator's
3
+ * rewordings of them have to move with the messages (10-T06).
4
+ *
5
+ * ─── What moved, and why it is not a rename ────────────────────────────────
6
+ *
7
+ * `common.studio.*` and `common.studioPages.*` — 971 keys, the whole admin
8
+ * console — became the `studio` namespace's `*` and `pages.*`. The point was
9
+ * bundle weight: `studio` is fetched when somebody opens the Studio instead of
10
+ * shipping in every user's first load. But `adminium_translations` files a row
11
+ * by `(scope, locale, namespace, key)`, so an override an admin wrote against
12
+ * the old address stops resolving the moment the message answers to a new one.
13
+ * Nothing errors. The string simply reverts to the compiled English, on the
14
+ * one surface whose users are the people who did the rewording.
15
+ *
16
+ * So this is a DATA move, in JavaScript rather than SQL: `substr` and string
17
+ * concatenation are spelled three different ways across sqlite, postgres and
18
+ * mysql, and the row count here is bounded by how many messages a human has
19
+ * personally rewritten.
20
+ *
21
+ * ─── The two carried keys ──────────────────────────────────────────────────
22
+ *
23
+ * The topbar's Studio menu used to title its two items from `studio.hub.title`
24
+ * and `studio.settingsHub.title`. It paints on every route, long before any
25
+ * Studio chunk exists, so it now has its own `common:topbar.*` keys.
26
+ *
27
+ * An override on either old key is COPIED to the new one rather than only
28
+ * moved. The alternative is an operator who renamed "Data connections" to
29
+ * "Databases" finding the page still says Databases and the menu item that
30
+ * opens it saying Data connections — a split they did not ask for and cannot
31
+ * see the cause of. The cost is honest and small: two rows where there was
32
+ * one, so a later reset has to be done twice. Preserving what they configured
33
+ * is worth more than saving them a click they may never make.
34
+ *
35
+ * ─── No version bump ───────────────────────────────────────────────────────
36
+ *
37
+ * The i18n version counter in `adminium_settings` is what makes a warm browser
38
+ * refetch. It is deliberately untouched: a cached override under a key that no
39
+ * longer exists resolves for nothing and is inert, and the next ordinary write
40
+ * moves the counter anyway.
41
+ */
42
+ import type { Kysely } from 'kysely';
43
+ export declare function up(db: Kysely<unknown>): Promise<void>;
44
+ //# sourceMappingURL=0022_studio_namespace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0022_studio_namespace.d.ts","sourceRoot":"","sources":["../../src/migrations/0022_studio_namespace.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAwCrC,wBAAsB,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAsD3D"}
@@ -0,0 +1,113 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ /**
3
+ * Wave 0022 — the Studio's messages moved namespace, so the operator's
4
+ * rewordings of them have to move with the messages (10-T06).
5
+ *
6
+ * ─── What moved, and why it is not a rename ────────────────────────────────
7
+ *
8
+ * `common.studio.*` and `common.studioPages.*` — 971 keys, the whole admin
9
+ * console — became the `studio` namespace's `*` and `pages.*`. The point was
10
+ * bundle weight: `studio` is fetched when somebody opens the Studio instead of
11
+ * shipping in every user's first load. But `adminium_translations` files a row
12
+ * by `(scope, locale, namespace, key)`, so an override an admin wrote against
13
+ * the old address stops resolving the moment the message answers to a new one.
14
+ * Nothing errors. The string simply reverts to the compiled English, on the
15
+ * one surface whose users are the people who did the rewording.
16
+ *
17
+ * So this is a DATA move, in JavaScript rather than SQL: `substr` and string
18
+ * concatenation are spelled three different ways across sqlite, postgres and
19
+ * mysql, and the row count here is bounded by how many messages a human has
20
+ * personally rewritten.
21
+ *
22
+ * ─── The two carried keys ──────────────────────────────────────────────────
23
+ *
24
+ * The topbar's Studio menu used to title its two items from `studio.hub.title`
25
+ * and `studio.settingsHub.title`. It paints on every route, long before any
26
+ * Studio chunk exists, so it now has its own `common:topbar.*` keys.
27
+ *
28
+ * An override on either old key is COPIED to the new one rather than only
29
+ * moved. The alternative is an operator who renamed "Data connections" to
30
+ * "Databases" finding the page still says Databases and the menu item that
31
+ * opens it saying Data connections — a split they did not ask for and cannot
32
+ * see the cause of. The cost is honest and small: two rows where there was
33
+ * one, so a later reset has to be done twice. Preserving what they configured
34
+ * is worth more than saving them a click they may never make.
35
+ *
36
+ * ─── No version bump ───────────────────────────────────────────────────────
37
+ *
38
+ * The i18n version counter in `adminium_settings` is what makes a warm browser
39
+ * refetch. It is deliberately untouched: a cached override under a key that no
40
+ * longer exists resolves for nothing and is inert, and the next ordinary write
41
+ * moves the counter anyway.
42
+ */
43
+ import { newId } from '../ids.js';
44
+ import { metaTable } from '../prefix.js';
45
+ /** Old `common` key → its address in the `studio` namespace. */
46
+ function movedKey(key) {
47
+ if (key.startsWith('studioPages.'))
48
+ return `pages.${key.slice('studioPages.'.length)}`;
49
+ if (key.startsWith('studio.'))
50
+ return key.slice('studio.'.length);
51
+ return null;
52
+ }
53
+ /** Old `common` key → the `common` key the topbar reads it from now. */
54
+ const CARRIED = {
55
+ 'studio.hub.title': 'topbar.dataConnections',
56
+ 'studio.settingsHub.title': 'topbar.workspaceSettings',
57
+ };
58
+ // No column-helpers parameter: this wave adds no column. It is the only
59
+ // migration in this directory that moves DATA rather than shape, and a
60
+ // declared-but-unused helper would suggest otherwise.
61
+ export async function up(db) {
62
+ const table = metaTable('translations');
63
+ const moveDb = db;
64
+ const rows = await moveDb
65
+ .selectFrom(table)
66
+ .select(['id', 'scope', 'locale', 'namespace', 'key', 'value', 'sourceText', 'updatedBy', 'createdAt', 'updatedAt'])
67
+ .where('namespace', '=', 'common')
68
+ .execute();
69
+ for (const row of rows) {
70
+ const moved = movedKey(row.key);
71
+ if (moved === null)
72
+ continue;
73
+ // Copy BEFORE the move, while the row still says what it used to. Guarded
74
+ // rather than assumed unique: the unique index is
75
+ // (scope, locale, namespace, key), and an admin who had already
76
+ // overridden `topbar.*` — impossible today, but this migration outlives
77
+ // that fact — must not lose the row they wrote by hand.
78
+ const carried = CARRIED[row.key];
79
+ if (carried !== undefined) {
80
+ const existing = await moveDb
81
+ .selectFrom(table)
82
+ .select('id')
83
+ .where('scope', '=', row.scope)
84
+ .where('locale', '=', row.locale)
85
+ .where('namespace', '=', 'common')
86
+ .where('key', '=', carried)
87
+ .executeTakeFirst();
88
+ if (existing === undefined) {
89
+ await moveDb
90
+ .insertInto(table)
91
+ .values({
92
+ id: newId('trn'),
93
+ scope: row.scope,
94
+ locale: row.locale,
95
+ namespace: 'common',
96
+ key: carried,
97
+ value: row.value,
98
+ sourceText: row.sourceText,
99
+ updatedBy: row.updatedBy,
100
+ createdAt: row.createdAt,
101
+ updatedAt: row.updatedAt,
102
+ })
103
+ .execute();
104
+ }
105
+ }
106
+ await moveDb
107
+ .updateTable(table)
108
+ .set({ namespace: 'studio', key: moved })
109
+ .where('id', '=', row.id)
110
+ .execute();
111
+ }
112
+ }
113
+ //# sourceMappingURL=0022_studio_namespace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0022_studio_namespace.js","sourceRoot":"","sources":["../../src/migrations/0022_studio_namespace.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAIH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E,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAgBnD,MAAM,WAAW,aAAa;IAC5B,uDAAuD;IACvD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE;AAED,eAAO,MAAM,cAAc,EAAE,SAAS,aAAa,EAelD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAwBnD,MAAM,WAAW,aAAa;IAC5B,uDAAuD;IACvD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE;AAED,eAAO,MAAM,cAAc,EAAE,SAAS,aAAa,EAuBlD,CAAC"}
@@ -32,7 +32,15 @@ import { up as up0010 } from './0010_llm_prompt_version_width.js';
32
32
  import { up as up0011 } from './0011_i18n_runtime.js';
33
33
  import { up as up0012 } from './0012_locale_width.js';
34
34
  import { up as up0013 } from './0013_connection_last_error_hint.js';
35
+ import { up as up0015 } from './0015_connection_tenant_config.js';
35
36
  import { up as up0014 } from './0014_public_surface.js';
37
+ import { up as up0016 } from './0016_audit_entity.js';
38
+ import { up as up0017 } from './0017_surface_binding.js';
39
+ import { up as up0018 } from './0018_connection_timezone_source.js';
40
+ import { up as up0019 } from './0019_connection_disabled.js';
41
+ import { up as up0020 } from './0020_manifests_add_on.js';
42
+ import { up as up0021 } from './0021_add_on_credentials.js';
43
+ import { up as up0022 } from './0022_studio_namespace.js';
36
44
  export const ALL_MIGRATIONS = [
37
45
  { name: '0001_core_auth', up: up0001 },
38
46
  { name: '0002_rbac', up: up0002 },
@@ -48,5 +56,13 @@ export const ALL_MIGRATIONS = [
48
56
  { name: '0012_locale_width', up: up0012 },
49
57
  { name: '0013_connection_last_error_hint', up: up0013 },
50
58
  { name: '0014_public_surface', up: up0014 },
59
+ { name: '0015_connection_tenant_config', up: up0015 },
60
+ { name: '0016_audit_entity', up: up0016 },
61
+ { name: '0017_surface_binding', up: up0017 },
62
+ { name: '0018_connection_timezone_source', up: up0018 },
63
+ { name: '0019_connection_disabled', up: up0019 },
64
+ { name: '0020_manifests_add_on', up: up0020 },
65
+ { name: '0021_add_on_credentials', up: up0021 },
66
+ { name: '0022_studio_namespace', up: up0022 },
51
67
  ];
52
68
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,eAAe,CAAC;AAC7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EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACxC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AA4BD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM;kBAGd,eAAe,OAAM,MAAM,GAAgB,OAAO,CAAC,UAAU,CAAC;kBA2BxE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,aAAa,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GACrE,OAAO,CAAC,UAAU,EAAE,CAAC;IAYxB,qFAAqF;WACxE,MAAM,iBAAiB,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;EAM/D;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC"}
@@ -5,7 +5,7 @@
5
5
  * capped at 16 KB serialized (replaced by `{ "_truncated": true }` beyond it).
6
6
  */
7
7
  import { newId } from '../ids.js';
8
- import { AUDIT_CHANGES_MAX_BYTES, actorKindSchema, auditCategorySchema, recordRefSchema, } from '../schema/json-payloads.js';
8
+ import { AUDIT_CHANGES_MAX_BYTES, actorKindSchema, auditCategorySchema, auditEntityKeyOf, recordRefSchema, } from '../schema/json-payloads.js';
9
9
  import { packJson, readJsonOrNull } from './util.js';
10
10
  function mapEntry(row) {
11
11
  return {
@@ -37,6 +37,10 @@ export function auditRepo(meta) {
37
37
  const { db } = meta;
38
38
  return {
39
39
  async append(input, at = Date.now()) {
40
+ const entity = input.entity === null || input.entity === undefined ? null : recordRefSchema.parse(input.entity);
41
+ // Denormalized per-record lookup keys (30-record-pages.md WS-A): the
42
+ // indexed columns the activity feed filters on, derived once at write.
43
+ const entityKeys = entity === null ? null : auditEntityKeyOf(entity);
40
44
  const row = {
41
45
  id: newId('aud'),
42
46
  createdAt: at,
@@ -46,7 +50,9 @@ export function auditRepo(meta) {
46
50
  category: auditCategorySchema.parse(input.category),
47
51
  action: input.action,
48
52
  connectionId: input.connectionId ?? null,
49
- entity: input.entity === null || input.entity === undefined ? null : packJson(recordRefSchema.parse(input.entity)),
53
+ entity: entity === null ? null : packJson(entity),
54
+ entityTable: entityKeys?.entityTable ?? null,
55
+ entityId: entityKeys?.entityId ?? null,
50
56
  changes: packChanges(input.changes),
51
57
  ip: input.ip ?? null,
52
58
  userAgent: input.userAgent ?? null,
@@ -1 +1 @@
1
- {"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/repos/audit.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;GAIG;AAKH,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EACL,uBAAuB,EACvB,eAAe,EACf,mBAAmB,EACnB,eAAe,GAIhB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAiCrD,SAAS,QAAQ,CAAC,GAAsC;IACtD,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,SAAS,EAAE,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC;QAC/C,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,QAAQ,EAAE,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC;QACjD,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,YAAY,EAAE,GAAG,CAAC,YAAY;QAC9B,MAAM,EAAE,cAAc,CAAY,GAAG,CAAC,MAAM,CAAC;QAC7C,OAAO,EAAE,cAAc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