@substrat-run/control-plane-api 0.147.0 → 0.149.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/api.d.ts +67 -4
  2. package/dist/api.d.ts.map +1 -1
  3. package/dist/api.js +1068 -418
  4. package/dist/api.js.map +1 -1
  5. package/dist/attachment-sweep.d.ts +29 -0
  6. package/dist/attachment-sweep.d.ts.map +1 -0
  7. package/dist/attachment-sweep.js +66 -0
  8. package/dist/attachment-sweep.js.map +1 -0
  9. package/dist/browser.d.ts +3 -1
  10. package/dist/browser.d.ts.map +1 -1
  11. package/dist/browser.js +3 -0
  12. package/dist/browser.js.map +1 -1
  13. package/dist/cf-observability.d.ts.map +1 -1
  14. package/dist/cf-observability.js +3 -1
  15. package/dist/cf-observability.js.map +1 -1
  16. package/dist/deploy.d.ts +26 -11
  17. package/dist/deploy.d.ts.map +1 -1
  18. package/dist/deploy.js +33 -18
  19. package/dist/deploy.js.map +1 -1
  20. package/dist/errors.d.ts +19 -1
  21. package/dist/errors.d.ts.map +1 -1
  22. package/dist/errors.js +18 -4
  23. package/dist/errors.js.map +1 -1
  24. package/dist/index.d.ts +15 -5
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +10 -4
  27. package/dist/index.js.map +1 -1
  28. package/dist/lake-gateway.d.ts +54 -0
  29. package/dist/lake-gateway.d.ts.map +1 -0
  30. package/dist/lake-gateway.js +158 -0
  31. package/dist/lake-gateway.js.map +1 -0
  32. package/dist/observability.d.ts +28 -0
  33. package/dist/observability.d.ts.map +1 -1
  34. package/dist/observability.js +35 -0
  35. package/dist/observability.js.map +1 -1
  36. package/dist/platform-entry.generated.d.ts +1 -1
  37. package/dist/platform-entry.generated.d.ts.map +1 -1
  38. package/dist/platform-entry.generated.js +2 -2
  39. package/dist/platform-entry.generated.js.map +1 -1
  40. package/dist/platform-scope-stores.d.ts +65 -12
  41. package/dist/platform-scope-stores.d.ts.map +1 -1
  42. package/dist/platform-scope-stores.js +121 -20
  43. package/dist/platform-scope-stores.js.map +1 -1
  44. package/dist/r2-sql-engine.d.ts +50 -0
  45. package/dist/r2-sql-engine.d.ts.map +1 -0
  46. package/dist/r2-sql-engine.js +126 -0
  47. package/dist/r2-sql-engine.js.map +1 -0
  48. package/dist/scope-copy-cleanup.d.ts +13 -1
  49. package/dist/scope-copy-cleanup.d.ts.map +1 -1
  50. package/dist/scope-copy-cleanup.js +14 -3
  51. package/dist/scope-copy-cleanup.js.map +1 -1
  52. package/dist/staff-client.d.ts +10 -2
  53. package/dist/staff-client.d.ts.map +1 -1
  54. package/dist/staff-client.js +6 -1
  55. package/dist/staff-client.js.map +1 -1
  56. package/dist/store-entry.d.ts +90 -0
  57. package/dist/store-entry.d.ts.map +1 -0
  58. package/dist/store-entry.generated.d.ts +60 -0
  59. package/dist/store-entry.generated.d.ts.map +1 -0
  60. package/dist/store-entry.generated.js +62 -0
  61. package/dist/store-entry.generated.js.map +1 -0
  62. package/dist/store-entry.js +178 -0
  63. package/dist/store-entry.js.map +1 -0
  64. package/dist/store-rebuild.d.ts +142 -0
  65. package/dist/store-rebuild.d.ts.map +1 -0
  66. package/dist/store-rebuild.js +223 -0
  67. package/dist/store-rebuild.js.map +1 -0
  68. package/dist/store-releases.d.ts +158 -0
  69. package/dist/store-releases.d.ts.map +1 -0
  70. package/dist/store-releases.js +332 -0
  71. package/dist/store-releases.js.map +1 -0
  72. package/dist/store-script.d.ts +98 -0
  73. package/dist/store-script.d.ts.map +1 -0
  74. package/dist/store-script.js +188 -0
  75. package/dist/store-script.js.map +1 -0
  76. package/dist/vertical-client.d.ts +33 -2
  77. package/dist/vertical-client.d.ts.map +1 -1
  78. package/dist/vertical-client.js +58 -3
  79. package/dist/vertical-client.js.map +1 -1
  80. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"observability.d.ts","sourceRoot":"","sources":["../src/observability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;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,CAAC,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAC;CACvG"}
@@ -47,6 +47,41 @@ export function invocationKindOf(v) {
47
47
  }
48
48
  /** How many values one facet lists, most frequent first. */
49
49
  export const REQUEST_FACET_TOP = 10;
