@voltro/protocol 0.63.0 → 0.65.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 +157 -0
- package/dist/index.d.ts +430 -29
- package/dist/index.js +532 -473
- package/dist/rest.d.ts +28 -3
- package/dist/rest.js +13 -13
- package/dist/{scopes-B0kGvAnI.js → scopes-C86BDyNJ.js} +120 -77
- package/dist/{serverErrorBus-BeN9pOpY.js → serverErrorBus-QQgyq6fV.js} +15 -7
- package/dist/session.js +6 -6
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
import { A as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as ee, L as te, M as ne, N as
|
|
2
|
-
import { a as Ne, c as Pe, i as Fe, n as Ie, o as Le, r as Re, s as ze, t as Be } from "./serverErrorBus-
|
|
3
|
-
import { Context as
|
|
4
|
-
import { Rpc as
|
|
1
|
+
import { A as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, K as ee, L as te, M as ne, N as re, O as ie, P as l, R as ae, S as oe, T as se, U as ce, V as le, W as ue, _ as de, a as u, b as fe, c as pe, d as me, f as he, g as d, h as ge, i as _e, j as ve, k as ye, l as be, m as xe, n as Se, o as Ce, p as we, r as Te, s as Ee, t as De, u as Oe, v as ke, w as Ae, x as je, y as f, z as Me } from "./scopes-C86BDyNJ.js";
|
|
2
|
+
import { a as Ne, c as Pe, i as p, l as Fe, n as Ie, o as Le, r as Re, s as ze, t as Be, u as Ve } from "./serverErrorBus-QQgyq6fV.js";
|
|
3
|
+
import { Context as He, Layer as Ue, Schema as m } from "effect";
|
|
4
|
+
import { Rpc as h } from "@effect/rpc";
|
|
5
|
+
import { VersionConflict as We } from "@voltro/database/wire";
|
|
5
6
|
//#region src/rowPatch.ts
|
|
6
|
-
var
|
|
7
|
-
key:
|
|
8
|
-
value:
|
|
9
|
-
}).pipe(
|
|
10
|
-
op:
|
|
11
|
-
path:
|
|
12
|
-
value:
|
|
13
|
-
}),
|
|
14
|
-
op:
|
|
15
|
-
path:
|
|
16
|
-
value:
|
|
17
|
-
}),
|
|
18
|
-
op:
|
|
19
|
-
path:
|
|
20
|
-
}),
|
|
21
|
-
op:
|
|
22
|
-
path:
|
|
23
|
-
value:
|
|
24
|
-
key:
|
|
25
|
-
value:
|
|
7
|
+
var Ge = m.Union(m.String, m.Number), g = m.Record({
|
|
8
|
+
key: m.String,
|
|
9
|
+
value: m.Unknown
|
|
10
|
+
}).pipe(m.filter((e) => "id" in e, { message: () => "patch row must carry an id" })), _ = m.Union(m.Struct({
|
|
11
|
+
op: m.Literal("add"),
|
|
12
|
+
path: m.String,
|
|
13
|
+
value: g
|
|
14
|
+
}), m.Struct({
|
|
15
|
+
op: m.Literal("replace"),
|
|
16
|
+
path: m.String,
|
|
17
|
+
value: g
|
|
18
|
+
}), m.Struct({
|
|
19
|
+
op: m.Literal("remove"),
|
|
20
|
+
path: m.String
|
|
21
|
+
}), m.Struct({
|
|
22
|
+
op: m.Literal("mergeCells"),
|
|
23
|
+
path: m.String,
|
|
24
|
+
value: m.Record({
|
|
25
|
+
key: m.String,
|
|
26
|
+
value: m.Unknown
|
|
26
27
|
})
|
|
27
|
-
})),
|
|
28
|
-
ops:
|
|
29
|
-
order:
|
|
30
|
-
}),
|
|
28
|
+
})), v = m.Struct({
|
|
29
|
+
ops: m.Array(_),
|
|
30
|
+
order: m.Array(Ge)
|
|
31
|
+
}), y = (e) => `/${String(e).replace(/~/g, "~0").replace(/\//g, "~1")}`, b = (e) => (e.startsWith("/") ? e.slice(1) : e).replace(/~1/g, "/").replace(/~0/g, "~"), x = (e) => {
|
|
31
32
|
let t = Object.keys(e).sort(), n = {};
|
|
32
33
|
for (let r of t) n[r] = e[r];
|
|
33
34
|
return JSON.stringify(n);
|
|
34
|
-
},
|
|
35
|
+
}, S = (e, t) => x(e) === x(t), Ke = (e, t) => {
|
|
35
36
|
if (e instanceof Uint8Array && t instanceof Uint8Array) {
|
|
36
37
|
if (e.length !== t.length) return !1;
|
|
37
38
|
for (let n = 0; n < e.length; n += 1) if (e[n] !== t[n]) return !1;
|
|
38
39
|
return !0;
|
|
39
40
|
}
|
|
40
|
-
return
|
|
41
|
+
return x({
|
|
41
42
|
id: 0,
|
|
42
43
|
v: e
|
|
43
|
-
}) ===
|
|
44
|
+
}) === x({
|
|
44
45
|
id: 0,
|
|
45
46
|
v: t
|
|
46
47
|
});
|
|
47
48
|
}, qe = (e, t, n = {}) => {
|
|
48
49
|
let r = /* @__PURE__ */ new Map();
|
|
49
50
|
for (let t of e) r.set(t.id, t);
|
|
50
|
-
let i = [], a = [], o = /* @__PURE__ */ new Set(), s = n.crdt,
|
|
51
|
+
let i = [], a = [], o = /* @__PURE__ */ new Set(), s = n.crdt, c = (e, t) => {
|
|
51
52
|
if (s === void 0 || s.columns.size === 0) return;
|
|
52
53
|
let n = {}, r = !1;
|
|
53
54
|
for (let i of s.columns) {
|
|
@@ -69,29 +70,29 @@ var Ue = f.Union(f.String, f.Number), m = f.Record({
|
|
|
69
70
|
let t = r.get(e.id);
|
|
70
71
|
if (t === void 0) i.push({
|
|
71
72
|
op: "add",
|
|
72
|
-
path:
|
|
73
|
+
path: y(e.id),
|
|
73
74
|
value: e
|
|
74
75
|
});
|
|
75
|
-
else if (!
|
|
76
|
-
let n =
|
|
76
|
+
else if (!S(t, e)) {
|
|
77
|
+
let n = c(t, e);
|
|
77
78
|
n === void 0 ? i.push({
|
|
78
79
|
op: "replace",
|
|
79
|
-
path:
|
|
80
|
+
path: y(e.id),
|
|
80
81
|
value: e
|
|
81
|
-
}) : (
|
|
82
|
+
}) : (S(Object.fromEntries(Object.entries(t).filter(([e]) => !s.columns.has(e))), n.scalars) || i.push({
|
|
82
83
|
op: "replace",
|
|
83
|
-
path:
|
|
84
|
+
path: y(e.id),
|
|
84
85
|
value: n.scalars
|
|
85
86
|
}), i.push({
|
|
86
87
|
op: "mergeCells",
|
|
87
|
-
path:
|
|
88
|
+
path: y(e.id),
|
|
88
89
|
value: n.merges
|
|
89
90
|
}));
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
for (let t of e) o.has(t.id) || i.push({
|
|
93
94
|
op: "remove",
|
|
94
|
-
path:
|
|
95
|
+
path: y(t.id)
|
|
95
96
|
});
|
|
96
97
|
return {
|
|
97
98
|
ops: i,
|
|
@@ -105,7 +106,7 @@ var Ue = f.Union(f.String, f.Number), m = f.Record({
|
|
|
105
106
|
for (let t of e) r.set(t.id, t);
|
|
106
107
|
for (let e of t.ops) {
|
|
107
108
|
if (e.op === "mergeCells") {
|
|
108
|
-
let t =
|
|
109
|
+
let t = b(e.path), i = r.get(t) ?? r.get(Number(t)), a = r.has(t) ? t : Number(t);
|
|
109
110
|
if (i === void 0) continue;
|
|
110
111
|
let o = { ...i };
|
|
111
112
|
for (let [t, r] of Object.entries(e.value)) o[t] = n.mergeCell === void 0 ? r : n.mergeCell(t, i[t], r);
|
|
@@ -120,56 +121,56 @@ var Ue = f.Union(f.String, f.Number), m = f.Record({
|
|
|
120
121
|
t !== void 0 && i.push(t);
|
|
121
122
|
}
|
|
122
123
|
return i;
|
|
123
|
-
},
|
|
124
|
-
_tag:
|
|
125
|
-
revision:
|
|
124
|
+
}, C = (e) => m.Union(m.Struct({
|
|
125
|
+
_tag: m.Literal("snapshot"),
|
|
126
|
+
revision: m.Number,
|
|
126
127
|
data: e,
|
|
127
|
-
computed:
|
|
128
|
-
}),
|
|
129
|
-
_tag:
|
|
130
|
-
revision:
|
|
131
|
-
emittedAt:
|
|
132
|
-
patch:
|
|
133
|
-
}),
|
|
134
|
-
_tag:
|
|
135
|
-
error:
|
|
136
|
-
revision:
|
|
137
|
-
})),
|
|
128
|
+
computed: m.optional(m.Boolean)
|
|
129
|
+
}), m.Struct({
|
|
130
|
+
_tag: m.Literal("delta"),
|
|
131
|
+
revision: m.Number,
|
|
132
|
+
emittedAt: m.Number,
|
|
133
|
+
patch: v
|
|
134
|
+
}), m.Struct({
|
|
135
|
+
_tag: m.Literal("error"),
|
|
136
|
+
error: m.Unknown,
|
|
137
|
+
revision: m.optional(m.Number)
|
|
138
|
+
})), w = (e, t) => {
|
|
138
139
|
let n = `${e ?? "this procedure"} input`;
|
|
139
140
|
return t === !0 ? `${n} (guarded — the guard did NOT run: the payload failed to decode first, so this says nothing about access)` : n;
|
|
140
141
|
}, Xe = (e) => {
|
|
141
142
|
let t = e.ast;
|
|
142
143
|
return t._tag === "TypeLiteral" && (t.propertySignatures?.length ?? 0) === 0 && (t.indexSignatures?.length ?? 0) === 0;
|
|
143
|
-
},
|
|
144
|
-
let r =
|
|
144
|
+
}, T = (e, t, n) => {
|
|
145
|
+
let r = w(t, n), i = e.annotations({
|
|
145
146
|
parseOptions: { onExcessProperty: "error" },
|
|
146
147
|
parseIssueTitle: () => r
|
|
147
148
|
});
|
|
148
|
-
return Xe(e) ?
|
|
149
|
-
},
|
|
150
|
-
rule:
|
|
151
|
-
params:
|
|
152
|
-
key:
|
|
153
|
-
value:
|
|
149
|
+
return Xe(e) ? m.filter((e) => typeof e == "object" && e && Object.keys(e).length > 0 ? `this procedure declares no input; received: ${Object.keys(e).join(", ")}` : void 0)(i).annotations({ identifier: r }) : i;
|
|
150
|
+
}, E = class extends m.TaggedError()("BusinessRuleViolation", {
|
|
151
|
+
rule: m.String,
|
|
152
|
+
params: m.optional(m.Record({
|
|
153
|
+
key: m.String,
|
|
154
|
+
value: m.Unknown
|
|
154
155
|
})),
|
|
155
|
-
field:
|
|
156
|
-
message:
|
|
157
|
-
severity:
|
|
158
|
-
}) {},
|
|
159
|
-
field:
|
|
160
|
-
message:
|
|
161
|
-
params:
|
|
162
|
-
key:
|
|
163
|
-
value:
|
|
156
|
+
field: m.optional(m.String),
|
|
157
|
+
message: m.optional(m.String),
|
|
158
|
+
severity: m.Literal("error", "warning")
|
|
159
|
+
}) {}, D = m.Struct({
|
|
160
|
+
field: m.String,
|
|
161
|
+
message: m.String,
|
|
162
|
+
params: m.optional(m.Record({
|
|
163
|
+
key: m.String,
|
|
164
|
+
value: m.Unknown
|
|
164
165
|
}))
|
|
165
|
-
}),
|
|
166
|
-
field:
|
|
167
|
-
message:
|
|
168
|
-
params:
|
|
169
|
-
key:
|
|
170
|
-
value:
|
|
166
|
+
}), O = class extends m.TaggedError()("ValidationError", {
|
|
167
|
+
field: m.String,
|
|
168
|
+
message: m.String,
|
|
169
|
+
params: m.optional(m.Record({
|
|
170
|
+
key: m.String,
|
|
171
|
+
value: m.Unknown
|
|
171
172
|
}))
|
|
172
|
-
}) {}, Ze = class extends
|
|
173
|
+
}) {}, Ze = class extends m.TaggedError()("ValidationErrors", { issues: m.Array(D).pipe(m.minItems(1)) }) {}, Qe = (e) => {
|
|
173
174
|
if (typeof e != "object" || !e) return [];
|
|
174
175
|
let t = e._tag;
|
|
175
176
|
if (t === "ValidationError") {
|
|
@@ -195,69 +196,69 @@ var Ue = f.Union(f.String, f.Number), m = f.Record({
|
|
|
195
196
|
}];
|
|
196
197
|
}
|
|
197
198
|
return [];
|
|
198
|
-
}, $e = class extends
|
|
199
|
-
approvalId:
|
|
200
|
-
procedure:
|
|
201
|
-
expiresAt:
|
|
202
|
-
requiredScopes:
|
|
203
|
-
reason:
|
|
204
|
-
created:
|
|
205
|
-
}) {}, et = class extends
|
|
206
|
-
approvalId:
|
|
207
|
-
subjectId:
|
|
208
|
-
}) {}, nt = class extends
|
|
209
|
-
approvalId:
|
|
210
|
-
decidedBy:
|
|
211
|
-
note:
|
|
212
|
-
}) {},
|
|
213
|
-
approvalId:
|
|
214
|
-
expiredAt:
|
|
215
|
-
}) {}, rt = class extends
|
|
216
|
-
approvalId:
|
|
217
|
-
status:
|
|
218
|
-
}) {}, it = class extends
|
|
219
|
-
approvalId:
|
|
220
|
-
required:
|
|
221
|
-
message:
|
|
222
|
-
}) {},
|
|
223
|
-
procedure:
|
|
224
|
-
message:
|
|
225
|
-
}) {}, at =
|
|
226
|
-
id:
|
|
227
|
-
procedure:
|
|
228
|
-
kind:
|
|
229
|
-
requestedBy:
|
|
230
|
-
status:
|
|
231
|
-
reason:
|
|
232
|
-
requiredScopes:
|
|
233
|
-
requestedAt:
|
|
234
|
-
expiresAt:
|
|
235
|
-
decidedBy:
|
|
236
|
-
decidedAt:
|
|
237
|
-
note:
|
|
238
|
-
relation:
|
|
239
|
-
}),
|
|
240
|
-
if (!
|
|
199
|
+
}, $e = class extends m.TaggedError()("ApprovalRequired", {
|
|
200
|
+
approvalId: m.String,
|
|
201
|
+
procedure: m.String,
|
|
202
|
+
expiresAt: m.String,
|
|
203
|
+
requiredScopes: m.Array(m.String),
|
|
204
|
+
reason: m.NullOr(m.String),
|
|
205
|
+
created: m.Boolean
|
|
206
|
+
}) {}, et = class extends m.TaggedError()("ApprovalNotFound", { approvalId: m.String }) {}, tt = class extends m.TaggedError()("ApprovalSelfApproval", {
|
|
207
|
+
approvalId: m.String,
|
|
208
|
+
subjectId: m.NullOr(m.String)
|
|
209
|
+
}) {}, nt = class extends m.TaggedError()("ApprovalRejected", {
|
|
210
|
+
approvalId: m.String,
|
|
211
|
+
decidedBy: m.NullOr(m.String),
|
|
212
|
+
note: m.NullOr(m.String)
|
|
213
|
+
}) {}, k = class extends m.TaggedError()("ApprovalExpired", {
|
|
214
|
+
approvalId: m.String,
|
|
215
|
+
expiredAt: m.String
|
|
216
|
+
}) {}, rt = class extends m.TaggedError()("ApprovalNotPending", {
|
|
217
|
+
approvalId: m.String,
|
|
218
|
+
status: m.String
|
|
219
|
+
}) {}, it = class extends m.TaggedError()("ApprovalForbidden", {
|
|
220
|
+
approvalId: m.String,
|
|
221
|
+
required: m.NullOr(m.String),
|
|
222
|
+
message: m.String
|
|
223
|
+
}) {}, A = class extends m.TaggedError()("ApprovalUnavailable", {
|
|
224
|
+
procedure: m.String,
|
|
225
|
+
message: m.String
|
|
226
|
+
}) {}, at = m.Union($e, nt, k, A), ot = m.Union(et, tt, k, rt, it, A), st = m.Struct({
|
|
227
|
+
id: m.String,
|
|
228
|
+
procedure: m.String,
|
|
229
|
+
kind: m.Literal("mutation", "action"),
|
|
230
|
+
requestedBy: m.NullOr(m.String),
|
|
231
|
+
status: m.Literal("pending", "approved", "rejected", "expired", "consumed"),
|
|
232
|
+
reason: m.NullOr(m.String),
|
|
233
|
+
requiredScopes: m.Array(m.String),
|
|
234
|
+
requestedAt: m.String,
|
|
235
|
+
expiresAt: m.String,
|
|
236
|
+
decidedBy: m.NullOr(m.String),
|
|
237
|
+
decidedAt: m.NullOr(m.String),
|
|
238
|
+
note: m.NullOr(m.String),
|
|
239
|
+
relation: m.Literal("to-decide", "requested")
|
|
240
|
+
}), j = "channel:", ct = Symbol.for("@voltro/protocol/reactivityChannels"), lt = globalThis, M = lt[ct] ?? (lt[ct] = /* @__PURE__ */ new Map()), ut = /^[a-z][a-z0-9-]*(\.[a-z0-9-]+)*$/, dt = (e) => {
|
|
241
|
+
if (!ut.test(e)) throw Error(`reactivityChannel('${e}'): invalid channel name.\n Use lowercase kebab segments separated by dots — \`presence\`, \`job-queue\`,
|
|
241
242
|
\`billing.usage\`. A \`:\` is refused because it is the namespace separator in
|
|
242
|
-
the routing key (\`${
|
|
243
|
+
the routing key (\`${j}<name>\`), and an uppercase letter is\n refused because a key that differs only by case reads as one channel and
|
|
243
244
|
routes as two.`);
|
|
244
|
-
let t =
|
|
245
|
+
let t = M.get(e);
|
|
245
246
|
if (t !== void 0) return t;
|
|
246
|
-
let n = `${
|
|
247
|
+
let n = `${j}${e}`, r = Object.freeze({
|
|
247
248
|
kind: "reactivity-channel",
|
|
248
249
|
name: e,
|
|
249
250
|
key: n,
|
|
250
251
|
toString: () => n
|
|
251
252
|
});
|
|
252
|
-
return
|
|
253
|
-
},
|
|
254
|
-
let t =
|
|
255
|
-
for (let r of e) for (let e of
|
|
253
|
+
return M.set(e, r), r;
|
|
254
|
+
}, ft = (e) => typeof e == "object" && !!e && e.kind === "reactivity-channel", pt = (e) => e.startsWith(j), mt = () => new Set([...M.values()].map((e) => e.key)), N = (e) => ft(e) ? e.key : e, ht = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map(N) : [N(e)], gt = (e) => e === void 0 ? void 0 : Array.isArray(e) ? e.map(N) : N(e), _t = (e) => {
|
|
255
|
+
let t = mt(), n = [];
|
|
256
|
+
for (let r of e) for (let e of ht(r.source)) !pt(e) || t.has(e) || n.push({
|
|
256
257
|
procedure: r.name,
|
|
257
258
|
key: e
|
|
258
259
|
});
|
|
259
260
|
return n;
|
|
260
|
-
},
|
|
261
|
+
}, vt = (e, t) => {
|
|
261
262
|
let n = e?.injectExternalChange;
|
|
262
263
|
return n !== void 0 && (n.call(e, {
|
|
263
264
|
table: t.key,
|
|
@@ -266,8 +267,8 @@ var Ue = f.Union(f.String, f.Number), m = f.Record({
|
|
|
266
267
|
old: {},
|
|
267
268
|
origin: "inline"
|
|
268
269
|
}), !0);
|
|
269
|
-
},
|
|
270
|
-
if (
|
|
270
|
+
}, yt = (e) => e.internal !== !0, P = (e) => {
|
|
271
|
+
if (bt(e), Array.isArray(e.guards) && e.guards.length === 0) throw Error(`${e.name}: \`guards: []\` is empty, so it enforces nothing — but it reads\n at the call site as if this procedure were protected. Omit the field for an
|
|
271
272
|
unguarded procedure, or list the scopes required to call it.`);
|
|
272
273
|
let t = typeof e.source == "string" ? [e.source] : Array.isArray(e.source) ? e.source : void 0;
|
|
273
274
|
if (t !== void 0 && (t.length === 0 || t.some((e) => String(e).trim() === ""))) throw Error(`${e.name}: \`source\` is empty, so this query declares reactivity and\n subscribes to nothing — it serves one snapshot and never updates again,
|
|
@@ -284,7 +285,7 @@ var Ue = f.Union(f.String, f.Number), m = f.Record({
|
|
|
284
285
|
let n = [e.publicApi === void 0 ? void 0 : "publicApi", e.exposeAsTool === void 0 ? void 0 : "exposeAsTool"].filter((e) => e !== void 0);
|
|
285
286
|
if (n.length === 0) return e;
|
|
286
287
|
throw Error(`${e.name}: \`internal: true\` cannot be combined with ${n.map((e) => `\`${e}\``).join(" or ")}. \`internal\` takes the procedure OFF the wire; those put it back ON a different one (${n.includes("publicApi") ? "a REST route" : "an agent tool"}), and that surface is projected without consulting the flag — so the procedure would be unreachable from your client and reachable from the internet. Drop \`internal: true\` if the wider surface is intended, or remove the ${n.join(" / ")} annotation if it is not.`);
|
|
287
|
-
},
|
|
288
|
+
}, bt = (e) => {
|
|
288
289
|
let t = e.requiresApproval;
|
|
289
290
|
if (t !== void 0) {
|
|
290
291
|
if (!Array.isArray(t.approvers) || t.approvers.length === 0) throw Error(`${e.name}: \`requiresApproval.approvers\` is empty, so NOBODY can approve this\n procedure and every call would park forever. Name the scope(s) an approver must hold
|
|
@@ -294,48 +295,48 @@ var Ue = f.Union(f.String, f.Number), m = f.Record({
|
|
|
294
295
|
human from every other, and the second-pair-of-eyes control would enforce nothing.
|
|
295
296
|
Give the procedure a \`guards:\` decision, or drop \`requiresApproval\`.`);
|
|
296
297
|
}
|
|
297
|
-
},
|
|
298
|
+
}, xt = (e) => e.action !== void 0 && e.resourceType !== void 0, St = (e) => e.authenticated === !0, Ct = (e) => e.openAccess !== void 0 || e.guards !== void 0 && e.guards.length > 0, F = (e, t, n) => {
|
|
298
299
|
if (n === void 0) return t;
|
|
299
300
|
if (n.trim() === "") throw Error(`${e}: \`openAccess\` needs a REASON, not an empty string. It is the sentence a\n reviewer reads to decide whether this procedure should really be callable
|
|
300
301
|
without an authorization check — e.g. \`openAccess: 'public pricing, no caller data'\`.`);
|
|
301
302
|
if (t !== void 0 && t.length > 0) throw Error(`${e}: \`openAccess\` and \`guards\` are two different access decisions, so\n declaring both says the procedure is protected AND open. Keep the guards if a
|
|
302
303
|
caller must hold a scope; drop them if anyone may call it.`);
|
|
303
|
-
return [
|
|
304
|
-
},
|
|
304
|
+
return [f(n.trim())];
|
|
305
|
+
}, I = (e) => P({
|
|
305
306
|
kind: "query",
|
|
306
307
|
name: e.name,
|
|
307
308
|
input: e.input,
|
|
308
309
|
output: e.output,
|
|
309
|
-
error: e.error ??
|
|
310
|
-
source:
|
|
310
|
+
error: e.error ?? m.Never,
|
|
311
|
+
source: gt(e.source),
|
|
311
312
|
cache: e.cache,
|
|
312
|
-
guards:
|
|
313
|
+
guards: F(e.name, e.guards, e.openAccess),
|
|
313
314
|
openAccess: e.openAccess,
|
|
314
315
|
publicApi: e.publicApi,
|
|
315
316
|
exposeAsTool: e.exposeAsTool,
|
|
316
317
|
internal: e.internal,
|
|
317
318
|
overridesPlugin: e.overridesPlugin
|
|
318
|
-
}),
|
|
319
|
+
}), L = (e) => P({
|
|
319
320
|
kind: "mutation",
|
|
320
321
|
name: e.name,
|
|
321
322
|
input: e.input,
|
|
322
323
|
output: e.output,
|
|
323
|
-
error: e.error ??
|
|
324
|
+
error: e.error ?? m.Never,
|
|
324
325
|
target: e.target,
|
|
325
|
-
guards:
|
|
326
|
+
guards: F(e.name, e.guards, e.openAccess),
|
|
326
327
|
openAccess: e.openAccess,
|
|
327
328
|
publicApi: e.publicApi,
|
|
328
329
|
exposeAsTool: e.exposeAsTool,
|
|
329
330
|
requiresApproval: e.requiresApproval,
|
|
330
331
|
internal: e.internal,
|
|
331
332
|
overridesPlugin: e.overridesPlugin
|
|
332
|
-
}),
|
|
333
|
+
}), R = (e) => P({
|
|
333
334
|
kind: "action",
|
|
334
335
|
name: e.name,
|
|
335
336
|
input: e.input,
|
|
336
337
|
output: e.output,
|
|
337
|
-
error: e.error ??
|
|
338
|
-
guards:
|
|
338
|
+
error: e.error ?? m.Never,
|
|
339
|
+
guards: F(e.name, e.guards, e.openAccess),
|
|
339
340
|
openAccess: e.openAccess,
|
|
340
341
|
source: e.source,
|
|
341
342
|
target: e.target,
|
|
@@ -344,53 +345,53 @@ var Ue = f.Union(f.String, f.Number), m = f.Record({
|
|
|
344
345
|
requiresApproval: e.requiresApproval,
|
|
345
346
|
internal: e.internal,
|
|
346
347
|
overridesPlugin: e.overridesPlugin
|
|
347
|
-
}),
|
|
348
|
+
}), wt = (e) => P({
|
|
348
349
|
kind: "stream",
|
|
349
350
|
name: e.name,
|
|
350
351
|
input: e.input,
|
|
351
352
|
element: e.element,
|
|
352
|
-
error: e.error ??
|
|
353
|
+
error: e.error ?? m.Never,
|
|
353
354
|
internal: e.internal,
|
|
354
355
|
overridesPlugin: e.overridesPlugin,
|
|
355
|
-
guards:
|
|
356
|
+
guards: F(e.name, e.guards, e.openAccess),
|
|
356
357
|
openAccess: e.openAccess
|
|
357
|
-
}),
|
|
358
|
+
}), z = (e, t) => t && t.length > 0 ? m.Union(e, ...t) : e, B = (e) => e !== void 0 && e.some((e) => !d(e)), V = (e, t) => B(t) ? m.Union(e, u, l) : e, Tt = (e) => m.Union(e, E), Et = (e) => m.Union(e, O, Ze), Dt = (e, t) => t === void 0 ? e : m.Union(e, at), H = (e, t) => {
|
|
358
359
|
if (t === "stream") return e.error;
|
|
359
|
-
let n =
|
|
360
|
-
return t === "query" ? n :
|
|
361
|
-
},
|
|
360
|
+
let n = V(e.error, e.guards);
|
|
361
|
+
return t === "query" ? n : Dt(Et(t === "mutation" ? m.Union(Tt(n), p, We) : n), e.requiresApproval);
|
|
362
|
+
}, Ot = (e, t) => z(V(e.errorSchema, e.guards), t), kt = (e, t) => ({
|
|
362
363
|
...e,
|
|
363
364
|
name: t
|
|
364
|
-
}),
|
|
365
|
-
payload:
|
|
366
|
-
success:
|
|
367
|
-
error:
|
|
365
|
+
}), At = (e, t) => h.make(e.name, {
|
|
366
|
+
payload: T(e.input, e.name, B(e.guards)),
|
|
367
|
+
success: C(e.output),
|
|
368
|
+
error: z(H(e, "query"), t),
|
|
368
369
|
stream: !0
|
|
369
|
-
}),
|
|
370
|
-
payload:
|
|
370
|
+
}), jt = (e, t) => h.make(e.name, {
|
|
371
|
+
payload: T(e.input, e.name, B(e.guards)),
|
|
371
372
|
success: e.output,
|
|
372
|
-
error:
|
|
373
|
-
}),
|
|
374
|
-
payload:
|
|
373
|
+
error: z(H(e, "mutation"), t)
|
|
374
|
+
}), Mt = (e, t) => h.make(e.name, {
|
|
375
|
+
payload: T(e.input, e.name, B(e.guards)),
|
|
375
376
|
success: e.output,
|
|
376
|
-
error:
|
|
377
|
-
}),
|
|
378
|
-
payload:
|
|
377
|
+
error: z(H(e, "action"), t)
|
|
378
|
+
}), Nt = (e, t) => h.make(e.name, {
|
|
379
|
+
payload: T(e.input, e.name, B(e.guards)),
|
|
379
380
|
success: e.element,
|
|
380
|
-
error:
|
|
381
|
+
error: z(e.error, t),
|
|
381
382
|
stream: !0
|
|
382
|
-
}),
|
|
383
|
+
}), Pt = (e) => {
|
|
383
384
|
if (typeof e != "object" || !e) return;
|
|
384
385
|
let t = e._tag;
|
|
385
386
|
return typeof t == "string" ? t : void 0;
|
|
386
|
-
},
|
|
387
|
+
}, Ft = (e) => {
|
|
387
388
|
switch (e.kind) {
|
|
388
|
-
case "query": return
|
|
389
|
-
case "mutation": return
|
|
390
|
-
case "action": return
|
|
391
|
-
case "stream": return
|
|
389
|
+
case "query": return At(e);
|
|
390
|
+
case "mutation": return jt(e);
|
|
391
|
+
case "action": return Mt(e);
|
|
392
|
+
case "stream": return Nt(e);
|
|
392
393
|
}
|
|
393
|
-
},
|
|
394
|
+
}, It = (e) => {
|
|
394
395
|
let t = e.input, n = t === void 0 ? {} : { input: t }, r = e.output, i = r === void 0 ? {} : { output: r };
|
|
395
396
|
if (e.kind === "query") return {
|
|
396
397
|
kind: "query",
|
|
@@ -432,7 +433,7 @@ var Ue = f.Union(f.String, f.Number), m = f.Record({
|
|
|
432
433
|
..."relations" in e && e.relations !== void 0 ? { relations: e.relations } : {}
|
|
433
434
|
}))
|
|
434
435
|
};
|
|
435
|
-
},
|
|
436
|
+
}, Lt = 7500, Rt = (e) => typeof e == "object" && !!e && e.kind === "event", zt = (e) => {
|
|
436
437
|
if (e.name.length === 0) throw Error("defineEvent: `name` must not be empty");
|
|
437
438
|
if (/\s/.test(e.name)) throw Error(`defineEvent("${e.name}"): \`name\` must not contain whitespace.\n The name is used as a broker subject segment. NATS refuses a subject with
|
|
438
439
|
whitespace and delivers nothing — silently, and only on that broker, so an
|
|
@@ -461,75 +462,116 @@ var Ue = f.Union(f.String, f.Number), m = f.Record({
|
|
|
461
462
|
name: e.name,
|
|
462
463
|
key: e.key,
|
|
463
464
|
payload: e.payload,
|
|
464
|
-
guards: e.openAccess === void 0 ? e.guards : [
|
|
465
|
+
guards: e.openAccess === void 0 ? e.guards : [f(e.openAccess.trim())],
|
|
465
466
|
openAccess: e.openAccess,
|
|
466
467
|
rewind: e.rewind,
|
|
467
468
|
webhook: e.webhook,
|
|
468
469
|
delivery: e.delivery
|
|
469
470
|
};
|
|
470
|
-
},
|
|
471
|
-
_tag:
|
|
472
|
-
origin:
|
|
473
|
-
n:
|
|
474
|
-
emittedAt:
|
|
471
|
+
}, Bt = (e) => m.Struct({
|
|
472
|
+
_tag: m.Literal("event"),
|
|
473
|
+
origin: m.String,
|
|
474
|
+
n: m.Number,
|
|
475
|
+
emittedAt: m.Number,
|
|
475
476
|
payload: e
|
|
476
|
-
}),
|
|
477
|
-
_tag:
|
|
478
|
-
missed:
|
|
479
|
-
reason:
|
|
480
|
-
}),
|
|
481
|
-
origin:
|
|
482
|
-
n:
|
|
483
|
-
}),
|
|
477
|
+
}), Vt = m.Struct({
|
|
478
|
+
_tag: m.Literal("gap"),
|
|
479
|
+
missed: m.Number,
|
|
480
|
+
reason: m.Literal("buffer", "resume")
|
|
481
|
+
}), Ht = m.Struct({ _tag: m.Literal("attached") }), Ut = (e) => m.Union(Ht, Bt(e), Vt), Wt = m.Struct({
|
|
482
|
+
origin: m.String,
|
|
483
|
+
n: m.Number
|
|
484
|
+
}), Gt = (e) => m.Struct({
|
|
484
485
|
key: e,
|
|
485
|
-
resume:
|
|
486
|
-
}),
|
|
487
|
-
let n = e.guards !== void 0 && e.guards.some((e) => !
|
|
488
|
-
return
|
|
489
|
-
payload:
|
|
490
|
-
success:
|
|
486
|
+
resume: m.optional(m.Array(Wt))
|
|
487
|
+
}), Kt = (e, t) => {
|
|
488
|
+
let n = e.guards !== void 0 && e.guards.some((e) => !d(e)) ? m.Union(u, l) : m.Never, r = t && t.length > 0 ? m.Union(n, ...t) : n;
|
|
489
|
+
return h.make(e.name, {
|
|
490
|
+
payload: T(Gt(e.key), e.name, B(e.guards)),
|
|
491
|
+
success: Ut(e.payload),
|
|
491
492
|
error: r,
|
|
492
493
|
stream: !0
|
|
493
494
|
});
|
|
494
|
-
},
|
|
495
|
-
event:
|
|
496
|
-
message:
|
|
497
|
-
}) {},
|
|
498
|
-
event:
|
|
499
|
-
message:
|
|
500
|
-
}) {},
|
|
501
|
-
event:
|
|
502
|
-
bytes:
|
|
503
|
-
limit:
|
|
504
|
-
}) {},
|
|
495
|
+
}, qt = class extends m.TaggedError()("EventPayloadInvalid", {
|
|
496
|
+
event: m.String,
|
|
497
|
+
message: m.String
|
|
498
|
+
}) {}, Jt = class extends m.TaggedError()("EventKeyInvalid", {
|
|
499
|
+
event: m.String,
|
|
500
|
+
message: m.String
|
|
501
|
+
}) {}, Yt = class extends m.TaggedError()("EventPayloadTooLarge", {
|
|
502
|
+
event: m.String,
|
|
503
|
+
bytes: m.Number,
|
|
504
|
+
limit: m.Number
|
|
505
|
+
}) {}, Xt = (e) => {
|
|
505
506
|
if (typeof e != "object" || !e) return JSON.stringify(e) ?? "null";
|
|
506
507
|
let t = Object.entries(e).filter(([, e]) => e !== void 0).sort(([e], [t]) => e < t ? -1 : +(e > t));
|
|
507
508
|
return JSON.stringify(t);
|
|
508
|
-
},
|
|
509
|
+
}, Zt = "\0", Qt = (e, t, n) => [
|
|
509
510
|
e ?? "~",
|
|
510
511
|
t,
|
|
511
|
-
|
|
512
|
-
].join("\0"),
|
|
512
|
+
Xt(n)
|
|
513
|
+
].join("\0"), $t = (e) => {
|
|
513
514
|
let [t = "~", n = "", r = ""] = e.split("\0");
|
|
514
515
|
return {
|
|
515
516
|
tenantId: t === "~" ? null : t,
|
|
516
517
|
event: n,
|
|
517
518
|
key: r
|
|
518
519
|
};
|
|
519
|
-
},
|
|
520
|
+
}, en = (e) => e.split("\0").join(" · "), U = Symbol.for("@voltro/protocol/workflow-access"), tn = {
|
|
521
|
+
guards: void 0,
|
|
522
|
+
openAccess: void 0,
|
|
523
|
+
internal: !1
|
|
524
|
+
}, nn = (e, t) => {
|
|
525
|
+
let n = t.guards;
|
|
526
|
+
if (n !== void 0 && n.length === 0) throw Error(`workflow("${e}"): \`guards: []\` is empty, so it enforces nothing —\n but it reads at the call site as if the start were protected. Omit the field
|
|
527
|
+
and decide with \`openAccess\` or \`internal\`, or list the scopes that may start it.`);
|
|
528
|
+
if (t.openAccess !== void 0) {
|
|
529
|
+
if (t.openAccess.trim() === "") throw Error(`workflow("${e}"): \`openAccess\` needs a REASON, not an empty string. It is\n the sentence a reviewer reads to decide whether anyone should really be able to
|
|
530
|
+
start durable work without an authorization check — e.g. \`openAccess: 'public
|
|
531
|
+
newsletter signup; the payload carries only the address being confirmed'\`.`);
|
|
532
|
+
if (n !== void 0 && n.length > 0) throw Error(`workflow("${e}"): \`openAccess\` and \`guards\` are two different access\n decisions, so declaring both says the start is protected AND open. Keep the
|
|
533
|
+
guards if a caller must hold a scope; drop them if anyone may start it.`);
|
|
534
|
+
if (t.internal === !0) throw Error(`workflow("${e}"): \`internal: true\` cannot be combined with \`openAccess\`.\n \`internal\` takes the start OFF the wire, and \`openAccess\` declares who may
|
|
535
|
+
start it over the wire — a decision about a door that does not exist. Drop
|
|
536
|
+
\`openAccess\` (an internal workflow needs no wire decision), or drop
|
|
537
|
+
\`internal: true\` if the workflow really is meant to be startable by clients.`);
|
|
538
|
+
}
|
|
539
|
+
return {
|
|
540
|
+
guards: t.openAccess === void 0 ? t.guards : [f(t.openAccess.trim())],
|
|
541
|
+
openAccess: t.openAccess?.trim(),
|
|
542
|
+
internal: t.internal === !0
|
|
543
|
+
};
|
|
544
|
+
}, rn = (e, t) => {
|
|
545
|
+
Object.defineProperty(e, U, {
|
|
546
|
+
value: t,
|
|
547
|
+
enumerable: !1
|
|
548
|
+
});
|
|
549
|
+
}, W = (e) => {
|
|
550
|
+
if (typeof e != "object" || !e) return tn;
|
|
551
|
+
let t = e[U];
|
|
552
|
+
return t === void 0 ? tn : t;
|
|
553
|
+
}, an = (e) => {
|
|
554
|
+
let t = W(e);
|
|
555
|
+
return {
|
|
556
|
+
name: e.name,
|
|
557
|
+
internal: t.internal,
|
|
558
|
+
guards: t.guards,
|
|
559
|
+
openAccess: t.openAccess
|
|
560
|
+
};
|
|
561
|
+
}, on = (e) => e, sn = (e) => e, cn = (e) => {
|
|
520
562
|
let t = e.alias?.trim(), n = e.instance?.trim(), r = t !== void 0 && t !== "" ? t : e.base;
|
|
521
563
|
return n !== void 0 && n !== "" ? `${r}#${n}` : r;
|
|
522
|
-
},
|
|
564
|
+
}, ln = (e) => {
|
|
523
565
|
if (e.length !== 0) return (t, n) => e.reduceRight((e, t) => t(e, n), t);
|
|
524
|
-
},
|
|
525
|
-
let n =
|
|
566
|
+
}, un = (e, t) => {
|
|
567
|
+
let n = He.GenericTag(e);
|
|
526
568
|
return {
|
|
527
569
|
Tag: n,
|
|
528
|
-
Live:
|
|
570
|
+
Live: Ue.succeed(n, t)
|
|
529
571
|
};
|
|
530
|
-
},
|
|
572
|
+
}, dn = (e, t, n) => {
|
|
531
573
|
if (!t) return { ok: !0 };
|
|
532
|
-
let r = n === void 0 ? null :
|
|
574
|
+
let r = n === void 0 ? null : G(n);
|
|
533
575
|
if (!r) return {
|
|
534
576
|
ok: !0,
|
|
535
577
|
unverified: `plugin "${e}" requires framework ${t}, but the running framework version is ${n === void 0 ? "unknown" : `unreadable ("${n}")`} — not checked.`
|
|
@@ -537,12 +579,12 @@ var Ue = f.Union(f.String, f.Number), m = f.Record({
|
|
|
537
579
|
let i = t.trim();
|
|
538
580
|
if (i === "*" || i === "") return { ok: !0 };
|
|
539
581
|
let a = i.split(/\s+/).filter((e) => e.length > 0);
|
|
540
|
-
for (let i of a) if (!
|
|
582
|
+
for (let i of a) if (!fn(i, r)) return {
|
|
541
583
|
ok: !1,
|
|
542
584
|
reason: `plugin "${e}" requires framework ${t}, running ${n}`
|
|
543
585
|
};
|
|
544
586
|
return { ok: !0 };
|
|
545
|
-
},
|
|
587
|
+
}, G = (e) => {
|
|
546
588
|
let t = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9a-zA-Z.-]+))?$/.exec(e.trim());
|
|
547
589
|
return t ? {
|
|
548
590
|
major: Number(t[1]),
|
|
@@ -550,256 +592,273 @@ var Ue = f.Union(f.String, f.Number), m = f.Record({
|
|
|
550
592
|
patch: Number(t[3]),
|
|
551
593
|
pre: t[4] ?? ""
|
|
552
594
|
} : null;
|
|
553
|
-
},
|
|
595
|
+
}, K = (e, t) => e.major === t.major ? e.minor === t.minor ? e.patch === t.patch ? e.pre && !t.pre ? -1 : !e.pre && t.pre ? 1 : e.pre && t.pre ? e.pre < t.pre ? -1 : +(e.pre > t.pre) : 0 : e.patch - t.patch : e.minor - t.minor : e.major - t.major, fn = (e, t) => {
|
|
554
596
|
if (e === "*") return !0;
|
|
555
597
|
if (e.startsWith("^")) {
|
|
556
|
-
let n =
|
|
557
|
-
return !n || t.major !== n.major ? !1 :
|
|
598
|
+
let n = G(e.slice(1));
|
|
599
|
+
return !n || t.major !== n.major ? !1 : K(t, n) >= 0;
|
|
558
600
|
}
|
|
559
601
|
if (e.startsWith("~")) {
|
|
560
|
-
let n =
|
|
561
|
-
return !n || t.major !== n.major || t.minor !== n.minor ? !1 :
|
|
602
|
+
let n = G(e.slice(1));
|
|
603
|
+
return !n || t.major !== n.major || t.minor !== n.minor ? !1 : K(t, n) >= 0;
|
|
562
604
|
}
|
|
563
605
|
let n = /^(>=|<=|>|<)(.+)$/.exec(e);
|
|
564
606
|
if (n) {
|
|
565
|
-
let e = n[1], r =
|
|
607
|
+
let e = n[1], r = G(n[2]);
|
|
566
608
|
if (!r) return !1;
|
|
567
|
-
let i =
|
|
609
|
+
let i = K(t, r);
|
|
568
610
|
if (e === ">=") return i >= 0;
|
|
569
611
|
if (e === "<=") return i <= 0;
|
|
570
612
|
if (e === ">") return i > 0;
|
|
571
613
|
if (e === "<") return i < 0;
|
|
572
614
|
}
|
|
573
|
-
let r =
|
|
574
|
-
return r ?
|
|
575
|
-
},
|
|
615
|
+
let r = G(e);
|
|
616
|
+
return r ? K(t, r) === 0 : !1;
|
|
617
|
+
}, pn = (e) => {
|
|
576
618
|
let t = e.startsWith("@") ? e.replace(/^@[^/]+\//, "") : e;
|
|
577
619
|
return (t.startsWith("plugin-") ? t.slice(7) : t).replace(/-([a-zA-Z0-9])/g, (e, t) => t.toUpperCase());
|
|
578
|
-
},
|
|
620
|
+
}, mn = (e) => {
|
|
579
621
|
let t = e.startsWith("@") ? e.replace(/^@[^/]+\//, "") : e;
|
|
580
622
|
return (t.startsWith("plugin-") ? t.slice(7) : t).replace(/#/g, "--").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
581
|
-
},
|
|
582
|
-
let e = globalThis, t = e[
|
|
623
|
+
}, hn = Symbol.for("@voltro/protocol/pluginAliases"), q = () => {
|
|
624
|
+
let e = globalThis, t = e[hn];
|
|
583
625
|
if (t instanceof Map) return t;
|
|
584
626
|
let n = /* @__PURE__ */ new Map();
|
|
585
|
-
return e[
|
|
586
|
-
},
|
|
587
|
-
let t =
|
|
627
|
+
return e[hn] = n, n;
|
|
628
|
+
}, gn = (e) => {
|
|
629
|
+
let t = q();
|
|
588
630
|
for (let [n, r] of Object.entries(e)) {
|
|
589
631
|
if (r === "") continue;
|
|
590
632
|
let e = t.get(n);
|
|
591
633
|
e === void 0 ? t.set(n, /* @__PURE__ */ new Set([r])) : e.add(r);
|
|
592
634
|
}
|
|
593
|
-
},
|
|
594
|
-
|
|
595
|
-
},
|
|
596
|
-
let n =
|
|
597
|
-
if (n === void 0 || n.size === 0) return `${
|
|
635
|
+
}, _n = () => {
|
|
636
|
+
q().clear();
|
|
637
|
+
}, vn = (e, t) => {
|
|
638
|
+
let n = q().get(e);
|
|
639
|
+
if (n === void 0 || n.size === 0) return `${pn(e)}.${t}`;
|
|
598
640
|
if (n.size === 1) return `${[...n][0]}.${t}`;
|
|
599
641
|
let r = [...n].filter((e) => !e.includes("#"));
|
|
600
642
|
if (r.length === 1) return `${r[0]}.${t}`;
|
|
601
643
|
throw Error(`[voltro] ${e} is installed more than once (${[...n].sort().join(", ")}) and no single install is the primary one, so a plugin hook cannot tell which of them it addresses. Call the route by its full tag instead — e.g. useSubscription(api, '${[...n].sort()[0]}.${t}').`);
|
|
602
|
-
},
|
|
603
|
-
mode:
|
|
604
|
-
dueAt:
|
|
605
|
-
retryAfterMs:
|
|
606
|
-
intentId:
|
|
607
|
-
}),
|
|
608
|
-
id:
|
|
609
|
-
workflowName:
|
|
610
|
-
executionId:
|
|
611
|
-
status:
|
|
612
|
-
deferral:
|
|
613
|
-
}),
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
occurredAt:
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
}),
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
}),
|
|
644
|
+
}, J = m.Literal("running", "succeeded", "failed", "cancelled", "suspended"), yn = m.Literal("cancel", "terminate", "abandon"), bn = m.Struct({
|
|
645
|
+
mode: m.String,
|
|
646
|
+
dueAt: m.NullOr(m.Number),
|
|
647
|
+
retryAfterMs: m.NullOr(m.Number),
|
|
648
|
+
intentId: m.NullOr(m.String)
|
|
649
|
+
}), xn = m.Struct({
|
|
650
|
+
id: m.String,
|
|
651
|
+
workflowName: m.String,
|
|
652
|
+
executionId: m.NullOr(m.String),
|
|
653
|
+
status: m.Literal("running", "queued", "dropped", "skipped", "replayed"),
|
|
654
|
+
deferral: m.optional(bn)
|
|
655
|
+
}), Sn = (e, t) => {
|
|
656
|
+
let n = W(e);
|
|
657
|
+
return h.make(e.name, {
|
|
658
|
+
payload: T(e.payloadSchema, e.name, B(n.guards)),
|
|
659
|
+
success: xn,
|
|
660
|
+
error: Ot({
|
|
661
|
+
errorSchema: e.errorSchema,
|
|
662
|
+
guards: n.guards
|
|
663
|
+
}, t)
|
|
664
|
+
});
|
|
665
|
+
}, Y = m.Struct({
|
|
666
|
+
id: m.String,
|
|
667
|
+
tag: m.String,
|
|
668
|
+
executionId: m.String,
|
|
669
|
+
status: J,
|
|
670
|
+
payload: m.Unknown,
|
|
671
|
+
workflowVersion: m.NullOr(m.String),
|
|
672
|
+
workflowPatches: m.NullOr(m.Unknown),
|
|
673
|
+
output: m.NullOr(m.Unknown),
|
|
674
|
+
subject: m.NullOr(m.Unknown),
|
|
675
|
+
source: m.NullOr(m.String),
|
|
676
|
+
errorTag: m.NullOr(m.String),
|
|
677
|
+
errorMessage: m.NullOr(m.String),
|
|
678
|
+
cancelled: m.Boolean,
|
|
679
|
+
startedAt: m.Date,
|
|
680
|
+
completedAt: m.NullOr(m.Date),
|
|
681
|
+
durationMs: m.NullOr(m.Number),
|
|
682
|
+
traceId: m.NullOr(m.String),
|
|
683
|
+
parentExecutionId: m.NullOr(m.String),
|
|
684
|
+
parentClosePolicy: m.NullOr(yn)
|
|
685
|
+
}), Cn = m.Struct({
|
|
686
|
+
tag: m.optional(m.String),
|
|
687
|
+
status: m.optional(J),
|
|
688
|
+
limit: m.optional(m.Number)
|
|
689
|
+
}), wn = m.Struct({
|
|
690
|
+
id: m.String,
|
|
691
|
+
runId: m.String,
|
|
692
|
+
stepName: m.String,
|
|
693
|
+
attempt: m.Number,
|
|
694
|
+
status: m.Literal("running", "succeeded", "failed"),
|
|
695
|
+
input: m.NullOr(m.Unknown),
|
|
696
|
+
retryPolicy: m.NullOr(m.Unknown),
|
|
697
|
+
output: m.NullOr(m.Unknown),
|
|
698
|
+
errorTag: m.NullOr(m.String),
|
|
699
|
+
errorMessage: m.NullOr(m.String),
|
|
700
|
+
errorCause: m.NullOr(m.Unknown),
|
|
701
|
+
startedAt: m.Date,
|
|
702
|
+
completedAt: m.NullOr(m.Date),
|
|
703
|
+
durationMs: m.NullOr(m.Number)
|
|
704
|
+
}), Tn = m.Struct({
|
|
705
|
+
id: m.String,
|
|
706
|
+
runId: m.String,
|
|
707
|
+
eventType: m.String,
|
|
708
|
+
payload: m.NullOr(m.Unknown),
|
|
709
|
+
occurredAt: m.Date,
|
|
710
|
+
stepName: m.NullOr(m.String),
|
|
711
|
+
attempt: m.NullOr(m.Number)
|
|
712
|
+
}), En = m.Struct({
|
|
713
|
+
id: m.String,
|
|
714
|
+
name: m.String,
|
|
715
|
+
payload: m.Unknown,
|
|
716
|
+
source: m.String,
|
|
717
|
+
subject: m.NullOr(m.Unknown),
|
|
718
|
+
traceId: m.NullOr(m.String),
|
|
719
|
+
occurredAt: m.Date
|
|
720
|
+
}), Dn = m.Struct({
|
|
721
|
+
id: m.String,
|
|
722
|
+
eventId: m.String,
|
|
723
|
+
eventName: m.String,
|
|
724
|
+
triggerId: m.String,
|
|
725
|
+
workflowName: m.String,
|
|
726
|
+
executionId: m.NullOr(m.String),
|
|
727
|
+
status: m.Literal("starting", "started", "skipped", "failed"),
|
|
728
|
+
idempotencyKey: m.String,
|
|
729
|
+
skipped: m.Boolean,
|
|
730
|
+
errorMessage: m.NullOr(m.String),
|
|
731
|
+
createdAt: m.Date,
|
|
732
|
+
completedAt: m.NullOr(m.Date)
|
|
733
|
+
}), On = m.Struct({ id: m.String }), X = m.Struct({ runId: m.String }), kn = m.Struct({
|
|
734
|
+
name: m.optional(m.String),
|
|
735
|
+
limit: m.optional(m.Number)
|
|
736
|
+
}), An = m.Struct({ eventId: m.String }), Z = m.Struct({
|
|
737
|
+
workflowName: m.String,
|
|
738
|
+
executionId: m.String
|
|
739
|
+
}), jn = m.Struct({
|
|
740
|
+
id: m.String,
|
|
741
|
+
signalName: m.String,
|
|
742
|
+
payload: m.optional(m.Unknown)
|
|
743
|
+
}), Mn = m.Struct({
|
|
744
|
+
id: m.String,
|
|
745
|
+
updateName: m.String,
|
|
746
|
+
payload: m.optional(m.Unknown),
|
|
747
|
+
timeoutMs: m.optional(m.Number)
|
|
748
|
+
}), Nn = m.Struct({
|
|
749
|
+
eventId: m.String,
|
|
750
|
+
updateId: m.String,
|
|
751
|
+
completedEventId: m.String,
|
|
752
|
+
result: m.Unknown
|
|
753
|
+
}), Pn = I({
|
|
702
754
|
name: "__voltro.workflow.run",
|
|
703
755
|
source: "_voltro_workflow_runs",
|
|
704
|
-
input:
|
|
705
|
-
output:
|
|
706
|
-
}),
|
|
756
|
+
input: On,
|
|
757
|
+
output: m.Array(Y)
|
|
758
|
+
}), Fn = I({
|
|
707
759
|
name: "__voltro.workflow.runs",
|
|
708
760
|
source: "_voltro_workflow_runs",
|
|
709
|
-
input:
|
|
710
|
-
output:
|
|
711
|
-
}),
|
|
761
|
+
input: Cn,
|
|
762
|
+
output: m.Array(Y)
|
|
763
|
+
}), In = I({
|
|
712
764
|
name: "__voltro.workflow.run.steps",
|
|
713
765
|
source: "_voltro_workflow_run_steps",
|
|
714
|
-
input:
|
|
715
|
-
output:
|
|
716
|
-
}),
|
|
766
|
+
input: X,
|
|
767
|
+
output: m.Array(wn)
|
|
768
|
+
}), Ln = I({
|
|
717
769
|
name: "__voltro.workflow.run.events",
|
|
718
770
|
source: "_voltro_workflow_run_events",
|
|
719
|
-
input:
|
|
720
|
-
output:
|
|
721
|
-
}),
|
|
771
|
+
input: X,
|
|
772
|
+
output: m.Array(Tn)
|
|
773
|
+
}), Rn = I({
|
|
722
774
|
name: "__voltro.workflow.domainEvents",
|
|
723
775
|
source: "_voltro_workflow_events",
|
|
724
|
-
input:
|
|
725
|
-
output:
|
|
726
|
-
}),
|
|
776
|
+
input: kn,
|
|
777
|
+
output: m.Array(En)
|
|
778
|
+
}), zn = I({
|
|
727
779
|
name: "__voltro.workflow.event.deliveries",
|
|
728
780
|
source: "_voltro_workflow_event_deliveries",
|
|
729
|
-
input:
|
|
730
|
-
output:
|
|
731
|
-
}),
|
|
781
|
+
input: An,
|
|
782
|
+
output: m.Array(Dn)
|
|
783
|
+
}), Bn = R({
|
|
732
784
|
name: "__voltro.workflow.cancel",
|
|
733
|
-
input:
|
|
734
|
-
output:
|
|
735
|
-
}),
|
|
785
|
+
input: Z,
|
|
786
|
+
output: m.Struct({ ok: m.Boolean })
|
|
787
|
+
}), Vn = R({
|
|
736
788
|
name: "__voltro.workflow.resume",
|
|
737
|
-
input:
|
|
738
|
-
output:
|
|
739
|
-
}),
|
|
789
|
+
input: Z,
|
|
790
|
+
output: m.Struct({ ok: m.Boolean })
|
|
791
|
+
}), Hn = R({
|
|
740
792
|
name: "__voltro.workflow.signal",
|
|
741
|
-
input:
|
|
742
|
-
output:
|
|
743
|
-
}),
|
|
793
|
+
input: jn,
|
|
794
|
+
output: m.Struct({ eventId: m.String })
|
|
795
|
+
}), Un = R({
|
|
744
796
|
name: "__voltro.workflow.update",
|
|
745
|
-
input:
|
|
746
|
-
output:
|
|
747
|
-
}),
|
|
748
|
-
id:
|
|
749
|
-
tag:
|
|
750
|
-
label:
|
|
751
|
-
undone:
|
|
752
|
-
crossesAction:
|
|
753
|
-
createdAt:
|
|
754
|
-
}),
|
|
755
|
-
invocationId:
|
|
756
|
-
reason:
|
|
757
|
-
}) {},
|
|
758
|
-
name:
|
|
797
|
+
input: Mn,
|
|
798
|
+
output: Nn
|
|
799
|
+
}), Wn = "__voltro.undo.log", Gn = "__voltro.undo.apply", Kn = "__voltro.undo.redo", qn = m.Struct({
|
|
800
|
+
id: m.String,
|
|
801
|
+
tag: m.String,
|
|
802
|
+
label: m.NullOr(m.String),
|
|
803
|
+
undone: m.Boolean,
|
|
804
|
+
crossesAction: m.Boolean,
|
|
805
|
+
createdAt: m.String
|
|
806
|
+
}), Jn = class extends m.TaggedError()("UndoNotFound", { invocationId: m.String }) {}, Yn = class extends m.TaggedError()("UndoForbidden", { invocationId: m.String }) {}, Xn = class extends m.TaggedError()("UndoConflict", {
|
|
807
|
+
invocationId: m.String,
|
|
808
|
+
reason: m.Literal("conflict", "action")
|
|
809
|
+
}) {}, Zn = m.Union(Jn, Yn, Xn), Qn = I({
|
|
810
|
+
name: Wn,
|
|
759
811
|
source: "_voltro_undo_log",
|
|
760
|
-
input:
|
|
761
|
-
output:
|
|
812
|
+
input: m.Struct({ limit: m.optional(m.Number) }),
|
|
813
|
+
output: m.Array(qn),
|
|
762
814
|
openAccess: "subject-scoped by construction: lists only the calling subject's own undoable actions"
|
|
763
|
-
}),
|
|
764
|
-
name:
|
|
765
|
-
input:
|
|
766
|
-
output:
|
|
767
|
-
error:
|
|
815
|
+
}), $n = L({
|
|
816
|
+
name: Gn,
|
|
817
|
+
input: m.Struct({ invocationId: m.String }),
|
|
818
|
+
output: m.Struct({ ok: m.Boolean }),
|
|
819
|
+
error: Zn,
|
|
768
820
|
openAccess: "subject-scoped by construction: undo is per-actor — another subject's invocation fails typed with UndoForbidden"
|
|
769
|
-
}),
|
|
770
|
-
name:
|
|
771
|
-
input:
|
|
772
|
-
output:
|
|
773
|
-
error:
|
|
821
|
+
}), er = L({
|
|
822
|
+
name: Kn,
|
|
823
|
+
input: m.Struct({ invocationId: m.String }),
|
|
824
|
+
output: m.Struct({ ok: m.Boolean }),
|
|
825
|
+
error: Zn,
|
|
774
826
|
openAccess: "subject-scoped by construction: redo is per-actor — another subject's invocation fails typed with UndoForbidden"
|
|
775
|
-
}),
|
|
776
|
-
table:
|
|
777
|
-
reason:
|
|
778
|
-
}) {},
|
|
779
|
-
operation:
|
|
780
|
-
table:
|
|
781
|
-
cause:
|
|
782
|
-
}) {},
|
|
783
|
-
table:
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
827
|
+
}), tr = class extends m.TaggedError()("TenantScopeViolation", {
|
|
828
|
+
table: m.String,
|
|
829
|
+
reason: m.String
|
|
830
|
+
}) {}, nr = class extends m.TaggedError()("StoreOperationFailed", {
|
|
831
|
+
operation: m.String,
|
|
832
|
+
table: m.String,
|
|
833
|
+
cause: m.String
|
|
834
|
+
}) {}, rr = class extends m.TaggedError()("NoRowFound", {
|
|
835
|
+
table: m.String,
|
|
836
|
+
found: m.Number
|
|
837
|
+
}) {
|
|
838
|
+
get message() {
|
|
839
|
+
return this.found === 0 ? `expected exactly one row in '${this.table}', found none` : `expected exactly one row in '${this.table}', found more than one`;
|
|
840
|
+
}
|
|
841
|
+
}, ir = class extends m.TaggedError()("TableValidationFailed", {
|
|
842
|
+
table: m.String,
|
|
843
|
+
summary: m.String,
|
|
844
|
+
issues: m.Array(m.Struct({
|
|
845
|
+
path: m.String,
|
|
846
|
+
message: m.String
|
|
788
847
|
}))
|
|
789
|
-
}) {},
|
|
790
|
-
table:
|
|
791
|
-
id:
|
|
792
|
-
reason:
|
|
793
|
-
}) {},
|
|
794
|
-
table:
|
|
795
|
-
columns:
|
|
796
|
-
}) {},
|
|
797
|
-
kind:
|
|
798
|
-
table:
|
|
799
|
-
operation:
|
|
800
|
-
constraint:
|
|
801
|
-
column:
|
|
802
|
-
detail:
|
|
848
|
+
}) {}, ar = class extends m.TaggedError()("TenantRowNotFound", {
|
|
849
|
+
table: m.String,
|
|
850
|
+
id: m.String,
|
|
851
|
+
reason: m.String
|
|
852
|
+
}) {}, or = class extends m.TaggedError()("ServerOnlyColumnWrite", {
|
|
853
|
+
table: m.String,
|
|
854
|
+
columns: m.Array(m.String)
|
|
855
|
+
}) {}, sr = class extends m.TaggedError()("ConstraintViolation", {
|
|
856
|
+
kind: m.Literal("foreignKey", "foreignKeyInUse", "unique", "notNull", "check"),
|
|
857
|
+
table: m.String,
|
|
858
|
+
operation: m.String,
|
|
859
|
+
constraint: m.optional(m.String),
|
|
860
|
+
column: m.optional(m.String),
|
|
861
|
+
detail: m.optional(m.String)
|
|
803
862
|
}) {
|
|
804
863
|
get message() {
|
|
805
864
|
if (this.detail !== void 0) return this.detail;
|
|
@@ -812,85 +871,85 @@ var Ue = f.Union(f.String, f.Number), m = f.Record({
|
|
|
812
871
|
case "check": return `check constraint ${t}: the row does not satisfy it`;
|
|
813
872
|
}
|
|
814
873
|
}
|
|
815
|
-
},
|
|
816
|
-
name:
|
|
874
|
+
}, cr = "__voltro.approvals.pending", lr = "__voltro.approvals.decide", ur = I({
|
|
875
|
+
name: cr,
|
|
817
876
|
source: "_voltro_approvals",
|
|
818
|
-
input:
|
|
819
|
-
output:
|
|
877
|
+
input: m.Struct({ limit: m.optional(m.Number) }),
|
|
878
|
+
output: m.Array(st),
|
|
820
879
|
openAccess: "the answer is scoped to the caller — a row appears only if they requested it or hold its recorded approver scopes, so an anonymous caller sees nothing"
|
|
821
|
-
}),
|
|
822
|
-
name:
|
|
823
|
-
input:
|
|
824
|
-
approvalId:
|
|
825
|
-
decision:
|
|
826
|
-
note:
|
|
880
|
+
}), dr = L({
|
|
881
|
+
name: lr,
|
|
882
|
+
input: m.Struct({
|
|
883
|
+
approvalId: m.String,
|
|
884
|
+
decision: m.Literal("approve", "reject"),
|
|
885
|
+
note: m.optional(m.String)
|
|
827
886
|
}),
|
|
828
|
-
output:
|
|
829
|
-
approvalId:
|
|
830
|
-
status:
|
|
887
|
+
output: m.Struct({
|
|
888
|
+
approvalId: m.String,
|
|
889
|
+
status: m.Literal("approved", "rejected")
|
|
831
890
|
}),
|
|
832
891
|
error: ot,
|
|
833
892
|
openAccess: "the approver authority is the PENDING ROW's own recorded scopes (plus an unconditional self-approval refusal), checked in-handler — a descriptor-level scope would have to be the union of every approval-requiring procedure in the app"
|
|
834
|
-
}),
|
|
835
|
-
connectionId:
|
|
893
|
+
}), fr = "__voltro.connections.list", pr = "__voltro.connections.start", mr = "__voltro.connections.submitToken", hr = "__voltro.connections.disconnect", Q = m.Literal("oauth2", "pat"), gr = m.Literal("disconnected", "connected", "expired", "revoked", "error"), _r = m.Struct({
|
|
894
|
+
connectionId: m.String,
|
|
836
895
|
kind: Q,
|
|
837
|
-
label:
|
|
838
|
-
status:
|
|
839
|
-
accountId:
|
|
840
|
-
accountLabel:
|
|
841
|
-
scopes:
|
|
842
|
-
expiresAt:
|
|
843
|
-
lastError:
|
|
844
|
-
connectedAt:
|
|
845
|
-
}),
|
|
846
|
-
connectionId:
|
|
896
|
+
label: m.String,
|
|
897
|
+
status: gr,
|
|
898
|
+
accountId: m.NullOr(m.String),
|
|
899
|
+
accountLabel: m.NullOr(m.String),
|
|
900
|
+
scopes: m.Array(m.String),
|
|
901
|
+
expiresAt: m.NullOr(m.String),
|
|
902
|
+
lastError: m.NullOr(m.String),
|
|
903
|
+
connectedAt: m.NullOr(m.String)
|
|
904
|
+
}), vr = class extends m.TaggedError()("ConnectionNotDeclared", { connectionId: m.String }) {}, yr = class extends m.TaggedError()("ConnectionSubjectRequired", { connectionId: m.String }) {}, br = class extends m.TaggedError()("ConnectionKindMismatch", {
|
|
905
|
+
connectionId: m.String,
|
|
847
906
|
expected: Q,
|
|
848
907
|
actual: Q
|
|
849
|
-
}) {},
|
|
850
|
-
connectionId:
|
|
851
|
-
reason:
|
|
852
|
-
transient:
|
|
853
|
-
}) {}, $ =
|
|
854
|
-
name:
|
|
908
|
+
}) {}, xr = class extends m.TaggedError()("ConnectionHandshakeFailed", {
|
|
909
|
+
connectionId: m.String,
|
|
910
|
+
reason: m.String,
|
|
911
|
+
transient: m.Boolean
|
|
912
|
+
}) {}, $ = m.Union(vr, yr, br, xr), Sr = I({
|
|
913
|
+
name: fr,
|
|
855
914
|
source: "_voltro_connections",
|
|
856
|
-
input:
|
|
857
|
-
output:
|
|
915
|
+
input: m.Struct({}),
|
|
916
|
+
output: m.Array(_r),
|
|
858
917
|
openAccess: "self-scoped read: projects the declared connections for the calling subject only (its own connect/disconnect state)"
|
|
859
|
-
}),
|
|
860
|
-
name:
|
|
861
|
-
input:
|
|
862
|
-
connectionId:
|
|
863
|
-
redirectTo:
|
|
918
|
+
}), Cr = R({
|
|
919
|
+
name: pr,
|
|
920
|
+
input: m.Struct({
|
|
921
|
+
connectionId: m.String,
|
|
922
|
+
redirectTo: m.optional(m.String)
|
|
864
923
|
}),
|
|
865
|
-
output:
|
|
866
|
-
authorizeUrl:
|
|
867
|
-
state:
|
|
924
|
+
output: m.Struct({
|
|
925
|
+
authorizeUrl: m.String,
|
|
926
|
+
state: m.String
|
|
868
927
|
}),
|
|
869
928
|
error: $,
|
|
870
929
|
openAccess: "self-service: begins an oauth handshake that stores a credential for the calling subject only; anonymous callers fail typed with ConnectionSubjectRequired"
|
|
871
|
-
}),
|
|
872
|
-
name:
|
|
873
|
-
input:
|
|
874
|
-
connectionId:
|
|
875
|
-
token:
|
|
930
|
+
}), wr = L({
|
|
931
|
+
name: mr,
|
|
932
|
+
input: m.Struct({
|
|
933
|
+
connectionId: m.String,
|
|
934
|
+
token: m.String
|
|
876
935
|
}),
|
|
877
|
-
output:
|
|
936
|
+
output: m.Struct({ ok: m.Boolean }),
|
|
878
937
|
error: $,
|
|
879
938
|
openAccess: "self-service: stores a pasted token as the calling subject's own credential; anonymous callers fail typed with ConnectionSubjectRequired"
|
|
880
|
-
}),
|
|
881
|
-
name:
|
|
882
|
-
input:
|
|
883
|
-
output:
|
|
939
|
+
}), Tr = L({
|
|
940
|
+
name: hr,
|
|
941
|
+
input: m.Struct({ connectionId: m.String }),
|
|
942
|
+
output: m.Struct({ ok: m.Boolean }),
|
|
884
943
|
error: $,
|
|
885
944
|
openAccess: "self-service: deletes only the calling subject's own credential row for this connection"
|
|
886
|
-
}),
|
|
945
|
+
}), Er = (e) => {
|
|
887
946
|
let t = e instanceof Date ? e.getTime() : typeof e == "number" ? e : typeof e == "string" ? new Date(e).getTime() : 0;
|
|
888
947
|
return Number.isNaN(t) ? 0 : t;
|
|
889
|
-
},
|
|
948
|
+
}, Dr = 4001, Or = /* @__PURE__ */ new Set(["/rpc", "/ws"]), kr = (e) => {
|
|
890
949
|
if (!e.path.startsWith("/")) throw Error(`defineWebSocket: path must be absolute, got '${e.path}'`);
|
|
891
|
-
if (
|
|
950
|
+
if (Or.has(e.path)) throw Error(`defineWebSocket: '${e.path}' is the framework's own socket surface — mount the gateway elsewhere`);
|
|
892
951
|
if (e.auth !== "subject" && e.auth !== "public") throw Error(`defineWebSocket: auth must be 'subject' or 'public' (explicitly — an unauthenticated socket has to be a decision somebody wrote down), got '${String(e.auth)}'`);
|
|
893
952
|
return e;
|
|
894
|
-
},
|
|
953
|
+
}, Ar = 1;
|
|
895
954
|
//#endregion
|
|
896
|
-
export { De as ADMIN_SCOPE, Se as APIKEY_ISSUE_ORG_SCOPE, Te as APIKEY_ISSUE_OTHER_SCOPE, _e as APIKEY_ISSUE_SELF_SCOPE,
|
|
955
|
+
export { De as ADMIN_SCOPE, Se as APIKEY_ISSUE_ORG_SCOPE, Te as APIKEY_ISSUE_OTHER_SCOPE, _e as APIKEY_ISSUE_SELF_SCOPE, lr as APPROVALS_DECIDE_TAG, cr as APPROVALS_PENDING_TAG, ot as ApprovalDecisionErrors, at as ApprovalErrors, k as ApprovalExpired, it as ApprovalForbidden, et as ApprovalNotFound, rt as ApprovalNotPending, nt as ApprovalRejected, $e as ApprovalRequired, tt as ApprovalSelfApproval, A as ApprovalUnavailable, se as AuthMiddleware, E as BusinessRuleViolation, fr as CONNECTIONS_LIST_TAG, hr as CONNECTION_DISCONNECT_TAG, pr as CONNECTION_START_TAG, mr as CONNECTION_SUBMIT_TOKEN_TAG, xr as ConnectionHandshakeFailed, i as ConnectionInfo, r as ConnectionInfoMiddleware, Q as ConnectionKind, br as ConnectionKindMismatch, vr as ConnectionNotDeclared, _r as ConnectionState, gr as ConnectionStatus, yr as ConnectionSubjectRequired, sr as ConstraintViolation, ie as DEFAULT_SCOPE_CACHE_MAX_ENTRIES, ye as DEFAULT_SCOPE_CACHE_TTL_MS, Zt as EVENT_ROUTE_SEP, Jt as EventKeyInvalid, qt as EventPayloadInvalid, Yt as EventPayloadTooLarge, Dr as GATEWAY_CREDENTIAL_EXPIRED_CLOSE_CODE, e as IMPERSONATION_METADATA_KEY, Lt as MAX_EVENT_ENVELOPE_BYTES, Re as MUTATION_IN_FLIGHT_RETRY_AFTER_MS, p as MutationInFlight, rr as NoRowFound, Ar as PROTOCOL_VERSION, st as PendingApproval, j as REACTIVITY_CHANNEL_PREFIX, u as ScopeError, or as ServerOnlyColumnWrite, nr as StoreOperationFailed, ve as Subject, ne as SubjectIdentity, re as SubjectService, ir as TableValidationFailed, ar as TenantRowNotFound, tr as TenantScopeViolation, Gn as UNDO_APPLY_TAG, Wn as UNDO_LOG_TAG, Kn as UNDO_REDO_TAG, l as Unauthenticated, Xn as UndoConflict, Yn as UndoForbidden, qn as UndoLogEntry, Jn as UndoNotFound, O as ValidationError, Ze as ValidationErrors, D as ValidationIssue, U as WorkflowAccessProperty, Z as WorkflowControlInputSchema, En as WorkflowDomainEventRowSchema, kn as WorkflowDomainEventsInputSchema, An as WorkflowEventDeliveriesInputSchema, Dn as WorkflowEventDeliveryRowSchema, yn as WorkflowParentClosePolicySchema, Tn as WorkflowRunEventRowSchema, xn as WorkflowRunHandleSchema, On as WorkflowRunRefSchema, Y as WorkflowRunRowSchema, J as WorkflowRunStatusSchema, wn as WorkflowRunStepRowSchema, X as WorkflowRunTableRefSchema, Cn as WorkflowRunsInputSchema, jn as WorkflowSignalInputSchema, bn as WorkflowStartDeferralSchema, Mn as WorkflowUpdateInputSchema, Nn as WorkflowUpdateResultSchema, Mt as actionToRpc, Ce as advisoryResourceGuardWarning, a as anonymousSubject, Ye as applyRowPatch, c as applyScopeDecision, dr as approvalsDecideDescriptor, ur as approvalsPendingQueryDescriptor, te as assertAuthenticated, rn as attachWorkflowAccess, Ne as beginIdempotent, dn as checkFrameworkCompat, Ee as checkGuards, pe as checkGuardsEffect, ae as composeAuthStrategies, ln as composeRpcInterceptors, Tr as connectionDisconnectDescriptor, Cr as connectionStartDescriptor, wr as connectionSubmitTokenDescriptor, Sr as connectionsListQueryDescriptor, mt as declaredReactivityChannelKeys, R as defineAction, zt as defineEvent, L as defineMutation, on as definePlugin, sn as definePluginRoute, un as definePluginService, I as defineQuery, wt as defineStream, kr as defineWebSocket, qe as diffRows, be as effectiveScopes, Xt as encodeEventKey, Pt as errorTag, Ht as eventAttached, Bt as eventEnvelope, Vt as eventGap, Wt as eventResumePoint, Qt as eventRoute, Ut as eventStreamEvent, Gt as eventSubscribeInput, Kt as eventToRpc, Le as failIdempotent, Qe as fieldIssuesOf, Oe as findAdvisoryResourceGuards, ze as finishIdempotent, en as formatEventRoute, me as getPolicyGuardResolver, he as getResourceScopeResolver, W as getWorkflowAccess, Ct as hasAccessDecision, Me as hasCallbackRoutes, we as hasEffectiveScope, B as hasEnforcedGuard, xe as hasScope, y as idToPath, Pe as idempotencyScope, w as inputLabel, ge as isAuthenticatedCheck, St as isAuthenticatedGuard, Rt as isEventDescriptor, Je as isIdKeyed, d as isOpenAccess, de as isPolicyCheck, xt as isPolicyGuard, ft as isReactivityChannel, pt as isReactivityChannelKey, t as isSystemSubject, yt as isWireReachable, le as makeScopeCache, Fe as memoryIdempotencyStore, ke as missingAccessDecision, jt as mutationToRpc, It as normalizeDescriptor, gt as normalizeSource, f as openAccessSpec, $t as parseEventRoute, b as pathToId, pn as pluginAlias, cn as pluginInstanceName, mn as pluginSlug, vn as pluginTag, vt as publishReactivity, Be as publishServerError, At as queryToRpc, s as rawImpersonationMark, dt as reactivityChannel, gn as registerPluginAliases, fe as requireScope, _n as resetPluginAliases, nn as resolveWorkflowAccess, _ as rowPatchOpSchema, v as rowPatchSchema, ce as scopeCacheKey, je as setEffectiveScopes, oe as setPolicyGuardResolver, n as setResourceScopeResolver, ht as sourceKeys, Nt as streamToRpc, T as strictInput, ue as subjectIdentity, Ae as subjectScopes, Ie as subscribeServerErrors, C as subscriptionEvent, o as systemSubject, ee as tenantScopedSubject, Ft as toRpc, Er as tsMs, _t as undeclaredChannelKeys, $n as undoApplyDescriptor, Qn as undoLogQueryDescriptor, er as undoRedoDescriptor, H as wireErrorUnion, kt as withRpcTag, an as workflowAccessDescriptor, Bn as workflowCancelDescriptor, Rn as workflowDomainEventsQueryDescriptor, zn as workflowEventDeliveriesQueryDescriptor, Vn as workflowResumeDescriptor, Ln as workflowRunEventsQueryDescriptor, Pn as workflowRunQueryDescriptor, In as workflowRunStepsQueryDescriptor, Fn as workflowRunsQueryDescriptor, Hn as workflowSignalDescriptor, Sn as workflowToRpc, Un as workflowUpdateDescriptor, Ot as workflowWireErrorUnion, Ve as wsMutationIdempotencyScope };
|