@nylorun/runtime 0.13.0-beta → 0.15.0-beta
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/CHANGELOG.md +434 -0
- package/README.md +137 -41
- package/dist/adapters/execution/restate.d.ts +7 -2
- package/dist/adapters/execution/restate.js +40 -10
- package/dist/adapters/replication/pgoutput.d.ts +21 -0
- package/dist/adapters/replication/pgoutput.js +170 -0
- package/dist/adapters/streams/s2.js +37 -20
- package/dist/admin-openapi.json +570 -0
- package/dist/api/a2a/card.d.ts +15 -0
- package/dist/api/a2a/card.js +24 -0
- package/dist/api/a2a/endpoint.d.ts +8 -0
- package/dist/api/a2a/endpoint.js +81 -0
- package/dist/api/a2a/protocol.d.ts +144 -0
- package/dist/api/a2a/protocol.js +188 -0
- package/dist/api/a2a/routes.d.ts +19 -0
- package/dist/api/a2a/routes.js +289 -0
- package/dist/api/a2a/tasks.d.ts +50 -0
- package/dist/api/a2a/tasks.js +186 -0
- package/dist/api/ag-ui/endpoint.d.ts +8 -0
- package/dist/api/ag-ui/endpoint.js +126 -0
- package/dist/api/ag-ui/history.d.ts +7 -0
- package/dist/api/ag-ui/history.js +60 -0
- package/dist/api/ag-ui/routes.d.ts +32 -0
- package/dist/api/ag-ui/routes.js +305 -0
- package/dist/api/ag-ui/session-id.d.ts +1 -0
- package/dist/api/ag-ui/session-id.js +12 -0
- package/dist/api/ag-ui/sse.d.ts +9 -0
- package/dist/api/ag-ui/sse.js +7 -0
- package/dist/api/ag-ui/translate.d.ts +38 -0
- package/dist/api/ag-ui/translate.js +222 -0
- package/dist/api/components.d.ts +8065 -0
- package/dist/api/components.js +82 -0
- package/dist/api/gate/keys.d.ts +14 -0
- package/dist/api/gate/keys.js +59 -0
- package/dist/api/gate/routes.d.ts +34 -0
- package/dist/api/gate/routes.js +235 -0
- package/dist/api/http/app.d.ts +18 -0
- package/dist/api/http/app.js +58 -0
- package/dist/api/http/body.d.ts +4 -0
- package/dist/api/http/body.js +37 -0
- package/dist/api/http/define.d.ts +39 -0
- package/dist/api/http/define.js +122 -0
- package/dist/api/http/respond.d.ts +9 -0
- package/dist/api/http/respond.js +44 -0
- package/dist/api/http/routes/access.d.ts +24 -0
- package/dist/api/http/routes/access.js +266 -0
- package/dist/api/http/routes/actions.d.ts +8 -0
- package/dist/api/http/routes/actions.js +76 -0
- package/dist/api/http/routes/endpoints.d.ts +7 -0
- package/dist/api/http/routes/endpoints.js +100 -0
- package/dist/api/http/routes/sessions.d.ts +3 -0
- package/dist/api/http/routes/sessions.js +205 -0
- package/dist/api/http/routes/tenant.d.ts +11 -0
- package/dist/api/http/routes/tenant.js +244 -0
- package/dist/api/http/routes/vaults.d.ts +8 -0
- package/dist/api/http/routes/vaults.js +167 -0
- package/dist/api/openapi.d.ts +19 -0
- package/dist/api/openapi.js +137 -0
- package/dist/api/route.d.ts +12 -0
- package/dist/api/route.js +4 -0
- package/dist/core/bearer.d.ts +8 -0
- package/dist/core/bearer.js +11 -0
- package/dist/core/flow-host.d.ts +7 -15
- package/dist/core/flow-host.js +16 -41
- package/dist/core/sandbox-routes.d.ts +12 -7
- package/dist/core/sandbox-routes.js +24 -25
- package/dist/execution/memory.d.ts +8 -5
- package/dist/execution/memory.js +33 -13
- package/dist/execution/types.d.ts +38 -6
- package/dist/execution/types.js +12 -3
- package/dist/gates/contract.d.ts +51 -0
- package/dist/gates/contract.js +37 -0
- package/dist/gates/handler.d.ts +21 -0
- package/dist/gates/handler.js +55 -0
- package/dist/gates/http-client.d.ts +12 -0
- package/dist/gates/http-client.js +160 -0
- package/dist/gates/in-process.d.ts +32 -0
- package/dist/gates/in-process.js +42 -0
- package/dist/gates/inflight.d.ts +39 -0
- package/dist/gates/inflight.js +70 -0
- package/dist/gates/mcp-handler.d.ts +35 -0
- package/dist/gates/mcp-handler.js +142 -0
- package/dist/gates/meter.d.ts +24 -0
- package/dist/gates/meter.js +165 -0
- package/dist/gates/model-gate.d.ts +45 -0
- package/dist/gates/model-gate.js +1 -0
- package/dist/gates/tenant-vaults.d.ts +64 -0
- package/dist/gates/tenant-vaults.js +94 -0
- package/dist/gates/tool-calls.d.ts +51 -0
- package/dist/gates/tool-calls.js +64 -0
- package/dist/gates/tool-client.d.ts +12 -0
- package/dist/gates/tool-client.js +201 -0
- package/dist/gates/tool-contract.d.ts +116 -0
- package/dist/gates/tool-contract.js +64 -0
- package/dist/gates/tool-gate.d.ts +45 -0
- package/dist/gates/tool-gate.js +10 -0
- package/dist/host/admin-api.d.ts +23 -0
- package/dist/host/admin-api.js +74 -0
- package/dist/host/app.d.ts +34 -0
- package/dist/host/app.js +181 -0
- package/dist/host/config-for.d.ts +3 -1
- package/dist/host/config-for.js +3 -2
- package/dist/host/config.d.ts +11 -0
- package/dist/host/cors.d.ts +27 -0
- package/dist/host/cors.js +64 -0
- package/dist/host/create-host.d.ts +36 -8
- package/dist/host/create-host.js +161 -330
- package/dist/host/execution.d.ts +20 -18
- package/dist/host/execution.js +2 -2
- package/dist/host/gates.d.ts +58 -0
- package/dist/host/gates.js +127 -0
- package/dist/host/http.d.ts +20 -4
- package/dist/host/http.js +81 -23
- package/dist/host/index.d.ts +1 -1
- package/dist/host/main.js +189 -58
- package/dist/host/stack-config.d.ts +91 -19
- package/dist/host/stack-config.js +246 -17
- package/dist/infra/database.d.ts +2 -2
- package/dist/infra/execution.d.ts +5 -5
- package/dist/infra/execution.js +8 -6
- package/dist/infra/index.d.ts +1 -1
- package/dist/infra/workers.d.ts +17 -17
- package/dist/infra/workers.js +9 -9
- package/dist/keys/client.d.ts +9 -0
- package/dist/keys/client.js +70 -0
- package/dist/keys/contract.d.ts +24 -0
- package/dist/keys/contract.js +12 -0
- package/dist/keys/keys.d.ts +41 -0
- package/dist/keys/keys.js +50 -0
- package/dist/mcp/connect.d.ts +43 -3
- package/dist/mcp/connect.js +12 -5
- package/dist/mcp/pool.d.ts +39 -3
- package/dist/mcp/pool.js +74 -11
- package/dist/model/catalog.d.ts +2 -10
- package/dist/model/classify.d.ts +13 -0
- package/dist/model/classify.js +61 -0
- package/dist/model/models.d.ts +10 -1
- package/dist/model/models.js +14 -6
- package/dist/model/pi-model.d.ts +17 -2
- package/dist/model/pi-model.js +366 -222
- package/dist/openapi.json +25889 -0
- package/dist/record/append.d.ts +51 -0
- package/dist/record/append.js +20 -0
- package/dist/record/envelope.d.ts +19 -0
- package/dist/record/envelope.js +49 -0
- package/dist/record/index.d.ts +11 -0
- package/dist/record/index.js +11 -0
- package/dist/sandbox/manager.d.ts +13 -1
- package/dist/sandbox/manager.js +8 -11
- package/dist/sandbox/resolve.d.ts +33 -0
- package/dist/sandbox/resolve.js +81 -0
- package/dist/sandbox/session-sandbox.d.ts +11 -0
- package/dist/sandbox/session-sandbox.js +51 -0
- package/dist/sandbox/share.d.ts +14 -2
- package/dist/sandbox/share.js +33 -3
- package/dist/sandbox/tenant-config.d.ts +37 -0
- package/dist/sandbox/tenant-config.js +51 -0
- package/dist/sandbox/tools.d.ts +7 -9
- package/dist/sandbox/tools.js +11 -3
- package/dist/sandbox/types.d.ts +8 -2
- package/dist/store/postgres/connect.d.ts +25 -9
- package/dist/store/postgres/connect.js +27 -10
- package/dist/store/postgres/db.d.ts +16 -0
- package/dist/store/postgres/db.js +28 -0
- package/dist/store/postgres/drizzle/0000_foundation.sql +22 -0
- package/dist/store/postgres/drizzle/0001_baseline.sql +255 -0
- package/dist/store/postgres/drizzle/0002_stream_relay.sql +4 -0
- package/dist/store/postgres/drizzle/0003_tool_crossings.sql +9 -0
- package/dist/store/postgres/drizzle/meta/_journal.json +34 -0
- package/dist/store/postgres/migrate.d.ts +68 -0
- package/dist/store/postgres/migrate.js +183 -0
- package/dist/store/postgres/record-writer.d.ts +4 -0
- package/dist/store/postgres/record-writer.js +34 -0
- package/dist/store/postgres/record.d.ts +5 -0
- package/dist/store/postgres/record.js +60 -0
- package/dist/store/postgres/schema.d.ts +3096 -0
- package/dist/store/postgres/schema.js +363 -0
- package/dist/store/postgres/store.d.ts +2 -4
- package/dist/store/postgres/store.js +590 -434
- package/dist/store/postgres/tenant.d.ts +56 -0
- package/dist/store/postgres/tenant.js +154 -0
- package/dist/store/types.d.ts +183 -132
- package/dist/store/types.js +0 -1
- package/dist/streams/basin.d.ts +18 -1
- package/dist/streams/basin.js +34 -2
- package/dist/streams/control.d.ts +18 -0
- package/dist/streams/control.js +33 -0
- package/dist/streams/memory.d.ts +3 -1
- package/dist/streams/memory.js +14 -8
- package/dist/streams/relay/core.d.ts +35 -0
- package/dist/streams/relay/core.js +366 -0
- package/dist/streams/relay/types.d.ts +78 -0
- package/dist/streams/relay/types.js +8 -0
- package/dist/streams/types.d.ts +71 -36
- package/dist/streams/types.js +18 -53
- package/dist/tenant/access-policy.d.ts +30 -0
- package/dist/tenant/access-policy.js +52 -0
- package/dist/tenant/actions.d.ts +10 -149
- package/dist/tenant/actions.js +5 -167
- package/dist/tenant/advance.d.ts +7 -2
- package/dist/tenant/advance.js +125 -14
- package/dist/tenant/auth.d.ts +19 -17
- package/dist/tenant/auth.js +90 -93
- package/dist/tenant/browser.d.ts +15 -0
- package/dist/tenant/browser.js +39 -0
- package/dist/tenant/cause.d.ts +25 -0
- package/dist/tenant/cause.js +45 -0
- package/dist/tenant/commands.d.ts +18 -2
- package/dist/tenant/commands.js +111 -115
- package/dist/tenant/context.d.ts +101 -21
- package/dist/tenant/context.js +14 -10
- package/dist/tenant/delivery-token.d.ts +41 -0
- package/dist/tenant/delivery-token.js +104 -0
- package/dist/tenant/delivery.d.ts +62 -0
- package/dist/tenant/delivery.js +481 -0
- package/dist/tenant/effects.d.ts +20 -1
- package/dist/tenant/effects.js +159 -42
- package/dist/tenant/endpoints.d.ts +67 -0
- package/dist/tenant/endpoints.js +90 -0
- package/dist/tenant/ephemeral.d.ts +22 -7
- package/dist/tenant/ephemeral.js +83 -125
- package/dist/tenant/history.d.ts +64 -0
- package/dist/tenant/history.js +120 -0
- package/dist/tenant/http.d.ts +8 -9
- package/dist/tenant/http.js +13 -27
- package/dist/tenant/jwt.d.ts +16 -0
- package/dist/tenant/jwt.js +50 -0
- package/dist/tenant/model-setting.d.ts +2 -2
- package/dist/tenant/module.d.ts +17 -28
- package/dist/tenant/module.js +133 -279
- package/dist/tenant/outbound.d.ts +44 -0
- package/dist/tenant/outbound.js +127 -0
- package/dist/tenant/paths.d.ts +11 -16
- package/dist/tenant/paths.js +24 -68
- package/dist/tenant/pool.d.ts +1 -3
- package/dist/tenant/pool.js +1 -19
- package/dist/tenant/principals.d.ts +23 -11
- package/dist/tenant/principals.js +61 -49
- package/dist/tenant/reset.d.ts +0 -4
- package/dist/tenant/reset.js +0 -5
- package/dist/tenant/runtime.d.ts +28 -20
- package/dist/tenant/runtime.js +95 -64
- package/dist/tenant/scheduler.d.ts +10 -3
- package/dist/tenant/scheduler.js +9 -5
- package/dist/tenant/session-streams.d.ts +127 -0
- package/dist/tenant/session-streams.js +404 -0
- package/dist/tenant/sessions.d.ts +28 -4
- package/dist/tenant/sessions.js +118 -24
- package/dist/tenant/signing-keys.d.ts +55 -0
- package/dist/tenant/signing-keys.js +172 -0
- package/dist/tenant/slim.d.ts +8 -0
- package/dist/tenant/slim.js +21 -0
- package/dist/tenant/status.d.ts +3 -3
- package/dist/tenant/status.js +20 -13
- package/dist/tenant/store-pg.d.ts +9 -6
- package/dist/tenant/store-pg.js +60 -125
- package/dist/tenant/streams.d.ts +62 -85
- package/dist/tenant/streams.js +143 -226
- package/dist/tenant/subject-limits.d.ts +16 -0
- package/dist/tenant/subject-limits.js +45 -0
- package/dist/tenant/sweep.d.ts +1 -10
- package/dist/tenant/sweep.js +29 -69
- package/dist/tenant/tokens.d.ts +14 -0
- package/dist/tenant/tokens.js +180 -0
- package/dist/tenant/transcript.d.ts +48 -5
- package/dist/tenant/transcript.js +58 -1
- package/dist/tenant/types.d.ts +69 -98
- package/dist/tenant/types.js +4 -15
- package/dist/tenant/worker.d.ts +3 -1
- package/dist/tenant/worker.js +13 -7
- package/dist/vault/host-model.d.ts +31 -0
- package/dist/vault/host-model.js +57 -0
- package/dist/vault/service.d.ts +44 -17
- package/dist/vault/service.js +126 -121
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +25 -9
- package/dist/core/executors.d.ts +0 -44
- package/dist/core/executors.js +0 -95
- package/dist/store/memory.d.ts +0 -57
- package/dist/store/memory.js +0 -645
- package/dist/store/postgres/migrations/001_initial.d.ts +0 -27
- package/dist/store/postgres/migrations/001_initial.js +0 -196
- package/dist/store/postgres/migrations/002_session_owner.d.ts +0 -6
- package/dist/store/postgres/migrations/002_session_owner.js +0 -13
- package/dist/store/postgres/migrations/index.d.ts +0 -49
- package/dist/store/postgres/migrations/index.js +0 -76
- package/dist/store/postgres/names.d.ts +0 -11
- package/dist/store/postgres/names.js +0 -42
- package/dist/store/postgres/tenants.d.ts +0 -90
- package/dist/store/postgres/tenants.js +0 -214
- package/dist/streams/relay.d.ts +0 -37
- package/dist/streams/relay.js +0 -254
- package/dist/tenant/envelope.d.ts +0 -7
- package/dist/tenant/envelope.js +0 -22
- package/dist/tenant/live.d.ts +0 -92
- package/dist/tenant/live.js +0 -290
- package/dist/tenant/quarantine-error.d.ts +0 -6
- package/dist/tenant/quarantine-error.js +0 -9
- package/dist/tenant/quarantine.d.ts +0 -27
- package/dist/tenant/quarantine.js +0 -72
- package/dist/tenant/routes-tenant.d.ts +0 -12
- package/dist/tenant/routes-tenant.js +0 -137
- package/dist/tenant/routes.d.ts +0 -9
- package/dist/tenant/routes.js +0 -151
- package/dist/tenant/store-memory.d.ts +0 -16
- package/dist/tenant/store-memory.js +0 -111
- /package/dist/{store → record}/cursor.d.ts +0 -0
- /package/dist/{store → record}/cursor.js +0 -0
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The first Postgres Tenant schema.
|
|
3
|
-
*
|
|
4
|
-
* - `tenant` holds the Tenant envelope (one row).
|
|
5
|
-
* - Document tables keep `id text primary key, body json`. The fields typed
|
|
6
|
-
* queries filter on are stored generated columns with indexes. Ids and
|
|
7
|
-
* timestamps compared as text use `COLLATE "C"`, so ordering is by code
|
|
8
|
-
* point, like the in-memory fake, whatever the database collation.
|
|
9
|
-
* - Bodies are `json`, not `jsonb`, so every string round-trips exactly as
|
|
10
|
-
* `JSON.stringify` wrote it. `jsonb` rejects the escapes `\u0000` (`22P05`)
|
|
11
|
-
* and unpaired surrogates (`\ud800`), which tool output can contain and
|
|
12
|
-
* which the in-memory store accepts. `json` stores the text
|
|
13
|
-
* verbatim and checks only its syntax. The generated columns read the body
|
|
14
|
-
* through `doc(body)`, which casts to `jsonb` after replacing those two
|
|
15
|
-
* escapes with `\ufffd`: the stored body is untouched, and only an indexed
|
|
16
|
-
* field that itself contained one (never an id, status or timestamp) would
|
|
17
|
-
* see U+FFFD. Bodies with no `\u` escape at all take the plain cast. Queries
|
|
18
|
-
* never apply `->`/`->>` to a `json` body (Postgres de-escapes the whole text
|
|
19
|
-
* and fails on the same escapes); they read generated columns.
|
|
20
|
-
* - `sessions` carries the store-managed `next_event_seq` and ownership
|
|
21
|
-
* columns (`owner`, `epoch`, `owner_expires_at`), which are never in `body`.
|
|
22
|
-
* - `outbox(session_id, seq, body)` holds committed, unrelayed events.
|
|
23
|
-
* - Executors, principals, vault and settings keep typed columns. Vault
|
|
24
|
-
* ciphertext is `bytea` columns, never inside a JSON body.
|
|
25
|
-
*/
|
|
26
|
-
export const initial = {
|
|
27
|
-
version: 1,
|
|
28
|
-
name: "initial",
|
|
29
|
-
up: (s) => `
|
|
30
|
-
CREATE FUNCTION ${s}.doc(body json) RETURNS jsonb
|
|
31
|
-
LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$
|
|
32
|
-
SELECT CASE WHEN strpos(body::text, '\\u') = 0 THEN body::jsonb
|
|
33
|
-
ELSE regexp_replace(
|
|
34
|
-
body::text,
|
|
35
|
-
'(?<!\\\\)((?:\\\\\\\\)*)\\\\u(0000|[dD][89a-fA-F][0-9a-fA-F]{2})',
|
|
36
|
-
'\\1\\\\ufffd',
|
|
37
|
-
'g'
|
|
38
|
-
)::jsonb
|
|
39
|
-
END
|
|
40
|
-
$$;
|
|
41
|
-
|
|
42
|
-
CREATE TABLE ${s}.tenant (
|
|
43
|
-
id text COLLATE "C" PRIMARY KEY,
|
|
44
|
-
name text NOT NULL,
|
|
45
|
-
created_at text NOT NULL,
|
|
46
|
-
updated_at text NOT NULL,
|
|
47
|
-
schema_version integer NOT NULL,
|
|
48
|
-
singleton boolean NOT NULL DEFAULT true UNIQUE CHECK (singleton)
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
CREATE TABLE ${s}.definitions (
|
|
52
|
-
id text COLLATE "C" PRIMARY KEY,
|
|
53
|
-
body json NOT NULL
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
CREATE TABLE ${s}.sessions (
|
|
57
|
-
id text COLLATE "C" PRIMARY KEY,
|
|
58
|
-
body json NOT NULL,
|
|
59
|
-
status text GENERATED ALWAYS AS (${s}.doc(body)->>'status') STORED,
|
|
60
|
-
agent_id text GENERATED ALWAYS AS (${s}.doc(body)->>'agentId') STORED,
|
|
61
|
-
stream_incarnation text GENERATED ALWAYS AS (${s}.doc(body)->>'streamIncarnation') STORED,
|
|
62
|
-
next_event_seq bigint NOT NULL DEFAULT 0,
|
|
63
|
-
owner text,
|
|
64
|
-
epoch bigint NOT NULL DEFAULT 0,
|
|
65
|
-
owner_expires_at timestamptz
|
|
66
|
-
);
|
|
67
|
-
CREATE INDEX sessions_status ON ${s}.sessions (status, owner_expires_at);
|
|
68
|
-
CREATE INDEX sessions_agent ON ${s}.sessions (agent_id);
|
|
69
|
-
|
|
70
|
-
CREATE TABLE ${s}.commands (
|
|
71
|
-
id text COLLATE "C" PRIMARY KEY,
|
|
72
|
-
body json NOT NULL
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
CREATE TABLE ${s}.checkpoints (
|
|
76
|
-
id text COLLATE "C" PRIMARY KEY,
|
|
77
|
-
body json NOT NULL
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
CREATE TABLE ${s}.effects (
|
|
81
|
-
id text COLLATE "C" PRIMARY KEY,
|
|
82
|
-
body json NOT NULL,
|
|
83
|
-
session_id text GENERATED ALWAYS AS (${s}.doc(body)->'request'->>'sessionId') STORED,
|
|
84
|
-
turn_id text GENERATED ALWAYS AS (${s}.doc(body)->'request'->>'turnId') STORED,
|
|
85
|
-
kind text GENERATED ALWAYS AS (${s}.doc(body)->'request'->>'kind') STORED,
|
|
86
|
-
status text GENERATED ALWAYS AS (${s}.doc(body)->>'status') STORED
|
|
87
|
-
);
|
|
88
|
-
CREATE INDEX effects_session ON ${s}.effects (session_id, turn_id, status);
|
|
89
|
-
CREATE INDEX effects_status ON ${s}.effects (status, kind);
|
|
90
|
-
|
|
91
|
-
CREATE TABLE ${s}.actions (
|
|
92
|
-
id text COLLATE "C" PRIMARY KEY,
|
|
93
|
-
body json NOT NULL,
|
|
94
|
-
session_id text GENERATED ALWAYS AS (${s}.doc(body)->>'sessionId') STORED,
|
|
95
|
-
turn_id text GENERATED ALWAYS AS (${s}.doc(body)->>'turnId') STORED,
|
|
96
|
-
agent_id text GENERATED ALWAYS AS (${s}.doc(body)->>'agentId') STORED,
|
|
97
|
-
status text GENERATED ALWAYS AS (${s}.doc(body)->>'status') STORED,
|
|
98
|
-
kind text GENERATED ALWAYS AS (${s}.doc(body)->>'kind') STORED,
|
|
99
|
-
lease_expires_at text GENERATED ALWAYS AS (${s}.doc(body)->>'leaseExpiresAt') STORED
|
|
100
|
-
);
|
|
101
|
-
CREATE INDEX actions_session ON ${s}.actions (session_id, turn_id, status);
|
|
102
|
-
CREATE INDEX actions_agent ON ${s}.actions (agent_id, status);
|
|
103
|
-
CREATE INDEX actions_status ON ${s}.actions (status, kind);
|
|
104
|
-
CREATE INDEX actions_lease ON ${s}.actions (status, lease_expires_at);
|
|
105
|
-
|
|
106
|
-
CREATE TABLE ${s}.sandboxes (
|
|
107
|
-
id text COLLATE "C" PRIMARY KEY,
|
|
108
|
-
body json NOT NULL
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
CREATE TABLE ${s}.links (
|
|
112
|
-
id text COLLATE "C" PRIMARY KEY,
|
|
113
|
-
body json NOT NULL,
|
|
114
|
-
workflow_session_id text GENERATED ALWAYS AS (${s}.doc(body)->>'workflowSessionId') STORED
|
|
115
|
-
);
|
|
116
|
-
CREATE INDEX links_workflow ON ${s}.links (workflow_session_id);
|
|
117
|
-
|
|
118
|
-
CREATE TABLE ${s}.outbox (
|
|
119
|
-
session_id text COLLATE "C" NOT NULL,
|
|
120
|
-
seq bigint NOT NULL,
|
|
121
|
-
body json NOT NULL,
|
|
122
|
-
created_at text COLLATE "C" GENERATED ALWAYS AS (${s}.doc(body)->>'createdAt') STORED,
|
|
123
|
-
PRIMARY KEY (session_id, seq)
|
|
124
|
-
);
|
|
125
|
-
|
|
126
|
-
CREATE TABLE ${s}.executors (
|
|
127
|
-
agent_id text COLLATE "C" PRIMARY KEY,
|
|
128
|
-
token_hash text NOT NULL UNIQUE,
|
|
129
|
-
implementation_version text NOT NULL,
|
|
130
|
-
manifest_hash text,
|
|
131
|
-
principal_id text,
|
|
132
|
-
created_at text NOT NULL,
|
|
133
|
-
updated_at text NOT NULL
|
|
134
|
-
);
|
|
135
|
-
|
|
136
|
-
CREATE TABLE ${s}.principals (
|
|
137
|
-
id text COLLATE "C" PRIMARY KEY,
|
|
138
|
-
role text NOT NULL,
|
|
139
|
-
token_hash text NOT NULL UNIQUE,
|
|
140
|
-
idempotency_key text,
|
|
141
|
-
created_at text NOT NULL
|
|
142
|
-
);
|
|
143
|
-
|
|
144
|
-
CREATE TABLE ${s}.vaults (
|
|
145
|
-
id text COLLATE "C" PRIMARY KEY,
|
|
146
|
-
name text NOT NULL,
|
|
147
|
-
owner_user_id text NOT NULL,
|
|
148
|
-
metadata_json text,
|
|
149
|
-
created_at text COLLATE "C" NOT NULL,
|
|
150
|
-
scope text NOT NULL DEFAULT 'user' CHECK (scope IN ('user', 'host'))
|
|
151
|
-
);
|
|
152
|
-
CREATE INDEX vaults_owner ON ${s}.vaults (owner_user_id, created_at, id);
|
|
153
|
-
CREATE UNIQUE INDEX vaults_one_host ON ${s}.vaults (scope) WHERE scope = 'host';
|
|
154
|
-
|
|
155
|
-
CREATE TABLE ${s}.vault_credentials (
|
|
156
|
-
id text COLLATE "C" PRIMARY KEY,
|
|
157
|
-
vault_id text NOT NULL REFERENCES ${s}.vaults (id) ON DELETE CASCADE,
|
|
158
|
-
name text NOT NULL,
|
|
159
|
-
type text NOT NULL,
|
|
160
|
-
binding_json text NOT NULL,
|
|
161
|
-
expires_at text,
|
|
162
|
-
created_at text COLLATE "C" NOT NULL,
|
|
163
|
-
rotated_at text,
|
|
164
|
-
kek_id text NOT NULL,
|
|
165
|
-
nonce bytea NOT NULL,
|
|
166
|
-
ciphertext bytea NOT NULL,
|
|
167
|
-
wrapped_dek bytea NOT NULL
|
|
168
|
-
);
|
|
169
|
-
CREATE INDEX vault_credentials_vault ON ${s}.vault_credentials (vault_id, created_at, id);
|
|
170
|
-
|
|
171
|
-
CREATE TABLE ${s}.vault_audit (
|
|
172
|
-
ord bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
|
173
|
-
id text NOT NULL UNIQUE,
|
|
174
|
-
at text NOT NULL,
|
|
175
|
-
actor text NOT NULL,
|
|
176
|
-
action text NOT NULL,
|
|
177
|
-
vault_id text,
|
|
178
|
-
credential_id text,
|
|
179
|
-
session_id text,
|
|
180
|
-
target text,
|
|
181
|
-
outcome text NOT NULL
|
|
182
|
-
);
|
|
183
|
-
CREATE INDEX vault_audit_vault ON ${s}.vault_audit (vault_id, ord);
|
|
184
|
-
|
|
185
|
-
CREATE TABLE ${s}.vault_idempotency (
|
|
186
|
-
id text PRIMARY KEY,
|
|
187
|
-
body_hash text NOT NULL,
|
|
188
|
-
response text NOT NULL
|
|
189
|
-
);
|
|
190
|
-
|
|
191
|
-
CREATE TABLE ${s}.tenant_settings (
|
|
192
|
-
key text PRIMARY KEY,
|
|
193
|
-
value text NOT NULL
|
|
194
|
-
);
|
|
195
|
-
`,
|
|
196
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Migration } from "./index.js";
|
|
2
|
-
/**
|
|
3
|
-
* The session owner (`ownerUserId`) as a stored generated column with an index, so a request
|
|
4
|
-
* acting for a subject lists only that subject's sessions. Not the lease column `owner`.
|
|
5
|
-
*/
|
|
6
|
-
export declare const sessionOwner: Migration;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The session owner (`ownerUserId`) as a stored generated column with an index, so a request
|
|
3
|
-
* acting for a subject lists only that subject's sessions. Not the lease column `owner`.
|
|
4
|
-
*/
|
|
5
|
-
export const sessionOwner = {
|
|
6
|
-
version: 2,
|
|
7
|
-
name: "session_owner",
|
|
8
|
-
up: (s) => `
|
|
9
|
-
ALTER TABLE ${s}.sessions
|
|
10
|
-
ADD COLUMN owner_user_id text GENERATED ALWAYS AS (${s}.doc(body)->>'ownerUserId') STORED;
|
|
11
|
-
CREATE INDEX sessions_owner_user ON ${s}.sessions (owner_user_id);
|
|
12
|
-
`,
|
|
13
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Forward-only, numbered migrations of one Tenant schema (architecture §14.6).
|
|
3
|
-
*
|
|
4
|
-
* Each schema records what it has applied in `<schema>.schema_version`, one
|
|
5
|
-
* row per migration; its version is the highest row. Migrating runs every
|
|
6
|
-
* missing step in order, in the caller's transaction, under a transaction-level
|
|
7
|
-
* advisory lock on the schema so two processes never migrate the same schema
|
|
8
|
-
* at once. A schema newer than the Runtime is never touched: migrating it
|
|
9
|
-
* throws a `schema-too-new` quarantine and the Tenant is quarantined.
|
|
10
|
-
*
|
|
11
|
-
* Adding a migration: append `NNN_name.ts` with the next version to
|
|
12
|
-
* `MIGRATIONS`. Never edit or reorder an applied migration.
|
|
13
|
-
*/
|
|
14
|
-
import type { Sql, TransactionSql } from "postgres";
|
|
15
|
-
export interface Migration {
|
|
16
|
-
/** 1, 2, 3, … without gaps. */
|
|
17
|
-
version: number;
|
|
18
|
-
name: string;
|
|
19
|
-
/** DDL for the quoted schema name `s` (for example `"tenant_tn_…"`). */
|
|
20
|
-
up(s: string): string;
|
|
21
|
-
}
|
|
22
|
-
export declare const MIGRATIONS: readonly Migration[];
|
|
23
|
-
/** The schema version this Runtime writes and expects. */
|
|
24
|
-
export declare const POSTGRES_SCHEMA_VERSION: number;
|
|
25
|
-
/** Checks that versions run 1, 2, 3, … Throws otherwise. */
|
|
26
|
-
export declare function assertMigrations(migrations: readonly Migration[]): void;
|
|
27
|
-
/** Takes the schema's migration lock until the transaction ends. */
|
|
28
|
-
export declare function lockSchema(tx: TransactionSql, schema: string): Promise<void>;
|
|
29
|
-
export declare function schemaExists(sql: Sql | TransactionSql, schema: string): Promise<boolean>;
|
|
30
|
-
/**
|
|
31
|
-
* The schema's version: 0 when it exists without a `schema_version` table,
|
|
32
|
-
* undefined when the schema does not exist.
|
|
33
|
-
*/
|
|
34
|
-
export declare function readSchemaVersion(sql: Sql | TransactionSql, schema: string): Promise<number | undefined>;
|
|
35
|
-
/**
|
|
36
|
-
* Creates the schema when missing and applies every missing migration, inside
|
|
37
|
-
* `tx`. Call `lockSchema` first when other processes may migrate concurrently
|
|
38
|
-
* (`migrateSchema` does). Throws a `schema-too-new` `QuarantineError` when the
|
|
39
|
-
* schema is ahead of `migrations`.
|
|
40
|
-
*/
|
|
41
|
-
export declare function migrateSchemaInTx(tx: TransactionSql, schema: string, migrations?: readonly Migration[]): Promise<{
|
|
42
|
-
from: number;
|
|
43
|
-
to: number;
|
|
44
|
-
}>;
|
|
45
|
-
/** `migrateSchemaInTx` in its own transaction, under the schema's migration lock. */
|
|
46
|
-
export declare function migrateSchema(sql: Sql, schema: string, migrations?: readonly Migration[]): Promise<{
|
|
47
|
-
from: number;
|
|
48
|
-
to: number;
|
|
49
|
-
}>;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { quarantine } from "../../../tenant/quarantine.js";
|
|
2
|
-
import { quoteIdentifier, tenantIdFromSchema } from "../names.js";
|
|
3
|
-
import { initial } from "./001_initial.js";
|
|
4
|
-
import { sessionOwner } from "./002_session_owner.js";
|
|
5
|
-
export const MIGRATIONS = [initial, sessionOwner];
|
|
6
|
-
/** The schema version this Runtime writes and expects. */
|
|
7
|
-
export const POSTGRES_SCHEMA_VERSION = MIGRATIONS.at(-1).version;
|
|
8
|
-
/** Checks that versions run 1, 2, 3, … Throws otherwise. */
|
|
9
|
-
export function assertMigrations(migrations) {
|
|
10
|
-
migrations.forEach((migration, index) => {
|
|
11
|
-
if (migration.version !== index + 1)
|
|
12
|
-
throw new Error(`Migration ${migration.name} has version ${migration.version}, expected ${index + 1}`);
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
/** Takes the schema's migration lock until the transaction ends. */
|
|
16
|
-
export async function lockSchema(tx, schema) {
|
|
17
|
-
await tx `SELECT pg_advisory_xact_lock(hashtextextended(${`nylorun.schema:${schema}`}, 0))`;
|
|
18
|
-
}
|
|
19
|
-
export async function schemaExists(sql, schema) {
|
|
20
|
-
const rows = await sql `SELECT 1 FROM pg_namespace WHERE nspname = ${schema}`;
|
|
21
|
-
return rows.length > 0;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* The schema's version: 0 when it exists without a `schema_version` table,
|
|
25
|
-
* undefined when the schema does not exist.
|
|
26
|
-
*/
|
|
27
|
-
export async function readSchemaVersion(sql, schema) {
|
|
28
|
-
const [row] = await sql `
|
|
29
|
-
SELECT
|
|
30
|
-
EXISTS (SELECT 1 FROM pg_namespace WHERE nspname = ${schema}) AS has_schema,
|
|
31
|
-
to_regclass(${`${quoteIdentifier(schema)}.schema_version`}) IS NOT NULL AS has_table`;
|
|
32
|
-
if (!row.has_schema)
|
|
33
|
-
return undefined;
|
|
34
|
-
if (!row.has_table)
|
|
35
|
-
return 0;
|
|
36
|
-
const [version] = await sql `
|
|
37
|
-
SELECT max(version)::int AS version FROM ${sql(`${schema}.schema_version`)}`;
|
|
38
|
-
return version?.version ?? 0;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Creates the schema when missing and applies every missing migration, inside
|
|
42
|
-
* `tx`. Call `lockSchema` first when other processes may migrate concurrently
|
|
43
|
-
* (`migrateSchema` does). Throws a `schema-too-new` `QuarantineError` when the
|
|
44
|
-
* schema is ahead of `migrations`.
|
|
45
|
-
*/
|
|
46
|
-
export async function migrateSchemaInTx(tx, schema, migrations = MIGRATIONS) {
|
|
47
|
-
assertMigrations(migrations);
|
|
48
|
-
const s = quoteIdentifier(schema);
|
|
49
|
-
const latest = migrations.length;
|
|
50
|
-
await tx.unsafe(`
|
|
51
|
-
CREATE SCHEMA IF NOT EXISTS ${s};
|
|
52
|
-
CREATE TABLE IF NOT EXISTS ${s}.schema_version (
|
|
53
|
-
version integer PRIMARY KEY,
|
|
54
|
-
name text NOT NULL,
|
|
55
|
-
applied_at timestamptz NOT NULL DEFAULT now()
|
|
56
|
-
);`);
|
|
57
|
-
const from = (await readSchemaVersion(tx, schema)) ?? 0;
|
|
58
|
-
if (from > latest)
|
|
59
|
-
throw quarantine("schema-too-new", `Tenant schema version ${from} is newer than this Runtime's ${latest}`, { tenantId: tenantIdFromSchema(schema) ?? schema });
|
|
60
|
-
for (const migration of migrations.slice(from)) {
|
|
61
|
-
await tx.unsafe(migration.up(s));
|
|
62
|
-
await tx `INSERT INTO ${tx(`${schema}.schema_version`)} (version, name)
|
|
63
|
-
VALUES (${migration.version}, ${migration.name})`;
|
|
64
|
-
}
|
|
65
|
-
if (from < latest)
|
|
66
|
-
await tx `UPDATE ${tx(`${schema}.tenant`)} SET schema_version = ${latest}`;
|
|
67
|
-
return { from, to: latest };
|
|
68
|
-
}
|
|
69
|
-
/** `migrateSchemaInTx` in its own transaction, under the schema's migration lock. */
|
|
70
|
-
export async function migrateSchema(sql, schema, migrations = MIGRATIONS) {
|
|
71
|
-
const result = await sql.begin(async (tx) => {
|
|
72
|
-
await lockSchema(tx, schema);
|
|
73
|
-
return { result: await migrateSchemaInTx(tx, schema, migrations) };
|
|
74
|
-
});
|
|
75
|
-
return result.result;
|
|
76
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const TENANT_SCHEMA_PREFIX = "tenant_";
|
|
2
|
-
/** Postgres truncates identifiers longer than NAMEDATALEN - 1 bytes. */
|
|
3
|
-
export declare const MAX_IDENTIFIER_BYTES = 63;
|
|
4
|
-
/** The schema holding `tenantId`'s Session Store. Throws on an invalid id. */
|
|
5
|
-
export declare function tenantSchemaName(tenantId: string): string;
|
|
6
|
-
/** The Tenant id a schema name encodes, or undefined when it is not a Tenant schema. */
|
|
7
|
-
export declare function tenantIdFromSchema(schema: string): string | undefined;
|
|
8
|
-
/** Rejects names Postgres would truncate or that could not be quoted safely. */
|
|
9
|
-
export declare function assertIdentifier(name: string): void;
|
|
10
|
-
/** `"name"`, for SQL text built outside a tagged template (migrations). */
|
|
11
|
-
export declare function quoteIdentifier(name: string): string;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tenant id ↔ Postgres schema name (architecture §8.1, §12.2).
|
|
3
|
-
*
|
|
4
|
-
* A Tenant's Session Store is the schema `"tenant_<id>"`, for example
|
|
5
|
-
* `tn_01k8z3…` ↦ `"tenant_tn_01k8z3…"`. Tenant ids match
|
|
6
|
-
* `^tn_[0-9a-hjkmnp-tv-z]{26}$` (lowercase ASCII), so the name is 36 bytes,
|
|
7
|
-
* under Postgres' 63-byte identifier limit, and needs no case folding. It is
|
|
8
|
-
* always written quoted. The mapping is total and reversible: a schema that
|
|
9
|
-
* starts with `tenant_` but does not decode to a valid Tenant id is not a
|
|
10
|
-
* Tenant.
|
|
11
|
-
*/
|
|
12
|
-
import { isTenantId } from "@nylorun/core/compatibility";
|
|
13
|
-
export const TENANT_SCHEMA_PREFIX = "tenant_";
|
|
14
|
-
/** Postgres truncates identifiers longer than NAMEDATALEN - 1 bytes. */
|
|
15
|
-
export const MAX_IDENTIFIER_BYTES = 63;
|
|
16
|
-
/** The schema holding `tenantId`'s Session Store. Throws on an invalid id. */
|
|
17
|
-
export function tenantSchemaName(tenantId) {
|
|
18
|
-
if (!isTenantId(tenantId))
|
|
19
|
-
throw new Error(`Invalid tenant id: ${tenantId}`);
|
|
20
|
-
const schema = `${TENANT_SCHEMA_PREFIX}${tenantId}`;
|
|
21
|
-
assertIdentifier(schema);
|
|
22
|
-
return schema;
|
|
23
|
-
}
|
|
24
|
-
/** The Tenant id a schema name encodes, or undefined when it is not a Tenant schema. */
|
|
25
|
-
export function tenantIdFromSchema(schema) {
|
|
26
|
-
if (!schema.startsWith(TENANT_SCHEMA_PREFIX))
|
|
27
|
-
return undefined;
|
|
28
|
-
const id = schema.slice(TENANT_SCHEMA_PREFIX.length);
|
|
29
|
-
return isTenantId(id) ? id : undefined;
|
|
30
|
-
}
|
|
31
|
-
/** Rejects names Postgres would truncate or that could not be quoted safely. */
|
|
32
|
-
export function assertIdentifier(name) {
|
|
33
|
-
if (name.length === 0 ||
|
|
34
|
-
Buffer.byteLength(name, "utf8") > MAX_IDENTIFIER_BYTES ||
|
|
35
|
-
!/^[a-z_][a-z0-9_]*$/.test(name))
|
|
36
|
-
throw new Error(`Invalid Postgres identifier: ${name}`);
|
|
37
|
-
}
|
|
38
|
-
/** `"name"`, for SQL text built outside a tagged template (migrations). */
|
|
39
|
-
export function quoteIdentifier(name) {
|
|
40
|
-
assertIdentifier(name);
|
|
41
|
-
return `"${name}"`;
|
|
42
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The Tenant catalog on one Postgres database (architecture §8.2).
|
|
3
|
-
*
|
|
4
|
-
* A Tenant exists when its schema `"tenant_<id>"` exists (see `names.ts`); the
|
|
5
|
-
* Host keeps no other registry. The envelope is the one row of the schema's
|
|
6
|
-
* `tenant` table, and its `schemaVersion` is the schema's migrated version.
|
|
7
|
-
*
|
|
8
|
-
* - `createTenant` runs in one transaction: create the schema, migrate it,
|
|
9
|
-
* write the envelope and the bootstrap principals. A crash leaves nothing.
|
|
10
|
-
* Creating an existing Tenant with the same bootstrap principals returns
|
|
11
|
-
* `exists`; with different ones it throws `TenantConflictError`.
|
|
12
|
-
* - `openTenant` migrates an older schema forward and returns its store. A
|
|
13
|
-
* schema newer than this Runtime, a failed migration or an unreadable
|
|
14
|
-
* envelope quarantines that Tenant only. A lost connection or an unavailable
|
|
15
|
-
* server says nothing about the Tenant, so it is thrown, never a quarantine.
|
|
16
|
-
* - `deleteTenant` drops the schema with everything in it.
|
|
17
|
-
*
|
|
18
|
-
* Create, migrate and delete of one schema are serialized by a
|
|
19
|
-
* transaction-level advisory lock on the schema name.
|
|
20
|
-
*/
|
|
21
|
-
import type { Sql } from "postgres";
|
|
22
|
-
import { type TenantEnvelope } from "@nylorun/core/contracts";
|
|
23
|
-
import type { BootstrapPrincipal, Quarantine } from "../../tenant/types.js";
|
|
24
|
-
import type { SessionStore } from "../types.js";
|
|
25
|
-
import { type Migration } from "./migrations/index.js";
|
|
26
|
-
export interface PostgresTenantCatalogOptions {
|
|
27
|
-
/** The shared pool. The catalog and its stores never end it. */
|
|
28
|
-
sql: Sql;
|
|
29
|
-
/** Clock for principal `createdAt`. Defaults to `() => new Date()`. */
|
|
30
|
-
now?: () => Date;
|
|
31
|
-
/** Passed to every opened store. */
|
|
32
|
-
onError?: (error: unknown) => void;
|
|
33
|
-
/** Tests only: the migrations this Runtime knows. */
|
|
34
|
-
migrations?: readonly Migration[];
|
|
35
|
-
}
|
|
36
|
-
export interface TenantListing {
|
|
37
|
-
id: string;
|
|
38
|
-
/** Null when the envelope cannot be read; `quarantine` says why. */
|
|
39
|
-
envelope: TenantEnvelope | null;
|
|
40
|
-
quarantine?: Quarantine;
|
|
41
|
-
}
|
|
42
|
-
export type CreateTenantResult = {
|
|
43
|
-
status: "created";
|
|
44
|
-
envelope: TenantEnvelope;
|
|
45
|
-
} | {
|
|
46
|
-
status: "exists";
|
|
47
|
-
envelope: TenantEnvelope;
|
|
48
|
-
};
|
|
49
|
-
export type OpenTenantResult = {
|
|
50
|
-
status: "ok";
|
|
51
|
-
store: SessionStore;
|
|
52
|
-
envelope: TenantEnvelope;
|
|
53
|
-
migrated: {
|
|
54
|
-
from: number;
|
|
55
|
-
to: number;
|
|
56
|
-
};
|
|
57
|
-
} | {
|
|
58
|
-
status: "quarantined";
|
|
59
|
-
reason: Quarantine;
|
|
60
|
-
} | {
|
|
61
|
-
status: "not-found";
|
|
62
|
-
};
|
|
63
|
-
export interface PostgresTenantCatalog {
|
|
64
|
-
/** Every `tenant_*` schema that encodes a Tenant id, ordered by id. */
|
|
65
|
-
listTenants(): Promise<TenantListing[]>;
|
|
66
|
-
/** The ids of `listTenants`, without reading any envelope. */
|
|
67
|
-
listTenantIds(): Promise<string[]>;
|
|
68
|
-
/** Whether the Tenant's schema exists. */
|
|
69
|
-
tenantExists(id: string): Promise<boolean>;
|
|
70
|
-
/** Throws a `QuarantineError` (`envelope-invalid`) when unreadable. */
|
|
71
|
-
readEnvelope(id: string): Promise<TenantEnvelope>;
|
|
72
|
-
createTenant(input: {
|
|
73
|
-
envelope: TenantEnvelope;
|
|
74
|
-
principals: BootstrapPrincipal;
|
|
75
|
-
}): Promise<CreateTenantResult>;
|
|
76
|
-
/** Whether the stored bootstrap (and Studio) principals equal `bootstrap`. */
|
|
77
|
-
bootstrapMatches(id: string, bootstrap: BootstrapPrincipal): Promise<boolean>;
|
|
78
|
-
openTenant(id: string, options?: {
|
|
79
|
-
now?: () => Date;
|
|
80
|
-
onError?: (error: unknown) => void;
|
|
81
|
-
}): Promise<OpenTenantResult>;
|
|
82
|
-
/** Migrates an existing Tenant schema. Throws `schema-too-new` or the migration error. */
|
|
83
|
-
migrateTenant(id: string): Promise<{
|
|
84
|
-
from: number;
|
|
85
|
-
to: number;
|
|
86
|
-
}>;
|
|
87
|
-
/** Drops the schema and everything in it. Returns false when it did not exist. */
|
|
88
|
-
deleteTenant(id: string): Promise<boolean>;
|
|
89
|
-
}
|
|
90
|
-
export declare function createPostgresTenantCatalog(options: PostgresTenantCatalogOptions): PostgresTenantCatalog;
|