50
+ /**
51
+ * #2192: the outbound calls of a raw line's `outboundCalls`, keeping only entries of the line's
52
+ * shape. The line is written by the platform's entry, but a vertical's own code can print a
53
+ * line of the same shape, so the read takes nothing on trust beyond the field types.
54
+ */
55
+ export function outboundCallsOf(v) {
56
+ if (!Array.isArray(v))
57
+ return [];
58
+ const calls = [];
59
+ for (const c of v) {
60
+ if (typeof c !== 'object' || c === null)
61
+ continue;
62
+ const e = c;
63
+ if (typeof e['host'] !== 'string' ||
64
+ typeof e['path'] !== 'string' ||
65
+ typeof e['method'] !== 'string' ||
66
+ !(typeof e['status'] === 'number' || e['status'] === null) ||
67
+ typeof e['outcome'] !== 'string' ||
68
+ typeof e['durationMs'] !== 'number' ||
69
+ typeof e['atMs'] !== 'number') {
70
+ continue;
71
+ }
72
+ calls.push({
73
+ host: e['host'],
74
+ path: e['path'],
75
+ method: e['method'],
76
+ status: e['status'],
77
+ outcome: e['outcome'],
78
+ durationMs: e['durationMs'],
79
+ atMs: e['atMs'],
80
+ ...(typeof e['reason'] === 'string' ? { reason: e['reason'] } : {}),
81
+ });
82
+ }
83
+ return calls;
84
+ }
50
85
  /** How many templates the pattern read lists. */
51
86
  export const LOG_PATTERN_TOP = 50;
52
87
  //# sourceMappingURL=observability.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"observability.js","sourceRoot":"","sources":["../src/observability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAwLH;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE1C;;;;;GAKG;AACH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IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;YACf,GAAG,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACpE,CAAC,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAgCD,iDAAiD;AACjD,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,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 — 12744 bytes of ESM. */
10
+ /** The entry itself — 19418 bytes of ESM. */
11
11
  export declare const PLATFORM_ENTRY_SOURCE: string;
