@w6w/embed 0.2.0 → 0.2.11

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.
Files changed (119) hide show
  1. package/dist/{ConfirmModal-RLbZT5_k.js → ConfirmModal-BE-SdX-O.js} +53 -49
  2. package/dist/{ConfirmModal-RLbZT5_k.js.map → ConfirmModal-BE-SdX-O.js.map} +1 -1
  3. package/dist/{CreateFunctionModal-DRsFx-FB.js → CreateFunctionModal-D6CQLpa_.js} +25 -25
  4. package/dist/{CreateFunctionModal-DRsFx-FB.js.map → CreateFunctionModal-D6CQLpa_.js.map} +1 -1
  5. package/dist/{DocumentFormModal-BExK1V-B.js → DocumentFormModal-YauVdolr.js} +5 -5
  6. package/dist/{DocumentFormModal-BExK1V-B.js.map → DocumentFormModal-YauVdolr.js.map} +1 -1
  7. package/dist/{ImportSpecModal-BDQIf6rg.js → ImportSpecModal-B7qd1Km2.js} +3 -3
  8. package/dist/{ImportSpecModal-BDQIf6rg.js.map → ImportSpecModal-B7qd1Km2.js.map} +1 -1
  9. package/dist/ModelRoutesManager-BGESQahw.js +345 -0
  10. package/dist/ModelRoutesManager-BGESQahw.js.map +1 -0
  11. package/dist/WorkflowEditor-CwvmAGp2.js +925 -0
  12. package/dist/WorkflowEditor-CwvmAGp2.js.map +1 -0
  13. package/dist/{apps-1FNUwbGv.js → apps-CboASBKr.js} +14 -14
  14. package/dist/{apps-1FNUwbGv.js.map → apps-CboASBKr.js.map} +1 -1
  15. package/dist/{callables-3mFrMVG_.js → callables-tOlflvbl.js} +11 -11
  16. package/dist/{callables-3mFrMVG_.js.map → callables-tOlflvbl.js.map} +1 -1
  17. package/dist/chrome/ConfirmModal.d.ts +4 -1
  18. package/dist/chrome/workspace.d.ts +4 -0
  19. package/dist/{coerce-input-BicYr7nc.js → coerce-input-DttlcSdO.js} +70 -58
  20. package/dist/coerce-input-DttlcSdO.js.map +1 -0
  21. package/dist/connections-D7cgXhDS.js +119 -0
  22. package/dist/connections-D7cgXhDS.js.map +1 -0
  23. package/dist/credentials-DaQU3Ca_.js +171 -0
  24. package/dist/credentials-DaQU3Ca_.js.map +1 -0
  25. package/dist/document-sources-UCwe8x77.js +91 -0
  26. package/dist/document-sources-UCwe8x77.js.map +1 -0
  27. package/dist/draft.mjs +1 -1
  28. package/dist/editor/BindingBanner.d.ts +13 -0
  29. package/dist/editor/CallableEditorFrame.d.ts +7 -0
  30. package/dist/editor/EndpointCards.d.ts +4 -1
  31. package/dist/editor/PublishControl.d.ts +19 -0
  32. package/dist/editor/TargetSelector.d.ts +15 -0
  33. package/dist/editor/TargetSelector.types.d.ts +2 -0
  34. package/dist/editor/definition.d.ts +2 -0
  35. package/dist/{editor-apps-BdenSV1o.js → editor-apps-BUZWld-m.js} +5 -5
  36. package/dist/{editor-apps-BdenSV1o.js.map → editor-apps-BUZWld-m.js.map} +1 -1
  37. package/dist/{editor-tools-RxmY5iyi.js → editor-tools-B_Lfx3kw.js} +11 -11
  38. package/dist/editor-tools-B_Lfx3kw.js.map +1 -0
  39. package/dist/editor.mjs +1 -1
  40. package/dist/editors.mjs +769 -622
  41. package/dist/editors.mjs.map +1 -1
  42. package/dist/{endpoints-B2ynbZo-.js → endpoints-DSRo1Lc5.js} +113 -107
  43. package/dist/endpoints-DSRo1Lc5.js.map +1 -0
  44. package/dist/fields-DvS8XZFc.js +21 -0
  45. package/dist/fields-DvS8XZFc.js.map +1 -0
  46. package/dist/forms/ModelBudgetsManager.d.ts +9 -0
  47. package/dist/forms/ModelRoutesManager.d.ts +14 -0
  48. package/dist/forms.d.ts +4 -0
  49. package/dist/forms.mjs +611 -212
  50. package/dist/forms.mjs.map +1 -1
  51. package/dist/index.mjs +119 -112
  52. package/dist/index.mjs.map +1 -1
  53. package/dist/lib/binding-problems.d.ts +38 -0
  54. package/dist/lib/code-rail.d.ts +4 -2
  55. package/dist/lib/index.d.ts +1 -0
  56. package/dist/lib/invoke-error.d.ts +1 -0
  57. package/dist/lib/sdk-snippets.d.ts +1 -1
  58. package/dist/lib/target-fields.d.ts +8 -0
  59. package/dist/lib/trigger-preview.d.ts +1 -0
  60. package/dist/lib/workflow-live-run.d.ts +9 -2
  61. package/dist/lib/workflow-nodes.d.ts +5 -0
  62. package/dist/lib/workflow-validity.d.ts +1 -0
  63. package/dist/lib.mjs +72 -70
  64. package/dist/lists/ConnectionDependents.d.ts +31 -0
  65. package/dist/lists/ConnectionDetail.d.ts +4 -1
  66. package/dist/lists/ConnectionList.d.ts +4 -1
  67. package/dist/lists/CredentialDetail.d.ts +15 -0
  68. package/dist/lists/CredentialList.d.ts +14 -0
  69. package/dist/lists/ModelCatalog.d.ts +12 -0
  70. package/dist/lists/ModelUsage.d.ts +12 -0
  71. package/dist/lists.d.ts +8 -0
  72. package/dist/lists.mjs +1322 -604
  73. package/dist/lists.mjs.map +1 -1
  74. package/dist/models-bAayQPJ_.js +270 -0
  75. package/dist/models-bAayQPJ_.js.map +1 -0
  76. package/dist/{project-context-BiCjv_E3.js → project-context-Tvp-La7A.js} +3 -3
  77. package/dist/{project-context-BiCjv_E3.js.map → project-context-Tvp-La7A.js.map} +1 -1
  78. package/dist/rail.mjs +4 -4
  79. package/dist/repos/agents-studio-agents.d.ts +52 -0
  80. package/dist/repos/agents-studio-assets.d.ts +68 -0
  81. package/dist/repos/connections.d.ts +30 -12
  82. package/dist/repos/credentials.d.ts +83 -0
  83. package/dist/repos/endpoints.d.ts +9 -3
  84. package/dist/repos/fields.d.ts +34 -0
  85. package/dist/repos/functions.d.ts +7 -5
  86. package/dist/repos/index.d.ts +5 -0
  87. package/dist/repos/models.d.ts +289 -0
  88. package/dist/repos.mjs +613 -176
  89. package/dist/repos.mjs.map +1 -1
  90. package/dist/{slug-C4ktDPdy.js → slug-BVdgiP_L.js} +64 -60
  91. package/dist/slug-BVdgiP_L.js.map +1 -0
  92. package/dist/{spec-export-Cf3VQSQS.js → spec-export-CBbloO_n.js} +7 -7
  93. package/dist/{spec-export-Cf3VQSQS.js.map → spec-export-CBbloO_n.js.map} +1 -1
  94. package/dist/{spec-import-CjmxyZDR.js → spec-import-CW6R_Wk1.js} +160 -156
  95. package/dist/spec-import-CW6R_Wk1.js.map +1 -0
  96. package/dist/theme-context-E2ZhlXDX.js +6 -0
  97. package/dist/theme-context-E2ZhlXDX.js.map +1 -0
  98. package/dist/theme-context.d.ts +2 -0
  99. package/dist/trigger-preview-DKxfjzUY.js +145 -0
  100. package/dist/trigger-preview-DKxfjzUY.js.map +1 -0
  101. package/dist/{use-callable-draft-zHLpcr-b.js → use-callable-draft-DsALnSfF.js} +22 -22
  102. package/dist/{use-callable-draft-zHLpcr-b.js.map → use-callable-draft-DsALnSfF.js.map} +1 -1
  103. package/dist/{workflow-blank-DyL3_RUA.js → workflow-blank-DFpGObrn.js} +6 -6
  104. package/dist/{workflow-blank-DyL3_RUA.js.map → workflow-blank-DFpGObrn.js.map} +1 -1
  105. package/package.json +1 -1
  106. package/src/styles.css +2 -6
  107. package/dist/WorkflowEditor-DlbVv6Fs.js +0 -854
  108. package/dist/WorkflowEditor-DlbVv6Fs.js.map +0 -1
  109. package/dist/coerce-input-BicYr7nc.js.map +0 -1
  110. package/dist/connections-CjjYeRqb.js +0 -78
  111. package/dist/connections-CjjYeRqb.js.map +0 -1
  112. package/dist/document-sources-C0grrtdq.js +0 -86
  113. package/dist/document-sources-C0grrtdq.js.map +0 -1
  114. package/dist/editor-tools-RxmY5iyi.js.map +0 -1
  115. package/dist/endpoints-B2ynbZo-.js.map +0 -1
  116. package/dist/slug-C4ktDPdy.js.map +0 -1
  117. package/dist/spec-import-CjmxyZDR.js.map +0 -1
  118. package/dist/trigger-preview-VPkrryDl.js +0 -120
  119. package/dist/trigger-preview-VPkrryDl.js.map +0 -1
