@burdenoff/microfe-bigconsole 2026.1119.3 → 2026.1119.5

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 (31) hide show
  1. package/dist/bigconsole/components/dashboard/PublishToStoreDialog.js +126 -80
  2. package/dist/bigconsole/components/parser/ParserSelector.js +150 -145
  3. package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +50 -49
  4. package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +223 -201
  5. package/dist/bigconsole/customWidget/index.d.ts +2 -1
  6. package/dist/bigconsole/customWidget/index.js +1 -0
  7. package/dist/bigconsole/customWidget/proposalContract.d.ts +55 -1
  8. package/dist/bigconsole/customWidget/proposalContract.js +37 -14
  9. package/dist/bigconsole/customWidget/proposalPreviewData.d.ts +18 -0
  10. package/dist/bigconsole/customWidget/proposalPreviewData.js +70 -0
  11. package/dist/bigconsole/customWidget/proposalSource.d.ts +10 -0
  12. package/dist/bigconsole/customWidget/proposalSource.js +197 -51
  13. package/dist/bigconsole/graphql/storeTemplates.d.ts +1 -1
  14. package/dist/bigconsole/graphql/storeTemplates.js +5 -5
  15. package/dist/bigconsole/hooks/useParserOperations.js +80 -74
  16. package/dist/bigconsole/hooks/usePublishOwnerOptions.d.ts +10 -0
  17. package/dist/bigconsole/hooks/usePublishOwnerOptions.js +48 -0
  18. package/dist/bigconsole/hooks/useStoreDashboardTemplates.d.ts +8 -0
  19. package/dist/bigconsole/hooks/useStoreDashboardTemplates.js +3 -1
  20. package/dist/bigconsole/pages/ParserBuilderPage.js +540 -518
  21. package/dist/bigconsole/store/parserScope.d.ts +24 -0
  22. package/dist/bigconsole/store/parserScope.js +17 -0
  23. package/dist/bigconsole/store/parserStore.d.ts +3 -0
  24. package/dist/bigconsole/store/parserStore.js +70 -68
  25. package/dist/bigconsole/utils/publishOwner.d.ts +100 -0
  26. package/dist/bigconsole/utils/publishOwner.js +71 -0
  27. package/dist/generated/global-operations.d.ts +19 -0
  28. package/dist/generated/global-operations.js +80 -1
  29. package/dist/generated/wspace-operations.d.ts +10 -0
  30. package/dist/generated/wspace-operations.js +180 -110
  31. package/package.json +1 -1
@@ -1,98 +1,104 @@
1
1
  import { useParserStore as e } from "../store/parserStore.js";
2
- import { CreateParserDocument as t, DeleteParserDocument as n, ExecuteParserDocument as r, GetParserDocument as i, ListParsersDocument as a, TestParserExpressionDocument as o, UpdateParserDocument as s } from "../../generated/wspace-operations.js";
3
- import { useCallback as c, useEffect as l, useMemo as u, useState as d } from "react";
4
- import { useApolloClient as f } from "@apollo/client/react";
2
+ import { selectParsersInScope as t } from "../store/parserScope.js";
3
+ import { CreateParserDocument as n, DeleteParserDocument as r, ExecuteParserDocument as i, GetParserDocument as a, ListParsersDocument as o, TestParserExpressionDocument as s, UpdateParserDocument as c } from "../../generated/wspace-operations.js";
4
+ import { useCallback as l, useEffect as u, useMemo as d, useState as f } from "react";
5
+ import { useApolloClient as p } from "@apollo/client/react";
5
6
  // src/bigconsole/hooks/useParserOperations.ts