12
12
  /**
13
13
  * #2245: the entry's `node:async_hooks` import, as it appears in `PLATFORM_ENTRY_SOURCE`, and
@@ -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,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"}
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,MAAktnB,CAAC;AAEvvnB;;;;;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,8 @@
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 — 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";
12
+ /** The entry itself — 19418 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(record2) {\n const params = new URLSearchParams();\n for (const key of FIELDS) {\n const v = record2[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.outboundCalls && f.outboundCalls.length > 0 ? { outboundCalls: f.outboundCalls } : {},\n ...f.outboundCallsDropped ? { outboundCallsDropped: f.outboundCallsDropped } : {},\n ...f.parentInvocationId ? { parentInvocationId: f.parentInvocationId, ...f.parentScopeId ? { parentScopeId: f.parentScopeId } : {} } : {},\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 OUTBOUND_CALL_LOG_CAP = 16;\nfunction tallyOutboundCall(tally, call) {\n const calls = tally.outboundCalls ?? (tally.outboundCalls = []);\n if (calls.length < OUTBOUND_CALL_LOG_CAP) {\n calls.push({\n host: call.host,\n path: call.path,\n method: call.method,\n status: call.status,\n outcome: call.outcome,\n durationMs: call.durationMs,\n atMs: call.atMs,\n ...call.reason !== void 0 ? { reason: call.reason } : {}\n });\n } else {\n tally.outboundCallsDropped = (tally.outboundCallsDropped ?? 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/vertical-host/src/outbound-calls.ts\nvar EGRESS_REFUSAL_HEADER = \"x-substrat-egress\";\nvar STORE_CALL_HOST = \"store.substrat.internal\";\nvar REDACTED = \"[redacted]\";\nvar PATH_MAX = 200;\nvar WORDS = /^[a-z]{1,16}(?:[-_][a-z]{1,16}){0,3}$/;\nvar WORDS_WITH_EXTENSION = /^[a-z]{1,16}(?:[-_][a-z]{1,16}){0,3}\\.[a-z][a-z0-9]{0,4}$/;\nvar SEGMENT_MAX = 40;\nvar SMALL_INTEGER = /^[0-9]{1,10}$/;\nvar VERSION = /^v[0-9]{1,3}(?:\\.[0-9]{1,3}){0,2}$/;\nfunction keepsSegment(segment) {\n if (segment.length > SEGMENT_MAX) return false;\n return segment === \"\" || WORDS.test(segment) || WORDS_WITH_EXTENSION.test(segment) || SMALL_INTEGER.test(segment) || VERSION.test(segment);\n}\nfunction redactOutboundPath(pathname) {\n const path = pathname.split(\"/\").map((segment) => keepsSegment(segment) ? segment : REDACTED).join(\"/\");\n return path.length > PATH_MAX ? `${path.slice(0, PATH_MAX)}…` : path;\n}\nvar ERROR_CLASS = /^[A-Z][A-Za-z]{0,30}(?:Error|Exception)$/;\nfunction errorName(e) {\n const name = e?.name;\n return typeof name === \"string\" && ERROR_CLASS.test(name) ? name : \"Error\";\n}\nfunction answeredOutcome(response) {\n if (response.status === 403 && response.headers?.get?.(EGRESS_REFUSAL_HEADER) === \"refused\") return \"refused\";\n return response.status >= 400 ? \"http-error\" : \"ok\";\n}\nfunction rejectedOutcome(e) {\n const name = errorName(e);\n if (name === \"TimeoutError\") return { outcome: \"timeout\" };\n if (name === \"AbortError\") return { outcome: \"aborted\" };\n return { outcome: \"failed\", reason: name };\n}\nvar SINCE = /* @__PURE__ */ Symbol.for(\"substrat.outbound-since\");\nfunction sinceMap() {\n const g = globalThis;\n return g[SINCE] ??= /* @__PURE__ */ new WeakMap();\n}\nfunction markRequestStart(recording, started) {\n try {\n sinceMap().set(recording, started);\n } catch {\n }\n}\nfunction destinationOf(input, init) {\n const fromRequest = typeof input === \"object\" && input !== null && !(input instanceof URL);\n const raw = fromRequest ? input.url : input;\n let url;\n try {\n url = new URL(String(raw));\n } catch {\n return null;\n }\n const initMethod = init?.method;\n const requestMethod = fromRequest ? input.method : void 0;\n const method = typeof initMethod === \"string\" ? initMethod : typeof requestMethod === \"string\" ? requestMethod : \"GET\";\n return { url, method: method.toUpperCase().slice(0, 16) };\n}\nfunction record(recording, destination, startedAt, end) {\n try {\n const call = {\n host: destination.url.host.toLowerCase(),\n path: redactOutboundPath(destination.url.pathname),\n method: destination.method,\n status: end.status,\n outcome: end.outcome,\n durationMs: Math.max(0, Date.now() - startedAt),\n atMs: Math.max(0, startedAt - (sinceMap().get(recording) ?? startedAt)),\n ...end.reason !== void 0 ? { reason: end.reason } : {}\n };\n tallyOutboundCall(recording, call);\n } catch {\n }\n}\nvar WRAPPED = /* @__PURE__ */ Symbol.for(\"substrat.outbound-fetch\");\nvar IN_CALL = /* @__PURE__ */ Symbol.for(\"substrat.outbound-fetch.in-call\");\nfunction recordingFetch(original, current) {\n const wrapped = function fetch(input, init) {\n const g = globalThis;\n if (g[IN_CALL] === true) return original.call(globalThis, input, init);\n let recording;\n let destination = null;\n try {\n recording = current();\n if (recording) destination = destinationOf(input, init);\n } catch {\n recording = void 0;\n }\n if (!recording || !destination || destination.url.hostname.toLowerCase() === STORE_CALL_HOST) {\n return original.call(globalThis, input, init);\n }\n const rec = recording;\n const dest = destination;\n const startedAt = Date.now();\n let pending;\n g[IN_CALL] = true;\n try {\n pending = original.call(globalThis, input, init);\n } finally {\n g[IN_CALL] = false;\n }\n return pending.then(\n (response) => {\n let status = null;\n let outcome = \"failed\";\n try {\n status = response.status;\n outcome = answeredOutcome(response);\n } catch {\n }\n record(rec, dest, startedAt, { status, outcome });\n return response;\n },\n (e) => {\n let end = { outcome: \"failed\", reason: \"Error\" };\n try {\n end = rejectedOutcome(e);\n } catch {\n }\n record(rec, dest, startedAt, { status: null, ...end });\n throw e;\n }\n );\n };\n Object.defineProperty(wrapped, WRAPPED, { value: true });\n return wrapped;\n}\nfunction installOutboundRecorder(current) {\n try {\n const g = globalThis;\n const existing = g.fetch;\n if (typeof existing !== \"function\" || existing[WRAPPED]) return;\n g.fetch = recordingFetch(existing, current);\n } catch {\n }\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()?.tally;\n return tally ? (call) => tallyStoreCall(tally, call) : void 0;\n },\n invocationId: () => storage.getStore()?.invocationId,\n run: (tally, fn, invocationId) => storage.run({ tally, invocationId }, fn),\n recording: () => storage.getStore()?.tally\n };\n g[key] = slot;\n return slot;\n } catch {\n return void 0;\n }\n}\nfunction currentRecording() {\n const slot = globalThis[Symbol.for(STORE_CALL_SINK_KEY)];\n return typeof slot?.recording === \"function\" ? slot.recording() : void 0;\n}\nfunction runRecording(stamp, started, provided, fn) {\n const slot = storeCallSlot(provided);\n if (!slot) return fn();\n markRequestStart(stamp.record, started);\n installOutboundRecorder(currentRecording);\n return slot.run(stamp.record, fn, stamp.invocationId);\n}\nfunction versionIdOf(env) {\n const v = env?.SUBSTRAT_VERSION_ID;\n return typeof v === \"string\" && v.length > 0 ? v : null;\n}\nvar UPLOAD_LINK_LOG_SECRET_PREFIX = \"sbup_\";\nvar UPLOAD_LINK_SECRET_SEGMENT = /^(\\/api\\/attachment-uploads\\/[^/]+\\/[^/]+\\/)[^/]+/;\nvar SECRET_SHAPED_SEGMENT = new RegExp(`(^|/)${UPLOAD_LINK_LOG_SECRET_PREFIX}[^/]*`, \"g\");\nvar redactUploadLinkSecret = (pathname) => pathname.replace(UPLOAD_LINK_SECRET_SEGMENT, \"$1[redacted]\").replace(SECRET_SHAPED_SEGMENT, \"$1[redacted]\");\nfunction pathOf(url) {\n try {\n return redactUploadLinkSecret(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: record2, 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, record2.problemCode),\n operation: record2.operation,\n problemCode: record2.problemCode,\n principalKind: record2.principalKind,\n ...record2.emitted ? { emitted: record2.emitted } : {},\n versionId: versionIdOf(done.env),\n ...record2.outputFields ? { outputFields: record2.outputFields } : {},\n ...stamp.fieldCoverageId ? { fieldCoverageId: stamp.fieldCoverageId } : {},\n ...record2.storeCalls && record2.storeCalls.length > 0 ? { storeCalls: record2.storeCalls } : {},\n ...record2.storeCallsDropped ? { storeCallsDropped: record2.storeCallsDropped } : {},\n ...record2.outboundCalls && record2.outboundCalls.length > 0 ? { outboundCalls: record2.outboundCalls } : {},\n ...record2.outboundCallsDropped ? { outboundCallsDropped: record2.outboundCallsDropped } : {}\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 runRecording(stamp, started, 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, record2, request, env, options) {\n try {\n const value = encodeInvocationRecord(record2);\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
14
  /**
15
15
  * #2245: the entry's `node:async_hooks` import, as it appears in `PLATFORM_ENTRY_SOURCE`, and
16
16
  * the line the uploader puts in its place for a script that can have no `AsyncLocalStorage`
@@ -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,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"}
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,ysnBAAysnB,CAAC;AAEvvnB;;;;;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"}
@@ -1,18 +1,19 @@
1
- import { type PlatformActorId, type ReservedStoreOperation, type Scope, type ScopeDumpTable, type StoreKindRegistration } from '@substrat-run/contracts';
1
+ import { type PlatformActorId, type ReservedStoreOperation, type Scope, type ScopeDumpTable, type StoreDriverRegistration } from '@substrat-run/contracts';
2
2
  import { type HostAdmin } from '@substrat-run/kernel';
3
3
  /**
4
4
  * A reserved scope-store call, made by the control plane straight at the store
5
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.
6
+ * namespace nor the key. The key signs the envelope here, audience `platform`,
7
+ * which is the only audience a `substrat.*` operation accepts.
8
8
  */
9
9
  export interface PlatformScopeStoreDispatch {
10
- readonly hmacKey: string;
10
+ /** PKCS8 Ed25519 private key, base64url. Signs audience `platform`. */
11
+ readonly platformKey: string;
11
12
  fetch(scriptName: string, request: Request): Promise<Response>;
12
13
  }
13
14
  export interface PlatformScopeStoreTarget {
14
15
  readonly vertical: string;
15
- readonly kind: string;
16
+ readonly driver: string;
16
17
  readonly tenantId: string;
17
18
  readonly scopeId: string;
18
19
  readonly binding: string;
@@ -20,7 +21,7 @@ export interface PlatformScopeStoreTarget {
20
21
  /** One declared binding, as a version manifest lists it. */
21
22
  export interface DeclaredScopeStore {
22
23
  readonly binding: string;
23
- readonly kind: string;
24
+ readonly driver: string;
24
25
  }
25
26
  export interface PlatformScopeStores {
26
27
  exportStores(input: {
@@ -30,7 +31,7 @@ export interface PlatformScopeStores {
30
31
  stores: readonly DeclaredScopeStore[];
31
32
  }): Promise<{
32
33
  binding: string;
33
- kind: string;
34
+ driver: string;
34
35
  tables: ScopeDumpTable[];
35
36
  }[]>;
36
37
  importStores(input: {
@@ -39,7 +40,7 @@ export interface PlatformScopeStores {
39
40
  vertical: string;
40
41
  stores: readonly {
41
42
  binding: string;
42
- kind: string;
43
+ driver: string;
43
44
  tables: ScopeDumpTable[];
44
45
  }[];
45
46
  }): Promise<void>;
@@ -71,22 +72,74 @@ export interface PlatformScopeStores {
71
72
  }
72
73
  /** Bindings a version manifest declares. Missing JSON is none. Unreadable JSON fails closed. */
73
74
  export declare function declaredStoresOf(manifestJson: string | null): DeclaredScopeStore[];
75
+ /**
76
+ * The version a scope's deployment runs, read once (#2207, L14). A scope with a serving pin runs
77
+ * the serving pointer's version when the pointer's ref is its pin, and an unknown one otherwise;
78
+ * a scope with no pin runs its bound version. `servingPointer` is the pointer as read, for a scope
79
+ * with a pin: the pair a subject-erasure claim requires to still hold (#2285). A pointer that
80
+ * cannot be read refuses (503): neither the version nor the fence can be named.
81
+ */
82
+ export interface RunningVersion {
83
+ readonly versionId: string | null;
84
+ readonly servingPointer?: {
85
+ ref: string;
86
+ versionId: string;
87
+ } | null;
88
+ }
89
+ export declare function runningVersionOf(admin: Pick<HostAdmin, 'verticalServing'>, actor: PlatformActorId, scope: Pick<Scope, 'vertical' | 'verticalVersionId' | 'servingRef'>): Promise<RunningVersion>;
90
+ /**
91
+ * Stop the router serving a scope, before its stores are wiped (#2285, L6). The router admits a
92
+ * scope only while one of its hostnames is `active`, and it reads that row on every request, so
93
+ * unbinding is immediate. Unbind is idempotent: a retry after a failed wipe finds nothing left
94
+ * to remove. A hostname set merely non-active would not hold — the issuance reconcile heals a
95
+ * platform hostname back to `active`.
96
+ */
97
+ export declare function unrouteScope(admin: Pick<HostAdmin, 'listHostnames' | 'unbindHostname'>, actor: PlatformActorId, scope: Pick<Scope, 'tenantId' | 'id'>): Promise<void>;
74
98
  /**
75
99
  * The scope stores of the version a scope's deployment runs (#2207). A scope on its vertical's
76
100
  * 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
101
+ * is the version the router reads a scope's stores from (`READ_ROUTE_SQL`), and the one a restore
102
+ * may import into (L8). The lifecycle reaches more: `scopeStoresOf`. Provisioning sets the
78
103
  * serving pin and no bound version, so reading the bound version alone answers "no store" for an
79
104
  * ordinary install whose store the router serves. A pin that names another script than the
80
105
  * pointer's is unknown, as #2242's erasure gate has it.
81
106
  *
82
- * The gate is `mayHoldScopeStores`: with no kind registered nothing can hold a store, and the
107
+ * The gate is `mayHoldScopeStores`: with no driver registered nothing can hold a store, and the
83
108
  * answer is none. Otherwise a version that cannot be named, a manifest that cannot be read, or one
84
109
  * the gate says may hold a store without naming it refuses (503), rather than let a backup, a
85
110
  * wipe, a replay or an erasure skip a store that may hold data.
111
+ *
112
+ * `running` is a resolution the caller already holds (`runningVersionOf`), so a caller that fences
113
+ * on the version reads it once and judges the stores against the same read.
86
114
  */
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. */
115
+ export declare function runningVersionStoresOf(admin: Pick<HostAdmin, 'verticalServing' | 'versionManifest'>, actor: PlatformActorId, scope: Pick<Scope, 'id' | 'vertical' | 'verticalVersionId' | 'servingRef'>, drivers?: readonly StoreDriverRegistration[], running?: RunningVersion): Promise<DeclaredScopeStore[]>;
116
+ /**
117
+ * What the lifecycle reaches for a scope (#2286, L17): the running version's stores
118
+ * (`runningVersionStoresOf`, which still fails closed first), and every binding any version of its
119
+ * vertical has declared (`HostAdmin.verticalScopeStores`, read by its keys). Export, wipe, erasure
120
+ * and the meter reach `all`, so an object under a binding a later version dropped is still
121
+ * reached. A restore imports only into `running` (L8).
122
+ *
123
+ * A binding keeps its driver for the life of the vertical, since publish refuses a driver change; a
124
+ * running version whose driver disagrees with the record, or a record that cannot be read,
125
+ * refuses (503).
126
+ */
127
+ export declare function scopeStoreReachOf(admin: Pick<HostAdmin, 'verticalServing' | 'versionManifest' | 'verticalScopeStores'>, actor: PlatformActorId, scope: Pick<Scope, 'id' | 'vertical' | 'verticalVersionId' | 'servingRef'>, drivers?: readonly StoreDriverRegistration[], running?: RunningVersion): Promise<{
128
+ running: DeclaredScopeStore[];
129
+ all: DeclaredScopeStore[];
130
+ }>;
131
+ /** `scopeStoreReachOf`'s `all`: every store the lifecycle reaches for a scope (#2286). */
132
+ export declare function scopeStoresOf(admin: Pick<HostAdmin, 'verticalServing' | 'versionManifest' | 'verticalScopeStores'>, actor: PlatformActorId, scope: Pick<Scope, 'id' | 'vertical' | 'verticalVersionId' | 'servingRef'>, drivers?: readonly StoreDriverRegistration[], running?: RunningVersion): Promise<DeclaredScopeStore[]>;
133
+ /** Sign the envelope and POST the reserved operation at that driver's script. */
89
134
  export declare function callPlatformScopeStore(dispatch: PlatformScopeStoreDispatch, target: PlatformScopeStoreTarget, operation: ReservedStoreOperation, input?: unknown): Promise<unknown>;
135
+ /**
136
+ * The same call at a named script and object: the platform's canary (#2300), which no
137
+ * (vertical, scope) names. Its answer is parsed as every reserved answer is.
138
+ */
139
+ export declare function callPlatformScopeStoreAt(dispatch: PlatformScopeStoreDispatch, target: {
140
+ readonly scriptName: string;
141
+ readonly objectName: string;
142
+ }, operation: ReservedStoreOperation, input?: unknown): Promise<unknown>;
90
143
  /** The five reserved operations, one call per declared binding. */
91
144
  export declare function platformScopeStoresFor(dispatch: PlatformScopeStoreDispatch): PlatformScopeStores;
92
145
  /**
@@ -1 +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,OAAO,CAAC;QAAE,OAAO,E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BAAkB,EAAE,CAAC,CAE/B;AASD,iFAAiF;AACjF,wBAAsB,sBAAsB,CAC1C,QAAQ,EAAE,0BAA0B,EACpC,MAAM,EAAE,wBAAwB,EAChC,SAAS,EAAE,sBAAsB,EACjC,KAAK,CAAC,EAAE,OAAO,GACd,OAAO,CAAC,OAAO,CAAC,CAUlB;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,0BAA0B,EACpC,MAAM,EAAE;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,EACpE,SAAS,EAAE,sBAAsB,EACjC,KAAK,CAAC,EAAE,OAAO,GACd,OAAO,CAAC,OAAO,CAAC,CA6ClB;AAED,mEAAmE;AACnE,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,0BAA0B,GAAG,mBAAmB,CA6ChG;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,IAAI,mBAAmB,CAKpE"}
@@ -1,4 +1,4 @@
1
- import { mayHoldScopeStores, scopeStoresDeclaredIn, STORE_KINDS, scopeStoreObjectName, scopeStoreScriptName, signScopeStoreName, storeEraseResult, storeExportResult, storeSizeResult, StoreError, } from '@substrat-run/contracts';
1
+ import { LIST_PAGE_MAX, mayHoldScopeStores, scopeStoresDeclaredIn, STORE_DRIVERS, issueScopeStoreEnvelope, SCOPE_STORE_ENVELOPE_HEADER, SCOPE_STORE_SIGNATURE_HEADER, ScopeStoreKeyError, scopeStoreObjectName, scopeStoreScriptName, storeEraseResult, storeExportResult, storeSizeResult, StoreError, } from '@substrat-run/contracts';
2
2
  import { callReservedStoreOperation } from '@substrat-run/kernel';
3
3
  import { ControlPlaneError } from '@substrat-run/control-plane-client';
4
4
  import { storedDeployManifest } from './deploy.js';
@@ -19,60 +19,161 @@ export function declaredStoresOf(manifestJson) {
19
19
  }
20
20
  return parsed.data.scopeStores;
21
21
  }
22
+ export async function runningVersionOf(admin, actor, scope) {
23
+ if (!scope.vertical || !scope.servingRef)
24
+ return { versionId: scope.verticalVersionId };
25
+ let pointer;
26
+ try {
27
+ pointer = await admin.verticalServing(actor, scope.vertical);
28
+ }
29
+ catch {
30
+ throw new ControlPlaneError(503, `the serving pointer of '${scope.vertical}' could not be read`);
31
+ }
32
+ const servingPointer = pointer ? { ref: pointer.ref, versionId: pointer.versionId } : null;
33
+ return { versionId: servingPointer?.ref === scope.servingRef ? servingPointer.versionId : null, servingPointer };
34
+ }
35
+ /**
36
+ * Stop the router serving a scope, before its stores are wiped (#2285, L6). The router admits a
37
+ * scope only while one of its hostnames is `active`, and it reads that row on every request, so
38
+ * unbinding is immediate. Unbind is idempotent: a retry after a failed wipe finds nothing left
39
+ * to remove. A hostname set merely non-active would not hold — the issuance reconcile heals a
40
+ * platform hostname back to `active`.
41
+ */
42
+ export async function unrouteScope(admin, actor, scope) {
43
+ // Every page: an unbind deletes the row, so each read starts again from the first hostname left.
44
+ // A row still listed after its unbind would loop forever, so it refuses instead.
45
+ const unbound = new Set();
46
+ for (;;) {
47
+ const page = await admin.listHostnames(actor, { tenantId: scope.tenantId, scopeId: scope.id, limit: LIST_PAGE_MAX });
48
+ if (page.length === 0)
49
+ return;
50
+ for (const { hostname } of page) {
51
+ if (unbound.has(hostname))
52
+ throw new Error(`hostname '${hostname}' is still bound after its unbind`);
53
+ // Only while the row still names this scope: a name rebound elsewhere since the list stays bound.
54
+ await admin.unbindHostname(actor, hostname, { tenantId: scope.tenantId, scopeId: scope.id });
55
+ unbound.add(hostname);
56
+ }
57
+ }
58
+ }
22
59
  /**
23
60
  * The scope stores of the version a scope's deployment runs (#2207). A scope on its vertical's
24
61
  * serving pin runs the serving pointer's version, and any other scope its bound version; this
25
- * is the version the router reads a scope's stores from (`READ_ROUTE_SQL`). Provisioning sets the
62
+ * is the version the router reads a scope's stores from (`READ_ROUTE_SQL`), and the one a restore
63
+ * may import into (L8). The lifecycle reaches more: `scopeStoresOf`. Provisioning sets the
26
64
  * serving pin and no bound version, so reading the bound version alone answers "no store" for an
27
65
  * ordinary install whose store the router serves. A pin that names another script than the
28
66
  * pointer's is unknown, as #2242's erasure gate has it.
29
67
  *
30
- * The gate is `mayHoldScopeStores`: with no kind registered nothing can hold a store, and the
68
+ * The gate is `mayHoldScopeStores`: with no driver registered nothing can hold a store, and the
31
69
  * answer is none. Otherwise a version that cannot be named, a manifest that cannot be read, or one
32
70
  * the gate says may hold a store without naming it refuses (503), rather than let a backup, a
33
71
  * wipe, a replay or an erasure skip a store that may hold data.
72
+ *
73
+ * `running` is a resolution the caller already holds (`runningVersionOf`), so a caller that fences
74
+ * on the version reads it once and judges the stores against the same read.
34
75
  */
35
- export async function scopeStoresOf(admin, actor, scope, kinds = STORE_KINDS) {
36
- if (!scope.vertical || !mayHoldScopeStores(undefined, kinds))
76
+ export async function runningVersionStoresOf(admin, actor, scope, drivers = STORE_DRIVERS, running) {
77
+ if (!scope.vertical || !mayHoldScopeStores(undefined, drivers))
37
78
  return [];
38
- let versionId = scope.verticalVersionId;
39
- if (scope.servingRef) {
40
- const pointer = await admin.verticalServing(actor, scope.vertical).catch(() => null);
41
- versionId = pointer?.ref === scope.servingRef ? pointer.versionId : null;
42
- }
79
+ const { versionId } = running ?? await runningVersionOf(admin, actor, scope);
43
80
  const manifestJson = versionId
44
81
  ? await admin.versionManifest(actor, scope.vertical, versionId).catch(() => undefined)
45
82
  : undefined;
46
- if (!mayHoldScopeStores(manifestJson, kinds))
83
+ if (!mayHoldScopeStores(manifestJson, drivers))
47
84
  return [];
48
85
  const declared = typeof manifestJson === 'string' && scopeStoresDeclaredIn(manifestJson) ? declaredStoresOf(manifestJson) : [];
49
86
  if (declared.length > 0)
50
87
  return declared;
51
88
  throw new ControlPlaneError(503, `scope ${scope.id} may hold scope stores, and the version it runs cannot say which`);
52
89
  }
90
+ /**
91
+ * What the lifecycle reaches for a scope (#2286, L17): the running version's stores
92
+ * (`runningVersionStoresOf`, which still fails closed first), and every binding any version of its
93
+ * vertical has declared (`HostAdmin.verticalScopeStores`, read by its keys). Export, wipe, erasure
94
+ * and the meter reach `all`, so an object under a binding a later version dropped is still
95
+ * reached. A restore imports only into `running` (L8).
96
+ *
97
+ * A binding keeps its driver for the life of the vertical, since publish refuses a driver change; a
98
+ * running version whose driver disagrees with the record, or a record that cannot be read,
99
+ * refuses (503).
100
+ */
101
+ export async function scopeStoreReachOf(admin, actor, scope, drivers = STORE_DRIVERS, running) {
102
+ const current = await runningVersionStoresOf(admin, actor, scope, drivers, running);
103
+ if (!scope.vertical || !mayHoldScopeStores(undefined, drivers))
104
+ return { running: current, all: current };
105
+ let declared;
106
+ try {
107
+ declared = await admin.verticalScopeStores(actor, scope.vertical);
108
+ }
109
+ catch {
110
+ throw new ControlPlaneError(503, `the scope stores '${scope.vertical}' has declared could not be read`);
111
+ }
112
+ const all = new Map(declared.map((store) => [store.binding, store.driver]));
113
+ for (const store of current) {
114
+ const driver = all.get(store.binding);
115
+ if (driver !== undefined && driver !== store.driver) {
116
+ throw new ControlPlaneError(503, `scope store '${store.binding}' is declared as both '${driver}' and '${store.driver}'`);
117
+ }
118
+ all.set(store.binding, store.driver);
119
+ }
120
+ return { running: current, all: [...all].map(([binding, driver]) => ({ binding, driver })) };
121
+ }
122
+ /** `scopeStoreReachOf`'s `all`: every store the lifecycle reaches for a scope (#2286). */
123
+ export async function scopeStoresOf(admin, actor, scope, drivers = STORE_DRIVERS, running) {
124
+ return (await scopeStoreReachOf(admin, actor, scope, drivers, running)).all;
125
+ }
53
126
  function asControlPlane(error) {
54
127
  if (error instanceof StoreError) {
55
128
  throw new ControlPlaneError(error.storeStatus, error.message);
56
129
  }
57
130
  throw error;
58
131
  }
59
- /** Sign `objectName` and POST the reserved operation at that kind's script. */
132
+ /** Sign the envelope and POST the reserved operation at that driver's script. */
60
133
  export async function callPlatformScopeStore(dispatch, target, operation, input) {
61
- if (!dispatch.hmacKey) {
134
+ return callPlatformScopeStoreAt(dispatch, {
135
+ scriptName: scopeStoreScriptName(target.vertical, target.driver),
136
+ objectName: scopeStoreObjectName(target.tenantId, target.vertical, target.scopeId, target.binding),
137
+ }, operation, input);
138
+ }
139
+ /**
140
+ * The same call at a named script and object: the platform's canary (#2300), which no
141
+ * (vertical, scope) names. Its answer is parsed as every reserved answer is.
142
+ */
143
+ export async function callPlatformScopeStoreAt(dispatch, target, operation, input) {
144
+ if (!dispatch.platformKey) {
62
145
  throw new ControlPlaneError(503, 'this control plane holds no scope-store key');
63
146
  }
147
+ const { scriptName, objectName } = target;
64
148
  try {
65
149
  return await callReservedStoreOperation(async (request) => {
66
- const objectName = scopeStoreObjectName(target.tenantId, target.vertical, target.scopeId, target.binding);
67
- const mac = await signScopeStoreName(dispatch.hmacKey, objectName);
68
- const response = await dispatch.fetch(scopeStoreScriptName(target.vertical, target.kind), new Request('https://scope-store/invoke', {
150
+ const body = JSON.stringify({ ...request, objectName });
151
+ let issued;
152
+ try {
153
+ issued = await issueScopeStoreEnvelope({
154
+ privateKey: dispatch.platformKey,
155
+ aud: 'platform',
156
+ script: scriptName,
157
+ name: objectName,
158
+ op: request.operation,
159
+ body,
160
+ });
161
+ }
162
+ catch (error) {
163
+ if (!(error instanceof ScopeStoreKeyError))
164
+ throw error;
165
+ // Set but unusable, e.g. a raw key where PKCS8 belongs. The message never carries the key.
166
+ console.warn(`scope store call refused: STORE_PLATFORM_KEY is set but unusable (${error.message})`);
167
+ throw new ControlPlaneError(503, 'this control plane holds no usable scope-store key');
168
+ }
169
+ const response = await dispatch.fetch(scriptName, new Request('https://scope-store/invoke', {
69
170
  method: 'POST',
70
171
  headers: {
71
172
  'content-type': 'application/json',
72
- 'x-substrat-store-mac': mac,
73
- 'x-substrat-store-audience': 'platform',
173
+ [SCOPE_STORE_ENVELOPE_HEADER]: issued.header,
174
+ [SCOPE_STORE_SIGNATURE_HEADER]: issued.signature,
74
175
  },
75
- body: JSON.stringify({ ...request, objectName }),
176
+ body,
76
177
  }));
77
178
  try {
78
179
  return await response.json();
@@ -94,7 +195,7 @@ export function platformScopeStoresFor(dispatch) {
94
195
  const exported = [];
95
196
  for (const store of stores) {
96
197
  const { tables } = storeExportResult.parse(await call({ ...store, tenantId, scopeId, vertical }, 'substrat.export'));
97
- exported.push({ binding: store.binding, kind: store.kind, tables });
198
+ exported.push({ binding: store.binding, driver: store.driver, tables });
98
199
  }
99
200
  return exported;
100
201
  },
@@ -1 +1 @@
1
- {"version":3,"file":"platform-scope-stores.js","sourceRoot":"","sources":["../src/platform-scope-stores.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,UAAU,GAMX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,0BAA0B,EAAkB,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AA6DnD,gGAAgG;AAChG,MAAM,UAAU,gBAAgB,CAAC,YAA2B;IAC1D,IAAI,CAAC,YAAY;QAAE,OAAO,EAAE,CAAC;IAC7B,IAAI,GAAY,CAAC;IACjB,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,iBAAiB,CAAC,GAAG,EAAE,4CAA4C,CAAC,CAAC;IACjF,CAAC;IACD,MAAM,MAAM,GAAG,oBAAoB,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACnD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,iBAAiB,CAAC,GAAG,EAAE,4CAA4C,CAAC,CAAC;IACjF,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;AACjC,CAAC;AAED;;;;;;;;;;;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C,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;YAChD,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,8BAA8B;IAC5C,MAAM,MAAM,GAAG,KAAK,IAAoB,EAAE;QACxC,MAAM,IAAI,iBAAiB,CAAC,GAAG,EAAE,8CAA8C,CAAC,CAAC;IACnF,CAAC,CAAC;IACF,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;AACtH,CAAC"}
1
+ {"version":3,"file":"platform-scope-stores.js","sourceRoot":"","sources":["../src/platform-scope-stores.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,uBAAuB,EACvB,2BAA2B,EAC3B,4BAA4B,EAC5B,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,UAAU,GAMX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,0BAA0B,EAAkB,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AA8DnD,gGAAgG;AAChG,MAAM,UAAU,gBAAgB,CAAC,YAA2B;IAC1D,IAAI,CAAC,YAAY;QAAE,OAAO,EAAE,CAAC;IAC7B,IAAI,GAAY,CAAC;IACjB,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,iBAAiB,CAAC,GAAG,EAAE,4CAA4C,CAAC,CAAC;IACjF,CAAC;IACD,MAAM,MAAM,GAAG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