@burdenoff/microfe-bigconsole 2026.1119.8 → 2026.1119.9

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.
@@ -5,69 +5,68 @@ import { useCallback as l, useEffect as u, useMemo as d, useState as f } from "r
5
5
  import { useApolloClient as p } from "@apollo/client/react";
6
6
  // src/bigconsole/hooks/useParserOperations.ts
7
7
  function m(m = {}) {
8
- let { consoleId: h, skipFetch: g = !1 } = m, [_, v] = f(!1), [y, b] = f(null), x = p(), S = e((e) => e.parsers), C = e((e) => e.setParsers), w = e((e) => e.replaceParsersInScope), T = e((e) => e.addParser), E = e((e) => e.updateParser), D = e((e) => e.removeParser), O = e((e) => e.setParserTesting), k = d(() => h ? {
8
+ let { consoleId: h, allScopes: g = !1, skipFetch: _ = !1 } = m, [v, y] = f(!1), [b, x] = f(null), S = p(), C = e((e) => e.parsers), w = e((e) => e.setParsers), T = e((e) => e.replaceParsersInScope), E = e((e) => e.addParser), D = e((e) => e.updateParser), O = e((e) => e.removeParser), k = e((e) => e.setParserTesting), A = d(() => g ? { kind: "all" } : h ? {
9
9
  kind: "console",
10
10
  consoleId: h
11
- } : null, [h]), A = d(() => k ? t(S, k) : [], [S, k]), j = l(async (e) => {
12
- if (!k || !h) return [];
11
+ } : null, [g, h]), j = d(() => A ? t(C, A) : [], [C, A]), M = l(async (e) => {
12
+ if (!A) return [];
13
13
  try {
14
- v(!0), b(null);
15
- let t = ((await x.query({
14
+ y(!0), x(null);
15
+ let t = ((await S.query({
16
16
  query: o,
17
17
  variables: {
18
- consoleId: h,
18
+ ...A.kind === "all" ? { scope: "ALL" } : { consoleId: A.consoleId },
19
19
  type: e?.type,
20
20
  status: e?.status,
21
21
  first: 100
22
22
  },
23
23
  fetchPolicy: "network-only"
24
24
  })).data?.listParsers?.edges || []).map((e) => e.node);
25
- return e?.type || e?.status ? C(t) : w(k, t), t;
25
+ return e?.type || e?.status ? w(t) : T(A, t), t;
26
26
  } catch (e) {
27
27
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to fetch parsers");
28
- return b(t), [];
28
+ return x(t), [];
29
29
  } finally {
30
- v(!1);
30
+ y(!1);
31
31
  }
32
32
  }, [
33
- x,
34
- h,
35
- k,
36
- C,
37
- w
38
- ]), M = l(async (e) => {
33
+ S,
34
+ A,
35
+ w,
36
+ T
37
+ ]), N = l(async (e) => {
39
38
  try {
40
- v(!0), b(null);
41
- let t = (await x.query({
39
+ y(!0), x(null);
40
+ let t = (await S.query({
42
41
  query: a,
43
42
  variables: { id: e },
44
43
  fetchPolicy: "network-only"
45
44
  })).data?.parser;
46
- return t ? (T(t), t) : null;
45
+ return t ? (E(t), t) : null;
47
46
  } catch (e) {
48
47
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to fetch parser");
49
- return b(t), null;
48
+ return x(t), null;
50
49
  } finally {
51
- v(!1);
50
+ y(!1);
52
51
  }
53
- }, [x, T]), N = l(async (e) => {
52
+ }, [S, E]), P = l(async (e) => {
54
53
  try {
55
- v(!0), b(null);
56
- let t = (await x.mutate({
54
+ y(!0), x(null);
55
+ let t = (await S.mutate({
57
56
  mutation: n,
58
57
  variables: { input: e }
59
58
  })).data?.createParser;
60
- return t ? (T(t), t) : null;
59
+ return t ? (E(t), t) : null;
61
60
  } catch (e) {
62
61
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to create parser");
63
- return b(t), null;
62
+ return x(t), null;
64
63
  } finally {
65
- v(!1);
64
+ y(!1);
66
65
  }
67
- }, [x, T]), P = l(async (e, t, n) => {
66
+ }, [S, E]), F = l(async (e, t, n) => {
68
67
  try {
69
- v(!0), b(null);
70
- let r = (await x.mutate({
68
+ y(!0), x(null);
69
+ let r = (await S.mutate({
71
70
  mutation: c,
72
71
  variables: {
73
72
  id: e,
@@ -75,29 +74,29 @@ function m(m = {}) {
75
74
  version: n
76
75
  }
77
76
  })).data?.updateParser;
78
- return r ? (E(e, r), r) : null;
77
+ return r ? (D(e, r), r) : null;
79
78
  } catch (e) {
80
79
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to update parser");
81
- return b(t), null;
80
+ return x(t), null;
82
81
  } finally {
83
- v(!1);
82
+ y(!1);
84
83
  }
85
- }, [x, E]), F = l(async (e) => {
84
+ }, [S, D]), I = l(async (e) => {
86
85
  try {
87
- return v(!0), b(null), await x.mutate({
86
+ return y(!0), x(null), await S.mutate({
88
87
  mutation: r,
89
88
  variables: { id: e }
90
- }), D(e), !0;
89
+ }), O(e), !0;
91
90
  } catch (e) {
92
91
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to delete parser");
93
- return b(t), !1;
92
+ return x(t), !1;
94
93
  } finally {
95
- v(!1);
94
+ y(!1);
96
95
  }
97
- }, [x, D]), I = l(async (e) => {
96
+ }, [S, O]), L = l(async (e) => {
98
97
  try {
99
- v(!0), b(null), O(e, !0);
100
- let t = (await x.mutate({
98
+ y(!0), x(null), k(e, !0);
99
+ let t = (await S.mutate({
101
100
  mutation: i,
102
101
  variables: { id: e }
103
102
  })).data?.executeParser;
@@ -111,14 +110,14 @@ function m(m = {}) {
111
110
  } : null;
112
111
  } catch (e) {
113
112
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to execute parser");
114
- return b(t), null;
113
+ return x(t), null;
115
114
  } finally {
116
- v(!1), O(e, !1);
115
+ y(!1), k(e, !1);
117
116
  }
118
- }, [x, O]), L = l(async (e) => {
117
+ }, [S, k]), R = l(async (e) => {
119
118
  try {
120
- v(!0), b(null);
121
- let t = (await x.query({
119
+ y(!0), x(null);
120
+ let t = (await S.query({
122
121
  query: s,
123
122
  variables: { input: e },
124
123
  fetchPolicy: "network-only"
@@ -134,31 +133,31 @@ function m(m = {}) {
134
133
  } : null;
135
134
  } catch (e) {
136
135
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to test expression");
137
- return b(t), null;
136
+ return x(t), null;
138
137
  } finally {
139
- v(!1);
138
+ y(!1);
140
139
  }
141
- }, [x]), R = l(async () => {
142
- await j();
143
- }, [j]);
140
+ }, [S]), z = l(async () => {
141
+ await M();
142
+ }, [M]);
144
143
  return u(() => {
145
- h && !g && j();
144
+ A && !_ && M();
146
145
  }, [
147
- h,
148
- g,
149
- j
146
+ A,
147
+ _,
148
+ M
150
149
  ]), {
151
- loading: _,
152
- error: y,
153
- parsers: A,
154
- fetchParsers: j,
155
- fetchParser: M,
156
- createParser: N,
157
- updateParser: P,
158
- deleteParser: F,
159
- executeParser: I,
160
- testParserExpression: L,
161
- refetch: R
150
+ loading: v,
151
+ error: b,
152
+ parsers: j,
153
+ fetchParsers: M,
154
+ fetchParser: N,
155
+ createParser: P,
156
+ updateParser: F,
157
+ deleteParser: I,
158
+ executeParser: L,
159
+ testParserExpression: R,
160
+ refetch: z
162
161
  };
163
162
  }
164
163
  export { m as default, m as useParserOperations };