@substrat-run/control-plane-api 0.57.1 → 0.58.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 +1 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +24 -1
- package/dist/api.js.map +1 -1
- package/dist/connection-relay.d.ts +32 -0
- package/dist/connection-relay.d.ts.map +1 -0
- package/dist/connection-relay.js +100 -0
- package/dist/connection-relay.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/platform-drain.d.ts +1 -1
- package/dist/platform-drain.d.ts.map +1 -1
- package/dist/platform-drain.js +5 -1
- package/dist/platform-drain.js.map +1 -1
- package/dist/vertical-client.d.ts +27 -1
- package/dist/vertical-client.d.ts.map +1 -1
- package/dist/vertical-client.js +20 -0
- package/dist/vertical-client.js.map +1 -1
- package/package.json +6 -6
package/dist/api.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Hono } from 'hono';
|
|
|
2
2
|
import type { PlatformActorId } from '@substrat-run/contracts';
|
|
3
3
|
import type { ScopeHost } from '@substrat-run/kernel';
|
|
4
4
|
import type { PlatformActorAuth, BuilderAuth, Principal } from './auth.js';
|
|
5
|
-
import type
|
|
5
|
+
import { type VerticalClient } from './vertical-client.js';
|
|
6
6
|
import type { DeployVerticalFn, FetchVerticalAssetFn, FetchVerticalModulesFn } from './deploy.js';
|
|
7
7
|
import type { PatchScriptBindingsFn } from './wfp.js';
|
|
8
8
|
import type { ObservabilityReader } from './observability.js';
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAiC5B,OAAO,KAAK,EAGV,eAAe,EAMhB,MAAM,yBAAyB,CAAC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E,KAAK,EAAE,eAAe,CAAC;IAAC,SAAS,EAAE,SAAS,CAAA;CAAE,CAAC;AA2P7D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAAE,SAAS,EAAE,IAAI,CAAA;CAAE,CAAC,CAyyGhG"}
|
package/dist/api.js
CHANGED
|
@@ -2,6 +2,7 @@ import { Hono } from 'hono';
|
|
|
2
2
|
import { adminAction, ASSET_PART_PREFIX, assetHash, channelName, createTenantInput, entitlementGrantInput, hostname as hostnameSchema, hostnameRegion, hostnameStatus, identityLink, listPageQuery, pageOf, principalId as principalIdSchema, promotionAcknowledgement, provisionableJurisdiction, publishVersionInput, queryScopeInput, readScopeTableInput, registerVerticalInput, scopeDump, dataSubjectId as dataSubjectIdSchema, scopeId as scopeIdSchema, scopeStatus, storageShape, surfaceName, tenantId as tenantIdSchema, tenantStatus, versionOrigin, z, } from '@substrat-run/contracts';
|
|
3
3
|
import { migrationProgress, ulid } from '@substrat-run/kernel';
|
|
4
4
|
import { TENANT_HEADER } from './auth.js';
|
|
5
|
+
import { connectionGrantsForScope } from './vertical-client.js';
|
|
5
6
|
import { ControlPlaneError } from './client.js';
|
|
6
7
|
import { provisionSiblingScope } from './platform-drain.js';
|
|
7
8
|
import { mapError } from './errors.js';
|
|
@@ -610,6 +611,12 @@ export function createControlPlaneApi(options) {
|
|
|
610
611
|
const tenantId = tenantIdSchema.parse(c.req.param('tenantId'));
|
|
611
612
|
return c.json(await admin.listIdentityLinks(c.get('actor'), tenantId));
|
|
612
613
|
});
|
|
614
|
+
// The tenant's live connection grants (#592) — the readable "what may this connection
|
|
615
|
+
// invoke" (connections.md §6.2.4 Q2), and the rows provision/reconcile deliver from.
|
|
616
|
+
app.get('/tenants/:tenantId/connection-grants', async (c) => {
|
|
617
|
+
const tenantId = tenantIdSchema.parse(c.req.param('tenantId'));
|
|
618
|
+
return c.json(await admin.listConnectionGrants(c.get('actor'), tenantId));
|
|
619
|
+
});
|
|
613
620
|
// -- the scope directory (§3.2/§4.2) ---------------------------------------
|
|
614
621
|
app.get('/scopes', async (c) => {
|
|
615
622
|
const p = c.get('principal');
|
|
@@ -1021,8 +1028,18 @@ export function createControlPlaneApi(options) {
|
|
|
1021
1028
|
// #406: re-gathered and re-delivered like entitlements, so a reconcile also repairs a
|
|
1022
1029
|
// dropped identity-link delivery — and is the channel a link/unlink after provision rides.
|
|
1023
1030
|
const identityLinks = (await admin.listIdentityLinks(actor, tenantId)).map(({ tenantId: _tenantId, ...link }) => link);
|
|
1031
|
+
// #592: connection grants ride the same authoritative gather — the back-fill for a
|
|
1032
|
+
// scope provisioned before `grantToConnection` ran, and how a revoked connection's
|
|
1033
|
+
// grants stop being delivered (they are absent from the directory's live rows).
|
|
1034
|
+
const connectionGrants = connectionGrantsForScope(await admin.listConnectionGrants(actor, tenantId), scope.vertical, scopeId);
|
|
1024
1035
|
try {
|
|
1025
|
-
const result = await vertical.reconcileInstance({
|
|
1036
|
+
const result = await vertical.reconcileInstance({
|
|
1037
|
+
tenantId,
|
|
1038
|
+
scopeId,
|
|
1039
|
+
entitlements,
|
|
1040
|
+
identityLinks,
|
|
1041
|
+
connectionGrants,
|
|
1042
|
+
});
|
|
1026
1043
|
return c.json(result);
|
|
1027
1044
|
}
|
|
1028
1045
|
catch (e) {
|
|
@@ -1906,6 +1923,11 @@ export function createControlPlaneApi(options) {
|
|
|
1906
1923
|
// so its auth adapter resolves logins from local storage, and offboarding becomes an
|
|
1907
1924
|
// unlink + re-deliver instead of a source edit + deploy.
|
|
1908
1925
|
const identityLinks = (await admin.listIdentityLinks(c.get('actor'), input.tenantId)).map(({ tenantId: _tenantId, ...link }) => link);
|
|
1926
|
+
// #592: connection grants too — tenant-wide rows materialize for the NEW scope, so an
|
|
1927
|
+
// install provisioned after `grantToConnection` holds the same `connection:<id>` tuple
|
|
1928
|
+
// as one provisioned before it, and the connector return path works without a human
|
|
1929
|
+
// replaying grants per install.
|
|
1930
|
+
const connectionGrants = connectionGrantsForScope(await admin.listConnectionGrants(c.get('actor'), input.tenantId), slug, input.scopeId);
|
|
1909
1931
|
// #301 PR-2: per-tenant relational stores the vertical DECLARED, minted here (before
|
|
1910
1932
|
// the callback — the vertical migrates the store inside the K-31 ready-gate, so it
|
|
1911
1933
|
// must exist and be bound first). Idempotent like the endpoint: a retried provision
|
|
@@ -1937,6 +1959,7 @@ export function createControlPlaneApi(options) {
|
|
|
1937
1959
|
...input,
|
|
1938
1960
|
entitlements,
|
|
1939
1961
|
identityLinks,
|
|
1962
|
+
connectionGrants,
|
|
1940
1963
|
...(tenantStores.length ? { tenantStores } : {}),
|
|
1941
1964
|
}));
|
|
1942
1965
|
return c.json(instance, 201);
|