@voltro/runtime 0.87.0 → 0.88.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 (179) hide show
  1. package/CHANGELOG.md +169 -6
  2. package/THIRD-PARTY-NOTICES.md +644 -48
  3. package/dist/aggregate.js +1 -2
  4. package/dist/aggregateExtrema.js +1 -2
  5. package/dist/aggregateIvm.js +1 -2
  6. package/dist/analyticsMirror.js +1 -2
  7. package/dist/analyticsSink.js +1 -2
  8. package/dist/apiKeyUsage.js +1 -2
  9. package/dist/apiKeys.js +1 -2
  10. package/dist/apiKeysWiring.js +1 -2
  11. package/dist/apiRoleBucketSampler.js +1 -2
  12. package/dist/apiRoleWorkloadHistory.js +1 -2
  13. package/dist/apiRoleWorkloadMetrics.js +1 -2
  14. package/dist/apiRoleWorkloadStorage.js +1 -2
  15. package/dist/approvalBuiltins.js +1 -2
  16. package/dist/approvals.js +1 -2
  17. package/dist/authMiddlewareLayer.js +1 -2
  18. package/dist/bindEvent.js +1 -2
  19. package/dist/boot-refusal.d.ts +10 -0
  20. package/dist/{bootRefusal.js → boot-refusal.js} +1 -2
  21. package/dist/bootListener.js +154 -65
  22. package/dist/bootStoreCodec.js +1 -2
  23. package/dist/businessRules.js +1 -2
  24. package/dist/changeClaimsTable.js +1 -2
  25. package/dist/columnOnUpdate.js +1 -2
  26. package/dist/composeAnalytics.js +1 -2
  27. package/dist/computedQuery.js +1 -2
  28. package/dist/computedQueryCache.js +136 -78
  29. package/dist/connectionBuiltins.js +1 -2
  30. package/dist/connectionCredentials.js +1 -2
  31. package/dist/connectionState.js +1 -2
  32. package/dist/connectionVault.js +1 -2
  33. package/dist/connectionsFacade.js +1 -2
  34. package/dist/coordinatedSchedule.js +1 -2
  35. package/dist/crdtHistory.js +1 -2
  36. package/dist/crdtMerge.js +1 -2
  37. package/dist/crdtVersionsTable.js +1 -2
  38. package/dist/credentialBound.js +1 -2
  39. package/dist/crud.js +1 -2
  40. package/dist/dataStore.js +1 -2
  41. package/dist/dataloader.js +1 -2
  42. package/dist/declaredTablesGuard.js +1 -2
  43. package/dist/defineExecutor.js +1 -2
  44. package/dist/dependencyGraph.js +1 -2
  45. package/dist/devices.js +1 -2
  46. package/dist/devicesWiring.js +1 -2
  47. package/dist/dialectReplicationAdapter.js +1 -2
  48. package/dist/dispatcher.js +1 -2
  49. package/dist/effectStore.js +1 -2
  50. package/dist/engineClients.js +1 -2
  51. package/dist/eventBus.js +1 -2
  52. package/dist/eventPublish.js +1 -2
  53. package/dist/events.js +1 -2
  54. package/dist/expectation.js +1 -2
  55. package/dist/expectationEvaluator.js +2 -3
  56. package/dist/experiment.js +1 -2
  57. package/dist/experimentEvaluator.js +1 -2
  58. package/dist/externalizedTasks.js +1 -2
  59. package/dist/fieldCipher.js +1 -2
  60. package/dist/fieldKeyRegistry.js +1 -2
  61. package/dist/fieldKeyRekey.js +1 -2
  62. package/dist/fieldKeyScan.js +1 -2
  63. package/dist/fieldKeyring.js +1 -2
  64. package/dist/fingerprint.js +1 -2
  65. package/dist/finops.js +1 -2
  66. package/dist/finopsAccountant.js +1 -2
  67. package/dist/handlerBody.js +1 -2
  68. package/dist/healthProbes.js +1 -2
  69. package/dist/hotDataStore.js +1 -2
  70. package/dist/hotDataStoreSnapshot.js +1 -2
  71. package/dist/hotDataStoreTables.js +1 -2
  72. package/dist/http-range.js +1 -2
  73. package/dist/httpClientSsrf.js +1 -2
  74. package/dist/httpClientTracing.js +1 -2
  75. package/dist/httpCompression.js +1 -2
  76. package/dist/httpInputStream.js +1 -2
  77. package/dist/httpKeepAlive.js +1 -2
  78. package/dist/httpRouteMounts.js +1 -2
  79. package/dist/idempotencyStore.js +1 -2
  80. package/dist/idleDetector.js +1 -2
  81. package/dist/index.d.ts +22 -2
  82. package/dist/index.js +109 -110
  83. package/dist/insertRequiredColumns.js +1 -2
  84. package/dist/instanceMembership.js +1 -2
  85. package/dist/ivm.js +1 -2
  86. package/dist/kvDataStore.js +1 -2
  87. package/dist/kvFacade.js +1 -2
  88. package/dist/matcher.js +1 -2
  89. package/dist/memoryColumnDefaults.js +1 -2
  90. package/dist/memoryQueryJoins.js +1 -2
  91. package/dist/memorySetOperations.js +1 -2
  92. package/dist/metrics.js +1 -2
  93. package/dist/observability.js +2 -3
  94. package/dist/observedGraph.js +1 -2
  95. package/dist/originGuard.js +1 -2
  96. package/dist/outbox.js +1 -2
  97. package/dist/pluginRefRules.js +1 -2
  98. package/dist/policyGuardResolver.js +1 -2
  99. package/dist/preview.js +1 -2
  100. package/dist/projectedRows.js +1 -2
  101. package/dist/provenance.js +1 -2
  102. package/dist/rangeIndex.js +1 -2
  103. package/dist/rawReadScope.js +2 -3
  104. package/dist/reaction.js +1 -2
  105. package/dist/reactiveConfig.js +1 -2
  106. package/dist/readClassification.js +1 -2
  107. package/dist/readRecorder.js +1 -2
  108. package/dist/readScopePredicate.js +1 -2
  109. package/dist/rebac.js +1 -2
  110. package/dist/rebacInterceptor.js +1 -2
  111. package/dist/registry.js +1 -2
  112. package/dist/relevantFields.js +1 -2
  113. package/dist/replicaHealth.js +1 -2
  114. package/dist/replicaLocality.js +1 -2
  115. package/dist/replicaObservations.js +1 -2
  116. package/dist/replicaSelection.js +1 -2
  117. package/dist/replicatedDataStore.js +1 -2
  118. package/dist/requestLoader.js +1 -2
  119. package/dist/resumeCensus.js +1 -2
  120. package/dist/revalidation.js +1 -2
  121. package/dist/rowFilter.js +1 -2
  122. package/dist/rowStateBytes.js +1 -2
  123. package/dist/rpcBodyCap.js +1 -2
  124. package/dist/rpcConnections.js +1 -2
  125. package/dist/rpcDefectDiagnostics.js +1 -2
  126. package/dist/rpcServer.js +1 -2
  127. package/dist/rpcWorkloadAdmission.js +1 -2
  128. package/dist/runAsSystem.js +1 -2
  129. package/dist/rywPositionStore.js +1 -2
  130. package/dist/schedule.js +1 -2
  131. package/dist/scheduleBackfillRequests.js +1 -2
  132. package/dist/scheduleClaimsTable.js +1 -2
  133. package/dist/scheduleRunsTable.js +1 -2
  134. package/dist/scheduler.js +1 -2
  135. package/dist/schemaRegistry.js +1 -2
  136. package/dist/secretsResolver.js +1 -2
  137. package/dist/securityHeaders.js +1 -2
  138. package/dist/servePipeline.js +198 -183
  139. package/dist/serverOnlyAudit.js +1 -2
  140. package/dist/serverTracer.js +1 -2
  141. package/dist/serviceCredentials.js +1 -2
  142. package/dist/setReadScopes.js +1 -2
  143. package/dist/singleNodeOrchestrator.js +1 -2
  144. package/dist/snapshotValueCodec.js +1 -2
  145. package/dist/sourceResolution.js +1 -2
  146. package/dist/storeMiddleware.js +3 -4
  147. package/dist/storeQuery.js +1 -2
  148. package/dist/storeRead.js +1 -2
  149. package/dist/subscriber.js +1 -2
  150. package/dist/subscriptionOutbox.js +1 -2
  151. package/dist/subscriptionRegistry.js +1 -2
  152. package/dist/subscriptionResume.js +1 -2
  153. package/dist/subscriptionSocketMetrics.js +1 -2
  154. package/dist/systemSubject.js +1 -2
  155. package/dist/tenantScope.js +1 -2
  156. package/dist/tenantSelection.js +1 -2
  157. package/dist/timeline.js +1 -2
  158. package/dist/traceContext.js +1 -2
  159. package/dist/traceSink.js +1 -2
  160. package/dist/traceSpansTable.js +1 -2
  161. package/dist/traceparent.js +1 -2
  162. package/dist/transactionSubject.js +1 -2
  163. package/dist/trustedProxy.js +2 -3
  164. package/dist/undo.js +1 -2
  165. package/dist/undoBuiltins.js +1 -2
  166. package/dist/undoCapture.js +1 -2
  167. package/dist/undoLogTable.js +1 -2
  168. package/dist/upsertBinding.js +1 -2
  169. package/dist/wakeOrchestrator.js +1 -2
  170. package/dist/wakeRegistry.js +1 -2
  171. package/dist/wakeRouter.js +1 -2
  172. package/dist/wakeSupervisor.js +1 -2
  173. package/dist/wakeupsTable.js +1 -2
  174. package/dist/webSocketGatewayRuntime.js +1 -2
  175. package/dist/webhookVerification.js +1 -2
  176. package/dist/wireColumnStrip.js +1 -2
  177. package/dist/workflowReadBuiltins.js +1 -2
  178. package/dist/workflowRuntime.js +1 -2
  179. package/package.json +26 -19
