@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
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Context as e, Option as t } from "effect";
|
|
2
|
+
import { EventRpcWorkload as n } from "@voltro/protocol";
|
|
3
|
+
import { RpcGroup as r, RpcSchema as i } from "effect/rpc";
|
|
4
|
+
// src/rpcWorkloadAdmission.ts
|
|
5
|
+
var a = (e) => {
|
|
6
|
+
if (e === void 0) return;
|
|
7
|
+
if (!e || typeof e != "object" || Array.isArray(e) || ![Object.prototype, null].includes(Object.getPrototypeOf(e))) throw Error("Invalid RPC workload admission");
|
|
8
|
+
let t = /* @__PURE__ */ new Map();
|
|
9
|
+
for (let n of Reflect.ownKeys(e)) {
|
|
10
|
+
let r = Object.getOwnPropertyDescriptor(e, n);
|
|
11
|
+
if (typeof n != "string" || ![
|
|
12
|
+
"rpc",
|
|
13
|
+
"subscriptions",
|
|
14
|
+
"events",
|
|
15
|
+
"routes"
|
|
16
|
+
].includes(n) || !r.enumerable || !("value" in r)) throw Error("RPC workload admission requires own data");
|
|
17
|
+
t.set(n, r.value);
|
|
18
|
+
}
|
|
19
|
+
let n = t.get("rpc"), r = t.get("subscriptions"), i = t.get("routes");
|
|
20
|
+
if (typeof n != "boolean" || typeof r != "boolean") throw Error("RPC workload admission requires explicit modes");
|
|
21
|
+
let a = t.get("events");
|
|
22
|
+
if (a !== void 0 && typeof a != "boolean") throw Error("Invalid event workload admission");
|
|
23
|
+
let o;
|
|
24
|
+
if (i !== void 0) {
|
|
25
|
+
if (!Array.isArray(i) || i.length > 4096 || Reflect.ownKeys(i).length !== i.length + 1) throw Error("Invalid RPC workload route filters");
|
|
26
|
+
let e = [];
|
|
27
|
+
for (let t = 0; t < i.length; t++) {
|
|
28
|
+
let n = Object.getOwnPropertyDescriptor(i, String(t));
|
|
29
|
+
if (!n?.enumerable || !("value" in n) || typeof n.value != "string" || n.value.length > 191 || !/^(?:[A-Za-z][A-Za-z0-9_-]*\.)*[A-Za-z][A-Za-z0-9_-]*(?:\.\*)?$/.test(n.value)) throw Error("Invalid RPC workload tag filter");
|
|
30
|
+
e.push(n.value);
|
|
31
|
+
}
|
|
32
|
+
if (new Set(e).size !== e.length) throw Error("Duplicate RPC workload tag filter");
|
|
33
|
+
o = Object.freeze(e);
|
|
34
|
+
}
|
|
35
|
+
return Object.freeze({
|
|
36
|
+
rpc: n,
|
|
37
|
+
subscriptions: r,
|
|
38
|
+
...a === void 0 ? {} : { events: a },
|
|
39
|
+
...o === void 0 ? {} : { routes: o }
|
|
40
|
+
});
|
|
41
|
+
}, o = (a, o, s) => {
|
|
42
|
+
if (!o) return a;
|
|
43
|
+
let c = [...a.requests.values()].filter((r) => {
|
|
44
|
+
let a = r, c = t.isSome(e.getOption(a.annotations, n)), l = o.events ?? o.subscriptions;
|
|
45
|
+
return (c ? l && (s === "websocket" || o.rpc) : s === "http" ? o.rpc : i.isStreamSchema(a.successSchema) ? o.subscriptions : o.rpc) && (o.routes === void 0 || o.routes.some((e) => e.endsWith(".*") ? r._tag.startsWith(e.slice(0, -1)) : r._tag === e));
|
|
46
|
+
});
|
|
47
|
+
return r.make(...c).annotateMerge(a.annotations);
|
|
48
|
+
};
|
|
49
|
+
export { a as captureRpcWorkloadAdmission, o as selectRpcWorkloadGroup };
|
package/dist/runAsSystem.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NO_ROW_FILTER as e } from "./rowFilter.js";
|
|
2
2
|
import { wrapStoreWithMixinBehaviour as t } from "./storeMiddleware.js";
|
|
3
3
|
import { systemSubject as n } from "@voltro/protocol";
|
|
4
|
-
|
|
4
|
+
// src/runAsSystem.ts
|
|
5
5
|
var r, i = (e) => {
|
|
6
6
|
r = e;
|
|
7
7
|
}, a = () => {
|
|
@@ -19,5 +19,4 @@ var r, i = (e) => {
|
|
|
19
19
|
})
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
export { a as clearSystemStoreHandle, o as getSystemStoreHandle, s as runAsSystem, i as setSystemStoreHandle };
|
package/dist/rywPositionStore.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Effect as e } from "effect";
|
|
2
|
+
import { createLogger as t } from "@voltro/logger";
|
|
3
|
+
// src/rywPositionStore.ts
|
|
4
|
+
var n = t({ scope: "voltro:ryw" }), r = (e = {}) => {
|
|
4
5
|
let t = e.now ?? Date.now, n = /* @__PURE__ */ new Map();
|
|
5
6
|
return {
|
|
6
7
|
get(e) {
|
|
@@ -20,65 +21,98 @@ var t = e({ scope: "voltro:ryw" }), n = (e = {}) => {
|
|
|
20
21
|
return n.size;
|
|
21
22
|
}
|
|
22
23
|
};
|
|
23
|
-
},
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
expiresAt: e.expiresAt
|
|
36
|
-
});
|
|
37
|
-
} else s.delete(e.subjectKey);
|
|
24
|
+
}, i = (e, t) => e === null ? t === void 0 ? "anon:bg" : `anon:${t}` : `subject:${e}`, a = (t) => e.gen(function* () {
|
|
25
|
+
let r = yield* e.context(), i = e.runPromiseWith(r), a = t.now ?? Date.now, s = t.keyPrefix.trim();
|
|
26
|
+
if (s.length === 0) throw Error("RYW keyPrefix must name an application/environment namespace");
|
|
27
|
+
let c = t.channel ?? `${s}:bus`;
|
|
28
|
+
if (c.trim().length === 0) throw Error("RYW channel must not be empty");
|
|
29
|
+
let l = t.onError ?? ((e, t) => {
|
|
30
|
+
n.warn("redis operation failed", { op: t });
|
|
31
|
+
}), u = (e, t) => {
|
|
32
|
+
try {
|
|
33
|
+
l(e, t);
|
|
34
|
+
} catch {
|
|
35
|
+
n.warn("redis error observer failed", { op: t });
|
|
38
36
|
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
}, d = `${process.pid}:${Math.random()}:${a()}`, f = /* @__PURE__ */ new Map(), p = !1, m = Promise.resolve(), h, g = yield* t.pubsub.subscribe(c, (e) => {
|
|
38
|
+
if (!p) try {
|
|
39
|
+
let t = o(e);
|
|
40
|
+
if (t.senderId === d) return;
|
|
41
|
+
t.op === "delete" ? f.delete(t.subjectKey) : t.expiresAt > a() ? f.set(t.subjectKey, {
|
|
42
|
+
position: t.position,
|
|
43
|
+
expiresAt: t.expiresAt
|
|
44
|
+
}) : f.delete(t.subjectKey);
|
|
44
45
|
} catch (e) {
|
|
45
|
-
|
|
46
|
+
u(e, "parse");
|
|
46
47
|
}
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
}).pipe(e.onError(() => t.pubsub.close)), _ = (e, n) => {
|
|
49
|
+
m = m.then(async () => {
|
|
50
|
+
try {
|
|
51
|
+
await n(), await i(t.pubsub.publish(c, JSON.stringify(e)));
|
|
52
|
+
} catch (t) {
|
|
53
|
+
u(t, e.op);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}, v = () => {
|
|
57
|
+
if (p) throw Error("RYW consumer is closed");
|
|
58
|
+
};
|
|
52
59
|
return {
|
|
53
60
|
get(e) {
|
|
54
|
-
let t =
|
|
61
|
+
let t = f.get(e);
|
|
55
62
|
if (t !== void 0) {
|
|
56
|
-
if (t.expiresAt <=
|
|
63
|
+
if (t.expiresAt <= a()) f.delete(e);
|
|
57
64
|
else return t;
|
|
58
65
|
}
|
|
59
66
|
},
|
|
60
|
-
set(
|
|
61
|
-
|
|
62
|
-
let
|
|
63
|
-
|
|
64
|
-
senderId:
|
|
67
|
+
set(e, n) {
|
|
68
|
+
v();
|
|
69
|
+
let r = { ...n };
|
|
70
|
+
f.set(e, r), _({
|
|
71
|
+
senderId: d,
|
|
65
72
|
op: "set",
|
|
66
|
-
subjectKey:
|
|
67
|
-
|
|
68
|
-
|
|
73
|
+
subjectKey: e,
|
|
74
|
+
...r
|
|
75
|
+
}, () => {
|
|
76
|
+
let n = r.expiresAt - a();
|
|
77
|
+
return n > 0 ? t.client.psetex(`${s}:${e}`, n, JSON.stringify(r)) : t.client.del([`${s}:${e}`]);
|
|
69
78
|
});
|
|
70
79
|
},
|
|
71
|
-
delete(
|
|
72
|
-
|
|
73
|
-
senderId:
|
|
80
|
+
delete(e) {
|
|
81
|
+
v(), f.delete(e), _({
|
|
82
|
+
senderId: d,
|
|
74
83
|
op: "delete",
|
|
75
|
-
subjectKey:
|
|
76
|
-
});
|
|
84
|
+
subjectKey: e
|
|
85
|
+
}, () => t.client.del([`${s}:${e}`]));
|
|
77
86
|
},
|
|
78
|
-
size()
|
|
79
|
-
|
|
80
|
-
|
|
87
|
+
size: () => f.size,
|
|
88
|
+
close: () => h ??= (async () => {
|
|
89
|
+
p = !0, await m;
|
|
90
|
+
try {
|
|
91
|
+
await i(g);
|
|
92
|
+
} finally {
|
|
93
|
+
try {
|
|
94
|
+
await i(t.pubsub.close);
|
|
95
|
+
} finally {
|
|
96
|
+
f.clear();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
})()
|
|
100
|
+
};
|
|
101
|
+
}), o = (e) => {
|
|
102
|
+
let t = JSON.parse(e);
|
|
103
|
+
if (typeof t != "object" || !t || !("senderId" in t) || typeof t.senderId != "string" || !("subjectKey" in t) || typeof t.subjectKey != "string" || !("op" in t) || t.op !== "set" && t.op !== "delete") throw Error("Invalid RYW message");
|
|
104
|
+
if (t.op === "delete") return {
|
|
105
|
+
senderId: t.senderId,
|
|
106
|
+
subjectKey: t.subjectKey,
|
|
107
|
+
op: "delete"
|
|
108
|
+
};
|
|
109
|
+
if (!("position" in t) || typeof t.position != "string" || !("expiresAt" in t) || typeof t.expiresAt != "number" || !Number.isFinite(t.expiresAt)) throw Error("Invalid RYW position");
|
|
110
|
+
return {
|
|
111
|
+
senderId: t.senderId,
|
|
112
|
+
subjectKey: t.subjectKey,
|
|
113
|
+
op: "set",
|
|
114
|
+
position: t.position,
|
|
115
|
+
expiresAt: t.expiresAt
|
|
81
116
|
};
|
|
82
117
|
};
|
|
83
|
-
|
|
84
|
-
export { r as buildSubjectKey, n as memoryRywPositionStore, i as redisRywPositionStore };
|
|
118
|
+
export { i as buildSubjectKey, r as memoryRywPositionStore, a as redisRywPositionStore };
|
package/dist/schedule.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Cron as e, Result as t } from "effect";
|
|
2
|
-
|
|
2
|
+
// src/schedule.ts
|
|
3
3
|
var n = Symbol.for("@voltro/ScheduleDefinition"), r = (e) => typeof e == "object" && !!e && n in e, i = 18e5, a = (r) => {
|
|
4
4
|
let i = e.parse(r.cron, r.timezone);
|
|
5
5
|
if (t.isFailure(i)) throw Error(`defineSchedule("${r.name}"): invalid cron expression "${r.cron}" (tz="${r.timezone}") — ${String(i.failure)}`);
|
|
@@ -19,5 +19,4 @@ Use a five-field expression, or leave this schedule on trigger: 'self' (the in-a
|
|
|
19
19
|
for (; c.getTime() <= r.getTime() && s.length <= i;) s.push(c), c = e.next(a, c);
|
|
20
20
|
return s;
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
export { i as DEFAULT_MAX_RUNTIME_MS, o as compileCron, c as cronOccurrences, a as defineSchedule, r as isScheduleDefinition, s as nextFiring };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema as e } from "effect";
|
|
2
2
|
import { and as t, eq as n, id as r, integer as i, isNull as a, json as o, lt as s, table as c, text as l, timestamp as u } from "@voltro/database";
|
|
3
3
|
import { ScheduleBackfillRequestConflict as d } from "@voltro/protocol/inspect";
|
|
4
|
-
|
|
4
|
+
// src/scheduleBackfillRequests.ts
|
|
5
5
|
var f = 5e3, p = 3e4, m = "_voltro_schedule_backfill_requests", h = c(m, {
|
|
6
6
|
id: r({ prefix: "schbackfill" }),
|
|
7
7
|
name: l(),
|
|
@@ -147,5 +147,4 @@ var f = 5e3, p = 3e4, m = "_voltro_schedule_backfill_requests", h = c(m, {
|
|
|
147
147
|
error: "Scheduler stopped before the backfill settled",
|
|
148
148
|
updatedAt: /* @__PURE__ */ new Date()
|
|
149
149
|
}, { where: t(n("status", "running"), n("owner", r)) }));
|
|
150
|
-
//#endregion
|
|
151
150
|
export { f as SCHEDULE_BACKFILL_HEARTBEAT_MS, m as SCHEDULE_BACKFILL_REQUESTS_TABLE, p as SCHEDULE_BACKFILL_STALE_MS, b as acceptScheduleBackfillRequest, x as claimScheduleBackfillRequest, S as executeScheduleBackfillRequest, w as interruptOwnedScheduleBackfills, C as interruptStaleScheduleBackfills, y as readScheduleBackfillRequest, h as scheduleBackfillRequestsTable };
|
|
@@ -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/scheduleClaimsTable.ts
|
|
3
3
|
var i = t("_voltro_schedule_claims", {
|
|
4
4
|
id: e({ prefix: "schclaim" }),
|
|
5
5
|
scheduleName: n(),
|
|
@@ -7,5 +7,4 @@ var i = t("_voltro_schedule_claims", {
|
|
|
7
7
|
claimedBy: n(),
|
|
8
8
|
claimedAt: r()
|
|
9
9
|
}).index(["scheduleName", "claimedAt"]).index(["claimedAt"]);
|
|
10
|
-
//#endregion
|
|
11
10
|
export { i as _voltroScheduleClaimsTable };
|
|
@@ -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/scheduleRunsTable.ts
|
|
3
3
|
var o = r("_voltro_schedule_runs", {
|
|
4
4
|
id: e({ prefix: "schrun" }),
|
|
5
5
|
name: i(),
|
|
@@ -33,5 +33,4 @@ var o = r("_voltro_schedule_runs", {
|
|
|
33
33
|
heartbeatAt: a().nullable(),
|
|
34
34
|
result: n().nullable()
|
|
35
35
|
}).index(["name", "scheduledAt"]).index(["status"]);
|
|
36
|
-
//#endregion
|
|
37
36
|
export { o as _voltroScheduleRunsTable };
|
package/dist/scheduler.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Cron as g, Effect as ne } from "effect";
|
|
|
9
9
|
import { and as _, eq as v, extractDbCause as y, lt as re } from "@voltro/database";
|
|
10
10
|
import { randomUUID as ie } from "node:crypto";
|
|
11
11
|
import { publishServerError as ae } from "@voltro/protocol";
|
|
12
|
-
|
|
12
|
+
// src/scheduler.ts
|
|
13
13
|
var b = c, x = "default", S = {
|
|
14
14
|
kind: "single",
|
|
15
15
|
tryClaim: async () => !0
|
|
@@ -363,7 +363,10 @@ var b = c, x = "default", S = {
|
|
|
363
363
|
let n = typeof t.workflow.payload == "function" ? await t.workflow.payload(a) : t.workflow.payload ?? {};
|
|
364
364
|
await e.start(t.workflow.name, n);
|
|
365
365
|
}
|
|
366
|
-
t.handler !== void 0
|
|
366
|
+
if (t.handler !== void 0) {
|
|
367
|
+
let n = t.handler, r = x.measureSync ? x.measureSync(() => n(a)) : n(a);
|
|
368
|
+
await e(r, (e) => x.runEffect ? x.runEffect(e, m.signal) : ne.runPromise(e, { signal: m.signal }));
|
|
369
|
+
}
|
|
367
370
|
}, h = k ? k(c, {
|
|
368
371
|
name: t.name,
|
|
369
372
|
scheduledAt: n,
|
|
@@ -662,6 +665,7 @@ Give each a five-field expression, or set trigger: 'self' on it.`);
|
|
|
662
665
|
};
|
|
663
666
|
Ge.length > 0 && Q !== "off" && Ye();
|
|
664
667
|
let Xe = async (e, t) => {
|
|
668
|
+
if (I) throw Error("scheduler stopped");
|
|
665
669
|
let n = V.get(e);
|
|
666
670
|
if (!n) return {
|
|
667
671
|
kind: "unknownSchedule",
|
|
@@ -730,6 +734,7 @@ Give each a five-field expression, or set trigger: 'self' on it.`);
|
|
|
730
734
|
for (let e of X) Fe(e);
|
|
731
735
|
}
|
|
732
736
|
return {
|
|
737
|
+
isRunning: () => !I,
|
|
733
738
|
triggerExternal: async (e, t) => {
|
|
734
739
|
let r = await Xe(e, t);
|
|
735
740
|
return n(e, r.kind), r;
|
|
@@ -831,5 +836,4 @@ Give each a five-field expression, or set trigger: 'self' on it.`);
|
|
|
831
836
|
for (let [n, r] of Object.entries(e)) t[n] = r instanceof Date ? r.toISOString() : r;
|
|
832
837
|
return t;
|
|
833
838
|
};
|
|
834
|
-
//#endregion
|
|
835
839
|
export { w as CLAIM_RETENTION_BUCKETS, oe as DEFAULT_CLAIM_BUCKET_MS, ce as DEFAULT_EXTERNAL_RECONCILE_MS, se as DEFAULT_EXTERNAL_TRIGGER_SKEW_MS, fe as DEFAULT_SCHEDULE_HEARTBEAT_MS, x as DORMANCY_WAKEUP_TENANT, le as EXTERNAL_TRIGGER_AHEAD_TOLERANCE_MS, b as SCHEDULE_SUBJECT, de as TERMINAL_RUN_STATUSES, T as claimGraceMs, E as makeAdvisoryLockCoordinator, A as peerRunIsAlive, S as singleCoordinator, j as startScheduler };
|
package/dist/schemaRegistry.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/schemaRegistry.ts
|
|
2
2
|
var e = "voltro/audit", t = "voltro/softDelete", n = "voltro/expires", r = "voltro/tenant", i = "voltro/localFirst", a = (e) => {
|
|
3
3
|
let t = /* @__PURE__ */ new Map();
|
|
4
4
|
for (let n of e) {
|
|
@@ -61,5 +61,4 @@ var e = "voltro/audit", t = "voltro/softDelete", n = "voltro/expires", r = "volt
|
|
|
61
61
|
validatePatchSchema: (e) => t.get(e)?.validatePatchSchema
|
|
62
62
|
};
|
|
63
63
|
}, o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = [], l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), d = a([]);
|
|
64
|
-
//#endregion
|
|
65
64
|
export { e as VOLTRO_AUDIT_MIXIN_ID, n as VOLTRO_EXPIRES_MIXIN_ID, i as VOLTRO_LOCAL_FIRST_MIXIN_ID, t as VOLTRO_SOFT_DELETE_MIXIN_ID, r as VOLTRO_TENANT_MIXIN_ID, d as emptySchemaRegistry, a as makeSchemaRegistry };
|
package/dist/secretsResolver.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/secretsResolver.ts
|
|
2
2
|
var e = { get: (e) => Promise.resolve(process.env[e]) }, t = e, n = (e) => {
|
|
3
3
|
t = e;
|
|
4
4
|
}, r = () => {
|
|
@@ -31,5 +31,4 @@ var e = { get: (e) => Promise.resolve(process.env[e]) }, t = e, n = (e) => {
|
|
|
31
31
|
return typeof t == "string" ? t : void 0;
|
|
32
32
|
} };
|
|
33
33
|
}, c = (t) => t === void 0 || t === "env" || typeof t == "object" && t.kind === "env" ? e : t.kind === "custom" ? t.backend : t.kind === "http" ? s(t) : e;
|
|
34
|
-
//#endregion
|
|
35
34
|
export { o as cachedBackend, e as envSecretsBackend, s as httpSecretsBackend, r as resetSecretsBackend, i as resolveSecret, a as resolveSecretSync, c as resolveSecretsBackend, n as setSecretsBackend };
|
package/dist/securityHeaders.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/securityHeaders.ts
|
|
2
2
|
var e = "default-src 'none'; frame-ancestors 'none'; base-uri 'none'; form-action 'none'", t = "frame-ancestors 'none'; base-uri 'none'; object-src 'none'", n = "max-age=15552000; includeSubDomains", r = /* @__PURE__ */ new Set(["no-referrer"]), i = (e) => {
|
|
3
3
|
if (e === !1) return !0;
|
|
4
4
|
let t = e.split(",").map((e) => e.trim().toLowerCase()).filter((e) => e !== ""), n = t[t.length - 1];
|
|
@@ -29,5 +29,4 @@ var e = "default-src 'none'; frame-ancestors 'none'; base-uri 'none'; form-actio
|
|
|
29
29
|
for (let [t, n] of Object.entries(e.extra)) r[t.toLowerCase()] = n;
|
|
30
30
|
return r;
|
|
31
31
|
};
|
|
32
|
-
//#endregion
|
|
33
32
|
export { e as API_CSP, n as DEFAULT_HSTS, t as HTML_CSP, r as ORIGIN_NULLING_REFERRER_POLICIES, i as preservesSameOriginHeader, s as resolveSecurityHeaders, c as securityHeadersFor };
|