6
- function p(p = {}) {
7
- let { consoleId: m, skipFetch: h = !1 } = p, [g, _] = d(!1), [v, y] = d(null), b = f(), x = e((e) => e.parsers), S = e((e) => e.setParsers), C = e((e) => e.addParser), w = e((e) => e.updateParser), T = e((e) => e.removeParser), E = e((e) => e.setParserTesting), D = u(() => Array.from(x.values()), [x]), O = c(async (e) => {
8
- if (!m) return [];
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 ? {
9
+ kind: "console",
10
+ consoleId: h
11
+ } : null, [h]), A = d(() => k ? t(S, k) : [], [S, k]), j = l(async (e) => {
12
+ if (!k || !h) return [];
9
13
  try {
10
- _(!0), y(null);
11
- let t = ((await b.query({
12
- query: a,
14
+ v(!0), b(null);
15
+ let t = ((await x.query({
16
+ query: o,
13
17
  variables: {
14
- consoleId: m,
18
+ consoleId: h,
15
19
  type: e?.type,
16
20
  status: e?.status,
17
21
  first: 100
18
22
  },
19
23
  fetchPolicy: "network-only"
20
24
  })).data?.listParsers?.edges || []).map((e) => e.node);
21
- return S(t), t;
25
+ return e?.type || e?.status ? C(t) : w(k, t), t;
22
26
  } catch (e) {
23
27
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to fetch parsers");
24
- return y(t), [];
28
+ return b(t), [];
25
29
  } finally {
26
- _(!1);
30
+ v(!1);
27
31
  }
28
32
  }, [
29
- b,
30
- m,
31
- S
32
- ]), k = c(async (e) => {
33
+ x,
34
+ h,
35
+ k,
36
+ C,
37
+ w
38
+ ]), M = l(async (e) => {
33
39
  try {
34
- _(!0), y(null);
35
- let t = (await b.query({
36
- query: i,
40
+ v(!0), b(null);
41
+ let t = (await x.query({
42
+ query: a,
37
43
  variables: { id: e },
38
44
  fetchPolicy: "network-only"
39
45
  })).data?.parser;
40
- return t ? (C(t), t) : null;
46
+ return t ? (T(t), t) : null;
41
47
  } catch (e) {
42
48
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to fetch parser");
43
- return y(t), null;
49
+ return b(t), null;
44
50
  } finally {
45
- _(!1);
51
+ v(!1);
46
52
  }
47
- }, [b, C]), A = c(async (e) => {
53
+ }, [x, T]), N = l(async (e) => {
48
54
  try {
49
- _(!0), y(null);
50
- let n = (await b.mutate({
51
- mutation: t,
55
+ v(!0), b(null);
56
+ let t = (await x.mutate({
57
+ mutation: n,
52
58
  variables: { input: e }
53
59
  })).data?.createParser;
54
- return n ? (C(n), n) : null;
60
+ return t ? (T(t), t) : null;
55
61
  } catch (e) {
56
62
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to create parser");
57
- return y(t), null;
63
+ return b(t), null;
58
64
  } finally {
59
- _(!1);
65
+ v(!1);
60
66
  }
61
- }, [b, C]), j = c(async (e, t, n) => {
67
+ }, [x, T]), P = l(async (e, t, n) => {
62
68
  try {
63
- _(!0), y(null);
64
- let r = (await b.mutate({
65
- mutation: s,
69
+ v(!0), b(null);
70
+ let r = (await x.mutate({
71
+ mutation: c,
66
72
  variables: {
67
73
  id: e,
68
74
  input: t,
69
75
  version: n
70
76
  }
71
77
  })).data?.updateParser;
72
- return r ? (w(e, r), r) : null;
78
+ return r ? (E(e, r), r) : null;
73
79
  } catch (e) {
74
80
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to update parser");
75
- return y(t), null;
81
+ return b(t), null;
76
82
  } finally {
77
- _(!1);
83
+ v(!1);
78
84
  }
79
- }, [b, w]), M = c(async (e) => {
85
+ }, [x, E]), F = l(async (e) => {
80
86
  try {
81
- return _(!0), y(null), await b.mutate({
82
- mutation: n,
87
+ return v(!0), b(null), await x.mutate({
88
+ mutation: r,
83
89
  variables: { id: e }
84
- }), T(e), !0;
90
+ }), D(e), !0;
85
91
  } catch (e) {
86
92
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to delete parser");
87
- return y(t), !1;
93
+ return b(t), !1;
88
94
  } finally {
89
- _(!1);
95
+ v(!1);
90
96
  }
91
- }, [b, T]), N = c(async (e) => {
97
+ }, [x, D]), I = l(async (e) => {
92
98
  try {
93
- _(!0), y(null), E(e, !0);
94
- let t = (await b.mutate({
95
- mutation: r,
99
+ v(!0), b(null), O(e, !0);
100
+ let t = (await x.mutate({
101
+ mutation: i,
96
102
  variables: { id: e }
97
103
  })).data?.executeParser;
98
104
  return t ? {
@@ -105,15 +111,15 @@ function p(p = {}) {
105
111
  } : null;
106
112
  } catch (e) {
107
113
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to execute parser");
108
- return y(t), null;
114
+ return b(t), null;
109
115
  } finally {
110
- _(!1), E(e, !1);
116
+ v(!1), O(e, !1);
111
117
  }
112
- }, [b, E]), P = c(async (e) => {
118
+ }, [x, O]), L = l(async (e) => {
113
119
  try {
114
- _(!0), y(null);
115
- let t = (await b.query({
116
- query: o,
120
+ v(!0), b(null);
121
+ let t = (await x.query({
122
+ query: s,
117
123
  variables: { input: e },
118
124
  fetchPolicy: "network-only"
119
125
  })).data?.testParserExpression;
@@ -128,31 +134,31 @@ function p(p = {}) {
128
134
  } : null;
129
135
  } catch (e) {
130
136
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to test expression");
131
- return y(t), null;
137
+ return b(t), null;
132
138
  } finally {
133
- _(!1);
139
+ v(!1);
134
140
  }
135
- }, [b]), F = c(async () => {
136
- await O();
137
- }, [O]);
138
- return l(() => {
139
- m && !h && O();
141
+ }, [x]), R = l(async () => {
142
+ await j();
143
+ }, [j]);
144
+ return u(() => {
145
+ h && !g && j();
140
146
  }, [
141
- m,
142
147
  h,
143
- O
148
+ g,
149
+ j
144
150
  ]), {
145
- loading: g,
146
- error: v,
147
- parsers: D,
148
- fetchParsers: O,
149
- fetchParser: k,
150
- createParser: A,
151
- updateParser: j,
152
- deleteParser: M,
153
- executeParser: N,
154
- testParserExpression: P,
155
- refetch: F
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
156
162
  };
157
163
  }
158
- export { p as default, p as useParserOperations };
164
+ export { m as default, m as useParserOperations };
@@ -0,0 +1,10 @@
1
+ import { PublishOwnerOption } from '../utils/publishOwner';
2
+ export interface UsePublishOwnerOptionsResult {
3
+ options: PublishOwnerOption[];
4
+ /** Owner to preselect; null means Personal. */
5
+ defaultOrganizationId: string | null;
6
+ loading: boolean;
7
+ /** Set when the organizations could not be loaded; Personal stays available. */
8
+ error: string | null;
9
+ }
10
+ export declare function usePublishOwnerOptions(enabled: boolean): UsePublishOwnerOptionsResult;
@@ -0,0 +1,48 @@
1
+ import { useBigConsole as e } from "../context/BigConsoleContext.js";
2
+ import { GetPublishOwnerOrganizationsDocument as t } from "../../generated/global-operations.js";
3
+ import "../graphql/storeTemplates.js";
4
+ import { buildPublishOwnerOptions as n, loadPublishOwnerOrganizations as r, readDevportalActiveOrg as i, resolveDefaultPublishOwner as a } from "../utils/publishOwner.js";
5
+ import { useEffect as o, useMemo as s, useState as c } from "react";
6
+ import { graphqlFetch as l } from "@burdenoff/fe-libs/shared/graphql";
7
+ import { print as u } from "graphql";
8
+ // src/bigconsole/hooks/usePublishOwnerOptions.ts
9
+ var d = "GetPublishOwnerOrganizations", f = u(t);
10
+ function p() {
11
+ try {
12
+ return typeof window > "u" ? null : window.localStorage;
13
+ } catch {
14
+ return null;
15
+ }
16
+ }
17
+ function m(t) {
18
+ let { currentUser: u } = e(), m = u?.id ?? null, [h, g] = c(null), [_, v] = c(!1);
19
+ return o(() => {
20
+ if (!t) return;
21
+ let e = new AbortController();
22
+ return g(null), v(!0), r(() => l({
23
+ gateway: "global",
24
+ query: f,
25
+ operationName: d,
26
+ responseCache: "reload",
27
+ signal: e.signal,
28
+ suppressGlobalErrorEvent: !0
29
+ })).then((t) => {
30
+ e.signal.aborted || (g(t), v(!1));
31
+ }), () => {
32
+ e.abort(), v(!1);
33
+ };
34
+ }, [t]), s(() => {
35
+ let e = n(h?.orgs ?? [], m);
36
+ return {
37
+ options: e,
38
+ defaultOrganizationId: a(e, i(p())),
39
+ loading: _,
40
+ error: h?.error ?? null
41
+ };
42
+ }, [
43
+ h,
44
+ _,
45
+ m
46
+ ]);
47
+ }
48
+ export { m as usePublishOwnerOptions };
@@ -90,12 +90,20 @@ export interface PublishToStoreArgs {
90
90
  tags?: string[];
91
91
  /** Embed a few real rows per data source so the board renders populated. */
92
92
  includeSampleData?: boolean;
93
+ /**
94
+ * Developer organization that owns the draft. Omitted/null creates a
95
+ * personally owned draft, which the Developer Portal lists under its
96
+ * "Personal" scope rather than under any organization (BOFF-10779).
97
+ */
98
+ developerOrganizationId?: string | null;
93
99
  }
94
100
  export interface PublishToStoreResult {
95
101
  success: boolean;
96
102
  /** The DRAFT devportal application created for this template. */
97
103
  applicationId?: string;
98
104
  status?: string;
105
+ /** Organization the draft was created under; null when personally owned. */
106
+ developerOrganizationId?: string | null;
99
107
  errorMessage?: string;
100
108
  /** Distinct data sinks the dashboard referenced, all tokenised into slots. */
101
109
  sinkCount: number;
@@ -154,7 +154,8 @@ function g(g = {}) {
154
154
  description: e.description,
155
155
  ...e.category ? { category: e.category } : {},
156
156
  tags: e.tags ?? [],
157
- compatibleProducts: ["bigconsole"]
157
+ compatibleProducts: ["bigconsole"],
158
+ ...e.developerOrganizationId ? { developerOrganizationId: e.developerOrganizationId } : {}
158
159
  } }
159
160
  })).data?.createApplication;
160
161
  return o ? (await b.mutate({
@@ -170,6 +171,7 @@ function g(g = {}) {
170
171
  success: !0,
171
172
  applicationId: o.id,
172
173
  status: o.status,
174
+ developerOrganizationId: e.developerOrganizationId ?? null,
173
175
  sinkCount: a,
174
176
  unknownSinkIds: s,
175
177
  sampleDataSinkCount: c