@voltro/protocol 0.5.0 → 0.7.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/dist/index.js CHANGED
@@ -1,30 +1,30 @@
1
- import { S as e, _ as t, a as n, b as r, c as i, d as a, f as o, g as ee, h as te, i as ne, l as s, m as c, n as re, o as ie, p as ae, r as oe, s as se, t as ce, u as le, v as ue, x as de, y as fe } from "./serverErrorBus-XDdIJk0c.js";
2
- import { a as pe, c as me, d as he, f as ge, i as _e, l as ve, n as ye, o as be, r as xe, s as Se, t as Ce, u as we } from "./auth-DCE6m7Bo.js";
3
- import { Context as Te, Layer as Ee, Schema as l } from "effect";
4
- import { Rpc as u } from "@effect/rpc";
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 De = l.Union(l.String, l.Number), d = l.Record({
7
- key: l.String,
8
- value: l.Unknown
9
- }).pipe(l.filter((e) => "id" in e, { message: () => "patch row must carry an id" })), f = l.Union(l.Struct({
10
- op: l.Literal("add"),
11
- path: l.String,
12
- value: d
13
- }), l.Struct({
14
- op: l.Literal("replace"),
15
- path: l.String,
16
- value: d
17
- }), l.Struct({
18
- op: l.Literal("remove"),
19
- path: l.String
20
- })), p = l.Struct({
21
- ops: l.Array(f),
22
- order: l.Array(De)
23
- }), m = (e) => `/${String(e).replace(/~/g, "~0").replace(/\//g, "~1")}`, Oe = (e) => (e.startsWith("/") ? e.slice(1) : e).replace(/~1/g, "/").replace(/~0/g, "~"), h = (e) => {
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
- }, ke = (e, t) => h(e) === h(t), Ae = (e, t) => {
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: m(e.id),
36
+ path: p(e.id),
37
37
  value: e
38
- }) : ke(t, e) || r.push({
38
+ }) : Me(t, e) || r.push({
39
39
  op: "replace",
40
- path: m(e.id),
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: m(t.id)
46
+ path: p(t.id)
47
47
  });
48
48
  return {
49
49
  ops: r,
50
50
  order: i
51
51
  };
