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