@adminiumjs/meta 0.2.2 → 0.2.4
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/dist/ids.d.ts +2 -0
- package/dist/ids.d.ts.map +1 -1
- package/dist/ids.js +7 -0
- package/dist/ids.js.map +1 -1
- package/dist/migrations/0015_connection_tenant_config.d.ts +42 -0
- package/dist/migrations/0015_connection_tenant_config.d.ts.map +1 -0
- package/dist/migrations/0015_connection_tenant_config.js +53 -0
- package/dist/migrations/0015_connection_tenant_config.js.map +1 -0
- package/dist/migrations/0016_audit_entity.d.ts +33 -0
- package/dist/migrations/0016_audit_entity.d.ts.map +1 -0
- package/dist/migrations/0016_audit_entity.js +137 -0
- package/dist/migrations/0016_audit_entity.js.map +1 -0
- package/dist/migrations/0017_surface_binding.d.ts +23 -0
- package/dist/migrations/0017_surface_binding.d.ts.map +1 -0
- package/dist/migrations/0017_surface_binding.js +37 -0
- package/dist/migrations/0017_surface_binding.js.map +1 -0
- package/dist/migrations/0018_connection_timezone_source.d.ts +44 -0
- package/dist/migrations/0018_connection_timezone_source.d.ts.map +1 -0
- package/dist/migrations/0018_connection_timezone_source.js +51 -0
- package/dist/migrations/0018_connection_timezone_source.js.map +1 -0
- package/dist/migrations/0019_connection_disabled.d.ts +38 -0
- package/dist/migrations/0019_connection_disabled.d.ts.map +1 -0
- package/dist/migrations/0019_connection_disabled.js +43 -0
- package/dist/migrations/0019_connection_disabled.js.map +1 -0
- package/dist/migrations/0020_manifests_add_on.d.ts +71 -0
- package/dist/migrations/0020_manifests_add_on.d.ts.map +1 -0
- package/dist/migrations/0020_manifests_add_on.js +111 -0
- package/dist/migrations/0020_manifests_add_on.js.map +1 -0
- package/dist/migrations/0021_add_on_credentials.d.ts +50 -0
- package/dist/migrations/0021_add_on_credentials.d.ts.map +1 -0
- package/dist/migrations/0021_add_on_credentials.js +80 -0
- package/dist/migrations/0021_add_on_credentials.js.map +1 -0
- package/dist/migrations/0022_studio_namespace.d.ts +44 -0
- package/dist/migrations/0022_studio_namespace.d.ts.map +1 -0
- package/dist/migrations/0022_studio_namespace.js +113 -0
- package/dist/migrations/0022_studio_namespace.js.map +1 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +16 -0
- package/dist/migrations/index.js.map +1 -1
- package/dist/repos/audit.d.ts.map +1 -1
- package/dist/repos/audit.js +8 -2
- package/dist/repos/audit.js.map +1 -1
- package/dist/repos/connections.d.ts +62 -0
- package/dist/repos/connections.d.ts.map +1 -1
- package/dist/repos/connections.js +104 -0
- package/dist/repos/connections.js.map +1 -1
- package/dist/repos/index.d.ts +1 -0
- package/dist/repos/index.d.ts.map +1 -1
- package/dist/repos/index.js +1 -0
- package/dist/repos/index.js.map +1 -1
- package/dist/repos/manifests.d.ts +139 -0
- package/dist/repos/manifests.d.ts.map +1 -0
- package/dist/repos/manifests.js +279 -0
- package/dist/repos/manifests.js.map +1 -0
- package/dist/repos/pages.d.ts +7 -0
- package/dist/repos/pages.d.ts.map +1 -1
- package/dist/repos/pages.js +39 -8
- package/dist/repos/pages.js.map +1 -1
- package/dist/repos/public-api.d.ts +24 -0
- package/dist/repos/public-api.d.ts.map +1 -1
- package/dist/repos/public-api.js +50 -0
- package/dist/repos/public-api.js.map +1 -1
- package/dist/schema/json-payloads.d.ts +27 -2
- package/dist/schema/json-payloads.d.ts.map +1 -1
- package/dist/schema/json-payloads.js +41 -2
- package/dist/schema/json-payloads.js.map +1 -1
- package/dist/schema/settings-registry.d.ts +26 -0
- package/dist/schema/settings-registry.d.ts.map +1 -1
- package/dist/schema/settings-registry.js +130 -0
- package/dist/schema/settings-registry.js.map +1 -1
- package/dist/schema/tables.d.ts +89 -1
- package/dist/schema/tables.d.ts.map +1 -1
- package/dist/schema/tables.js +2 -0
- package/dist/schema/tables.js.map +1 -1
- package/package.json +1 -1
|
@@ -35,10 +35,38 @@ export interface Connection {
|
|
|
35
35
|
lastError: string | null;
|
|
36
36
|
/** Remediation copy for {@link lastError}, from the adapter (05 §3). */
|
|
37
37
|
lastErrorHint: string | null;
|
|
38
|
+
/** Tenant configuration (28-T34, D20). Null = not configured. */
|
|
39
|
+
timezone: string | null;
|
|
40
|
+
/**
|
|
41
|
+
* Who chose {@link timezone} (0018). `null` is "no claim" — an unattributed
|
|
42
|
+
* pre-0018 row, or no zone to attribute — and is NOT the same as `'host'`.
|
|
43
|
+
*/
|
|
44
|
+
timezoneSource: TimezoneSource | null;
|
|
45
|
+
currency: string | null;
|
|
46
|
+
/**
|
|
47
|
+
* When an operator paused this source (0019); `null` while it is serving.
|
|
48
|
+
*
|
|
49
|
+
* Separate from {@link status} on purpose: status is what a probe last
|
|
50
|
+
* observed and every test overwrites it, while a pause is a decision that has
|
|
51
|
+
* to outlive one. Read it through {@link Connection.disabled} rather than
|
|
52
|
+
* comparing to null at each call site.
|
|
53
|
+
*/
|
|
54
|
+
disabledAt: number | null;
|
|
55
|
+
/** Convenience mirror of `disabledAt !== null` — the question callers ask. */
|
|
56
|
+
disabled: boolean;
|
|
38
57
|
createdBy: string | null;
|
|
39
58
|
createdAt: number;
|
|
40
59
|
updatedAt: number;
|
|
41
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Where a stored `timezone` came from (0018).
|
|
63
|
+
*
|
|
64
|
+
* `'host'` is the zone of the machine running Adminium, seeded by {@link
|
|
65
|
+
* connectionsRepo}'s `create` so a hosted surface has something to render. It
|
|
66
|
+
* is a plausible value and an unverified one, which is the whole reason it is
|
|
67
|
+
* labelled rather than left to pass as `'operator'`.
|
|
68
|
+
*/
|
|
69
|
+
export type TimezoneSource = 'host' | 'operator';
|
|
42
70
|
/** Decrypted per-role DSNs (01-architecture.md §3 privilege model). */
|
|
43
71
|
export interface ConnectionDsns {
|
|
44
72
|
introspectDsn: string | null;
|
|
@@ -57,6 +85,11 @@ export interface CreateConnectionInput {
|
|
|
57
85
|
ssl?: ConnectionSsl | null;
|
|
58
86
|
settings?: ConnectionSettings;
|
|
59
87
|
status?: string;
|
|
88
|
+
/**
|
|
89
|
+
* The tenant's zone. Omitted ⇒ seeded from the SERVER's zone (see `create`);
|
|
90
|
+
* pass `null` explicitly to create one with no zone at all.
|
|
91
|
+
*/
|
|
92
|
+
timezone?: string | null;
|
|
60
93
|
createdBy?: string | null;
|
|
61
94
|
}
|
|
62
95
|
export interface UpdateConnectionInput {
|
|
@@ -69,6 +102,8 @@ export interface UpdateConnectionInput {
|
|
|
69
102
|
status?: string;
|
|
70
103
|
lastError?: string | null;
|
|
71
104
|
lastErrorHint?: string | null;
|
|
105
|
+
timezone?: string | null;
|
|
106
|
+
currency?: string | null;
|
|
72
107
|
}
|
|
73
108
|
export interface ConnectionTestOutcome {
|
|
74
109
|
ok: boolean;
|
|
@@ -79,6 +114,18 @@ export interface ConnectionTestOutcome {
|
|
|
79
114
|
/** Probe result — a read-only data role flips the app read-only (§3.13). */
|
|
80
115
|
readOnly?: boolean;
|
|
81
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* The connection's tenant facts, with NO DSN crypto involved (28-T34).
|
|
119
|
+
*
|
|
120
|
+
* `connectionsRepo` needs a `DsnCrypto` because it decrypts connection
|
|
121
|
+
* strings. Reading a timezone does not, and the public-API route that wants
|
|
122
|
+
* one has no business holding the key that opens every DSN on the instance.
|
|
123
|
+
* Two columns, one query, no secrets in reach.
|
|
124
|
+
*/
|
|
125
|
+
export declare function connectionTenantConfig(meta: MetaDb, connectionId: string): Promise<{
|
|
126
|
+
timezone: string | null;
|
|
127
|
+
currency: string | null;
|
|
128
|
+
} | null>;
|
|
82
129
|
export declare function connectionsRepo(meta: MetaDb, crypto: DsnCrypto): {
|
|
83
130
|
create(input: CreateConnectionInput, at?: number): Promise<Connection>;
|
|
84
131
|
findById(id: string): Promise<Connection | null>;
|
|
@@ -88,6 +135,21 @@ export declare function connectionsRepo(meta: MetaDb, crypto: DsnCrypto): {
|
|
|
88
135
|
update(id: string, patch: UpdateConnectionInput, at?: number): Promise<Connection | null>;
|
|
89
136
|
/** Persist a test/probe outcome (health chip fields, §3.13). */
|
|
90
137
|
recordTestResult(id: string, outcome: ConnectionTestOutcome, at?: number): Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* Pause or resume the source (0019).
|
|
140
|
+
*
|
|
141
|
+
* Its own writer rather than a field on {@link UpdateConnectionInput}
|
|
142
|
+
* because the column stores WHEN and the caller only ever knows WHETHER —
|
|
143
|
+
* letting routes pass their own timestamp is how one of them ends up
|
|
144
|
+
* writing a zero and rendering "paused 56 years ago". Idempotent: pausing
|
|
145
|
+
* an already-paused connection leaves the original instant alone, so the
|
|
146
|
+
* age on the card is the age of the pause and not of the last click.
|
|
147
|
+
*
|
|
148
|
+
* NOTHING here touches `status`. A connection that was failing when it was
|
|
149
|
+
* paused is still failing, and saying so on resume is more useful than a
|
|
150
|
+
* clean slate nobody earned.
|
|
151
|
+
*/
|
|
152
|
+
setDisabled(id: string, disabled: boolean, at?: number): Promise<Connection | null>;
|
|
91
153
|
/** FK CASCADE removes the connection's snapshots and overrides. */
|
|
92
154
|
delete(id: string): Promise<boolean>;
|
|
93
155
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connections.d.ts","sourceRoot":"","sources":["../../src/repos/connections.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAML,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAIpC,sEAAsE;AACtE,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,SAAS,GAAG,aAAa,GAAG,SAAS,CAAC;IAC5C,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACtC;AAED,gFAAgF;AA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,MAAM,GACnB,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,IAAI,CAAC,CAOtE;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS;kBAmDvC,qBAAqB,OAAM,MAAM,GAAgB,OAAO,CAAC,UAAU,CAAC;iBA+DrE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;YASxC,OAAO,CAAC,UAAU,EAAE,CAAC;IAKnC,2EAA2E;gBACzD,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;eASxC,MAAM,SAAS,qBAAqB,OAAM,MAAM,GAAgB,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAgD3G,gEAAgE;yBACrC,MAAM,WAAW,qBAAqB,OAAM,MAAM,GAAgB,OAAO,CAAC,IAAI,CAAC;IAmB1G;;;;;;;;;;;;;OAaG;oBACmB,MAAM,YAAY,OAAO,OAAM,MAAM,GAAgB,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAYrG,mEAAmE;eAClD,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;EAK7C;AAED,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -10,6 +10,17 @@
|
|
|
10
10
|
import { newId } from '../ids.js';
|
|
11
11
|
import { connectionEngineSchema, connectionSettingsSchema, connectionSourceKindSchema, connectionSslSchema, connectionStatusSchema, } from '../schema/json-payloads.js';
|
|
12
12
|
import { MetaValidationError, packJson, readBool, readJson, readJsonOrNull, writeBool } from './util.js';
|
|
13
|
+
/**
|
|
14
|
+
* Narrow a stored source, treating anything unrecognised as "no claim".
|
|
15
|
+
*
|
|
16
|
+
* The column is free text at the storage layer, and a value this code does not
|
|
17
|
+
* know — a hand-edited row, or a source added by a newer version and rolled
|
|
18
|
+
* back — must degrade to silence. Rendering an unknown provenance as `'host'`
|
|
19
|
+
* would accuse an operator's own choice of being a guess.
|
|
20
|
+
*/
|
|
21
|
+
function readTimezoneSource(value) {
|
|
22
|
+
return value === 'host' || value === 'operator' ? value : null;
|
|
23
|
+
}
|
|
13
24
|
function decode(row) {
|
|
14
25
|
return {
|
|
15
26
|
id: row.id,
|
|
@@ -27,11 +38,32 @@ function decode(row) {
|
|
|
27
38
|
lastLatencyMs: row.lastLatencyMs,
|
|
28
39
|
lastError: row.lastError,
|
|
29
40
|
lastErrorHint: row.lastErrorHint,
|
|
41
|
+
timezone: row.timezone,
|
|
42
|
+
timezoneSource: readTimezoneSource(row.timezoneSource),
|
|
43
|
+
currency: row.currency,
|
|
44
|
+
disabledAt: row.disabledAt,
|
|
45
|
+
disabled: row.disabledAt !== null,
|
|
30
46
|
createdBy: row.createdBy,
|
|
31
47
|
createdAt: row.createdAt,
|
|
32
48
|
updatedAt: row.updatedAt,
|
|
33
49
|
};
|
|
34
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* The connection's tenant facts, with NO DSN crypto involved (28-T34).
|
|
53
|
+
*
|
|
54
|
+
* `connectionsRepo` needs a `DsnCrypto` because it decrypts connection
|
|
55
|
+
* strings. Reading a timezone does not, and the public-API route that wants
|
|
56
|
+
* one has no business holding the key that opens every DSN on the instance.
|
|
57
|
+
* Two columns, one query, no secrets in reach.
|
|
58
|
+
*/
|
|
59
|
+
export async function connectionTenantConfig(meta, connectionId) {
|
|
60
|
+
const row = await meta.db
|
|
61
|
+
.selectFrom('adminium_connections')
|
|
62
|
+
.select(['timezone', 'currency'])
|
|
63
|
+
.where('id', '=', connectionId)
|
|
64
|
+
.executeTakeFirst();
|
|
65
|
+
return row === undefined ? null : { timezone: row.timezone, currency: row.currency };
|
|
66
|
+
}
|
|
35
67
|
export function connectionsRepo(meta, crypto) {
|
|
36
68
|
const { db } = meta;
|
|
37
69
|
function encryptOrNull(dsn) {
|
|
@@ -93,6 +125,39 @@ export function connectionsRepo(meta, crypto) {
|
|
|
93
125
|
lastLatencyMs: null,
|
|
94
126
|
lastError: null,
|
|
95
127
|
lastErrorHint: null,
|
|
128
|
+
/*
|
|
129
|
+
* Seeded from the SERVER's zone, not left null.
|
|
130
|
+
*
|
|
131
|
+
* This was `null` on the reasoning that "a guessed zone is worse than an
|
|
132
|
+
* absent one". That was wrong in practice, and an operator found out the
|
|
133
|
+
* hard way: an absent zone made a hosted app surface refuse to render at
|
|
134
|
+
* all, so the cost of the missing value landed as total unavailability
|
|
135
|
+
* rather than as an hour's drift.
|
|
136
|
+
*
|
|
137
|
+
* The server's own zone is a real signal — it is the machine the
|
|
138
|
+
* operator chose to deploy on — and unlike the BROWSER's zone it is one
|
|
139
|
+
* value for the tenant rather than a different one per reader. It is
|
|
140
|
+
* also written down and editable, so a wrong guess is visible in the UI
|
|
141
|
+
* and fixable, which an invisible per-request default never is.
|
|
142
|
+
*
|
|
143
|
+
* `PATCH /connections/:id` may still set it to `null` deliberately.
|
|
144
|
+
*
|
|
145
|
+
* The seed is LABELLED (`timezoneSource`, wave 0018) so Studio can tell
|
|
146
|
+
* an operator this zone came from the server rather than from them.
|
|
147
|
+
* Storing the guess unlabelled is what would make it indistinguishable
|
|
148
|
+
* from a decision — the failure this default was accused of causing.
|
|
149
|
+
*/
|
|
150
|
+
timezone: input.timezone === undefined
|
|
151
|
+
? Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
152
|
+
: input.timezone,
|
|
153
|
+
/*
|
|
154
|
+
* An explicit `null` timezone gets a `null` source: there is no choice
|
|
155
|
+
* to attribute, and `timezone` already records "none" by itself.
|
|
156
|
+
*/
|
|
157
|
+
timezoneSource: input.timezone === undefined ? 'host' : input.timezone === null ? null : 'operator',
|
|
158
|
+
currency: null,
|
|
159
|
+
// New sources serve immediately — pausing is always a later decision.
|
|
160
|
+
disabledAt: null,
|
|
96
161
|
createdBy: input.createdBy ?? null,
|
|
97
162
|
createdAt: at,
|
|
98
163
|
updatedAt: at,
|
|
@@ -138,6 +203,18 @@ export function connectionsRepo(meta, crypto) {
|
|
|
138
203
|
set.lastError = patch.lastError;
|
|
139
204
|
if (patch.lastErrorHint !== undefined)
|
|
140
205
|
set.lastErrorHint = patch.lastErrorHint;
|
|
206
|
+
/*
|
|
207
|
+
* A zone arriving through an update came from a person — the only caller
|
|
208
|
+
* that patches this field is `PATCH /connections/:id`, and the probe and
|
|
209
|
+
* health writers below never touch it. So the seed's label is replaced
|
|
210
|
+
* rather than left to outlive the guess it described.
|
|
211
|
+
*/
|
|
212
|
+
if (patch.timezone !== undefined) {
|
|
213
|
+
set.timezone = patch.timezone;
|
|
214
|
+
set.timezoneSource = patch.timezone === null ? null : 'operator';
|
|
215
|
+
}
|
|
216
|
+
if (patch.currency !== undefined)
|
|
217
|
+
set.currency = patch.currency;
|
|
141
218
|
if (patch.ssl !== undefined) {
|
|
142
219
|
if (patch.ssl === null) {
|
|
143
220
|
set.ssl = null;
|
|
@@ -189,6 +266,33 @@ export function connectionsRepo(meta, crypto) {
|
|
|
189
266
|
.where('id', '=', id)
|
|
190
267
|
.execute();
|
|
191
268
|
},
|
|
269
|
+
/**
|
|
270
|
+
* Pause or resume the source (0019).
|
|
271
|
+
*
|
|
272
|
+
* Its own writer rather than a field on {@link UpdateConnectionInput}
|
|
273
|
+
* because the column stores WHEN and the caller only ever knows WHETHER —
|
|
274
|
+
* letting routes pass their own timestamp is how one of them ends up
|
|
275
|
+
* writing a zero and rendering "paused 56 years ago". Idempotent: pausing
|
|
276
|
+
* an already-paused connection leaves the original instant alone, so the
|
|
277
|
+
* age on the card is the age of the pause and not of the last click.
|
|
278
|
+
*
|
|
279
|
+
* NOTHING here touches `status`. A connection that was failing when it was
|
|
280
|
+
* paused is still failing, and saying so on resume is more useful than a
|
|
281
|
+
* clean slate nobody earned.
|
|
282
|
+
*/
|
|
283
|
+
async setDisabled(id, disabled, at = Date.now()) {
|
|
284
|
+
const current = await this.findById(id);
|
|
285
|
+
if (current === null)
|
|
286
|
+
return null;
|
|
287
|
+
if (current.disabled === disabled)
|
|
288
|
+
return current;
|
|
289
|
+
await db
|
|
290
|
+
.updateTable('adminium_connections')
|
|
291
|
+
.set({ disabledAt: disabled ? at : null, updatedAt: at })
|
|
292
|
+
.where('id', '=', id)
|
|
293
|
+
.execute();
|
|
294
|
+
return this.findById(id);
|
|
295
|
+
},
|
|
192
296
|
/** FK CASCADE removes the connection's snapshots and overrides. */
|
|
193
297
|
async delete(id) {
|
|
194
298
|
const res = await db.deleteFrom('adminium_connections').where('id', '=', id).executeTakeFirst();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connections.js","sourceRoot":"","sources":["../../src/repos/connections.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;GAOG;AAKH,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,mBAAmB,EACnB,sBAAsB,GAEvB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"connections.js","sourceRoot":"","sources":["../../src/repos/connections.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;GAOG;AAKH,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,mBAAmB,EACnB,sBAAsB,GAEvB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAiEzG;;;;;;;GAOG;AACH,SAAS,kBAAkB,CAAC,KAAoB;IAC9C,OAAO,KAAK,KAAK,MAAM,IAAI,K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AAC,UAAU,CAAC,sBAAsB,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,gBAAgB,EAAE,CAAC;YAChG,OAAO,MAAM,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC;QAChD,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/repos/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/repos/index.ts"],"names":[],"mappings":"AACA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/repos/index.ts"],"names":[],"mappings":"AACA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC"}
|
package/dist/repos/index.js
CHANGED
package/dist/repos/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/repos/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,g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mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* manifestsRepo — `adminium_manifests`, its attachments and its credentials
|
|
3
|
+
* (07-meta-store.md §3.32; 26-add-on-runtime.md §4).
|
|
4
|
+
*
|
|
5
|
+
* The table has existed since migration 0006 and until now had no repo, no
|
|
6
|
+
* writer and zero rows — which is how three planning documents came to record a
|
|
7
|
+
* shipped table as absent. This is the writer.
|
|
8
|
+
*
|
|
9
|
+
* ─── One repo, three tables, because they are one lifecycle ────────────────
|
|
10
|
+
*
|
|
11
|
+
* `adminium_manifests` says what is installed, `adminium_manifest_attachments`
|
|
12
|
+
* which hosts it is mounted on and whether it is on for each, and
|
|
13
|
+
* `adminium_add_on_credentials` what secret it was given. Install writes the
|
|
14
|
+
* first two, connect writes the third, disconnect deletes only the third, and
|
|
15
|
+
* uninstall deletes the first and lets the FKs take the rest (26 D5). Splitting
|
|
16
|
+
* them across three repos would put that sequence in the caller, where it is
|
|
17
|
+
* one forgotten delete away from an orphaned secret.
|
|
18
|
+
*
|
|
19
|
+
* ─── Repos never see key material ─────────────────────────────────────────
|
|
20
|
+
*
|
|
21
|
+
* `CredentialCrypto` is the same closure shape `connectionsRepo` takes for DSNs
|
|
22
|
+
* (01-architecture.md §3/§7): the server builds it from `ADMINIUM_SECRET` and
|
|
23
|
+
* hands it in. Nothing here derives a key, and the ciphertext is the only form
|
|
24
|
+
* a credential takes on this side of the boundary.
|
|
25
|
+
*
|
|
26
|
+
* `licenseKeyEncrypted` is shipped in the table and is never read or written by
|
|
27
|
+
* anything below: 17 defers licences BY NAME, so honouring that costs nothing.
|
|
28
|
+
*/
|
|
29
|
+
import type { Selectable } from 'kysely';
|
|
30
|
+
import type { MetaDb } from '../connect.js';
|
|
31
|
+
import type { AdminiumManifestAttachmentsTable, AdminiumManifestsTable } from '../schema/tables.js';
|
|
32
|
+
export type ManifestRow = Selectable<AdminiumManifestsTable>;
|
|
33
|
+
export type ManifestAttachmentRow = Selectable<AdminiumManifestAttachmentsTable>;
|
|
34
|
+
/** Encrypt/decrypt closures over `ADMINIUM_SECRET`; the repo never sees the key. */
|
|
35
|
+
export interface CredentialCrypto {
|
|
36
|
+
encrypt(plaintext: string): string;
|
|
37
|
+
decrypt(token: string): string;
|
|
38
|
+
}
|
|
39
|
+
/** `none` never reaches the credential table — there is nothing to store. */
|
|
40
|
+
export type ConnectKind = 'api-key' | 'oauth2';
|
|
41
|
+
/** An installed manifest with the hosts it is attached to. */
|
|
42
|
+
export interface InstalledManifest {
|
|
43
|
+
row: ManifestRow;
|
|
44
|
+
/** The parsed manifest document. */
|
|
45
|
+
document: unknown;
|
|
46
|
+
attachments: ManifestAttachmentRow[];
|
|
47
|
+
}
|
|
48
|
+
export interface InstallManifestInput {
|
|
49
|
+
manifestKey: string;
|
|
50
|
+
version: string;
|
|
51
|
+
kind: 'app' | 'add-on';
|
|
52
|
+
/** `marketplace` | `file` — how it arrived. */
|
|
53
|
+
source: string;
|
|
54
|
+
/** The validated manifest document, stored verbatim. */
|
|
55
|
+
document: unknown;
|
|
56
|
+
connectionId?: string | null;
|
|
57
|
+
installedBy?: string | null;
|
|
58
|
+
/** Host `manifest_key`s to attach on install. */
|
|
59
|
+
attachTo?: readonly string[];
|
|
60
|
+
}
|
|
61
|
+
/** The decrypted credential envelope, as the connect routes hand it over. */
|
|
62
|
+
export interface CredentialEnvelope {
|
|
63
|
+
kind: ConnectKind;
|
|
64
|
+
/** Shape differs per kind; opaque to this layer. */
|
|
65
|
+
secret: Record<string, unknown>;
|
|
66
|
+
expiresAt?: number | null;
|
|
67
|
+
scopes?: string[] | null;
|
|
68
|
+
}
|
|
69
|
+
export declare function manifestsRepo(meta: MetaDb, crypto: CredentialCrypto): {
|
|
70
|
+
/**
|
|
71
|
+
* Install: one manifest row plus an attachment per host.
|
|
72
|
+
*
|
|
73
|
+
* NOT a transaction here, deliberately — the meta store's own migrator is
|
|
74
|
+
* the only thing in this package that opens one, and the caller
|
|
75
|
+
* (`applyInstall`) already owns a transaction spanning the DATA-source DDL
|
|
76
|
+
* and these rows. Wrapping again would nest.
|
|
77
|
+
*/
|
|
78
|
+
install(input: InstallManifestInput, at?: number): Promise<InstalledManifest>;
|
|
79
|
+
findByKey(manifestKey: string): Promise<InstalledManifest | null>;
|
|
80
|
+
findById(id: string): Promise<InstalledManifest | null>;
|
|
81
|
+
/** Every installed manifest of `kind`, newest first. */
|
|
82
|
+
list(kind?: "app" | "add-on"): Promise<InstalledManifest[]>;
|
|
83
|
+
/**
|
|
84
|
+
* The read a HOST makes on every page load: what is attached here and on.
|
|
85
|
+
* Disabled attachments are excluded rather than returned with a flag — a
|
|
86
|
+
* host that has to remember to filter is a host that will forget once.
|
|
87
|
+
*/
|
|
88
|
+
enabledForHost(attachedTo: string): Promise<InstalledManifest[]>;
|
|
89
|
+
/** Upgrade in place: a new version and document over the same row (26-T17). */
|
|
90
|
+
setVersion(id: string, input: {
|
|
91
|
+
version: string;
|
|
92
|
+
document: unknown;
|
|
93
|
+
}, at?: number): Promise<void>;
|
|
94
|
+
/** Attach to one more host; idempotent (the unique index is the guarantee). */
|
|
95
|
+
attach(manifestId: string, attachedTo: string, at?: number): Promise<ManifestAttachmentRow>;
|
|
96
|
+
/**
|
|
97
|
+
* Enable/disable on ONE host (§5.1's `PATCH`). Per attachment, not per
|
|
98
|
+
* manifest: an add-on can legitimately be live on one host and off on
|
|
99
|
+
* another, and a single flag would make that unrepresentable.
|
|
100
|
+
*/
|
|
101
|
+
setAttachmentEnabled(manifestId: string, attachedTo: string, enabled: boolean, at?: number): Promise<boolean>;
|
|
102
|
+
/**
|
|
103
|
+
* Uninstall: delete the manifest row. Attachments and credentials follow by
|
|
104
|
+
* FK cascade; every table the add-on BROUGHT stays, because nothing here
|
|
105
|
+
* touches the data source (24 D16 / 26 D5).
|
|
106
|
+
*/
|
|
107
|
+
uninstall(id: string): Promise<boolean>;
|
|
108
|
+
/**
|
|
109
|
+
* Connect: store the envelope encrypted, one row per add-on.
|
|
110
|
+
*
|
|
111
|
+
* An upsert rather than an insert, because the unique index makes a second
|
|
112
|
+
* connect a violation and a re-connect is an ordinary thing to do (a
|
|
113
|
+
* rotated API key, a re-authorised OAuth grant).
|
|
114
|
+
*/
|
|
115
|
+
setCredential(manifestId: string, envelope: CredentialEnvelope, at?: number): Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* The decrypted envelope, for the server code that is about to make a call
|
|
118
|
+
* with it. Never reached by a route that serves a browser (24 D15).
|
|
119
|
+
*/
|
|
120
|
+
getCredential(manifestId: string): Promise<CredentialEnvelope | null>;
|
|
121
|
+
/**
|
|
122
|
+
* Whether an add-on is connected, and when its grant lapses — WITHOUT
|
|
123
|
+
* decrypting anything. This is what the Studio page and the connect status
|
|
124
|
+
* read, so a list of add-ons never touches key material.
|
|
125
|
+
*/
|
|
126
|
+
credentialStatus(manifestId: string): Promise<{
|
|
127
|
+
kind: ConnectKind;
|
|
128
|
+
expiresAt: number | null;
|
|
129
|
+
scopes: string[] | null;
|
|
130
|
+
} | null>;
|
|
131
|
+
/**
|
|
132
|
+
* Disconnect (D5): the keys go and NOTHING else does. One statement over a
|
|
133
|
+
* table that holds only secrets, which is what makes "keeps your data" a
|
|
134
|
+
* property of the schema rather than of the caller's care.
|
|
135
|
+
*/
|
|
136
|
+
deleteCredential(manifestId: string): Promise<boolean>;
|
|
137
|
+
};
|
|
138
|
+
export type ManifestsRepo = ReturnType<typeof manifestsRepo>;
|
|
139
|
+
//# sourceMappingURL=manifests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifests.d.ts","sourceRoot":"","sources":["../../src/repos/manifests.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AA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