@substrat-run/control-plane-api 0.136.0 → 0.137.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.map +1 -1
- package/dist/api.js +15 -4
- package/dist/api.js.map +1 -1
- package/dist/cf-observability.d.ts +15 -0
- package/dist/cf-observability.d.ts.map +1 -1
- package/dist/cf-observability.js +25 -12
- package/dist/cf-observability.js.map +1 -1
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +3 -4
- package/dist/deploy.js.map +1 -1
- package/dist/field-coverage-tally.d.ts +58 -0
- package/dist/field-coverage-tally.d.ts.map +1 -0
- package/dist/field-coverage-tally.js +234 -0
- package/dist/field-coverage-tally.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- 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/reconcile.d.ts +10 -3
- package/dist/reconcile.d.ts.map +1 -1
- package/dist/reconcile.js +7 -2
- package/dist/reconcile.js.map +1 -1
- package/dist/service-family.d.ts +19 -0
- package/dist/service-family.d.ts.map +1 -0
- package/dist/service-family.js +27 -0
- package/dist/service-family.js.map +1 -0
- package/dist/vertical-client.d.ts +15 -1
- package/dist/vertical-client.d.ts.map +1 -1
- package/dist/vertical-client.js +1 -0
- package/dist/vertical-client.js.map +1 -1
- package/package.json +6 -6
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":"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M,yBAAyB,kCAAkC,CAAC;AAKzE,KAAK,IAAI,GAAG;IACV,KAAK,EAAE,eAAe,CAAC;IACvB,SAAS,EAAE,SAAS,CAAC;IACrB;;;;;;OAMG;IACH,IAAI,EAAE,SAAS,CAAC;IAChB,kFAAkF;IAClF,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC;AAwYF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;iBASzB,CAAC;AAqCH,yFAAyF;AACzF,eAAO,MAAM,yBAAyB,MAAM,CAAC;AA8G7C,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAuC/C,KAAK,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AA6IjE;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAEvF;AAuBD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAAE,SAAS,EAAE,IAAI,CAAA;CAAE,CAAC,CA82OhG"}
|
package/dist/api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveObservabilityWindow } from './observability-window.js';
|
|
2
2
|
import { Hono } from 'hono';
|
|
3
|
-
import { parseHostname, withLabel, RESERVED_LABEL_SEPARATOR, adminAction, ownerTransferInput, OWNER_TRANSFER_AUDIT_ERROR_MAX, ASSET_PART_PREFIX, assetHash, channelName, connectionActivity, connectionActivitySource, connectionCredential, connectionFilter, connectionHealthState, connectionProvider, connectorDispatchKind, PROVISION_SIBLING_KIND, ARCHIVE_SCOPE_KIND, PROVISION_TENANT_KIND, SET_ENTITLEMENTS_KIND, MODEL_USAGE_KIND, SWEEP_RUNS_KIND, toConnectionHealthEntry, CONNECTION_EXPIRY_WARNING_DAYS, CONNECTION_STALE_DAYS, connectionProbe, createTenantInput, entitlementGrantInput, hostname as hostnameSchema, hostnameRegion, hostnameStatus, identityLink, errorCode, issueStatus, issueStatusInput, listPageQuery, matchesOutboundHost, pageOf, platformRequestFilter, principalId as principalIdSchema, impersonationStamp, promotionAcknowledgement, bindAcknowledgement, provisionableJurisdiction, publishVersionInput, queryScopeInput, readScopeTableInput, entityHistoryInput, eventFacetInput, eventCauseInput, eventEffectsInput, invocationEventsInput, deadLettersInput, lifecycleFlowInput, delegatedReadParams, createOrgInput, roleKey as roleKeySchema, peerSwitch, systemSwitch, DEFAULT_DENIAL_LIMIT, DENIAL_LIMIT_MAX, denialGroupBy, registerVerticalInput, serviceDimensions, sweepRunKind, sweepRunOutcome, scopeDump, dataSubjectId as dataSubjectIdSchema, scopeId as scopeIdSchema, scopeStatus, storageShape, surfaceName, tenantId as tenantIdSchema, tenantStatus, versionOrigin, z, PROBLEM_CONTENT_TYPE, toProblem, redrainEventsInput, importCursorMove, importCursorAcknowledgementMissing, REDRAIN_BATCH, migrationsOnTop, errorCodeOf, capabilityFilterQuery, PLATFORM_FEATURES_HEADER, PLATFORM_FEATURE_SCOPE_SWEEPER, } from '@substrat-run/contracts';
|
|
3
|
+
import { parseHostname, withLabel, RESERVED_LABEL_SEPARATOR, adminAction, ownerTransferInput, OWNER_TRANSFER_AUDIT_ERROR_MAX, ASSET_PART_PREFIX, assetHash, channelName, connectionActivity, connectionActivitySource, connectionCredential, connectionFilter, connectionHealthState, connectionProvider, connectorDispatchKind, PROVISION_SIBLING_KIND, ARCHIVE_SCOPE_KIND, PROVISION_TENANT_KIND, SET_ENTITLEMENTS_KIND, MODEL_USAGE_KIND, SWEEP_RUNS_KIND, toConnectionHealthEntry, CONNECTION_EXPIRY_WARNING_DAYS, CONNECTION_STALE_DAYS, connectionProbe, createTenantInput, entitlementGrantInput, hostname as hostnameSchema, hostnameRegion, hostnameStatus, identityLink, errorCode, issueStatus, issueStatusInput, listPageQuery, matchesOutboundHost, pageOf, platformRequestFilter, principalId as principalIdSchema, impersonationStamp, promotionAcknowledgement, bindAcknowledgement, provisionableJurisdiction, publishVersionInput, queryScopeInput, readScopeTableInput, entityHistoryInput, eventFacetInput, eventCauseInput, eventEffectsInput, invocationEventsInput, deadLettersInput, lifecycleFlowInput, delegatedReadParams, createOrgInput, roleKey as roleKeySchema, peerSwitch, systemSwitch, DEFAULT_DENIAL_LIMIT, DENIAL_LIMIT_MAX, denialGroupBy, registerVerticalInput, platformScriptCollision, platformScriptRefusal, PLATFORM_SCRIPT_NAMES, serviceDimensions, sweepRunKind, sweepRunOutcome, scopeDump, dataSubjectId as dataSubjectIdSchema, scopeId as scopeIdSchema, scopeStatus, storageShape, surfaceName, tenantId as tenantIdSchema, tenantStatus, versionOrigin, z, PROBLEM_CONTENT_TYPE, toProblem, redrainEventsInput, importCursorMove, importCursorAcknowledgementMissing, REDRAIN_BATCH, migrationsOnTop, errorCodeOf, capabilityFilterQuery, PLATFORM_FEATURES_HEADER, PLATFORM_FEATURE_SCOPE_SWEEPER, } from '@substrat-run/contracts';
|
|
4
4
|
import { attributeFailure } from './failure-attribution.js';
|
|
5
5
|
import { BIND_EXPORT_BREAK_REFUSAL, CARRIED_AWAY_KEY, bindExportBreakRefusal, carriedAwayDump, dumpMetaValue, metaValueIn, crossVerticalHealth, exportBreakRefusal, isBindExportBreakRefusal, isExportBreakRefusal, isPrimaryScope, migrationProgress, ulid, } from '@substrat-run/kernel';
|
|
6
6
|
import { TENANT_HEADER, confinedTenant } from './auth.js';
|
|
@@ -3167,7 +3167,7 @@ export function createControlPlaneApi(options) {
|
|
|
3167
3167
|
return c.json({ error: `scope ${scopeId} has no hostname bound — a claim link needs an address to open on` }, 409);
|
|
3168
3168
|
}
|
|
3169
3169
|
try {
|
|
3170
|
-
return c.json(await vertical.mintOwnerClaim({ tenantId, scopeId, origin: `https://${host.hostname}
|
|
3170
|
+
return c.json(await vertical.mintOwnerClaim({ tenantId, scopeId, origin: `https://${host.hostname}`, actor }), 201);
|
|
3171
3171
|
}
|
|
3172
3172
|
catch (e) {
|
|
3173
3173
|
if (e instanceof ControlPlaneError)
|
|
@@ -3354,7 +3354,7 @@ export function createControlPlaneApi(options) {
|
|
|
3354
3354
|
forkedAt: new Date().toISOString(),
|
|
3355
3355
|
expiresAt: opts.expiresAt,
|
|
3356
3356
|
});
|
|
3357
|
-
await retryTransient(() => vertical.snapshotScope({ sourceScopeId: scope.id, newScopeId: snapId }));
|
|
3357
|
+
await retryTransient(() => vertical.snapshotScope({ sourceScopeId: scope.id, newScopeId: snapId, tenantId }));
|
|
3358
3358
|
await c.var.admin.activateScope(actor, tenantId, snapId);
|
|
3359
3359
|
// Bound to the SOURCE's current version: source and fork share a deployment, so
|
|
3360
3360
|
// the fork resolves to the DO namespace its bytes actually live in.
|
|
@@ -4319,7 +4319,8 @@ export function createControlPlaneApi(options) {
|
|
|
4319
4319
|
// through, makes the next sweep reconcile the scope, and that reconcile re-asserts
|
|
4320
4320
|
// what the directory records as off. Left to the sweep rather than done here: the
|
|
4321
4321
|
// scope's store restarts to finish the restore, and a re-assert now would race it.
|
|
4322
|
-
// Meanwhile, the deployment that rewound it holds those modules off
|
|
4322
|
+
// Meanwhile, the deployment that rewound it holds those modules off at its system door, so
|
|
4323
|
+
// their schedules and job runs both wait (#1819, #1834). A hold is
|
|
4323
4324
|
// released by that reconcile's re-assert, or earlier by a switch move known to land on the
|
|
4324
4325
|
// rewound storage, such as an operator's ON.
|
|
4325
4326
|
await c.var.admin.markScopeProvisioned(actor, tenantId, scopeId, null);
|
|
@@ -5447,6 +5448,10 @@ export function createControlPlaneApi(options) {
|
|
|
5447
5448
|
const doClasses = deployedDoClasses(manifest.doClasses, manifest.platformSweeper);
|
|
5448
5449
|
const serving = await host.admin.verticalServing(actor, slug);
|
|
5449
5450
|
const ref = serving?.ref ?? stableDeploymentRefFor(slug);
|
|
5451
|
+
// #1923: the serving upload is the other door a script name is minted through.
|
|
5452
|
+
const collision = platformScriptCollision(slug) ?? (PLATFORM_SCRIPT_NAMES.has(ref) ? ref : null);
|
|
5453
|
+
if (collision)
|
|
5454
|
+
throw new ControlPlaneError(422, platformScriptRefusal(slug, collision));
|
|
5450
5455
|
const modules = await options.fetchVerticalModules(version.deploymentRef);
|
|
5451
5456
|
// #301 PR-2: every serving upload re-derives the per-tenant store D1 bindings from
|
|
5452
5457
|
// the ledger and sends them WITH the bundle's own bindings — an upload's `bindings`
|
|
@@ -5860,6 +5865,12 @@ export function createControlPlaneApi(options) {
|
|
|
5860
5865
|
slug = bare;
|
|
5861
5866
|
ownerTenant = (await ownerOf(c.get('actor'), slug)) ?? null;
|
|
5862
5867
|
}
|
|
5868
|
+
// #1923: a slug that would deploy under one of the platform's own script names is refused
|
|
5869
|
+
// before anything is uploaded. Registration refuses it too; this is the deploy half, for a
|
|
5870
|
+
// registry id that predates the rule, so it can never put a script under a platform name.
|
|
5871
|
+
const collision = platformScriptCollision(slug);
|
|
5872
|
+
if (collision)
|
|
5873
|
+
return c.json({ error: platformScriptRefusal(slug, collision) }, 422);
|
|
5863
5874
|
// #388: refuse the SILENT lineage fork. A first push of a registry id that does not
|
|
5864
5875
|
// exist yet, whose product name (the slug's tail) matches an existing lineage this
|
|
5865
5876
|
// push could CONFUSE ITSELF WITH, is almost always a mis-identified project — a
|