@substrat-run/control-plane-api 0.146.0 → 0.147.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 +14 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +205 -24
- package/dist/api.js.map +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/deploy.d.ts +45 -0
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +53 -1
- package/dist/deploy.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/platform-entry.d.ts +23 -1
- package/dist/platform-entry.d.ts.map +1 -1
- package/dist/platform-entry.generated.d.ts +9 -1
- package/dist/platform-entry.generated.d.ts.map +1 -1
- package/dist/platform-entry.generated.js +10 -2
- package/dist/platform-entry.generated.js.map +1 -1
- package/dist/platform-entry.js +31 -1
- package/dist/platform-entry.js.map +1 -1
- package/dist/platform-scope-stores.d.ts +98 -0
- package/dist/platform-scope-stores.d.ts.map +1 -0
- package/dist/platform-scope-stores.js +140 -0
- package/dist/platform-scope-stores.js.map +1 -0
- package/dist/staff-client.d.ts +9 -1
- package/dist/staff-client.d.ts.map +1 -1
- package/dist/staff-client.js.map +1 -1
- package/dist/vertical-client.d.ts +15 -2
- package/dist/vertical-client.d.ts.map +1 -1
- package/dist/vertical-client.js.map +1 -1
- package/dist/wfp.js +1 -1
- package/dist/wfp.js.map +1 -1
- package/package.json +8 -7
package/dist/browser.d.ts
CHANGED
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
* `test/browser-entry.test.ts` holds that line.
|
|
8
8
|
*/
|
|
9
9
|
export { ControlPlaneStaffClient } from './staff-client.js';
|
|
10
|
-
export type { AdminLogPage, AuditLogQuery, BindHostnameInput, ConnectionHealthQuery, ConnectorCallsBucket, DoNamespace, EgressReport, IssuesQuery, MembersReading, ObservedEgressRow, OpsFailuresQuery, PageQuery, PlatformRuntime, ProvisionScopeInput, RebindScopeResult, RecentLogEvent, ScopeHealth, ServiceMetricsRow, StaffMember, SweepRunsQuery, SystemSwitchesQuery, TenantStores, } from './staff-client.js';
|
|
10
|
+
export type { AdminLogPage, AuditLogQuery, BindHostnameInput, ConnectionHealthQuery, ConnectorCallsBucket, DoNamespace, EgressReport, IssuesQuery, MembersReading, ObservedEgressRow, OpsFailuresQuery, PageQuery, PlatformRuntime, ProvisionScopeInput, RebindScopeResult, RecentLogEvent, ReprovisionedScope, ScopeHealth, ServiceMetricsRow, StaffMember, SweepRunsQuery, SystemSwitchesQuery, TenantStores, } from './staff-client.js';
|
|
11
11
|
export * from '@substrat-run/control-plane-client';
|
|
12
12
|
//# sourceMappingURL=browser.d.ts.map
|
package/dist/browser.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,YAAY,EACV,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,YAAY,GACb,MAAM,mBAAmB,CAAC;AAG3B,cAAc,oCAAoC,CAAC"}
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,YAAY,EACV,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,YAAY,GACb,MAAM,mBAAmB,CAAC;AAG3B,cAAc,oCAAoC,CAAC"}
|
package/dist/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AA0B5D,2FAA2F;AAC3F,0FAA0F;AAC1F,cAAc,oCAAoC,CAAC"}
|
package/dist/deploy.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { scopeStoreScriptName, type ScopeStoreNeed, type StoreKindRegistration } from '@substrat-run/contracts';
|
|
1
2
|
import type { AssetRouting, DeclaredBinding, DeployManifest } from '@substrat-run/contracts';
|
|
2
3
|
/**
|
|
3
4
|
* The deploy seam (self-serve-deploy.md). A `substrat push` uploads a *built* worker
|
|
@@ -131,6 +132,50 @@ export type FetchVerticalModulesFn = (deploymentRef: string) => Promise<Vertical
|
|
|
131
132
|
* `DeployVerticalFn`; undefined when the bytes cannot be produced.
|
|
132
133
|
*/
|
|
133
134
|
export type FetchVerticalAssetFn = (deploymentRef: string, asset: Pick<AssetUpload, 'path' | 'hash'>) => Promise<Uint8Array | undefined>;
|
|
135
|
+
/**
|
|
136
|
+
* The script a kind is uploaded as, for one vertical (#2210). Defined in contracts beside the
|
|
137
|
+
* vertical script names it must never collide with (L20).
|
|
138
|
+
*/
|
|
139
|
+
export { scopeStoreScriptName };
|
|
140
|
+
/** One store script to upload. The serving script is not given the namespace or the key. */
|
|
141
|
+
export interface ScopeStoreUploadPlan {
|
|
142
|
+
readonly scripts: readonly {
|
|
143
|
+
readonly kind: string;
|
|
144
|
+
readonly release: string;
|
|
145
|
+
readonly vertical: string;
|
|
146
|
+
readonly scriptName: string;
|
|
147
|
+
readonly className: string;
|
|
148
|
+
}[];
|
|
149
|
+
/** Empty (L1). A vertical reaches a store through the platform, not a binding of its own. */
|
|
150
|
+
readonly bindings: readonly [];
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Which store scripts a vertical's stores need (#2210). One script per (kind, vertical), shared
|
|
154
|
+
* by every binding of that kind, named by {@link scopeStoreScriptName}, which carries no release:
|
|
155
|
+
* a new release of the kind is uploaded into the same name. A kind that is not in `kinds` is
|
|
156
|
+
* refused. The default registry is empty. Nothing uploads these scripts yet.
|
|
157
|
+
*/
|
|
158
|
+
export declare function scopeStoreUploadPlan(input: {
|
|
159
|
+
readonly vertical: string;
|
|
160
|
+
readonly stores: readonly ScopeStoreNeed[];
|
|
161
|
+
readonly kinds?: readonly StoreKindRegistration[];
|
|
162
|
+
}): ScopeStoreUploadPlan;
|
|
163
|
+
/**
|
|
164
|
+
* The bindings a vertical's upload carries (#2210), the per-version push and the serving upload
|
|
165
|
+
* alike: the version's own declared bindings, then the platform's (the serving upload's
|
|
166
|
+
* ledger-derived stores; none on a push). A declared scope store adds none (RFC scope-stores §10.2, L1):
|
|
167
|
+
* its kind is still checked against `kinds`, so a version whose kind is not registered is
|
|
168
|
+
* refused here as at push.
|
|
169
|
+
*/
|
|
170
|
+
export declare function verticalUploadBindings<B>(input: {
|
|
171
|
+
readonly vertical: string;
|
|
172
|
+
readonly manifest: {
|
|
173
|
+
readonly bindings: readonly DeclaredBinding[];
|
|
174
|
+
readonly scopeStores: readonly ScopeStoreNeed[];
|
|
175
|
+
};
|
|
176
|
+
readonly platformBindings: readonly B[];
|
|
177
|
+
readonly kinds?: readonly StoreKindRegistration[];
|
|
178
|
+
}): (DeclaredBinding | B)[];
|
|
134
179
|
/**
|
|
135
180
|
* The §4 sandbox contract. Throws a `forbidden` `substratError` (403 — the upload is well-formed
|
|
136
181
|
* and still refused) if a declared binding is not one of the vertical's OWN admissible
|
package/dist/deploy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,oBAAoB,EAKpB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE7F;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACzG,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE/E;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb;0FACsF;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAED,8EAA8E;AAC9E,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;IAC1B;mFAC+E;IAC/E,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,OAAO,EAAE;QAAE,IAA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,cAAc,EAAE,CAAA;KAAE,CAAC;IACtH,QAAQ,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAAE,CAAC;IACxC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAC;CACnD,GAAG,CAAC,eAAe,GAAG,CAAC,CAAC,EAAE,CAG1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,cAAc,GAAG,IAAI,CA6C7D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAExE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;0FAC0F;AAC1F,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGxD"}
|
package/dist/deploy.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ADMISSIBLE_BINDING_TYPES, PLATFORM_BINDING_PREFIX, substratError, verticalScriptStem } from '@substrat-run/contracts';
|
|
1
|
+
import { ADMISSIBLE_BINDING_TYPES, assertDeclaredScopeStores, PLATFORM_BINDING_PREFIX, scopeStoreScriptName, STORE_KINDS, storeNamesOfBindings, substratError, verticalScriptStem, } from '@substrat-run/contracts';
|
|
2
2
|
/**
|
|
3
3
|
* The deploy seam (self-serve-deploy.md). A `substrat push` uploads a *built* worker
|
|
4
4
|
* bundle; this layer forwards it to the platform's runtime (a Workers-for-Platforms
|
|
@@ -52,6 +52,51 @@ const NAMED_REFUSALS = {
|
|
|
52
52
|
service: 'a vertical is one serving script; it reaches the platform through the router (K-27), never a service binding',
|
|
53
53
|
dispatch_namespace: "the platform's Workers-for-Platforms dispatch fabric is never a vertical's to bind",
|
|
54
54
|
};
|
|
55
|
+
/**
|
|
56
|
+
* The script a kind is uploaded as, for one vertical (#2210). Defined in contracts beside the
|
|
57
|
+
* vertical script names it must never collide with (L20).
|
|
58
|
+
*/
|
|
59
|
+
export { scopeStoreScriptName };
|
|
60
|
+
/**
|
|
61
|
+
* Which store scripts a vertical's stores need (#2210). One script per (kind, vertical), shared
|
|
62
|
+
* by every binding of that kind, named by {@link scopeStoreScriptName}, which carries no release:
|
|
63
|
+
* a new release of the kind is uploaded into the same name. A kind that is not in `kinds` is
|
|
64
|
+
* refused. The default registry is empty. Nothing uploads these scripts yet.
|
|
65
|
+
*/
|
|
66
|
+
export function scopeStoreUploadPlan(input) {
|
|
67
|
+
const kinds = input.kinds ?? STORE_KINDS;
|
|
68
|
+
const scripts = [];
|
|
69
|
+
const seen = new Set();
|
|
70
|
+
for (const store of input.stores) {
|
|
71
|
+
const kind = kinds.find((candidate) => candidate.kind === store.kind);
|
|
72
|
+
if (!kind) {
|
|
73
|
+
throw substratError('forbidden', `deploy refused: scope store '${store.binding}' declares kind '${store.kind}', which is not registered. ` +
|
|
74
|
+
`A store kind is platform code, pinned to a release the way a connector is.`);
|
|
75
|
+
}
|
|
76
|
+
if (seen.has(kind.kind))
|
|
77
|
+
continue;
|
|
78
|
+
seen.add(kind.kind);
|
|
79
|
+
scripts.push({
|
|
80
|
+
kind: kind.kind,
|
|
81
|
+
release: kind.release,
|
|
82
|
+
vertical: input.vertical,
|
|
83
|
+
scriptName: scopeStoreScriptName(input.vertical, kind.kind),
|
|
84
|
+
className: kind.className,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return { scripts, bindings: [] };
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The bindings a vertical's upload carries (#2210), the per-version push and the serving upload
|
|
91
|
+
* alike: the version's own declared bindings, then the platform's (the serving upload's
|
|
92
|
+
* ledger-derived stores; none on a push). A declared scope store adds none (RFC scope-stores §10.2, L1):
|
|
93
|
+
* its kind is still checked against `kinds`, so a version whose kind is not registered is
|
|
94
|
+
* refused here as at push.
|
|
95
|
+
*/
|
|
96
|
+
export function verticalUploadBindings(input) {
|
|
97
|
+
const plan = scopeStoreUploadPlan({ vertical: input.vertical, stores: input.manifest.scopeStores, kinds: input.kinds });
|
|
98
|
+
return [...input.manifest.bindings, ...input.platformBindings, ...plan.bindings];
|
|
99
|
+
}
|
|
55
100
|
/**
|
|
56
101
|
* The §4 sandbox contract. Throws a `forbidden` `substratError` (403 — the upload is well-formed
|
|
57
102
|
* and still refused) if a declared binding is not one of the vertical's OWN admissible
|
|
@@ -81,6 +126,13 @@ const NAMED_REFUSALS = {
|
|
|
81
126
|
* the platform mints a live D1 per tenant and attaches it to the serving script — #301 PR-2.)
|
|
82
127
|
*/
|
|
83
128
|
export function assertSandboxContract(m) {
|
|
129
|
+
// The same derivation push applies (#2224): an own DO binding is an own store.
|
|
130
|
+
assertDeclaredScopeStores({
|
|
131
|
+
...storeNamesOfBindings(m.bindings),
|
|
132
|
+
tenantStores: m.tenantStores,
|
|
133
|
+
blobStores: m.blobStores,
|
|
134
|
+
scopeStores: m.scopeStores,
|
|
135
|
+
});
|
|
84
136
|
const own = new Set(m.doClasses);
|
|
85
137
|
const admissible = new Set(ADMISSIBLE_BINDING_TYPES);
|
|
86
138
|
const doc = 'self-serve-deploy.md §4';
|
package/dist/deploy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,EACpB,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,kBAAkB,GAGnB,MAAM,yBAAyB,CAAC;AAGjC;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,uFAAuF;AACvF,oFAAoF;AACpF,2CAA2C;AAC3C,OAAO,EAAE,cAAc,EAAE,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AC,UAAU,+CAA+C,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC;YACtH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;;;;;;;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/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export { attributeFailure, terminalFailureNote } from './failure-attribution.js'
|
|
|
28
28
|
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
29
|
export { isTerminalDispatchFailure, isTerminalProviderError, providerErrorStatus, RETRYABLE_CLIENT_STATUSES, } from './provider-error.js';
|
|
30
30
|
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';
|
|
31
32
|
export { assertSandboxContract, deployManifest, deploymentRefFor, stableDeploymentRefFor, nextMigrationTag, DeployUploadError, upstreamStatusOf, } from './deploy.js';
|
|
32
33
|
export type { DeployVerticalFn, FetchVerticalAssetFn, FetchVerticalModulesFn, RecoverAssetContentFn, VerticalBundle, DeclaredBinding, DeployManifest, } from './deploy.js';
|
|
33
34
|
export { createWfpUploader, createWfpModulesFetcher, createWfpBindingsPatcher } from './wfp.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,YAAY,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACrG,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC7F,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACzE,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,sBA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AAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACtE,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,YAAY,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,oBAAoB,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,4BAA4B,EAI5B,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAI/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,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
|
@@ -25,6 +25,7 @@ export { attributeFailure, terminalFailureNote } from './failure-attribution.js'
|
|
|
25
25
|
export { sendEmailHandler, sendFailureStatus, retryAfterSecondsOf, MAX_EMAIL_SEND_ATTEMPTS, EMAIL_RETRY_BASE_MS, EMAIL_RETRY_MAX_MS, } from './email-intent.js';
|
|
26
26
|
// #1978: moved here from the kernel — the drain is its only reader.
|
|
27
27
|
export { isTerminalDispatchFailure, isTerminalProviderError, providerErrorStatus, RETRYABLE_CLIENT_STATUSES, } from './provider-error.js';
|
|
28
|
+
export { callPlatformScopeStore, platformScopeStoresFor, scopeStoresOf, unreachablePlatformScopeStores, declaredStoresOf, } from './platform-scope-stores.js';
|
|
28
29
|
export { assertSandboxContract, deployManifest, deploymentRefFor, stableDeploymentRefFor, nextMigrationTag, DeployUploadError, upstreamStatusOf, } from './deploy.js';
|
|
29
30
|
export { createWfpUploader, createWfpModulesFetcher, createWfpBindingsPatcher } from './wfp.js';
|
|
30
31
|
export { withPlatformEntry, platformEntrySkipReason, platformSweeperDecision, PLATFORM_ENTRY_MODULE, PLATFORM_SWEEPER_MODULE, } from './platform-entry.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;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,E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MAAM,mBAAmB,CAAC;AAG3E,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/platform-entry.d.ts
CHANGED
|
@@ -84,6 +84,28 @@ declared: {
|
|
|
84
84
|
* and a later upload never re-declares one that is already live.
|
|
85
85
|
*/
|
|
86
86
|
export declare function deployedDoClasses(doClasses: readonly string[], supplySweeper: boolean | undefined): string[];
|
|
87
|
+
/** The flag that gives a script `node:async_hooks` and nothing else of node (#2245). */
|
|
88
|
+
export declare const ASYNC_LOCAL_STORAGE_FLAG = "nodejs_als";
|
|
89
|
+
/**
|
|
90
|
+
* The compatibility flags a wrapped script is uploaded with, and whether the platform entry
|
|
91
|
+
* may import `AsyncLocalStorage` (#2245, RFC §6: the request runs in one, so its store calls
|
|
92
|
+
* reach its line). The entry imports `node:async_hooks`, which workerd allows only under
|
|
93
|
+
* `nodejs_als` or `nodejs_compat`:
|
|
94
|
+
*
|
|
95
|
+
* - either flag already there: the flags go up exactly as declared;
|
|
96
|
+
* - neither: `nodejs_als` is appended, after the declared ones. It has no compatibility-date
|
|
97
|
+
* gate, and it adds `node:async_hooks` alone — no other node module, no globals;
|
|
98
|
+
* - the script opts out with `no_nodejs_als`: the flags go up as declared and the entry drops
|
|
99
|
+
* its import, so the upload never fails over it. With `nodejs_compat` beside the opt-out,
|
|
100
|
+
* vertical-host still reaches `AsyncLocalStorage` through `process.getBuiltinModule` and the
|
|
101
|
+
* line names the calls; with no `nodejs_compat` either, the line names no store calls.
|
|
102
|
+
*
|
|
103
|
+
* Existing flags are never removed or reordered.
|
|
104
|
+
*/
|
|
105
|
+
export declare function platformEntryFlags(declared: readonly string[] | undefined): {
|
|
106
|
+
flags: string[];
|
|
107
|
+
asyncLocalStorage: boolean;
|
|
108
|
+
};
|
|
87
109
|
/**
|
|
88
110
|
* The bundle as uploaded: the platform's entry module added (or refreshed) and named as
|
|
89
111
|
* the script's main module, importing the vertical's own entry — and, when the version's
|
|
@@ -94,5 +116,5 @@ export declare function deployedDoClasses(doClasses: readonly string[], supplySw
|
|
|
94
116
|
* bundle the platform cannot or need not wrap comes back unchanged, apart from dropping stale
|
|
95
117
|
* platform modules it can no longer reach.
|
|
96
118
|
*/
|
|
97
|
-
export declare function withPlatformEntry<B extends Pick<VerticalBundle, 'entry' | 'modules'> & Partial<Pick<VerticalBundle, 'doClasses' | 'bindings' | 'supplySweeper'>>>(bundle: B): B;
|
|
119
|
+
export declare function withPlatformEntry<B extends Pick<VerticalBundle, 'entry' | 'modules'> & Partial<Pick<VerticalBundle, 'doClasses' | 'bindings' | 'supplySweeper' | 'compatibilityFlags'>>>(bundle: B): B;
|
|
98
120
|
//# sourceMappingURL=platform-entry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-entry.d.ts","sourceRoot":"","sources":["../src/platform-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,
|
|
1
|
+
{"version":3,"file":"platform-entry.d.ts","sourceRoot":"","sources":["../src/platform-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAGL,qBAAqB,EAGrB,uBAAuB,EAExB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,CAAC;AAoB1D;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,MAAM,GAAG,SAAS,CAc7G;AAuBD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,uBAAuB;AACrC,qGAAqG;AACrG,QAAQ,EAAE;IAAE,SAAS,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAAC,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,EAC7G,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,SAAS,CAAC,GAChD;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CA2D1C;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,EAAE,aAAa,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,EAAE,CAE5G;AAED,wFAAwF;AACxF,eAAO,MAAM,wBAAwB,eAAe,CAAC;AAErD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,iBAAiB,EAAE,OAAO,CAAA;CAAE,CAK3H;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,CAAC,SAAS,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,SAAS,CAAC,GACjD,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,GAAG,UAAU,GAAG,eAAe,GAAG,oBAAoB,CAAC,CAAC,EAClG,MAAM,EAAE,CAAC,GAAG,CAAC,CAkCd"}
|
|
@@ -7,8 +7,16 @@
|
|
|
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 — 12744 bytes of ESM. */
|
|
11
11
|
export declare const PLATFORM_ENTRY_SOURCE: string;
|
|
12
|
+
/**
|
|
13
|
+
* #2245: the entry's `node:async_hooks` import, as it appears in `PLATFORM_ENTRY_SOURCE`, and
|
|
14
|
+
* the line the uploader puts in its place for a script that can have no `AsyncLocalStorage`
|
|
15
|
+
* (one that opts out with `no_nodejs_als`). With no `nodejs_compat` either, that script's line names
|
|
16
|
+
* no store calls; with it, vertical-host reaches the class through `process.getBuiltinModule`.
|
|
17
|
+
*/
|
|
18
|
+
export declare const PLATFORM_ENTRY_ALS_IMPORT = "import { AsyncLocalStorage } from \"node:async_hooks\";";
|
|
19
|
+
export declare const PLATFORM_ENTRY_ALS_FALLBACK = "const AsyncLocalStorage = undefined;";
|
|
12
20
|
/**
|
|
13
21
|
* The scope sweeper the platform supplies (#1902) — uploaded beside the entry, which
|
|
14
22
|
* re-exports its class, when a vertical declares schedules and brings no sweeper of its own.
|
|
@@ -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,6CAA6C;AAC7C,eAAO,MAAM,qBAAqB,EAAE,
|
|
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,MAA08Z,CAAC;AAE/+Z;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,4DAA4D,CAAC;AACnG,eAAO,MAAM,2BAA2B,yCAAyC,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,iCAAiC,CAAC;AAEtE,8CAA8C;AAC9C,eAAO,MAAM,uBAAuB,EAAE,MAA60T,CAAC"}
|
|
@@ -9,8 +9,16 @@
|
|
|
9
9
|
export const PLATFORM_ENTRY_MODULE = 'substrat-platform-entry.js';
|
|
10
10
|
/** The import specifier the uploader replaces with `./<the bundle's entry>`. */
|
|
11
11
|
export const PLATFORM_ENTRY_PLACEHOLDER = '__SUBSTRAT_VERTICAL_ENTRY__';
|
|
12
|
-
/** The entry itself —
|
|
13
|
-
export const PLATFORM_ENTRY_SOURCE = "// packages/contracts/dist/invocation-record.js\nvar INVOCATION_RECORD_HEADER = \"x-substrat-invocation-record\";\nvar REQUEST_ID_HEADER = \"x-substrat-request-id\";\nvar INVOCATION_RECORD_FIELD_MAX = 128;\nvar FIELDS = [\"operation\", \"problemCode\", \"principalKind\"];\nfunction encodeInvocationRecord(record) {\n const params = new URLSearchParams();\n for (const key of FIELDS) {\n const v = record[key];\n if (typeof v === \"string\" && v !== \"\")\n params.set(key, v.slice(0, INVOCATION_RECORD_FIELD_MAX));\n }\n const value = params.toString();\n return value === \"\" ? null : value;\n}\nvar FIELD_COVERAGE_HEADER = \"x-substrat-field-coverage\";\nfunction invocationLevelOf(status, threw, problemCode) {\n if (threw || status === null || status >= 500)\n return \"error\";\n if (status >= 400)\n return \"warn\";\n if (problemCode)\n return \"warn\";\n return \"info\";\n}\n\n// packages/kernel/dist/invocation-line.js\nfunction invocationLine(f) {\n const emitted = f.emitted;\n return {\n substrat: \"invocation\",\n ...f.kind ? { kind: f.kind } : {},\n tenantId: f.tenantId,\n scopeId: f.scopeId,\n vertical: f.vertical ?? null,\n surface: f.surface ?? null,\n method: f.method ?? null,\n path: f.path ?? null,\n status: f.status ?? null,\n threw: f.threw,\n durationMs: f.durationMs,\n invocationId: f.invocationId,\n level: f.level,\n operation: f.operation ?? null,\n problemCode: f.problemCode ?? null,\n principalKind: f.principalKind ?? null,\n eventCount: emitted ? emitted.total : null,\n eventTypes: emitted ? distinct(emitted.events.map((e) => e.type)) : [],\n entities: emitted && f.withEntities !== false ? distinct(emitted.events.map((e) => e.entity)) : [],\n versionId: f.versionId ?? null,\n ...f.outputFields ? { outputFields: f.outputFields, ...f.fieldCoverageId ? { fieldCoverageId: f.fieldCoverageId } : {} } : {},\n ...f.async ?? {}\n };\n}\nfunction distinct(values) {\n return [...new Set(values)];\n}\n\n// packages/kernel/dist/ulid.js\nvar B32 = \"0123456789ABCDEFGHJKMNPQRSTVWXYZ\";\nvar MAX_ULID_TIME = 2 ** 48 - 1;\nvar ULID_SHAPE = /^[0-9A-HJKMNP-TV-Z]{26}$/;\nvar unencodable = (t) => `not an encodable ULID instant: ${t} (want 0..${MAX_ULID_TIME})`;\nfunction encodeTime(time) {\n let ts = \"\";\n let t = time;\n for (let i = 0; i < 10; i++) {\n ts = B32[t % 32] + ts;\n t = Math.floor(t / 32);\n }\n return ts;\n}\nfunction createUlid() {\n let lastTime = -1;\n const lastRand = new Array(16).fill(0);\n function freshRandom() {\n const bytes = crypto.getRandomValues(new Uint8Array(16));\n for (let i = 0; i < 16; i++)\n lastRand[i] = bytes[i] % 32;\n }\n function incrementRandom() {\n for (let i = 15; i >= 0; i--) {\n if (lastRand[i] < 31) {\n lastRand[i]++;\n return true;\n }\n lastRand[i] = 0;\n }\n return false;\n }\n const mint = ((now = Date.now()) => {\n if (!Number.isSafeInteger(now))\n throw new RangeError(unencodable(now));\n let time = now;\n if (time <= lastTime) {\n time = lastTime;\n if (!incrementRandom()) {\n time = lastTime + 1;\n freshRandom();\n }\n } else {\n freshRandom();\n }\n if (time < 0 || time > MAX_ULID_TIME)\n throw new RangeError(unencodable(time));\n lastTime = time;\n let r = \"\";\n for (const d of lastRand)\n r += B32[d];\n return encodeTime(time) + r;\n });\n mint.seedFrom = (id) => {\n const time = ulidTime(id);\n if (time < lastTime)\n return;\n const rand = [];\n for (const ch of id.slice(10))\n rand.push(B32.indexOf(ch));\n if (time === lastTime) {\n let ahead = false;\n for (let i = 0; i < 16; i++) {\n if (rand[i] !== lastRand[i]) {\n ahead = rand[i] > lastRand[i];\n break;\n }\n }\n if (!ahead)\n return;\n }\n lastTime = time;\n for (let i = 0; i < 16; i++)\n lastRand[i] = rand[i];\n };\n return mint;\n}\nvar processUlid = createUlid();\nfunction ulid(now = Date.now()) {\n return processUlid(now);\n}\nfunction ulidTime(id) {\n if (!ULID_SHAPE.test(id))\n throw new Error(`not a ULID: ${id}`);\n let t = 0;\n for (const ch of id.slice(0, 10))\n t = t * 32 + B32.indexOf(ch);\n if (t > MAX_ULID_TIME)\n throw new Error(`not a ULID: ${id}`);\n return t;\n}\n\n// packages/contracts/dist/wire-auth.js\nfunction secretMatches(presented, expected) {\n const given = presented ?? \"\";\n let diff = given.length ^ expected.length | (given.length === 0 ? 1 : 0);\n for (let i = 0; i < expected.length; i++) {\n diff |= (i < given.length ? given.charCodeAt(i) : 0) ^ expected.charCodeAt(i);\n }\n return diff === 0;\n}\n\n// packages/vertical-host/src/routed-node.ts\nvar ROUTED_ID = /^[0-9A-HJKMNP-TV-Z]{26}$/;\nvar RouterAssertionError = class extends Error {\n};\nfunction readRoutedNode(headers, options = {}) {\n const rawTenant = headers.get(\"x-substrat-tenant\");\n const rawScope = headers.get(\"x-substrat-scope\");\n if (!rawTenant && !rawScope) return null;\n const { expectedSecret, allowUnsigned = false } = options;\n if (expectedSecret) {\n if (!secretMatches(headers.get(\"x-substrat-router\"), expectedSecret)) {\n throw new RouterAssertionError(\"router assertion is not signed by a known router\");\n }\n } else if (!allowUnsigned) {\n throw new RouterAssertionError(\n \"router assertion cannot be verified: this worker has no ROUTER_SECRET configured\"\n );\n }\n if (!rawTenant || !rawScope) {\n throw new RouterAssertionError(\"router assertion is incomplete\");\n }\n if (!ROUTED_ID.test(rawTenant) || !ROUTED_ID.test(rawScope)) {\n throw new RouterAssertionError(\"router assertion carries a malformed id\");\n }\n return {\n tenantId: rawTenant,\n scopeId: rawScope,\n surface: headers.get(\"x-substrat-surface\") ?? \"app\",\n verticalSlug: headers.get(\"x-substrat-vertical\")\n };\n}\n\n// packages/vertical-host/src/invocation-log.ts\nfunction versionIdOf(env) {\n const v = env?.SUBSTRAT_VERSION_ID;\n return typeof v === \"string\" && v.length > 0 ? v : null;\n}\nfunction pathOf(url) {\n try {\n return new URL(url).pathname;\n } catch {\n return \"/\";\n }\n}\nvar STAMPS = /* @__PURE__ */ Symbol.for(\"substrat.invocation-stamp\");\nfunction stamps() {\n const g = globalThis;\n return g[STAMPS] ??= /* @__PURE__ */ new WeakMap();\n}\nfunction invocationStampOf(request) {\n return stamps().get(request);\n}\nfunction withRequestId(response, id) {\n const headers = response?.headers;\n try {\n headers?.set?.(REQUEST_ID_HEADER, id);\n return response;\n } catch {\n }\n try {\n const r = response;\n if (r.status === 101) return response;\n const copy = new Response(r.body, r);\n copy.headers.set(REQUEST_ID_HEADER, id);\n return copy;\n } catch {\n return response;\n }\n}\nfunction beginStamp(request, env, options) {\n const stamp = { invocationId: ulid(), record: {} };\n const fieldCoverageId = armedFieldCoverageId(request.headers, env, options);\n if (fieldCoverageId) stamp.fieldCoverageId = fieldCoverageId;\n stamps().set(request, stamp);\n return stamp;\n}\nfunction armedFieldCoverageId(headers, env, options) {\n let id;\n try {\n id = headers.get(FIELD_COVERAGE_HEADER);\n } catch {\n return void 0;\n }\n if (id === null || !ROUTED_ID.test(id)) return void 0;\n return routedNodeOrNull(headers, env, options) !== null ? id : void 0;\n}\nfunction writeInvocationLine(stamp, done, options) {\n try {\n writeLineOrThrow(stamp, done, options);\n } catch (e) {\n try {\n console.log(JSON.stringify({ substrat: \"invocation-log-fault\", detail: String(e) }));\n } catch {\n }\n }\n}\nfunction writeLineOrThrow(stamp, done, options) {\n const node = routedNodeOrNull(done.request.headers, done.env, options);\n if (!node) return;\n const { record, invocationId } = stamp;\n const line = invocationLine({\n tenantId: node.tenantId,\n scopeId: node.scopeId,\n vertical: node.verticalSlug,\n surface: node.surface,\n method: done.request.method,\n path: pathOf(done.request.url),\n status: done.status,\n threw: done.threw,\n durationMs: Date.now() - done.started,\n invocationId,\n level: invocationLevelOf(done.status, done.threw, record.problemCode),\n operation: record.operation,\n problemCode: record.problemCode,\n principalKind: record.principalKind,\n ...record.emitted ? { emitted: record.emitted } : {},\n versionId: versionIdOf(done.env),\n ...record.outputFields ? { outputFields: record.outputFields } : {},\n ...stamp.fieldCoverageId ? { fieldCoverageId: stamp.fieldCoverageId } : {}\n });\n console.log(JSON.stringify(line));\n}\nvar OTHER_HANDLERS = [\"scheduled\", \"queue\", \"email\", \"tail\", \"trace\", \"alarm\", \"test\"];\nfunction withInvocationLog(worker, options = {}) {\n const inner = worker?.fetch;\n if (typeof inner !== \"function\") return worker;\n const wrapped = {\n async fetch(request, env, ctx) {\n if (invocationStampOf(request)) return inner.call(worker, request, env, ctx);\n const started = Date.now();\n const stamp = beginStamp(request, env, options);\n let status = null;\n let threw = false;\n try {\n const response = withRequestId(await inner.call(worker, request, env, ctx), stamp.invocationId);\n status = response.status;\n handRecordToRouter(response, stamp.record, request, env, options);\n return response;\n } catch (e) {\n threw = true;\n throw e;\n } finally {\n writeInvocationLine(stamp, { request, env, status, threw, started }, options);\n }\n }\n };\n for (const name of OTHER_HANDLERS) {\n const h = worker[name];\n if (typeof h === \"function\") wrapped[name] = h.bind(worker);\n }\n return wrapped;\n}\nfunction handRecordToRouter(response, record, request, env, options) {\n try {\n const value = encodeInvocationRecord(record);\n if (value === null || !routedNodeOrNull(request.headers, env, options)) return;\n response.headers?.set?.(\n INVOCATION_RECORD_HEADER,\n value\n );\n } catch {\n }\n}\nfunction routedNodeOrNull(headers, env, options) {\n try {\n return readRoutedNode(headers, {\n expectedSecret: options.routerSecret?.(env),\n allowUnsigned: options.allowUnsigned?.(env) ?? false\n });\n } catch (e) {\n if (!(e instanceof RouterAssertionError)) console.log(JSON.stringify({ substrat: \"invocation-log-fault\", detail: String(e) }));\n return null;\n }\n}\n\n// substrat-platform-entry.ts\nimport * as vertical from \"__SUBSTRAT_VERTICAL_ENTRY__\";\nexport * from \"__SUBSTRAT_VERTICAL_ENTRY__\";\nvar substrat_platform_entry_default = withInvocationLog(vertical.default, {\n routerSecret: (env) => env.ROUTER_SECRET,\n allowUnsigned: (env) => env.ALLOW_DEV_NODE === \"true\"\n});\nexport {\n substrat_platform_entry_default as default\n};\n";
|
|
12
|
+
/** The entry itself — 12744 bytes of ESM. */
|
|
13
|
+
export const PLATFORM_ENTRY_SOURCE = "// substrat-platform-entry.ts\nimport { AsyncLocalStorage } from \"node:async_hooks\";\n\n// packages/contracts/dist/invocation-record.js\nvar INVOCATION_RECORD_HEADER = \"x-substrat-invocation-record\";\nvar REQUEST_ID_HEADER = \"x-substrat-request-id\";\nvar INVOCATION_RECORD_FIELD_MAX = 128;\nvar FIELDS = [\"operation\", \"problemCode\", \"principalKind\"];\nfunction encodeInvocationRecord(record) {\n const params = new URLSearchParams();\n for (const key of FIELDS) {\n const v = record[key];\n if (typeof v === \"string\" && v !== \"\")\n params.set(key, v.slice(0, INVOCATION_RECORD_FIELD_MAX));\n }\n const value = params.toString();\n return value === \"\" ? null : value;\n}\nvar FIELD_COVERAGE_HEADER = \"x-substrat-field-coverage\";\nfunction invocationLevelOf(status, threw, problemCode) {\n if (threw || status === null || status >= 500)\n return \"error\";\n if (status >= 400)\n return \"warn\";\n if (problemCode)\n return \"warn\";\n return \"info\";\n}\n\n// packages/kernel/dist/invocation-line.js\nfunction invocationLine(f) {\n const emitted = f.emitted;\n return {\n substrat: \"invocation\",\n ...f.kind ? { kind: f.kind } : {},\n tenantId: f.tenantId,\n scopeId: f.scopeId,\n vertical: f.vertical ?? null,\n surface: f.surface ?? null,\n method: f.method ?? null,\n path: f.path ?? null,\n status: f.status ?? null,\n threw: f.threw,\n durationMs: f.durationMs,\n invocationId: f.invocationId,\n level: f.level,\n operation: f.operation ?? null,\n problemCode: f.problemCode ?? null,\n principalKind: f.principalKind ?? null,\n eventCount: emitted ? emitted.total : null,\n eventTypes: emitted ? distinct(emitted.events.map((e) => e.type)) : [],\n entities: emitted && f.withEntities !== false ? distinct(emitted.events.map((e) => e.entity)) : [],\n versionId: f.versionId ?? null,\n ...f.outputFields ? { outputFields: f.outputFields, ...f.fieldCoverageId ? { fieldCoverageId: f.fieldCoverageId } : {} } : {},\n ...f.storeCalls && f.storeCalls.length > 0 ? { storeCalls: f.storeCalls } : {},\n ...f.storeCallsDropped ? { storeCallsDropped: f.storeCallsDropped } : {},\n ...f.async ?? {}\n };\n}\nvar STORE_CALL_LOG_CAP = 16;\nfunction tallyStoreCall(tally, call) {\n const calls = tally.storeCalls ?? (tally.storeCalls = []);\n if (calls.length < STORE_CALL_LOG_CAP) {\n calls.push({ binding: call.binding, operation: call.operation, outcome: call.outcome, durationMs: call.durationMs });\n } else {\n tally.storeCallsDropped = (tally.storeCallsDropped ?? 0) + 1;\n }\n}\nvar STORE_CALL_SINK_KEY = \"substrat.store-call-sink\";\nfunction distinct(values) {\n return [...new Set(values)];\n}\n\n// packages/kernel/dist/ulid.js\nvar B32 = \"0123456789ABCDEFGHJKMNPQRSTVWXYZ\";\nvar MAX_ULID_TIME = 2 ** 48 - 1;\nvar ULID_SHAPE = /^[0-9A-HJKMNP-TV-Z]{26}$/;\nvar unencodable = (t) => `not an encodable ULID instant: ${t} (want 0..${MAX_ULID_TIME})`;\nfunction encodeTime(time) {\n let ts = \"\";\n let t = time;\n for (let i = 0; i < 10; i++) {\n ts = B32[t % 32] + ts;\n t = Math.floor(t / 32);\n }\n return ts;\n}\nfunction createUlid() {\n let lastTime = -1;\n const lastRand = new Array(16).fill(0);\n function freshRandom() {\n const bytes = crypto.getRandomValues(new Uint8Array(16));\n for (let i = 0; i < 16; i++)\n lastRand[i] = bytes[i] % 32;\n }\n function incrementRandom() {\n for (let i = 15; i >= 0; i--) {\n if (lastRand[i] < 31) {\n lastRand[i]++;\n return true;\n }\n lastRand[i] = 0;\n }\n return false;\n }\n const mint = ((now = Date.now()) => {\n if (!Number.isSafeInteger(now))\n throw new RangeError(unencodable(now));\n let time = now;\n if (time <= lastTime) {\n time = lastTime;\n if (!incrementRandom()) {\n time = lastTime + 1;\n freshRandom();\n }\n } else {\n freshRandom();\n }\n if (time < 0 || time > MAX_ULID_TIME)\n throw new RangeError(unencodable(time));\n lastTime = time;\n let r = \"\";\n for (const d of lastRand)\n r += B32[d];\n return encodeTime(time) + r;\n });\n mint.seedFrom = (id) => {\n const time = ulidTime(id);\n if (time < lastTime)\n return;\n const rand = [];\n for (const ch of id.slice(10))\n rand.push(B32.indexOf(ch));\n if (time === lastTime) {\n let ahead = false;\n for (let i = 0; i < 16; i++) {\n if (rand[i] !== lastRand[i]) {\n ahead = rand[i] > lastRand[i];\n break;\n }\n }\n if (!ahead)\n return;\n }\n lastTime = time;\n for (let i = 0; i < 16; i++)\n lastRand[i] = rand[i];\n };\n return mint;\n}\nvar processUlid = createUlid();\nfunction ulid(now = Date.now()) {\n return processUlid(now);\n}\nfunction ulidTime(id) {\n if (!ULID_SHAPE.test(id))\n throw new Error(`not a ULID: ${id}`);\n let t = 0;\n for (const ch of id.slice(0, 10))\n t = t * 32 + B32.indexOf(ch);\n if (t > MAX_ULID_TIME)\n throw new Error(`not a ULID: ${id}`);\n return t;\n}\n\n// packages/contracts/dist/wire-auth.js\nfunction secretMatches(presented, expected) {\n const given = presented ?? \"\";\n let diff = given.length ^ expected.length | (given.length === 0 ? 1 : 0);\n for (let i = 0; i < expected.length; i++) {\n diff |= (i < given.length ? given.charCodeAt(i) : 0) ^ expected.charCodeAt(i);\n }\n return diff === 0;\n}\n\n// packages/vertical-host/src/routed-node.ts\nvar ROUTED_ID = /^[0-9A-HJKMNP-TV-Z]{26}$/;\nvar RouterAssertionError = class extends Error {\n};\nfunction readRoutedNode(headers, options = {}) {\n const rawTenant = headers.get(\"x-substrat-tenant\");\n const rawScope = headers.get(\"x-substrat-scope\");\n if (!rawTenant && !rawScope) return null;\n const { expectedSecret, allowUnsigned = false } = options;\n if (expectedSecret) {\n if (!secretMatches(headers.get(\"x-substrat-router\"), expectedSecret)) {\n throw new RouterAssertionError(\"router assertion is not signed by a known router\");\n }\n } else if (!allowUnsigned) {\n throw new RouterAssertionError(\n \"router assertion cannot be verified: this worker has no ROUTER_SECRET configured\"\n );\n }\n if (!rawTenant || !rawScope) {\n throw new RouterAssertionError(\"router assertion is incomplete\");\n }\n if (!ROUTED_ID.test(rawTenant) || !ROUTED_ID.test(rawScope)) {\n throw new RouterAssertionError(\"router assertion carries a malformed id\");\n }\n return {\n tenantId: rawTenant,\n scopeId: rawScope,\n surface: headers.get(\"x-substrat-surface\") ?? \"app\",\n verticalSlug: headers.get(\"x-substrat-vertical\")\n };\n}\n\n// packages/vertical-host/src/invocation-log.ts\nfunction builtinAsyncLocalStorage() {\n try {\n const proc = globalThis.process;\n const mod = proc?.getBuiltinModule?.(\"node:async_hooks\");\n return typeof mod?.AsyncLocalStorage === \"function\" ? mod.AsyncLocalStorage : void 0;\n } catch {\n return void 0;\n }\n}\nfunction storeCallSlot(provided) {\n try {\n const g = globalThis;\n const key = Symbol.for(STORE_CALL_SINK_KEY);\n const existing = g[key];\n if (typeof existing?.run === \"function\" && typeof existing.current === \"function\") return existing;\n const Als = provided ?? builtinAsyncLocalStorage();\n if (!Als) return void 0;\n const storage = new Als();\n const slot = {\n current() {\n const tally = storage.getStore();\n return tally ? (call) => tallyStoreCall(tally, call) : void 0;\n },\n run: (tally, fn) => storage.run(tally, fn)\n };\n g[key] = slot;\n return slot;\n } catch {\n return void 0;\n }\n}\nfunction runRecordingStoreCalls(record, provided, fn) {\n const slot = storeCallSlot(provided);\n return slot ? slot.run(record, fn) : fn();\n}\nfunction versionIdOf(env) {\n const v = env?.SUBSTRAT_VERSION_ID;\n return typeof v === \"string\" && v.length > 0 ? v : null;\n}\nfunction pathOf(url) {\n try {\n return new URL(url).pathname;\n } catch {\n return \"/\";\n }\n}\nvar STAMPS = /* @__PURE__ */ Symbol.for(\"substrat.invocation-stamp\");\nfunction stamps() {\n const g = globalThis;\n return g[STAMPS] ??= /* @__PURE__ */ new WeakMap();\n}\nfunction invocationStampOf(request) {\n return stamps().get(request);\n}\nfunction withRequestId(response, id) {\n const headers = response?.headers;\n try {\n headers?.set?.(REQUEST_ID_HEADER, id);\n return response;\n } catch {\n }\n try {\n const r = response;\n if (r.status === 101) return response;\n const copy = new Response(r.body, r);\n copy.headers.set(REQUEST_ID_HEADER, id);\n return copy;\n } catch {\n return response;\n }\n}\nfunction beginStamp(request, env, options) {\n const stamp = { invocationId: ulid(), record: {} };\n const fieldCoverageId = armedFieldCoverageId(request.headers, env, options);\n if (fieldCoverageId) stamp.fieldCoverageId = fieldCoverageId;\n stamps().set(request, stamp);\n return stamp;\n}\nfunction armedFieldCoverageId(headers, env, options) {\n let id;\n try {\n id = headers.get(FIELD_COVERAGE_HEADER);\n } catch {\n return void 0;\n }\n if (id === null || !ROUTED_ID.test(id)) return void 0;\n return routedNodeOrNull(headers, env, options) !== null ? id : void 0;\n}\nfunction writeInvocationLine(stamp, done, options) {\n try {\n writeLineOrThrow(stamp, done, options);\n } catch (e) {\n try {\n console.log(JSON.stringify({ substrat: \"invocation-log-fault\", detail: String(e) }));\n } catch {\n }\n }\n}\nfunction writeLineOrThrow(stamp, done, options) {\n const node = routedNodeOrNull(done.request.headers, done.env, options);\n if (!node) return;\n const { record, invocationId } = stamp;\n const line = invocationLine({\n tenantId: node.tenantId,\n scopeId: node.scopeId,\n vertical: node.verticalSlug,\n surface: node.surface,\n method: done.request.method,\n path: pathOf(done.request.url),\n status: done.status,\n threw: done.threw,\n durationMs: Date.now() - done.started,\n invocationId,\n level: invocationLevelOf(done.status, done.threw, record.problemCode),\n operation: record.operation,\n problemCode: record.problemCode,\n principalKind: record.principalKind,\n ...record.emitted ? { emitted: record.emitted } : {},\n versionId: versionIdOf(done.env),\n ...record.outputFields ? { outputFields: record.outputFields } : {},\n ...stamp.fieldCoverageId ? { fieldCoverageId: stamp.fieldCoverageId } : {},\n ...record.storeCalls && record.storeCalls.length > 0 ? { storeCalls: record.storeCalls } : {},\n ...record.storeCallsDropped ? { storeCallsDropped: record.storeCallsDropped } : {}\n });\n console.log(JSON.stringify(line));\n}\nvar OTHER_HANDLERS = [\"scheduled\", \"queue\", \"email\", \"tail\", \"trace\", \"alarm\", \"test\"];\nfunction withInvocationLog(worker, options = {}) {\n const inner = worker?.fetch;\n if (typeof inner !== \"function\") return worker;\n const wrapped = {\n async fetch(request, env, ctx) {\n if (invocationStampOf(request)) return inner.call(worker, request, env, ctx);\n const started = Date.now();\n const stamp = beginStamp(request, env, options);\n let status = null;\n let threw = false;\n try {\n const response = withRequestId(\n await runRecordingStoreCalls(stamp.record, options.asyncLocalStorage, () => inner.call(worker, request, env, ctx)),\n stamp.invocationId\n );\n status = response.status;\n handRecordToRouter(response, stamp.record, request, env, options);\n return response;\n } catch (e) {\n threw = true;\n throw e;\n } finally {\n writeInvocationLine(stamp, { request, env, status, threw, started }, options);\n }\n }\n };\n for (const name of OTHER_HANDLERS) {\n const h = worker[name];\n if (typeof h === \"function\") wrapped[name] = h.bind(worker);\n }\n return wrapped;\n}\nfunction handRecordToRouter(response, record, request, env, options) {\n try {\n const value = encodeInvocationRecord(record);\n if (value === null || !routedNodeOrNull(request.headers, env, options)) return;\n response.headers?.set?.(\n INVOCATION_RECORD_HEADER,\n value\n );\n } catch {\n }\n}\nfunction routedNodeOrNull(headers, env, options) {\n try {\n return readRoutedNode(headers, {\n expectedSecret: options.routerSecret?.(env),\n allowUnsigned: options.allowUnsigned?.(env) ?? false\n });\n } catch (e) {\n if (!(e instanceof RouterAssertionError)) console.log(JSON.stringify({ substrat: \"invocation-log-fault\", detail: String(e) }));\n return null;\n }\n}\n\n// substrat-platform-entry.ts\nimport * as vertical from \"__SUBSTRAT_VERTICAL_ENTRY__\";\nexport * from \"__SUBSTRAT_VERTICAL_ENTRY__\";\nvar substrat_platform_entry_default = withInvocationLog(vertical.default, {\n routerSecret: (env) => env.ROUTER_SECRET,\n allowUnsigned: (env) => env.ALLOW_DEV_NODE === \"true\",\n asyncLocalStorage: AsyncLocalStorage\n});\nexport {\n substrat_platform_entry_default as default\n};\n";
|
|
14
|
+
/**
|
|
15
|
+
* #2245: the entry's `node:async_hooks` import, as it appears in `PLATFORM_ENTRY_SOURCE`, and
|
|
16
|
+
* the line the uploader puts in its place for a script that can have no `AsyncLocalStorage`
|
|
17
|
+
* (one that opts out with `no_nodejs_als`). With no `nodejs_compat` either, that script's line names
|
|
18
|
+
* no store calls; with it, vertical-host reaches the class through `process.getBuiltinModule`.
|
|
19
|
+
*/
|
|
20
|
+
export const PLATFORM_ENTRY_ALS_IMPORT = "import { AsyncLocalStorage } from \"node:async_hooks\";";
|
|
21
|
+
export const PLATFORM_ENTRY_ALS_FALLBACK = "const AsyncLocalStorage = undefined;";
|
|
14
22
|
/**
|
|
15
23
|
* The scope sweeper the platform supplies (#1902) — uploaded beside the entry, which
|
|
16
24
|
* re-exports its class, when a vertical declares schedules and brings no sweeper of its own.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-entry.generated.js","sourceRoot":"","sources":["../src/platform-entry.generated.ts"],"names":[],"mappings":"AAAA,8KAA8K;AAC9K,sEAAsE;AAEtE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,4BAA4B,CAAC;AAElE,gFAAgF;AAChF,MAAM,CAAC,MAAM,0BAA0B,GAAG,6BAA6B,CAAC;AAExE,6CAA6C;AAC7C,MAAM,CAAC,MAAM,qBAAqB,GAAW,
|
|
1
|
+
{"version":3,"file":"platform-entry.generated.js","sourceRoot":"","sources":["../src/platform-entry.generated.ts"],"names":[],"mappings":"AAAA,8KAA8K;AAC9K,sEAAsE;AAEtE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,4BAA4B,CAAC;AAElE,gFAAgF;AAChF,MAAM,CAAC,MAAM,0BAA0B,GAAG,6BAA6B,CAAC;AAExE,6CAA6C;AAC7C,MAAM,CAAC,MAAM,qBAAqB,GAAW,i8ZAAi8Z,CAAC;AAE/+Z;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,yDAAyD,CAAC;AACnG,MAAM,CAAC,MAAM,2BAA2B,GAAG,sCAAsC,CAAC;AAElF;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,8BAA8B,CAAC;AAEtE,8CAA8C;AAC9C,MAAM,CAAC,MAAM,uBAAuB,GAAW,o0TAAo0T,CAAC"}
|
package/dist/platform-entry.js
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* keeps that answer for every later upload.
|
|
31
31
|
*/
|
|
32
32
|
import { PLATFORM_SWEEPER_BINDING, PLATFORM_SWEEPER_CLASS, PLATFORM_SWEEPER_VAR, PLATFORM_SWEEP_HOST_KEY, sweeperConflict, } from '@substrat-run/contracts';
|
|
33
|
-
import { PLATFORM_ENTRY_MODULE, PLATFORM_ENTRY_PLACEHOLDER, PLATFORM_ENTRY_SOURCE, PLATFORM_SWEEPER_MODULE, PLATFORM_SWEEPER_SOURCE, } from './platform-entry.generated.js';
|
|
33
|
+
import { PLATFORM_ENTRY_ALS_FALLBACK, PLATFORM_ENTRY_ALS_IMPORT, PLATFORM_ENTRY_MODULE, PLATFORM_ENTRY_PLACEHOLDER, PLATFORM_ENTRY_SOURCE, PLATFORM_SWEEPER_MODULE, PLATFORM_SWEEPER_SOURCE, } from './platform-entry.generated.js';
|
|
34
34
|
export { PLATFORM_ENTRY_MODULE, PLATFORM_SWEEPER_MODULE };
|
|
35
35
|
const PLATFORM_MODULES = new Set([PLATFORM_ENTRY_MODULE, PLATFORM_SWEEPER_MODULE]);
|
|
36
36
|
/** The line `invocationLog` writes, as it appears in any build: `substrat:"invocation"`. */
|
|
@@ -182,6 +182,32 @@ declared, bundle) {
|
|
|
182
182
|
export function deployedDoClasses(doClasses, supplySweeper) {
|
|
183
183
|
return supplySweeper ? [...new Set([...doClasses, PLATFORM_SWEEPER_CLASS])] : [...doClasses];
|
|
184
184
|
}
|
|
185
|
+
/** The flag that gives a script `node:async_hooks` and nothing else of node (#2245). */
|
|
186
|
+
export const ASYNC_LOCAL_STORAGE_FLAG = 'nodejs_als';
|
|
187
|
+
/**
|
|
188
|
+
* The compatibility flags a wrapped script is uploaded with, and whether the platform entry
|
|
189
|
+
* may import `AsyncLocalStorage` (#2245, RFC §6: the request runs in one, so its store calls
|
|
190
|
+
* reach its line). The entry imports `node:async_hooks`, which workerd allows only under
|
|
191
|
+
* `nodejs_als` or `nodejs_compat`:
|
|
192
|
+
*
|
|
193
|
+
* - either flag already there: the flags go up exactly as declared;
|
|
194
|
+
* - neither: `nodejs_als` is appended, after the declared ones. It has no compatibility-date
|
|
195
|
+
* gate, and it adds `node:async_hooks` alone — no other node module, no globals;
|
|
196
|
+
* - the script opts out with `no_nodejs_als`: the flags go up as declared and the entry drops
|
|
197
|
+
* its import, so the upload never fails over it. With `nodejs_compat` beside the opt-out,
|
|
198
|
+
* vertical-host still reaches `AsyncLocalStorage` through `process.getBuiltinModule` and the
|
|
199
|
+
* line names the calls; with no `nodejs_compat` either, the line names no store calls.
|
|
200
|
+
*
|
|
201
|
+
* Existing flags are never removed or reordered.
|
|
202
|
+
*/
|
|
203
|
+
export function platformEntryFlags(declared) {
|
|
204
|
+
const flags = [...(declared ?? [])];
|
|
205
|
+
if (flags.includes(`no_${ASYNC_LOCAL_STORAGE_FLAG}`))
|
|
206
|
+
return { flags, asyncLocalStorage: false };
|
|
207
|
+
if (flags.includes(ASYNC_LOCAL_STORAGE_FLAG) || flags.includes('nodejs_compat'))
|
|
208
|
+
return { flags, asyncLocalStorage: true };
|
|
209
|
+
return { flags: [...flags, ASYNC_LOCAL_STORAGE_FLAG], asyncLocalStorage: true };
|
|
210
|
+
}
|
|
185
211
|
/**
|
|
186
212
|
* The bundle as uploaded: the platform's entry module added (or refreshed) and named as
|
|
187
213
|
* the script's main module, importing the vertical's own entry — and, when the version's
|
|
@@ -198,14 +224,18 @@ export function withPlatformEntry(bundle) {
|
|
|
198
224
|
return bundle;
|
|
199
225
|
const own = bundle.modules.filter((m) => !PLATFORM_MODULES.has(m.name));
|
|
200
226
|
const encode = (text) => new TextEncoder().encode(text);
|
|
227
|
+
const { flags, asyncLocalStorage } = platformEntryFlags(bundle.compatibilityFlags);
|
|
201
228
|
// Module names are paths from the script root, where the platform entry sits too.
|
|
202
229
|
let source = PLATFORM_ENTRY_SOURCE.split(PLATFORM_ENTRY_PLACEHOLDER).join(`./${bundle.entry}`);
|
|
230
|
+
if (!asyncLocalStorage)
|
|
231
|
+
source = source.split(PLATFORM_ENTRY_ALS_IMPORT).join(PLATFORM_ENTRY_ALS_FALLBACK);
|
|
203
232
|
if (supply)
|
|
204
233
|
source += `export { ${PLATFORM_SWEEPER_CLASS} } from "./${PLATFORM_SWEEPER_MODULE}";\n`;
|
|
205
234
|
const kind = 'application/javascript+module';
|
|
206
235
|
return {
|
|
207
236
|
...bundle,
|
|
208
237
|
entry: PLATFORM_ENTRY_MODULE,
|
|
238
|
+
compatibilityFlags: flags,
|
|
209
239
|
modules: [
|
|
210
240
|
{ name: PLATFORM_ENTRY_MODULE, content: encode(source), contentType: kind },
|
|
211
241
|
...(supply ? [{ name: PLATFORM_SWEEPER_MODULE, content: encode(PLATFORM_SWEEPER_SOURCE), contentType: kind }] : []),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-entry.js","sourceRoot":"","sources":["../src/platform-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,GAEhB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,+BAA+B,CAAC;AAEvC,OAA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AAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,CAAC,uBAAuB,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACnH,GAAG,GAAG;SACP;QACD,GAAG,CAAC,MAAM;YACR,CAAC,CAAC;gBACE,mFAAmF;gBACnF,0DAA0D;gBAC1D,SAAS,EAAE,iBAAiB,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,EAAE,IAAI,CAAC;gBAC1D,QAAQ,EAAE;oBACR,GAAG,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC;oBAC1B,EAAE,IAAI,EAAE,0BAA0B,EAAE,IAAI,EAAE,wBAAwB,EAAE,UAAU,EAAE,sBAAsB,EAAE;oBACxG,+FAA+F;oBAC/F,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,wBAAwB,EAAwC;iBACzH;aACF;YACH,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { type PlatformActorId, type ReservedStoreOperation, type Scope, type ScopeDumpTable, type StoreKindRegistration } from '@substrat-run/contracts';
|
|
2
|
+
import { type HostAdmin } from '@substrat-run/kernel';
|
|
3
|
+
/**
|
|
4
|
+
* A reserved scope-store call, made by the control plane straight at the store
|
|
5
|
+
* script (#2207). The vertical is not on this path: it holds neither the
|
|
6
|
+
* namespace nor the key. The key signs the object name here, and the audience
|
|
7
|
+
* is `platform`, which is the only audience a `substrat.*` operation accepts.
|
|
8
|
+
*/
|
|
9
|
+
export interface PlatformScopeStoreDispatch {
|
|
10
|
+
readonly hmacKey: string;
|
|
11
|
+
fetch(scriptName: string, request: Request): Promise<Response>;
|
|
12
|
+
}
|
|
13
|
+
export interface PlatformScopeStoreTarget {
|
|
14
|
+
readonly vertical: string;
|
|
15
|
+
readonly kind: string;
|
|
16
|
+
readonly tenantId: string;
|
|
17
|
+
readonly scopeId: string;
|
|
18
|
+
readonly binding: string;
|
|
19
|
+
}
|
|
20
|
+
/** One declared binding, as a version manifest lists it. */
|
|
21
|
+
export interface DeclaredScopeStore {
|
|
22
|
+
readonly binding: string;
|
|
23
|
+
readonly kind: string;
|
|
24
|
+
}
|
|
25
|
+
export interface PlatformScopeStores {
|
|
26
|
+
exportStores(input: {
|
|
27
|
+
tenantId: string;
|
|
28
|
+
scopeId: string;
|
|
29
|
+
vertical: string;
|
|
30
|
+
stores: readonly DeclaredScopeStore[];
|
|
31
|
+
}): Promise<{
|
|
32
|
+
binding: string;
|
|
33
|
+
kind: string;
|
|
34
|
+
tables: ScopeDumpTable[];
|
|
35
|
+
}[]>;
|
|
36
|
+
importStores(input: {
|
|
37
|
+
tenantId: string;
|
|
38
|
+
scopeId: string;
|
|
39
|
+
vertical: string;
|
|
40
|
+
stores: readonly {
|
|
41
|
+
binding: string;
|
|
42
|
+
kind: string;
|
|
43
|
+
tables: ScopeDumpTable[];
|
|
44
|
+
}[];
|
|
45
|
+
}): Promise<void>;
|
|
46
|
+
eraseSubject(input: {
|
|
47
|
+
tenantId: string;
|
|
48
|
+
scopeId: string;
|
|
49
|
+
vertical: string;
|
|
50
|
+
subjectId: string;
|
|
51
|
+
stores: readonly DeclaredScopeStore[];
|
|
52
|
+
}): Promise<{
|
|
53
|
+
binding: string;
|
|
54
|
+
erased: number;
|
|
55
|
+
}[]>;
|
|
56
|
+
wipeStores(input: {
|
|
57
|
+
tenantId: string;
|
|
58
|
+
scopeId: string;
|
|
59
|
+
vertical: string;
|
|
60
|
+
stores: readonly DeclaredScopeStore[];
|
|
61
|
+
}): Promise<void>;
|
|
62
|
+
sizeStores(input: {
|
|
63
|
+
tenantId: string;
|
|
64
|
+
scopeId: string;
|
|
65
|
+
vertical: string;
|
|
66
|
+
stores: readonly DeclaredScopeStore[];
|
|
67
|
+
}): Promise<{
|
|
68
|
+
binding: string;
|
|
69
|
+
bytes: number;
|
|
70
|
+
}[]>;
|
|
71
|
+
}
|
|
72
|
+
/** Bindings a version manifest declares. Missing JSON is none. Unreadable JSON fails closed. */
|
|
73
|
+
export declare function declaredStoresOf(manifestJson: string | null): DeclaredScopeStore[];
|
|
74
|
+
/**
|
|
75
|
+
* The scope stores of the version a scope's deployment runs (#2207). A scope on its vertical's
|
|
76
|
+
* serving pin runs the serving pointer's version, and any other scope its bound version; this
|
|
77
|
+
* is the version the router reads a scope's stores from (`READ_ROUTE_SQL`). Provisioning sets the
|
|
78
|
+
* serving pin and no bound version, so reading the bound version alone answers "no store" for an
|
|
79
|
+
* ordinary install whose store the router serves. A pin that names another script than the
|
|
80
|
+
* pointer's is unknown, as #2242's erasure gate has it.
|
|
81
|
+
*
|
|
82
|
+
* The gate is `mayHoldScopeStores`: with no kind registered nothing can hold a store, and the
|
|
83
|
+
* answer is none. Otherwise a version that cannot be named, a manifest that cannot be read, or one
|
|
84
|
+
* the gate says may hold a store without naming it refuses (503), rather than let a backup, a
|
|
85
|
+
* wipe, a replay or an erasure skip a store that may hold data.
|
|
86
|
+
*/
|
|
87
|
+
export declare function scopeStoresOf(admin: Pick<HostAdmin, 'verticalServing' | 'versionManifest'>, actor: PlatformActorId, scope: Pick<Scope, 'id' | 'vertical' | 'verticalVersionId' | 'servingRef'>, kinds?: readonly StoreKindRegistration[]): Promise<DeclaredScopeStore[]>;
|
|
88
|
+
/** Sign `objectName` and POST the reserved operation at that kind's script. */
|
|
89
|
+
export declare function callPlatformScopeStore(dispatch: PlatformScopeStoreDispatch, target: PlatformScopeStoreTarget, operation: ReservedStoreOperation, input?: unknown): Promise<unknown>;
|
|
90
|
+
/** The five reserved operations, one call per declared binding. */
|
|
91
|
+
export declare function platformScopeStoresFor(dispatch: PlatformScopeStoreDispatch): PlatformScopeStores;
|
|
92
|
+
/**
|
|
93
|
+
* The caller of a hosted control plane that has no route to the store scripts (#2207): every
|
|
94
|
+
* call is refused (503). A hosted control plane always passes a caller, this one included, so
|
|
95
|
+
* a missing route refuses the backup, wipe or erasure that needs a store instead of skipping it.
|
|
96
|
+
*/
|
|
97
|
+
export declare function unreachablePlatformScopeStores(): PlatformScopeStores;
|
|
98
|
+
//# sourceMappingURL=platform-scope-stores.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-scope-stores.d.ts","sourceRoot":"","sources":["../src/platform-scope-stores.ts"],"names":[],"mappings":"AAAA,OAAO,EAWL,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,KAAK,EACV,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAA8B,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAIlF;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CAChE;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,4DAA4D;AAC5D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,KAAK,EAAE;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAC;KACvC,GAAG,O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