@voltro/runtime 0.86.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.
- package/CHANGELOG.md +5484 -0
- package/README.md +43 -0
- package/THIRD-PARTY-NOTICES.md +1511 -276
- package/dist/aggregate.js +1 -2
- package/dist/aggregateExtrema.js +1 -2
- package/dist/aggregateIvm.js +1 -2
- package/dist/analyticsMirror.js +1 -2
- package/dist/analyticsSink.js +9 -16
- package/dist/apiKeyUsage.js +1 -2
- package/dist/apiKeys.js +83 -80
- package/dist/apiKeysWiring.js +1 -2
- package/dist/apiRoleBucketSampler.js +63 -0
- package/dist/apiRoleWorkloadHistory.js +55 -0
- package/dist/apiRoleWorkloadMetrics.js +77 -0
- package/dist/apiRoleWorkloadStorage.js +94 -0
- package/dist/approvalBuiltins.js +1 -2
- package/dist/approvals.js +68 -76
- package/dist/authMiddlewareLayer.js +8 -8
- package/dist/bindEvent.js +49 -30
- package/dist/boot-refusal.d.ts +10 -0
- package/dist/{bootRefusal.js → boot-refusal.js} +1 -2
- package/dist/bootListener.js +203 -47
- package/dist/bootStoreCodec.js +39 -39
- package/dist/businessRules.js +1 -2
- package/dist/changeClaimsTable.js +1 -2
- package/dist/circuitBreaker.js +1 -72
- package/dist/columnOnUpdate.js +1 -2
- package/dist/composeAnalytics.js +32 -12
- package/dist/computedQuery.js +1 -2
- package/dist/computedQueryCache.js +289 -0
- package/dist/connectionBuiltins.js +1 -2
- package/dist/connectionCredentials.js +1 -2
- package/dist/connectionState.js +1 -2
- package/dist/connectionVault.js +1 -2
- package/dist/connectionsFacade.js +33 -32
- package/dist/coordinatedSchedule.js +85 -80
- package/dist/crdtHistory.js +1 -2
- package/dist/crdtMerge.js +1 -2
- package/dist/crdtVersionsTable.js +1 -2
- package/dist/credentialBound.js +1 -2
- package/dist/crud.js +1 -2
- package/dist/dataStore.js +155 -123
- package/dist/dataloader.js +1 -2
- package/dist/declaredTablesGuard.js +3 -3
- package/dist/defineExecutor.js +1 -2
- package/dist/dependencyGraph.js +1 -2
- package/dist/devices.js +1 -2
- package/dist/devicesWiring.js +1 -2
- package/dist/dialectReplicationAdapter.js +1 -2
- package/dist/dispatcher.js +404 -330
- package/dist/effectStore.js +3 -4
- package/dist/engineClients.js +23 -0
- package/dist/eventBus.js +1 -2
- package/dist/eventPublish.js +1 -2
- package/dist/events.js +1 -2
- package/dist/expectation.js +1 -2
- package/dist/expectationEvaluator.js +2 -3
- package/dist/experiment.js +1 -2
- package/dist/experimentEvaluator.js +1 -2
- package/dist/externalizedTasks.js +20 -8
- package/dist/fieldCipher.js +110 -42
- package/dist/fieldKeyRegistry.js +294 -0
- package/dist/fieldKeyRekey.js +285 -0
- package/dist/fieldKeyScan.js +135 -0
- package/dist/fieldKeyring.js +76 -0
- package/dist/fingerprint.js +1 -2
- package/dist/finops.js +1 -2
- package/dist/finopsAccountant.js +1 -2
- package/dist/handlerBody.js +1 -2
- package/dist/healthProbes.js +1 -2
- package/dist/hot.d.ts +56 -0
- package/dist/hot.js +3 -0
- package/dist/hotDataStore.js +147 -0
- package/dist/hotDataStoreSnapshot.js +97 -0
- package/dist/hotDataStoreTables.js +17 -0
- package/dist/http-range.d.ts +53 -0
- package/dist/http-range.js +51 -0
- package/dist/httpClientSsrf.js +13 -39
- package/dist/httpClientTracing.js +13 -11
- package/dist/httpCompression.js +18 -19
- package/dist/httpInputStream.js +81 -0
- package/dist/httpKeepAlive.js +1 -2
- package/dist/httpRouteMounts.js +2 -2
- package/dist/idempotencyStore.js +93 -54
- package/dist/idleDetector.js +1 -2
- package/dist/index.d.ts +1185 -452
- package/dist/index.js +144 -134
- package/dist/insertRequiredColumns.js +1 -2
- package/dist/instanceMembership.js +1 -2
- package/dist/ivm.js +1 -2
- package/dist/kvDataStore.js +1 -2
- package/dist/kvFacade.js +24 -19
- package/dist/matcher.js +1 -2
- package/dist/memoryColumnDefaults.js +1 -2
- package/dist/memoryQueryJoins.js +17 -18
- package/dist/memorySetOperations.js +42 -0
- package/dist/metrics.js +39 -26
- package/dist/observability.js +2 -3
- package/dist/observedGraph.js +1 -2
- package/dist/originGuard.js +1 -2
- package/dist/outbox.js +2 -3
- package/dist/pluginRefRules.js +1 -2
- package/dist/policyGuardResolver.js +1 -2
- package/dist/preview.js +1 -2
- package/dist/projectedRows.js +1 -2
- package/dist/provenance.js +1 -2
- package/dist/rangeIndex.js +1 -2
- package/dist/rawReadScope.js +2 -3
- package/dist/reaction.js +1 -2
- package/dist/reactiveConfig.js +1 -2
- package/dist/readClassification.js +1 -2
- package/dist/readRecorder.js +36 -36
- package/dist/readScopePredicate.js +11 -0
- package/dist/rebac.js +1 -2
- package/dist/rebacInterceptor.js +1 -2
- package/dist/registry.js +1 -2
- package/dist/relevantFields.js +1 -2
- package/dist/replicaHealth.js +1 -2
- package/dist/replicaLocality.js +1 -2
- package/dist/replicaObservations.js +1 -2
- package/dist/replicaSelection.js +1 -2
- package/dist/replicatedDataStore.js +23 -6
- package/dist/requestLoader.js +1 -2
- package/dist/resumeCensus.js +1 -2
- package/dist/revalidation.js +1 -2
- package/dist/rowFilter.js +57 -41
- package/dist/rowStateBytes.js +1 -2
- package/dist/rpcBodyCap.js +1 -2
- package/dist/rpcConnections.js +9 -10
- package/dist/rpcDefectDiagnostics.js +1 -2
- package/dist/rpcServer.js +523 -451
- package/dist/rpcWorkloadAdmission.js +49 -0
- package/dist/runAsSystem.js +1 -2
- package/dist/rywPositionStore.js +83 -49
- package/dist/schedule.js +1 -2
- package/dist/scheduleBackfillRequests.js +1 -2
- package/dist/scheduleClaimsTable.js +1 -2
- package/dist/scheduleRunsTable.js +1 -2
- package/dist/scheduler.js +7 -3
- package/dist/schemaRegistry.js +1 -2
- package/dist/secretsResolver.js +1 -2
- package/dist/securityHeaders.js +1 -2
- package/dist/servePipeline.js +238 -154
- package/dist/serverOnlyAudit.js +1 -2
- package/dist/serverTracer.js +1 -2
- package/dist/serviceCredentials.js +1 -2
- package/dist/setReadScopes.js +27 -0
- package/dist/singleNodeOrchestrator.js +1 -2
- package/dist/snapshotValueCodec.js +45 -0
- package/dist/sourceResolution.js +35 -26
- package/dist/storeMiddleware.js +213 -212
- package/dist/storeQuery.js +1 -2
- package/dist/storeRead.js +1 -2
- package/dist/subscriber.js +2 -2
- package/dist/subscriptionOutbox.js +1 -2
- package/dist/subscriptionRegistry.js +1 -2
- package/dist/subscriptionResume.js +1 -2
- package/dist/subscriptionSocketMetrics.js +1 -2
- package/dist/systemSubject.js +1 -2
- package/dist/tenantScope.js +9 -22
- package/dist/tenantSelection.js +1 -2
- package/dist/timeline.js +1 -2
- package/dist/traceContext.js +1 -2
- package/dist/traceSink.js +1 -2
- package/dist/traceSpansTable.js +1 -2
- package/dist/traceparent.js +9 -21
- package/dist/transactionSubject.js +1 -2
- package/dist/trustedProxy.js +2 -3
- package/dist/undo.js +1 -2
- package/dist/undoBuiltins.js +1 -2
- package/dist/undoCapture.js +1 -2
- package/dist/undoLogTable.js +1 -2
- package/dist/upsertBinding.js +1 -2
- package/dist/wakeOrchestrator.js +1 -2
- package/dist/wakeRegistry.js +1 -2
- package/dist/wakeRouter.js +1 -2
- package/dist/wakeSupervisor.js +1 -2
- package/dist/wakeupsTable.js +1 -2
- package/dist/webSocketGatewayRuntime.js +112 -73
- package/dist/webhookVerification.js +1 -2
- package/dist/wireColumnStrip.js +1 -2
- package/dist/workflowReadBuiltins.js +1 -2
- package/dist/workflowRuntime.js +10 -11
- package/package.json +36 -17
package/dist/replicaHealth.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/replicaHealth.ts
|
|
2
2
|
var e = (e = {}) => {
|
|
3
3
|
let t = e.thresholdFailures ?? 3, n = e.windowMs ?? 1e4, r = e.blackoutMs ?? 6e4, i = e.now ?? Date.now, a = /* @__PURE__ */ new Map(), o = (e) => {
|
|
4
4
|
let t = a.get(e);
|
|
@@ -38,5 +38,4 @@ var e = (e = {}) => {
|
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
|
-
//#endregion
|
|
42
41
|
export { e as replicaHealth };
|
package/dist/replicaLocality.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/replicaLocality.ts
|
|
2
2
|
var e = (e) => {
|
|
3
3
|
let { currentRegion: t, replicaRegions: n, inner: r } = e, i = (e) => {
|
|
4
4
|
if (t === void 0) return {
|
|
@@ -40,5 +40,4 @@ var e = (e) => {
|
|
|
40
40
|
if (typeof n == "string" && n.length > 0) return n;
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
//#endregion
|
|
44
43
|
export { e as localityAwareSelector, t as resolveCurrentRegion };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createLogger as e } from "@voltro/logger";
|
|
2
2
|
import { processIdentity as t } from "@voltro/protocol/identity";
|
|
3
|
-
|
|
3
|
+
// src/replicaObservations.ts
|
|
4
4
|
var n = e({ scope: "voltro:replica-observations" }), r = "_voltro_replica_observations", i = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? e : NaN, a = /* @__PURE__ */ new Set(), o = () => {
|
|
5
5
|
a.clear();
|
|
6
6
|
}, s = async (e, i, o) => {
|
|
@@ -117,5 +117,4 @@ var n = e({ scope: "voltro:replica-observations" }), r = "_voltro_replica_observ
|
|
|
117
117
|
...h === void 0 ? { versions: void 0 } : { versions: h }
|
|
118
118
|
};
|
|
119
119
|
};
|
|
120
|
-
//#endregion
|
|
121
120
|
export { f as DEFAULT_STALE_AFTER_MS, l as ObservationsUnavailable, r as REPLICA_OBSERVATIONS_TABLE, d as forgetReplicaObservations, p as mergeFleetObservations, c as readReplicaObservations, o as resetReplicaObservationWarnings, s as writeReplicaObservation };
|
package/dist/replicaSelection.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/replicaSelection.ts
|
|
2
2
|
var e = (e = {}) => {
|
|
3
3
|
let t = e.random ?? Math.random, n = /* @__PURE__ */ new Map(), r = (e) => n.get(e) ?? 0;
|
|
4
4
|
return {
|
|
@@ -28,5 +28,4 @@ var e = (e = {}) => {
|
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
-
//#endregion
|
|
32
31
|
export { e as powerOfTwoSelector };
|
|
@@ -4,13 +4,14 @@ import { memoryRywPositionStore as n } from "./rywPositionStore.js";
|
|
|
4
4
|
import { Effect as r, Fiber as i } from "effect";
|
|
5
5
|
import { createLogger as a } from "@voltro/logger";
|
|
6
6
|
import { AsyncLocalStorage as o } from "node:async_hooks";
|
|
7
|
-
|
|
7
|
+
// src/replicatedDataStore.ts
|
|
8
8
|
var s = a({ scope: "voltro:replication" }), c = new o(), l = (e, t) => c.run(e, t), u = (e, t) => r.flatMap(r.context(), (n) => r.callback((a) => {
|
|
9
9
|
let o = l(e, () => r.runForkWith(n)(t));
|
|
10
10
|
return o.addObserver((e) => {
|
|
11
11
|
a(e);
|
|
12
12
|
}), r.asVoid(i.interrupt(o));
|
|
13
13
|
})), d = () => c.getStore(), f = class {
|
|
14
|
+
integrityQuery;
|
|
14
15
|
primary;
|
|
15
16
|
replicas;
|
|
16
17
|
adapter;
|
|
@@ -22,8 +23,9 @@ var s = a({ scope: "voltro:replication" }), c = new o(), l = (e, t) => c.run(e,
|
|
|
22
23
|
health;
|
|
23
24
|
recordRouting;
|
|
24
25
|
now;
|
|
26
|
+
closing;
|
|
25
27
|
constructor(r) {
|
|
26
|
-
this.primary = r.primary, this.replicas = r.replicas, this.adapter = r.replicationAdapter, this.policy = r.rywPolicy ?? "fallback", this.rywTtlMs = r.rywTtlMs ?? 3e4, this.rywMaxWaitMs = r.rywMaxWaitMs ?? 500, this.now = r.now ?? Date.now, this.rywStore = r.rywStore ?? n({ now: this.now }), this.selector = r.replicaSelector ?? e(), this.health = r.replicaHealth ?? t({ now: this.now }), r.recordRouting !== void 0 && (this.recordRouting = r.recordRouting);
|
|
28
|
+
this.primary = r.primary, r.primary.integrityQuery !== void 0 && (this.integrityQuery = r.primary.integrityQuery.bind(r.primary)), this.replicas = r.replicas, this.adapter = r.replicationAdapter, this.policy = r.rywPolicy ?? "fallback", this.rywTtlMs = r.rywTtlMs ?? 3e4, this.rywMaxWaitMs = r.rywMaxWaitMs ?? 500, this.now = r.now ?? Date.now, this.rywStore = r.rywStore ?? n({ now: this.now }), this.selector = r.replicaSelector ?? e(), this.health = r.replicaHealth ?? t({ now: this.now }), r.recordRouting !== void 0 && (this.recordRouting = r.recordRouting);
|
|
27
29
|
}
|
|
28
30
|
async query(e) {
|
|
29
31
|
let t = c.getStore(), n = t?.subjectKey ?? "anon:bg";
|
|
@@ -166,9 +168,9 @@ var s = a({ scope: "voltro:replication" }), c = new o(), l = (e, t) => c.run(e,
|
|
|
166
168
|
let n = await this.primary.insert(e, t);
|
|
167
169
|
return await this.stampPostWrite(), n;
|
|
168
170
|
}
|
|
169
|
-
async insertMany(e, t) {
|
|
170
|
-
let
|
|
171
|
-
return await this.stampPostWrite(),
|
|
171
|
+
async insertMany(e, t, n) {
|
|
172
|
+
let r = await this.primary.insertMany(e, t, n);
|
|
173
|
+
return await this.stampPostWrite(), r;
|
|
172
174
|
}
|
|
173
175
|
async patchJson(e, t, n, r, i) {
|
|
174
176
|
let a = await this.primary.patchJson(e, t, n, r, i);
|
|
@@ -218,6 +220,22 @@ var s = a({ scope: "voltro:replication" }), c = new o(), l = (e, t) => c.run(e,
|
|
|
218
220
|
get changeScope() {
|
|
219
221
|
return this.primary.changeScope ?? "local";
|
|
220
222
|
}
|
|
223
|
+
close(e) {
|
|
224
|
+
return this.closing ??= (async () => {
|
|
225
|
+
let t = [];
|
|
226
|
+
try {
|
|
227
|
+
await this.rywStore.close?.();
|
|
228
|
+
} catch (e) {
|
|
229
|
+
t.push(e);
|
|
230
|
+
}
|
|
231
|
+
for (let n of /* @__PURE__ */ new Set([this.primary, ...this.replicas])) try {
|
|
232
|
+
await n.close?.(e);
|
|
233
|
+
} catch (e) {
|
|
234
|
+
t.push(e);
|
|
235
|
+
}
|
|
236
|
+
if (t.length > 0) throw AggregateError(t, "Read replica shutdown failed");
|
|
237
|
+
})();
|
|
238
|
+
}
|
|
221
239
|
async stampPostWrite() {
|
|
222
240
|
if (this.replicas.length === 0) return;
|
|
223
241
|
let e = c.getStore()?.subjectKey ?? "anon:bg";
|
|
@@ -235,5 +253,4 @@ var s = a({ scope: "voltro:replication" }), c = new o(), l = (e, t) => c.run(e,
|
|
|
235
253
|
this.recordRouting?.(e);
|
|
236
254
|
}
|
|
237
255
|
}, p = (e) => new Promise((t) => setTimeout(t, e));
|
|
238
|
-
//#endregion
|
|
239
256
|
export { f as ReplicatedDataStore, d as currentRoutingContext, l as runWithRoutingContext, u as runWithRoutingContextEffect };
|
package/dist/requestLoader.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AsyncLocalStorage as e } from "node:async_hooks";
|
|
2
|
-
|
|
2
|
+
// src/requestLoader.ts
|
|
3
3
|
var t = new e(), n = (e) => {
|
|
4
4
|
t.enterWith(e);
|
|
5
5
|
}, r = () => t.getStore(), i = (e, n) => t.run(e, n);
|
|
6
|
-
//#endregion
|
|
7
6
|
export { r as currentRequestLoader, n as enterRequestLoader, i as runWithRequestLoader };
|
package/dist/resumeCensus.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createLogger as e } from "@voltro/logger";
|
|
2
|
-
|
|
2
|
+
// src/resumeCensus.ts
|
|
3
3
|
var t = Symbol.for("@voltro/runtime/resumeCensus"), n = globalThis, r = n[t] ?? (n[t] = { byLabel: /* @__PURE__ */ new Map() }), i = e({ scope: "voltro:resume" }), a = (e, t) => {
|
|
4
4
|
let n = e.startsWith("subscription.") ? e.slice(13) : e, a = r.byLabel.get(n) ?? {
|
|
5
5
|
resumable: 0,
|
|
@@ -24,5 +24,4 @@ var t = Symbol.for("@voltro/runtime/resumeCensus"), n = globalThis, r = n[t] ??
|
|
|
24
24
|
}, s = () => {
|
|
25
25
|
r.byLabel.clear();
|
|
26
26
|
};
|
|
27
|
-
//#endregion
|
|
28
27
|
export { a as noteResumeVerdict, s as resetResumeCensus, o as resumeCensus };
|
package/dist/revalidation.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/revalidation.ts
|
|
2
2
|
var e = Symbol.for("@voltro/runtime/revalidation:publisher"), t = () => {
|
|
3
3
|
let t = globalThis;
|
|
4
4
|
return t[e] ??= { publisher: null };
|
|
@@ -18,5 +18,4 @@ var e = Symbol.for("@voltro/runtime/revalidation:publisher"), t = () => {
|
|
|
18
18
|
kind: "tag",
|
|
19
19
|
value: e
|
|
20
20
|
});
|
|
21
|
-
//#endregion
|
|
22
21
|
export { i as revalidatePath, a as revalidateTable, o as revalidateTag, n as setRevalidationPublisher };
|
package/dist/rowFilter.js
CHANGED
|
@@ -1,65 +1,81 @@
|
|
|
1
1
|
import { restrictingReadsEffect as e } from "./readRecorder.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { mapSetReadScopes as t } from "./setReadScopes.js";
|
|
3
|
+
import { Effect as n, Schedule as r, Schema as i } from "effect";
|
|
4
|
+
import { and as a } from "@voltro/database";
|
|
5
|
+
import { currentSubjectAuthority as o, isMachineSubject as s } from "@voltro/protocol";
|
|
6
|
+
import { createLogger as c } from "@voltro/logger";
|
|
7
|
+
// src/rowFilter.ts
|
|
8
|
+
var l = class extends i.TaggedError()("RowFilterUnavailable", { cause: i.String }) {}, u = class extends i.TaggedError()("RowFilterDeclarationViolated", {
|
|
9
|
+
table: i.String,
|
|
10
|
+
declared: i.Array(i.String)
|
|
10
11
|
}) {
|
|
11
12
|
get message() {
|
|
12
13
|
return `row filter narrowed '${this.table}', which its declaration does not name (declared: ${this.declared.join(", ") || "none"})`;
|
|
13
14
|
}
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
|
|
15
|
+
}, d = r.max([r.exponential("20 millis"), r.recurs(2)]), f = Symbol.for("@voltro/runtime/rowFilter"), p = globalThis, m = p[f] ?? (p[f] = {}), h = (e) => {
|
|
16
|
+
m.filter = e;
|
|
17
|
+
}, g = () => m.filter, _ = () => m.filter !== void 0, v = () => void 0, y = c({ scope: "voltro:row-filter" }), b = /* @__PURE__ */ new Set(), x = (e, t) => {
|
|
18
|
+
b.has(e) || (b.add(e), y.info("row filter: RESOLVED on a live read path", {
|
|
18
19
|
arm: e,
|
|
19
20
|
...t === void 0 ? {} : { constrains: t },
|
|
20
|
-
armsSeen: [...
|
|
21
|
+
armsSeen: [...b].sort().join(",")
|
|
21
22
|
}));
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
let e =
|
|
26
|
-
e !== void 0 &&
|
|
27
|
-
})),
|
|
28
|
-
if (
|
|
29
|
-
let a =
|
|
30
|
-
return
|
|
31
|
-
let r =
|
|
32
|
-
if (r !== void 0 && !p.has(
|
|
33
|
-
table:
|
|
23
|
+
}, S = () => [...b].sort(), C = () => {
|
|
24
|
+
b.clear();
|
|
25
|
+
}, w = (e, t) => n.tap(T(g(), e, t), () => n.sync(() => {
|
|
26
|
+
let e = g();
|
|
27
|
+
e !== void 0 && x("request", e.tables?.length);
|
|
28
|
+
})), T = (t, r, i) => {
|
|
29
|
+
if (t === void 0 || s(r)) return n.succeed(v);
|
|
30
|
+
let a = t.retry ?? d, o = e(t.load(r)), c = a === !1 ? o : n.retry(o, a), f = t.tables, p = f === void 0 ? void 0 : new Set(f);
|
|
31
|
+
return c.pipe(n.map((e) => p === void 0 ? (n) => t.predicate(e, n) : (n) => {
|
|
32
|
+
let r = t.predicate(e, n);
|
|
33
|
+
if (r !== void 0 && !p.has(n)) throw new u({
|
|
34
|
+
table: n,
|
|
34
35
|
declared: f ?? []
|
|
35
36
|
});
|
|
36
37
|
return r;
|
|
37
|
-
}),
|
|
38
|
-
},
|
|
38
|
+
}), n.catch((e) => n.suspend(() => (i?.(e), t.onLoadError === "deny" ? n.succeed(E) : n.fail(new l({ cause: String(e) }))))));
|
|
39
|
+
}, E = () => ({
|
|
39
40
|
column: "id",
|
|
40
41
|
op: "isNull"
|
|
41
|
-
}),
|
|
42
|
-
let t =
|
|
42
|
+
}), D = (e) => {
|
|
43
|
+
let t = g();
|
|
43
44
|
if (t === void 0) return !1;
|
|
44
45
|
let n = t.tables;
|
|
45
46
|
if (n === void 0) return !0;
|
|
46
47
|
let r = new Set(n);
|
|
47
48
|
return e.some((e) => r.has(e));
|
|
48
|
-
},
|
|
49
|
+
}, O = (e, t, n) => {
|
|
49
50
|
let r = e(t);
|
|
50
|
-
return r === void 0 ? n : n ?
|
|
51
|
-
}, O = (e, t) => {
|
|
52
|
-
let n = D(e, t.table, t.predicate);
|
|
53
|
-
return n === t.predicate ? t : {
|
|
54
|
-
...t,
|
|
55
|
-
predicate: n
|
|
56
|
-
};
|
|
51
|
+
return r === void 0 ? n : n ? a(n, r) : r;
|
|
57
52
|
}, k = (e, n) => {
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
let r = n;
|
|
54
|
+
if (r.setOp !== void 0) {
|
|
55
|
+
let i = {
|
|
56
|
+
...r,
|
|
57
|
+
table: n.table,
|
|
58
|
+
predicate: n.predicate,
|
|
59
|
+
order: r.order ?? [],
|
|
60
|
+
projection: r.projection,
|
|
61
|
+
take: r.take,
|
|
62
|
+
skip: r.skip
|
|
63
|
+
}, a = t(i, (t) => k(e, t));
|
|
64
|
+
return {
|
|
65
|
+
...n,
|
|
66
|
+
setOp: a.setOp
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
let i = O(e, n.table, n.predicate);
|
|
70
|
+
return i === n.predicate ? n : {
|
|
71
|
+
...n,
|
|
72
|
+
predicate: i
|
|
73
|
+
};
|
|
74
|
+
}, A = (e, t) => {
|
|
75
|
+
if (g() !== void 0) return async () => {
|
|
76
|
+
let r = await n.runPromise(n.result(w(o(e), t)));
|
|
60
77
|
if (r._tag === "Failure") throw r.failure;
|
|
61
78
|
return r.success;
|
|
62
79
|
};
|
|
63
80
|
};
|
|
64
|
-
|
|
65
|
-
export { u as DEFAULT_ROW_FILTER_RETRY, _ as NO_ROW_FILTER, l as RowFilterDeclarationViolated, c as RowFilterUnavailable, D as applyRowFilter, O as applyRowFilterToDescriptor, h as getRowFilter, k as makeDefaultRefilter, b as noteRowFilterResolved, S as resetRowFilterResolvedArms, C as resolveRowFilterScope, w as resolveRowFilterScopeFor, E as rowFilterMayNarrow, g as rowFilterRegistered, x as rowFilterResolvedArms, m as setRowFilter };
|
|
81
|
+
export { d as DEFAULT_ROW_FILTER_RETRY, v as NO_ROW_FILTER, u as RowFilterDeclarationViolated, l as RowFilterUnavailable, O as applyRowFilter, k as applyRowFilterToDescriptor, g as getRowFilter, A as makeDefaultRefilter, x as noteRowFilterResolved, C as resetRowFilterResolvedArms, w as resolveRowFilterScope, T as resolveRowFilterScopeFor, D as rowFilterMayNarrow, _ as rowFilterRegistered, S as rowFilterResolvedArms, h as setRowFilter };
|
package/dist/rowStateBytes.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/rowStateBytes.ts
|
|
2
2
|
var e = (t, n) => {
|
|
3
3
|
if (typeof t != "object" || !t) return typeof t != "bigint";
|
|
4
4
|
if (n.has(t)) return !1;
|
|
@@ -41,5 +41,4 @@ var e = (t, n) => {
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
|
-
//#endregion
|
|
45
44
|
export { t as createRowStateByteEstimator };
|
package/dist/rpcBodyCap.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect as e, Stream as t } from "effect";
|
|
2
2
|
import { HttpServerError as n, UrlParams as r } from "effect/http";
|
|
3
|
-
|
|
3
|
+
// src/rpcBodyCap.ts
|
|
4
4
|
var i = (t, n) => e.callback((r) => {
|
|
5
5
|
let i = [], a = 0, o = !1, s = () => {
|
|
6
6
|
t.off("data", l), t.off("end", u), t.off("error", d), t.off("aborted", d);
|
|
@@ -59,5 +59,4 @@ var i = (t, n) => e.callback((r) => {
|
|
|
59
59
|
}
|
|
60
60
|
}), o;
|
|
61
61
|
};
|
|
62
|
-
//#endregion
|
|
63
62
|
export { i as readCappedBody, a as withBufferedBody };
|
package/dist/rpcConnections.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { interruptConnectionStreams as e, unbindConnection as t } from "./connectionCredentials.js";
|
|
2
2
|
import { Effect as n, Layer as r, Queue as i } from "effect";
|
|
3
3
|
import { randomUUID as a } from "node:crypto";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
4
|
+
import { RpcServer as o } from "effect/rpc";
|
|
5
|
+
import { Headers as s } from "effect/http";
|
|
6
|
+
// src/rpcConnections.ts
|
|
7
7
|
var c = Symbol.for("@voltro/runtime/rpcConnections"), l = globalThis, u = l[c] ??= {
|
|
8
8
|
nextId: 1,
|
|
9
9
|
entries: /* @__PURE__ */ new Map(),
|
|
10
10
|
addressMark: a()
|
|
11
11
|
}, d = "x-voltro-client-address", f = (e) => `${u.addressMark} ${e}`, p = (e, t) => {
|
|
12
|
-
let n =
|
|
12
|
+
let n = s.remove(e.headers, d), r = t === void 0 ? n : s.set(n, d, f(t)), i = Object.create(e);
|
|
13
13
|
return Object.defineProperty(i, "headers", {
|
|
14
14
|
value: r,
|
|
15
15
|
configurable: !0
|
|
@@ -21,8 +21,8 @@ var c = Symbol.for("@voltro/runtime/rpcConnections"), l = globalThis, u = l[c] ?
|
|
|
21
21
|
remoteAddr: n,
|
|
22
22
|
headers: r.length === e.length ? e : r
|
|
23
23
|
};
|
|
24
|
-
}, h = (e) => u.entries.get(e)?.connection, g = (
|
|
25
|
-
let r = yield*
|
|
24
|
+
}, h = (e) => u.entries.get(e)?.connection, g = (s, c) => r.effect(o.Protocol, n.gen(function* () {
|
|
25
|
+
let r = yield* o.Protocol, s = yield* i.make(), l = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), f = (e, t) => {
|
|
26
26
|
let n = l.get(e);
|
|
27
27
|
if (n !== void 0) return t !== void 0 && n.connection.remoteAddr === void 0 && (n.connection = Object.freeze({
|
|
28
28
|
...n.connection,
|
|
@@ -48,10 +48,10 @@ var c = Symbol.for("@voltro/runtime/rpcConnections"), l = globalThis, u = l[c] ?
|
|
|
48
48
|
for (let e of l.keys()) p(e);
|
|
49
49
|
})), yield* n.forkScoped(n.gen(function* () {
|
|
50
50
|
let e = yield* i.take(r.disconnects), t = p(e);
|
|
51
|
-
t !== void 0 && (yield* i.offer(
|
|
51
|
+
t !== void 0 && (yield* i.offer(s, t));
|
|
52
52
|
}).pipe(n.forever)), {
|
|
53
53
|
...r,
|
|
54
|
-
disconnects:
|
|
54
|
+
disconnects: s,
|
|
55
55
|
run: (e) => r.run((t, i) => n.gen(function* () {
|
|
56
56
|
if (!(yield* r.clientIds).has(t)) return;
|
|
57
57
|
if (i._tag !== "Request") {
|
|
@@ -78,6 +78,5 @@ var c = Symbol.for("@voltro/runtime/rpcConnections"), l = globalThis, u = l[c] ?
|
|
|
78
78
|
return n;
|
|
79
79
|
})
|
|
80
80
|
};
|
|
81
|
-
})).pipe(r.provide(
|
|
82
|
-
//#endregion
|
|
81
|
+
})).pipe(r.provide(s));
|
|
83
82
|
export { d as RPC_CLIENT_ADDRESS_HEADER, h as getRpcConnection, f as stampRpcClientAddress, m as takeRpcClientAddress, p as withRpcClientAddress, g as withRpcConnectionIdentity };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/rpcDefectDiagnostics.ts
|
|
2
2
|
var e = (e) => {
|
|
3
3
|
if (typeof e != "object" || !e) return [];
|
|
4
4
|
let t = e;
|
|
@@ -11,5 +11,4 @@ var e = (e) => {
|
|
|
11
11
|
return t._tag === "Die" ? [t.defect] : [];
|
|
12
12
|
});
|
|
13
13
|
};
|
|
14
|
-
//#endregion
|
|
15
14
|
export { e as rpcFrameDefects };
|