@substrat-run/control-plane-api 0.147.0 → 0.148.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.ts +56 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +801 -379
- package/dist/api.js.map +1 -1
- package/dist/deploy.d.ts +4 -3
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +3 -3
- package/dist/deploy.js.map +1 -1
- package/dist/errors.d.ts +19 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +18 -4
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +10 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/lake-gateway.d.ts +54 -0
- package/dist/lake-gateway.d.ts.map +1 -0
- package/dist/lake-gateway.js +158 -0
- package/dist/lake-gateway.js.map +1 -0
- package/dist/platform-entry.generated.d.ts +1 -1
- package/dist/platform-entry.generated.d.ts.map +1 -1
- package/dist/platform-entry.generated.js +2 -2
- package/dist/platform-entry.generated.js.map +1 -1
- package/dist/platform-scope-stores.d.ts +59 -6
- package/dist/platform-scope-stores.d.ts.map +1 -1
- package/dist/platform-scope-stores.js +117 -16
- package/dist/platform-scope-stores.js.map +1 -1
- package/dist/r2-sql-engine.d.ts +50 -0
- package/dist/r2-sql-engine.d.ts.map +1 -0
- package/dist/r2-sql-engine.js +126 -0
- package/dist/r2-sql-engine.js.map +1 -0
- package/dist/scope-copy-cleanup.d.ts +12 -0
- package/dist/scope-copy-cleanup.d.ts.map +1 -1
- package/dist/scope-copy-cleanup.js +14 -3
- package/dist/scope-copy-cleanup.js.map +1 -1
- package/dist/store-entry.d.ts +90 -0
- package/dist/store-entry.d.ts.map +1 -0
- package/dist/store-entry.generated.d.ts +60 -0
- package/dist/store-entry.generated.d.ts.map +1 -0
- package/dist/store-entry.generated.js +62 -0
- package/dist/store-entry.generated.js.map +1 -0
- package/dist/store-entry.js +178 -0
- package/dist/store-entry.js.map +1 -0
- package/dist/store-releases.d.ts +147 -0
- package/dist/store-releases.d.ts.map +1 -0
- package/dist/store-releases.js +298 -0
- package/dist/store-releases.js.map +1 -0
- package/dist/store-script.d.ts +80 -0
- package/dist/store-script.d.ts.map +1 -0
- package/dist/store-script.js +173 -0
- package/dist/store-script.js.map +1 -0
- package/dist/vertical-client.d.ts +4 -0
- package/dist/vertical-client.d.ts.map +1 -1
- package/dist/vertical-client.js +10 -1
- package/dist/vertical-client.js.map +1 -1
- package/package.json +7 -7
package/dist/api.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { ConnectionScopeBinding, ConnectionScopeBindingInput } from '@substrat-run/control-plane-client';
|
|
1
2
|
import { Hono } from 'hono';
|
|
2
|
-
import { type ConnectionCertificate, z, type StoreKindRegistration } from '@substrat-run/contracts';
|
|
3
|
+
import { type ConnectionCertificate, z, type ScopeStoreNeed, type StoreKindRegistration } from '@substrat-run/contracts';
|
|
3
4
|
import type { Connection, ConnectionActivity, ConnectionActivitySource, ConnectionCredential, ConnectionProbe, PlatformActorId } from '@substrat-run/contracts';
|
|
4
5
|
import type { CrossVerticalOptions, HostAdmin, ScopeHost } from '@substrat-run/kernel';
|
|
5
6
|
import type { PlatformActorAuth, BuilderAuth, Principal, TenantServiceAuth } from './auth.js';
|
|
6
7
|
import { type VerticalClient } from './vertical-client.js';
|
|
7
8
|
import type { PlatformScopeStores } from './platform-scope-stores.js';
|
|
9
|
+
import type { ScopeStoreEnsurerOptions } from './store-script.js';
|
|
10
|
+
import { type CanaryCall, type StoreReleaseBytes } from './store-releases.js';
|
|
8
11
|
import { type ConnectionCandidatePrepare } from './connection-relay.js';
|
|
9
12
|
import type { DeployVerticalFn, FetchVerticalAssetFn, FetchVerticalModulesFn } from './deploy.js';
|
|
10
13
|
import type { PatchScriptBindingsFn } from './wfp.js';
|
|
@@ -12,6 +15,7 @@ import { type ObservabilityReader } from './observability.js';
|
|
|
12
15
|
import type { PlatformRuntime } from './platform-runtime.js';
|
|
13
16
|
import { type DoNamespaceReader } from './do-namespaces.js';
|
|
14
17
|
import type { DirectoryBackupStore, ScopeBackupStore } from './backups.js';
|
|
18
|
+
import { type LakeQueryEngine } from './lake-gateway.js';
|
|
15
19
|
import { type CustomHostnameProvisioner } from './custom-hostnames.js';
|
|
16
20
|
/**
|
|
17
21
|
* What one provider can answer about a live connection (#605) — the seam behind
|
|
@@ -25,6 +29,13 @@ import { type CustomHostnameProvisioner } from './custom-hostnames.js';
|
|
|
25
29
|
* callback capability token), and redaction has to be structural.
|
|
26
30
|
*/
|
|
27
31
|
export interface ConnectionInspector {
|
|
32
|
+
/** Poll-only landing setup. The API checks tenant, vertical and the in-scope grant first. */
|
|
33
|
+
bindScope?: (host: ScopeHost, connection: Connection, target: ConnectionScopeBindingInput & {
|
|
34
|
+
tenantId: string;
|
|
35
|
+
scopeId: string;
|
|
36
|
+
vertical: string;
|
|
37
|
+
}) => Promise<ConnectionScopeBinding>;
|
|
38
|
+
bindings?: (host: ScopeHost, connection: Connection) => Promise<ConnectionScopeBinding[]>;
|
|
28
39
|
probe?: (host: ScopeHost, connection: Connection) => Promise<ConnectionProbe>;
|
|
29
40
|
activity?: (host: ScopeHost, connection: Connection, opts: {
|
|
30
41
|
live: boolean;
|
|
@@ -144,6 +155,44 @@ export interface ControlPlaneApiOptions {
|
|
|
144
155
|
* 501s. See `deploy.ts`.
|
|
145
156
|
*/
|
|
146
157
|
deployVertical?: DeployVerticalFn;
|
|
158
|
+
/**
|
|
159
|
+
* Uploads the store script for each declared scope store before the vertical's own
|
|
160
|
+
* upload (#2210). Absent ⇒ a push that declares a store and has a registered kind is
|
|
161
|
+
* refused, rather than serving a vertical whose store script was never uploaded.
|
|
162
|
+
*/
|
|
163
|
+
ensureScopeStores?: (input: {
|
|
164
|
+
vertical: string;
|
|
165
|
+
stores: readonly ScopeStoreNeed[];
|
|
166
|
+
/** The release a rollout moves the scripts to; a push or serve passes none (#2300). */
|
|
167
|
+
to?: string;
|
|
168
|
+
loadRelease: ScopeStoreEnsurerOptions['loadRelease'];
|
|
169
|
+
}) => Promise<void | {
|
|
170
|
+
uploaded: number;
|
|
171
|
+
}>;
|
|
172
|
+
/**
|
|
173
|
+
* A store kind's release flow (D-63, #2300): where release bytes are kept, how a release is put
|
|
174
|
+
* in the kind's canary script, and how the canary's reserved calls reach it. Absent ⇒ the
|
|
175
|
+
* release routes answer 501, and a push of a declared store finds no release (409).
|
|
176
|
+
*/
|
|
177
|
+
storeReleases?: {
|
|
178
|
+
bytes: StoreReleaseBytes;
|
|
179
|
+
ensureCanary(input: {
|
|
180
|
+
kind: string;
|
|
181
|
+
to: string;
|
|
182
|
+
loadRelease: ScopeStoreEnsurerOptions['loadRelease'];
|
|
183
|
+
}): Promise<{
|
|
184
|
+
scriptName: string;
|
|
185
|
+
}>;
|
|
186
|
+
callCanary: CanaryCall;
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* The actor a request's credential names when that credential is a person's staff session,
|
|
190
|
+
* else null (D-63: a release is published by a person). The host passes only the readers of a
|
|
191
|
+
* human sign-in, never a service token's, so the automation token, which resolves to a staff
|
|
192
|
+
* actor too, is refused here. That holds only while the staff roster lists people alone
|
|
193
|
+
* (docs/architecture/control-plane.md §4.4). Absent ⇒ no request publishes a release.
|
|
194
|
+
*/
|
|
195
|
+
humanStaffActor?: (request: Request) => Promise<PlatformActorId | null>;
|
|
147
196
|
/**
|
|
148
197
|
* Reads a script's module contents back from the platform runtime (#286) — the
|
|
149
198
|
* archive script is the bundle store the serving upload reads from. Host-injected
|
|
@@ -240,6 +289,12 @@ export interface ControlPlaneApiOptions {
|
|
|
240
289
|
* means forgetting that costs a feature, never a leak.
|
|
241
290
|
*/
|
|
242
291
|
observability?: ObservabilityReader;
|
|
292
|
+
/**
|
|
293
|
+
* The Tier-2 lake's query engine (#1334), host-injected like `observability` so this
|
|
294
|
+
* package holds no lake credential. Absent ⇒ `GET /tenants/:tenantId/lake/events` 501s.
|
|
295
|
+
* Every read goes through `lake-gateway.ts`, which is what scopes it to one tenant.
|
|
296
|
+
*/
|
|
297
|
+
lakeQuery?: LakeQueryEngine;
|
|
243
298
|
/**
|
|
244
299
|
* Per-provider connection **inspectors** (#605), keyed by provider slug — what makes
|
|
245
300
|
* an integration something an operator can interrogate rather than trust.
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAE9G,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAsBL,KAAK,qBAAqB,EA+E1B,CAAC,EAcD,KAAK,cAAc,EAEnB,KAAK,qBAAqB,EAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAGV,UAAU,EACV,kBAAkB,EAGlB,wBAAwB,EACxB,oBAAoB,EAEpB,eAAe,EAKf,eAAe,EAUhB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAoB,oBAAoB,EAAE,SAAS,EAAoD,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAsB3J,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9F,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EAAsB,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAE1F,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAgF,KAAK,UAAU,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