@voltro/protocol 0.39.0 → 0.40.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 +210 -0
- package/dist/apikey.d.ts +17 -0
- package/dist/index.d.ts +78 -13
- package/dist/index.js +397 -393
- package/dist/jwt.d.ts +17 -0
- package/dist/rest.d.ts +17 -0
- package/dist/rest.js +1 -1
- package/dist/{auth-CKS3UNnf.js → scopes-B0kGvAnI.js} +169 -160
- package/dist/session.d.ts +35 -0
- package/dist/session.js +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
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 ee, I as te, L as
|
|
2
|
-
import { a as
|
|
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 ee, I as te, L as ne, M as re, N as s, O as ie, P as ae, R as oe, S as se, T as ce, U as le, V as ue, W as de, _ as fe, a as c, b as pe, c as me, d as he, f as ge, g as _e, h as l, i as ve, j as ye, k as be, l as xe, m as Se, n as Ce, o as we, p as Te, r as Ee, s as De, t as Oe, u as ke, v as u, w as Ae, x as je, y as Me, z as Ne } from "./scopes-B0kGvAnI.js";
|
|
2
|
+
import { a as Pe, c as Fe, i as Ie, n as Le, o as Re, r as ze, s as Be, t as Ve } from "./serverErrorBus-BeN9pOpY.js";
|
|
3
|
+
import { Context as He, Layer as Ue, Schema as d } from "effect";
|
|
4
|
+
import { Rpc as f } from "@effect/rpc";
|
|
5
5
|
//#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
|
-
ops:
|
|
22
|
-
order:
|
|
23
|
-
}),
|
|
6
|
+
var We = d.Union(d.String, d.Number), p = d.Record({
|
|
7
|
+
key: d.String,
|
|
8
|
+
value: d.Unknown
|
|
9
|
+
}).pipe(d.filter((e) => "id" in e, { message: () => "patch row must carry an id" })), m = d.Union(d.Struct({
|
|
10
|
+
op: d.Literal("add"),
|
|
11
|
+
path: d.String,
|
|
12
|
+
value: p
|
|
13
|
+
}), d.Struct({
|
|
14
|
+
op: d.Literal("replace"),
|
|
15
|
+
path: d.String,
|
|
16
|
+
value: p
|
|
17
|
+
}), d.Struct({
|
|
18
|
+
op: d.Literal("remove"),
|
|
19
|
+
path: d.String
|
|
20
|
+
})), h = d.Struct({
|
|
21
|
+
ops: d.Array(m),
|
|
22
|
+
order: d.Array(We)
|
|
23
|
+
}), g = (e) => `/${String(e).replace(/~/g, "~0").replace(/\//g, "~1")}`, Ge = (e) => (e.startsWith("/") ? e.slice(1) : e).replace(/~1/g, "/").replace(/~0/g, "~"), _ = (e) => {
|
|
24
24
|
let t = Object.keys(e).sort(), n = {};
|
|
25
25
|
for (let r of t) n[r] = e[r];
|
|
26
26
|
return JSON.stringify(n);
|
|
27
|
-
},
|
|
27
|
+
}, Ke = (e, t) => _(e) === _(t), qe = (e, t) => {
|
|
28
28
|
let n = /* @__PURE__ */ new Map();
|
|
29
29
|
for (let t of e) n.set(t.id, t);
|
|
30
30
|
let r = [], i = [], a = /* @__PURE__ */ new Set();
|
|
@@ -33,26 +33,26 @@ var qe = c.Union(c.String, c.Number), u = c.Record({
|
|
|
33
33
|
let t = n.get(e.id);
|
|
34
34
|
t === void 0 ? r.push({
|
|
35
35
|
op: "add",
|
|
36
|
-
path:
|
|
36
|
+
path: g(e.id),
|
|
37
37
|
value: e
|
|
38
|
-
}) :
|
|
38
|
+
}) : Ke(t, e) || r.push({
|
|
39
39
|
op: "replace",
|
|
40
|
-
path:
|
|
40
|
+
path: g(e.id),
|
|
41
41
|
value: e
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
for (let t of e) a.has(t.id) || r.push({
|
|
45
45
|
op: "remove",
|
|
46
|
-
path:
|
|
46
|
+
path: g(t.id)
|
|
47
47
|
});
|
|
48
48
|
return {
|
|
49
49
|
ops: r,
|
|
50
50
|
order: i
|
|
51
51
|
};
|
|
52
|
-
},
|
|
52
|
+
}, Je = (e) => e.every((e) => {
|
|
53
53
|
let t = e.id;
|
|
54
54
|
return typeof t == "string" || typeof t == "number";
|
|
55
|
-
}),
|
|
55
|
+
}), Ye = (e, t) => {
|
|
56
56
|
let n = /* @__PURE__ */ new Map();
|
|
57
57
|
for (let t of e) n.set(t.id, t);
|
|
58
58
|
for (let e of t.ops) (e.op === "add" || e.op === "replace") && n.set(e.value.id, e.value);
|
|
@@ -62,96 +62,96 @@ var qe = c.Union(c.String, c.Number), u = c.Record({
|
|
|
62
62
|
t !== void 0 && r.push(t);
|
|
63
63
|
}
|
|
64
64
|
return r;
|
|
65
|
-
},
|
|
66
|
-
_tag:
|
|
67
|
-
revision:
|
|
65
|
+
}, v = (e) => d.Union(d.Struct({
|
|
66
|
+
_tag: d.Literal("snapshot"),
|
|
67
|
+
revision: d.Number,
|
|
68
68
|
data: e,
|
|
69
|
-
computed:
|
|
70
|
-
}),
|
|
71
|
-
_tag:
|
|
72
|
-
revision:
|
|
73
|
-
emittedAt:
|
|
74
|
-
patch:
|
|
75
|
-
}),
|
|
76
|
-
_tag:
|
|
77
|
-
error:
|
|
78
|
-
revision:
|
|
79
|
-
})),
|
|
69
|
+
computed: d.optional(d.Boolean)
|
|
70
|
+
}), d.Struct({
|
|
71
|
+
_tag: d.Literal("delta"),
|
|
72
|
+
revision: d.Number,
|
|
73
|
+
emittedAt: d.Number,
|
|
74
|
+
patch: h
|
|
75
|
+
}), d.Struct({
|
|
76
|
+
_tag: d.Literal("error"),
|
|
77
|
+
error: d.Unknown,
|
|
78
|
+
revision: d.optional(d.Number)
|
|
79
|
+
})), Xe = (e) => {
|
|
80
80
|
let t = e.ast;
|
|
81
81
|
return t._tag === "TypeLiteral" && (t.propertySignatures?.length ?? 0) === 0 && (t.indexSignatures?.length ?? 0) === 0;
|
|
82
|
-
},
|
|
82
|
+
}, y = (e, t) => {
|
|
83
83
|
let n = e.annotations({
|
|
84
84
|
parseOptions: { onExcessProperty: "error" },
|
|
85
85
|
parseIssueTitle: () => `${t ?? "this procedure"} input`
|
|
86
86
|
});
|
|
87
|
-
return
|
|
88
|
-
},
|
|
89
|
-
rule:
|
|
90
|
-
params:
|
|
91
|
-
key:
|
|
92
|
-
value:
|
|
87
|
+
return Xe(e) ? d.filter((e) => typeof e == "object" && e && Object.keys(e).length > 0 ? `this procedure declares no input; received: ${Object.keys(e).join(", ")}` : void 0)(n).annotations({ identifier: `${t ?? "this procedure"} input` }) : n;
|
|
88
|
+
}, b = class extends d.TaggedError()("BusinessRuleViolation", {
|
|
89
|
+
rule: d.String,
|
|
90
|
+
params: d.optional(d.Record({
|
|
91
|
+
key: d.String,
|
|
92
|
+
value: d.Unknown
|
|
93
93
|
})),
|
|
94
|
-
field:
|
|
95
|
-
message:
|
|
96
|
-
severity:
|
|
97
|
-
}) {},
|
|
98
|
-
approvalId:
|
|
99
|
-
procedure:
|
|
100
|
-
expiresAt:
|
|
101
|
-
requiredScopes:
|
|
102
|
-
reason:
|
|
103
|
-
created:
|
|
104
|
-
}) {},
|
|
105
|
-
approvalId:
|
|
106
|
-
subjectId:
|
|
107
|
-
}) {},
|
|
108
|
-
approvalId:
|
|
109
|
-
decidedBy:
|
|
110
|
-
note:
|
|
111
|
-
}) {},
|
|
112
|
-
approvalId:
|
|
113
|
-
expiredAt:
|
|
114
|
-
}) {},
|
|
115
|
-
approvalId:
|
|
116
|
-
status:
|
|
117
|
-
}) {},
|
|
118
|
-
approvalId:
|
|
119
|
-
required:
|
|
120
|
-
message:
|
|
121
|
-
}) {},
|
|
122
|
-
procedure:
|
|
123
|
-
message:
|
|
124
|
-
}) {},
|
|
125
|
-
id:
|
|
126
|
-
procedure:
|
|
127
|
-
kind:
|
|
128
|
-
requestedBy:
|
|
129
|
-
status:
|
|
130
|
-
reason:
|
|
131
|
-
requiredScopes:
|
|
132
|
-
requestedAt:
|
|
133
|
-
expiresAt:
|
|
134
|
-
decidedBy:
|
|
135
|
-
decidedAt:
|
|
136
|
-
note:
|
|
137
|
-
relation:
|
|
138
|
-
}),
|
|
139
|
-
if (!
|
|
94
|
+
field: d.optional(d.String),
|
|
95
|
+
message: d.optional(d.String),
|
|
96
|
+
severity: d.Literal("error", "warning")
|
|
97
|
+
}) {}, x = class extends d.TaggedError()("ApprovalRequired", {
|
|
98
|
+
approvalId: d.String,
|
|
99
|
+
procedure: d.String,
|
|
100
|
+
expiresAt: d.String,
|
|
101
|
+
requiredScopes: d.Array(d.String),
|
|
102
|
+
reason: d.NullOr(d.String),
|
|
103
|
+
created: d.Boolean
|
|
104
|
+
}) {}, S = class extends d.TaggedError()("ApprovalNotFound", { approvalId: d.String }) {}, C = class extends d.TaggedError()("ApprovalSelfApproval", {
|
|
105
|
+
approvalId: d.String,
|
|
106
|
+
subjectId: d.NullOr(d.String)
|
|
107
|
+
}) {}, w = class extends d.TaggedError()("ApprovalRejected", {
|
|
108
|
+
approvalId: d.String,
|
|
109
|
+
decidedBy: d.NullOr(d.String),
|
|
110
|
+
note: d.NullOr(d.String)
|
|
111
|
+
}) {}, T = class extends d.TaggedError()("ApprovalExpired", {
|
|
112
|
+
approvalId: d.String,
|
|
113
|
+
expiredAt: d.String
|
|
114
|
+
}) {}, E = class extends d.TaggedError()("ApprovalNotPending", {
|
|
115
|
+
approvalId: d.String,
|
|
116
|
+
status: d.String
|
|
117
|
+
}) {}, D = class extends d.TaggedError()("ApprovalForbidden", {
|
|
118
|
+
approvalId: d.String,
|
|
119
|
+
required: d.NullOr(d.String),
|
|
120
|
+
message: d.String
|
|
121
|
+
}) {}, O = class extends d.TaggedError()("ApprovalUnavailable", {
|
|
122
|
+
procedure: d.String,
|
|
123
|
+
message: d.String
|
|
124
|
+
}) {}, k = d.Union(x, w, T, O), A = d.Union(S, C, T, E, D, O), j = d.Struct({
|
|
125
|
+
id: d.String,
|
|
126
|
+
procedure: d.String,
|
|
127
|
+
kind: d.Literal("mutation", "action"),
|
|
128
|
+
requestedBy: d.NullOr(d.String),
|
|
129
|
+
status: d.Literal("pending", "approved", "rejected", "expired", "consumed"),
|
|
130
|
+
reason: d.NullOr(d.String),
|
|
131
|
+
requiredScopes: d.Array(d.String),
|
|
132
|
+
requestedAt: d.String,
|
|
133
|
+
expiresAt: d.String,
|
|
134
|
+
decidedBy: d.NullOr(d.String),
|
|
135
|
+
decidedAt: d.NullOr(d.String),
|
|
136
|
+
note: d.NullOr(d.String),
|
|
137
|
+
relation: d.Literal("to-decide", "requested")
|
|
138
|
+
}), M = "channel:", N = Symbol.for("@voltro/protocol/reactivityChannels"), P = globalThis, F = P[N] ?? (P[N] = /* @__PURE__ */ new Map()), Ze = /^[a-z][a-z0-9-]*(\.[a-z0-9-]+)*$/, Qe = (e) => {
|
|
139
|
+
if (!Ze.test(e)) throw Error(`reactivityChannel('${e}'): invalid channel name.\n Use lowercase kebab segments separated by dots — \`presence\`, \`job-queue\`,
|
|
140
140
|
\`billing.usage\`. A \`:\` is refused because it is the namespace separator in
|
|
141
|
-
the routing key (\`${
|
|
141
|
+
the routing key (\`${M}<name>\`), and an uppercase letter is\n refused because a key that differs only by case reads as one channel and
|
|
142
142
|
routes as two.`);
|
|
143
|
-
let t =
|
|
143
|
+
let t = F.get(e);
|
|
144
144
|
if (t !== void 0) return t;
|
|
145
|
-
let n = `${
|
|
145
|
+
let n = `${M}${e}`, r = Object.freeze({
|
|
146
146
|
kind: "reactivity-channel",
|
|
147
147
|
name: e,
|
|
148
148
|
key: n,
|
|
149
149
|
toString: () => n
|
|
150
150
|
});
|
|
151
|
-
return
|
|
152
|
-
},
|
|
153
|
-
let t =
|
|
154
|
-
for (let r of e) for (let e of
|
|
151
|
+
return F.set(e, r), r;
|
|
152
|
+
}, I = (e) => typeof e == "object" && !!e && e.kind === "reactivity-channel", $e = (e) => e.startsWith(M), et = () => new Set([...F.values()].map((e) => e.key)), L = (e) => I(e) ? e.key : e, tt = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map(L) : [L(e)], nt = (e) => e === void 0 ? void 0 : Array.isArray(e) ? e.map(L) : L(e), rt = (e) => {
|
|
153
|
+
let t = et(), n = [];
|
|
154
|
+
for (let r of e) for (let e of tt(r.source)) !$e(e) || t.has(e) || n.push({
|
|
155
155
|
procedure: r.name,
|
|
156
156
|
key: e
|
|
157
157
|
});
|
|
@@ -193,19 +193,19 @@ var qe = c.Union(c.String, c.Number), u = c.Record({
|
|
|
193
193
|
human from every other, and the second-pair-of-eyes control would enforce nothing.
|
|
194
194
|
Give the procedure a \`guards:\` decision, or drop \`requiresApproval\`.`);
|
|
195
195
|
}
|
|
196
|
-
}, st = (e) => e.action !== void 0 && e.resourceType !== void 0, ct = (e) => e.openAccess !== void 0 || e.guards !== void 0 && e.guards.length > 0, z = (e,
|
|
197
|
-
if (
|
|
198
|
-
if (
|
|
196
|
+
}, st = (e) => e.action !== void 0 && e.resourceType !== void 0, ct = (e) => e.openAccess !== void 0 || e.guards !== void 0 && e.guards.length > 0, z = (e, t, n) => {
|
|
197
|
+
if (n === void 0) return t;
|
|
198
|
+
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
|
|
199
199
|
without an authorization check — e.g. \`openAccess: 'public pricing, no caller data'\`.`);
|
|
200
|
-
if (
|
|
200
|
+
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
|
|
201
201
|
caller must hold a scope; drop them if anyone may call it.`);
|
|
202
|
-
return [
|
|
202
|
+
return [u(n.trim())];
|
|
203
203
|
}, B = (e) => R({
|
|
204
204
|
kind: "query",
|
|
205
205
|
name: e.name,
|
|
206
206
|
input: e.input,
|
|
207
207
|
output: e.output,
|
|
208
|
-
error: e.error ??
|
|
208
|
+
error: e.error ?? d.Never,
|
|
209
209
|
source: nt(e.source),
|
|
210
210
|
cache: e.cache,
|
|
211
211
|
guards: z(e.name, e.guards, e.openAccess),
|
|
@@ -219,7 +219,7 @@ var qe = c.Union(c.String, c.Number), u = c.Record({
|
|
|
219
219
|
name: e.name,
|
|
220
220
|
input: e.input,
|
|
221
221
|
output: e.output,
|
|
222
|
-
error: e.error ??
|
|
222
|
+
error: e.error ?? d.Never,
|
|
223
223
|
target: e.target,
|
|
224
224
|
guards: z(e.name, e.guards, e.openAccess),
|
|
225
225
|
openAccess: e.openAccess,
|
|
@@ -233,7 +233,7 @@ var qe = c.Union(c.String, c.Number), u = c.Record({
|
|
|
233
233
|
name: e.name,
|
|
234
234
|
input: e.input,
|
|
235
235
|
output: e.output,
|
|
236
|
-
error: e.error ??
|
|
236
|
+
error: e.error ?? d.Never,
|
|
237
237
|
guards: z(e.name, e.guards, e.openAccess),
|
|
238
238
|
openAccess: e.openAccess,
|
|
239
239
|
source: e.source,
|
|
@@ -248,41 +248,45 @@ var qe = c.Union(c.String, c.Number), u = c.Record({
|
|
|
248
248
|
name: e.name,
|
|
249
249
|
input: e.input,
|
|
250
250
|
element: e.element,
|
|
251
|
-
error: e.error ??
|
|
251
|
+
error: e.error ?? d.Never,
|
|
252
252
|
internal: e.internal,
|
|
253
253
|
overridesPlugin: e.overridesPlugin,
|
|
254
254
|
guards: z(e.name, e.guards, e.openAccess),
|
|
255
255
|
openAccess: e.openAccess
|
|
256
|
-
}), U = (e, t) => t && t.length > 0 ?
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
256
|
+
}), U = (e, t) => t && t.length > 0 ? d.Union(e, ...t) : e, ut = (e, t) => t && t.some((e) => !l(e)) ? d.Union(e, c, s) : e, dt = (e) => d.Union(e, b), ft = (e, t) => t === void 0 ? e : d.Union(e, k), W = (e, t) => {
|
|
257
|
+
if (t === "stream") return e.error;
|
|
258
|
+
let n = ut(e.error, e.guards);
|
|
259
|
+
return t === "query" ? n : ft(t === "mutation" ? dt(n) : n, e.requiresApproval);
|
|
260
|
+
}, pt = (e, t) => f.make(e.name, {
|
|
261
|
+
payload: y(e.input, e.name),
|
|
262
|
+
success: v(e.output),
|
|
263
|
+
error: U(W(e, "query"), t),
|
|
260
264
|
stream: !0
|
|
261
|
-
}),
|
|
262
|
-
payload:
|
|
265
|
+
}), mt = (e, t) => f.make(e.name, {
|
|
266
|
+
payload: y(e.input, e.name),
|
|
263
267
|
success: e.output,
|
|
264
|
-
error: U(
|
|
265
|
-
}),
|
|
266
|
-
payload:
|
|
268
|
+
error: U(W(e, "mutation"), t)
|
|
269
|
+
}), ht = (e, t) => f.make(e.name, {
|
|
270
|
+
payload: y(e.input, e.name),
|
|
267
271
|
success: e.output,
|
|
268
|
-
error: U(
|
|
269
|
-
}),
|
|
270
|
-
payload:
|
|
272
|
+
error: U(W(e, "action"), t)
|
|
273
|
+
}), gt = (e, t) => f.make(e.name, {
|
|
274
|
+
payload: y(e.input, e.name),
|
|
271
275
|
success: e.element,
|
|
272
276
|
error: U(e.error, t),
|
|
273
277
|
stream: !0
|
|
274
|
-
}),
|
|
278
|
+
}), _t = (e) => {
|
|
275
279
|
if (typeof e != "object" || !e) return;
|
|
276
280
|
let t = e._tag;
|
|
277
281
|
return typeof t == "string" ? t : void 0;
|
|
278
|
-
},
|
|
282
|
+
}, vt = (e) => {
|
|
279
283
|
switch (e.kind) {
|
|
280
|
-
case "query": return
|
|
281
|
-
case "mutation": return
|
|
282
|
-
case "action": return
|
|
283
|
-
case "stream": return
|
|
284
|
+
case "query": return pt(e);
|
|
285
|
+
case "mutation": return mt(e);
|
|
286
|
+
case "action": return ht(e);
|
|
287
|
+
case "stream": return gt(e);
|
|
284
288
|
}
|
|
285
|
-
},
|
|
289
|
+
}, yt = (e) => {
|
|
286
290
|
let t = e.input, n = t === void 0 ? {} : { input: t }, r = e.output, i = r === void 0 ? {} : { output: r };
|
|
287
291
|
if (e.kind === "query") return {
|
|
288
292
|
kind: "query",
|
|
@@ -323,7 +327,7 @@ var qe = c.Union(c.String, c.Number), u = c.Record({
|
|
|
323
327
|
..."shapeItem" in e && e.shapeItem !== void 0 ? { shapeItem: e.shapeItem } : {}
|
|
324
328
|
}))
|
|
325
329
|
};
|
|
326
|
-
},
|
|
330
|
+
}, bt = 7500, xt = (e) => typeof e == "object" && !!e && e.kind === "event", St = (e) => {
|
|
327
331
|
if (e.name.length === 0) throw Error("defineEvent: `name` must not be empty");
|
|
328
332
|
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
|
|
329
333
|
whitespace and delivers nothing — silently, and only on that broker, so an
|
|
@@ -352,75 +356,75 @@ var qe = c.Union(c.String, c.Number), u = c.Record({
|
|
|
352
356
|
name: e.name,
|
|
353
357
|
key: e.key,
|
|
354
358
|
payload: e.payload,
|
|
355
|
-
guards: e.openAccess === void 0 ? e.guards : [
|
|
359
|
+
guards: e.openAccess === void 0 ? e.guards : [u(e.openAccess.trim())],
|
|
356
360
|
openAccess: e.openAccess,
|
|
357
361
|
rewind: e.rewind,
|
|
358
362
|
webhook: e.webhook,
|
|
359
363
|
delivery: e.delivery
|
|
360
364
|
};
|
|
361
|
-
},
|
|
362
|
-
_tag:
|
|
363
|
-
origin:
|
|
364
|
-
n:
|
|
365
|
-
emittedAt:
|
|
365
|
+
}, Ct = (e) => d.Struct({
|
|
366
|
+
_tag: d.Literal("event"),
|
|
367
|
+
origin: d.String,
|
|
368
|
+
n: d.Number,
|
|
369
|
+
emittedAt: d.Number,
|
|
366
370
|
payload: e
|
|
367
|
-
}),
|
|
368
|
-
_tag:
|
|
369
|
-
missed:
|
|
370
|
-
reason:
|
|
371
|
-
}),
|
|
372
|
-
origin:
|
|
373
|
-
n:
|
|
374
|
-
}),
|
|
371
|
+
}), wt = d.Struct({
|
|
372
|
+
_tag: d.Literal("gap"),
|
|
373
|
+
missed: d.Number,
|
|
374
|
+
reason: d.Literal("buffer", "resume")
|
|
375
|
+
}), Tt = d.Struct({ _tag: d.Literal("attached") }), Et = (e) => d.Union(Tt, Ct(e), wt), Dt = d.Struct({
|
|
376
|
+
origin: d.String,
|
|
377
|
+
n: d.Number
|
|
378
|
+
}), Ot = (e) => d.Struct({
|
|
375
379
|
key: e,
|
|
376
|
-
resume:
|
|
377
|
-
}),
|
|
378
|
-
let n = e.guards !== void 0 && e.guards.some((e) => !
|
|
379
|
-
return
|
|
380
|
-
payload:
|
|
381
|
-
success:
|
|
382
|
-
error:
|
|
380
|
+
resume: d.optional(d.Array(Dt))
|
|
381
|
+
}), kt = (e, t) => {
|
|
382
|
+
let n = e.guards !== void 0 && e.guards.some((e) => !l(e)) ? d.Union(c, s) : d.Never, r = t && t.length > 0 ? d.Union(n, ...t) : n;
|
|
383
|
+
return f.make(e.name, {
|
|
384
|
+
payload: y(Ot(e.key), e.name),
|
|
385
|
+
success: Et(e.payload),
|
|
386
|
+
error: r,
|
|
383
387
|
stream: !0
|
|
384
388
|
});
|
|
385
|
-
},
|
|
386
|
-
event:
|
|
387
|
-
message:
|
|
388
|
-
}) {},
|
|
389
|
-
event:
|
|
390
|
-
message:
|
|
391
|
-
}) {},
|
|
392
|
-
event:
|
|
393
|
-
bytes:
|
|
394
|
-
limit:
|
|
395
|
-
}) {},
|
|
389
|
+
}, At = class extends d.TaggedError()("EventPayloadInvalid", {
|
|
390
|
+
event: d.String,
|
|
391
|
+
message: d.String
|
|
392
|
+
}) {}, jt = class extends d.TaggedError()("EventKeyInvalid", {
|
|
393
|
+
event: d.String,
|
|
394
|
+
message: d.String
|
|
395
|
+
}) {}, Mt = class extends d.TaggedError()("EventPayloadTooLarge", {
|
|
396
|
+
event: d.String,
|
|
397
|
+
bytes: d.Number,
|
|
398
|
+
limit: d.Number
|
|
399
|
+
}) {}, Nt = (e) => {
|
|
396
400
|
if (typeof e != "object" || !e) return JSON.stringify(e) ?? "null";
|
|
397
401
|
let t = Object.entries(e).filter(([, e]) => e !== void 0).sort(([e], [t]) => e < t ? -1 : +(e > t));
|
|
398
402
|
return JSON.stringify(t);
|
|
399
|
-
},
|
|
403
|
+
}, Pt = "\0", Ft = (e, t, n) => [
|
|
400
404
|
e ?? "~",
|
|
401
405
|
t,
|
|
402
|
-
|
|
403
|
-
].join("\0"),
|
|
406
|
+
Nt(n)
|
|
407
|
+
].join("\0"), It = (e) => {
|
|
404
408
|
let [t = "~", n = "", r = ""] = e.split("\0");
|
|
405
409
|
return {
|
|
406
410
|
tenantId: t === "~" ? null : t,
|
|
407
411
|
event: n,
|
|
408
412
|
key: r
|
|
409
413
|
};
|
|
410
|
-
},
|
|
414
|
+
}, Lt = (e) => e.split("\0").join(" · "), Rt = (e) => e, zt = (e) => e, Bt = (e) => {
|
|
411
415
|
let t = e.alias?.trim(), n = e.instance?.trim(), r = t !== void 0 && t !== "" ? t : e.base;
|
|
412
416
|
return n !== void 0 && n !== "" ? `${r}#${n}` : r;
|
|
413
|
-
},
|
|
417
|
+
}, Vt = (e) => {
|
|
414
418
|
if (e.length !== 0) return (t, n) => e.reduceRight((e, t) => t(e, n), t);
|
|
415
|
-
},
|
|
416
|
-
let n =
|
|
419
|
+
}, Ht = (e, t) => {
|
|
420
|
+
let n = He.GenericTag(e);
|
|
417
421
|
return {
|
|
418
422
|
Tag: n,
|
|
419
|
-
Live:
|
|
423
|
+
Live: Ue.succeed(n, t)
|
|
420
424
|
};
|
|
421
|
-
},
|
|
425
|
+
}, Ut = (e, t, n) => {
|
|
422
426
|
if (!t) return { ok: !0 };
|
|
423
|
-
let r =
|
|
427
|
+
let r = G(n);
|
|
424
428
|
if (!r) return {
|
|
425
429
|
ok: !1,
|
|
426
430
|
reason: `cannot parse runningVersion "${n}"`
|
|
@@ -428,12 +432,12 @@ var qe = c.Union(c.String, c.Number), u = c.Record({
|
|
|
428
432
|
let i = t.trim();
|
|
429
433
|
if (i === "*" || i === "") return { ok: !0 };
|
|
430
434
|
let a = i.split(/\s+/).filter((e) => e.length > 0);
|
|
431
|
-
for (let i of a) if (!
|
|
435
|
+
for (let i of a) if (!Wt(i, r)) return {
|
|
432
436
|
ok: !1,
|
|
433
437
|
reason: `plugin "${e}" requires framework ${t}, running ${n}`
|
|
434
438
|
};
|
|
435
439
|
return { ok: !0 };
|
|
436
|
-
},
|
|
440
|
+
}, G = (e) => {
|
|
437
441
|
let t = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9a-zA-Z.-]+))?$/.exec(e.trim());
|
|
438
442
|
return t ? {
|
|
439
443
|
major: Number(t[1]),
|
|
@@ -441,275 +445,275 @@ var qe = c.Union(c.String, c.Number), u = c.Record({
|
|
|
441
445
|
patch: Number(t[3]),
|
|
442
446
|
pre: t[4] ?? ""
|
|
443
447
|
} : null;
|
|
444
|
-
},
|
|
448
|
+
}, 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, Wt = (e, t) => {
|
|
445
449
|
if (e === "*") return !0;
|
|
446
450
|
if (e.startsWith("^")) {
|
|
447
|
-
let n =
|
|
448
|
-
return !n || t.major !== n.major ? !1 :
|
|
451
|
+
let n = G(e.slice(1));
|
|
452
|
+
return !n || t.major !== n.major ? !1 : K(t, n) >= 0;
|
|
449
453
|
}
|
|
450
454
|
if (e.startsWith("~")) {
|
|
451
|
-
let n =
|
|
452
|
-
return !n || t.major !== n.major || t.minor !== n.minor ? !1 :
|
|
455
|
+
let n = G(e.slice(1));
|
|
456
|
+
return !n || t.major !== n.major || t.minor !== n.minor ? !1 : K(t, n) >= 0;
|
|
453
457
|
}
|
|
454
458
|
let n = /^(>=|<=|>|<)(.+)$/.exec(e);
|
|
455
459
|
if (n) {
|
|
456
|
-
let e = n[1], r =
|
|
460
|
+
let e = n[1], r = G(n[2]);
|
|
457
461
|
if (!r) return !1;
|
|
458
|
-
let i =
|
|
462
|
+
let i = K(t, r);
|
|
459
463
|
if (e === ">=") return i >= 0;
|
|
460
464
|
if (e === "<=") return i <= 0;
|
|
461
465
|
if (e === ">") return i > 0;
|
|
462
466
|
if (e === "<") return i < 0;
|
|
463
467
|
}
|
|
464
|
-
let r =
|
|
465
|
-
return r ?
|
|
466
|
-
},
|
|
467
|
-
mode:
|
|
468
|
-
dueAt:
|
|
469
|
-
retryAfterMs:
|
|
470
|
-
intentId:
|
|
471
|
-
}),
|
|
472
|
-
id:
|
|
473
|
-
workflowName:
|
|
474
|
-
executionId:
|
|
475
|
-
status:
|
|
476
|
-
deferral:
|
|
477
|
-
}),
|
|
478
|
-
id:
|
|
479
|
-
tag:
|
|
480
|
-
executionId:
|
|
481
|
-
status:
|
|
482
|
-
payload:
|
|
483
|
-
workflowVersion:
|
|
484
|
-
workflowPatches:
|
|
485
|
-
output:
|
|
486
|
-
subject:
|
|
487
|
-
source:
|
|
488
|
-
errorTag:
|
|
489
|
-
errorMessage:
|
|
490
|
-
cancelled:
|
|
491
|
-
startedAt:
|
|
492
|
-
completedAt:
|
|
493
|
-
durationMs:
|
|
494
|
-
traceId:
|
|
495
|
-
parentExecutionId:
|
|
496
|
-
parentClosePolicy:
|
|
497
|
-
}),
|
|
498
|
-
tag:
|
|
499
|
-
status:
|
|
500
|
-
limit:
|
|
501
|
-
}),
|
|
502
|
-
id:
|
|
503
|
-
runId:
|
|
504
|
-
stepName:
|
|
505
|
-
attempt:
|
|
506
|
-
status:
|
|
507
|
-
input:
|
|
508
|
-
retryPolicy:
|
|
509
|
-
output:
|
|
510
|
-
errorTag:
|
|
511
|
-
errorMessage:
|
|
512
|
-
errorCause:
|
|
513
|
-
startedAt:
|
|
514
|
-
completedAt:
|
|
515
|
-
durationMs:
|
|
516
|
-
}),
|
|
517
|
-
id:
|
|
518
|
-
runId:
|
|
519
|
-
eventType:
|
|
520
|
-
payload:
|
|
521
|
-
occurredAt:
|
|
522
|
-
stepName:
|
|
523
|
-
attempt:
|
|
524
|
-
}),
|
|
525
|
-
id:
|
|
526
|
-
name:
|
|
527
|
-
payload:
|
|
528
|
-
source:
|
|
529
|
-
subject:
|
|
530
|
-
traceId:
|
|
531
|
-
occurredAt:
|
|
532
|
-
}),
|
|
533
|
-
id:
|
|
534
|
-
eventId:
|
|
535
|
-
eventName:
|
|
536
|
-
triggerId:
|
|
537
|
-
workflowName:
|
|
538
|
-
executionId:
|
|
539
|
-
status:
|
|
540
|
-
idempotencyKey:
|
|
541
|
-
skipped:
|
|
542
|
-
errorMessage:
|
|
543
|
-
createdAt:
|
|
544
|
-
completedAt:
|
|
545
|
-
}),
|
|
546
|
-
name:
|
|
547
|
-
limit:
|
|
548
|
-
}),
|
|
549
|
-
workflowName:
|
|
550
|
-
executionId:
|
|
551
|
-
}),
|
|
552
|
-
id:
|
|
553
|
-
signalName:
|
|
554
|
-
payload:
|
|
555
|
-
}),
|
|
556
|
-
id:
|
|
557
|
-
updateName:
|
|
558
|
-
payload:
|
|
559
|
-
timeoutMs:
|
|
560
|
-
}),
|
|
561
|
-
eventId:
|
|
562
|
-
updateId:
|
|
563
|
-
completedEventId:
|
|
564
|
-
result:
|
|
565
|
-
}),
|
|
468
|
+
let r = G(e);
|
|
469
|
+
return r ? K(t, r) === 0 : !1;
|
|
470
|
+
}, q = d.Literal("running", "succeeded", "failed", "cancelled", "suspended"), Gt = d.Literal("cancel", "terminate", "abandon"), Kt = d.Struct({
|
|
471
|
+
mode: d.String,
|
|
472
|
+
dueAt: d.NullOr(d.Number),
|
|
473
|
+
retryAfterMs: d.NullOr(d.Number),
|
|
474
|
+
intentId: d.NullOr(d.String)
|
|
475
|
+
}), qt = d.Struct({
|
|
476
|
+
id: d.String,
|
|
477
|
+
workflowName: d.String,
|
|
478
|
+
executionId: d.NullOr(d.String),
|
|
479
|
+
status: d.Literal("running", "queued", "dropped", "skipped"),
|
|
480
|
+
deferral: d.optional(Kt)
|
|
481
|
+
}), J = d.Struct({
|
|
482
|
+
id: d.String,
|
|
483
|
+
tag: d.String,
|
|
484
|
+
executionId: d.String,
|
|
485
|
+
status: q,
|
|
486
|
+
payload: d.Unknown,
|
|
487
|
+
workflowVersion: d.NullOr(d.String),
|
|
488
|
+
workflowPatches: d.NullOr(d.Unknown),
|
|
489
|
+
output: d.NullOr(d.Unknown),
|
|
490
|
+
subject: d.NullOr(d.Unknown),
|
|
491
|
+
source: d.NullOr(d.String),
|
|
492
|
+
errorTag: d.NullOr(d.String),
|
|
493
|
+
errorMessage: d.NullOr(d.String),
|
|
494
|
+
cancelled: d.Boolean,
|
|
495
|
+
startedAt: d.Date,
|
|
496
|
+
completedAt: d.NullOr(d.Date),
|
|
497
|
+
durationMs: d.NullOr(d.Number),
|
|
498
|
+
traceId: d.NullOr(d.String),
|
|
499
|
+
parentExecutionId: d.NullOr(d.String),
|
|
500
|
+
parentClosePolicy: d.NullOr(Gt)
|
|
501
|
+
}), Jt = d.Struct({
|
|
502
|
+
tag: d.optional(d.String),
|
|
503
|
+
status: d.optional(q),
|
|
504
|
+
limit: d.optional(d.Number)
|
|
505
|
+
}), Yt = d.Struct({
|
|
506
|
+
id: d.String,
|
|
507
|
+
runId: d.String,
|
|
508
|
+
stepName: d.String,
|
|
509
|
+
attempt: d.Number,
|
|
510
|
+
status: d.Literal("running", "succeeded", "failed"),
|
|
511
|
+
input: d.NullOr(d.Unknown),
|
|
512
|
+
retryPolicy: d.NullOr(d.Unknown),
|
|
513
|
+
output: d.NullOr(d.Unknown),
|
|
514
|
+
errorTag: d.NullOr(d.String),
|
|
515
|
+
errorMessage: d.NullOr(d.String),
|
|
516
|
+
errorCause: d.NullOr(d.Unknown),
|
|
517
|
+
startedAt: d.Date,
|
|
518
|
+
completedAt: d.NullOr(d.Date),
|
|
519
|
+
durationMs: d.NullOr(d.Number)
|
|
520
|
+
}), Xt = d.Struct({
|
|
521
|
+
id: d.String,
|
|
522
|
+
runId: d.String,
|
|
523
|
+
eventType: d.String,
|
|
524
|
+
payload: d.NullOr(d.Unknown),
|
|
525
|
+
occurredAt: d.Date,
|
|
526
|
+
stepName: d.NullOr(d.String),
|
|
527
|
+
attempt: d.NullOr(d.Number)
|
|
528
|
+
}), Zt = d.Struct({
|
|
529
|
+
id: d.String,
|
|
530
|
+
name: d.String,
|
|
531
|
+
payload: d.Unknown,
|
|
532
|
+
source: d.String,
|
|
533
|
+
subject: d.NullOr(d.Unknown),
|
|
534
|
+
traceId: d.NullOr(d.String),
|
|
535
|
+
occurredAt: d.Date
|
|
536
|
+
}), Qt = d.Struct({
|
|
537
|
+
id: d.String,
|
|
538
|
+
eventId: d.String,
|
|
539
|
+
eventName: d.String,
|
|
540
|
+
triggerId: d.String,
|
|
541
|
+
workflowName: d.String,
|
|
542
|
+
executionId: d.NullOr(d.String),
|
|
543
|
+
status: d.Literal("starting", "started", "skipped", "failed"),
|
|
544
|
+
idempotencyKey: d.String,
|
|
545
|
+
skipped: d.Boolean,
|
|
546
|
+
errorMessage: d.NullOr(d.String),
|
|
547
|
+
createdAt: d.Date,
|
|
548
|
+
completedAt: d.NullOr(d.Date)
|
|
549
|
+
}), $t = d.Struct({ id: d.String }), Y = d.Struct({ runId: d.String }), en = d.Struct({
|
|
550
|
+
name: d.optional(d.String),
|
|
551
|
+
limit: d.optional(d.Number)
|
|
552
|
+
}), tn = d.Struct({ eventId: d.String }), X = d.Struct({
|
|
553
|
+
workflowName: d.String,
|
|
554
|
+
executionId: d.String
|
|
555
|
+
}), nn = d.Struct({
|
|
556
|
+
id: d.String,
|
|
557
|
+
signalName: d.String,
|
|
558
|
+
payload: d.optional(d.Unknown)
|
|
559
|
+
}), rn = d.Struct({
|
|
560
|
+
id: d.String,
|
|
561
|
+
updateName: d.String,
|
|
562
|
+
payload: d.optional(d.Unknown),
|
|
563
|
+
timeoutMs: d.optional(d.Number)
|
|
564
|
+
}), an = d.Struct({
|
|
565
|
+
eventId: d.String,
|
|
566
|
+
updateId: d.String,
|
|
567
|
+
completedEventId: d.String,
|
|
568
|
+
result: d.Unknown
|
|
569
|
+
}), on = B({
|
|
566
570
|
name: "__voltro.workflow.run",
|
|
567
571
|
source: "_voltro_workflow_runs",
|
|
568
|
-
input:
|
|
569
|
-
output:
|
|
570
|
-
}),
|
|
572
|
+
input: $t,
|
|
573
|
+
output: d.Array(J)
|
|
574
|
+
}), sn = B({
|
|
571
575
|
name: "__voltro.workflow.runs",
|
|
572
576
|
source: "_voltro_workflow_runs",
|
|
573
|
-
input:
|
|
574
|
-
output:
|
|
575
|
-
}),
|
|
577
|
+
input: Jt,
|
|
578
|
+
output: d.Array(J)
|
|
579
|
+
}), cn = B({
|
|
576
580
|
name: "__voltro.workflow.run.steps",
|
|
577
581
|
source: "_voltro_workflow_run_steps",
|
|
578
|
-
input:
|
|
579
|
-
output:
|
|
580
|
-
}),
|
|
582
|
+
input: Y,
|
|
583
|
+
output: d.Array(Yt)
|
|
584
|
+
}), ln = B({
|
|
581
585
|
name: "__voltro.workflow.run.events",
|
|
582
586
|
source: "_voltro_workflow_run_events",
|
|
583
|
-
input:
|
|
584
|
-
output:
|
|
585
|
-
}),
|
|
587
|
+
input: Y,
|
|
588
|
+
output: d.Array(Xt)
|
|
589
|
+
}), un = B({
|
|
586
590
|
name: "__voltro.workflow.domainEvents",
|
|
587
591
|
source: "_voltro_workflow_events",
|
|
588
|
-
input:
|
|
589
|
-
output:
|
|
590
|
-
}),
|
|
592
|
+
input: en,
|
|
593
|
+
output: d.Array(Zt)
|
|
594
|
+
}), dn = B({
|
|
591
595
|
name: "__voltro.workflow.event.deliveries",
|
|
592
596
|
source: "_voltro_workflow_event_deliveries",
|
|
593
|
-
input:
|
|
594
|
-
output:
|
|
595
|
-
}),
|
|
597
|
+
input: tn,
|
|
598
|
+
output: d.Array(Qt)
|
|
599
|
+
}), fn = H({
|
|
596
600
|
name: "__voltro.workflow.cancel",
|
|
597
|
-
input:
|
|
598
|
-
output:
|
|
599
|
-
}),
|
|
601
|
+
input: X,
|
|
602
|
+
output: d.Struct({ ok: d.Boolean })
|
|
603
|
+
}), pn = H({
|
|
600
604
|
name: "__voltro.workflow.resume",
|
|
601
|
-
input:
|
|
602
|
-
output:
|
|
603
|
-
}),
|
|
605
|
+
input: X,
|
|
606
|
+
output: d.Struct({ ok: d.Boolean })
|
|
607
|
+
}), mn = H({
|
|
604
608
|
name: "__voltro.workflow.signal",
|
|
605
|
-
input:
|
|
606
|
-
output:
|
|
607
|
-
}),
|
|
609
|
+
input: nn,
|
|
610
|
+
output: d.Struct({ eventId: d.String })
|
|
611
|
+
}), hn = H({
|
|
608
612
|
name: "__voltro.workflow.update",
|
|
609
|
-
input:
|
|
610
|
-
output:
|
|
611
|
-
}),
|
|
612
|
-
id:
|
|
613
|
-
tag:
|
|
614
|
-
label:
|
|
615
|
-
undone:
|
|
616
|
-
crossesAction:
|
|
617
|
-
createdAt:
|
|
618
|
-
}),
|
|
619
|
-
invocationId:
|
|
620
|
-
reason:
|
|
621
|
-
}) {},
|
|
622
|
-
name:
|
|
613
|
+
input: rn,
|
|
614
|
+
output: an
|
|
615
|
+
}), gn = "__voltro.undo.log", Z = "__voltro.undo.apply", _n = "__voltro.undo.redo", vn = d.Struct({
|
|
616
|
+
id: d.String,
|
|
617
|
+
tag: d.String,
|
|
618
|
+
label: d.NullOr(d.String),
|
|
619
|
+
undone: d.Boolean,
|
|
620
|
+
crossesAction: d.Boolean,
|
|
621
|
+
createdAt: d.String
|
|
622
|
+
}), yn = class extends d.TaggedError()("UndoNotFound", { invocationId: d.String }) {}, bn = class extends d.TaggedError()("UndoForbidden", { invocationId: d.String }) {}, xn = class extends d.TaggedError()("UndoConflict", {
|
|
623
|
+
invocationId: d.String,
|
|
624
|
+
reason: d.Literal("conflict", "action")
|
|
625
|
+
}) {}, Sn = d.Union(yn, bn, xn), Cn = B({
|
|
626
|
+
name: gn,
|
|
623
627
|
source: "_voltro_undo_log",
|
|
624
|
-
input:
|
|
625
|
-
output:
|
|
628
|
+
input: d.Struct({ limit: d.optional(d.Number) }),
|
|
629
|
+
output: d.Array(vn),
|
|
626
630
|
openAccess: "subject-scoped by construction: lists only the calling subject's own undoable actions"
|
|
627
|
-
}), Cn = V({
|
|
628
|
-
name: hn,
|
|
629
|
-
input: c.Struct({ invocationId: c.String }),
|
|
630
|
-
output: c.Struct({ ok: c.Boolean }),
|
|
631
|
-
error: xn,
|
|
632
|
-
openAccess: "subject-scoped by construction: undo is per-actor — another subject's invocation fails typed with UndoForbidden"
|
|
633
631
|
}), wn = V({
|
|
634
|
-
name:
|
|
635
|
-
input:
|
|
636
|
-
output:
|
|
637
|
-
error:
|
|
632
|
+
name: Z,
|
|
633
|
+
input: d.Struct({ invocationId: d.String }),
|
|
634
|
+
output: d.Struct({ ok: d.Boolean }),
|
|
635
|
+
error: Sn,
|
|
636
|
+
openAccess: "subject-scoped by construction: undo is per-actor — another subject's invocation fails typed with UndoForbidden"
|
|
637
|
+
}), Tn = V({
|
|
638
|
+
name: _n,
|
|
639
|
+
input: d.Struct({ invocationId: d.String }),
|
|
640
|
+
output: d.Struct({ ok: d.Boolean }),
|
|
641
|
+
error: Sn,
|
|
638
642
|
openAccess: "subject-scoped by construction: redo is per-actor — another subject's invocation fails typed with UndoForbidden"
|
|
639
|
-
}),
|
|
640
|
-
name:
|
|
643
|
+
}), En = "__voltro.approvals.pending", Dn = "__voltro.approvals.decide", On = B({
|
|
644
|
+
name: En,
|
|
641
645
|
source: "_voltro_approvals",
|
|
642
|
-
input:
|
|
643
|
-
output:
|
|
646
|
+
input: d.Struct({ limit: d.optional(d.Number) }),
|
|
647
|
+
output: d.Array(j),
|
|
644
648
|
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"
|
|
645
|
-
}),
|
|
646
|
-
name:
|
|
647
|
-
input:
|
|
648
|
-
approvalId:
|
|
649
|
-
decision:
|
|
650
|
-
note:
|
|
649
|
+
}), kn = V({
|
|
650
|
+
name: Dn,
|
|
651
|
+
input: d.Struct({
|
|
652
|
+
approvalId: d.String,
|
|
653
|
+
decision: d.Literal("approve", "reject"),
|
|
654
|
+
note: d.optional(d.String)
|
|
651
655
|
}),
|
|
652
|
-
output:
|
|
653
|
-
approvalId:
|
|
654
|
-
status:
|
|
656
|
+
output: d.Struct({
|
|
657
|
+
approvalId: d.String,
|
|
658
|
+
status: d.Literal("approved", "rejected")
|
|
655
659
|
}),
|
|
656
|
-
error:
|
|
660
|
+
error: A,
|
|
657
661
|
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"
|
|
658
|
-
}),
|
|
659
|
-
connectionId:
|
|
662
|
+
}), An = "__voltro.connections.list", jn = "__voltro.connections.start", Mn = "__voltro.connections.submitToken", Nn = "__voltro.connections.disconnect", Q = d.Literal("oauth2", "pat"), Pn = d.Literal("disconnected", "connected", "expired", "revoked", "error"), Fn = d.Struct({
|
|
663
|
+
connectionId: d.String,
|
|
660
664
|
kind: Q,
|
|
661
|
-
label:
|
|
662
|
-
status:
|
|
663
|
-
accountId:
|
|
664
|
-
accountLabel:
|
|
665
|
-
scopes:
|
|
666
|
-
expiresAt:
|
|
667
|
-
lastError:
|
|
668
|
-
connectedAt:
|
|
669
|
-
}),
|
|
670
|
-
connectionId:
|
|
665
|
+
label: d.String,
|
|
666
|
+
status: Pn,
|
|
667
|
+
accountId: d.NullOr(d.String),
|
|
668
|
+
accountLabel: d.NullOr(d.String),
|
|
669
|
+
scopes: d.Array(d.String),
|
|
670
|
+
expiresAt: d.NullOr(d.String),
|
|
671
|
+
lastError: d.NullOr(d.String),
|
|
672
|
+
connectedAt: d.NullOr(d.String)
|
|
673
|
+
}), In = class extends d.TaggedError()("ConnectionNotDeclared", { connectionId: d.String }) {}, Ln = class extends d.TaggedError()("ConnectionSubjectRequired", { connectionId: d.String }) {}, Rn = class extends d.TaggedError()("ConnectionKindMismatch", {
|
|
674
|
+
connectionId: d.String,
|
|
671
675
|
expected: Q,
|
|
672
676
|
actual: Q
|
|
673
|
-
}) {},
|
|
674
|
-
connectionId:
|
|
675
|
-
reason:
|
|
676
|
-
transient:
|
|
677
|
-
}) {}, $ =
|
|
678
|
-
name:
|
|
677
|
+
}) {}, zn = class extends d.TaggedError()("ConnectionHandshakeFailed", {
|
|
678
|
+
connectionId: d.String,
|
|
679
|
+
reason: d.String,
|
|
680
|
+
transient: d.Boolean
|
|
681
|
+
}) {}, $ = d.Union(In, Ln, Rn, zn), Bn = B({
|
|
682
|
+
name: An,
|
|
679
683
|
source: "_voltro_connections",
|
|
680
|
-
input:
|
|
681
|
-
output:
|
|
684
|
+
input: d.Struct({}),
|
|
685
|
+
output: d.Array(Fn),
|
|
682
686
|
openAccess: "self-scoped read: projects the declared connections for the calling subject only (its own connect/disconnect state)"
|
|
683
|
-
}),
|
|
684
|
-
name:
|
|
685
|
-
input:
|
|
686
|
-
connectionId:
|
|
687
|
-
redirectTo:
|
|
687
|
+
}), Vn = H({
|
|
688
|
+
name: jn,
|
|
689
|
+
input: d.Struct({
|
|
690
|
+
connectionId: d.String,
|
|
691
|
+
redirectTo: d.optional(d.String)
|
|
688
692
|
}),
|
|
689
|
-
output:
|
|
690
|
-
authorizeUrl:
|
|
691
|
-
state:
|
|
693
|
+
output: d.Struct({
|
|
694
|
+
authorizeUrl: d.String,
|
|
695
|
+
state: d.String
|
|
692
696
|
}),
|
|
693
697
|
error: $,
|
|
694
698
|
openAccess: "self-service: begins an oauth handshake that stores a credential for the calling subject only; anonymous callers fail typed with ConnectionSubjectRequired"
|
|
695
|
-
}),
|
|
696
|
-
name:
|
|
697
|
-
input:
|
|
698
|
-
connectionId:
|
|
699
|
-
token:
|
|
699
|
+
}), Hn = V({
|
|
700
|
+
name: Mn,
|
|
701
|
+
input: d.Struct({
|
|
702
|
+
connectionId: d.String,
|
|
703
|
+
token: d.String
|
|
700
704
|
}),
|
|
701
|
-
output:
|
|
705
|
+
output: d.Struct({ ok: d.Boolean }),
|
|
702
706
|
error: $,
|
|
703
707
|
openAccess: "self-service: stores a pasted token as the calling subject's own credential; anonymous callers fail typed with ConnectionSubjectRequired"
|
|
704
|
-
}),
|
|
705
|
-
name:
|
|
706
|
-
input:
|
|
707
|
-
output:
|
|
708
|
+
}), Un = V({
|
|
709
|
+
name: Nn,
|
|
710
|
+
input: d.Struct({ connectionId: d.String }),
|
|
711
|
+
output: d.Struct({ ok: d.Boolean }),
|
|
708
712
|
error: $,
|
|
709
713
|
openAccess: "self-service: deletes only the calling subject's own credential row for this connection"
|
|
710
|
-
}),
|
|
714
|
+
}), Wn = (e) => {
|
|
711
715
|
let t = e instanceof Date ? e.getTime() : typeof e == "number" ? e : typeof e == "string" ? new Date(e).getTime() : 0;
|
|
712
716
|
return Number.isNaN(t) ? 0 : t;
|
|
713
|
-
},
|
|
717
|
+
}, Gn = 1;
|
|
714
718
|
//#endregion
|
|
715
|
-
export {
|
|
719
|
+
export { Oe as ADMIN_SCOPE, Ce as APIKEY_ISSUE_ORG_SCOPE, Ee as APIKEY_ISSUE_OTHER_SCOPE, ve as APIKEY_ISSUE_SELF_SCOPE, Dn as APPROVALS_DECIDE_TAG, En as APPROVALS_PENDING_TAG, A as ApprovalDecisionErrors, k as ApprovalErrors, T as ApprovalExpired, D as ApprovalForbidden, S as ApprovalNotFound, E as ApprovalNotPending, w as ApprovalRejected, x as ApprovalRequired, C as ApprovalSelfApproval, O as ApprovalUnavailable, Ae as AuthMiddleware, b as BusinessRuleViolation, An as CONNECTIONS_LIST_TAG, Nn as CONNECTION_DISCONNECT_TAG, jn as CONNECTION_START_TAG, Mn as CONNECTION_SUBMIT_TOKEN_TAG, zn as ConnectionHandshakeFailed, ce as ConnectionInfo, i as ConnectionInfoMiddleware, Q as ConnectionKind, Rn as ConnectionKindMismatch, In as ConnectionNotDeclared, Fn as ConnectionState, Pn as ConnectionStatus, Ln as ConnectionSubjectRequired, r as DEFAULT_SCOPE_CACHE_MAX_ENTRIES, ie as DEFAULT_SCOPE_CACHE_TTL_MS, Pt as EVENT_ROUTE_SEP, jt as EventKeyInvalid, At as EventPayloadInvalid, Mt as EventPayloadTooLarge, be as IMPERSONATION_METADATA_KEY, bt as MAX_EVENT_ENVELOPE_BYTES, Gn as PROTOCOL_VERSION, j as PendingApproval, M as REACTIVITY_CHANNEL_PREFIX, c as ScopeError, e as Subject, ye as SubjectIdentity, re as SubjectService, Z as UNDO_APPLY_TAG, gn as UNDO_LOG_TAG, _n as UNDO_REDO_TAG, s as Unauthenticated, xn as UndoConflict, bn as UndoForbidden, vn as UndoLogEntry, yn as UndoNotFound, X as WorkflowControlInputSchema, Zt as WorkflowDomainEventRowSchema, en as WorkflowDomainEventsInputSchema, tn as WorkflowEventDeliveriesInputSchema, Qt as WorkflowEventDeliveryRowSchema, Gt as WorkflowParentClosePolicySchema, Xt as WorkflowRunEventRowSchema, qt as WorkflowRunHandleSchema, $t as WorkflowRunRefSchema, J as WorkflowRunRowSchema, q as WorkflowRunStatusSchema, Yt as WorkflowRunStepRowSchema, Y as WorkflowRunTableRefSchema, Jt as WorkflowRunsInputSchema, nn as WorkflowSignalInputSchema, Kt as WorkflowStartDeferralSchema, rn as WorkflowUpdateInputSchema, an as WorkflowUpdateResultSchema, ht as actionToRpc, we as advisoryResourceGuardWarning, ae as anonymousSubject, Ye as applyRowPatch, a as applyScopeDecision, kn as approvalsDecideDescriptor, On as approvalsPendingQueryDescriptor, te as assertAuthenticated, ze as beginIdempotent, Ut as checkFrameworkCompat, De as checkGuards, me as checkGuardsEffect, ne as composeAuthStrategies, Vt as composeRpcInterceptors, Un as connectionDisconnectDescriptor, Vn as connectionStartDescriptor, Hn as connectionSubmitTokenDescriptor, Bn as connectionsListQueryDescriptor, et as declaredReactivityChannelKeys, H as defineAction, St as defineEvent, V as defineMutation, Rt as definePlugin, zt as definePluginRoute, Ht as definePluginService, B as defineQuery, lt as defineStream, qe as diffRows, xe as effectiveScopes, Nt as encodeEventKey, _t as errorTag, Tt as eventAttached, Ct as eventEnvelope, wt as eventGap, Dt as eventResumePoint, Ft as eventRoute, Et as eventStreamEvent, Ot as eventSubscribeInput, kt as eventToRpc, Ie as failIdempotent, ke as findAdvisoryResourceGuards, Pe as finishIdempotent, Lt as formatEventRoute, he as getPolicyGuardResolver, ge as getResourceScopeResolver, ct as hasAccessDecision, oe as hasCallbackRoutes, Te as hasEffectiveScope, Se as hasScope, g as idToPath, Re as idempotencyScope, xt as isEventDescriptor, Je as isIdKeyed, l as isOpenAccess, _e as isPolicyCheck, st as isPolicyGuard, I as isReactivityChannel, $e as isReactivityChannelKey, Ne as isSystemSubject, at as isWireReachable, t as makeScopeCache, Be as memoryIdempotencyStore, fe as missingAccessDecision, mt as mutationToRpc, yt as normalizeDescriptor, nt as normalizeSource, u as openAccessSpec, It as parseEventRoute, Ge as pathToId, Bt as pluginInstanceName, it as publishReactivity, Ve as publishServerError, pt as queryToRpc, ue as rawImpersonationMark, Qe as reactivityChannel, Me as requireScope, m as rowPatchOpSchema, h as rowPatchSchema, ee as scopeCacheKey, pe as setEffectiveScopes, je as setPolicyGuardResolver, se as setResourceScopeResolver, tt as sourceKeys, gt as streamToRpc, y as strictInput, le as subjectIdentity, n as subjectScopes, Le as subscribeServerErrors, v as subscriptionEvent, de as systemSubject, o as tenantScopedSubject, vt as toRpc, Wn as tsMs, rt as undeclaredChannelKeys, wn as undoApplyDescriptor, Cn as undoLogQueryDescriptor, Tn as undoRedoDescriptor, W as wireErrorUnion, fn as workflowCancelDescriptor, un as workflowDomainEventsQueryDescriptor, dn as workflowEventDeliveriesQueryDescriptor, pn as workflowResumeDescriptor, ln as workflowRunEventsQueryDescriptor, on as workflowRunQueryDescriptor, cn as workflowRunStepsQueryDescriptor, sn as workflowRunsQueryDescriptor, mn as workflowSignalDescriptor, hn as workflowUpdateDescriptor, Fe as wsMutationIdempotencyScope };
|