@voltro/protocol 0.24.0 → 0.26.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 +670 -0
- package/dist/index.d.ts +567 -5
- package/dist/index.js +351 -279
- package/dist/rest.d.ts +66 -0
- package/dist/session.d.ts +27 -0
- package/dist/session.js +6 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { C as e, D as t, E as n, O as r, S as i, T as a, _ as o, a as ee, b as te, c as ne, d as re, f as ie, g as ae, h as oe, i as se, l as ce, m as le, n as ue, o as de, p as
|
|
2
|
-
import { a as
|
|
3
|
-
import { Context as
|
|
4
|
-
import { Rpc as
|
|
1
|
+
import { C as e, D as t, E as n, O as r, S as i, T as a, _ as o, a as ee, b as te, c as ne, d as re, f as ie, g as ae, h as oe, i as se, l as ce, m as le, n as ue, o as de, p as s, r as fe, s as pe, t as me, u as he, v as ge, w as _e, x as ve, y as ye } from "./serverErrorBus-C3JTqgIc.js";
|
|
2
|
+
import { a as be, c as xe, d as Se, f as Ce, i as we, l as Te, n as Ee, o as De, p as Oe, r as ke, s as Ae, t as je, u as Me } from "./auth-BPdyOBsd.js";
|
|
3
|
+
import { Context as Ne, Layer as Pe, Schema as c } from "effect";
|
|
4
|
+
import { Rpc as l } 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 Fe = c.Union(c.String, c.Number), u = c.Record({
|
|
7
|
+
key: c.String,
|
|
8
|
+
value: c.Unknown
|
|
9
|
+
}).pipe(c.filter((e) => "id" in e, { message: () => "patch row must carry an id" })), d = c.Union(c.Struct({
|
|
10
|
+
op: c.Literal("add"),
|
|
11
|
+
path: c.String,
|
|
12
|
+
value: u
|
|
13
|
+
}), c.Struct({
|
|
14
|
+
op: c.Literal("replace"),
|
|
15
|
+
path: c.String,
|
|
16
|
+
value: u
|
|
17
|
+
}), c.Struct({
|
|
18
|
+
op: c.Literal("remove"),
|
|
19
|
+
path: c.String
|
|
20
|
+
})), f = c.Struct({
|
|
21
|
+
ops: c.Array(d),
|
|
22
|
+
order: c.Array(Fe)
|
|
23
|
+
}), p = (e) => `/${String(e).replace(/~/g, "~0").replace(/\//g, "~1")}`, Ie = (e) => (e.startsWith("/") ? e.slice(1) : e).replace(/~1/g, "/").replace(/~0/g, "~"), m = (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
|
+
}, Le = (e, t) => m(e) === m(t), Re = (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 Ie = s.Union(s.String, s.Number), l = s.Record({
|
|
|
33
33
|
let t = n.get(e.id);
|
|
34
34
|
t === void 0 ? r.push({
|
|
35
35
|
op: "add",
|
|
36
|
-
path:
|
|
36
|
+
path: p(e.id),
|
|
37
37
|
value: e
|
|
38
|
-
}) :
|
|
38
|
+
}) : Le(t, e) || r.push({
|
|
39
39
|
op: "replace",
|
|
40
|
-
path:
|
|
40
|
+
path: p(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: p(t.id)
|
|
47
47
|
});
|
|
48
48
|
return {
|
|
49
49
|
ops: r,
|
|
50
50
|
order: i
|
|
51
51
|
};
|
|
52
|
-
},
|
|
52
|
+
}, ze = (e) => e.every((e) => {
|
|
53
53
|
let t = e.id;
|
|
54
54
|
return typeof t == "string" || typeof t == "number";
|
|
55
|
-
}),
|
|
55
|
+
}), Be = (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,97 +62,102 @@ var Ie = s.Union(s.String, s.Number), l = s.Record({
|
|
|
62
62
|
t !== void 0 && r.push(t);
|
|
63
63
|
}
|
|
64
64
|
return r;
|
|
65
|
-
},
|
|
66
|
-
_tag:
|
|
67
|
-
revision:
|
|
65
|
+
}, h = (e) => c.Union(c.Struct({
|
|
66
|
+
_tag: c.Literal("snapshot"),
|
|
67
|
+
revision: c.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: c.optional(c.Boolean)
|
|
70
|
+
}), c.Struct({
|
|
71
|
+
_tag: c.Literal("delta"),
|
|
72
|
+
revision: c.Number,
|
|
73
|
+
emittedAt: c.Number,
|
|
74
|
+
patch: f
|
|
75
|
+
}), c.Struct({
|
|
76
|
+
_tag: c.Literal("error"),
|
|
77
|
+
error: c.Unknown,
|
|
78
|
+
revision: c.optional(c.Number)
|
|
79
|
+
})), Ve = (e) => e.internal !== !0, g = (e) => {
|
|
80
80
|
if (e.internal !== !0) return e;
|
|
81
81
|
let t = [e.publicApi === void 0 ? void 0 : "publicApi", e.exposeAsTool === void 0 ? void 0 : "exposeAsTool"].filter((e) => e !== void 0);
|
|
82
82
|
if (t.length === 0) return e;
|
|
83
83
|
throw Error(`${e.name}: \`internal: true\` cannot be combined with ${t.map((e) => `\`${e}\``).join(" or ")}. \`internal\` takes the procedure OFF the wire; those put it back ON a different one (${t.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 ${t.join(" / ")} annotation if it is not.`);
|
|
84
|
-
},
|
|
84
|
+
}, He = (e) => e.action !== void 0 && e.resourceType !== void 0, _ = (e) => g({
|
|
85
85
|
kind: "query",
|
|
86
86
|
name: e.name,
|
|
87
87
|
input: e.input,
|
|
88
88
|
output: e.output,
|
|
89
|
-
error: e.error ??
|
|
89
|
+
error: e.error ?? c.Never,
|
|
90
90
|
source: e.source,
|
|
91
91
|
cache: e.cache,
|
|
92
92
|
guards: e.guards,
|
|
93
93
|
publicApi: e.publicApi,
|
|
94
94
|
exposeAsTool: e.exposeAsTool,
|
|
95
|
-
internal: e.internal
|
|
96
|
-
|
|
95
|
+
internal: e.internal,
|
|
96
|
+
overridesPlugin: e.overridesPlugin
|
|
97
|
+
}), v = (e) => g({
|
|
97
98
|
kind: "mutation",
|
|
98
99
|
name: e.name,
|
|
99
100
|
input: e.input,
|
|
100
101
|
output: e.output,
|
|
101
|
-
error: e.error ??
|
|
102
|
+
error: e.error ?? c.Never,
|
|
102
103
|
target: e.target,
|
|
103
104
|
guards: e.guards,
|
|
104
105
|
publicApi: e.publicApi,
|
|
105
106
|
exposeAsTool: e.exposeAsTool,
|
|
106
|
-
internal: e.internal
|
|
107
|
-
|
|
107
|
+
internal: e.internal,
|
|
108
|
+
overridesPlugin: e.overridesPlugin
|
|
109
|
+
}), y = (e) => g({
|
|
108
110
|
kind: "action",
|
|
109
111
|
name: e.name,
|
|
110
112
|
input: e.input,
|
|
111
113
|
output: e.output,
|
|
112
|
-
error: e.error ??
|
|
114
|
+
error: e.error ?? c.Never,
|
|
113
115
|
guards: e.guards,
|
|
114
116
|
source: e.source,
|
|
115
117
|
target: e.target,
|
|
116
118
|
publicApi: e.publicApi,
|
|
117
119
|
exposeAsTool: e.exposeAsTool,
|
|
118
|
-
internal: e.internal
|
|
119
|
-
|
|
120
|
+
internal: e.internal,
|
|
121
|
+
overridesPlugin: e.overridesPlugin
|
|
122
|
+
}), Ue = (e) => g({
|
|
120
123
|
kind: "stream",
|
|
121
124
|
name: e.name,
|
|
122
125
|
input: e.input,
|
|
123
126
|
element: e.element,
|
|
124
|
-
error: e.error ??
|
|
125
|
-
internal: e.internal
|
|
126
|
-
|
|
127
|
+
error: e.error ?? c.Never,
|
|
128
|
+
internal: e.internal,
|
|
129
|
+
overridesPlugin: e.overridesPlugin,
|
|
130
|
+
guards: e.guards
|
|
131
|
+
}), b = (e, t) => t && t.length > 0 ? c.Union(e, ...t) : e, x = (e, t) => t && t.length > 0 ? c.Union(e, s) : e, S = (e, t) => l.make(e.name, {
|
|
127
132
|
payload: e.input,
|
|
128
|
-
success:
|
|
129
|
-
error:
|
|
133
|
+
success: h(e.output),
|
|
134
|
+
error: b(x(e.error, e.guards), t),
|
|
130
135
|
stream: !0
|
|
131
|
-
}),
|
|
136
|
+
}), We = (e, t) => l.make(e.name, {
|
|
132
137
|
payload: e.input,
|
|
133
138
|
success: e.output,
|
|
134
|
-
error:
|
|
135
|
-
}),
|
|
139
|
+
error: b(x(e.error, e.guards), t)
|
|
140
|
+
}), Ge = (e, t) => l.make(e.name, {
|
|
136
141
|
payload: e.input,
|
|
137
142
|
success: e.output,
|
|
138
|
-
error:
|
|
139
|
-
}),
|
|
143
|
+
error: b(x(e.error, e.guards), t)
|
|
144
|
+
}), Ke = (e, t) => l.make(e.name, {
|
|
140
145
|
payload: e.input,
|
|
141
146
|
success: e.element,
|
|
142
|
-
error:
|
|
147
|
+
error: b(e.error, t),
|
|
143
148
|
stream: !0
|
|
144
|
-
}),
|
|
149
|
+
}), qe = (e) => {
|
|
145
150
|
if (typeof e != "object" || !e) return;
|
|
146
151
|
let t = e._tag;
|
|
147
152
|
return typeof t == "string" ? t : void 0;
|
|
148
|
-
},
|
|
153
|
+
}, Je = (e) => {
|
|
149
154
|
switch (e.kind) {
|
|
150
|
-
case "query": return
|
|
151
|
-
case "mutation": return
|
|
152
|
-
case "action": return
|
|
153
|
-
case "stream": return
|
|
155
|
+
case "query": return S(e);
|
|
156
|
+
case "mutation": return We(e);
|
|
157
|
+
case "action": return Ge(e);
|
|
158
|
+
case "stream": return Ke(e);
|
|
154
159
|
}
|
|
155
|
-
},
|
|
160
|
+
}, Ye = (e) => {
|
|
156
161
|
let t = e.input, n = t === void 0 ? {} : { input: t }, r = e.output, i = r === void 0 ? {} : { output: r };
|
|
157
162
|
if (e.kind === "query") return {
|
|
158
163
|
kind: "query",
|
|
@@ -193,17 +198,84 @@ var Ie = s.Union(s.String, s.Number), l = s.Record({
|
|
|
193
198
|
..."shapeItem" in e && e.shapeItem !== void 0 ? { shapeItem: e.shapeItem } : {}
|
|
194
199
|
}))
|
|
195
200
|
};
|
|
196
|
-
},
|
|
201
|
+
}, Xe = 7500, Ze = (e) => typeof e == "object" && !!e && e.kind === "event", Qe = (e) => {
|
|
202
|
+
if (e.name.length === 0) throw Error("defineEvent: `name` must not be empty");
|
|
203
|
+
if (e.delivery === "latest" && e.webhook !== void 0) throw Error(`defineEvent(${e.name}): \`delivery: 'latest'\` cannot be combined with \`webhook\`.\n \`latest\` means a superseded delivery did not matter — but a webhook delivery is a
|
|
204
|
+
durable side effect at a third party, and one already sent cannot be superseded.
|
|
205
|
+
A high-rate event with an HTTP audience is also 60 deliveries per second per target;
|
|
206
|
+
the rate limit DEFERS the excess as pending rows, so it grows a table instead of failing.
|
|
207
|
+
Split them: publish the high-rate event for clients, and publish a separate, coarser
|
|
208
|
+
event (a summary, a state change) for the outside world.`);
|
|
209
|
+
return {
|
|
210
|
+
kind: "event",
|
|
211
|
+
name: e.name,
|
|
212
|
+
key: e.key,
|
|
213
|
+
payload: e.payload,
|
|
214
|
+
guards: e.guards,
|
|
215
|
+
rewind: e.rewind,
|
|
216
|
+
webhook: e.webhook,
|
|
217
|
+
delivery: e.delivery
|
|
218
|
+
};
|
|
219
|
+
}, C = (e) => c.Struct({
|
|
220
|
+
_tag: c.Literal("event"),
|
|
221
|
+
origin: c.String,
|
|
222
|
+
n: c.Number,
|
|
223
|
+
emittedAt: c.Number,
|
|
224
|
+
payload: e
|
|
225
|
+
}), w = c.Struct({
|
|
226
|
+
_tag: c.Literal("gap"),
|
|
227
|
+
missed: c.Number,
|
|
228
|
+
reason: c.Literal("buffer", "resume")
|
|
229
|
+
}), T = c.Struct({ _tag: c.Literal("attached") }), E = (e) => c.Union(T, C(e), w), D = c.Struct({
|
|
230
|
+
origin: c.String,
|
|
231
|
+
n: c.Number
|
|
232
|
+
}), O = (e) => c.Struct({
|
|
233
|
+
key: e,
|
|
234
|
+
resume: c.optional(c.Array(D))
|
|
235
|
+
}), $e = (e, t) => {
|
|
236
|
+
let n = e.guards && e.guards.length > 0 ? s : c.Never, r = t && t.length > 0 ? c.Union(n, ...t) : n;
|
|
237
|
+
return l.make(e.name, {
|
|
238
|
+
payload: O(e.key),
|
|
239
|
+
success: E(e.payload),
|
|
240
|
+
error: r,
|
|
241
|
+
stream: !0
|
|
242
|
+
});
|
|
243
|
+
}, et = class extends c.TaggedError()("EventPayloadInvalid", {
|
|
244
|
+
event: c.String,
|
|
245
|
+
message: c.String
|
|
246
|
+
}) {}, tt = class extends c.TaggedError()("EventKeyInvalid", {
|
|
247
|
+
event: c.String,
|
|
248
|
+
message: c.String
|
|
249
|
+
}) {}, nt = class extends c.TaggedError()("EventPayloadTooLarge", {
|
|
250
|
+
event: c.String,
|
|
251
|
+
bytes: c.Number,
|
|
252
|
+
limit: c.Number
|
|
253
|
+
}) {}, k = (e) => {
|
|
254
|
+
if (typeof e != "object" || !e) return JSON.stringify(e) ?? "null";
|
|
255
|
+
let t = Object.entries(e).filter(([, e]) => e !== void 0).sort(([e], [t]) => e < t ? -1 : +(e > t));
|
|
256
|
+
return JSON.stringify(t);
|
|
257
|
+
}, rt = "\0", it = (e, t, n) => [
|
|
258
|
+
e ?? "~",
|
|
259
|
+
t,
|
|
260
|
+
k(n)
|
|
261
|
+
].join("\0"), at = (e) => {
|
|
262
|
+
let [t = "~", n = "", r = ""] = e.split("\0");
|
|
263
|
+
return {
|
|
264
|
+
tenantId: t === "~" ? null : t,
|
|
265
|
+
event: n,
|
|
266
|
+
key: r
|
|
267
|
+
};
|
|
268
|
+
}, ot = (e) => e.split("\0").join(" · "), st = (e) => e, ct = (e) => e, lt = (e) => {
|
|
197
269
|
if (e.length !== 0) return (t, n) => e.reduceRight((e, t) => t(e, n), t);
|
|
198
|
-
},
|
|
199
|
-
let n =
|
|
270
|
+
}, ut = (e, t) => {
|
|
271
|
+
let n = Ne.GenericTag(e);
|
|
200
272
|
return {
|
|
201
273
|
Tag: n,
|
|
202
|
-
Live:
|
|
274
|
+
Live: Pe.succeed(n, t)
|
|
203
275
|
};
|
|
204
|
-
},
|
|
276
|
+
}, dt = (e, t, n) => {
|
|
205
277
|
if (!t) return { ok: !0 };
|
|
206
|
-
let r =
|
|
278
|
+
let r = A(n);
|
|
207
279
|
if (!r) return {
|
|
208
280
|
ok: !1,
|
|
209
281
|
reason: `cannot parse runningVersion "${n}"`
|
|
@@ -211,12 +283,12 @@ var Ie = s.Union(s.String, s.Number), l = s.Record({
|
|
|
211
283
|
let i = t.trim();
|
|
212
284
|
if (i === "*" || i === "") return { ok: !0 };
|
|
213
285
|
let a = i.split(/\s+/).filter((e) => e.length > 0);
|
|
214
|
-
for (let i of a) if (
|
|
286
|
+
for (let i of a) if (!ft(i, r)) return {
|
|
215
287
|
ok: !1,
|
|
216
288
|
reason: `plugin "${e}" requires framework ${t}, running ${n}`
|
|
217
289
|
};
|
|
218
290
|
return { ok: !0 };
|
|
219
|
-
},
|
|
291
|
+
}, A = (e) => {
|
|
220
292
|
let t = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9a-zA-Z.-]+))?$/.exec(e.trim());
|
|
221
293
|
return t ? {
|
|
222
294
|
major: Number(t[1]),
|
|
@@ -224,243 +296,243 @@ var Ie = s.Union(s.String, s.Number), l = s.Record({
|
|
|
224
296
|
patch: Number(t[3]),
|
|
225
297
|
pre: t[4] ?? ""
|
|
226
298
|
} : null;
|
|
227
|
-
},
|
|
299
|
+
}, j = (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, ft = (e, t) => {
|
|
228
300
|
if (e === "*") return !0;
|
|
229
301
|
if (e.startsWith("^")) {
|
|
230
|
-
let n =
|
|
231
|
-
return !n || t.major !== n.major ? !1 :
|
|
302
|
+
let n = A(e.slice(1));
|
|
303
|
+
return !n || t.major !== n.major ? !1 : j(t, n) >= 0;
|
|
232
304
|
}
|
|
233
305
|
if (e.startsWith("~")) {
|
|
234
|
-
let n =
|
|
235
|
-
return !n || t.major !== n.major || t.minor !== n.minor ? !1 :
|
|
306
|
+
let n = A(e.slice(1));
|
|
307
|
+
return !n || t.major !== n.major || t.minor !== n.minor ? !1 : j(t, n) >= 0;
|
|
236
308
|
}
|
|
237
309
|
let n = /^(>=|<=|>|<)(.+)$/.exec(e);
|
|
238
310
|
if (n) {
|
|
239
|
-
let e = n[1], r =
|
|
311
|
+
let e = n[1], r = A(n[2]);
|
|
240
312
|
if (!r) return !1;
|
|
241
|
-
let i =
|
|
313
|
+
let i = j(t, r);
|
|
242
314
|
if (e === ">=") return i >= 0;
|
|
243
315
|
if (e === "<=") return i <= 0;
|
|
244
316
|
if (e === ">") return i > 0;
|
|
245
317
|
if (e === "<") return i < 0;
|
|
246
318
|
}
|
|
247
|
-
let r =
|
|
248
|
-
return r ?
|
|
249
|
-
},
|
|
250
|
-
id:
|
|
251
|
-
workflowName:
|
|
252
|
-
executionId:
|
|
253
|
-
status:
|
|
254
|
-
}),
|
|
255
|
-
id:
|
|
256
|
-
tag:
|
|
257
|
-
executionId:
|
|
258
|
-
status:
|
|
259
|
-
payload:
|
|
260
|
-
workflowVersion:
|
|
261
|
-
workflowPatches:
|
|
262
|
-
output:
|
|
263
|
-
subject:
|
|
264
|
-
source:
|
|
265
|
-
errorTag:
|
|
266
|
-
errorMessage:
|
|
267
|
-
cancelled:
|
|
268
|
-
startedAt:
|
|
269
|
-
completedAt:
|
|
270
|
-
durationMs:
|
|
271
|
-
traceId:
|
|
272
|
-
parentExecutionId:
|
|
273
|
-
parentClosePolicy:
|
|
274
|
-
}),
|
|
275
|
-
tag:
|
|
276
|
-
status:
|
|
277
|
-
limit:
|
|
278
|
-
}),
|
|
279
|
-
id:
|
|
280
|
-
runId:
|
|
281
|
-
stepName:
|
|
282
|
-
attempt:
|
|
283
|
-
status:
|
|
284
|
-
input:
|
|
285
|
-
retryPolicy:
|
|
286
|
-
output:
|
|
287
|
-
errorTag:
|
|
288
|
-
errorMessage:
|
|
289
|
-
errorCause:
|
|
290
|
-
startedAt:
|
|
291
|
-
completedAt:
|
|
292
|
-
durationMs:
|
|
293
|
-
}),
|
|
294
|
-
id:
|
|
295
|
-
runId:
|
|
296
|
-
eventType:
|
|
297
|
-
payload:
|
|
298
|
-
occurredAt:
|
|
299
|
-
stepName:
|
|
300
|
-
attempt:
|
|
301
|
-
}),
|
|
302
|
-
id:
|
|
303
|
-
name:
|
|
304
|
-
payload:
|
|
305
|
-
source:
|
|
306
|
-
subject:
|
|
307
|
-
traceId:
|
|
308
|
-
occurredAt:
|
|
309
|
-
}),
|
|
310
|
-
id:
|
|
311
|
-
eventId:
|
|
312
|
-
eventName:
|
|
313
|
-
triggerId:
|
|
314
|
-
workflowName:
|
|
315
|
-
executionId:
|
|
316
|
-
status:
|
|
317
|
-
idempotencyKey:
|
|
318
|
-
skipped:
|
|
319
|
-
errorMessage:
|
|
320
|
-
createdAt:
|
|
321
|
-
completedAt:
|
|
322
|
-
}),
|
|
323
|
-
name:
|
|
324
|
-
limit:
|
|
325
|
-
}),
|
|
326
|
-
workflowName:
|
|
327
|
-
executionId:
|
|
328
|
-
}),
|
|
329
|
-
id:
|
|
330
|
-
signalName:
|
|
331
|
-
payload:
|
|
332
|
-
}),
|
|
333
|
-
id:
|
|
334
|
-
updateName:
|
|
335
|
-
payload:
|
|
336
|
-
timeoutMs:
|
|
337
|
-
}),
|
|
338
|
-
eventId:
|
|
339
|
-
updateId:
|
|
340
|
-
completedEventId:
|
|
341
|
-
result:
|
|
342
|
-
}),
|
|
319
|
+
let r = A(e);
|
|
320
|
+
return r ? j(t, r) === 0 : !1;
|
|
321
|
+
}, M = c.Literal("running", "succeeded", "failed", "cancelled", "suspended"), N = c.Literal("cancel", "terminate", "abandon"), pt = c.Struct({
|
|
322
|
+
id: c.String,
|
|
323
|
+
workflowName: c.String,
|
|
324
|
+
executionId: c.String,
|
|
325
|
+
status: c.Literal("running")
|
|
326
|
+
}), P = c.Struct({
|
|
327
|
+
id: c.String,
|
|
328
|
+
tag: c.String,
|
|
329
|
+
executionId: c.String,
|
|
330
|
+
status: M,
|
|
331
|
+
payload: c.Unknown,
|
|
332
|
+
workflowVersion: c.NullOr(c.String),
|
|
333
|
+
workflowPatches: c.NullOr(c.Unknown),
|
|
334
|
+
output: c.NullOr(c.Unknown),
|
|
335
|
+
subject: c.NullOr(c.Unknown),
|
|
336
|
+
source: c.NullOr(c.String),
|
|
337
|
+
errorTag: c.NullOr(c.String),
|
|
338
|
+
errorMessage: c.NullOr(c.String),
|
|
339
|
+
cancelled: c.Boolean,
|
|
340
|
+
startedAt: c.Date,
|
|
341
|
+
completedAt: c.NullOr(c.Date),
|
|
342
|
+
durationMs: c.NullOr(c.Number),
|
|
343
|
+
traceId: c.NullOr(c.String),
|
|
344
|
+
parentExecutionId: c.NullOr(c.String),
|
|
345
|
+
parentClosePolicy: c.NullOr(N)
|
|
346
|
+
}), F = c.Struct({
|
|
347
|
+
tag: c.optional(c.String),
|
|
348
|
+
status: c.optional(M),
|
|
349
|
+
limit: c.optional(c.Number)
|
|
350
|
+
}), I = c.Struct({
|
|
351
|
+
id: c.String,
|
|
352
|
+
runId: c.String,
|
|
353
|
+
stepName: c.String,
|
|
354
|
+
attempt: c.Number,
|
|
355
|
+
status: c.Literal("running", "succeeded", "failed"),
|
|
356
|
+
input: c.NullOr(c.Unknown),
|
|
357
|
+
retryPolicy: c.NullOr(c.Unknown),
|
|
358
|
+
output: c.NullOr(c.Unknown),
|
|
359
|
+
errorTag: c.NullOr(c.String),
|
|
360
|
+
errorMessage: c.NullOr(c.String),
|
|
361
|
+
errorCause: c.NullOr(c.Unknown),
|
|
362
|
+
startedAt: c.Date,
|
|
363
|
+
completedAt: c.NullOr(c.Date),
|
|
364
|
+
durationMs: c.NullOr(c.Number)
|
|
365
|
+
}), L = c.Struct({
|
|
366
|
+
id: c.String,
|
|
367
|
+
runId: c.String,
|
|
368
|
+
eventType: c.String,
|
|
369
|
+
payload: c.NullOr(c.Unknown),
|
|
370
|
+
occurredAt: c.Date,
|
|
371
|
+
stepName: c.NullOr(c.String),
|
|
372
|
+
attempt: c.NullOr(c.Number)
|
|
373
|
+
}), R = c.Struct({
|
|
374
|
+
id: c.String,
|
|
375
|
+
name: c.String,
|
|
376
|
+
payload: c.Unknown,
|
|
377
|
+
source: c.String,
|
|
378
|
+
subject: c.NullOr(c.Unknown),
|
|
379
|
+
traceId: c.NullOr(c.String),
|
|
380
|
+
occurredAt: c.Date
|
|
381
|
+
}), z = c.Struct({
|
|
382
|
+
id: c.String,
|
|
383
|
+
eventId: c.String,
|
|
384
|
+
eventName: c.String,
|
|
385
|
+
triggerId: c.String,
|
|
386
|
+
workflowName: c.String,
|
|
387
|
+
executionId: c.NullOr(c.String),
|
|
388
|
+
status: c.Literal("starting", "started", "skipped", "failed"),
|
|
389
|
+
idempotencyKey: c.String,
|
|
390
|
+
skipped: c.Boolean,
|
|
391
|
+
errorMessage: c.NullOr(c.String),
|
|
392
|
+
createdAt: c.Date,
|
|
393
|
+
completedAt: c.NullOr(c.Date)
|
|
394
|
+
}), B = c.Struct({ id: c.String }), V = c.Struct({ runId: c.String }), mt = c.Struct({
|
|
395
|
+
name: c.optional(c.String),
|
|
396
|
+
limit: c.optional(c.Number)
|
|
397
|
+
}), H = c.Struct({ eventId: c.String }), U = c.Struct({
|
|
398
|
+
workflowName: c.String,
|
|
399
|
+
executionId: c.String
|
|
400
|
+
}), W = c.Struct({
|
|
401
|
+
id: c.String,
|
|
402
|
+
signalName: c.String,
|
|
403
|
+
payload: c.optional(c.Unknown)
|
|
404
|
+
}), G = c.Struct({
|
|
405
|
+
id: c.String,
|
|
406
|
+
updateName: c.String,
|
|
407
|
+
payload: c.optional(c.Unknown),
|
|
408
|
+
timeoutMs: c.optional(c.Number)
|
|
409
|
+
}), K = c.Struct({
|
|
410
|
+
eventId: c.String,
|
|
411
|
+
updateId: c.String,
|
|
412
|
+
completedEventId: c.String,
|
|
413
|
+
result: c.Unknown
|
|
414
|
+
}), ht = _({
|
|
343
415
|
name: "__voltro.workflow.run",
|
|
344
416
|
source: "_voltro_workflow_runs",
|
|
345
|
-
input:
|
|
346
|
-
output:
|
|
347
|
-
}),
|
|
417
|
+
input: B,
|
|
418
|
+
output: c.Array(P)
|
|
419
|
+
}), gt = _({
|
|
348
420
|
name: "__voltro.workflow.runs",
|
|
349
421
|
source: "_voltro_workflow_runs",
|
|
350
|
-
input:
|
|
351
|
-
output:
|
|
352
|
-
}),
|
|
422
|
+
input: F,
|
|
423
|
+
output: c.Array(P)
|
|
424
|
+
}), _t = _({
|
|
353
425
|
name: "__voltro.workflow.run.steps",
|
|
354
426
|
source: "_voltro_workflow_run_steps",
|
|
355
|
-
input:
|
|
356
|
-
output:
|
|
357
|
-
}),
|
|
427
|
+
input: V,
|
|
428
|
+
output: c.Array(I)
|
|
429
|
+
}), vt = _({
|
|
358
430
|
name: "__voltro.workflow.run.events",
|
|
359
431
|
source: "_voltro_workflow_run_events",
|
|
360
|
-
input:
|
|
361
|
-
output:
|
|
362
|
-
}),
|
|
432
|
+
input: V,
|
|
433
|
+
output: c.Array(L)
|
|
434
|
+
}), yt = _({
|
|
363
435
|
name: "__voltro.workflow.domainEvents",
|
|
364
436
|
source: "_voltro_workflow_events",
|
|
365
|
-
input:
|
|
366
|
-
output:
|
|
367
|
-
}),
|
|
437
|
+
input: mt,
|
|
438
|
+
output: c.Array(R)
|
|
439
|
+
}), bt = _({
|
|
368
440
|
name: "__voltro.workflow.event.deliveries",
|
|
369
441
|
source: "_voltro_workflow_event_deliveries",
|
|
370
|
-
input:
|
|
371
|
-
output:
|
|
372
|
-
}),
|
|
442
|
+
input: H,
|
|
443
|
+
output: c.Array(z)
|
|
444
|
+
}), xt = y({
|
|
373
445
|
name: "__voltro.workflow.cancel",
|
|
374
|
-
input:
|
|
375
|
-
output:
|
|
376
|
-
}),
|
|
446
|
+
input: U,
|
|
447
|
+
output: c.Struct({ ok: c.Boolean })
|
|
448
|
+
}), St = y({
|
|
377
449
|
name: "__voltro.workflow.resume",
|
|
378
|
-
input:
|
|
379
|
-
output:
|
|
380
|
-
}),
|
|
450
|
+
input: U,
|
|
451
|
+
output: c.Struct({ ok: c.Boolean })
|
|
452
|
+
}), Ct = y({
|
|
381
453
|
name: "__voltro.workflow.signal",
|
|
382
|
-
input:
|
|
383
|
-
output:
|
|
384
|
-
}),
|
|
454
|
+
input: W,
|
|
455
|
+
output: c.Struct({ eventId: c.String })
|
|
456
|
+
}), wt = y({
|
|
385
457
|
name: "__voltro.workflow.update",
|
|
386
|
-
input:
|
|
387
|
-
output:
|
|
388
|
-
}),
|
|
389
|
-
id:
|
|
390
|
-
tag:
|
|
391
|
-
label:
|
|
392
|
-
undone:
|
|
393
|
-
crossesAction:
|
|
394
|
-
createdAt:
|
|
395
|
-
}),
|
|
396
|
-
invocationId:
|
|
397
|
-
reason:
|
|
398
|
-
}) {},
|
|
399
|
-
name:
|
|
458
|
+
input: G,
|
|
459
|
+
output: K
|
|
460
|
+
}), q = "__voltro.undo.log", J = "__voltro.undo.apply", Y = "__voltro.undo.redo", X = c.Struct({
|
|
461
|
+
id: c.String,
|
|
462
|
+
tag: c.String,
|
|
463
|
+
label: c.NullOr(c.String),
|
|
464
|
+
undone: c.Boolean,
|
|
465
|
+
crossesAction: c.Boolean,
|
|
466
|
+
createdAt: c.String
|
|
467
|
+
}), Tt = class extends c.TaggedError()("UndoNotFound", { invocationId: c.String }) {}, Et = class extends c.TaggedError()("UndoForbidden", { invocationId: c.String }) {}, Dt = class extends c.TaggedError()("UndoConflict", {
|
|
468
|
+
invocationId: c.String,
|
|
469
|
+
reason: c.Literal("conflict", "action")
|
|
470
|
+
}) {}, Ot = c.Union(Tt, Et, Dt), kt = _({
|
|
471
|
+
name: q,
|
|
400
472
|
source: "_voltro_undo_log",
|
|
401
|
-
input:
|
|
402
|
-
output:
|
|
403
|
-
}),
|
|
404
|
-
name:
|
|
405
|
-
input:
|
|
406
|
-
output:
|
|
407
|
-
error:
|
|
408
|
-
}),
|
|
409
|
-
name:
|
|
410
|
-
input:
|
|
411
|
-
output:
|
|
412
|
-
error:
|
|
413
|
-
}),
|
|
414
|
-
connectionId:
|
|
415
|
-
kind:
|
|
416
|
-
label:
|
|
417
|
-
status:
|
|
418
|
-
accountId:
|
|
419
|
-
accountLabel:
|
|
420
|
-
scopes:
|
|
421
|
-
expiresAt:
|
|
422
|
-
lastError:
|
|
423
|
-
connectedAt:
|
|
424
|
-
}),
|
|
425
|
-
connectionId:
|
|
426
|
-
expected:
|
|
427
|
-
actual:
|
|
428
|
-
}) {},
|
|
429
|
-
connectionId:
|
|
430
|
-
reason:
|
|
431
|
-
transient:
|
|
432
|
-
}) {}, $ =
|
|
433
|
-
name:
|
|
473
|
+
input: c.Struct({ limit: c.optional(c.Number) }),
|
|
474
|
+
output: c.Array(X)
|
|
475
|
+
}), At = v({
|
|
476
|
+
name: J,
|
|
477
|
+
input: c.Struct({ invocationId: c.String }),
|
|
478
|
+
output: c.Struct({ ok: c.Boolean }),
|
|
479
|
+
error: Ot
|
|
480
|
+
}), jt = v({
|
|
481
|
+
name: Y,
|
|
482
|
+
input: c.Struct({ invocationId: c.String }),
|
|
483
|
+
output: c.Struct({ ok: c.Boolean }),
|
|
484
|
+
error: Ot
|
|
485
|
+
}), Mt = "__voltro.connections.list", Z = "__voltro.connections.start", Nt = "__voltro.connections.submitToken", Pt = "__voltro.connections.disconnect", Q = c.Literal("oauth2", "pat"), Ft = c.Literal("disconnected", "connected", "expired", "revoked", "error"), It = c.Struct({
|
|
486
|
+
connectionId: c.String,
|
|
487
|
+
kind: Q,
|
|
488
|
+
label: c.String,
|
|
489
|
+
status: Ft,
|
|
490
|
+
accountId: c.NullOr(c.String),
|
|
491
|
+
accountLabel: c.NullOr(c.String),
|
|
492
|
+
scopes: c.Array(c.String),
|
|
493
|
+
expiresAt: c.NullOr(c.String),
|
|
494
|
+
lastError: c.NullOr(c.String),
|
|
495
|
+
connectedAt: c.NullOr(c.String)
|
|
496
|
+
}), Lt = class extends c.TaggedError()("ConnectionNotDeclared", { connectionId: c.String }) {}, Rt = class extends c.TaggedError()("ConnectionSubjectRequired", { connectionId: c.String }) {}, zt = class extends c.TaggedError()("ConnectionKindMismatch", {
|
|
497
|
+
connectionId: c.String,
|
|
498
|
+
expected: Q,
|
|
499
|
+
actual: Q
|
|
500
|
+
}) {}, Bt = class extends c.TaggedError()("ConnectionHandshakeFailed", {
|
|
501
|
+
connectionId: c.String,
|
|
502
|
+
reason: c.String,
|
|
503
|
+
transient: c.Boolean
|
|
504
|
+
}) {}, $ = c.Union(Lt, Rt, zt, Bt), Vt = _({
|
|
505
|
+
name: Mt,
|
|
434
506
|
source: "_voltro_connections",
|
|
435
|
-
input:
|
|
436
|
-
output:
|
|
437
|
-
}),
|
|
438
|
-
name:
|
|
439
|
-
input:
|
|
440
|
-
connectionId:
|
|
441
|
-
redirectTo:
|
|
507
|
+
input: c.Struct({}),
|
|
508
|
+
output: c.Array(It)
|
|
509
|
+
}), Ht = y({
|
|
510
|
+
name: Z,
|
|
511
|
+
input: c.Struct({
|
|
512
|
+
connectionId: c.String,
|
|
513
|
+
redirectTo: c.optional(c.String)
|
|
442
514
|
}),
|
|
443
|
-
output:
|
|
444
|
-
authorizeUrl:
|
|
445
|
-
state:
|
|
515
|
+
output: c.Struct({
|
|
516
|
+
authorizeUrl: c.String,
|
|
517
|
+
state: c.String
|
|
446
518
|
}),
|
|
447
519
|
error: $
|
|
448
|
-
}),
|
|
449
|
-
name:
|
|
450
|
-
input:
|
|
451
|
-
connectionId:
|
|
452
|
-
token:
|
|
520
|
+
}), Ut = v({
|
|
521
|
+
name: Nt,
|
|
522
|
+
input: c.Struct({
|
|
523
|
+
connectionId: c.String,
|
|
524
|
+
token: c.String
|
|
453
525
|
}),
|
|
454
|
-
output:
|
|
526
|
+
output: c.Struct({ ok: c.Boolean }),
|
|
455
527
|
error: $
|
|
456
|
-
}),
|
|
457
|
-
name:
|
|
458
|
-
input:
|
|
459
|
-
output:
|
|
528
|
+
}), Wt = v({
|
|
529
|
+
name: Pt,
|
|
530
|
+
input: c.Struct({ connectionId: c.String }),
|
|
531
|
+
output: c.Struct({ ok: c.Boolean }),
|
|
460
532
|
error: $
|
|
461
|
-
}),
|
|
533
|
+
}), Gt = (e) => {
|
|
462
534
|
let t = e instanceof Date ? e.getTime() : typeof e == "number" ? e : typeof e == "string" ? new Date(e).getTime() : 0;
|
|
463
535
|
return Number.isNaN(t) ? 0 : t;
|
|
464
|
-
},
|
|
536
|
+
}, Kt = 1;
|
|
465
537
|
//#endregion
|
|
466
|
-
export { ce as ADMIN_SCOPE,
|
|
538
|
+
export { ce as ADMIN_SCOPE, he as APIKEY_ISSUE_ORG_SCOPE, re as APIKEY_ISSUE_OTHER_SCOPE, ie as APIKEY_ISSUE_SELF_SCOPE, je as AuthMiddleware, Mt as CONNECTIONS_LIST_TAG, Pt as CONNECTION_DISCONNECT_TAG, Z as CONNECTION_START_TAG, Nt as CONNECTION_SUBMIT_TOKEN_TAG, Bt as ConnectionHandshakeFailed, Ee as ConnectionInfo, ke as ConnectionInfoMiddleware, Q as ConnectionKind, zt as ConnectionKindMismatch, Lt as ConnectionNotDeclared, It as ConnectionState, Ft as ConnectionStatus, Rt as ConnectionSubjectRequired, rt as EVENT_ROUTE_SEP, tt as EventKeyInvalid, et as EventPayloadInvalid, nt as EventPayloadTooLarge, Xe as MAX_EVENT_ENVELOPE_BYTES, Kt as PROTOCOL_VERSION, s as ScopeError, we as Subject, be as SubjectService, J as UNDO_APPLY_TAG, q as UNDO_LOG_TAG, Y as UNDO_REDO_TAG, De as Unauthenticated, Dt as UndoConflict, Et as UndoForbidden, X as UndoLogEntry, Tt as UndoNotFound, U as WorkflowControlInputSchema, R as WorkflowDomainEventRowSchema, mt as WorkflowDomainEventsInputSchema, H as WorkflowEventDeliveriesInputSchema, z as WorkflowEventDeliveryRowSchema, N as WorkflowParentClosePolicySchema, L as WorkflowRunEventRowSchema, pt as WorkflowRunHandleSchema, B as WorkflowRunRefSchema, P as WorkflowRunRowSchema, M as WorkflowRunStatusSchema, I as WorkflowRunStepRowSchema, V as WorkflowRunTableRefSchema, F as WorkflowRunsInputSchema, W as WorkflowSignalInputSchema, G as WorkflowUpdateInputSchema, K as WorkflowUpdateResultSchema, Ge as actionToRpc, le as advisoryResourceGuardWarning, Ae as anonymousSubject, Be as applyRowPatch, xe as assertAuthenticated, fe as beginIdempotent, dt as checkFrameworkCompat, oe as checkGuards, ae as checkGuardsEffect, Te as composeAuthStrategies, lt as composeRpcInterceptors, Wt as connectionDisconnectDescriptor, Ht as connectionStartDescriptor, Ut as connectionSubmitTokenDescriptor, Vt as connectionsListQueryDescriptor, y as defineAction, Qe as defineEvent, v as defineMutation, st as definePlugin, ct as definePluginRoute, ut as definePluginService, _ as defineQuery, Ue as defineStream, Re as diffRows, o as effectiveScopes, k as encodeEventKey, qe as errorTag, T as eventAttached, C as eventEnvelope, w as eventGap, D as eventResumePoint, it as eventRoute, E as eventStreamEvent, O as eventSubscribeInput, $e as eventToRpc, se as failIdempotent, ge as findAdvisoryResourceGuards, ee as finishIdempotent, ot as formatEventRoute, ye as getPolicyGuardResolver, te as getResourceScopeResolver, Me as hasCallbackRoutes, ve as hasEffectiveScope, i as hasScope, p as idToPath, de as idempotencyScope, Ze as isEventDescriptor, ze as isIdKeyed, e as isPolicyCheck, He as isPolicyGuard, Se as isSystemSubject, Ve as isWireReachable, pe as memoryIdempotencyStore, We as mutationToRpc, Ye as normalizeDescriptor, at as parseEventRoute, Ie as pathToId, me as publishServerError, S as queryToRpc, _e as requireScope, d as rowPatchOpSchema, f as rowPatchSchema, a as setEffectiveScopes, n as setPolicyGuardResolver, t as setResourceScopeResolver, Ke as streamToRpc, r as subjectScopes, ue as subscribeServerErrors, h as subscriptionEvent, Ce as systemSubject, Oe as tenantScopedSubject, Je as toRpc, Gt as tsMs, At as undoApplyDescriptor, kt as undoLogQueryDescriptor, jt as undoRedoDescriptor, xt as workflowCancelDescriptor, yt as workflowDomainEventsQueryDescriptor, bt as workflowEventDeliveriesQueryDescriptor, St as workflowResumeDescriptor, vt as workflowRunEventsQueryDescriptor, ht as workflowRunQueryDescriptor, _t as workflowRunStepsQueryDescriptor, gt as workflowRunsQueryDescriptor, Ct as workflowSignalDescriptor, wt as workflowUpdateDescriptor, ne as wsMutationIdempotencyScope };
|