@substrat-run/control-plane-api 0.147.0 → 0.149.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 +67 -4
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +1068 -418
- package/dist/api.js.map +1 -1
- package/dist/attachment-sweep.d.ts +29 -0
- package/dist/attachment-sweep.d.ts.map +1 -0
- package/dist/attachment-sweep.js +66 -0
- package/dist/attachment-sweep.js.map +1 -0
- package/dist/browser.d.ts +3 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +3 -0
- package/dist/browser.js.map +1 -1
- package/dist/cf-observability.d.ts.map +1 -1
- package/dist/cf-observability.js +3 -1
- package/dist/cf-observability.js.map +1 -1
- package/dist/deploy.d.ts +26 -11
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +33 -18
- 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 +15 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -4
- 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/observability.d.ts +28 -0
- package/dist/observability.d.ts.map +1 -1
- package/dist/observability.js +35 -0
- package/dist/observability.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/platform-scope-stores.d.ts +65 -12
- package/dist/platform-scope-stores.d.ts.map +1 -1
- package/dist/platform-scope-stores.js +121 -20
- 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 +13 -1
- 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/staff-client.d.ts +10 -2
- package/dist/staff-client.d.ts.map +1 -1
- package/dist/staff-client.js +6 -1
- package/dist/staff-client.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-rebuild.d.ts +142 -0
- package/dist/store-rebuild.d.ts.map +1 -0
- package/dist/store-rebuild.js +223 -0
- package/dist/store-rebuild.js.map +1 -0
- package/dist/store-releases.d.ts +158 -0
- package/dist/store-releases.d.ts.map +1 -0
- package/dist/store-releases.js +332 -0
- package/dist/store-releases.js.map +1 -0
- package/dist/store-script.d.ts +98 -0
- package/dist/store-script.d.ts.map +1 -0
- package/dist/store-script.js +188 -0
- package/dist/store-script.js.map +1 -0
- package/dist/vertical-client.d.ts +33 -2
- package/dist/vertical-client.d.ts.map +1 -1
- package/dist/vertical-client.js +58 -3
- package/dist/vertical-client.js.map +1 -1
- package/package.json +7 -7
package/dist/deploy.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ADMISSIBLE_BINDING_TYPES, assertDeclaredScopeStores, PLATFORM_BINDING_PREFIX, scopeStoreScriptName,
|
|
1
|
+
import { ADMISSIBLE_BINDING_TYPES, assertDeclaredScopeStores, PLATFORM_BINDING_PREFIX, scopeStoreScriptName, STORE_DRIVERS, storeNamesOfBindings, substratError, verticalScriptStem, } from '@substrat-run/contracts';
|
|
2
|
+
import { MIGRATIONS_DIGEST_BINDING, migrationSetDigest } from '@substrat-run/kernel';
|
|
2
3
|
/**
|
|
3
4
|
* The deploy seam (self-serve-deploy.md). A `substrat push` uploads a *built* worker
|
|
4
5
|
* bundle; this layer forwards it to the platform's runtime (a Workers-for-Platforms
|
|
@@ -58,30 +59,30 @@ const NAMED_REFUSALS = {
|
|
|
58
59
|
*/
|
|
59
60
|
export { scopeStoreScriptName };
|
|
60
61
|
/**
|
|
61
|
-
* Which store scripts a vertical's stores need (#2210). One script per (
|
|
62
|
-
* by every binding of that
|
|
63
|
-
* a new release of the
|
|
64
|
-
* refused. The default registry is empty.
|
|
62
|
+
* Which store scripts a vertical's stores need (#2210). One script per (driver, vertical), shared
|
|
63
|
+
* by every binding of that driver, named by {@link scopeStoreScriptName}, which carries no release:
|
|
64
|
+
* a new release of the driver is uploaded into the same name. A driver that is not in `drivers` is
|
|
65
|
+
* refused. The default registry is empty. The upload itself is `createScopeStoreEnsurer`.
|
|
65
66
|
*/
|
|
66
67
|
export function scopeStoreUploadPlan(input) {
|
|
67
|
-
const
|
|
68
|
+
const drivers = input.drivers ?? STORE_DRIVERS;
|
|
68
69
|
const scripts = [];
|
|
69
70
|
const seen = new Set();
|
|
70
71
|
for (const store of input.stores) {
|
|
71
|
-
const
|
|
72
|
-
if (!
|
|
73
|
-
throw substratError('forbidden', `deploy refused: scope store '${store.binding}' declares
|
|
74
|
-
`A store
|
|
72
|
+
const driver = drivers.find((candidate) => candidate.driver === store.driver);
|
|
73
|
+
if (!driver) {
|
|
74
|
+
throw substratError('forbidden', `deploy refused: scope store '${store.binding}' declares driver '${store.driver}', which is not registered. ` +
|
|
75
|
+
`A store driver is platform code, registered in this repo.`);
|
|
75
76
|
}
|
|
76
|
-
if (seen.has(
|
|
77
|
+
if (seen.has(driver.driver))
|
|
77
78
|
continue;
|
|
78
|
-
seen.add(
|
|
79
|
+
seen.add(driver.driver);
|
|
79
80
|
scripts.push({
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
driver: driver.driver,
|
|
82
|
+
releases: driver.releases,
|
|
82
83
|
vertical: input.vertical,
|
|
83
|
-
scriptName: scopeStoreScriptName(input.vertical,
|
|
84
|
-
className:
|
|
84
|
+
scriptName: scopeStoreScriptName(input.vertical, driver.driver),
|
|
85
|
+
className: driver.className,
|
|
85
86
|
});
|
|
86
87
|
}
|
|
87
88
|
return { scripts, bindings: [] };
|
|
@@ -90,13 +91,27 @@ export function scopeStoreUploadPlan(input) {
|
|
|
90
91
|
* The bindings a vertical's upload carries (#2210), the per-version push and the serving upload
|
|
91
92
|
* alike: the version's own declared bindings, then the platform's (the serving upload's
|
|
92
93
|
* ledger-derived stores; none on a push). A declared scope store adds none (RFC scope-stores §10.2, L1):
|
|
93
|
-
* its
|
|
94
|
+
* its driver is still checked against `drivers`, so a version whose driver is not registered is
|
|
94
95
|
* refused here as at push.
|
|
95
96
|
*/
|
|
96
97
|
export function verticalUploadBindings(input) {
|
|
97
|
-
const plan = scopeStoreUploadPlan({ vertical: input.vertical, stores: input.manifest.scopeStores,
|
|
98
|
+
const plan = scopeStoreUploadPlan({ vertical: input.vertical, stores: input.manifest.scopeStores, drivers: input.drivers });
|
|
98
99
|
return [...input.manifest.bindings, ...input.platformBindings, ...plan.bindings];
|
|
99
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* The platform binding that hands a script the migration set digest of the version it deploys
|
|
103
|
+
* (#2349): the integrity check a scope host makes before it applies a migration compares the
|
|
104
|
+
* migrations its bundle registers with these. A version whose migrations the control plane does
|
|
105
|
+
* not hold (`null`: the push left them out of its manifest) gets no binding, so its scopes
|
|
106
|
+
* compare nothing — the promote gate already asks for the acknowledgement on such a version.
|
|
107
|
+
* `plain_text`, like `SUBSTRAT_VERSION_ID`, so an in-place serve replaces it with the served
|
|
108
|
+
* version's rather than keeping the outgoing one.
|
|
109
|
+
*/
|
|
110
|
+
export async function migrationsDigestBindings(migrations) {
|
|
111
|
+
if (migrations === null)
|
|
112
|
+
return [];
|
|
113
|
+
return [{ type: 'plain_text', name: MIGRATIONS_DIGEST_BINDING, text: await migrationSetDigest(migrations) }];
|
|
114
|
+
}
|
|
100
115
|
/**
|
|
101
116
|
* The §4 sandbox contract. Throws a `forbidden` `substratError` (403 — the upload is well-formed
|
|
102
117
|
* and still refused) if a declared binding is not one of the vertical's OWN admissible
|
package/dist/deploy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,EACpB,
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,EACpB,aAAa,EACb,oBAAoB,EACpB,aAAa,EACb,kBAAkB,GAInB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAErF;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,uFAAuF;AACvF,oFAAoF;AACpF,2CAA2C;AAC3C,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAwFzG;;;;;;;GAOG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAE/B,cAAc;IADzB,YACW,cAAsB,EAC/B,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;8BAHN,cAAc;QAIvB,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF;AAED,6GAA6G;AAC7G,MAAM,UAAU,gBAAgB,CAAC,CAAU;IACzC,OAAO,CAAC,YAAY,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC;AACvE,CAAC;AAwBD;;;;GAI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;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,SAAiB;IAC9D,OAAO,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC;AAClE,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAY;IACjD,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED;0FAC0F;AAC1F,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,MAAM,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;AAC1C,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
import type { ContentfulStatusCode } from 'hono/utils/http-status';
|
|
2
|
-
import { type Problem } from '@substrat-run/contracts';
|
|
2
|
+
import { type ErrorCode, type Problem } from '@substrat-run/contracts';
|
|
3
|
+
/**
|
|
4
|
+
* The log line the API writes when it answers a failure that is NOT a problem document
|
|
5
|
+
* (#113) — the tripwire in `createControlPlaneApi`. Named once, because the package's test
|
|
6
|
+
* setup fails a test on it and an operator searches for it.
|
|
7
|
+
*/
|
|
8
|
+
export declare const NON_PROBLEM_REFUSAL = "control-plane.non-problem-refusal";
|
|
3
9
|
export interface ApiError {
|
|
4
10
|
status: ContentfulStatusCode;
|
|
5
11
|
body: Problem;
|
|
6
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* A body built from a code this layer decided, rather than one the throw declared. The
|
|
15
|
+
* status follows from the catalog, so a route that refuses by code cannot pick a status
|
|
16
|
+
* the code does not mean.
|
|
17
|
+
*/
|
|
18
|
+
export declare const coded: (code: ErrorCode, message: string) => ApiError;
|
|
19
|
+
/**
|
|
20
|
+
* A body for a status and nothing else — `about:blank`. Two kinds of answer take it: a
|
|
21
|
+
* status raised somewhere else and relayed (not ours to type), and a status this layer
|
|
22
|
+
* answers that the closed taxonomy has no code for (501, 422, 502).
|
|
23
|
+
*/
|
|
24
|
+
export declare const relayed: (status: number, message: string) => ApiError;
|
|
7
25
|
/**
|
|
8
26
|
* Map a `HostAdmin` throw onto a problem document — #113.
|
|
9
27
|
*
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAML,KAAK,SAAS,EACd,KAAK,OAAO,EACb,MAAM,yBAAyB,CAAC;AAKjC;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,sCAAsC,CAAC;AAEvE,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,oBAAoB,CAAC;IAC7B,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;;GAIG;AACH,eAAO,MAAM,KAAK,SAAU,SAAS,WAAW,MAAM,KAAG,QAGvD,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,OAAO,WAAY,MAAM,WAAW,MAAM,KAAG,QAGxD,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,QAAQ,CAqD/C"}
|
package/dist/errors.js
CHANGED
|
@@ -2,13 +2,27 @@ import { errorCodeOf, PROBLEM_CATALOG, problemForStatus, substratError, toProble
|
|
|
2
2
|
import { SecretBoxUnconfiguredError } from '@substrat-run/kernel';
|
|
3
3
|
import { ControlPlaneError } from '@substrat-run/control-plane-client';
|
|
4
4
|
import { ConnectionRelayError } from './connection-relay.js';
|
|
5
|
-
/**
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The log line the API writes when it answers a failure that is NOT a problem document
|
|
7
|
+
* (#113) — the tripwire in `createControlPlaneApi`. Named once, because the package's test
|
|
8
|
+
* setup fails a test on it and an operator searches for it.
|
|
9
|
+
*/
|
|
10
|
+
export const NON_PROBLEM_REFUSAL = 'control-plane.non-problem-refusal';
|
|
11
|
+
/**
|
|
12
|
+
* A body built from a code this layer decided, rather than one the throw declared. The
|
|
13
|
+
* status follows from the catalog, so a route that refuses by code cannot pick a status
|
|
14
|
+
* the code does not mean.
|
|
15
|
+
*/
|
|
16
|
+
export const coded = (code, message) => ({
|
|
7
17
|
status: PROBLEM_CATALOG[code].status,
|
|
8
18
|
body: toProblem(substratError(code, message)),
|
|
9
19
|
});
|
|
10
|
-
/**
|
|
11
|
-
|
|
20
|
+
/**
|
|
21
|
+
* A body for a status and nothing else — `about:blank`. Two kinds of answer take it: a
|
|
22
|
+
* status raised somewhere else and relayed (not ours to type), and a status this layer
|
|
23
|
+
* answers that the closed taxonomy has no code for (501, 422, 502).
|
|
24
|
+
*/
|
|
25
|
+
export const relayed = (status, message) => ({
|
|
12
26
|
status: status,
|
|
13
27
|
body: problemForStatus(status, message),
|
|
14
28
|
});
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,SAAS,GAGV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uB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or } fr
|
|
|
13
13
|
export { mintTenantToken, verifyTenantToken, tenantTokenAuth } from './tenant-token.js';
|
|
14
14
|
export type { PlatformActorAuth, StaffIdentity, StaffSessionReader, StaffActorResolver, BuilderIdentity, BuilderAuth, TenantServiceIdentity, TenantServiceAuth, Principal, } from './auth.js';
|
|
15
15
|
export * from './browser.js';
|
|
16
|
-
export { VerticalClient, AUDITED_CALL_DEADLINE_MS } from './vertical-client.js';
|
|
17
|
-
export {
|
|
16
|
+
export { VerticalClient, AUDITED_CALL_DEADLINE_MS, isRouteMiss } from './vertical-client.js';
|
|
17
|
+
export { sweepScopeAttachments, type AttachmentSweepReach } from './attachment-sweep.js';
|
|
18
|
+
export { assertNoUnreachableScopeCopies, claimScopeScriptReap, drainScopeScriptCopies, retryScopeScriptCopy, retryScopeScriptCopies, reapScopeScriptCopies, settleExpiredScopeScriptCopies, sweepScopeScriptCopies, } from './scope-copy-cleanup.js';
|
|
18
19
|
export { BIRTH_WINDOW_MS, backfillScopeScriptCopies, type CopyBackfillPage, } from './scope-copy-backfill.js';
|
|
19
20
|
export { scopeDeployment, versionReachedAt } from './scope-deployment.js';
|
|
20
21
|
export { hostedCrossVerticalReach } from './cross-vertical.js';
|
|
@@ -28,19 +29,25 @@ export { attributeFailure, terminalFailureNote } from './failure-attribution.js'
|
|
|
28
29
|
export { sendEmailHandler, sendFailureStatus, retryAfterSecondsOf, MAX_EMAIL_SEND_ATTEMPTS, EMAIL_RETRY_BASE_MS, EMAIL_RETRY_MAX_MS, type EmailSent, type SendEmailDeps, } from './email-intent.js';
|
|
29
30
|
export { isTerminalDispatchFailure, isTerminalProviderError, providerErrorStatus, RETRYABLE_CLIENT_STATUSES, } from './provider-error.js';
|
|
30
31
|
export type { VerticalClientOptions, ProvisionInstanceInput, ProvisionedInstance, ConfigureInstanceInput, } from './vertical-client.js';
|
|
31
|
-
export { callPlatformScopeStore, platformScopeStoresFor, scopeStoresOf, unreachablePlatformScopeStores, type PlatformScopeStoreDispatch, type PlatformScopeStores, type DeclaredScopeStore, declaredStoresOf, } from './platform-scope-stores.js';
|
|
32
|
+
export { callPlatformScopeStore, callPlatformScopeStoreAt, platformScopeStoresFor, runningVersionStoresOf, scopeStoresOf, unrouteScope, unreachablePlatformScopeStores, type PlatformScopeStoreDispatch, type PlatformScopeStores, type DeclaredScopeStore, declaredStoresOf, } from './platform-scope-stores.js';
|
|
32
33
|
export { assertSandboxContract, deployManifest, deploymentRefFor, stableDeploymentRefFor, nextMigrationTag, DeployUploadError, upstreamStatusOf, } from './deploy.js';
|
|
33
34
|
export type { DeployVerticalFn, FetchVerticalAssetFn, FetchVerticalModulesFn, RecoverAssetContentFn, VerticalBundle, DeclaredBinding, DeployManifest, } from './deploy.js';
|
|
34
35
|
export { createWfpUploader, createWfpModulesFetcher, createWfpBindingsPatcher } from './wfp.js';
|
|
36
|
+
export { createScopeStoreEnsurer, createStoreCanaryEnsurer, STORE_BUILD_VAR, STORE_RELEASE_VAR, storePlatformFingerprint } from './store-script.js';
|
|
37
|
+
export { STORE_REBUILD_PASS_SUBREQUESTS, runStoreFleetRebuild, storeRebuildBudget, storeRebuildStatus, type StoreDriverRebuildPass, } from './store-rebuild.js';
|
|
38
|
+
export { ROLLOUT_WALKS_PER_REQUEST, ROLLOUT_HOLD_TTL_MS, ROLLOUT_VERTICALS_PER_REQUEST, canaryObjectName, canaryStoreRelease, decodeStoreDriverRelease, runStoreDriverRollout, storeDriverRelease, storeReleaseKey, storedReleaseLoader, type CanaryCall, type StoreDriverRolloutDeps, type StoreDriverRolloutResult, type StoreReleaseBytes, } from './store-releases.js';
|
|
39
|
+
export type { ScopeStoreEnsurerOptions, StoreCanaryTarget, StoreDriverReleaseArtifact } from './store-script.js';
|
|
35
40
|
export { withPlatformEntry, platformEntrySkipReason, platformSweeperDecision, PLATFORM_ENTRY_MODULE, PLATFORM_SWEEPER_MODULE, } from './platform-entry.js';
|
|
41
|
+
export { withStoreEntry, withPythonStoreEntry, STORE_ENTRY_MODULE, STORE_ENTRY_PYTHON_MODULE, STORE_ENTRY_PYTHON_SOURCE, STORE_ENTRY_PYTHON_VERIFIER_SOURCE, STORE_OBJECT_CLASS, STORE_RESERVED_MODULES, STORE_VERIFIER_MODULE, } from './store-entry.js';
|
|
42
|
+
export type { StoreEntryOptions, PythonStoreDriverRelease, PythonStoreScript } from './store-entry.js';
|
|
36
43
|
export type { WfpUploaderOptions, PatchScriptBindingsFn, ScriptBindingSpec, D1BindingSpec, R2BindingSpec, } from './wfp.js';
|
|
37
44
|
export { blobStoreBindings, collectBlobStoreHandles, collectTenantStoreHandles, tenantStoreBindings, } from './tenant-stores.js';
|
|
38
45
|
export { auditedChange, settleUnrecordedOutcomes, supersededUnknowns, withAuditedOutcomes, OUTCOME_CONFLICT_LOG, MALFORMED_OPERATION_ID_LOG, SETTLE_GRACE_MS, UNRECORDED_OUTCOME_LOG, } from './audited-change.js';
|
|
39
46
|
export type { AuditedChange, AuditedChangeSpec, AuditedRow, SettleAdmin, SettleOptions, SettleResult } from './audited-change.js';
|
|
40
47
|
export { createCustomHostnameProvisioner, mapCfStatus, extractRecords, reconcilePendingHostnames, isCustomHostname, validateBindableHostname, } from './custom-hostnames.js';
|
|
41
48
|
export type { CustomHostnameProvisioner, CustomHostnameProvisionerOptions, CustomHostnameIssuance, ReconcileHostnamesResult, } from './custom-hostnames.js';
|
|
42
|
-
export type { ObservabilityReader, ServiceMetricsRow, RecentLogEvent, TenantMetricsBucket, ConnectorCallsBucket, RequestFacetKey, RequestWhere, TenantRequestScope, RequestLevelCounts, RequestVolume, RequestVolumeBucket, RequestFacets, RequestFacetValue, RequestRecord, InvocationKind, LogPattern, LogPatterns, LogPatternLevel, } from './observability.js';
|
|
43
|
-
export { TENANT_SERIES_SCOPE_CAP, TENANT_METRICS_LIMIT, REQUEST_FACET_KEYS, REQUEST_FACET_TOP, LOG_PATTERN_TOP, INVOCATION_KINDS, invocationKindOf, } from './observability.js';
|
|
49
|
+
export type { ObservabilityReader, ServiceMetricsRow, RecentLogEvent, TenantMetricsBucket, ConnectorCallsBucket, RequestFacetKey, RequestWhere, TenantRequestScope, RequestLevelCounts, RequestVolume, RequestVolumeBucket, RequestFacets, RequestFacetValue, RequestRecord, OutboundCall, InvocationKind, LogPattern, LogPatterns, LogPatternLevel, } from './observability.js';
|
|
50
|
+
export { TENANT_SERIES_SCOPE_CAP, TENANT_METRICS_LIMIT, REQUEST_FACET_KEYS, REQUEST_FACET_TOP, LOG_PATTERN_TOP, INVOCATION_KINDS, invocationKindOf, outboundCallsOf, } from './observability.js';
|
|
44
51
|
export { STORAGE_PAGE_DEFAULT, STORAGE_PAGE_MAX, STORAGE_READ_CONCURRENCY, readStoragePage, } from './storage-meter.js';
|
|
45
52
|
export type { StoragePageInput, StorageScope } from './storage-meter.js';
|
|
46
53
|
export type { PlatformRuntime } from './platform-runtime.js';
|
|
@@ -58,6 +65,9 @@ export type { CfObservabilityOptions } from './cf-observability.js';
|
|
|
58
65
|
export type { ScopeBackup, ScopeBackupStore, DirectoryBackup, DirectoryBackupStore, } from './backups.js';
|
|
59
66
|
export { createR2AccessLogSink, createR2BackupStore, createR2DirectoryBackupStore, createR2EventSink, pruneAccessLogBatches, pruneScopeBackups, } from './r2-backups.js';
|
|
60
67
|
export { createPipelinesEventSink } from './pipelines-sink.js';
|
|
68
|
+
export type { LakeQueryEngine } from './lake-gateway.js';
|
|
69
|
+
export { createR2SqlEngine } from './r2-sql-engine.js';
|
|
70
|
+
export type { R2SqlEngineOptions } from './r2-sql-engine.js';
|
|
61
71
|
export { backupDirectoryIfDue } from './directory-backup.js';
|
|
62
72
|
export type { DirectoryBackupOptions, DirectoryBackupResult } from './directory-backup.js';
|
|
63
73
|
export { maskDump, maskRecords, MASKED } from './mask.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,mBAAmB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uB,CAAC;AAM3F,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC3E,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACnG,YAAY,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -10,8 +10,9 @@ export { mintTenantToken, verifyTenantToken, tenantTokenAuth } from './tenant-to
|
|
|
10
10
|
// The console's staff surface (#971). Browser-safe, so it is ALSO a subpath of its own
|
|
11
11
|
// (`./browser`): a bundler resolving the root entry would pull the whole server.
|
|
12
12
|
export * from './browser.js';
|
|
13
|
-
export { VerticalClient, AUDITED_CALL_DEADLINE_MS } from './vertical-client.js';
|
|
14
|
-
export {
|
|
13
|
+
export { VerticalClient, AUDITED_CALL_DEADLINE_MS, isRouteMiss } from './vertical-client.js';
|
|
14
|
+
export { sweepScopeAttachments } from './attachment-sweep.js';
|
|
15
|
+
export { assertNoUnreachableScopeCopies, claimScopeScriptReap, drainScopeScriptCopies, retryScopeScriptCopy, retryScopeScriptCopies, reapScopeScriptCopies, settleExpiredScopeScriptCopies, sweepScopeScriptCopies, } from './scope-copy-cleanup.js';
|
|
15
16
|
export { BIRTH_WINDOW_MS, backfillScopeScriptCopies, } from './scope-copy-backfill.js';
|
|
16
17
|
export { scopeDeployment, versionReachedAt } from './scope-deployment.js';
|
|
17
18
|
// #1705 PR 2: the cross-vertical phase's reach for a control plane whose scopes live elsewhere.
|
|
@@ -25,14 +26,18 @@ export { attributeFailure, terminalFailureNote } from './failure-attribution.js'
|
|
|
25
26
|
export { sendEmailHandler, sendFailureStatus, retryAfterSecondsOf, MAX_EMAIL_SEND_ATTEMPTS, EMAIL_RETRY_BASE_MS, EMAIL_RETRY_MAX_MS, } from './email-intent.js';
|
|
26
27
|
// #1978: moved here from the kernel — the drain is its only reader.
|
|
27
28
|
export { isTerminalDispatchFailure, isTerminalProviderError, providerErrorStatus, RETRYABLE_CLIENT_STATUSES, } from './provider-error.js';
|
|
28
|
-
export { callPlatformScopeStore, platformScopeStoresFor, scopeStoresOf, unreachablePlatformScopeStores, declaredStoresOf, } from './platform-scope-stores.js';
|
|
29
|
+
export { callPlatformScopeStore, callPlatformScopeStoreAt, platformScopeStoresFor, runningVersionStoresOf, scopeStoresOf, unrouteScope, unreachablePlatformScopeStores, declaredStoresOf, } from './platform-scope-stores.js';
|
|
29
30
|
export { assertSandboxContract, deployManifest, deploymentRefFor, stableDeploymentRefFor, nextMigrationTag, DeployUploadError, upstreamStatusOf, } from './deploy.js';
|
|
30
31
|
export { createWfpUploader, createWfpModulesFetcher, createWfpBindingsPatcher } from './wfp.js';
|
|
32
|
+
export { createScopeStoreEnsurer, createStoreCanaryEnsurer, STORE_BUILD_VAR, STORE_RELEASE_VAR, storePlatformFingerprint } from './store-script.js';
|
|
33
|
+
export { STORE_REBUILD_PASS_SUBREQUESTS, runStoreFleetRebuild, storeRebuildBudget, storeRebuildStatus, } from './store-rebuild.js';
|
|
34
|
+
export { ROLLOUT_WALKS_PER_REQUEST, ROLLOUT_HOLD_TTL_MS, ROLLOUT_VERTICALS_PER_REQUEST, canaryObjectName, canaryStoreRelease, decodeStoreDriverRelease, runStoreDriverRollout, storeDriverRelease, storeReleaseKey, storedReleaseLoader, } from './store-releases.js';
|
|
31
35
|
export { withPlatformEntry, platformEntrySkipReason, platformSweeperDecision, PLATFORM_ENTRY_MODULE, PLATFORM_SWEEPER_MODULE, } from './platform-entry.js';
|
|
36
|
+
export { withStoreEntry, withPythonStoreEntry, STORE_ENTRY_MODULE, STORE_ENTRY_PYTHON_MODULE, STORE_ENTRY_PYTHON_SOURCE, STORE_ENTRY_PYTHON_VERIFIER_SOURCE, STORE_OBJECT_CLASS, STORE_RESERVED_MODULES, STORE_VERIFIER_MODULE, } from './store-entry.js';
|
|
32
37
|
export { blobStoreBindings, collectBlobStoreHandles, collectTenantStoreHandles, tenantStoreBindings, } from './tenant-stores.js';
|
|
33
38
|
export { auditedChange, settleUnrecordedOutcomes, supersededUnknowns, withAuditedOutcomes, OUTCOME_CONFLICT_LOG, MALFORMED_OPERATION_ID_LOG, SETTLE_GRACE_MS, UNRECORDED_OUTCOME_LOG, } from './audited-change.js';
|
|
34
39
|
export { createCustomHostnameProvisioner, mapCfStatus, extractRecords, reconcilePendingHostnames, isCustomHostname, validateBindableHostname, } from './custom-hostnames.js';
|
|
35
|
-
export { TENANT_SERIES_SCOPE_CAP, TENANT_METRICS_LIMIT, REQUEST_FACET_KEYS, REQUEST_FACET_TOP, LOG_PATTERN_TOP, INVOCATION_KINDS, invocationKindOf, } from './observability.js';
|
|
40
|
+
export { TENANT_SERIES_SCOPE_CAP, TENANT_METRICS_LIMIT, REQUEST_FACET_KEYS, REQUEST_FACET_TOP, LOG_PATTERN_TOP, INVOCATION_KINDS, invocationKindOf, outboundCallsOf, } from './observability.js';
|
|
36
41
|
export { STORAGE_PAGE_DEFAULT, STORAGE_PAGE_MAX, STORAGE_READ_CONCURRENCY, readStoragePage, } from './storage-meter.js';
|
|
37
42
|
export { createCfDoNamespaceReader, namespacesForScript } from './do-namespaces.js';
|
|
38
43
|
export { createCfObservabilityReader } from './cf-observability.js';
|
|
@@ -51,6 +56,7 @@ createR2EventSink, pruneAccessLogBatches, pruneScopeBackups, } from './r2-backup
|
|
|
51
56
|
// The same seam's Pipelines shape — kernel-design §5.3's Cloudflare row for event
|
|
52
57
|
// transport. Which one a deployment binds is its choice; the drain never learns.
|
|
53
58
|
export { createPipelinesEventSink } from './pipelines-sink.js';
|
|
59
|
+
export { createR2SqlEngine } from './r2-sql-engine.js';
|
|
54
60
|
// #40 — the scheduled directory copy. Exported as a function the CP worker's cron calls,
|
|
55
61
|
// not as a route with a timer behind it: this package stays library-only, exactly as the
|
|
56
62
|
// platform-request drain does (the recurrence has to come from a deployment, #444).
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,2BAA2B,EAC3B,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEjH,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE7F,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC3H,OAAO,EACL,yBAAyB,GAG1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACrG,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAYxF,uFAAuF;AACvF,iFAAiF;AACjF,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,mBAAmB,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2
|
+
/**
|
|
3
|
+
* The Tier-2 lake's query gateway (#1334) — the one path by which anything in the product
|
|
4
|
+
* reads `kernel.events`, and the place the tenant boundary is held for it.
|
|
5
|
+
*
|
|
6
|
+
* Every tenant's events share one Iceberg table, and the sink cannot partition it, so
|
|
7
|
+
* nothing below this file knows whose row is whose. Isolation is therefore made here, in
|
|
8
|
+
* three layers, each enough on its own:
|
|
9
|
+
*
|
|
10
|
+
* 1. **The tenant is an argument, never an input.** `compileLakeEvents` takes it apart from
|
|
11
|
+
* the filters, and the filter schema (`lakeEventsInput`) has no tenant field and refuses
|
|
12
|
+
* unknown keys. The caller's only way to name a tenant is the route's path segment, which
|
|
13
|
+
* the API's authentication has already confined.
|
|
14
|
+
* 2. **The predicate is written first, by the only producer of SQL.** No caller supplies
|
|
15
|
+
* SQL, an identifier or a fragment: the query is a closed shape, every column is from
|
|
16
|
+
* the list below, and every value is a literal that passes `LAKE_LITERAL` — an alphabet
|
|
17
|
+
* with no quote in it — or is refused. `tenant_id = '<tenant>'` is the first conjunct of
|
|
18
|
+
* every WHERE, and the filters can only AND onto it.
|
|
19
|
+
* 3. **The answer is checked, not trusted.** Every row must carry the tenant asked for. One
|
|
20
|
+
* that does not fails the whole read with nothing returned: a defect in the layers above
|
|
21
|
+
* becomes an error rather than a disclosure.
|
|
22
|
+
*
|
|
23
|
+
* The engine is a seam (`LakeQueryEngine`) because §5.3 says it is replaceable — Iceberg is
|
|
24
|
+
* the contract, R2 SQL is today's reader, DuckDB over the same catalog the fallback. The
|
|
25
|
+
* gateway is where the contract lives, so swapping the engine changes none of the above.
|
|
26
|
+
*/
|
|
27
|
+
/** The query engine over the lake: one SQL statement in, rows keyed by column name out. */
|
|
28
|
+
export interface LakeQueryEngine {
|
|
29
|
+
query(sql: string): Promise<readonly Record<string, unknown>[]>;
|
|
30
|
+
}
|
|
31
|
+
/** A row the engine handed back for a tenant other than the one asked about. */
|
|
32
|
+
export declare class LakeTenantMismatchError extends Error {
|
|
33
|
+
readonly expected: TenantId;
|
|
34
|
+
constructor(expected: TenantId);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* One page of a tenant's events, newest first, as SQL.
|
|
38
|
+
*
|
|
39
|
+
* No `DISTINCT`. The drain is at-least-once, so a retried batch lands twice, but asking the
|
|
40
|
+
* engine to dedupe makes it dedupe the whole filtered set before it can apply the limit, and
|
|
41
|
+
* R2 SQL names large deduplicating sorts as a timeout risk. Duplicates share an id and the
|
|
42
|
+
* order is by id, so they arrive adjacent; `queryLakeEvents` collapses them, and pages off
|
|
43
|
+
* the engine's own window so a duplicate can shorten a page but never end the walk early.
|
|
44
|
+
* Keyset on `id` (a ULID, so time-ordered) rather than on `occurred_at`, so the cursor is a
|
|
45
|
+
* string comparison every engine agrees on. One row over the limit is asked for, to know
|
|
46
|
+
* whether there is a next page without a second query.
|
|
47
|
+
*/
|
|
48
|
+
export declare function compileLakeEvents(tenantId: TenantId, input: LakeEventsInput): string;
|
|
49
|
+
/**
|
|
50
|
+
* One page of `tenantId`'s lake events. Throws `LakeTenantMismatchError` — and returns
|
|
51
|
+
* nothing — if the engine answers with any row of another tenant.
|
|
52
|
+
*/
|
|
53
|
+
export declare function queryLakeEvents(engine: LakeQueryEngine, tenantId: TenantId, input: LakeEventsInput): Promise<LakeEventsPage>;
|
|
54
|
+
//# sourceMappingURL=lake-gateway.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lake-gateway.d.ts","sourceRoot":"","sources":["../src/lake-gateway.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACd,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,2FAA2F;AAC3F,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;CACjE;AA4BD,gFAAgF;AAChF,qBAAa,uBAAwB,SAAQ,KAAK;IACpC,QAAQ,CAAC,QAAQ,EAAE,QAAQ;IAAvC,YAAqB,QAAQ,EAAE,QAAQ,EAGtC;CACF;AAYD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,eAAe,GAAG,MAAM,CAkBpF;AA6CD;;;GAGG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,cAAc,CAAC,CAuBzB"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { LAKE_LITERAL, actor as actorSchema, lakeEvent, } from '@substrat-run/contracts';
|
|
2
|
+
/** The lake's one table — `LAKE.namespace`.`LAKE.table` in `scripts/lake-provision.mjs`. */
|
|
3
|
+
const LAKE_TABLE = 'kernel.events';
|
|
4
|
+
/**
|
|
5
|
+
* The envelope columns a lake read returns. Deliberately NOT `payload`, `subject_id`,
|
|
6
|
+
* `authorization` or `impersonation`: erasure does not reach the lake yet, so what was said
|
|
7
|
+
* stays out of every answer until it does. `impersonated` is derived, so the fact of a staff
|
|
8
|
+
* session is visible and the session's own record is not.
|
|
9
|
+
*/
|
|
10
|
+
const COLUMNS = [
|
|
11
|
+
'id',
|
|
12
|
+
'type',
|
|
13
|
+
'schema_version',
|
|
14
|
+
'occurred_at',
|
|
15
|
+
'tenant_id',
|
|
16
|
+
'scope_id',
|
|
17
|
+
'actor',
|
|
18
|
+
'entity_type',
|
|
19
|
+
'entity_id',
|
|
20
|
+
'pii_class',
|
|
21
|
+
'operation',
|
|
22
|
+
'version',
|
|
23
|
+
'caused_by',
|
|
24
|
+
'invocation_id',
|
|
25
|
+
];
|
|
26
|
+
/** A row the engine handed back for a tenant other than the one asked about. */
|
|
27
|
+
export class LakeTenantMismatchError extends Error {
|
|
28
|
+
expected;
|
|
29
|
+
constructor(expected) {
|
|
30
|
+
super(`lake gateway: the engine returned a row outside tenant ${expected}; the read is refused whole`);
|
|
31
|
+
this.expected = expected;
|
|
32
|
+
this.name = 'LakeTenantMismatchError';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A value as a SQL string literal. Refuses anything outside `LAKE_LITERAL` rather than
|
|
37
|
+
* escaping it — every caller has already parsed its value against a narrower schema, so a
|
|
38
|
+
* refusal here means a schema and this file have parted company, which must be loud.
|
|
39
|
+
*/
|
|
40
|
+
function literal(value) {
|
|
41
|
+
if (!LAKE_LITERAL.test(value))
|
|
42
|
+
throw new Error(`lake gateway: refusing a literal outside the lake alphabet`);
|
|
43
|
+
return `'${value}'`;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* One page of a tenant's events, newest first, as SQL.
|
|
47
|
+
*
|
|
48
|
+
* No `DISTINCT`. The drain is at-least-once, so a retried batch lands twice, but asking the
|
|
49
|
+
* engine to dedupe makes it dedupe the whole filtered set before it can apply the limit, and
|
|
50
|
+
* R2 SQL names large deduplicating sorts as a timeout risk. Duplicates share an id and the
|
|
51
|
+
* order is by id, so they arrive adjacent; `queryLakeEvents` collapses them, and pages off
|
|
52
|
+
* the engine's own window so a duplicate can shorten a page but never end the walk early.
|
|
53
|
+
* Keyset on `id` (a ULID, so time-ordered) rather than on `occurred_at`, so the cursor is a
|
|
54
|
+
* string comparison every engine agrees on. One row over the limit is asked for, to know
|
|
55
|
+
* whether there is a next page without a second query.
|
|
56
|
+
*/
|
|
57
|
+
export function compileLakeEvents(tenantId, input) {
|
|
58
|
+
const where = [`tenant_id = ${literal(tenantId)}`];
|
|
59
|
+
if (input.scopeId !== undefined)
|
|
60
|
+
where.push(`scope_id = ${literal(input.scopeId)}`);
|
|
61
|
+
if (input.type !== undefined)
|
|
62
|
+
where.push(`type = ${literal(input.type)}`);
|
|
63
|
+
if (input.entityType !== undefined)
|
|
64
|
+
where.push(`entity_type = ${literal(input.entityType)}`);
|
|
65
|
+
if (input.entityId !== undefined)
|
|
66
|
+
where.push(`entity_id = ${literal(input.entityId)}`);
|
|
67
|
+
// The shipper sends the decoded actor (`pipelines-sink.ts`), so a principal is its bare id.
|
|
68
|
+
if (input.actor !== undefined)
|
|
69
|
+
where.push(`actor = ${literal(input.actor)}`);
|
|
70
|
+
if (input.operation !== undefined)
|
|
71
|
+
where.push(`operation = ${literal(input.operation)}`);
|
|
72
|
+
if (input.version !== undefined)
|
|
73
|
+
where.push(`version = ${literal(input.version)}`);
|
|
74
|
+
if (input.impersonated)
|
|
75
|
+
where.push('impersonation IS NOT NULL');
|
|
76
|
+
if (input.since !== undefined)
|
|
77
|
+
where.push(`occurred_at >= ${literal(input.since)}`);
|
|
78
|
+
if (input.until !== undefined)
|
|
79
|
+
where.push(`occurred_at < ${literal(input.until)}`);
|
|
80
|
+
if (input.cursor !== undefined)
|
|
81
|
+
where.push(`id < ${literal(input.cursor)}`);
|
|
82
|
+
return (`SELECT ${COLUMNS.join(', ')}, (impersonation IS NOT NULL) AS impersonated ` +
|
|
83
|
+
`FROM ${LAKE_TABLE} WHERE ${where.join(' AND ')} ORDER BY id DESC LIMIT ${input.limit + 1}`);
|
|
84
|
+
}
|
|
85
|
+
/** The stored actor, decoded the way `timelineEntry` decodes it, or the self-naming marker. */
|
|
86
|
+
function decodeActor(raw) {
|
|
87
|
+
const direct = actorSchema.safeParse(raw);
|
|
88
|
+
if (direct.success)
|
|
89
|
+
return direct.data;
|
|
90
|
+
if (typeof raw === 'string') {
|
|
91
|
+
try {
|
|
92
|
+
const parsed = actorSchema.safeParse(JSON.parse(raw));
|
|
93
|
+
if (parsed.success)
|
|
94
|
+
return parsed.data;
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
// not JSON: falls through to the marker
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return { system: 'undecodable' };
|
|
101
|
+
}
|
|
102
|
+
/** The column as an ISO instant, whether the engine hands back epoch millis or text. */
|
|
103
|
+
function instantOf(raw) {
|
|
104
|
+
const ms = typeof raw === 'number' ? raw : typeof raw === 'string' ? Date.parse(raw) : Number.NaN;
|
|
105
|
+
if (!Number.isFinite(ms))
|
|
106
|
+
throw new Error('lake gateway: a row carried no readable occurred_at');
|
|
107
|
+
return new Date(ms).toISOString();
|
|
108
|
+
}
|
|
109
|
+
const nullableString = (raw) => (typeof raw === 'string' ? raw : null);
|
|
110
|
+
function toEvent(row) {
|
|
111
|
+
return lakeEvent.parse({
|
|
112
|
+
id: row.id,
|
|
113
|
+
type: row.type,
|
|
114
|
+
schemaVersion: Number(row.schema_version),
|
|
115
|
+
occurredAt: instantOf(row.occurred_at),
|
|
116
|
+
scopeId: row.scope_id,
|
|
117
|
+
actor: decodeActor(row.actor),
|
|
118
|
+
entityType: row.entity_type,
|
|
119
|
+
entityId: row.entity_id,
|
|
120
|
+
piiClass: row.pii_class,
|
|
121
|
+
operation: nullableString(row.operation),
|
|
122
|
+
version: nullableString(row.version),
|
|
123
|
+
causedBy: nullableString(row.caused_by),
|
|
124
|
+
invocationId: nullableString(row.invocation_id),
|
|
125
|
+
impersonated: row.impersonated === true || row.impersonated === 1,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* One page of `tenantId`'s lake events. Throws `LakeTenantMismatchError` — and returns
|
|
130
|
+
* nothing — if the engine answers with any row of another tenant.
|
|
131
|
+
*/
|
|
132
|
+
export async function queryLakeEvents(engine, tenantId, input) {
|
|
133
|
+
const rows = await engine.query(compileLakeEvents(tenantId, input));
|
|
134
|
+
// Every row, before any is decoded or dropped: the check is about what the engine
|
|
135
|
+
// returned, not about what this page would have shown.
|
|
136
|
+
if (rows.some((r) => r.tenant_id !== tenantId))
|
|
137
|
+
throw new LakeTenantMismatchError(tenantId);
|
|
138
|
+
// The page is the engine's first `limit` rows, deduplicated by id, and the next page starts
|
|
139
|
+
// after the last of THOSE rows. Deciding "more" from the deduplicated list instead would
|
|
140
|
+
// end the walk early whenever a duplicate fell inside the window: `limit + 1` rows with
|
|
141
|
+
// one copy among them dedupe to `limit` events and read as the last page.
|
|
142
|
+
const window = rows.slice(0, input.limit);
|
|
143
|
+
const more = rows.length > input.limit;
|
|
144
|
+
const seen = new Set();
|
|
145
|
+
const page = [];
|
|
146
|
+
for (const row of window) {
|
|
147
|
+
const event = toEvent(row);
|
|
148
|
+
if (seen.has(event.id))
|
|
149
|
+
continue;
|
|
150
|
+
seen.add(event.id);
|
|
151
|
+
page.push(event);
|
|
152
|
+
}
|
|
153
|
+
// Rows arrive ordered by id, so the window's last row is a copy of the last event or that
|
|
154
|
+
// event itself: its id is the cursor either way.
|
|
155
|
+
const nextCursor = more ? (page[page.length - 1]?.id ?? null) : null;
|
|
156
|
+
return { events: page, nextCursor, consistency: 'eventual' };
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=lake-gateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lake-gateway.js","sourceRoot":"","sources":["../src/lake-gateway.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,IAAI,WAAW,EACpB,SAAS,GAKV,MAAM,yBAAyB,CAAC;AAiCjC,4FAA4F;AAC5F,MAAM,UAAU,GAAG,eAAe,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,OAAO,GAAG;IACd,IAAI;IACJ,MAAM;IACN,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,UAAU;IACV,OAAO;IACP,aAAa;IACb,WAAW;IACX,WAAW;IACX,WAAW;IACX,SAAS;IACT,WAAW;IACX,eAAe;CACP,CAAC;AAEX,gFAAgF;AAChF,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAC3B,QAAQ;IAA7B,YAAqB,QAAkB;QACrC,KAAK,CAAC,0DAA0D,QAAQ,6BAA6B,CAAC,CAAC;wBADpF,QAAQ;QAE3B,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAA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AAiD;IACjD,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACrE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;AAC/D,CAAC"}
|
package/dist/observability.d.ts
CHANGED
|
@@ -370,7 +370,35 @@ export interface RequestRecord {
|
|
|
370
370
|
attempt: number | null;
|
|
371
371
|
/** #1901: a schedule run's lateness against its due time, in milliseconds. */
|
|
372
372
|
latenessMs: number | null;
|
|
373
|
+
/**
|
|
374
|
+
* #2192: the outbound `fetch` calls the request made, as the line names them (host, redacted
|
|
375
|
+
* path, method, status, outcome, timing). `[]` when the line names none — a request that made
|
|
376
|
+
* no call, or a line written before the field existed.
|
|
377
|
+
*/
|
|
378
|
+
outboundCalls: OutboundCall[];
|
|
379
|
+
/** #2192: calls past the line's cap, counted rather than named. `0` when none were dropped. */
|
|
380
|
+
outboundCallsDropped: number;
|
|
373
381
|
}
|
|
382
|
+
/** #2192: one outbound call on a request's line — the kernel's `OutboundCallLine`, as read back. */
|
|
383
|
+
export interface OutboundCall {
|
|
384
|
+
host: string;
|
|
385
|
+
path: string;
|
|
386
|
+
method: string;
|
|
387
|
+
status: number | null;
|
|
388
|
+
/** `ok`, `http-error`, `refused` (the platform's egress refusal), `timeout`, `aborted` or `failed`. */
|
|
389
|
+
outcome: string;
|
|
390
|
+
durationMs: number;
|
|
391
|
+
/** Milliseconds from the request's start to the call. */
|
|
392
|
+
atMs: number;
|
|
393
|
+
/** A `failed` call's error class, when the line names one. */
|
|
394
|
+
reason?: string;
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* #2192: the outbound calls of a raw line's `outboundCalls`, keeping only entries of the line's
|
|
398
|
+
* shape. The line is written by the platform's entry, but a vertical's own code can print a
|
|
399
|
+
* line of the same shape, so the read takes nothing on trust beyond the field types.
|
|
400
|
+
*/
|
|
401
|
+
export declare function outboundCallsOf(v: unknown): OutboundCall[];
|
|
374
402
|
/** The levels a `ctx.log` line is written at. */
|
|
375
403
|
export type LogPatternLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
376
404
|
/** One template and the lines written from it (#1747). */
|