@substrat-run/control-plane-api 0.136.0 → 0.138.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 +31 -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/errors.d.ts +23 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +26 -109
- package/dist/errors.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 +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- 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 +29 -6
- package/dist/reconcile.d.ts.map +1 -1
- package/dist/reconcile.js +20 -7
- 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 +50 -1
- package/dist/vertical-client.d.ts.map +1 -1
- package/dist/vertical-client.js +34 -0
- package/dist/vertical-client.js.map +1 -1
- package/package.json +8 -8
package/dist/errors.js
CHANGED
|
@@ -2,106 +2,6 @@ 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
|
-
* Map a `HostAdmin` throw onto a problem document — #113 phase 4.
|
|
7
|
-
*
|
|
8
|
-
* **The code is read first, and the table below is what is left.** A throw that
|
|
9
|
-
* declared what it is (`substratError`, `PermissionDenied`, anything carrying a
|
|
10
|
-
* `Substrat.<code>` name across the RPC hop) is rendered from its own declaration by
|
|
11
|
-
* `toProblem`, extensions and all. Only a throw that declared nothing reaches the
|
|
12
|
-
* patterns, and each pattern that survives is one more `HostAdmin` throw site nobody
|
|
13
|
-
* has typed yet — a to-do list that shortens, rather than a mapping layer that grows.
|
|
14
|
-
*
|
|
15
|
-
* The table names a CODE now, not a status. The status follows from the catalog, so the
|
|
16
|
-
* two can no longer disagree — and the entry says what the failure IS, which is the
|
|
17
|
-
* thing a reviewer can check against the throw site. `409` was never checkable.
|
|
18
|
-
*
|
|
19
|
-
* What has not changed, and should not:
|
|
20
|
-
*
|
|
21
|
-
* - The patterns are less brittle than they look. Every one is a message the CONTRACT
|
|
22
|
-
* SUITE asserts on (`/unknown tenant/`, `/illegal scope transition/`, `/already
|
|
23
|
-
* taken/`, `/not active/`), against both adapters. Changing one turns a contract test
|
|
24
|
-
* red, not just this mapping. Phase 5 migrates those assertions onto codes and this
|
|
25
|
-
* table goes with them — **one family at a time, and ten are gone.** `unknown vertical`
|
|
26
|
-
* went first; `unknown version` followed, its ten throw sites across the two adapters
|
|
27
|
-
* now saying `substratError('not_found', …)` with the contract suite asserting that
|
|
28
|
-
* code rather than the sentence, so the row had nothing left to do. `deploy refused:`
|
|
29
|
-
* is the third, and the first whose throw is not in an adapter at all: its one site
|
|
30
|
-
* is `assertSandboxContract` in this package's own `deploy.ts`, now `substratError(
|
|
31
|
-
* 'forbidden', …)`, pinned by `test/deploy.test.ts` on the code. `still backs` is the
|
|
32
|
-
* fourth, and the first that fixed an operator-facing BUG rather than only removing a
|
|
33
|
-
* row: `deleteVertical` refuses twice, and the row read `/still backs \d+ scope\(s\)/`
|
|
34
|
-
* — which the archived sentence ("still backs 1 ARCHIVED scope(s) — reap or restore
|
|
35
|
-
* them first") does not match, because the word sits between the digits and `scope(s)`.
|
|
36
|
-
* Nothing else caught it, so archiving an app and then deleting its vertical answered
|
|
37
|
-
* `internal error`. Both branches are typed now and a code cannot miss a reword.
|
|
38
|
-
* `was rejected — publish a new one` is the fifth: `admitVersion`'s refusal of a rejected
|
|
39
|
-
* version, one site per adapter, now `substratError('conflict', …)` and pinned on the
|
|
40
|
-
* code by the contract suite. The sixth to eighth are the registry's own refusals, all in
|
|
41
|
-
* `host.ts` / `adapter-sqlite` and all `conflict`: `is owned by` (`registerVertical` —
|
|
42
|
-
* claim-on-first-push, a slug's owner is fixed at first push), `is auto-admitted` (the
|
|
43
|
-
* publish seam, `setVerticalListed`: prod points at a version only the AUTO admission note
|
|
44
|
-
* vouches for, so a staff admit is what it names as the way out) and `not admitted`
|
|
45
|
-
* (`bindScopeVersion` and `promoteVersion` refusing a version that is not admitted).
|
|
46
|
-
* The ninth and tenth are the last two coordinator-only registry refusals: `is already admitted`
|
|
47
|
-
* (`rejectVersion` — an admitted version may be bound, so it cannot be un-vouched) and
|
|
48
|
-
* `belongs to '` (`promoteVersion` — a version promoted through a vertical that does not own
|
|
49
|
-
* it), now `substratError('conflict', …)` at one site per adapter each.
|
|
50
|
-
* That is the shape every remaining row is waiting for: type the throws, move the
|
|
51
|
-
* suite's assertion, delete the row. A row is not removed before its throws are typed —
|
|
52
|
-
* deleting one early turns its refusal into the generic 500 below.
|
|
53
|
-
*
|
|
54
|
-
* **What decides whether a row CAN go, and it is not the row:** where its throws live.
|
|
55
|
-
* Both families removed so far are thrown on the COORDINATOR — `adapter-cloudflare`'s
|
|
56
|
-
* `host.ts` and `adapter-sqlite` — where the real error object reaches this function and
|
|
57
|
-
* `errorCodeOf` reads it. A throw raised inside a Durable Object does not arrive that
|
|
58
|
-
* way. workerd folds `name` into the message and resets it, so a `substratError` thrown
|
|
59
|
-
* in `scope-do.ts` or `control-plane-do.ts` arrives here as a plain `Error` whose
|
|
60
|
-
* message has grown a `Substrat.<code>: ` prefix — the code lost, and the sentence no
|
|
61
|
-
* longer the one that was written (it lands in the SQL console UI). That is measured,
|
|
62
|
-
* not assumed: see the note on `toRpcError` in `adapter-cloudflare/src/scope-do.ts`,
|
|
63
|
-
* which also names the fix — structure must travel as a VALUE, the `{ ok, error }`
|
|
64
|
-
* envelope, not as `name`. So typing a DO-side throw today makes things WORSE, and
|
|
65
|
-
* roughly half the rows still below are waiting on that envelope rather than on
|
|
66
|
-
* somebody getting around to them. Check where a family throws before planning its row.
|
|
67
|
-
* - Anything unmatched is a 500 with a GENERIC body: an unrecognised throw is, by
|
|
68
|
-
* definition, one whose message we have not reviewed for what it discloses, and this
|
|
69
|
-
* surface has cross-tenant reach.
|
|
70
|
-
*
|
|
71
|
-
* **ORDER IS SIGNIFICANT** — first match wins, so every specific pattern must precede
|
|
72
|
-
* the general one it would otherwise be swallowed by. `cannot provision scope under
|
|
73
|
-
* unknown tenant` contains `unknown tenant:`, and listing the general one first turned a
|
|
74
|
-
* precondition conflict into a 404 claiming POST /scopes does not exist. That is the
|
|
75
|
-
* message-matching fragility this file admits to above, caught by the test below rather
|
|
76
|
-
* than by reading.
|
|
77
|
-
*/
|
|
78
|
-
const CODE_PATTERNS = [
|
|
79
|
-
// Well-formed, but conflicts with current state or references something absent.
|
|
80
|
-
// The addressed collection exists; the request cannot be applied to it.
|
|
81
|
-
[/cannot provision scope under unknown tenant/, 'conflict'],
|
|
82
|
-
[/already taken/, 'conflict'],
|
|
83
|
-
[/illegal scope transition/, 'conflict'],
|
|
84
|
-
// #1738: a ScopeDO refusing a projection for a tenant other than the one it was provisioned
|
|
85
|
-
// for. Thrown inside the DO, so it arrives with the code flattened into the message.
|
|
86
|
-
[/applyProjection refused/, 'conflict'],
|
|
87
|
-
[/non-active tenant/, 'conflict'],
|
|
88
|
-
[/not active \(status:/, 'conflict'],
|
|
89
|
-
// Registry (#31): well-formed, but conflicts with a version's admission state or
|
|
90
|
-
// ownership, or needs an unacknowledged change acknowledged (the two checkpoints).
|
|
91
|
-
[/is already registered/, 'conflict'],
|
|
92
|
-
[/acknowledge it explicitly to promote/, 'conflict'],
|
|
93
|
-
// The ADDRESSED resource does not exist — including the K-3 fail-closed case
|
|
94
|
-
// where it exists under a DIFFERENT tenant and must read as absent.
|
|
95
|
-
[/unknown tenant:/, 'not_found'],
|
|
96
|
-
[/unknown scope for tenant/, 'not_found'],
|
|
97
|
-
[/unknown scope /, 'not_found'],
|
|
98
|
-
// A read-only introspection read (§5.4) for a table the scope's schema does not have.
|
|
99
|
-
[/unknown table /, 'not_found'],
|
|
100
|
-
// The SQL console's gate (#219) refused the statement — a malformed request, not a
|
|
101
|
-
// server fault. The prefix is pinned by the contract suite against both adapters.
|
|
102
|
-
[/read-only console/, 'validation_failed'],
|
|
103
|
-
[/scope has no tenant record/, 'not_found'],
|
|
104
|
-
];
|
|
105
5
|
/** A body built from a code this layer decided, rather than one the throw declared. */
|
|
106
6
|
const coded = (code, message) => ({
|
|
107
7
|
status: PROBLEM_CATALOG[code].status,
|
|
@@ -112,6 +12,29 @@ const relayed = (status, message) => ({
|
|
|
112
12
|
status: status,
|
|
113
13
|
body: problemForStatus(status, message),
|
|
114
14
|
});
|
|
15
|
+
/**
|
|
16
|
+
* Map a `HostAdmin` throw onto a problem document — #113.
|
|
17
|
+
*
|
|
18
|
+
* **The code decides, and nothing else does.** A throw that declared what it is
|
|
19
|
+
* (`substratError`, `PermissionDenied`, anything carrying a `Substrat.<code>` name) is
|
|
20
|
+
* rendered from its own declaration by `toProblem`, extensions and all. There is no
|
|
21
|
+
* message table behind it any more: every `HostAdmin` refusal that used to reach one is
|
|
22
|
+
* typed at its throw site, on both adapters, and the contract suite asserts the code
|
|
23
|
+
* rather than the sentence. The last fourteen rows went together, so a reworded refusal
|
|
24
|
+
* can no longer slip past the table into the generic 500, or be caught by the wrong row.
|
|
25
|
+
*
|
|
26
|
+
* Where the throw is raised inside a Durable Object, its code does not survive being
|
|
27
|
+
* THROWN across the hop: workerd folds `name` into the message and drops every own
|
|
28
|
+
* property. Those refusals travel as a value instead — the DO answers a `DoReply`
|
|
29
|
+
* (`adapter-cloudflare/src/do-reply.ts`) or a refusal record, and the coordinator throws
|
|
30
|
+
* it, typed, on this side. So a new DO-side refusal needs that envelope as well as its
|
|
31
|
+
* code, or it arrives here untyped.
|
|
32
|
+
*
|
|
33
|
+
* Anything untyped is a 500 with a GENERIC body: an unrecognised throw is, by
|
|
34
|
+
* definition, one whose message we have not reviewed for what it discloses, and this
|
|
35
|
+
* surface has cross-tenant reach. That is also what makes a new untyped refusal VISIBLE:
|
|
36
|
+
* it answers `internal error` in its first test, rather than being quietly matched.
|
|
37
|
+
*/
|
|
115
38
|
export function mapError(err) {
|
|
116
39
|
// A ControlPlaneError is a DELIBERATE downstream answer, not an unreviewed throw —
|
|
117
40
|
// the VerticalClient wraps the vertical's own JSON status/message in it. Passing it
|
|
@@ -152,19 +75,13 @@ export function mapError(err) {
|
|
|
152
75
|
// screen alone.
|
|
153
76
|
if (err instanceof ConnectionRelayError)
|
|
154
77
|
return relayed(err.status, err.message);
|
|
155
|
-
// THE CODE
|
|
156
|
-
//
|
|
157
|
-
//
|
|
158
|
-
// line is a throw site nobody has typed yet.
|
|
78
|
+
// THE CODE (#113). A throw that declared what it is renders from its own declaration —
|
|
79
|
+
// extensions included, so a `conflict` arrives carrying the `reason` the engine narrowed
|
|
80
|
+
// it with, and a parse failure its field list.
|
|
159
81
|
const declared = errorCodeOf(err);
|
|
160
82
|
if (declared !== undefined && err instanceof Error) {
|
|
161
83
|
return { status: PROBLEM_CATALOG[declared].status, body: toProblem(err) };
|
|
162
84
|
}
|
|
163
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
164
|
-
for (const [pattern, code] of CODE_PATTERNS) {
|
|
165
|
-
if (pattern.test(message))
|
|
166
|
-
return coded(code, message);
|
|
167
|
-
}
|
|
168
85
|
// The generic 500. `toProblem` refuses to disclose the message — that is the rule, and
|
|
169
86
|
// this surface has cross-tenant reach — so the body carries no `detail`. The deprecated
|
|
170
87
|
// `error` duplicate is set by hand to the same constant this branch has always
|
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,uBAAuB,CAAC;
|
|
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,uBAAuB,CAAC;AAO7D,uFAAuF;AACvF,MAAM,KAAK,GAAG,CAAC,IAAe,EAAE,OAAe,EAAY,EAAE,CAAC,CAAC;IAC7D,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,MAA8B;IAC5D,IAAI,EAAE,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;CAC9C,CAAC,CAAC;AAEH,0FAA0F;AAC1F,MAAM,OAAO,GAAG,CAAC,MAAc,EAAE,OAAe,EAAY,EAAE,CAAC,CAAC;IAC9D,MAAM,EAAE,MAA8B;IACtC,IAAI,EAAE,gBAAgB,CA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M,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC,MAA8B,EAAE,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;IACpG,CAAC;IAED,uFAAuF;IACvF,wFAAwF;IACxF,+EAA+E;IAC/E,uFAAuF;IACvF,4DAA4D;IAC5D,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,GAAG,SAAS,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** How often one declared field was carried, across the responses counted. */
|
|
2
|
+
export interface FieldCoverageCount {
|
|
3
|
+
field: string;
|
|
4
|
+
/** Carried with a value. */
|
|
5
|
+
present: number;
|
|
6
|
+
/** Carried as `null`. */
|
|
7
|
+
empty: number;
|
|
8
|
+
/** Not carried. */
|
|
9
|
+
absent: number;
|
|
10
|
+
}
|
|
11
|
+
/** One operation's counts. `responses` is how many reports were counted for it. */
|
|
12
|
+
export interface OperationFieldCoverage {
|
|
13
|
+
operation: string;
|
|
14
|
+
responses: number;
|
|
15
|
+
/** In first-seen order, which for a well-behaved vertical is declaration order. */
|
|
16
|
+
fields: FieldCoverageCount[];
|
|
17
|
+
}
|
|
18
|
+
export interface FieldCoverageTally {
|
|
19
|
+
/** The tenant the caller asked about — echoed, so a view never has to take it from a line. */
|
|
20
|
+
tenantId: string;
|
|
21
|
+
/** By operation name. */
|
|
22
|
+
operations: OperationFieldCoverage[];
|
|
23
|
+
/**
|
|
24
|
+
* This tenant's lines, from this app's scripts, whose report was refused (malformed, over a
|
|
25
|
+
* cap, or naming an undeclared field). Lines of other tenants or other scripts are not in
|
|
26
|
+
* it. A view shows it so a refused report reads as refused, not as "never returned".
|
|
27
|
+
*/
|
|
28
|
+
refused: number;
|
|
29
|
+
}
|
|
30
|
+
/** What the tally is for. Every field is the CALLER's resolution, never a line's. */
|
|
31
|
+
export interface FieldCoverageScope {
|
|
32
|
+
/** The tenant, forced from the principal the way every tenant read forces it. */
|
|
33
|
+
tenantId: string;
|
|
34
|
+
/** The app's vertical slug, as the router resolves it onto its line (`vertical`). */
|
|
35
|
+
vertical: string;
|
|
36
|
+
/** The app's script family stems. Empty names no script, so nothing counts. */
|
|
37
|
+
services: readonly string[];
|
|
38
|
+
/**
|
|
39
|
+
* The declared output field names per operation, when the caller has the manifest. A report
|
|
40
|
+
* on an operation not in this map, or naming a field outside its list, is refused.
|
|
41
|
+
*/
|
|
42
|
+
declared?: Readonly<Record<string, readonly string[]>>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* How many distinct operations one tally keeps. Past it, a report on a new operation is
|
|
46
|
+
* refused: a vertical cannot grow the answer without bound by inventing names.
|
|
47
|
+
*/
|
|
48
|
+
export declare const FIELD_COVERAGE_OPERATIONS_MAX = 1000;
|
|
49
|
+
/**
|
|
50
|
+
* Tally the field coverage in `events` — raw Workers Logs events (`{ source, $metadata }`), as
|
|
51
|
+
* the telemetry query returns them — for one tenant and one app, counting only the reports
|
|
52
|
+
* whose dispatch id `routerEvents` (the router's own request lines) vouches for.
|
|
53
|
+
*
|
|
54
|
+
* The query that fetched them should already filter on both; this checks them again, because
|
|
55
|
+
* the tally is the thing a view trusts, and a query is one forgotten parameter from fleet-wide.
|
|
56
|
+
*/
|
|
57
|
+
export declare function tallyFieldCoverage(events: Iterable<unknown>, routerEvents: Iterable<unknown>, scope: FieldCoverageScope): FieldCoverageTally;
|
|
58
|
+
//# sourceMappingURL=field-coverage-tally.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-coverage-tally.d.ts","sourceRoot":"","sources":["../src/field-coverage-tally.ts"],"names":[],"mappings":"AAuDA,8EAA8E;AAC9E,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,mFAAmF;AACnF,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,mFAAmF;IACnF,MAAM,EAAE,kBAAkB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,kBAAkB;IACjC,8FAA8F;IAC9F,QAAQ,EAAE,MAAM,CAAC;IACjB,yBAAyB;IACzB,UAAU,EAAE,sBAAsB,EAAE,CAAC;IACrC;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qFAAqF;AACrF,MAAM,WAAW,kBAAkB;IACjC,iFAAiF;IACjF,QAAQ,EAAE,MAAM,CAAC;IACjB,qFAAqF;IACrF,QAAQ,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;CACxD;AAgCD;;;GAGG;AACH,eAAO,MAAM,6BAA6B,OAAO,CAAC;AAyBlD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,EACzB,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,EAC/B,KAAK,EAAE,kBAAkB,GACxB,kBAAkB,CAqGpB"}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one sanctioned reading of `outputFields` (#1923 part c): per-(operation, field) counts for
|
|
3
|
+
* ONE tenant, from the stamped invocation lines its app's scripts wrote, joined to the router's
|
|
4
|
+
* own line for each request.
|
|
5
|
+
*
|
|
6
|
+
* ## Why the reading needs rules at all
|
|
7
|
+
*
|
|
8
|
+
* The report on a line is written by the vertical's own code, like `operation` and
|
|
9
|
+
* `problemCode` on the router's header. A vertical can mislabel its own responses, and it can
|
|
10
|
+
* `console.log` a line that looks exactly like the platform's, naming any tenant id it likes.
|
|
11
|
+
* So nothing on a line is taken as given except what the reader resolved itself:
|
|
12
|
+
*
|
|
13
|
+
* - **The tenant is the caller's, never the line's.** `tenantId` is required, and there is no
|
|
14
|
+
* "every tenant" spelling.
|
|
15
|
+
* - **The tenant and app a report counts for are the ROUTER's.** A report counts only when
|
|
16
|
+
* its `fieldCoverageId` — the dispatch id the router armed the walk with — matches the
|
|
17
|
+
* router's own line for that request, and that line names this tenant and this app. Router
|
|
18
|
+
* lines are read from the router's scripts only (`ROUTER_SCRIPT_NAMES`, by
|
|
19
|
+
* `$metadata.service`, which the log platform stamps). A vertical cannot log under those
|
|
20
|
+
* names: a slug that would deploy under any platform script name is refused at
|
|
21
|
+
* registration and at deploy (`platformScriptCollision`), from the same list. Workers Logs
|
|
22
|
+
* carry no field that tells a dispatch-namespace script from a top-level worker that this
|
|
23
|
+
* reader could check instead, so the reserved names are the whole of that guarantee. A vertical serving tenants A and
|
|
24
|
+
* B that writes a report naming B during A's request has only A's id to give it, which joins
|
|
25
|
+
* to A; an invented id joins to nothing. Each id counts once.
|
|
26
|
+
* - **The script is the app's.** A vertical line counts only if one of the app's own script
|
|
27
|
+
* families wrote it, which keeps one app's lines out of another's tally before the join.
|
|
28
|
+
* - **Silence about other tenants.** A line that does not join is dropped without trace —
|
|
29
|
+
* not counted as refused — since a count of someone else's lines is a fact about them.
|
|
30
|
+
*
|
|
31
|
+
* What remains is the accepted residual: a vertical can mislabel the report of a response it
|
|
32
|
+
* actually served for that tenant, the same way it can mislabel `operation`.
|
|
33
|
+
* - **Names are bounded, and declared when the caller can say so.** A report is refused whole
|
|
34
|
+
* when it is not three string arrays, names a field twice, names more than the declared
|
|
35
|
+
* half's cap, or names a field longer than an operation name may be. Given the operation's
|
|
36
|
+
* declared output (`declared`), a report naming anything outside it is refused too, so a
|
|
37
|
+
* vertical cannot grow the tally with names its own declaration never had.
|
|
38
|
+
*
|
|
39
|
+
* ## Why aggregate only
|
|
40
|
+
*
|
|
41
|
+
* One report is a fact about one response, and the line it rides also carries a path that
|
|
42
|
+
* can name a record (`/customers/{id}`): "this customer's `phone` is null". The question field
|
|
43
|
+
* coverage asks is "is this field ever returned", and a count answers it without holding a
|
|
44
|
+
* fact about any one record. So the tally keeps counts per (operation, field) and the number
|
|
45
|
+
* of responses behind them, and nothing per request: no path, scope, time, invocation id or
|
|
46
|
+
* value. It does not pass any of those through, so a view built on it cannot either.
|
|
47
|
+
*
|
|
48
|
+
* Every count is per response serialisation, never per row: a paged read of 200 rows is one
|
|
49
|
+
* response (#1331).
|
|
50
|
+
*/
|
|
51
|
+
import { DECLARED_OUTPUT_FIELDS_MAX, FIELD_COVERAGE_ID_FIELD, INVOCATION_RECORD_FIELD_MAX, ROUTER_SCRIPT_NAMES } from '@substrat-run/contracts';
|
|
52
|
+
import { ownsInvocation } from './cf-observability.js';
|
|
53
|
+
import { serviceFamilyMatcher } from './service-family.js';
|
|
54
|
+
/** A dispatch id: the ULID the router mints for a sampled request. */
|
|
55
|
+
const DISPATCH_ID = /^[0-9A-HJKMNP-TV-Z]{26}$/;
|
|
56
|
+
/** The service a raw event was logged by, as the log platform stamped it. */
|
|
57
|
+
function serviceOf(event) {
|
|
58
|
+
const metadata = event['$metadata'];
|
|
59
|
+
return metadata && typeof metadata === 'object' ? metadata['service'] : undefined;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The dispatch ids the router minted for THIS tenant's requests to THIS app, from the
|
|
63
|
+
* router's own request lines (`router: 'request'`). Anything not logged by a router service is
|
|
64
|
+
* ignored, whatever it says.
|
|
65
|
+
*/
|
|
66
|
+
function dispatchIdsFor(routerEvents, scope) {
|
|
67
|
+
const ids = new Set();
|
|
68
|
+
for (const event of routerEvents) {
|
|
69
|
+
if (event === null || typeof event !== 'object')
|
|
70
|
+
continue;
|
|
71
|
+
const service = serviceOf(event);
|
|
72
|
+
if (typeof service !== 'string' || !ROUTER_SCRIPT_NAMES.includes(service))
|
|
73
|
+
continue;
|
|
74
|
+
const source = event['source'];
|
|
75
|
+
if (source === null || typeof source !== 'object')
|
|
76
|
+
continue;
|
|
77
|
+
const line = source;
|
|
78
|
+
if (line['router'] !== 'request' || line['tenantId'] !== scope.tenantId || line['vertical'] !== scope.vertical)
|
|
79
|
+
continue;
|
|
80
|
+
const id = line[FIELD_COVERAGE_ID_FIELD];
|
|
81
|
+
if (typeof id === 'string' && DISPATCH_ID.test(id))
|
|
82
|
+
ids.add(id);
|
|
83
|
+
}
|
|
84
|
+
return ids;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* How many distinct operations one tally keeps. Past it, a report on a new operation is
|
|
88
|
+
* refused: a vertical cannot grow the answer without bound by inventing names.
|
|
89
|
+
*/
|
|
90
|
+
export const FIELD_COVERAGE_OPERATIONS_MAX = 1000;
|
|
91
|
+
/** The report's buckets — the writer's own shape, so a renamed bucket is a compile error here. */
|
|
92
|
+
const BUCKETS = ['present', 'empty', 'absent'];
|
|
93
|
+
/** A report's three name lists, or `undefined` when it is not a well-formed one. */
|
|
94
|
+
function namesOf(report, allowed) {
|
|
95
|
+
if (report === null || typeof report !== 'object' || Array.isArray(report))
|
|
96
|
+
return undefined;
|
|
97
|
+
const seen = new Set();
|
|
98
|
+
const out = { present: [], empty: [], absent: [] };
|
|
99
|
+
for (const bucket of BUCKETS) {
|
|
100
|
+
const list = report[bucket];
|
|
101
|
+
if (!Array.isArray(list))
|
|
102
|
+
return undefined;
|
|
103
|
+
for (const name of list) {
|
|
104
|
+
if (typeof name !== 'string' || name.length === 0 || name.length > INVOCATION_RECORD_FIELD_MAX)
|
|
105
|
+
return undefined;
|
|
106
|
+
if (seen.has(name))
|
|
107
|
+
return undefined;
|
|
108
|
+
if (allowed && !allowed.has(name))
|
|
109
|
+
return undefined;
|
|
110
|
+
seen.add(name);
|
|
111
|
+
out[bucket].push(name);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (seen.size === 0 || seen.size > DECLARED_OUTPUT_FIELDS_MAX)
|
|
115
|
+
return undefined;
|
|
116
|
+
return out;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Tally the field coverage in `events` — raw Workers Logs events (`{ source, $metadata }`), as
|
|
120
|
+
* the telemetry query returns them — for one tenant and one app, counting only the reports
|
|
121
|
+
* whose dispatch id `routerEvents` (the router's own request lines) vouches for.
|
|
122
|
+
*
|
|
123
|
+
* The query that fetched them should already filter on both; this checks them again, because
|
|
124
|
+
* the tally is the thing a view trusts, and a query is one forgotten parameter from fleet-wide.
|
|
125
|
+
*/
|
|
126
|
+
export function tallyFieldCoverage(events, routerEvents, scope) {
|
|
127
|
+
if (typeof scope.tenantId !== 'string' || scope.tenantId.length === 0) {
|
|
128
|
+
throw new TypeError('a field-coverage tally is for one tenant, and names it');
|
|
129
|
+
}
|
|
130
|
+
if (typeof scope.vertical !== 'string' || scope.vertical.length === 0) {
|
|
131
|
+
throw new TypeError('a field-coverage tally is for one app, and names it');
|
|
132
|
+
}
|
|
133
|
+
const ownService = serviceFamilyMatcher(scope.services);
|
|
134
|
+
// #1923: an app whose own scripts would be named like the router's has no provenance to
|
|
135
|
+
// join to — its lines and the router's are one set. Registration and deploy refuse such a
|
|
136
|
+
// slug; a registry entry that predates the rule is refused here rather than trusted.
|
|
137
|
+
const shadowed = ROUTER_SCRIPT_NAMES.find((name) => ownService(name));
|
|
138
|
+
if (shadowed) {
|
|
139
|
+
throw new TypeError(`a field-coverage tally cannot trust router lines for an app whose scripts are named like '${shadowed}'`);
|
|
140
|
+
}
|
|
141
|
+
const dispatched = dispatchIdsFor(routerEvents, scope);
|
|
142
|
+
const counted = new Set();
|
|
143
|
+
const operations = new Map();
|
|
144
|
+
// Each operation's declared names as a set, built the first time a report needs it.
|
|
145
|
+
const declaredSets = new Map();
|
|
146
|
+
let refused = 0;
|
|
147
|
+
for (const event of events) {
|
|
148
|
+
if (event === null || typeof event !== 'object')
|
|
149
|
+
continue;
|
|
150
|
+
// The same isolation predicate the tenant log reads use: a stamped line naming this tenant.
|
|
151
|
+
if (!ownsInvocation(event, { tenantId: scope.tenantId }))
|
|
152
|
+
continue;
|
|
153
|
+
const line = event.source;
|
|
154
|
+
if (!ownService(serviceOf(event)))
|
|
155
|
+
continue;
|
|
156
|
+
// A line with no report was not walked (unarmed, failed, or nothing declared): no data.
|
|
157
|
+
if (!('outputFields' in line))
|
|
158
|
+
continue;
|
|
159
|
+
// The provenance: the router minted this id for this tenant's request to this app. A line
|
|
160
|
+
// that does not join is not this tenant's as far as anything trusted says, and is dropped
|
|
161
|
+
// as silently as a line naming another tenant.
|
|
162
|
+
const id = line[FIELD_COVERAGE_ID_FIELD];
|
|
163
|
+
if (typeof id !== 'string' || !dispatched.has(id))
|
|
164
|
+
continue;
|
|
165
|
+
// From here the line is this tenant's, from this app: a bad report is the app's own fault,
|
|
166
|
+
// and is counted as refused rather than ignored. So is a second report on one dispatch id:
|
|
167
|
+
// one request is one response, and the first report on it is the one that counts.
|
|
168
|
+
if (counted.has(id)) {
|
|
169
|
+
refused++;
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
counted.add(id);
|
|
173
|
+
const operation = line['operation'];
|
|
174
|
+
// An async line (`kind`) has no response to report on, whatever it says.
|
|
175
|
+
if (line['kind'] !== undefined || typeof operation !== 'string' || operation.length === 0 || operation.length > INVOCATION_RECORD_FIELD_MAX) {
|
|
176
|
+
refused++;
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
let allowed;
|
|
180
|
+
if (scope.declared) {
|
|
181
|
+
if (!Object.hasOwn(scope.declared, operation)) {
|
|
182
|
+
refused++;
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
allowed = declaredSets.get(operation);
|
|
186
|
+
if (!allowed)
|
|
187
|
+
declaredSets.set(operation, (allowed = new Set(scope.declared[operation])));
|
|
188
|
+
}
|
|
189
|
+
const names = namesOf(line['outputFields'], allowed);
|
|
190
|
+
if (!names) {
|
|
191
|
+
refused++;
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
let entry = operations.get(operation);
|
|
195
|
+
if (!entry) {
|
|
196
|
+
if (operations.size >= FIELD_COVERAGE_OPERATIONS_MAX) {
|
|
197
|
+
refused++;
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
entry = { responses: 0, fields: new Map() };
|
|
201
|
+
}
|
|
202
|
+
// The field cap holds per operation across reports too, so a vertical naming a different
|
|
203
|
+
// field each time cannot grow one operation past what one declaration could hold.
|
|
204
|
+
let fresh = 0;
|
|
205
|
+
for (const bucket of BUCKETS)
|
|
206
|
+
for (const field of names[bucket])
|
|
207
|
+
if (!entry.fields.has(field))
|
|
208
|
+
fresh++;
|
|
209
|
+
if (entry.fields.size + fresh > DECLARED_OUTPUT_FIELDS_MAX) {
|
|
210
|
+
refused++;
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
operations.set(operation, entry);
|
|
214
|
+
entry.responses++;
|
|
215
|
+
for (const bucket of BUCKETS) {
|
|
216
|
+
for (const field of names[bucket]) {
|
|
217
|
+
let count = entry.fields.get(field);
|
|
218
|
+
if (!count) {
|
|
219
|
+
count = { field, present: 0, empty: 0, absent: 0 };
|
|
220
|
+
entry.fields.set(field, count);
|
|
221
|
+
}
|
|
222
|
+
count[bucket]++;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return {
|
|
227
|
+
tenantId: scope.tenantId,
|
|
228
|
+
operations: [...operations]
|
|
229
|
+
.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))
|
|
230
|
+
.map(([operation, e]) => ({ operation, responses: e.responses, fields: [...e.fields.values()] })),
|
|
231
|
+
refused,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
//# sourceMappingURL=field-coverage-tally.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-co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SAAS,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;QACnG,OAAO;KACR,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export { retireAllPreviewClients, retireClientsOfReapedScope, tenantIssuers, wir
|
|
|
16
16
|
export type { PreviewAuthDeps, WirePreviewAuthInput } from './preview-auth.js';
|
|
17
17
|
export type { ScopeDeployment, ScopeDeploymentVia } from './scope-deployment.js';
|
|
18
18
|
export { drainScopePlatformRequests, MAX_PLATFORM_REQUEST_ATTEMPTS, provisionSiblingScope, provisionSiblingHandler, archiveScopeHandler, peerInvokeHandler, provisionTenantHandler, setEntitlementsHandler, modelUsageHandler, sweepRunsHandler, connectorDispatchHandler, type ConnectorDispatchDeps, type ManagedTenantDeps, type PlatformDrainOptions, type ArchiveScopeDeps, type PlatformRequestHandler, type PlatformDrainContext, type PlatformRequestContext, type PlatformRequestOutcome, type PlatformDrainReport, type PeerInvokeDeps, type ProvisionSiblingDeps, type ProvisionSiblingInput, type ProvisionSiblingResult, } from './platform-drain.js';
|
|
19
|
-
export { reconcilePayloadFor, reconcileThenReassert } from './reconcile.js';
|
|
19
|
+
export { reconcilePayloadFor, reconcileThenReassert, switchCarryFor, type SwitchCarry } from './reconcile.js';
|
|
20
20
|
export type { ReconcilePayload, ReconcileGatherAdmin } from './reconcile.js';
|
|
21
21
|
export { attributeFailure, terminalFailureNote } from './failure-attribution.js';
|
|
22
22
|
export { isTerminalDispatchFailure, isTerminalProviderError, providerErrorStatus, RETRYABLE_CLIENT_STATUSES, } from './provider-error.js';
|
|
@@ -37,6 +37,8 @@ export type { PlatformRuntime } from './platform-runtime.js';
|
|
|
37
37
|
export { createCfDoNamespaceReader, namespacesForScript } from './do-namespaces.js';
|
|
38
38
|
export type { DoNamespaceReader, DoNamespaceRecord, CfDoNamespaceOptions } from './do-namespaces.js';
|
|
39
39
|
export { createCfObservabilityReader } from './cf-observability.js';
|
|
40
|
+
export { tallyFieldCoverage, FIELD_COVERAGE_OPERATIONS_MAX } from './field-coverage-tally.js';
|
|
41
|
+
export type { FieldCoverageTally, FieldCoverageScope, OperationFieldCoverage, FieldCoverageCount } from './field-coverage-tally.js';
|
|
40
42
|
export { cachedSource, memoryCubeStore, grainFor, blockMsFor, CLOSE_LAG_MS } from './aggregate-source.js';
|
|
41
43
|
export type { AggregateSource, Cube, CubeQuery, CubeStore, StoredBlock, RequestCubeRow, PatternCubeRow } from './aggregate-source.js';
|
|
42
44
|
export { aggregateReads } from './aggregate-reads.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,EACnB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC5E,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;AACjH,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACzE,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EACL,yBAAyB,EACzB,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,GACpC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACrG,OA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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
|
@@ -16,7 +16,7 @@ export { hostedCrossVerticalReach } from './cross-vertical.js';
|
|
|
16
16
|
// platform sweep also runs when it garbage-collects an expired preview.
|
|
17
17
|
export { retireAllPreviewClients, retireClientsOfReapedScope, tenantIssuers, wirePreviewAuth } from './preview-auth.js';
|
|
18
18
|
export { drainScopePlatformRequests, MAX_PLATFORM_REQUEST_ATTEMPTS, provisionSiblingScope, provisionSiblingHandler, archiveScopeHandler, peerInvokeHandler, provisionTenantHandler, setEntitlementsHandler, modelUsageHandler, sweepRunsHandler, connectorDispatchHandler, } from './platform-drain.js';
|
|
19
|
-
export { reconcilePayloadFor, reconcileThenReassert } from './reconcile.js';
|
|
19
|
+
export { reconcilePayloadFor, reconcileThenReassert, switchCarryFor } from './reconcile.js';
|
|
20
20
|
export { attributeFailure, terminalFailureNote } from './failure-attribution.js';
|
|
21
21
|
// #1978: moving here from the kernel — the drain is its only reader.
|
|
22
22
|
export { isTerminalDispatchFailure, isTerminalProviderError, providerErrorStatus, RETRYABLE_CLIENT_STATUSES, } from './provider-error.js';
|
|
@@ -29,6 +29,8 @@ export { TENANT_SERIES_SCOPE_CAP, TENANT_METRICS_LIMIT, REQUEST_FACET_KEYS, REQU
|
|
|
29
29
|
export { STORAGE_PAGE_DEFAULT, STORAGE_PAGE_MAX, STORAGE_READ_CONCURRENCY, readStoragePage, } from './storage-meter.js';
|
|
30
30
|
export { createCfDoNamespaceReader, namespacesForScript } from './do-namespaces.js';
|
|
31
31
|
export { createCfObservabilityReader } from './cf-observability.js';
|
|
32
|
+
// #1923: the one sanctioned reading of a line's `outputFields` — tenant- and app-scoped, aggregate only.
|
|
33
|
+
export { tallyFieldCoverage, FIELD_COVERAGE_OPERATIONS_MAX } from './field-coverage-tally.js';
|
|
32
34
|
// #1877: the aggregate seam under ObservabilityReader, and the store its cache keeps
|
|
33
35
|
// closed blocks in (a Durable Object's SQL in production).
|
|
34
36
|
export { cachedSource, memoryCubeStore, grainFor, blockMsFor, CLOSE_LAG_MS } from './aggregate-source.js';
|
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;AACjH,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEzE,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,MAAM,sBAA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Q,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG3E,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
export declare const PLATFORM_ENTRY_MODULE = "substrat-platform-entry.js";
|
|
8
8
|
/** The import specifier the uploader replaces with `./<the bundle's entry>`. */
|
|
9
9
|
export declare const PLATFORM_ENTRY_PLACEHOLDER = "__SUBSTRAT_VERTICAL_ENTRY__";
|
|
10
|
-
/** The entry itself —
|
|
10
|
+
/** The entry itself — 10039 bytes of ESM. */
|
|
11
11
|
export declare const PLATFORM_ENTRY_SOURCE: string;
|
|
12
12
|
/**
|
|
13
13
|
* The scope sweeper the platform supplies (#1902) — uploaded beside the entry, which
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-entry.generated.d.ts","sourceRoot":"","sources":["../src/platform-entry.generated.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,+BAA+B,CAAC;AAElE,gFAAgF;AAChF,eAAO,MAAM,0BAA0B,gCAAgC,CAAC;AAExE,
|
|
1
|
+
{"version":3,"file":"platform-entry.generated.d.ts","sourceRoot":"","sources":["../src/platform-entry.generated.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,+BAA+B,CAAC;AAElE,gFAAgF;AAChF,eAAO,MAAM,0BAA0B,gCAAgC,CAAC;AAExE,6CAA6C;AAC7C,eAAO,MAAM,qBAAqB,EAAE,MAAktU,CAAC;AAEvvU;;;GAGG;AACH,eAAO,MAAM,uBAAuB,iCAAiC,CAAC;AAEtE,8CAA8C;AAC9C,eAAO,MAAM,uBAAuB,EAAE,MAAuxT,CAAC"}
|