@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/storeQuery.js
CHANGED
|
@@ -2,7 +2,7 @@ import { NO_ROW_FILTER as e } from "./rowFilter.js";
|
|
|
2
2
|
import { Schema as t } from "effect";
|
|
3
3
|
import { and as n, contains as r, eq as i, getTable as a, gt as o, gte as s, inSet as c, isNull as l, lt as u, lte as d, neq as f, queryFor as p, startsWith as m } from "@voltro/database";
|
|
4
4
|
import { NoRowFound as h, NoRowFound as g } from "@voltro/protocol";
|
|
5
|
-
|
|
5
|
+
// src/storeQuery.ts
|
|
6
6
|
var _ = (e, t) => t === void 0 ? new h(e) : t(e), v = class extends t.TaggedError()("OptimisticLockError", {
|
|
7
7
|
table: t.String,
|
|
8
8
|
expected: t.Number
|
|
@@ -200,5 +200,4 @@ var _ = (e, t) => t === void 0 ? new h(e) : t(e), v = class extends t.TaggedErro
|
|
|
200
200
|
updateWhere: (n) => new C(e, t, n),
|
|
201
201
|
deleteWhere: (n) => new w(e, t, n)
|
|
202
202
|
});
|
|
203
|
-
//#endregion
|
|
204
203
|
export { w as DeleteBuilder, g as NoRowFound, v as OptimisticLockError, S as SelectBuilder, C as UpdateBuilder, T as makeFluentStore, _ as missingRowError };
|
package/dist/storeRead.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/storeRead.ts
|
|
2
2
|
var e = async (e, t) => {
|
|
3
3
|
let n = "descriptor" in t ? t.descriptor : t;
|
|
4
4
|
return (await e.query({
|
|
@@ -6,5 +6,4 @@ var e = async (e, t) => {
|
|
|
6
6
|
take: 1
|
|
7
7
|
}))[0] ?? null;
|
|
8
8
|
};
|
|
9
|
-
//#endregion
|
|
10
9
|
export { e as readMaybeOne };
|
package/dist/subscriber.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// src/subscriber.ts
|
|
2
2
|
var e = (e) => {
|
|
3
|
+
if (e.eventTenant !== void 0 && typeof e.eventTenant != "function") throw Error("defineSubscriber: `eventTenant` must be a function");
|
|
3
4
|
if (e.once !== void 0 && e.eachReplica === !0) throw Error("defineSubscriber: choose either `once` or `eachReplica: true`, not both");
|
|
4
5
|
return e;
|
|
5
6
|
};
|
|
6
|
-
//#endregion
|
|
7
7
|
export { e as defineSubscriber };
|
|
@@ -3,7 +3,7 @@ import { createRowStateByteEstimator as a } from "./rowStateBytes.js";
|
|
|
3
3
|
import { MutableList as o } from "effect";
|
|
4
4
|
import { createRowPatchApplier as s, diffRows as c, isIdKeyed as l } from "@voltro/protocol";
|
|
5
5
|
import { createLogger as u } from "@voltro/logger";
|
|
6
|
-
|
|
6
|
+
// src/subscriptionOutbox.ts
|
|
7
7
|
var d = u({ scope: "voltro:subscription" }), f = 1048576, p = 1e4, m = 262144, h = 5e3, g = Symbol.for("@voltro/runtime/reactiveSocketTunables"), _ = (e) => {
|
|
8
8
|
let t = globalThis;
|
|
9
9
|
t[g] = e;
|
|
@@ -135,5 +135,4 @@ var d = u({ scope: "voltro:subscription" }), f = 1048576, p = 1e4, m = 262144, h
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
};
|
|
138
|
-
//#endregion
|
|
139
138
|
export { f as DEFAULT_SOCKET_MAX_BUFFERED_BYTES, p as DEFAULT_SOCKET_OVERRUN_AFTER_MS, m as DEFAULT_SOCKET_OVERSIZED_EVENT_BYTES, h as DEFAULT_SOCKET_STALL_WARN_AFTER_MS, b as makeSubscriptionOutbox, x as pumpOutbox, v as reactiveSocketTunables, _ as setReactiveSocketTunables };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fingerprintFor as e } from "./fingerprint.js";
|
|
2
|
-
|
|
2
|
+
// src/subscriptionRegistry.ts
|
|
3
3
|
var t = class {
|
|
4
4
|
matcher;
|
|
5
5
|
byFingerprint = /* @__PURE__ */ new Map();
|
|
@@ -78,5 +78,4 @@ var t = class {
|
|
|
78
78
|
return e;
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
//#endregion
|
|
82
81
|
export { t as SubscriptionRegistry };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BoundedRing as e } from "@voltro/protocol";
|
|
2
|
-
|
|
2
|
+
// src/subscriptionResume.ts
|
|
3
3
|
var t = 6e4, n = 256, r = Symbol.for("@voltro/runtime:resume-tunables"), i = (e) => {
|
|
4
4
|
let t = globalThis;
|
|
5
5
|
t[r] = e;
|
|
@@ -128,5 +128,4 @@ var t = 6e4, n = 256, r = Symbol.for("@voltro/runtime:resume-tunables"), i = (e)
|
|
|
128
128
|
for (let e of b().values()) clearTimeout(e.timer), e.unsubscribe();
|
|
129
129
|
b().clear();
|
|
130
130
|
};
|
|
131
|
-
//#endregion
|
|
132
131
|
export { n as DEFAULT_RESUME_MAX_DELTAS, t as DEFAULT_RESUME_WINDOW_MS, S as adoptDetached, _ as answerResume, s as canonicalInputKey, x as detachForResume, g as recordForResume, C as resetDetachedForTest, v as resetResumeRingsForTest, o as resumeKeyOf, a as resumeTunables, i as setResumeTunables };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/subscriptionSocketMetrics.ts
|
|
2
2
|
var e = Symbol.for("@voltro/runtime/subscriptionSocketMetrics"), t = () => {
|
|
3
3
|
let t = globalThis;
|
|
4
4
|
return t[e] ??= {
|
|
@@ -61,5 +61,4 @@ var e = Symbol.for("@voltro/runtime/subscriptionSocketMetrics"), t = () => {
|
|
|
61
61
|
let e = t();
|
|
62
62
|
e.bufferOwners = /* @__PURE__ */ new WeakMap(), e.bufferedBytes.clear(), e.coalescedTotal.clear(), e.overrunTotal.clear(), e.oversizedTotal.clear(), e.stalledTotal.clear();
|
|
63
63
|
};
|
|
64
|
-
//#endregion
|
|
65
64
|
export { i as createSubscriptionBufferMetric, a as recordCoalesced, o as recordOverrun, s as recordOversized, c as recordStalled, f as resetSubscriptionSocketMetrics, r as setBufferedBytes, d as subscriptionSocketMetricSamples, u as subscriptionSocketMetricsSnapshot };
|
package/dist/systemSubject.js
CHANGED
package/dist/tenantScope.js
CHANGED
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
}, i = (e, t, n) => n === "" && !e.crossTenant && t.has(e.table), a = (e) => e?.type === "user" && e.tenantId === "", o = (t, r) => {
|
|
11
|
-
if (t.includeDeleted || !r.has(t.table)) return t;
|
|
12
|
-
let i = n("deletedAt");
|
|
13
|
-
return {
|
|
14
|
-
...t,
|
|
15
|
-
predicate: t.predicate ? e(t.predicate, i) : i
|
|
16
|
-
};
|
|
17
|
-
}, s = (e) => (t, n) => {
|
|
18
|
-
e.observe?.beforeScope?.({ ...t }, n);
|
|
19
|
-
let i = o(r(t, e.tenantScopedTables, n.tenantId), e.softDeleteScopedTables);
|
|
20
|
-
return e.observe?.afterScope?.({ ...i }), i;
|
|
1
|
+
import { mapSetReadScopes as e } from "./setReadScopes.js";
|
|
2
|
+
import { addReadScopePredicate as t } from "./readScopePredicate.js";
|
|
3
|
+
import { eq as n, gt as r, isNull as i, or as a } from "@voltro/database";
|
|
4
|
+
// src/tenantScope.ts
|
|
5
|
+
var o = (r, i, a) => e(r, (e) => e.crossTenant || !i.has(e.table) || a == null ? e : t(e, (e) => n(e("tenantId"), a))), s = (e, t, n) => n === "" && !e.crossTenant && t.has(e.table), c = (e) => e?.type === "user" && e.tenantId === "", l = (n, r) => e(n, (e) => e.includeDeleted || !r.has(e.table) ? e : t(e, (e) => i(e("deletedAt")))), u = (n) => (s, c) => {
|
|
6
|
+
n.observe?.beforeScope?.({ ...s }, c);
|
|
7
|
+
let u = l(o(s, n.tenantScopedTables, c.tenantId), n.softDeleteScopedTables), d = /* @__PURE__ */ new Date(), f = n.expiresScopedTables, p = f === void 0 ? u : e(u, (e) => e.includeExpired || !f.has(e.table) ? e : t(e, (e) => a(i(e("expiresAt")), r(e("expiresAt"), d))));
|
|
8
|
+
return n.observe?.afterScope?.({ ...p }), p;
|
|
21
9
|
};
|
|
22
|
-
|
|
23
|
-
export { o as applySoftDeleteScope, r as applyTenantScope, i as isEmptyTenantScopedRead, a as isOrglessUserSubject, s as makeQueryFinalizer };
|
|
10
|
+
export { l as applySoftDeleteScope, o as applyTenantScope, s as isEmptyTenantScopedRead, c as isOrglessUserSubject, u as makeQueryFinalizer };
|
package/dist/tenantSelection.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TENANT_SELECTIONS_TABLE as e, deleteTenantSelection as t, readTenantSelection as n, tenantSelectionId as r, writeTenantSelection as i } from "@voltro/database";
|
|
2
2
|
import { isTenantSelectable as a, selectSubjectTenant as o } from "@voltro/protocol";
|
|
3
|
-
|
|
3
|
+
// src/tenantSelection.ts
|
|
4
4
|
var s = (e) => {
|
|
5
5
|
let r = () => {
|
|
6
6
|
let t = e();
|
|
@@ -23,5 +23,4 @@ var s = (e) => {
|
|
|
23
23
|
id: n.id
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
|
-
//#endregion
|
|
27
26
|
export { e as TENANT_SELECTIONS_TABLE, l as clearTenantSelection, c as selectTenant, r as tenantSelectionId, s as tenantSelectionStore };
|
package/dist/timeline.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { randomUUID as e } from "node:crypto";
|
|
2
2
|
import { BoundedRing as t } from "@voltro/protocol";
|
|
3
|
-
|
|
3
|
+
// src/timeline.ts
|
|
4
4
|
var n = (e = process.env) => {
|
|
5
5
|
let t = (e.VOLTRO_TIMELINE ?? "").toLowerCase();
|
|
6
6
|
return t === "off" || t === "0" || t === "false" ? "off" : t === "all" ? "all" : t === "interesting" || t === "on" || t === "1" || t === "true" ? "interesting" : e.NODE_ENV === "production" ? "off" : "interesting";
|
|
@@ -101,5 +101,4 @@ var n = (e = process.env) => {
|
|
|
101
101
|
t.invalidate();
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
|
-
//#endregion
|
|
105
104
|
export { u as TimelineRecorder, f as getTimelineRecorder, m as recordTimelineEvent, a as redactRow, n as resolveTimelineMode, c as reverseEventOverRows, p as setTimelineRecorderForTest };
|
package/dist/traceContext.js
CHANGED
package/dist/traceSink.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpanKind as e, SpanStatusCode as t } from "@opentelemetry/api";
|
|
2
|
-
|
|
2
|
+
// src/traceSink.ts
|
|
3
3
|
var n = {
|
|
4
4
|
[e.INTERNAL]: "internal",
|
|
5
5
|
[e.SERVER]: "server",
|
|
@@ -59,5 +59,4 @@ var n = {
|
|
|
59
59
|
forceFlush: () => Promise.resolve(),
|
|
60
60
|
shutdown: () => Promise.resolve()
|
|
61
61
|
});
|
|
62
|
-
//#endregion
|
|
63
62
|
export { l as makeBufferingSpanProcessor };
|
package/dist/traceSpansTable.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { id as e, integer as t, json as n, table as r, text as i, timestamp as a } from "@voltro/database";
|
|
2
|
-
|
|
2
|
+
// src/traceSpansTable.ts
|
|
3
3
|
var o = r("_voltro_traces", {
|
|
4
4
|
id: e({ prefix: "span" }),
|
|
5
5
|
traceId: i(),
|
|
@@ -25,5 +25,4 @@ var o = r("_voltro_traces", {
|
|
|
25
25
|
attributes: n().nullable(),
|
|
26
26
|
events: n().nullable()
|
|
27
27
|
}).index(["traceId", "startedAt"]).index(["startedAt"]).index(["status"]);
|
|
28
|
-
//#endregion
|
|
29
28
|
export { o as _voltroTracesTable };
|
package/dist/traceparent.js
CHANGED
|
@@ -1,34 +1,22 @@
|
|
|
1
1
|
import { Tracer as e } from "effect";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { newTraceId as t } from "@voltro/shared";
|
|
3
|
+
// src/traceparent.ts
|
|
4
|
+
var n = /^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/, r = (e) => `00-${e.traceId}-${e.spanId}-${e.sampled ? "01" : "00"}`, i = (e) => {
|
|
4
5
|
if (typeof e != "string") return null;
|
|
5
|
-
let
|
|
6
|
-
if (
|
|
7
|
-
let [, r, i, a] =
|
|
6
|
+
let t = n.exec(e.trim().toLowerCase());
|
|
7
|
+
if (t === null) return null;
|
|
8
|
+
let [, r, i, a] = t;
|
|
8
9
|
return r === "0".repeat(32) || i === "0".repeat(16) ? null : {
|
|
9
10
|
traceId: r,
|
|
10
11
|
spanId: i,
|
|
11
12
|
sampled: (parseInt(a, 16) & 1) == 1
|
|
12
13
|
};
|
|
13
|
-
},
|
|
14
|
-
let n =
|
|
14
|
+
}, a = (t) => {
|
|
15
|
+
let n = i(t);
|
|
15
16
|
if (n !== null) return e.externalSpan({
|
|
16
17
|
traceId: n.traceId,
|
|
17
18
|
spanId: n.spanId,
|
|
18
19
|
sampled: n.sampled
|
|
19
20
|
});
|
|
20
|
-
}, a = () => {
|
|
21
|
-
let e = globalThis.crypto, t = /* @__PURE__ */ new Uint8Array(16);
|
|
22
|
-
if (e?.getRandomValues !== void 0) e.getRandomValues(t);
|
|
23
|
-
else {
|
|
24
|
-
let e = `${Date.now().toString(16)}${Math.random().toString(16).slice(2)}`;
|
|
25
|
-
for (let n = 0; n < t.length; n += 1) {
|
|
26
|
-
let r = e.slice(n * 2 % e.length, n * 2 % e.length + 2);
|
|
27
|
-
t[n] = (parseInt(r, 16) || n + 1) ^ (Math.random() * 256 | 0);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
let n = Array.from(t, (e) => e.toString(16).padStart(2, "0")).join("");
|
|
31
|
-
return n === "0".repeat(32) ? `${"0".repeat(31)}1` : n;
|
|
32
21
|
};
|
|
33
|
-
|
|
34
|
-
export { i as externalSpanFromTraceparent, n as formatTraceparent, a as newTraceId, r as parseTraceparent };
|
|
22
|
+
export { a as externalSpanFromTraceparent, r as formatTraceparent, t as newTraceId, i as parseTraceparent };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isMachineSubject as e, tenantScopedSubject as t } from "@voltro/protocol";
|
|
2
|
-
|
|
2
|
+
// src/transactionSubject.ts
|
|
3
3
|
var n = (n, r, i) => {
|
|
4
4
|
if (r === void 0) return n;
|
|
5
5
|
if (r.trim() === "") throw Error("transaction tenantId must be non-empty");
|
|
@@ -8,5 +8,4 @@ var n = (n, r, i) => {
|
|
|
8
8
|
if (!e(n)) throw Error("only a system context — the framework itself, or another app calling a `service:` procedure — can select another transaction tenant");
|
|
9
9
|
return t(n, r);
|
|
10
10
|
};
|
|
11
|
-
//#endregion
|
|
12
11
|
export { n as resolveTransactionSubject };
|
package/dist/trustedProxy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bootRefusal as e } from "./
|
|
2
|
-
|
|
1
|
+
import { bootRefusal as e } from "./boot-refusal.js";
|
|
2
|
+
// src/trustedProxy.ts
|
|
3
3
|
var t = {
|
|
4
4
|
entries: [],
|
|
5
5
|
trustAll: !1
|
|
@@ -151,5 +151,4 @@ var t = {
|
|
|
151
151
|
let t = e.xForwardedProto;
|
|
152
152
|
return t === void 0 || t.trim() === "" || !(e.config.trustAll || e.config.hops !== void 0 || l(e.socketAddress, e.config)) ? !1 : t.split(",")[0].trim().toLowerCase() === "https";
|
|
153
153
|
};
|
|
154
|
-
//#endregion
|
|
155
154
|
export { t as NO_TRUSTED_PROXIES, a as ipToBytes, l as isTrustedProxy, n as normalizeIp, f as resolveClientAddress, m as resolveRequestClientAddress, h as resolveRequestIsHttps, u as resolveTrustedProxies };
|
package/dist/undo.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/undo.ts
|
|
2
2
|
var e = (e) => {
|
|
3
3
|
if (e.id !== void 0) return e.id;
|
|
4
4
|
let t = e.next?.id;
|
|
@@ -125,5 +125,4 @@ var e = (e) => {
|
|
|
125
125
|
}, c = async (e, t) => {
|
|
126
126
|
for (let n of t) await s(e, n);
|
|
127
127
|
};
|
|
128
|
-
//#endregion
|
|
129
128
|
export { r as UndoBoundaryError, a as UndoStack, s as applyInverse, c as applyInverses, o as forwardChangeFromCdc, t as invertChange, i as isSafeToApply, n as synthesizeInverse };
|
package/dist/undoBuiltins.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { applyInverses as e, isSafeToApply as t, synthesizeInverse as n } from "./undo.js";
|
|
2
2
|
import { eq as r } from "@voltro/database";
|
|
3
3
|
import { UndoConflict as i, UndoForbidden as a, UndoNotFound as o } from "@voltro/protocol";
|
|
4
|
-
|
|
4
|
+
// src/undoBuiltins.ts
|
|
5
5
|
var s = (e) => e.request?.subject?.id ?? null, c = (e) => e === !0 || e === 1, l = async (e, t, n) => (await e.query({
|
|
6
6
|
table: t,
|
|
7
7
|
predicate: r("id", n),
|
|
@@ -65,5 +65,4 @@ var s = (e) => e.request?.subject?.id ?? null, c = (e) => e === !0 || e === 1, l
|
|
|
65
65
|
}
|
|
66
66
|
return await t.store.update("_voltro_undo_log", e.invocationId, { undone: !1 }), { ok: !0 };
|
|
67
67
|
};
|
|
68
|
-
//#endregion
|
|
69
68
|
export { m as applyUndoInvocation, h as redoUndoInvocation, f as undoLogExecutor };
|
package/dist/undoCapture.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { eq as e } from "@voltro/database";
|
|
2
|
-
|
|
2
|
+
// src/undoCapture.ts
|
|
3
3
|
var t = (e = process.env) => {
|
|
4
4
|
let t = (e.VOLTRO_UNDO ?? "").toLowerCase();
|
|
5
5
|
return t === "on" || t === "1" || t === "true" ? !0 : t === "off" || t === "0" || t === "false" ? !1 : e.NODE_ENV !== "production";
|
|
@@ -70,5 +70,4 @@ var t = (e = process.env) => {
|
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
};
|
|
73
|
-
//#endregion
|
|
74
73
|
export { o as makeUndoCapture, t as undoCaptureEnabled, n as undoSurfaceEnabled, a as wrapCaptureStore };
|
package/dist/undoLogTable.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { boolean as e, id as t, table as n, text as r, timestamp as i } from "@voltro/database";
|
|
2
|
-
|
|
2
|
+
// src/undoLogTable.ts
|
|
3
3
|
var a = n("_voltro_undo_log", {
|
|
4
4
|
id: t({ prefix: "undo" }),
|
|
5
5
|
tag: r(),
|
|
@@ -12,5 +12,4 @@ var a = n("_voltro_undo_log", {
|
|
|
12
12
|
undone: e().default(!1),
|
|
13
13
|
createdAt: i().default("now")
|
|
14
14
|
}).index(["subjectId", "createdAt"]);
|
|
15
|
-
//#endregion
|
|
16
15
|
export { a as _voltroUndoLogTable };
|
package/dist/upsertBinding.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { and as e, eq as t } from "@voltro/database";
|
|
2
|
-
|
|
2
|
+
// src/upsertBinding.ts
|
|
3
3
|
var n = "id", r = async (r, i, a, o) => {
|
|
4
4
|
let s = o.map((e) => t(e, a[e]));
|
|
5
5
|
if (s.length === 0) return;
|
|
@@ -16,5 +16,4 @@ var n = "id", r = async (r, i, a, o) => {
|
|
|
16
16
|
let o = await r(e, t, i, a);
|
|
17
17
|
return o === void 0 ? i[n] : o;
|
|
18
18
|
};
|
|
19
|
-
//#endregion
|
|
20
19
|
export { r as upsertConflictId, i as upsertDestinationId };
|
package/dist/wakeOrchestrator.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { dueWakeups as e, releaseWakeup as t, tryClaimWakeup as n } from "./wakeRegistry.js";
|
|
2
|
-
|
|
2
|
+
// src/wakeOrchestrator.ts
|
|
3
3
|
var r = async (r) => {
|
|
4
4
|
let i = r.now?.() ?? /* @__PURE__ */ new Date(), a = await e(r.store, i, r.batchLimit ?? 100);
|
|
5
5
|
if (a.length === 0) return 0;
|
|
@@ -30,5 +30,4 @@ var r = async (r) => {
|
|
|
30
30
|
n = !0, i !== void 0 && clearTimeout(i);
|
|
31
31
|
} };
|
|
32
32
|
};
|
|
33
|
-
//#endregion
|
|
34
33
|
export { i as runWakeLoop, r as wakeDueOnce };
|
package/dist/wakeRegistry.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/wakeRegistry.ts
|
|
2
2
|
var e = "_voltro_wakeups", t = (e) => `${e.tenantId}:${e.kind}:${e.refId}`, n = (e) => ({
|
|
3
3
|
tenantId: String(e.tenantId),
|
|
4
4
|
kind: String(e.kind),
|
|
@@ -67,5 +67,4 @@ var e = "_voltro_wakeups", t = (e) => `${e.tenantId}:${e.kind}:${e.refId}`, n =
|
|
|
67
67
|
for (let n of i) a !== void 0 && (n.wakeAt instanceof Date ? n.wakeAt : new Date(String(n.wakeAt))).getTime() >= a || await t.delete(e, String(n.id)) && o++;
|
|
68
68
|
return o;
|
|
69
69
|
};
|
|
70
|
-
//#endregion
|
|
71
70
|
export { i as cancelWakeup, d as dueWakeups, a as markWakeupFired, f as nextWakeup, m as pruneWakeups, r as registerWakeup, c as releaseWakeup, s as tryClaimWakeup };
|
package/dist/wakeRouter.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as e from "node:http";
|
|
2
|
-
|
|
2
|
+
// src/wakeRouter.ts
|
|
3
3
|
var t = () => {
|
|
4
4
|
let e = 0, t = 0;
|
|
5
5
|
return {
|
|
@@ -59,5 +59,4 @@ var t = () => {
|
|
|
59
59
|
});
|
|
60
60
|
}), s;
|
|
61
61
|
};
|
|
62
|
-
//#endregion
|
|
63
62
|
export { t as makeRouterActivity, n as makeWakeGate, a as makeWakeProxyServer };
|
package/dist/wakeSupervisor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawn as e } from "node:child_process";
|
|
2
|
-
|
|
2
|
+
// src/wakeSupervisor.ts
|
|
3
3
|
var t = (e) => ({ wake: async () => {
|
|
4
4
|
await e.start();
|
|
5
5
|
} }), n = (e) => new Promise((t) => setTimeout(t, e)), r = (t) => {
|
|
@@ -58,5 +58,4 @@ var t = (e) => ({ wake: async () => {
|
|
|
58
58
|
stop: g
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
|
-
//#endregion
|
|
62
61
|
export { t as makeProcessAdapter, r as nodeProcessSupervisor };
|
package/dist/wakeupsTable.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { id as e, table as t, text as n, timestamp as r } from "@voltro/database";
|
|
2
|
-
|
|
2
|
+
// src/wakeupsTable.ts
|
|
3
3
|
var i = t("_voltro_wakeups", {
|
|
4
4
|
id: e({ prefix: "wakeup" }),
|
|
5
5
|
tenantId: n(),
|
|
@@ -8,5 +8,4 @@ var i = t("_voltro_wakeups", {
|
|
|
8
8
|
wakeAt: r(),
|
|
9
9
|
status: n()
|
|
10
10
|
}).index(["status", "wakeAt"]).index(["tenantId"]);
|
|
11
|
-
//#endregion
|
|
12
11
|
export { i as _voltroWakeupsTable };
|