52
- }, je = (e) => e.every((e) => {
52
+ }, Pe = (e) => e.every((e) => {
53
53
  let t = e.id;
54
54
  return typeof t == "string" || typeof t == "number";
55
- }), Me = (e, t) => {
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
- }, g = (e) => l.Union(l.Struct({
66
- _tag: l.Literal("snapshot"),
67
- revision: l.Number,
65
+ }, h = (e) => c.Union(c.Struct({
66
+ _tag: c.Literal("snapshot"),
67
+ revision: c.Number,
68
68
  data: e,
69
- computed: l.optional(l.Boolean)
70
- }), l.Struct({
71
- _tag: l.Literal("delta"),
72
- revision: l.Number,
73
- emittedAt: l.Number,
74
- patch: p
75
- }), l.Struct({
76
- _tag: l.Literal("error"),
77
- error: l.Unknown,
78
- revision: l.optional(l.Number)
79
- })), Ne = (e) => e.action !== void 0 && e.resourceType !== void 0, _ = (e) => ({
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 ?? l.Never,
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
- }), v = (e) => ({
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 ?? l.Never,
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
- }), y = (e) => ({
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 ?? l.Never,
105
+ error: e.error ?? c.Never,
106
106
  guards: e.guards,
107
107
  publicApi: e.publicApi,
108
108
  exposeAsTool: e.exposeAsTool
109
- }), b = (e) => ({
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 ?? l.Never
115
- }), x = (e, t) => t && t.length > 0 ? l.Union(e, ...t) : e, S = (e, t) => t && t.length > 0 ? l.Union(e, s) : e, C = (e, t) => u.make(e.name, {
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: g(e.output),
118
- error: x(S(e.error, e.guards), t),
117
+ success: h(e.output),
118
+ error: y(b(e.error, e.guards), t),
119
119
  stream: !0
120
- }), w = (e, t) => u.make(e.name, {
120
+ }), Re = (e, t) => l.make(e.name, {
121
121
  payload: e.input,
122
122
  success: e.output,
123
- error: x(S(e.error, e.guards), t)
124
- }), T = (e, t) => u.make(e.name, {
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: x(S(e.error, e.guards), t)
128
- }), E = (e, t) => u.make(e.name, {
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: x(e.error, t),
131
+ error: y(e.error, t),
132
132
  stream: !0
133
- }), Pe = (e) => {
133
+ }), Be = (e) => {
134
134
  switch (e.kind) {
135
- case "query": return C(e);
136
- case "mutation": return w(e);
137
- case "action": return T(e);
138
- case "stream": return E(e);
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
- }, Fe = (e) => {
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
- }, Ie = (e) => e, Le = (e) => e, Re = (e) => {
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
- }, ze = (e, t) => {
184
- let n = Te.GenericTag(e);
183
+ }, Ge = (e, t) => {
184
+ let n = Oe.GenericTag(e);
185
185
  return {
186
186
  Tag: n,
187
- Live: Ee.succeed(n, t)
187
+ Live: ke.succeed(n, t)
188
188
  };
189
- }, D = (e, t, n) => {
189
+ }, Ke = (e, t, n) => {
190
190
  if (!t) return { ok: !0 };
191
- let r = O(n);
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 (!Be(i, r)) return {
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
- }, O = (e) => {
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
- }, 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, Be = (e, t) => {
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 = O(e.slice(1));
216
- return !n || t.major !== n.major ? !1 : k(t, n) >= 0;
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 = O(e.slice(1));
220
- return !n || t.major !== n.major || t.minor !== n.minor ? !1 : k(t, n) >= 0;
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 = O(n[2]);
224
+ let e = n[1], r = C(n[2]);
225
225
  if (!r) return !1;
226
- let i = k(t, r);
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 = O(e);
233
- return r ? k(t, r) === 0 : !1;
234
- }, A = l.Literal("running", "succeeded", "failed", "cancelled", "suspended"), j = l.Literal("cancel", "terminate", "abandon"), Ve = l.Struct({
235
- id: l.String,
236
- workflowName: l.String,
237
- executionId: l.String,
238
- status: l.Literal("running")
239
- }), M = l.Struct({
240
- id: l.String,
241
- tag: l.String,
242
- executionId: l.String,
243
- status: A,
244
- payload: l.Unknown,
245
- workflowVersion: l.NullOr(l.String),
246
- workflowPatches: l.NullOr(l.Unknown),
247
- output: l.NullOr(l.Unknown),
248
- subject: l.NullOr(l.Unknown),
249
- source: l.NullOr(l.String),
250
- errorTag: l.NullOr(l.String),
251
- errorMessage: l.NullOr(l.String),
252
- cancelled: l.Boolean,
253
- startedAt: l.Date,
254
- completedAt: l.NullOr(l.Date),
255
- durationMs: l.NullOr(l.Number),
256
- traceId: l.NullOr(l.String),
257
- parentExecutionId: l.NullOr(l.String),
258
- parentClosePolicy: l.NullOr(j)
259
- }), N = l.Struct({
260
- tag: l.optional(l.String),
261
- status: l.optional(A),
262
- limit: l.optional(l.Number)
263
- }), P = l.Struct({
264
- id: l.String,
265
- runId: l.String,
266
- stepName: l.String,
267
- attempt: l.Number,
268
- status: l.Literal("running", "succeeded", "failed"),
269
- input: l.NullOr(l.Unknown),
270
- retryPolicy: l.NullOr(l.Unknown),
271
- output: l.NullOr(l.Unknown),
272
- errorTag: l.NullOr(l.String),
273
- errorMessage: l.NullOr(l.String),
274
- errorCause: l.NullOr(l.Unknown),
275
- startedAt: l.Date,
276
- completedAt: l.NullOr(l.Date),
277
- durationMs: l.NullOr(l.Number)
278
- }), F = l.Struct({
279
- id: l.String,
280
- runId: l.String,
281
- eventType: l.String,
282
- payload: l.NullOr(l.Unknown),
283
- occurredAt: l.Date,
284
- stepName: l.NullOr(l.String),
285
- attempt: l.NullOr(l.Number)
286
- }), I = l.Struct({
287
- id: l.String,
288
- name: l.String,
289
- payload: l.Unknown,
290
- source: l.String,
291
- subject: l.NullOr(l.Unknown),
292
- traceId: l.NullOr(l.String),
293
- occurredAt: l.Date
294
- }), L = l.Struct({
295
- id: l.String,
296
- eventId: l.String,
297
- eventName: l.String,
298
- triggerId: l.String,
299
- workflowName: l.String,
300
- executionId: l.NullOr(l.String),
301
- status: l.Literal("starting", "started", "skipped", "failed"),
302
- idempotencyKey: l.String,
303
- skipped: l.Boolean,
304
- errorMessage: l.NullOr(l.String),
305
- createdAt: l.Date,
306
- completedAt: l.NullOr(l.Date)
307
- }), R = l.Struct({ id: l.String }), z = l.Struct({ runId: l.String }), B = l.Struct({
308
- name: l.optional(l.String),
309
- limit: l.optional(l.Number)
310
- }), V = l.Struct({ eventId: l.String }), H = l.Struct({
311
- workflowName: l.String,
312
- executionId: l.String
313
- }), U = l.Struct({
314
- id: l.String,
315
- signalName: l.String,
316
- payload: l.optional(l.Unknown)
317
- }), W = l.Struct({
318
- id: l.String,
319
- updateName: l.String,
320
- payload: l.optional(l.Unknown),
321
- timeoutMs: l.optional(l.Number)
322
- }), G = l.Struct({
323
- eventId: l.String,
324
- updateId: l.String,
325
- completedEventId: l.String,
326
- result: l.Unknown
327
- }), He = _({
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: R,
331
- output: l.Array(M)
332
- }), Ue = _({
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: N,
336
- output: l.Array(M)
337
- }), We = _({
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: z,
341
- output: l.Array(P)
342
- }), Ge = _({
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: z,
346
- output: l.Array(F)
347
- }), Ke = _({
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: B,
351
- output: l.Array(I)
352
- }), qe = _({
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: V,
356
- output: l.Array(L)
357
- }), Je = y({
355
+ input: I,
356
+ output: c.Array(M)
357
+ }), tt = v({
358
358
  name: "__voltro.workflow.cancel",
359
- input: H,
360
- output: l.Struct({ ok: l.Boolean })
361
- }), Ye = y({
359
+ input: L,
360
+ output: c.Struct({ ok: c.Boolean })
361
+ }), nt = v({
362
362
  name: "__voltro.workflow.resume",
363
- input: H,
364
- output: l.Struct({ ok: l.Boolean })
365
- }), Xe = y({
363
+ input: L,
364
+ output: c.Struct({ ok: c.Boolean })
365
+ }), rt = v({
366
366
  name: "__voltro.workflow.signal",
367
- input: U,
368
- output: l.Struct({ eventId: l.String })
369
- }), Ze = y({
367
+ input: R,
368
+ output: c.Struct({ eventId: c.String })
369
+ }), it = v({
370
370
  name: "__voltro.workflow.update",
371
- input: W,
372
- output: G
373
- }), K = "__voltro.undo.log", q = "__voltro.undo.apply", J = "__voltro.undo.redo", Y = l.Struct({
374
- id: l.String,
375
- tag: l.String,
376
- label: l.NullOr(l.String),
377
- undone: l.Boolean,
378
- crossesAction: l.Boolean,
379
- createdAt: l.String
380
- }), X = class extends l.TaggedError()("UndoNotFound", { invocationId: l.String }) {}, Z = class extends l.TaggedError()("UndoForbidden", { invocationId: l.String }) {}, Q = class extends l.TaggedError()("UndoConflict", {
381
- invocationId: l.String,
382
- reason: l.Literal("conflict", "action")
383
- }) {}, $ = l.Union(X, Z, Q), Qe = _({
384
- name: K,
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: l.Struct({ limit: l.optional(l.Number) }),
387
- output: l.Array(Y)
388
- }), $e = v({
389
- name: q,
390
- input: l.Struct({ invocationId: l.String }),
391
- output: l.Struct({ ok: l.Boolean }),
392
- error: $
393
- }), et = v({
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
- input: l.Struct({ invocationId: l.String }),
396
- output: l.Struct({ ok: l.Boolean }),
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
- }), tt = (e) => {
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
- }, nt = 1;
449
+ }, bt = 1;
402
450
  //#endregion
403
- export { i as ADMIN_SCOPE, Ce as AuthMiddleware, ye as ConnectionInfo, xe as ConnectionInfoMiddleware, nt as PROTOCOL_VERSION, s as ScopeError, _e as Subject, pe as SubjectService, q as UNDO_APPLY_TAG, K as UNDO_LOG_TAG, J as UNDO_REDO_TAG, be as Unauthenticated, Q as UndoConflict, Z as UndoForbidden, Y as UndoLogEntry, X as UndoNotFound, H as WorkflowControlInputSchema, I as WorkflowDomainEventRowSchema, B as WorkflowDomainEventsInputSchema, V as WorkflowEventDeliveriesInputSchema, L as WorkflowEventDeliveryRowSchema, j as WorkflowParentClosePolicySchema, F as WorkflowRunEventRowSchema, Ve as WorkflowRunHandleSchema, R as WorkflowRunRefSchema, M as WorkflowRunRowSchema, A as WorkflowRunStatusSchema, P as WorkflowRunStepRowSchema, z as WorkflowRunTableRefSchema, N as WorkflowRunsInputSchema, U as WorkflowSignalInputSchema, W as WorkflowUpdateInputSchema, G as WorkflowUpdateResultSchema, T as actionToRpc, Se as anonymousSubject, Me as applyRowPatch, me as assertAuthenticated, oe as beginIdempotent, D as checkFrameworkCompat, le as checkGuards, a as checkGuardsEffect, ve as composeAuthStrategies, Re as composeRpcInterceptors, y as defineAction, v as defineMutation, Ie as definePlugin, Le as definePluginRoute, ze as definePluginService, _ as defineQuery, b as defineStream, Ae as diffRows, o as effectiveScopes, ne as failIdempotent, n as finishIdempotent, ae as getPolicyGuardResolver, c as getResourceScopeResolver, we as hasCallbackRoutes, te as hasEffectiveScope, ee as hasScope, m as idToPath, ie as idempotencyScope, je as isIdKeyed, t as isPolicyCheck, Ne as isPolicyGuard, he as isSystemSubject, se as memoryIdempotencyStore, w as mutationToRpc, Fe as normalizeDescriptor, Oe as pathToId, ce as publishServerError, C as queryToRpc, ue as requireScope, f as rowPatchOpSchema, p as rowPatchSchema, fe as setEffectiveScopes, r as setPolicyGuardResolver, de as setResourceScopeResolver, E as streamToRpc, e as subjectScopes, re as subscribeServerErrors, g as subscriptionEvent, ge as systemSubject, Pe as toRpc, tt as tsMs, $e as undoApplyDescriptor, Qe as undoLogQueryDescriptor, et as undoRedoDescriptor, Je as workflowCancelDescriptor, Ke as workflowDomainEventsQueryDescriptor, qe as workflowEventDeliveriesQueryDescriptor, Ye as workflowResumeDescriptor, Ge as workflowRunEventsQueryDescriptor, He as workflowRunQueryDescriptor, We as workflowRunStepsQueryDescriptor, Ue as workflowRunsQueryDescriptor, Xe as workflowSignalDescriptor, Ze as workflowUpdateDescriptor };
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 };