@voltro/protocol 0.5.0 → 0.6.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 +48 -1
- package/dist/apikey.d.ts +6 -0
- package/dist/apikey.js +4 -1
- package/dist/index.d.ts +202 -0
- package/dist/index.js +278 -230
- package/dist/rest.js +1 -1
- package/dist/{serverErrorBus-XDdIJk0c.js → serverErrorBus-B3hDwGoL.js} +0 -0
- package/dist/session.d.ts +22 -11
- package/dist/session.js +40 -35
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import { Context as
|
|
4
|
-
import { Rpc as
|
|
1
|
+
import { C as e, S as t, _ as n, a as r, b as i, c as a, d as o, f as ee, g as te, h as ne, i as re, l as s, m as ie, n as ae, o as oe, p as se, r as ce, s as le, t as ue, u as de, v as fe, w as pe, x as me, y as he } from "./serverErrorBus-B3hDwGoL.js";
|
|
2
|
+
import { a as ge, c as _e, d as ve, f as ye, i as be, l as xe, n as Se, o as Ce, r as we, s as Te, t as Ee, u as De } from "./auth-DCE6m7Bo.js";
|
|
3
|
+
import { Context as Oe, Layer as ke, 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 Ae = 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(Ae)
|
|
23
|
+
}), p = (e) => `/${String(e).replace(/~/g, "~0").replace(/\//g, "~1")}`, je = (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
|
+
}, Me = (e, t) => m(e) === m(t), Ne = (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 De = l.Union(l.String, l.Number), d = l.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
|
+
}) : Me(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
|
+
}, Pe = (e) => e.every((e) => {
|
|
53
53
|
let t = e.id;
|
|
54
54
|
return typeof t == "string" || typeof t == "number";
|
|
55
|
-
}),
|
|
55
|
+
}), Fe = (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,82 +62,82 @@ var De = l.Union(l.String, l.Number), d = l.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
|
+
})), Ie = (e) => e.action !== void 0 && e.resourceType !== void 0, g = (e) => ({
|
|
80
80
|
kind: "query",
|
|
81
81
|
name: e.name,
|
|
82
82
|
input: e.input,
|
|
83
83
|
output: e.output,
|
|
84
|
-
error: e.error ??
|
|
84
|
+
error: e.error ?? c.Never,
|
|
85
85
|
source: e.source,
|
|
86
86
|
cache: e.cache,
|
|
87
87
|
guards: e.guards,
|
|
88
88
|
publicApi: e.publicApi,
|
|
89
89
|
exposeAsTool: e.exposeAsTool
|
|
90
|
-
}),
|
|
90
|
+
}), _ = (e) => ({
|
|
91
91
|
kind: "mutation",
|
|
92
92
|
name: e.name,
|
|
93
93
|
input: e.input,
|
|
94
94
|
output: e.output,
|
|
95
|
-
error: e.error ??
|
|
95
|
+
error: e.error ?? c.Never,
|
|
96
96
|
target: e.target,
|
|
97
97
|
guards: e.guards,
|
|
98
98
|
publicApi: e.publicApi,
|
|
99
99
|
exposeAsTool: e.exposeAsTool
|
|
100
|
-
}),
|
|
100
|
+
}), v = (e) => ({
|
|
101
101
|
kind: "action",
|
|
102
102
|
name: e.name,
|
|
103
103
|
input: e.input,
|
|
104
104
|
output: e.output,
|
|
105
|
-
error: e.error ??
|
|
105
|
+
error: e.error ?? c.Never,
|
|
106
106
|
guards: e.guards,
|
|
107
107
|
publicApi: e.publicApi,
|
|
108
108
|
exposeAsTool: e.exposeAsTool
|
|
109
|
-
}),
|
|
109
|
+
}), Le = (e) => ({
|
|
110
110
|
kind: "stream",
|
|
111
111
|
name: e.name,
|
|
112
112
|
input: e.input,
|
|
113
113
|
element: e.element,
|
|
114
|
-
error: e.error ??
|
|
115
|
-
}),
|
|
114
|
+
error: e.error ?? c.Never
|
|
115
|
+
}), y = (e, t) => t && t.length > 0 ? c.Union(e, ...t) : e, b = (e, t) => t && t.length > 0 ? c.Union(e, s) : e, x = (e, t) => l.make(e.name, {
|
|
116
116
|
payload: e.input,
|
|
117
|
-
success:
|
|
118
|
-
error:
|
|
117
|
+
success: h(e.output),
|
|
118
|
+
error: y(b(e.error, e.guards), t),
|
|
119
119
|
stream: !0
|
|
120
|
-
}),
|
|
120
|
+
}), Re = (e, t) => l.make(e.name, {
|
|
121
121
|
payload: e.input,
|
|
122
122
|
success: e.output,
|
|
123
|
-
error:
|
|
124
|
-
}),
|
|
123
|
+
error: y(b(e.error, e.guards), t)
|
|
124
|
+
}), ze = (e, t) => l.make(e.name, {
|
|
125
125
|
payload: e.input,
|
|
126
126
|
success: e.output,
|
|
127
|
-
error:
|
|
128
|
-
}),
|
|
127
|
+
error: y(b(e.error, e.guards), t)
|
|
128
|
+
}), S = (e, t) => l.make(e.name, {
|
|
129
129
|
payload: e.input,
|
|
130
130
|
success: e.element,
|
|
131
|
-
error:
|
|
131
|
+
error: y(e.error, t),
|
|
132
132
|
stream: !0
|
|
133
|
-
}),
|
|
133
|
+
}), Be = (e) => {
|
|
134
134
|
switch (e.kind) {
|
|
135
|
-
case "query": return
|
|
136
|
-
case "mutation": return
|
|
137
|
-
case "action": return
|
|
138
|
-
case "stream": return
|
|
135
|
+
case "query": return x(e);
|
|
136
|
+
case "mutation": return Re(e);
|
|
137
|
+
case "action": return ze(e);
|
|
138
|
+
case "stream": return S(e);
|
|
139
139
|
}
|
|
140
|
-
},
|
|
140
|
+
}, Ve = (e) => {
|
|
141
141
|
let t = e.input, n = t === void 0 ? {} : { input: t }, r = e.output, i = r === void 0 ? {} : { output: r };
|
|
142
142
|
if (e.kind === "query") return {
|
|
143
143
|
kind: "query",
|
|
@@ -178,17 +178,17 @@ var De = l.Union(l.String, l.Number), d = l.Record({
|
|
|
178
178
|
..."shapeItem" in e && e.shapeItem !== void 0 ? { shapeItem: e.shapeItem } : {}
|
|
179
179
|
}))
|
|
180
180
|
};
|
|
181
|
-
},
|
|
181
|
+
}, He = (e) => e, Ue = (e) => e, We = (e) => {
|
|
182
182
|
if (e.length !== 0) return (t, n) => e.reduceRight((e, t) => t(e, n), t);
|
|
183
|
-
},
|
|
184
|
-
let n =
|
|
183
|
+
}, Ge = (e, t) => {
|
|
184
|
+
let n = Oe.GenericTag(e);
|
|
185
185
|
return {
|
|
186
186
|
Tag: n,
|
|
187
|
-
Live:
|
|
187
|
+
Live: ke.succeed(n, t)
|
|
188
188
|
};
|
|
189
|
-
},
|
|
189
|
+
}, Ke = (e, t, n) => {
|
|
190
190
|
if (!t) return { ok: !0 };
|
|
191
|
-
let r =
|
|
191
|
+
let r = C(n);
|
|
192
192
|
if (!r) return {
|
|
193
193
|
ok: !1,
|
|
194
194
|
reason: `cannot parse runningVersion "${n}"`
|
|
@@ -196,12 +196,12 @@ var De = l.Union(l.String, l.Number), d = l.Record({
|
|
|
196
196
|
let i = t.trim();
|
|
197
197
|
if (i === "*" || i === "") return { ok: !0 };
|
|
198
198
|
let a = i.split(/\s+/).filter((e) => e.length > 0);
|
|
199
|
-
for (let i of a) if (!
|
|
199
|
+
for (let i of a) if (!qe(i, r)) return {
|
|
200
200
|
ok: !1,
|
|
201
201
|
reason: `plugin "${e}" requires framework ${t}, running ${n}`
|
|
202
202
|
};
|
|
203
203
|
return { ok: !0 };
|
|
204
|
-
},
|
|
204
|
+
}, C = (e) => {
|
|
205
205
|
let t = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9a-zA-Z.-]+))?$/.exec(e.trim());
|
|
206
206
|
return t ? {
|
|
207
207
|
major: Number(t[1]),
|
|
@@ -209,195 +209,243 @@ var De = l.Union(l.String, l.Number), d = l.Record({
|
|
|
209
209
|
patch: Number(t[3]),
|
|
210
210
|
pre: t[4] ?? ""
|
|
211
211
|
} : null;
|
|
212
|
-
},
|
|
212
|
+
}, w = (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, qe = (e, t) => {
|
|
213
213
|
if (e === "*") return !0;
|
|
214
214
|
if (e.startsWith("^")) {
|
|
215
|
-
let n =
|
|
216
|
-
return !n || t.major !== n.major ? !1 :
|
|
215
|
+
let n = C(e.slice(1));
|
|
216
|
+
return !n || t.major !== n.major ? !1 : w(t, n) >= 0;
|
|
217
217
|
}
|
|
218
218
|
if (e.startsWith("~")) {
|
|
219
|
-
let n =
|
|
220
|
-
return !n || t.major !== n.major || t.minor !== n.minor ? !1 :
|
|
219
|
+
let n = C(e.slice(1));
|
|
220
|
+
return !n || t.major !== n.major || t.minor !== n.minor ? !1 : w(t, n) >= 0;
|
|
221
221
|
}
|
|
222
222
|
let n = /^(>=|<=|>|<)(.+)$/.exec(e);
|
|
223
223
|
if (n) {
|
|
224
|
-
let e = n[1], r =
|
|
224
|
+
let e = n[1], r = C(n[2]);
|
|
225
225
|
if (!r) return !1;
|
|
226
|
-
let i =
|
|
226
|
+
let i = w(t, r);
|
|
227
227
|
if (e === ">=") return i >= 0;
|
|
228
228
|
if (e === "<=") return i <= 0;
|
|
229
229
|
if (e === ">") return i > 0;
|
|
230
230
|
if (e === "<") return i < 0;
|
|
231
231
|
}
|
|
232
|
-
let r =
|
|
233
|
-
return r ?
|
|
234
|
-
},
|
|
235
|
-
id:
|
|
236
|
-
workflowName:
|
|
237
|
-
executionId:
|
|
238
|
-
status:
|
|
239
|
-
}),
|
|
240
|
-
id:
|
|
241
|
-
tag:
|
|
242
|
-
executionId:
|
|
243
|
-
status:
|
|
244
|
-
payload:
|
|
245
|
-
workflowVersion:
|
|
246
|
-
workflowPatches:
|
|
247
|
-
output:
|
|
248
|
-
subject:
|
|
249
|
-
source:
|
|
250
|
-
errorTag:
|
|
251
|
-
errorMessage:
|
|
252
|
-
cancelled:
|
|
253
|
-
startedAt:
|
|
254
|
-
completedAt:
|
|
255
|
-
durationMs:
|
|
256
|
-
traceId:
|
|
257
|
-
parentExecutionId:
|
|
258
|
-
parentClosePolicy:
|
|
259
|
-
}),
|
|
260
|
-
tag:
|
|
261
|
-
status:
|
|
262
|
-
limit:
|
|
263
|
-
}),
|
|
264
|
-
id:
|
|
265
|
-
runId:
|
|
266
|
-
stepName:
|
|
267
|
-
attempt:
|
|
268
|
-
status:
|
|
269
|
-
input:
|
|
270
|
-
retryPolicy:
|
|
271
|
-
output:
|
|
272
|
-
errorTag:
|
|
273
|
-
errorMessage:
|
|
274
|
-
errorCause:
|
|
275
|
-
startedAt:
|
|
276
|
-
completedAt:
|
|
277
|
-
durationMs:
|
|
278
|
-
}),
|
|
279
|
-
id:
|
|
280
|
-
runId:
|
|
281
|
-
eventType:
|
|
282
|
-
payload:
|
|
283
|
-
occurredAt:
|
|
284
|
-
stepName:
|
|
285
|
-
attempt:
|
|
286
|
-
}),
|
|
287
|
-
id:
|
|
288
|
-
name:
|
|
289
|
-
payload:
|
|
290
|
-
source:
|
|
291
|
-
subject:
|
|
292
|
-
traceId:
|
|
293
|
-
occurredAt:
|
|
294
|
-
}),
|
|
295
|
-
id:
|
|
296
|
-
eventId:
|
|
297
|
-
eventName:
|
|
298
|
-
triggerId:
|
|
299
|
-
workflowName:
|
|
300
|
-
executionId:
|
|
301
|
-
status:
|
|
302
|
-
idempotencyKey:
|
|
303
|
-
skipped:
|
|
304
|
-
errorMessage:
|
|
305
|
-
createdAt:
|
|
306
|
-
completedAt:
|
|
307
|
-
}),
|
|
308
|
-
name:
|
|
309
|
-
limit:
|
|
310
|
-
}),
|
|
311
|
-
workflowName:
|
|
312
|
-
executionId:
|
|
313
|
-
}),
|
|
314
|
-
id:
|
|
315
|
-
signalName:
|
|
316
|
-
payload:
|
|
317
|
-
}),
|
|
318
|
-
id:
|
|
319
|
-
updateName:
|
|
320
|
-
payload:
|
|
321
|
-
timeoutMs:
|
|
322
|
-
}),
|
|
323
|
-
eventId:
|
|
324
|
-
updateId:
|
|
325
|
-
completedEventId:
|
|
326
|
-
result:
|
|
327
|
-
}),
|
|
232
|
+
let r = C(e);
|
|
233
|
+
return r ? w(t, r) === 0 : !1;
|
|
234
|
+
}, T = c.Literal("running", "succeeded", "failed", "cancelled", "suspended"), E = c.Literal("cancel", "terminate", "abandon"), Je = c.Struct({
|
|
235
|
+
id: c.String,
|
|
236
|
+
workflowName: c.String,
|
|
237
|
+
executionId: c.String,
|
|
238
|
+
status: c.Literal("running")
|
|
239
|
+
}), D = c.Struct({
|
|
240
|
+
id: c.String,
|
|
241
|
+
tag: c.String,
|
|
242
|
+
executionId: c.String,
|
|
243
|
+
status: T,
|
|
244
|
+
payload: c.Unknown,
|
|
245
|
+
workflowVersion: c.NullOr(c.String),
|
|
246
|
+
workflowPatches: c.NullOr(c.Unknown),
|
|
247
|
+
output: c.NullOr(c.Unknown),
|
|
248
|
+
subject: c.NullOr(c.Unknown),
|
|
249
|
+
source: c.NullOr(c.String),
|
|
250
|
+
errorTag: c.NullOr(c.String),
|
|
251
|
+
errorMessage: c.NullOr(c.String),
|
|
252
|
+
cancelled: c.Boolean,
|
|
253
|
+
startedAt: c.Date,
|
|
254
|
+
completedAt: c.NullOr(c.Date),
|
|
255
|
+
durationMs: c.NullOr(c.Number),
|
|
256
|
+
traceId: c.NullOr(c.String),
|
|
257
|
+
parentExecutionId: c.NullOr(c.String),
|
|
258
|
+
parentClosePolicy: c.NullOr(E)
|
|
259
|
+
}), O = c.Struct({
|
|
260
|
+
tag: c.optional(c.String),
|
|
261
|
+
status: c.optional(T),
|
|
262
|
+
limit: c.optional(c.Number)
|
|
263
|
+
}), k = c.Struct({
|
|
264
|
+
id: c.String,
|
|
265
|
+
runId: c.String,
|
|
266
|
+
stepName: c.String,
|
|
267
|
+
attempt: c.Number,
|
|
268
|
+
status: c.Literal("running", "succeeded", "failed"),
|
|
269
|
+
input: c.NullOr(c.Unknown),
|
|
270
|
+
retryPolicy: c.NullOr(c.Unknown),
|
|
271
|
+
output: c.NullOr(c.Unknown),
|
|
272
|
+
errorTag: c.NullOr(c.String),
|
|
273
|
+
errorMessage: c.NullOr(c.String),
|
|
274
|
+
errorCause: c.NullOr(c.Unknown),
|
|
275
|
+
startedAt: c.Date,
|
|
276
|
+
completedAt: c.NullOr(c.Date),
|
|
277
|
+
durationMs: c.NullOr(c.Number)
|
|
278
|
+
}), A = c.Struct({
|
|
279
|
+
id: c.String,
|
|
280
|
+
runId: c.String,
|
|
281
|
+
eventType: c.String,
|
|
282
|
+
payload: c.NullOr(c.Unknown),
|
|
283
|
+
occurredAt: c.Date,
|
|
284
|
+
stepName: c.NullOr(c.String),
|
|
285
|
+
attempt: c.NullOr(c.Number)
|
|
286
|
+
}), j = c.Struct({
|
|
287
|
+
id: c.String,
|
|
288
|
+
name: c.String,
|
|
289
|
+
payload: c.Unknown,
|
|
290
|
+
source: c.String,
|
|
291
|
+
subject: c.NullOr(c.Unknown),
|
|
292
|
+
traceId: c.NullOr(c.String),
|
|
293
|
+
occurredAt: c.Date
|
|
294
|
+
}), M = c.Struct({
|
|
295
|
+
id: c.String,
|
|
296
|
+
eventId: c.String,
|
|
297
|
+
eventName: c.String,
|
|
298
|
+
triggerId: c.String,
|
|
299
|
+
workflowName: c.String,
|
|
300
|
+
executionId: c.NullOr(c.String),
|
|
301
|
+
status: c.Literal("starting", "started", "skipped", "failed"),
|
|
302
|
+
idempotencyKey: c.String,
|
|
303
|
+
skipped: c.Boolean,
|
|
304
|
+
errorMessage: c.NullOr(c.String),
|
|
305
|
+
createdAt: c.Date,
|
|
306
|
+
completedAt: c.NullOr(c.Date)
|
|
307
|
+
}), N = c.Struct({ id: c.String }), P = c.Struct({ runId: c.String }), F = c.Struct({
|
|
308
|
+
name: c.optional(c.String),
|
|
309
|
+
limit: c.optional(c.Number)
|
|
310
|
+
}), I = c.Struct({ eventId: c.String }), L = c.Struct({
|
|
311
|
+
workflowName: c.String,
|
|
312
|
+
executionId: c.String
|
|
313
|
+
}), R = c.Struct({
|
|
314
|
+
id: c.String,
|
|
315
|
+
signalName: c.String,
|
|
316
|
+
payload: c.optional(c.Unknown)
|
|
317
|
+
}), z = c.Struct({
|
|
318
|
+
id: c.String,
|
|
319
|
+
updateName: c.String,
|
|
320
|
+
payload: c.optional(c.Unknown),
|
|
321
|
+
timeoutMs: c.optional(c.Number)
|
|
322
|
+
}), B = c.Struct({
|
|
323
|
+
eventId: c.String,
|
|
324
|
+
updateId: c.String,
|
|
325
|
+
completedEventId: c.String,
|
|
326
|
+
result: c.Unknown
|
|
327
|
+
}), Ye = g({
|
|
328
328
|
name: "__voltro.workflow.run",
|
|
329
329
|
source: "_voltro_workflow_runs",
|
|
330
|
-
input:
|
|
331
|
-
output:
|
|
332
|
-
}),
|
|
330
|
+
input: N,
|
|
331
|
+
output: c.Array(D)
|
|
332
|
+
}), Xe = g({
|
|
333
333
|
name: "__voltro.workflow.runs",
|
|
334
334
|
source: "_voltro_workflow_runs",
|
|
335
|
-
input:
|
|
336
|
-
output:
|
|
337
|
-
}),
|
|
335
|
+
input: O,
|
|
336
|
+
output: c.Array(D)
|
|
337
|
+
}), Ze = g({
|
|
338
338
|
name: "__voltro.workflow.run.steps",
|
|
339
339
|
source: "_voltro_workflow_run_steps",
|
|
340
|
-
input:
|
|
341
|
-
output:
|
|
342
|
-
}),
|
|
340
|
+
input: P,
|
|
341
|
+
output: c.Array(k)
|
|
342
|
+
}), Qe = g({
|
|
343
343
|
name: "__voltro.workflow.run.events",
|
|
344
344
|
source: "_voltro_workflow_run_events",
|
|
345
|
-
input:
|
|
346
|
-
output:
|
|
347
|
-
}),
|
|
345
|
+
input: P,
|
|
346
|
+
output: c.Array(A)
|
|
347
|
+
}), $e = g({
|
|
348
348
|
name: "__voltro.workflow.domainEvents",
|
|
349
349
|
source: "_voltro_workflow_events",
|
|
350
|
-
input:
|
|
351
|
-
output:
|
|
352
|
-
}),
|
|
350
|
+
input: F,
|
|
351
|
+
output: c.Array(j)
|
|
352
|
+
}), et = g({
|
|
353
353
|
name: "__voltro.workflow.event.deliveries",
|
|
354
354
|
source: "_voltro_workflow_event_deliveries",
|
|
355
|
-
input:
|
|
356
|
-
output:
|
|
357
|
-
}),
|
|
355
|
+
input: I,
|
|
356
|
+
output: c.Array(M)
|
|
357
|
+
}), tt = v({
|
|
358
358
|
name: "__voltro.workflow.cancel",
|
|
359
|
-
input:
|
|
360
|
-
output:
|
|
361
|
-
}),
|
|
359
|
+
input: L,
|
|
360
|
+
output: c.Struct({ ok: c.Boolean })
|
|
361
|
+
}), nt = v({
|
|
362
362
|
name: "__voltro.workflow.resume",
|
|
363
|
-
input:
|
|
364
|
-
output:
|
|
365
|
-
}),
|
|
363
|
+
input: L,
|
|
364
|
+
output: c.Struct({ ok: c.Boolean })
|
|
365
|
+
}), rt = v({
|
|
366
366
|
name: "__voltro.workflow.signal",
|
|
367
|
-
input:
|
|
368
|
-
output:
|
|
369
|
-
}),
|
|
367
|
+
input: R,
|
|
368
|
+
output: c.Struct({ eventId: c.String })
|
|
369
|
+
}), it = v({
|
|
370
370
|
name: "__voltro.workflow.update",
|
|
371
|
-
input:
|
|
372
|
-
output:
|
|
373
|
-
}),
|
|
374
|
-
id:
|
|
375
|
-
tag:
|
|
376
|
-
label:
|
|
377
|
-
undone:
|
|
378
|
-
crossesAction:
|
|
379
|
-
createdAt:
|
|
380
|
-
}),
|
|
381
|
-
invocationId:
|
|
382
|
-
reason:
|
|
383
|
-
}) {},
|
|
384
|
-
name:
|
|
371
|
+
input: z,
|
|
372
|
+
output: B
|
|
373
|
+
}), at = "__voltro.undo.log", V = "__voltro.undo.apply", H = "__voltro.undo.redo", U = c.Struct({
|
|
374
|
+
id: c.String,
|
|
375
|
+
tag: c.String,
|
|
376
|
+
label: c.NullOr(c.String),
|
|
377
|
+
undone: c.Boolean,
|
|
378
|
+
crossesAction: c.Boolean,
|
|
379
|
+
createdAt: c.String
|
|
380
|
+
}), W = class extends c.TaggedError()("UndoNotFound", { invocationId: c.String }) {}, G = class extends c.TaggedError()("UndoForbidden", { invocationId: c.String }) {}, K = class extends c.TaggedError()("UndoConflict", {
|
|
381
|
+
invocationId: c.String,
|
|
382
|
+
reason: c.Literal("conflict", "action")
|
|
383
|
+
}) {}, q = c.Union(W, G, K), ot = g({
|
|
384
|
+
name: at,
|
|
385
385
|
source: "_voltro_undo_log",
|
|
386
|
-
input:
|
|
387
|
-
output:
|
|
388
|
-
}),
|
|
389
|
-
name:
|
|
390
|
-
input:
|
|
391
|
-
output:
|
|
392
|
-
error:
|
|
393
|
-
}),
|
|
386
|
+
input: c.Struct({ limit: c.optional(c.Number) }),
|
|
387
|
+
output: c.Array(U)
|
|
388
|
+
}), st = _({
|
|
389
|
+
name: V,
|
|
390
|
+
input: c.Struct({ invocationId: c.String }),
|
|
391
|
+
output: c.Struct({ ok: c.Boolean }),
|
|
392
|
+
error: q
|
|
393
|
+
}), ct = _({
|
|
394
|
+
name: H,
|
|
395
|
+
input: c.Struct({ invocationId: c.String }),
|
|
396
|
+
output: c.Struct({ ok: c.Boolean }),
|
|
397
|
+
error: q
|
|
398
|
+
}), J = "__voltro.connections.list", Y = "__voltro.connections.start", X = "__voltro.connections.submitToken", Z = "__voltro.connections.disconnect", Q = c.Literal("oauth2", "pat"), lt = c.Literal("disconnected", "connected", "expired", "revoked", "error"), ut = c.Struct({
|
|
399
|
+
connectionId: c.String,
|
|
400
|
+
kind: Q,
|
|
401
|
+
label: c.String,
|
|
402
|
+
status: lt,
|
|
403
|
+
accountId: c.NullOr(c.String),
|
|
404
|
+
accountLabel: c.NullOr(c.String),
|
|
405
|
+
scopes: c.Array(c.String),
|
|
406
|
+
expiresAt: c.NullOr(c.String),
|
|
407
|
+
lastError: c.NullOr(c.String),
|
|
408
|
+
connectedAt: c.NullOr(c.String)
|
|
409
|
+
}), dt = class extends c.TaggedError()("ConnectionNotDeclared", { connectionId: c.String }) {}, ft = class extends c.TaggedError()("ConnectionSubjectRequired", { connectionId: c.String }) {}, pt = class extends c.TaggedError()("ConnectionKindMismatch", {
|
|
410
|
+
connectionId: c.String,
|
|
411
|
+
expected: Q,
|
|
412
|
+
actual: Q
|
|
413
|
+
}) {}, mt = class extends c.TaggedError()("ConnectionHandshakeFailed", {
|
|
414
|
+
connectionId: c.String,
|
|
415
|
+
reason: c.String,
|
|
416
|
+
transient: c.Boolean
|
|
417
|
+
}) {}, $ = c.Union(dt, ft, pt, mt), ht = g({
|
|
394
418
|
name: J,
|
|
395
|
-
|
|
396
|
-
|
|
419
|
+
source: "_voltro_connections",
|
|
420
|
+
input: c.Struct({}),
|
|
421
|
+
output: c.Array(ut)
|
|
422
|
+
}), gt = v({
|
|
423
|
+
name: Y,
|
|
424
|
+
input: c.Struct({
|
|
425
|
+
connectionId: c.String,
|
|
426
|
+
redirectTo: c.optional(c.String)
|
|
427
|
+
}),
|
|
428
|
+
output: c.Struct({
|
|
429
|
+
authorizeUrl: c.String,
|
|
430
|
+
state: c.String
|
|
431
|
+
}),
|
|
432
|
+
error: $
|
|
433
|
+
}), _t = _({
|
|
434
|
+
name: X,
|
|
435
|
+
input: c.Struct({
|
|
436
|
+
connectionId: c.String,
|
|
437
|
+
token: c.String
|
|
438
|
+
}),
|
|
439
|
+
output: c.Struct({ ok: c.Boolean }),
|
|
440
|
+
error: $
|
|
441
|
+
}), vt = _({
|
|
442
|
+
name: Z,
|
|
443
|
+
input: c.Struct({ connectionId: c.String }),
|
|
444
|
+
output: c.Struct({ ok: c.Boolean }),
|
|
397
445
|
error: $
|
|
398
|
-
}),
|
|
446
|
+
}), yt = (e) => {
|
|
399
447
|
let t = e instanceof Date ? e.getTime() : typeof e == "number" ? e : typeof e == "string" ? new Date(e).getTime() : 0;
|
|
400
448
|
return Number.isNaN(t) ? 0 : t;
|
|
401
|
-
},
|
|
449
|
+
}, bt = 1;
|
|
402
450
|
//#endregion
|
|
403
|
-
export {
|
|
451
|
+
export { a as ADMIN_SCOPE, Ee as AuthMiddleware, J as CONNECTIONS_LIST_TAG, Z as CONNECTION_DISCONNECT_TAG, Y as CONNECTION_START_TAG, X as CONNECTION_SUBMIT_TOKEN_TAG, mt as ConnectionHandshakeFailed, Se as ConnectionInfo, we as ConnectionInfoMiddleware, Q as ConnectionKind, pt as ConnectionKindMismatch, dt as ConnectionNotDeclared, ut as ConnectionState, lt as ConnectionStatus, ft as ConnectionSubjectRequired, bt as PROTOCOL_VERSION, s as ScopeError, be as Subject, ge as SubjectService, V as UNDO_APPLY_TAG, at as UNDO_LOG_TAG, H as UNDO_REDO_TAG, Ce as Unauthenticated, K as UndoConflict, G as UndoForbidden, U as UndoLogEntry, W as UndoNotFound, L as WorkflowControlInputSchema, j as WorkflowDomainEventRowSchema, F as WorkflowDomainEventsInputSchema, I as WorkflowEventDeliveriesInputSchema, M as WorkflowEventDeliveryRowSchema, E as WorkflowParentClosePolicySchema, A as WorkflowRunEventRowSchema, Je as WorkflowRunHandleSchema, N as WorkflowRunRefSchema, D as WorkflowRunRowSchema, T as WorkflowRunStatusSchema, k as WorkflowRunStepRowSchema, P as WorkflowRunTableRefSchema, O as WorkflowRunsInputSchema, R as WorkflowSignalInputSchema, z as WorkflowUpdateInputSchema, B as WorkflowUpdateResultSchema, ze as actionToRpc, de as advisoryResourceGuardWarning, Te as anonymousSubject, Fe as applyRowPatch, _e as assertAuthenticated, ce as beginIdempotent, Ke as checkFrameworkCompat, o as checkGuards, ee as checkGuardsEffect, xe as composeAuthStrategies, We as composeRpcInterceptors, vt as connectionDisconnectDescriptor, gt as connectionStartDescriptor, _t as connectionSubmitTokenDescriptor, ht as connectionsListQueryDescriptor, v as defineAction, _ as defineMutation, He as definePlugin, Ue as definePluginRoute, Ge as definePluginService, g as defineQuery, Le as defineStream, Ne as diffRows, se as effectiveScopes, re as failIdempotent, ie as findAdvisoryResourceGuards, r as finishIdempotent, ne as getPolicyGuardResolver, te as getResourceScopeResolver, De as hasCallbackRoutes, n as hasEffectiveScope, fe as hasScope, p as idToPath, oe as idempotencyScope, Pe as isIdKeyed, he as isPolicyCheck, Ie as isPolicyGuard, ve as isSystemSubject, le as memoryIdempotencyStore, Re as mutationToRpc, Ve as normalizeDescriptor, je as pathToId, ue as publishServerError, x as queryToRpc, i as requireScope, d as rowPatchOpSchema, f as rowPatchSchema, me as setEffectiveScopes, t as setPolicyGuardResolver, e as setResourceScopeResolver, S as streamToRpc, pe as subjectScopes, ae as subscribeServerErrors, h as subscriptionEvent, ye as systemSubject, Be as toRpc, yt as tsMs, st as undoApplyDescriptor, ot as undoLogQueryDescriptor, ct as undoRedoDescriptor, tt as workflowCancelDescriptor, $e as workflowDomainEventsQueryDescriptor, et as workflowEventDeliveriesQueryDescriptor, nt as workflowResumeDescriptor, Qe as workflowRunEventsQueryDescriptor, Ye as workflowRunQueryDescriptor, Ze as workflowRunStepsQueryDescriptor, Xe as workflowRunsQueryDescriptor, rt as workflowSignalDescriptor, it as workflowUpdateDescriptor };
|