@@ -5,39 +5,39 @@ import { buildSubjectKey as i } from "./rywPositionStore.js";
5
5
  import { runWithRoutingContext as a } from "./replicatedDataStore.js";
6
6
  import { Effect as o, Option as s, Schema as c } from "effect";
7
7
  import { createHash as l } from "node:crypto";
8
- import { parseRevalidateMs as u, schemaShape as d, shapeDigest as f } from "@voltro/protocol";
9
- import { AsyncLocalStorage as p } from "node:async_hooks";
10
- //#region src/computedQueryCache.ts
11
- var m = Symbol.for("@voltro/runtime:computed-query-cache-capture"), h = () => {
12
- let e = globalThis, t = e[m];
8
+ import { Unauthenticated as u, currentSubjectAuthority as d, effectiveScopes as f, parseRevalidateMs as p, schemaShape as m, setEffectiveScopes as h, shapeDigest as g } from "@voltro/protocol";
9
+ import { AsyncLocalStorage as _ } from "node:async_hooks";
10
+ // src/computedQueryCache.ts
11
+ var v = Symbol.for("@voltro/runtime:computed-query-cache-capture"), y = () => {
12
+ let e = globalThis, t = e[v];
13
13
  return t === void 0 && (t = {
14
- storage: new p(),
14
+ storage: new _(),
15
15
  installed: !1
16
- }, e[m] = t), t;
17
- }, g = () => {
18
- h().installed = !0;
19
- }, _ = () => h().installed, v = () => {
20
- h().installed = !1;
21
- }, y = (e) => {
22
- let t = h().storage.getStore();
16
+ }, e[v] = t), t;
17
+ }, b = () => {
18
+ y().installed = !0;
19
+ }, x = () => y().installed, S = () => {
20
+ y().installed = !1;
21
+ }, C = (e) => {
22
+ let t = y().storage.getStore();
23
23
  if (t === void 0) return;
24
24
  let { composed: n, restricting: i } = r(e, !1);
25
25
  for (let e of n) t.tables.add(e);
26
26
  for (let e of i) t.tables.add(e);
27
- }, b = Symbol.for("@voltro/runtime:query-dependencies"), x = () => {
28
- let e = globalThis, t = e[b];
29
- return t === void 0 && (t = { storage: new p() }, e[b] = t), t;
30
- }, S = () => {
31
- x().storage.enterWith(/* @__PURE__ */ new Set());
32
- }, C = () => [...x().storage.getStore() ?? []], w = (e) => {
33
- x().storage.getStore()?.add(e), h().storage.getStore()?.tables.add(e);
34
- }, T = (e) => {
35
- h().storage.getStore()?.volatile.add(e);
36
- }, E = (e, t) => h().storage.run(e, t), D = () => ({
27
+ }, w = Symbol.for("@voltro/runtime:query-dependencies"), T = () => {
28
+ let e = globalThis, t = e[w];
29
+ return t === void 0 && (t = { storage: new _() }, e[w] = t), t;
30
+ }, E = () => {
31
+ T().storage.enterWith(/* @__PURE__ */ new Set());
32
+ }, D = () => [...T().storage.getStore() ?? []], O = (e) => {
33
+ T().storage.getStore()?.add(e), y().storage.getStore()?.tables.add(e);
34
+ }, k = (e) => {
35
+ y().storage.getStore()?.volatile.add(e);
36
+ }, A = (e, t) => y().storage.run(e, t), j = () => ({
37
37
  tables: /* @__PURE__ */ new Set(),
38
38
  caller: /* @__PURE__ */ new Set(),
39
39
  volatile: /* @__PURE__ */ new Set()
40
- }), O = /* @__PURE__ */ new Set([
40
+ }), M = /* @__PURE__ */ new Set([
41
41
  "connections",
42
42
  "apis",
43
43
  "kv",
@@ -48,27 +48,70 @@ var m = Symbol.for("@voltro/runtime:computed-query-cache-capture"), h = () => {
48
48
  "outbox",
49
49
  "transaction",
50
50
  "storeForTenant"
51
- ]), k = /* @__PURE__ */ new Set(["access", "connectionState"]), A = (e, t, n) => new Proxy(e, { get(e, r) {
51
+ ]), N = /* @__PURE__ */ new Set(["access", "connectionState"]), P = (e, t, n) => new Proxy(e, { get(e, r) {
52
52
  return typeof r == "string" && !t.has(r) && n.caller.add(`subject.${r}`), Reflect.get(e, r, e);
53
- } }), j = (e, t, n) => {
54
- let r = e.request, i = r === void 0 ? void 0 : new Proxy(r, { get(e, r) {
55
- return r === "subject" ? t : ((r === "clientId" || r === "cookieHeader") && n.caller.add(`request.${r}`), Reflect.get(e, r, e));
53
+ } }), F = (e, t, n, r = !1) => {
54
+ let i = e.request, a = i === void 0 ? void 0 : new Proxy(i, { get(e, r) {
55
+ return r === "subject" ? t : (typeof r == "string" && n.caller.add(`request.${r}`), Reflect.get(e, r, e));
56
56
  } });
57
57
  return new Proxy(e, { get(e, t) {
58
- if (t === "request" && i !== void 0) return i;
59
- typeof t == "string" && (O.has(t) && n.volatile.add(`ctx.${t}`), k.has(t) && n.caller.add(`ctx.${t}`));
60
- let r = Reflect.get(e, t, e);
61
- return typeof r == "function" ? r.bind(e) : r;
58
+ if (t === "request" && a !== void 0) return a;
59
+ typeof t == "string" && (M.has(t) && n.volatile.add(`ctx.${t}`), N.has(t) && !(r && t === "access") && n.caller.add(`ctx.${t}`));
60
+ let i = Reflect.get(e, t, e);
61
+ return typeof i == "function" ? i.bind(e) : i;
62
62
  } });
63
- }, M = /* @__PURE__ */ new WeakMap(), N = (e) => {
64
- let t = M.get(e);
65
- return t === void 0 && (t = c.toCodecJson(e), M.set(e, t)), t;
66
- }, P = /* @__PURE__ */ new WeakMap(), F = (e) => {
63
+ }, I = (e) => {
64
+ let t = /* @__PURE__ */ new Set(), n = (e, r) => {
65
+ if (r > 64) throw Error("subject claims too deep");
66
+ if (e === void 0) return ["undefined"];
67
+ if (e === null || typeof e == "string" || typeof e == "boolean") return e;
68
+ if (typeof e == "number" && Number.isFinite(e)) return ["number", Object.is(e, -0) ? "-0" : e];
69
+ if (typeof e != "object" || !e || t.has(e)) throw Error("non-data subject claim");
70
+ let i = Object.getPrototypeOf(e);
71
+ if (!Array.isArray(e) && i !== Object.prototype && i !== null) throw Error("non-data subject claim");
72
+ if (Object.getOwnPropertySymbols(e).length > 0) throw Error("symbol subject claim");
73
+ t.add(e);
74
+ try {
75
+ if (Array.isArray(e)) {
76
+ if (i !== Array.prototype || Object.keys(e).length !== e.length || Object.getOwnPropertyNames(e).length !== e.length + 1) throw Error("non-data subject array");
77
+ return ["array", Array.from({ length: e.length }, (t, i) => {
78
+ let a = Object.getOwnPropertyDescriptor(e, String(i));
79
+ if (a === void 0 || !("value" in a)) throw Error("non-data subject array");
80
+ return n(a.value, r + 1);
81
+ })];
82
+ }
83
+ if (Object.getOwnPropertyNames(e).length !== Object.keys(e).length) throw Error("hidden subject claim");
84
+ return ["object", Object.keys(e).sort().map((t) => {
85
+ let i = Object.getOwnPropertyDescriptor(e, t);
86
+ if (i === void 0 || !("value" in i)) throw Error("accessor subject claim");
87
+ return [t, n(i.value, r + 1)];
88
+ })];
89
+ } finally {
90
+ t.delete(e);
91
+ }
92
+ };
93
+ try {
94
+ n(e, 0);
95
+ let t = e, r = "scopes" in t && t.scopes !== void 0 ? { scopes: [...new Set(t.scopes)].sort() } : {}, i = n({
96
+ subject: {
97
+ ...e,
98
+ ...r
99
+ },
100
+ effective: [...new Set(f(t))].sort()
101
+ }, 0);
102
+ return l("sha256").update(JSON.stringify(i)).digest("base64url");
103
+ } catch {
104
+ return;
105
+ }
106
+ }, L = /* @__PURE__ */ new WeakMap(), R = (e) => {
107
+ let t = L.get(e);
108
+ return t === void 0 && (t = c.toCodecJson(e), L.set(e, t)), t;
109
+ }, z = /* @__PURE__ */ new WeakMap(), B = (e) => {
67
110
  if (e === void 0) return "none";
68
- let t = P.get(e);
69
- return t === void 0 && (t = f(d(e.ast)), P.set(e, t)), t;
70
- }, I = (t) => {
71
- let n = t.input === void 0 ? s.some(t.decodedInput) : c.encodeUnknownOption(N(t.input))(t.decodedInput);
111
+ let t = z.get(e);
112
+ return t === void 0 && (t = g(m(e.ast)), z.set(e, t)), t;
113
+ }, V = (t) => {
114
+ let n = t.input === void 0 ? s.some(t.decodedInput) : c.encodeUnknownOption(R(t.input))(t.decodedInput);
72
115
  if (s.isNone(n)) return { bypass: "input-not-encodable" };
73
116
  let r;
74
117
  if (t.scope === "global") r = "g";
@@ -77,13 +120,15 @@ var m = Symbol.for("@voltro/runtime:computed-query-cache-capture"), h = () => {
77
120
  r = `t:${t.subject.tenantId}`;
78
121
  } else {
79
122
  if (t.subject.type === "anonymous" || t.subject.id == null || t.subject.id === "") return { bypass: "anonymous-subject" };
80
- r = `s:${t.subject.id}`;
123
+ let e = I(t.subject);
124
+ if (e === void 0) return { bypass: "subject-not-encodable" };
125
+ r = `s:${e}`;
81
126
  }
82
127
  let i = t.rowFilter === void 0 ? [] : [...t.declaredSources].sort().map((n) => [n, e(t.rowFilter(n) ?? null)]), a;
83
128
  try {
84
129
  a = JSON.stringify([
85
130
  t.codeIdentity,
86
- F(t.output),
131
+ B(t.output),
87
132
  e(n.value),
88
133
  i
89
134
  ]);
@@ -92,15 +137,11 @@ var m = Symbol.for("@voltro/runtime:computed-query-cache-capture"), h = () => {
92
137
  }
93
138
  let o = l("sha256").update(a).digest("base64url");
94
139
  return { key: `cq:${t.name}:${o}:${r}` };
95
- }, L = (e) => {
140
+ }, H = (e) => {
96
141
  if (e.aborted) return { refused: {
97
142
  reason: "aborted",
98
143
  detail: []
99
144
  } };
100
- if (e.cacheScope !== "subject" && e.scope.caller.size > 0) return { refused: {
101
- reason: "caller",
102
- detail: [...e.scope.caller].sort()
103
- } };
104
145
  if (!e.volatileAllowed && e.scope.volatile.size > 0) return { refused: {
105
146
  reason: "volatile",
106
147
  detail: [...e.scope.volatile].sort()
@@ -120,7 +161,7 @@ var m = Symbol.for("@voltro/runtime:computed-query-cache-capture"), h = () => {
120
161
  detail: r
121
162
  } };
122
163
  }
123
- let r = e.output === void 0 ? s.some(e.value) : c.encodeUnknownOption(N(e.output))(e.value);
164
+ let r = e.output === void 0 ? s.some(e.value) : c.encodeUnknownOption(R(e.output))(e.value);
124
165
  if (s.isNone(r)) return { refused: {
125
166
  reason: "output-not-encodable",
126
167
  detail: []
@@ -134,17 +175,20 @@ var m = Symbol.for("@voltro/runtime:computed-query-cache-capture"), h = () => {
134
175
  detail: []
135
176
  } };
136
177
  }
137
- return i > e.maxEntryBytes ? { refused: {
178
+ return e.scope.caller.size > 0 ? { refused: {
179
+ reason: "caller",
180
+ detail: [...e.scope.caller].sort()
181
+ } } : i > e.maxEntryBytes ? { refused: {
138
182
  reason: "oversized",
139
183
  detail: [`${i} bytes`]
140
184
  } } : { store: {
141
185
  stored: r.value,
142
186
  tags: [...n].sort()
143
187
  } };
144
- }, R = (e, t) => e === void 0 ? s.some(t) : c.decodeUnknownOption(N(e))(t), z = (e, t) => {
188
+ }, U = (e, t) => e === void 0 ? s.some(t) : c.decodeUnknownOption(R(e))(t), W = (e, t) => {
145
189
  let n = t.detail.join(", ");
146
190
  switch (t.reason) {
147
- case "caller": return `${e}: \`cache:\` result NOT kept — the handler read ${n}, which its cache scope does not key on, so the value is specific to this caller. Use \`scope: 'subject'\`, or derive the result without reading the caller (declare access in \`guards:\`; a membership the handler READS through ctx.store is fine — it becomes a dependency).`;
191
+ case "caller": return `${e}: \`cache:\` result NOT kept — the handler read ${n}, which its cache scope does not key on. Use \`scope: 'subject'\` for subject claims and effective scopes, or declare access in \`guards:\`. Connection state, client ids and cookie headers are never keyed; keep those reads outside cached queries. Membership rows read through ctx.store become invalidation dependencies.`;
148
192
  case "volatile": return `${e}: \`cache:\` result NOT kept — the handler used ${n}, which no table write invalidates. Declare \`cache: { …, volatile: true }\` to accept the ttl as the bound on that staleness, or drop \`cache:\`.`;
149
193
  case "undeclared-raw-read": return `${e}: \`cache:\` result NOT kept — a raw read declares no tables, so no write could invalidate it: ${n}. Declare them: ctx.store.raw(fragment, { dependsOn: ['…'] }).`;
150
194
  case "row-filter-outside-source": return `${e}: \`cache:\` result NOT kept — the registered row filter restricts ${n}, which the query reads but does not declare in \`source:\`. Add it to \`source:\` so the entry is keyed by what this caller may see there.`;
@@ -152,20 +196,35 @@ var m = Symbol.for("@voltro/runtime:computed-query-cache-capture"), h = () => {
152
196
  case "oversized": return `${e}: \`cache:\` result NOT kept — ${n} exceeds the cache's maxEntryBytes.`;
153
197
  case "aborted": return `${e}: \`cache:\` result NOT kept — the subscription closed while it was computed.`;
154
198
  }
155
- }, B = (e) => {
156
- let r = o.suspend(() => {
157
- let r = D(), s = new Set(e.policy.scope === "tenant" ? ["tenantId"] : []), c = e.policy.scope === "subject" ? e.subject : A(e.subject, s, r), l = j(e.ctx, c, r), u = [], d = e.subject.id ?? "anonymous", f = {
158
- subjectKey: i(d, void 0),
199
+ }, G = () => new u({ reason: "request authority changed while reading a cached query; authenticate again" }), K = (e) => {
200
+ let r = I(e.subject), s = o.suspend(() => {
201
+ let s = j(), c = e.policy.scope === "subject", l = new Set(c ? [
202
+ ...Object.keys(e.subject),
203
+ "id",
204
+ "type",
205
+ "tenantId",
206
+ "scopes",
207
+ "metadata",
208
+ "kind",
209
+ "service",
210
+ "auditActorId"
211
+ ] : e.policy.scope === "tenant" ? ["tenantId"] : []), u = P(e.subject, l, s), p = f(e.subject);
212
+ h(u, c ? p : new Proxy(p, { get(e, t, n) {
213
+ return s.caller.add("subject.scopes"), Reflect.get(e, t, n);
214
+ } }));
215
+ let m = F(e.ctx, u, s, c), g = [], _ = e.subject.id ?? "anonymous", v = {
216
+ subjectKey: i(_, void 0),
159
217
  forcePrimary: !0
160
218
  };
161
219
  return o.tryPromise({
162
- try: () => E(r, () => a(f, () => n(async () => {
163
- let n = await e.execute(l, c);
164
- return u = t(), n;
220
+ try: () => A(s, () => a(v, () => n(async () => {
221
+ let n = await e.execute(m, u);
222
+ if (r !== I(d(e.subject))) throw G();
223
+ return g = t(), n;
165
224
  }))),
166
225
  catch: (e) => e
167
226
  }).pipe(o.map((t) => {
168
- let n = new Set(e.sources), i = (e) => [...new Set(e)].filter((e) => !n.has(e)).sort();
227
+ let n = new Set(e.sources), r = (e) => [...new Set(e)].filter((e) => !n.has(e)).sort();
169
228
  if (e.isDescriptor(t)) return e.onDescriptor(), {
170
229
  value: {
171
230
  value: t,
@@ -173,11 +232,11 @@ var m = Symbol.for("@voltro/runtime:computed-query-cache-capture"), h = () => {
173
232
  },
174
233
  notApplicable: !0
175
234
  };
176
- let a = L({
177
- scope: r,
235
+ let i = H({
236
+ scope: s,
178
237
  cacheScope: e.policy.scope,
179
238
  volatileAllowed: e.policy.volatile,
180
- rawReads: u,
239
+ rawReads: g,
181
240
  declaredSources: e.sources,
182
241
  rowFilter: e.rowFilter,
183
242
  output: e.output,
@@ -185,47 +244,46 @@ var m = Symbol.for("@voltro/runtime:computed-query-cache-capture"), h = () => {
185
244
  maxEntryBytes: e.cache.maxEntryBytes,
186
245
  aborted: e.signal?.aborted === !0
187
246
  });
188
- if ("refused" in a) return a.refused.reason !== "aborted" && e.cache.notice(e.name, a.refused.reason, z(e.name, a.refused)), { value: {
247
+ if ("refused" in i) return i.refused.reason !== "aborted" && e.cache.notice(e.name, i.refused.reason, W(e.name, i.refused)), { value: {
189
248
  value: t,
190
- dependencies: i(r.tables)
249
+ dependencies: r(s.tables)
191
250
  } };
192
- let o = i(a.store.tags);
251
+ let a = r(i.store.tags);
193
252
  return {
194
253
  value: {
195
254
  value: t,
196
- dependencies: o
255
+ dependencies: a
197
256
  },
198
257
  store: {
199
258
  stored: {
200
- v: a.store.stored,
201
- d: o
259
+ v: i.store.stored,
260
+ d: a
202
261
  },
203
- tags: a.store.tags
262
+ tags: i.store.tags
204
263
  }
205
264
  };
206
- }));
265
+ }), o.flatMap((t) => r === I(d(e.subject)) ? o.succeed(t) : o.fail(G())));
207
266
  });
208
267
  return e.cache.wrapDynamic(e.key, {
209
268
  ttlMs: e.policy.ttlMs,
210
269
  ...e.policy.swrMs === void 0 ? {} : { swrMs: e.policy.swrMs },
211
270
  ...e.cache.leaseMs === void 0 ? {} : { leaseMs: e.cache.leaseMs },
212
271
  label: e.name
213
- }, r, (t) => o.succeed(V(e.output, t))).pipe(o.map(({ value: e }) => e));
214
- }, V = (e, t) => {
272
+ }, s, (t) => o.succeed(q(e.output, t))).pipe(o.map(({ value: e }) => e));
273
+ }, q = (e, t) => {
215
274
  if (typeof t != "object" || !t || !("v" in t) || !("d" in t)) return s.none();
216
275
  let n = t;
217
- return !Array.isArray(n.d) || !n.d.every((e) => typeof e == "string") ? s.none() : s.map(R(e, n.v), (e) => ({
276
+ return !Array.isArray(n.d) || !n.d.every((e) => typeof e == "string") ? s.none() : s.map(U(e, n.v), (e) => ({
218
277
  value: e,
219
278
  dependencies: n.d
220
279
  }));
221
- }, H = (e) => {
222
- let t = u(e.ttl);
280
+ }, J = (e) => {
281
+ let t = p(e.ttl);
223
282
  if (t !== null) return {
224
283
  ttlMs: t,
225
- swrMs: e.swr === void 0 ? void 0 : u(e.swr) ?? void 0,
284
+ swrMs: e.swr === void 0 ? void 0 : p(e.swr) ?? void 0,
226
285
  scope: e.scope,
227
286
  volatile: e.volatile === !0
228
287
  };
229
288
  };
230
- //#endregion
231
- export { B as cachedComputedCall, I as computedCacheKey, _ as computedQueryCacheCaptureInstalled, C as currentQueryDependencies, L as decideComputedStore, R as decodeComputedStored, z as describeComputedRefusal, S as enterQueryDependencies, g as installComputedQueryCacheCapture, D as newComputedCaptureScope, y as noteCacheRead, T as noteCacheVolatile, w as noteDependency, j as observedContext, A as observedSubject, H as queryCachePolicy, v as resetComputedQueryCacheCaptureForTests, E as runWithComputedCapture };
289
+ export { K as cachedComputedCall, G as computedAuthorityRefusal, V as computedCacheKey, x as computedQueryCacheCaptureInstalled, I as computedSubjectIdentity, D as currentQueryDependencies, H as decideComputedStore, U as decodeComputedStored, W as describeComputedRefusal, E as enterQueryDependencies, b as installComputedQueryCacheCapture, j as newComputedCaptureScope, C as noteCacheRead, k as noteCacheVolatile, O as noteDependency, F as observedContext, P as observedSubject, J as queryCachePolicy, S as resetComputedQueryCacheCaptureForTests, A as runWithComputedCapture };
@@ -1,6 +1,6 @@
1
1
  import { beginOAuthConnect as e, forgetCredential as t, listConnectionStates as n, storeCredential as r } from "./connectionVault.js";
2
2
  import { ConnectionHandshakeFailed as i, ConnectionKindMismatch as a, ConnectionNotDeclared as o, ConnectionSubjectRequired as s } from "@voltro/protocol";
3
- //#region src/connectionBuiltins.ts
3
+ // src/connectionBuiltins.ts
4
4
  var c = (e, t) => {
5
5
  let n = e.request?.subject?.id ?? null;
6
6
  if (n === null || n === "") throw new s({ connectionId: t });
@@ -77,5 +77,4 @@ var c = (e, t) => {
77
77
  let i = c(r, n.connectionId);
78
78
  return { ok: await t(r.store, n.connectionId, i) };
79
79
  };
80
- //#endregion
81
80
  export { p as makeDisconnectConnectionExecutor, u as makeListConnectionsExecutor, d as makeStartConnectionExecutor, f as makeSubmitTokenExecutor };
@@ -1,4 +1,4 @@
1
- //#region src/connectionCredentials.ts
1
+ // src/connectionCredentials.ts
2
2
  var e = 36e5, t = Symbol.for("@voltro/runtime/connectionCredentials"), n = globalThis, r = n[t] ??= {
3
3
  overrides: /* @__PURE__ */ new Map(),
4
4
  credentialExpiry: /* @__PURE__ */ new Map(),
@@ -62,5 +62,4 @@ var m = (e, t) => {
62
62
  }, g = (e) => o.get(e)?.size ?? 0, _ = () => {
63
63
  i.clear(), a.clear(), o.clear();
64
64
  };
65
- //#endregion
66
65
  export { g as _connectionStreamCount, _ as _resetConnectionCredentialsForTest, p as applyConnectionCredential, l as bindConnectionCredential, u as getConnectionCredential, c as getCredentialExpiry, h as interruptConnectionStreams, f as mergeCookieHeader, s as recordCredentialExpiry, m as registerConnectionStream, d as unbindConnection };
@@ -1,4 +1,4 @@
1
- //#region src/connectionState.ts
1
+ // src/connectionState.ts
2
2
  var e = Symbol.for("@voltro/runtime/connectionState"), t = globalThis, n = t[e] ??= /* @__PURE__ */ new WeakMap(), r = (e, t) => {
3
3
  let r = n.get(e);
4
4
  if (r === void 0 && !e.signal.aborted) {
@@ -30,5 +30,4 @@ var e = Symbol.for("@voltro/runtime/connectionState"), t = globalThis, n = t[e]
30
30
  })
31
31
  };
32
32
  };
33
- //#endregion
34
33
  export { r as makeConnectionState };
@@ -2,7 +2,7 @@ import { decryptField as e, encryptField as t, getFieldCipher as n } from "./fie
2
2
  import { and as r, eq as i, fieldBinding as a, generateId as o, id as s, json as c, lte as l, table as u, text as d, timestamp as f } from "@voltro/database";
3
3
  import { ConnectionHandshakeFailed as p } from "@voltro/protocol";
4
4
  import { createLogger as m } from "@voltro/logger";
5
- //#region src/connectionVault.ts
5
+ // src/connectionVault.ts
6
6
  var h = m({ scope: "voltro:connections" }), g = "_voltro_connections", _ = {
7
7
  kind: "typeid",
8
8
  prefix: "conn"
@@ -406,5 +406,4 @@ var h = m({ scope: "voltro:connections" }), g = "_voltro_connections", _ = {
406
406
  for (let t of n) await e.delete("_voltro_connection_grants", t.id) && r++;
407
407
  return r;
408
408
  };
409
- //#endregion
410
409
  export { g as CONNECTIONS_TABLE, y as CONNECTION_GRANTS_TABLE, z as ConnectionNotConnected, L as DEFAULT_REFRESH_SKEW_MS, X as GRANT_TTL_MS, R as REFRESH_LEASE_MS, b as _voltroConnectionGrantsTable, v as _voltroConnectionsTable, C as assertConnectionCipherConfigured, ae as beginOAuthConnect, U as clearConnectionRefreshFlights, oe as completeOAuthConnect, Z as connectionCallbackPath, S as connectionLabel, ne as defineConnection, F as exchangeAuthorizationCode, j as forgetCredential, M as listConnectionStates, w as makeConnectionRegistry, x as oauthCredentialValue, O as projectConnectionState, I as refreshAccessToken, K as resolveConnection, $ as resolveRedirectUri, Q as sanitizeRedirectTo, A as storeCredential, se as sweepExpiredGrants };
@@ -1,6 +1,6 @@
1
1
  import { noteCacheVolatile as e } from "./computedQueryCache.js";
2
2
  import { ConnectionNotConnected as t, listConnectionStates as n, resolveConnection as r } from "./connectionVault.js";
3
- //#region src/connectionsFacade.ts
3
+ // src/connectionsFacade.ts
4
4
  var i, a = (e) => {
5
5
  i = e;
6
6
  }, o = () => i, s = (e, t) => {
@@ -52,5 +52,4 @@ var i, a = (e) => {
52
52
  })) : n(i.store, i.registry, a)
53
53
  };
54
54
  };
55
- //#endregion
56
55
  export { o as getConnectionResolver, c as makeConnectionResolver, l as makeConnectionsFacade, s as resolveConnectionForSubject, a as setConnectionResolver };
@@ -1,5 +1,5 @@
1
1
  import { cronForInterval as e, externalizationRefusal as t, registerExternalizedTask as n } from "./externalizedTasks.js";
2
- //#region src/coordinatedSchedule.ts
2
+ // src/coordinatedSchedule.ts
3
3
  var r = (e) => {
4
4
  if (e === void 0) return null;
5
5
  let t = e.nextDueInMs;
@@ -141,5 +141,4 @@ var r = (e) => {
141
141
  ...e.externalizeTask === void 0 ? {} : { externalize: e.externalizeTask(t) },
142
142
  ...i?.disarmWhenIdle === void 0 ? {} : { disarmWhenIdle: i.disarmWhenIdle }
143
143
  });
144
- //#endregion
145
144
  export { o as DEFAULT_MAX_IDLE_INTERVAL_MS, a as inspectCoordinatedSchedule, u as makeCoordinatedScheduler, l as nextDelay, s as readPollCeilingMs, c as scheduleCoordinated };
@@ -3,7 +3,7 @@ import { CRDT_VERSIONS_TABLE as o } from "./crdtVersionsTable.js";
3
3
  import { and as s, eq as c } from "@voltro/database";
4
4
  import { ValidationError as l } from "@voltro/protocol";
5
5
  import { crdtSchemaVersionOf as u, decodeSealedLog as d, defaultCrdtBackend as f, emptyCrdtState as p, latestCrdtSchemaVersion as m, sealedLogEpoch as h } from "@voltro/local-first";
6
- //#region src/crdtHistory.ts
6
+ // src/crdtHistory.ts
7
7
  var g = (e, t, n, r) => e.query({
8
8
  table: t,
9
9
  predicate: n,
@@ -134,5 +134,4 @@ var g = (e, t, n, r) => e.query({
134
134
  migrated: o
135
135
  };
136
136
  };
137
- //#endregion
138
137
  export { T as crdtCellStats, S as listCrdtVersions, E as migrateCrdtColumn, w as prepareSealedCrdtRestore, C as restoreCrdtVersion, x as snapshotCrdt };
package/dist/crdtMerge.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ValidationError as e } from "@voltro/protocol";
2
2
  import { applyCrdtMigrations as t, applySealedFrame as n, defaultCrdtBackend as r, emptyCrdtState as i, mergeCrdtStates as a, setDefaultCrdtBackend as o } from "@voltro/local-first";
3
- //#region src/crdtMerge.ts
3
+ // src/crdtMerge.ts
4
4
  var s = 524288, c = Symbol.for("@voltro/runtime:crdt-compact-max-bytes"), l = (e) => {
5
5
  let t = globalThis;
6
6
  t[c] = e;
@@ -175,5 +175,4 @@ var s = 524288, c = Symbol.for("@voltro/runtime:crdt-compact-max-bytes"), l = (e
175
175
  }, k = (e) => {
176
176
  o(e);
177
177
  }, A = (e, t) => v().migrations?.[e]?.[t] ?? [];
178
- //#endregion
179
178
  export { s as DEFAULT_CRDT_COMPACT_MAX_BYTES, m as DEFAULT_CRDT_MAX_DOCUMENT_BYTES, p as DEFAULT_CRDT_MAX_UPDATE_BYTES, h as DEFAULT_CRDT_REBASE_MAX_BYTES, O as applySealedWrite, C as assertCrdtUpdateAdmissible, u as crdtCompactMaxBytes, f as crdtFoldCell, d as crdtIncrementalCell, x as crdtMaxDocumentBytes, b as crdtMaxUpdateBytes, A as crdtMigrationsFor, S as crdtRebaseMaxBytes, D as describeCrdtState, T as mergeCrdtColumnsIntoPatch, E as patchTouchesCrdt, _ as setCrdtAdmission, k as setCrdtBackend, l as setCrdtCompactMaxBytes };
@@ -1,5 +1,5 @@
1
1
  import { bytes as e, id as t, table as n, text as r, timestamp as i } from "@voltro/database";
2
- //#region src/crdtVersionsTable.ts
2
+ // src/crdtVersionsTable.ts
3
3
  var a = "_voltro_crdt_versions", o = n(a, {
4
4
  id: t({ prefix: "crdtv" }),
5
5
  tableName: r(),
@@ -21,5 +21,4 @@ var a = "_voltro_crdt_versions", o = n(a, {
21
21
  "columnName",
22
22
  "createdAt"
23
23
  ]);
24
- //#endregion
25
24
  export { a as CRDT_VERSIONS_TABLE, o as _voltroCrdtVersionsTable };
@@ -1,5 +1,5 @@
1
1
  import { Duration as e, Effect as t, Ref as n, Stream as r } from "effect";
2
- //#region src/credentialBound.ts
2
+ // src/credentialBound.ts
3
3
  var i = (i, a, o, s) => {
4
4
  if (a === void 0) return i;
5
5
  let c = a * 1e3 - Date.now();
@@ -8,5 +8,4 @@ var i = (i, a, o, s) => {
8
8
  return r.concat(r.interruptWhen(i, o), r.unwrap(n.get(a).pipe(t.map((e) => e ? s : r.empty))));
9
9
  }));
10
10
  };
11
- //#endregion
12
11
  export { i as boundByCredential };
package/dist/crud.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { getTable as e, serverOnlyColumns as t } from "@voltro/database";
2
2
  import { ServerOnlyColumnWrite as n } from "@voltro/protocol";
3
- //#region src/crud.ts
3
+ // src/crud.ts
4
4
  var r = (e, t) => {
5
5
  if (t === void 0 || t.length === 0) return e;
6
6
  let n = { ...e };
@@ -68,5 +68,4 @@ var r = (e, t) => {
68
68
  count: (e, t = {}) => async (n, r) => s(r.store.select(e), t.filter, t.scope, n ?? {}, r).count(),
69
69
  remove: (e) => async (t, n) => ({ deleted: await n.store.delete(e, t.id) })
70
70
  };
71
- //#endregion
72
71
  export { u as crud, o as redactColumns };
package/dist/dataStore.js CHANGED
@@ -4,7 +4,7 @@ import { applyMemoryColumnDefaults as i } from "./memoryColumnDefaults.js";
4
4
  import { Effect as a } from "effect";
5
5
  import { applyJsonPatch as o, attachEagerLoads as s, attributionFields as c, collectSubqueries as l, compareDecimal as u, emitCommittedChanges as d, evaluatePredicate as f, externalChangeEvent as p, getTable as m, hasEagerLoads as h, isTableReactive as g, jsonPatchAssignments as _, preparePredicate as v, raiseChangeListenerCeiling as y, requireTable as b, rowKeyColumns as x, settleTransactionExit as S, stampGeneratedId as C, transactionRetrySchedule as w, upsertUpdatePatch as T, upsertUpdateValues as E } from "@voltro/database";
6
6
  import { EventEmitter as D } from "node:events";
7
- //#region src/dataStore.ts
7
+ // src/dataStore.ts
8
8
  var O = (e, t, n, r = m(n)?.fields) => t.length === 0 ? e : [...e].sort((e, n) => {
9
9
  for (let i of t) {
10
10
  let t = e[i.column], a = n[i.column];
@@ -708,5 +708,4 @@ var O = (e, t, n, r = m(n)?.fields) => t.length === 0 ? e : [...e].sort((e, n) =
708
708
  this.settled || (this.settled = !0, this.overlay.clear(), this.tombstones.clear(), this.events.length = 0);
709
709
  }
710
710
  };
711
- //#endregion
712
711
  export { q as InMemoryDataStore };
@@ -1,5 +1,5 @@
1
1
  import { inSet as e } from "@voltro/database";
2
- //#region src/dataloader.ts
2
+ // src/dataloader.ts
3
3
  var t = () => {
4
4
  let e, t;
5
5
  return {
@@ -57,5 +57,4 @@ var t = () => {
57
57
  loadMany: (e, t) => l(e, t)
58
58
  };
59
59
  };
60
- //#endregion
61
60
  export { r as makeDataLoader };
@@ -1,4 +1,4 @@
1
- //#region src/declaredTablesGuard.ts
1
+ // src/declaredTablesGuard.ts
2
2
  var e = class extends Error {
3
3
  table;
4
4
  operation;
@@ -45,5 +45,4 @@ var e = class extends Error {
45
45
  ...n.storedTables === void 0 ? {} : { storedTables: () => n.storedTables() }
46
46
  };
47
47
  };
48
- //#endregion
49
48
  export { e as UndeclaredTableAccess, t as guardUndeclaredTables };
@@ -1,4 +1,3 @@
1
- //#region src/defineExecutor.ts
1
+ // src/defineExecutor.ts
2
2
  var e = (e, t) => t;
3
- //#endregion
4
3
  export { e as defineExecutor };
@@ -1,5 +1,5 @@
1
1
  import { collectSubqueries as e, getRelations as t } from "@voltro/database";
2
- //#region src/dependencyGraph.ts
2
+ // src/dependencyGraph.ts
3
3
  var n = (e) => {
4
4
  let t = /* @__PURE__ */ new Set();
5
5
  return r(e, t), t;
@@ -28,5 +28,4 @@ var n = (e) => {
28
28
  }
29
29
  }
30
30
  };
31
- //#endregion
32
31
  export { n as resolveDependentTables };
package/dist/devices.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { and as e, eq as t, generateId as n } from "@voltro/database";
2
2
  import { createHash as r, randomBytes as i } from "node:crypto";
3
- //#region src/devices.ts
3
+ // src/devices.ts
4
4
  var a = "_voltro_devices", o = "actors", s = (e) => r("sha256").update(e, "utf8").digest("hex"), c = (e = "dev_") => {
5
5
  let t = e.replace(/_+$/, "");
6
6
  return {
@@ -224,5 +224,4 @@ var a = "_voltro_devices", o = "actors", s = (e) => r("sha256").update(e, "utf8"
224
224
  claim: async (r, i, o, s) => await n.updateMany(a, v(s), { where: e(t("id", r), t(i, o)) }) === 1
225
225
  };
226
226
  };
227
- //#endregion
228
227
  export { a as DEVICES_TABLE, y as dataStoreDeviceStore, c as deviceTokenPrefixes, p as makeDeviceService, m as memoryDeviceStore, s as sha256HexOf };
@@ -2,7 +2,7 @@ import { deviceTokenPrefixes as e, sha256HexOf as t } from "./devices.js";
2
2
  import { Schema as n } from "effect";
3
3
  import { ADMIN_SCOPE as r, DEVICES_MANAGE_SCOPE as i, ScopeError as a, Unauthenticated as o } from "@voltro/protocol";
4
4
  import { defineRestRoute as s, requireAnyScope as c } from "@voltro/protocol/rest";
5
- //#region src/devicesWiring.ts
5
+ // src/devicesWiring.ts
6
6
  var l = (n, r = {}) => {
7
7
  let i = e(r.prefix);
8
8
  return {
@@ -164,5 +164,4 @@ var l = (n, r = {}) => {
164
164
  })
165
165
  ];
166
166
  };
167
- //#endregion
168
167
  export { f as deviceManagementRoutes, l as frameworkDeviceStrategy };
@@ -1,4 +1,4 @@
1
- //#region src/dialectReplicationAdapter.ts
1
+ // src/dialectReplicationAdapter.ts
2
2
  var e = () => {
3
3
  let e = {
4
4
  primary: 0,
@@ -25,5 +25,4 @@ var e = () => {
25
25
  }
26
26
  };
27
27
  };
28
- //#endregion
29
28
  export { e as memoryReplicationAdapter };
@@ -15,7 +15,7 @@ import { committedChangeBatchOf as _ } from "@voltro/database";
15
15
  import { createHash as v, randomUUID as y } from "node:crypto";
16
16
  import { diffRows as b, isIdKeyed as x } from "@voltro/protocol";
17
17
  import { createLogger as S } from "@voltro/logger";
18
- //#region src/dispatcher.ts
18
+ // src/dispatcher.ts
19
19
  var C = /* @__PURE__ */ new Set(), w = S({ scope: "voltro:dispatcher" }), T = (e) => Array.isArray(e) ? e.length : e == null ? 0 : 1, E = (e, n) => ({
20
20
  ...e,
21
21
  key: `${e.key}:${v("sha256").update(JSON.stringify(t(n))).digest("base64url")}`
@@ -518,5 +518,4 @@ var C = /* @__PURE__ */ new Set(), w = S({ scope: "voltro:dispatcher" }), T = (e
518
518
  for (let n = 0; n < e.length; n++) if (JSON.stringify(e[n]) !== JSON.stringify(t[n])) return !1;
519
519
  return !0;
520
520
  };
521
- //#endregion
522
521
  export { j as Dispatcher, T as deliveredRowCount, E as snapshotEntryFor };
@@ -2,7 +2,7 @@ import { Context as e, Effect as t, Exit as n, Layer as r } from "effect";
2
2
  import { authoredError as i, describeDriverError as a, wireSafeCause as o } from "@voltro/database";
3
3
  import { StoreOperationFailed as s } from "@voltro/protocol";
4
4
  import { createLogger as c } from "@voltro/logger";
5
- //#region src/effectStore.ts
5
+ // src/effectStore.ts
6
6
  var l = c({ scope: "store" }), u = class extends e.Service()("@voltro/EffectStore") {}, d = {
7
7
  TenantScopeViolation: !0,
8
8
  TenantRowNotFound: !0,
@@ -67,5 +67,4 @@ var l = c({ scope: "store" }), u = class extends e.Service()("@voltro/EffectStor
67
67
  ...e.update === void 0 ? {} : { update: e.update },
68
68
  ...e.updateValues === void 0 ? {} : { updateValues: e.updateValues }
69
69
  }), x = (e, t, n) => e.insert(t.tableName, n), S = (e, t, n, r) => e.insertMany(t.tableName, n, r), C = (e, t, n, r) => e.upsert(t.tableName, n, b(r)), w = (e, t, n, r) => e.upsertWithOutcome(t.tableName, n, b(r)), T = (e, t, n, r) => e.insertIgnoreWithOutcome(t.tableName, n, { conflictColumns: r.conflictColumns });
70
- //#endregion
71
70
  export { u as EffectStore, T as insertIgnoreRowOutcomeEffect, S as insertManyRowsEffect, x as insertRowEffect, y as makeEffectStoreLayer, C as upsertRowEffect, w as upsertRowOutcomeEffect };