@@ -1,21 +1,24 @@
1
1
  import { useQueryClient as c, useMutation as a, useQuery as y } from "@tanstack/react-query";
2
2
  import { u as i } from "./client-context-CX61Bgw-.js";
3
- import { isTerminalRunStatus as g, path as v } from "@w6w/sdk";
4
- import { i as b } from "./spec-import-invalidation-D3retX4Q.js";
5
- const p = "Step failed without reporting a reason.", C = "Run failed without reporting a reason.";
3
+ import { isTerminalRunStatus as g, path as b } from "@w6w/sdk";
4
+ import { i as C } from "./spec-import-invalidation-D3retX4Q.js";
6
5
  function E(t) {
6
+ return (t == null ? void 0 : t.nodes) ?? (t == null ? void 0 : t.steps) ?? void 0;
7
+ }
8
+ const p = "Node failed without reporting a reason.", A = "Run failed without reporting a reason.";
9
+ function K(t) {
7
10
  return t === void 0 || !g(t);
8
11
  }
9
- function A(t, e) {
12
+ function F(t, e) {
10
13
  return e || t === void 0 ? !1 : !g(t);
11
14
  }
12
- function X(t, e) {
13
- return A(t, e) ? t === "queued" ? "Queued…" : "Running…" : "Run";
15
+ function et(t, e) {
16
+ return F(t, e) ? t === "queued" ? "Queued…" : "Running…" : "Run";
14
17
  }
15
- function tt(t) {
18
+ function nt(t) {
16
19
  return t === "run_not_cancelable" ? "reconcile" : "surface";
17
20
  }
18
- function K(t) {
21
+ function Q(t) {
19
22
  return t ? Object.entries(t).map(([e, n]) => ({
20
23
  id: e,
21
24
  status: n.status,
@@ -24,10 +27,10 @@ function K(t) {
24
27
  input: n.input,
25
28
  output: n.output,
26
29
  ...n.meta !== void 0 && n.meta !== null ? { meta: n.meta } : {},
27
- ...F(n)
30
+ ...M(n)
28
31
  })) : [];
29
32
  }
30
- function F(t) {
33
+ function M(t) {
31
34
  const e = w(t.error);
32
35
  return e ? { error: e } : t.status === "failed" ? { error: { message: p } } : {};
33
36
  }
@@ -35,7 +38,7 @@ function w(t) {
35
38
  if (t != null) {
36
39
  if (typeof t == "string" && t !== "") return { message: t };
37
40
  if (typeof t == "object") {
38
- const e = t, n = typeof e.code == "string" ? e.code : void 0, o = typeof e.message == "string" && e.message !== "" ? e.message : n || Q(t);
41
+ const e = t, n = typeof e.code == "string" ? e.code : void 0, o = typeof e.message == "string" && e.message !== "" ? e.message : n || D(t);
39
42
  return {
40
43
  ...n !== void 0 ? { code: n } : {},
41
44
  message: o || "Unknown error.",
@@ -46,81 +49,81 @@ function w(t) {
46
49
  return { message: String(t) || "Unknown error." };
47
50
  }
48
51
  }
49
- function Q(t) {
52
+ function D(t) {
50
53
  try {
51
54
  return JSON.stringify(t) ?? "";
52
55
  } catch {
53
56
  return "";
54
57
  }
55
58
  }
56
- function et(t, e) {
59
+ function ot(t, e) {
57
60
  if (!t) return {};
58
- const n = new Set(e.filter((s) => s.error !== void 0).map((s) => s.id)), o = new Set(
59
- e.filter((s) => s.error !== void 0 && s.error.message !== p).map((s) => s.id)
60
- ), r = (t.stepErrors ?? []).filter((s) => !o.has(s.stepId)).map((s) => ({
61
- stepId: s.stepId,
62
- error: w(s.error) ?? { message: p }
63
- })), u = w(t.error), l = (s) => u !== void 0 && (s == null ? void 0 : s.message) === u.message && (s == null ? void 0 : s.code) === u.code;
64
- let d = e.some((s) => l(s.error)) || r.some((s) => l(s.error)) ? void 0 : u;
65
- return !d && t.status === "failed" && n.size === 0 && r.length === 0 && (d = { message: C }), {
61
+ const n = new Set(e.filter((r) => r.error !== void 0).map((r) => r.id)), o = new Set(
62
+ e.filter((r) => r.error !== void 0 && r.error.message !== p).map((r) => r.id)
63
+ ), s = (t.stepErrors ?? []).map((r) => ({ e: r, id: r.nodeId ?? r.stepId ?? "" })).filter(({ id: r }) => !o.has(r)).map(({ e: r, id: v }) => ({
64
+ stepId: v,
65
+ error: w(r.error) ?? { message: p }
66
+ })), u = w(t.error), l = (r) => u !== void 0 && (r == null ? void 0 : r.message) === u.message && (r == null ? void 0 : r.code) === u.code;
67
+ let d = e.some((r) => l(r.error)) || s.some((r) => l(r.error)) ? void 0 : u;
68
+ return !d && t.status === "failed" && n.size === 0 && s.length === 0 && (d = { message: A }), {
66
69
  ...d ? { runError: d } : {},
67
- ...r.length > 0 ? { stepErrors: r } : {}
70
+ ...s.length > 0 ? { stepErrors: s } : {}
68
71
  };
69
72
  }
70
- function D(t) {
73
+ function I(t) {
71
74
  var n;
72
75
  const e = (n = t == null ? void 0 : t[t.length - 1]) == null ? void 0 : n.with;
73
76
  if (!(e === null || typeof e != "object" || Array.isArray(e)))
74
77
  return e;
75
78
  }
76
- async function nt(t, e) {
79
+ async function rt(t, e) {
77
80
  if (t)
78
81
  try {
79
- return D(await e(t));
82
+ return I(await e(t));
80
83
  } catch {
81
84
  return;
82
85
  }
83
86
  }
84
- const ot = {
87
+ const st = {
85
88
  status: "",
86
89
  kind: "",
87
90
  from: "",
88
91
  to: "",
89
92
  q: "",
90
93
  offset: 0
91
- }, q = 25, I = /* @__PURE__ */ new Set([
94
+ }, q = 25, T = /* @__PURE__ */ new Set([
92
95
  "queued",
93
96
  "running",
94
97
  "succeeded",
95
98
  "failed",
96
99
  "canceled"
97
- ]), M = /* @__PURE__ */ new Set(["function", "endpoint", "workflow"]), T = /^\d{4}-\d{2}-\d{2}$/;
100
+ ]), N = /* @__PURE__ */ new Set(["function", "endpoint", "workflow"]), _ = /^\d{4}-\d{2}-\d{2}$/;
98
101
  function m(t) {
99
- if (!T.test(t)) return !1;
100
- const { y: e, m: n, d: o } = h(t), r = new Date(e, n - 1, o);
101
- return r.getFullYear() === e && r.getMonth() === n - 1 && r.getDate() === o;
102
+ if (!_.test(t)) return !1;
103
+ const { y: e, m: n, d: o } = h(t), s = new Date(e, n - 1, o);
104
+ return s.getFullYear() === e && s.getMonth() === n - 1 && s.getDate() === o;
102
105
  }
103
106
  function h(t) {
104
107
  const [e, n, o] = t.split("-").map(Number);
105
108
  return { y: e, m: n, d: o };
106
109
  }
107
- function rt(t) {
108
- const e = new URLSearchParams(t), n = e.get("status") ?? "", o = e.get("kind") ?? "", r = e.get("from") ?? "", u = e.get("to") ?? "", l = e.get("q") ?? "", f = e.get("offset");
110
+ function it(t) {
111
+ const e = new URLSearchParams(t), n = e.get("status") ?? "", o = e.get("kind") ?? "", s = e.get("from") ?? "", u = e.get("to") ?? "", l = e.get("q") ?? "", f = e.get("offset");
109
112
  let d = 0;
110
113
  if (f !== null) {
111
- const s = Number(f);
112
- Number.isInteger(s) && s >= 0 && (d = s);
114
+ const r = Number(f);
115
+ Number.isInteger(r) && r >= 0 && (d = r);
113
116
  }
114
117
  return {
115
- status: I.has(n) ? n : "",
116
- kind: M.has(o) ? o : "",
117
- from: m(r) ? r : "",
118
+ status: T.has(n) ? n : "",
119
+ kind: N.has(o) ? o : "",
120
+ from: m(s) ? s : "",
118
121
  to: m(u) ? u : "",
119
122
  q: l,
120
123
  offset: d
121
124
  };
122
125
  }
123
- function st(t) {
126
+ function ut(t) {
124
127
  const e = new URLSearchParams();
125
128
  t.status !== "" && e.set("status", t.status), t.kind !== "" && e.set("kind", t.kind), t.from !== "" && e.set("from", t.from), t.to !== "" && e.set("to", t.to), t.q !== "" && e.set("q", t.q), t.offset > 0 && e.set("offset", String(t.offset));
126
129
  const n = e.toString();
@@ -136,8 +139,8 @@ function k(t, e, n) {
136
139
  const { y: u, m: l, d: f } = h(e.to);
137
140
  o.to = new Date(u, l - 1, f + 1).toISOString();
138
141
  }
139
- const r = e.q.trim();
140
- return r !== "" && (o.q = r), n.paged && (o.limit = String(n.limit ?? q), e.offset > 0 && (o.offset = String(e.offset))), o;
142
+ const s = e.q.trim();
143
+ return s !== "" && (o.q = s), n.paged && (o.limit = String(n.limit ?? q), e.offset > 0 && (o.offset = String(e.offset))), o;
141
144
  }
142
145
  const R = {
143
146
  root: ["history"],
@@ -154,35 +157,35 @@ const R = {
154
157
  return ["history", "detail", t, e];
155
158
  }
156
159
  };
157
- function it(t, e, n, o = q) {
160
+ function at(t, e, n, o = q) {
158
161
  return t.request({
159
162
  method: "GET",
160
163
  path: "/history",
161
164
  query: k(e, n, { paged: !0, limit: o })
162
- }).then((r) => r.body);
165
+ }).then((s) => s.body);
163
166
  }
164
- function ut(t, e, n) {
167
+ function ct(t, e, n) {
165
168
  return t.request({
166
169
  method: "GET",
167
170
  path: "/history/stats",
168
171
  query: k(e, n, { paged: !1 })
169
172
  }).then((o) => o.body.stats);
170
173
  }
171
- async function at(t, e) {
174
+ async function lt(t, e) {
172
175
  if (e.kind === "workflow") {
173
- const r = await t.console.workflows.getRun(e.id);
176
+ const s = await t.console.workflows.getRun(e.id);
174
177
  return {
175
178
  id: e.id,
176
179
  kind: "workflow",
177
180
  callableName: e.callableName,
178
- status: r.status,
181
+ status: s.status,
179
182
  startedAt: e.startedAt,
180
183
  finishedAt: e.finishedAt,
181
184
  durationMs: e.durationMs,
182
- input: r.variables,
183
- output: r.output,
184
- error: r.error,
185
- steps: K(r.steps)
185
+ input: s.variables,
186
+ output: s.output,
187
+ error: s.error,
188
+ steps: Q(E(s))
186
189
  };
187
190
  }
188
191
  const o = (await t.request({
@@ -202,50 +205,50 @@ async function at(t, e) {
202
205
  error: o.error
203
206
  };
204
207
  }
205
- const N = /* @__PURE__ */ new Set(["succeeded", "failed", "canceled"]);
206
- function _(t) {
208
+ const j = /* @__PURE__ */ new Set(["succeeded", "failed", "canceled"]);
209
+ function L(t) {
207
210
  return new Promise((e) => setTimeout(e, t));
208
211
  }
209
- async function j(t, e = _) {
212
+ async function O(t, e = L) {
210
213
  for (let n = 0; n < 600; n++) {
211
214
  const o = await t();
212
- if (N.has(o.status)) return o;
215
+ if (j.has(o.status)) return o;
213
216
  await e(500);
214
217
  }
215
218
  return t();
216
219
  }
217
- const L = (t) => ["workflows", t];
218
- function O(t, e) {
220
+ const P = (t) => ["workflows", t];
221
+ function W(t, e) {
219
222
  return t.workflows.list({ project: e });
220
223
  }
221
- function ct(t, e = !0) {
224
+ function ft(t, e = !0) {
222
225
  const n = i();
223
226
  return y({
224
- queryKey: L(t),
225
- queryFn: () => O(n, t),
227
+ queryKey: P(t),
228
+ queryFn: () => W(n, t),
226
229
  enabled: e
227
230
  });
228
231
  }
229
- const P = (t) => ["workflow", t];
230
- function W(t, e) {
232
+ const U = (t) => ["workflow", t];
233
+ function x(t, e) {
231
234
  return t.workflows.get(e);
232
235
  }
233
- function lt(t, e = !0) {
236
+ function dt(t, e = !0) {
234
237
  const n = i();
235
238
  return y({
236
- queryKey: P(t),
237
- queryFn: () => W(n, t),
239
+ queryKey: U(t),
240
+ queryFn: () => x(n, t),
238
241
  enabled: e
239
242
  });
240
243
  }
241
- function ft(t) {
244
+ function yt(t) {
242
245
  const e = i(), n = c();
243
246
  return a({
244
247
  mutationFn: (o) => t ? e.console.workflows.upsert(o, { project: t }) : Promise.reject(new Error("No project selected yet.")),
245
248
  onSuccess: () => n.invalidateQueries({ queryKey: ["workflows"] })
246
249
  });
247
250
  }
248
- function dt(t) {
251
+ function mt(t) {
249
252
  const e = i(), n = c();
250
253
  return a({
251
254
  mutationFn: (o) => t ? e.console.workflows.upsert(o.definition, {
@@ -255,14 +258,14 @@ function dt(t) {
255
258
  onSuccess: () => n.invalidateQueries({ queryKey: ["workflows"] })
256
259
  });
257
260
  }
258
- function yt() {
261
+ function pt() {
259
262
  const t = i(), e = c();
260
263
  return a({
261
264
  mutationFn: (n) => t.workflows.archive(n),
262
265
  onSuccess: () => e.invalidateQueries({ queryKey: ["workflows"] })
263
266
  });
264
267
  }
265
- function mt() {
268
+ function wt() {
266
269
  const t = i(), e = c();
267
270
  return a({
268
271
  mutationFn: (n) => t.workflows.delete(n),
@@ -270,84 +273,84 @@ function mt() {
270
273
  });
271
274
  }
272
275
  const S = (t) => ["runs", t];
273
- function pt(t) {
276
+ function ht(t) {
274
277
  const e = i();
275
278
  return y({
276
279
  queryKey: S(t),
277
280
  queryFn: () => e.console.workflows.listRuns(t)
278
281
  });
279
282
  }
280
- function U(t, e, n, o) {
281
- return t.workflows.run(e, { variables: n, input: o, allowUnpublished: !0 }).then((r) => j(() => t.console.workflows.getRun(r.runId)));
283
+ function H(t, e, n, o) {
284
+ return t.workflows.run(e, { variables: n, input: o, allowUnpublished: !0 }).then((s) => O(() => t.console.workflows.getRun(s.runId)));
282
285
  }
283
- function wt() {
286
+ function St() {
284
287
  const t = i(), e = c();
285
288
  return a({
286
- mutationFn: (n) => U(t, n.id, n.variables, n.input),
289
+ mutationFn: (n) => H(t, n.id, n.variables, n.input),
287
290
  onSuccess: (n, o) => e.invalidateQueries({ queryKey: S(o.id) }),
288
291
  onSettled: () => e.invalidateQueries({ queryKey: R.root })
289
292
  });
290
293
  }
291
- function ht(t, e, n, o) {
294
+ function gt(t, e, n, o) {
292
295
  return t.workflows.run(e, { variables: n, input: o, wait: !0 });
293
296
  }
294
- function x(t, e, n, o) {
295
- return t.workflows.run(e, { variables: n, input: o, allowUnpublished: !0 }).then((r) => ({ runId: r.runId }));
297
+ function G(t, e, n, o) {
298
+ return t.workflows.run(e, { variables: n, input: o, allowUnpublished: !0 }).then((s) => ({ runId: s.runId }));
296
299
  }
297
- function St() {
300
+ function qt() {
298
301
  const t = i(), e = c();
299
302
  return a({
300
- mutationFn: (n) => x(t, n.id, n.variables, n.input),
303
+ mutationFn: (n) => G(t, n.id, n.variables, n.input),
301
304
  onSuccess: (n, o) => e.invalidateQueries({ queryKey: S(o.id) }),
302
305
  onSettled: () => e.invalidateQueries({ queryKey: R.root })
303
306
  });
304
307
  }
305
- function H(t, e) {
308
+ function Y(t, e) {
306
309
  return t.workflows.cancel(e);
307
310
  }
308
- function gt() {
311
+ function kt() {
309
312
  const t = i();
310
313
  return a({
311
- mutationFn: (e) => H(t, e)
314
+ mutationFn: (e) => Y(t, e)
312
315
  });
313
316
  }
314
- function G(t, e) {
317
+ function $(t, e) {
315
318
  return t.console.workflows.getRun(e);
316
319
  }
317
- const Y = (t) => ["run", t];
318
- function qt(t) {
320
+ const J = (t) => ["run", t];
321
+ function Rt(t) {
319
322
  const e = i();
320
323
  return y({
321
- queryKey: Y(t ?? ""),
322
- queryFn: () => G(e, t),
324
+ queryKey: J(t ?? ""),
325
+ queryFn: () => $(e, t),
323
326
  enabled: t != null,
324
327
  refetchInterval: (n) => {
325
328
  var o;
326
- return E((o = n.state.data) == null ? void 0 : o.status) ? 500 : !1;
329
+ return K((o = n.state.data) == null ? void 0 : o.status) ? 500 : !1;
327
330
  }
328
331
  });
329
332
  }
330
- function kt(t) {
333
+ function vt(t) {
331
334
  return t.shared ? t.sourceRepo == null ? "pending" : "synced" : "private";
332
335
  }
333
- function $(t) {
336
+ function V(t) {
334
337
  return ["documents", t];
335
338
  }
336
- function J(t, e) {
339
+ function z(t, e) {
337
340
  return ["documents", "detail", t, e];
338
341
  }
339
- function Rt(t, e, n = !0) {
342
+ function bt(t, e, n = !0) {
340
343
  const o = i();
341
344
  return y({
342
- queryKey: J(t, e),
345
+ queryKey: z(t, e),
343
346
  queryFn: async () => await o.documents.get(t, { project: e }),
344
347
  enabled: n
345
348
  });
346
349
  }
347
- function vt(t, e = !0) {
350
+ function Ct(t, e = !0) {
348
351
  const n = i();
349
352
  return y({
350
- queryKey: $(t),
353
+ queryKey: V(t),
351
354
  // Cast to DocWithProvenance[], same as useDocumentQuery above: the wire
352
355
  // response already carries `shared`/`source*`/`syncedAt` (repo.list()
353
356
  // serializes every document the same way repo.get() does), but the SDK's
@@ -358,45 +361,45 @@ function vt(t, e = !0) {
358
361
  enabled: e
359
362
  });
360
363
  }
361
- function bt() {
364
+ function Et() {
362
365
  const t = i(), e = c();
363
366
  return a({
364
367
  mutationFn: (n) => t.documents.create(n.input, { project: n.project }),
365
368
  onSuccess: () => e.invalidateQueries({ queryKey: ["documents"] })
366
369
  });
367
370
  }
368
- function Ct() {
371
+ function At() {
369
372
  const t = i(), e = c();
370
373
  return a({
371
374
  mutationFn: (n) => t.documents.update(n.id, n.patch, { project: n.project }),
372
375
  onSuccess: () => e.invalidateQueries({ queryKey: ["documents"] })
373
376
  });
374
377
  }
375
- function Et() {
378
+ function Kt() {
376
379
  const t = i(), e = c();
377
380
  return a({
378
381
  mutationFn: (n) => t.documents.delete(n.id, { project: n.project }),
379
382
  onSuccess: () => e.invalidateQueries({ queryKey: ["documents"] })
380
383
  });
381
384
  }
382
- function At() {
385
+ function Ft() {
383
386
  const t = i(), e = c();
384
387
  return a({
385
388
  mutationFn: (n) => t.request({
386
389
  method: "POST",
387
- path: v`/documents/${n.id}/sync`,
390
+ path: b`/documents/${n.id}/sync`,
388
391
  query: { project: n.project }
389
392
  }),
390
393
  onSuccess: () => e.invalidateQueries({ queryKey: ["documents"] })
391
394
  });
392
395
  }
393
- function Kt(t, e) {
396
+ function Qt(t, e) {
394
397
  const n = i(), o = c();
395
398
  return a({
396
- mutationFn: async (r) => (await n.request({
399
+ mutationFn: async (s) => (await n.request({
397
400
  method: "POST",
398
401
  path: "/spec/import",
399
- body: r
402
+ body: s
400
403
  })).body,
401
404
  // A row exists in every `201` outcome (T2.1.2 §E creates it even when
402
405
  // some references stayed unresolved), so the list is stale either way —
@@ -404,62 +407,63 @@ function Kt(t, e) {
404
407
  // unconditional `functionsKey` this used to invalidate left an imported
405
408
  // Endpoint or Workflow's own list stale while pointlessly invalidating
406
409
  // Functions.
407
- onSuccess: (r) => b(o, r.kind, e, t)
410
+ onSuccess: (s) => C(o, s.kind, e, t)
408
411
  });
409
412
  }
410
413
  export {
411
- E as A,
412
- x as B,
413
- w as C,
414
- yt as D,
415
- ot as E,
416
- gt as F,
417
- bt as G,
414
+ P as $,
415
+ J as A,
416
+ H as B,
417
+ gt as C,
418
+ S as D,
419
+ st as E,
420
+ K as F,
421
+ G,
418
422
  q as H,
419
- ft as I,
420
- Et as J,
421
- mt as K,
422
- Rt as L,
423
- vt as M,
424
- Kt as N,
425
- qt as O,
426
- wt as P,
427
- pt as Q,
428
- C as R,
423
+ w as I,
424
+ pt as J,
425
+ kt as K,
426
+ yt as L,
427
+ Kt as M,
428
+ wt as N,
429
+ bt as O,
430
+ Ct as P,
431
+ Rt as Q,
432
+ A as R,
429
433
  p as S,
430
- dt as T,
431
- St as U,
432
- At as V,
433
- Ct as W,
434
- lt as X,
435
- ct as Y,
436
- P as Z,
437
- L as _,
438
- tt as a,
439
- kt as b,
440
- H as c,
441
- J as d,
442
- $ as e,
443
- rt as f,
444
- st as g,
445
- at as h,
446
- it as i,
447
- ut as j,
448
- G as k,
449
- W as l,
450
- R as m,
451
- k as n,
452
- A as o,
453
- D as p,
454
- O as q,
455
- K as r,
456
- j as s,
457
- nt as t,
458
- X as u,
459
- et as v,
460
- Y as w,
461
- U as x,
462
- ht as y,
463
- S as z
434
+ St as T,
435
+ ht as U,
436
+ mt as V,
437
+ qt as W,
438
+ Ft as X,
439
+ dt as Y,
440
+ ft as Z,
441
+ U as _,
442
+ At as a,
443
+ Qt as b,
444
+ Y as c,
445
+ nt as d,
446
+ z as e,
447
+ vt as f,
448
+ V as g,
449
+ it as h,
450
+ ut as i,
451
+ lt as j,
452
+ at as k,
453
+ ct as l,
454
+ $ as m,
455
+ x as n,
456
+ R as o,
457
+ k as p,
458
+ F as q,
459
+ I as r,
460
+ W as s,
461
+ Q as t,
462
+ Et as u,
463
+ O as v,
464
+ rt as w,
465
+ et as x,
466
+ ot as y,
467
+ E as z
464
468
  };
465
- //# sourceMappingURL=spec-import-CjmxyZDR.js.map
469
+ //# sourceMappingURL=spec-import-CW6R_Wk1.js.map