@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.
- package/dist/bigconsole/components/dashboard/PublishToStoreDialog.js +126 -80
- package/dist/bigconsole/components/parser/ParserSelector.js +150 -145
- package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +50 -49
- package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +223 -201
- package/dist/bigconsole/customWidget/index.d.ts +2 -1
- package/dist/bigconsole/customWidget/index.js +1 -0
- package/dist/bigconsole/customWidget/proposalContract.d.ts +55 -1
- package/dist/bigconsole/customWidget/proposalContract.js +37 -14
- package/dist/bigconsole/customWidget/proposalPreviewData.d.ts +18 -0
- package/dist/bigconsole/customWidget/proposalPreviewData.js +70 -0
- package/dist/bigconsole/customWidget/proposalSource.d.ts +10 -0
- package/dist/bigconsole/customWidget/proposalSource.js +197 -51
- package/dist/bigconsole/graphql/storeTemplates.d.ts +1 -1
- package/dist/bigconsole/graphql/storeTemplates.js +5 -5
- package/dist/bigconsole/hooks/useParserOperations.js +80 -74
- package/dist/bigconsole/hooks/usePublishOwnerOptions.d.ts +10 -0
- package/dist/bigconsole/hooks/usePublishOwnerOptions.js +48 -0
- package/dist/bigconsole/hooks/useStoreDashboardTemplates.d.ts +8 -0
- package/dist/bigconsole/hooks/useStoreDashboardTemplates.js +3 -1
- package/dist/bigconsole/pages/ParserBuilderPage.js +540 -518
- package/dist/bigconsole/store/parserScope.d.ts +24 -0
- package/dist/bigconsole/store/parserScope.js +17 -0
- package/dist/bigconsole/store/parserStore.d.ts +3 -0
- package/dist/bigconsole/store/parserStore.js +70 -68
- package/dist/bigconsole/utils/publishOwner.d.ts +100 -0
- package/dist/bigconsole/utils/publishOwner.js +71 -0
- package/dist/generated/global-operations.d.ts +19 -0
- package/dist/generated/global-operations.js +80 -1
- package/dist/generated/wspace-operations.d.ts +10 -0
- package/dist/generated/wspace-operations.js +180 -110
- package/package.json +1 -1
|
@@ -1,98 +1,104 @@
|
|
|
1
1
|
import { useParserStore as e } from "../store/parserStore.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
|
7
|
-
let { consoleId:
|
|
8
|
-
|
|
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
|
-
|
|
11
|
-
let t = ((await
|
|
12
|
-
query:
|
|
14
|
+
v(!0), b(null);
|
|
15
|
+
let t = ((await x.query({
|
|
16
|
+
query: o,
|
|
13
17
|
variables: {
|
|
14
|
-
consoleId:
|
|
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
|
|
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
|
|
28
|
+
return b(t), [];
|
|
25
29
|
} finally {
|
|
26
|
-
|
|
30
|
+
v(!1);
|
|
27
31
|
}
|
|
28
32
|
}, [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
x,
|
|
34
|
+
h,
|
|
35
|
+
k,
|
|
36
|
+
C,
|
|
37
|
+
w
|
|
38
|
+
]), M = l(async (e) => {
|
|
33
39
|
try {
|
|
34
|
-
|
|
35
|
-
let t = (await
|
|
36
|
-
query:
|
|
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 ? (
|
|
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
|
|
49
|
+
return b(t), null;
|
|
44
50
|
} finally {
|
|
45
|
-
|
|
51
|
+
v(!1);
|
|
46
52
|
}
|
|
47
|
-
}, [
|
|
53
|
+
}, [x, T]), N = l(async (e) => {
|
|
48
54
|
try {
|
|
49
|
-
|
|
50
|
-
let
|
|
51
|
-
mutation:
|
|
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
|
|
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
|
|
63
|
+
return b(t), null;
|
|
58
64
|
} finally {
|
|
59
|
-
|
|
65
|
+
v(!1);
|
|
60
66
|
}
|
|
61
|
-
}, [
|
|
67
|
+
}, [x, T]), P = l(async (e, t, n) => {
|
|
62
68
|
try {
|
|
63
|
-
|
|
64
|
-
let r = (await
|
|
65
|
-
mutation:
|
|
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 ? (
|
|
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
|
|
81
|
+
return b(t), null;
|
|
76
82
|
} finally {
|
|
77
|
-
|
|
83
|
+
v(!1);
|
|
78
84
|
}
|
|
79
|
-
}, [
|
|
85
|
+
}, [x, E]), F = l(async (e) => {
|
|
80
86
|
try {
|
|
81
|
-
return
|
|
82
|
-
mutation:
|
|
87
|
+
return v(!0), b(null), await x.mutate({
|
|
88
|
+
mutation: r,
|
|
83
89
|
variables: { id: e }
|
|
84
|
-
}),
|
|
90
|
+
}), D(e), !0;
|
|
85
91
|
} catch (e) {
|
|
86
92
|
let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to delete parser");
|
|
87
|
-
return
|
|
93
|
+
return b(t), !1;
|
|
88
94
|
} finally {
|
|
89
|
-
|
|
95
|
+
v(!1);
|
|
90
96
|
}
|
|
91
|
-
}, [
|
|
97
|
+
}, [x, D]), I = l(async (e) => {
|
|
92
98
|
try {
|
|
93
|
-
|
|
94
|
-
let t = (await
|
|
95
|
-
mutation:
|
|
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
|
|
114
|
+
return b(t), null;
|
|
109
115
|
} finally {
|
|
110
|
-
|
|
116
|
+
v(!1), O(e, !1);
|
|
111
117
|
}
|
|
112
|
-
}, [
|
|
118
|
+
}, [x, O]), L = l(async (e) => {
|
|
113
119
|
try {
|
|
114
|
-
|
|
115
|
-
let t = (await
|
|
116
|
-
query:
|
|
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
|
|
137
|
+
return b(t), null;
|
|
132
138
|
} finally {
|
|
133
|
-
|
|
139
|
+
v(!1);
|
|
134
140
|
}
|
|
135
|
-
}, [
|
|
136
|
-
await
|
|
137
|
-
}, [
|
|
138
|
-
return
|
|
139
|
-
|
|
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
|
-
|
|
148
|
+
g,
|
|
149
|
+
j
|
|
144
150
|
]), {
|
|
145
|
-
loading:
|
|
146
|
-
error:
|
|
147
|
-
parsers:
|
|
148
|
-
fetchParsers:
|
|
149
|
-
fetchParser:
|
|
150
|
-
createParser:
|
|
151
|
-
updateParser:
|
|
152
|
-
deleteParser:
|
|
153
|
-
executeParser:
|
|
154
|
-
testParserExpression:
|
|
155
|
-
refetch:
|
|
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 {
|
|
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
|