@voltro/runtime 0.87.0 → 0.89.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 +272 -6
- package/THIRD-PARTY-NOTICES.md +644 -48
- 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 +1 -2
- package/dist/apiKeyUsage.js +1 -2
- package/dist/apiKeys.js +1 -2
- package/dist/apiKeysWiring.js +1 -2
- package/dist/apiRoleBucketSampler.js +1 -2
- package/dist/apiRoleWorkloadHistory.js +1 -2
- package/dist/apiRoleWorkloadMetrics.js +1 -2
- package/dist/apiRoleWorkloadStorage.js +1 -2
- package/dist/approvalBuiltins.js +1 -2
- package/dist/approvals.js +1 -2
- package/dist/authMiddlewareLayer.js +1 -2
- package/dist/bindEvent.js +1 -2
- package/dist/boot-refusal.d.ts +10 -0
- package/dist/{bootRefusal.js → boot-refusal.js} +1 -2
- package/dist/bootListener.js +154 -65
- package/dist/bootStoreCodec.js +1 -2
- package/dist/businessRules.js +1 -2
- package/dist/changeClaimsTable.js +1 -2
- package/dist/columnOnUpdate.js +1 -2
- package/dist/composeAnalytics.js +1 -2
- package/dist/computedQuery.js +1 -2
- package/dist/computedQueryCache.js +136 -78
- 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 +1 -2
- package/dist/coordinatedSchedule.js +1 -2
- 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 +1 -2
- package/dist/dataloader.js +1 -2
- package/dist/declaredTablesGuard.js +1 -2
- 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 +1 -2
- package/dist/effectStore.js +1 -2
- package/dist/engineClients.js +1 -2
- 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 +1 -2
- package/dist/fieldCipher.js +1 -2
- package/dist/fieldKeyRegistry.js +1 -2
- package/dist/fieldKeyRekey.js +1 -2
- package/dist/fieldKeyScan.js +1 -2
- package/dist/fieldKeyring.js +1 -2
- 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/hotDataStore.js +1 -2
- package/dist/hotDataStoreSnapshot.js +1 -2
- package/dist/hotDataStoreTables.js +1 -2
- package/dist/http-range.js +1 -2
- package/dist/httpClientSsrf.js +1 -2
- package/dist/httpClientTracing.js +1 -2
- package/dist/httpCompression.js +1 -2
- package/dist/httpInputStream.js +1 -2
- package/dist/httpKeepAlive.js +1 -2
- package/dist/httpRouteMounts.js +1 -2
- package/dist/idempotencyStore.js +1 -2
- package/dist/idleDetector.js +1 -2
- package/dist/index.d.ts +22 -2
- package/dist/index.js +109 -110
- 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 +1 -2
- package/dist/matcher.js +1 -2
- package/dist/memoryColumnDefaults.js +1 -2
- package/dist/memoryQueryJoins.js +1 -2
- package/dist/memorySetOperations.js +1 -2
- package/dist/metrics.js +1 -2
- package/dist/observability.js +2 -3
- package/dist/observedGraph.js +1 -2
- package/dist/originGuard.js +1 -2
- package/dist/outbox.js +1 -2
- 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 +1 -2
- package/dist/readScopePredicate.js +1 -2
- 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 +1 -2
- package/dist/requestLoader.js +1 -2
- package/dist/resumeCensus.js +1 -2
- package/dist/revalidation.js +1 -2
- package/dist/rowFilter.js +1 -2
- package/dist/rowStateBytes.js +1 -2
- package/dist/rpcBodyCap.js +1 -2
- package/dist/rpcConnections.js +1 -2
- package/dist/rpcDefectDiagnostics.js +1 -2
- package/dist/rpcServer.js +1 -2
- package/dist/rpcWorkloadAdmission.js +1 -2
- package/dist/runAsSystem.js +1 -2
- package/dist/rywPositionStore.js +1 -2
- 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 +4 -4
- package/dist/schemaRegistry.js +1 -2
- package/dist/secretsResolver.js +1 -2
- package/dist/securityHeaders.js +1 -2
- package/dist/servePipeline.js +198 -183
- package/dist/serverOnlyAudit.js +1 -2
- package/dist/serverTracer.js +1 -2
- package/dist/serviceCredentials.js +1 -2
- package/dist/setReadScopes.js +1 -2
- package/dist/singleNodeOrchestrator.js +1 -2
- package/dist/snapshotValueCodec.js +1 -2
- package/dist/sourceResolution.js +1 -2
- package/dist/storeMiddleware.js +3 -4
- package/dist/storeQuery.js +1 -2
- package/dist/storeRead.js +1 -2
- package/dist/subscriber.js +1 -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 +1 -2
- 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 +1 -2
- 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 +1 -2
- package/dist/webhookVerification.js +1 -2
- package/dist/wireColumnStrip.js +1 -2
- package/dist/workflowReadBuiltins.js +1 -2
- package/dist/workflowRuntime.js +1 -2
- package/package.json +26 -19
package/dist/storeMiddleware.js
CHANGED
|
@@ -16,7 +16,7 @@ import { INITIAL_VERSION as ie, VersionConflict as ae, and as y, classifyConstra
|
|
|
16
16
|
import { ConstraintViolation as ke, TableValidationFailed as w, TenantRowNotFound as Ae, TenantScopeViolation as je, ValidationError as Me, isMachineSubject as Ne, subjectAuditActorId as T } from "@voltro/protocol";
|
|
17
17
|
import { createLogger as Pe } from "@voltro/logger";
|
|
18
18
|
import { defaultCrdtBackend as E } from "@voltro/local-first";
|
|
19
|
-
|
|
19
|
+
// src/storeMiddleware.ts
|
|
20
20
|
var Fe = (e, t, n) => {
|
|
21
21
|
let r = me(e);
|
|
22
22
|
if (r === void 0) return t;
|
|
@@ -86,7 +86,7 @@ var Fe = (e, t, n) => {
|
|
|
86
86
|
let a = r.versionColumn(e);
|
|
87
87
|
if (a !== void 0) {
|
|
88
88
|
let e = n[a];
|
|
89
|
-
|
|
89
|
+
typeof e == "number" && Number.isFinite(e) || (n[a] = ie);
|
|
90
90
|
}
|
|
91
91
|
if (r.hasAudit(e)) {
|
|
92
92
|
let e = /* @__PURE__ */ new Date();
|
|
@@ -94,7 +94,7 @@ var Fe = (e, t, n) => {
|
|
|
94
94
|
}
|
|
95
95
|
r.hasTenant(e) && ("tenantId" in n || (M === null && ze(e), n.tenantId = M));
|
|
96
96
|
let o = r.defaultFactories(e);
|
|
97
|
-
if (o.size > 0) for (let [e, t] of o)
|
|
97
|
+
if (o.size > 0) for (let [e, t] of o) e in n && n[e] !== void 0 || (n[e] = t());
|
|
98
98
|
let s = r.computedFields(e);
|
|
99
99
|
if (s.size > 0) for (let [e, t] of s) n[e] = t(n);
|
|
100
100
|
let c = r.generatedColumns(e);
|
|
@@ -878,5 +878,4 @@ var Fe = (e, t, n) => {
|
|
|
878
878
|
super(e.message), this.conflict = e;
|
|
879
879
|
}
|
|
880
880
|
}, M = (e) => typeof e == "object" && !!e && e.name === "VoltroTransactionReadConflict" && "conflict" in e, N = Symbol.for("@voltro/runtime:tx-read-versions");
|
|
881
|
-
//#endregion
|
|
882
881
|
export { A as TRANSACTION_READ_CONFLICT_NAME, N as TX_READ_VERSIONS_KEY, j as TransactionReadConflict, Be as actingUserId, Re as applyDefined, M as isTransactionReadConflict, Ve as wrapStoreWithMixinBehaviour };
|
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,8 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// src/subscriber.ts
|
|
2
2
|
var e = (e) => {
|
|
3
3
|
if (e.eventTenant !== void 0 && typeof e.eventTenant != "function") throw Error("defineSubscriber: `eventTenant` must be a function");
|
|
4
4
|
if (e.once !== void 0 && e.eachReplica === !0) throw Error("defineSubscriber: choose either `once` or `eachReplica: true`, not both");
|
|
5
5
|
return e;
|
|
6
6
|
};
|
|
7
|
-
//#endregion
|
|
8
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,11 +1,10 @@
|
|
|
1
1
|
import { mapSetReadScopes as e } from "./setReadScopes.js";
|
|
2
2
|
import { addReadScopePredicate as t } from "./readScopePredicate.js";
|
|
3
3
|
import { eq as n, gt as r, isNull as i, or as a } from "@voltro/database";
|
|
4
|
-
|
|
4
|
+
// src/tenantScope.ts
|
|
5
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
6
|
n.observe?.beforeScope?.({ ...s }, c);
|
|
7
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
8
|
return n.observe?.afterScope?.({ ...p }), p;
|
|
9
9
|
};
|
|
10
|
-
//#endregion
|
|
11
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,6 +1,6 @@
|
|
|
1
1
|
import { Tracer as e } from "effect";
|
|
2
2
|
import { newTraceId as t } from "@voltro/shared";
|
|
3
|
-
|
|
3
|
+
// src/traceparent.ts
|
|
4
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) => {
|
|
5
5
|
if (typeof e != "string") return null;
|
|
6
6
|
let t = n.exec(e.trim().toLowerCase());
|
|
@@ -19,5 +19,4 @@ var n = /^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/, r = (e) => `00-${e.t
|
|
|
19
19
|
sampled: n.sampled
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
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 };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect as e, Schema as t } from "effect";
|
|
2
2
|
import { GATEWAY_CREDENTIAL_EXPIRED_CLOSE_CODE as n, Subject as r } from "@voltro/protocol";
|
|
3
3
|
import { Socket as i } from "effect/socket";
|
|
4
|
-
|
|
4
|
+
// src/webSocketGatewayRuntime.ts
|
|
5
5
|
var a = (a, o, s, c, l, u, d) => e.scoped(e.gen(function* () {
|
|
6
6
|
let f = yield* a.writer, p = yield* e.context(), m = new AbortController(), h = s.limits?.maxMessageBytes ?? 1048576, g = s.limits?.maxPendingBytes ?? 4194304, _ = s.limits?.maxPendingMessages ?? 64, v = [], y = s.limits?.maxInboundMessagesPerSecond, b = s.limits?.burst ?? y ?? 0, x = b, S = performance.now(), C = [], w = 0, T, E = 0, D, O, k, A = 0, j, M = s.auth === "token" ? "waiting" : "admitted", N = c, P = !1, F = !1, I = () => {
|
|
7
7
|
let e = D;
|
|
@@ -150,5 +150,4 @@ var a = (a, o, s, c, l, u, d) => e.scoped(e.gen(function* () {
|
|
|
150
150
|
}
|
|
151
151
|
}).pipe(e.ignore);
|
|
152
152
|
}));
|
|
153
|
-
//#endregion
|
|
154
153
|
export { a as runWebSocketGateway };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/webhookVerification.ts
|
|
2
2
|
var e = "voltroWebhookVerification", t = (e) => e === "signature" || e === "provider" || e === "none", n = (n) => {
|
|
3
3
|
if (typeof n != "function" && (typeof n != "object" || !n)) return;
|
|
4
4
|
let r = n[e];
|
|
@@ -14,5 +14,4 @@ var e = "voltroWebhookVerification", t = (e) => e === "signature" || e === "prov
|
|
|
14
14
|
for (let [t, i] of e) if (n(i.handle) === void 0) throw new r(t);
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
//#endregion
|
|
18
17
|
export { r as UnverifiedWebhookRoute, e as WEBHOOK_VERIFICATION_PROPERTY, i as assertWebhookRoutesDeclareVerification, n as webhookVerificationOf };
|
package/dist/wireColumnStrip.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getTable as e, readableByColumns as t, serverOnlyColumns as n } from "@voltro/database";
|
|
2
2
|
import { ADMIN_SCOPE as r, effectiveScopes as i, hasEffectiveScope as a } from "@voltro/protocol";
|
|
3
3
|
import { types as o } from "node:util";
|
|
4
|
-
|
|
4
|
+
// src/wireColumnStrip.ts
|
|
5
5
|
var s = Array.prototype.includes, c = (e) => !o.isProxy(e) && Object.getPrototypeOf(e) === Array.prototype && Object.getOwnPropertyDescriptor(Array.prototype, "includes")?.value === s && Reflect.ownKeys(e).every((t) => {
|
|
6
6
|
if (typeof t != "string" || t !== "length" && !/^(0|[1-9][0-9]*)$/.test(t)) return !1;
|
|
7
7
|
let n = Object.getOwnPropertyDescriptor(e, t);
|
|
@@ -80,5 +80,4 @@ var s = Array.prototype.includes, c = (e) => !o.isProxy(e) && Object.getPrototyp
|
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
82
|
};
|
|
83
|
-
//#endregion
|
|
84
83
|
export { g as createDispatchWireStrip, p as forbiddenColumnsForSubject, u as serverOnlyColumnNames, d as stripColumnsFromRows, m as stripForbiddenForWire, f as stripServerOnlyForWire };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { and as e, eq as t } from "@voltro/database";
|
|
2
2
|
import { ADMIN_SCOPE as n, hasEffectiveScope as r } from "@voltro/protocol";
|
|
3
3
|
import { openWorkflowRow as i } from "@voltro/workflow";
|
|
4
|
-
|
|
4
|
+
// src/workflowReadBuiltins.ts
|
|
5
5
|
var a = (e) => e.request?.subject ?? null, o = (e, t) => {
|
|
6
6
|
if (typeof e != "object" || !e) return null;
|
|
7
7
|
let n = e[t];
|
|
@@ -83,5 +83,4 @@ var a = (e) => e.request?.subject ?? null, o = (e, t) => {
|
|
|
83
83
|
projection: void 0
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
|
-
//#endregion
|
|
87
86
|
export { _ as workflowDomainEventsExecutor, v as workflowEventDeliveriesExecutor, s as workflowRowVisibleTo, h as workflowRunEventsExecutor, f as workflowRunExecutor, m as workflowRunStepsExecutor, p as workflowRunsExecutor };
|
package/dist/workflowRuntime.js
CHANGED
|
@@ -6,7 +6,7 @@ import { SubjectService as d, WorkflowControlResultSchema as f, WorkflowQueuedCa
|
|
|
6
6
|
import { createLogger as x } from "@voltro/logger";
|
|
7
7
|
import { executePreparedWorkflow as S, getCurrentWorkflowExecutionId as C, hasPreparedWorkflowExecution as w } from "@voltro/workflow";
|
|
8
8
|
import * as T from "effect/SchemaAST";
|
|
9
|
-
|
|
9
|
+
// src/workflowRuntime.ts
|
|
10
10
|
var E = class extends l.TaggedError()("WorkflowStartNotExecuted", {
|
|
11
11
|
workflowName: l.String,
|
|
12
12
|
handleId: l.String,
|
|
@@ -704,5 +704,4 @@ var E = class extends l.TaggedError()("WorkflowStartNotExecuted", {
|
|
|
704
704
|
return a.provide(m, h);
|
|
705
705
|
}));
|
|
706
706
|
})));
|
|
707
|
-
//#endregion
|
|
708
707
|
export { V as WorkflowPayloadError, P as WorkflowRateLimitedError, F as WorkflowSingletonHeldError, E as WorkflowStartNotExecuted, Y as makeLazyWorkflowFacade, q as makeTransactionalWorkflowFacade, G as makeWorkflowFacade, J as makeWorkflowFacadeWithCallerContext, X as makeWorkflowHandlers, Z as makeWorkflowLayers, L as makeWorkflowRunHandle, U as payloadPropertyNames };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voltro/runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.89.0",
|
|
4
4
|
"description": "The Voltro server runtime — AppContext assembly, the dispatcher, handler layers, API keys, coordinated scheduling, and analytics composition.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"voltro",
|
|
@@ -33,6 +33,11 @@
|
|
|
33
33
|
"import": "./dist/http-range.js",
|
|
34
34
|
"default": "./dist/http-range.js"
|
|
35
35
|
},
|
|
36
|
+
"./boot-refusal": {
|
|
37
|
+
"types": "./dist/boot-refusal.d.ts",
|
|
38
|
+
"import": "./dist/boot-refusal.js",
|
|
39
|
+
"default": "./dist/boot-refusal.js"
|
|
40
|
+
},
|
|
36
41
|
"./package.json": "./package.json"
|
|
37
42
|
},
|
|
38
43
|
"main": "./dist/index.js",
|
|
@@ -43,28 +48,30 @@
|
|
|
43
48
|
"node": ">=24.0.0"
|
|
44
49
|
},
|
|
45
50
|
"dependencies": {
|
|
46
|
-
"@effect/platform-node": "4.0
|
|
47
|
-
"@effect/platform-node-shared": "4.0
|
|
48
|
-
"@
|
|
51
|
+
"@effect/platform-node": "4.1.0",
|
|
52
|
+
"@effect/platform-node-shared": "4.1.0",
|
|
53
|
+
"@nats-io/transport-node": "^3.4.0",
|
|
54
|
+
"@opentelemetry/api": "~1.9.1",
|
|
49
55
|
"@opentelemetry/exporter-metrics-otlp-http": "^0.222.0",
|
|
50
56
|
"@opentelemetry/exporter-trace-otlp-http": "^0.222.0",
|
|
51
|
-
"@opentelemetry/resources": "^2.
|
|
52
|
-
"@opentelemetry/sdk-metrics": "^2.
|
|
53
|
-
"@opentelemetry/sdk-trace-base": "^2.
|
|
54
|
-
"@opentelemetry/sdk-trace-node": "^2.
|
|
55
|
-
"@opentelemetry/semantic-conventions": "^1.
|
|
56
|
-
"@
|
|
57
|
-
"@voltro/
|
|
58
|
-
"@voltro/
|
|
59
|
-
"@voltro/
|
|
60
|
-
"@voltro/
|
|
61
|
-
"@voltro/
|
|
62
|
-
"@voltro/
|
|
63
|
-
"
|
|
57
|
+
"@opentelemetry/resources": "^2.12.0",
|
|
58
|
+
"@opentelemetry/sdk-metrics": "^2.12.0",
|
|
59
|
+
"@opentelemetry/sdk-trace-base": "^2.12.0",
|
|
60
|
+
"@opentelemetry/sdk-trace-node": "^2.12.0",
|
|
61
|
+
"@opentelemetry/semantic-conventions": "^1.44.0",
|
|
62
|
+
"@upstash/redis": "^1.40.0",
|
|
63
|
+
"@voltro/database": "0.89.0",
|
|
64
|
+
"@voltro/kv": "0.89.0",
|
|
65
|
+
"@voltro/local-first": "0.89.0",
|
|
66
|
+
"@voltro/logger": "0.89.0",
|
|
67
|
+
"@voltro/protocol": "0.89.0",
|
|
68
|
+
"@voltro/shared": "0.89.0",
|
|
69
|
+
"@voltro/workflow": "0.89.0",
|
|
70
|
+
"ioredis": "^6.0.0"
|
|
64
71
|
},
|
|
65
72
|
"peerDependencies": {
|
|
66
|
-
"@effect/opentelemetry": "4.0
|
|
67
|
-
"effect": "4.0
|
|
73
|
+
"@effect/opentelemetry": "4.1.0",
|
|
74
|
+
"effect": "4.1.0"
|
|
68
75
|
},
|
|
69
76
|
"peerDependenciesMeta": {
|
|
70
77
|
"@effect/opentelemetry": {
|