@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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Parser } from '../types';
|
|
2
|
+
/** The `consoleId` of a workspace-global parser. */
|
|
3
|
+
export declare const GLOBAL_PARSER_CONSOLE_ID = "default";
|
|
4
|
+
/** Which parsers a reader of the store wants. */
|
|
5
|
+
export type ParserStoreScope =
|
|
6
|
+
/** Every parser the caller can see: global plus each readable dashboard's. */
|
|
7
|
+
{
|
|
8
|
+
kind: 'all';
|
|
9
|
+
}
|
|
10
|
+
/** The parsers of one console (`default` for the global ones). */
|
|
11
|
+
| {
|
|
12
|
+
kind: 'console';
|
|
13
|
+
consoleId: string;
|
|
14
|
+
};
|
|
15
|
+
/** Whether a parser is workspace-global rather than dashboard-scoped. */
|
|
16
|
+
export declare function isGlobalParser(parser: Pick<Parser, 'consoleId'>): boolean;
|
|
17
|
+
/** The stored parsers that belong to `scope`, in insertion order. */
|
|
18
|
+
export declare function selectParsersInScope(parsers: ReadonlyMap<string, Parser>, scope: ParserStoreScope): Parser[];
|
|
19
|
+
/**
|
|
20
|
+
* The store after a complete (unfiltered) fetch of `scope`: the fetched list
|
|
21
|
+
* becomes the truth for that scope, so a parser deleted elsewhere drops out,
|
|
22
|
+
* while parsers of other scopes are kept untouched.
|
|
23
|
+
*/
|
|
24
|
+
export declare function replaceParsersInScope(parsers: ReadonlyMap<string, Parser>, scope: ParserStoreScope, fetched: readonly Parser[]): Map<string, Parser>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/bigconsole/store/parserScope.ts
|
|
2
|
+
var e = "default";
|
|
3
|
+
function t(e, t) {
|
|
4
|
+
return t.kind === "all" || e.consoleId === t.consoleId;
|
|
5
|
+
}
|
|
6
|
+
function n(e, n) {
|
|
7
|
+
let r = [];
|
|
8
|
+
for (let i of e.values()) t(i, n) && r.push(i);
|
|
9
|
+
return r;
|
|
10
|
+
}
|
|
11
|
+
function r(e, n, r) {
|
|
12
|
+
let i = /* @__PURE__ */ new Map();
|
|
13
|
+
for (let [r, a] of e) t(a, n) || i.set(r, a);
|
|
14
|
+
for (let e of r) i.set(e.id, e);
|
|
15
|
+
return i;
|
|
16
|
+
}
|
|
17
|
+
export { e as GLOBAL_PARSER_CONSOLE_ID, r as replaceParsersInScope, n as selectParsersInScope };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Parser, ParserType, ParserStatus } from '../types';
|
|
2
|
+
import { ParserStoreScope } from './parserScope';
|
|
2
3
|
/** UI state for individual Parser items */
|
|
3
4
|
interface ParserUIState {
|
|
4
5
|
isLoading: boolean;
|
|
@@ -28,6 +29,8 @@ interface ParserState {
|
|
|
28
29
|
/** Parser store actions */
|
|
29
30
|
interface ParserActions {
|
|
30
31
|
setParsers: (parsers: Parser[]) => void;
|
|
32
|
+
/** Make a complete fetch of `scope` the truth for that scope (BOFF-9770). */
|
|
33
|
+
replaceParsersInScope: (scope: ParserStoreScope, parsers: Parser[]) => void;
|
|
31
34
|
addParser: (parser: Parser) => void;
|
|
32
35
|
updateParser: (id: string, updates: Partial<Parser>) => void;
|
|
33
36
|
removeParser: (id: string) => void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { replaceParsersInScope as e } from "./parserScope.js";
|
|
2
|
+
import { create as t } from "zustand";
|
|
3
|
+
import { devtools as n, persist as r } from "zustand/middleware";
|
|
4
|
+
import { createProfileScopedStorage as i } from "@burdenoff/fe-libs/shared/utils";
|
|
4
5
|
// src/bigconsole/store/parserStore.ts
|
|
5
|
-
var
|
|
6
|
+
var a = {
|
|
6
7
|
parsers: /* @__PURE__ */ new Map(),
|
|
7
8
|
parserUIStates: /* @__PURE__ */ new Map(),
|
|
8
9
|
dirtyParserIds: /* @__PURE__ */ new Set(),
|
|
@@ -19,77 +20,78 @@ var i = {
|
|
|
19
20
|
testOutput: null,
|
|
20
21
|
testError: null,
|
|
21
22
|
testExecutionTime: null
|
|
22
|
-
},
|
|
23
|
-
...
|
|
24
|
-
setParsers: (
|
|
25
|
-
let n = new Map(
|
|
26
|
-
for (let
|
|
23
|
+
}, o = t()(n(r((t, n) => ({
|
|
24
|
+
...a,
|
|
25
|
+
setParsers: (e) => t((t) => {
|
|
26
|
+
let n = new Map(t.parsers);
|
|
27
|
+
for (let t of e) n.set(t.id, t);
|
|
27
28
|
return { parsers: n };
|
|
28
29
|
}),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
replaceParsersInScope: (n, r) => t((t) => ({ parsers: e(t.parsers, n, r) })),
|
|
31
|
+
addParser: (e) => t((t) => {
|
|
32
|
+
let n = new Map(t.parsers);
|
|
33
|
+
return n.set(e.id, e), { parsers: n };
|
|
32
34
|
}),
|
|
33
|
-
updateParser: (
|
|
34
|
-
let r = new Map(
|
|
35
|
-
return i && r.set(
|
|
35
|
+
updateParser: (e, n) => t((t) => {
|
|
36
|
+
let r = new Map(t.parsers), i = r.get(e);
|
|
37
|
+
return i && r.set(e, {
|
|
36
38
|
...i,
|
|
37
39
|
...n
|
|
38
40
|
}), { parsers: r };
|
|
39
41
|
}),
|
|
40
|
-
removeParser: (
|
|
41
|
-
let n = new Map(
|
|
42
|
-
n.delete(
|
|
43
|
-
let r = new Map(
|
|
44
|
-
return r.delete(
|
|
42
|
+
removeParser: (e) => t((t) => {
|
|
43
|
+
let n = new Map(t.parsers);
|
|
44
|
+
n.delete(e);
|
|
45
|
+
let r = new Map(t.parserUIStates);
|
|
46
|
+
return r.delete(e), {
|
|
45
47
|
parsers: n,
|
|
46
48
|
parserUIStates: r,
|
|
47
|
-
selectedParserId:
|
|
49
|
+
selectedParserId: t.selectedParserId === e ? null : t.selectedParserId
|
|
48
50
|
};
|
|
49
51
|
}),
|
|
50
|
-
selectParser: (
|
|
51
|
-
clearSelection: () =>
|
|
52
|
-
setTypeFilter: (
|
|
53
|
-
setStatusFilter: (
|
|
54
|
-
setSearchQuery: (
|
|
55
|
-
clearFilters: () =>
|
|
52
|
+
selectParser: (e) => t({ selectedParserId: e }),
|
|
53
|
+
clearSelection: () => t({ selectedParserId: null }),
|
|
54
|
+
setTypeFilter: (e) => t({ typeFilter: e }),
|
|
55
|
+
setStatusFilter: (e) => t({ statusFilter: e }),
|
|
56
|
+
setSearchQuery: (e) => t({ searchQuery: e }),
|
|
57
|
+
clearFilters: () => t({
|
|
56
58
|
typeFilter: null,
|
|
57
59
|
statusFilter: null,
|
|
58
60
|
searchQuery: ""
|
|
59
61
|
}),
|
|
60
|
-
openCreateDialog: () =>
|
|
62
|
+
openCreateDialog: () => t({
|
|
61
63
|
createDialogOpen: !0,
|
|
62
64
|
currentParser: null
|
|
63
65
|
}),
|
|
64
|
-
closeCreateDialog: () =>
|
|
66
|
+
closeCreateDialog: () => t({
|
|
65
67
|
createDialogOpen: !1,
|
|
66
68
|
currentParser: null
|
|
67
69
|
}),
|
|
68
|
-
openEditDialog: (
|
|
70
|
+
openEditDialog: (e) => t({
|
|
69
71
|
editDialogOpen: !0,
|
|
70
|
-
currentParser:
|
|
72
|
+
currentParser: e
|
|
71
73
|
}),
|
|
72
|
-
closeEditDialog: () =>
|
|
74
|
+
closeEditDialog: () => t({
|
|
73
75
|
editDialogOpen: !1,
|
|
74
76
|
currentParser: null
|
|
75
77
|
}),
|
|
76
|
-
openDeleteDialog: (
|
|
78
|
+
openDeleteDialog: (e) => t({
|
|
77
79
|
deleteDialogOpen: !0,
|
|
78
|
-
currentParser:
|
|
80
|
+
currentParser: e
|
|
79
81
|
}),
|
|
80
|
-
closeDeleteDialog: () =>
|
|
82
|
+
closeDeleteDialog: () => t({
|
|
81
83
|
deleteDialogOpen: !1,
|
|
82
84
|
currentParser: null
|
|
83
85
|
}),
|
|
84
|
-
openTestDialog: (
|
|
86
|
+
openTestDialog: (e) => t({
|
|
85
87
|
testDialogOpen: !0,
|
|
86
|
-
currentParser:
|
|
88
|
+
currentParser: e,
|
|
87
89
|
testInput: "{}",
|
|
88
90
|
testOutput: null,
|
|
89
91
|
testError: null,
|
|
90
92
|
testExecutionTime: null
|
|
91
93
|
}),
|
|
92
|
-
closeTestDialog: () =>
|
|
94
|
+
closeTestDialog: () => t({
|
|
93
95
|
testDialogOpen: !1,
|
|
94
96
|
currentParser: null,
|
|
95
97
|
testInput: "{}",
|
|
@@ -97,76 +99,76 @@ var i = {
|
|
|
97
99
|
testError: null,
|
|
98
100
|
testExecutionTime: null
|
|
99
101
|
}),
|
|
100
|
-
setParserLoading: (
|
|
101
|
-
let r = new Map(
|
|
102
|
+
setParserLoading: (e, n) => t((t) => {
|
|
103
|
+
let r = new Map(t.parserUIStates), i = r.get(e) || {
|
|
102
104
|
isLoading: !1,
|
|
103
105
|
isError: !1,
|
|
104
106
|
isTesting: !1
|
|
105
107
|
};
|
|
106
|
-
return r.set(
|
|
108
|
+
return r.set(e, {
|
|
107
109
|
...i,
|
|
108
110
|
isLoading: n
|
|
109
111
|
}), { parserUIStates: r };
|
|
110
112
|
}),
|
|
111
|
-
setParserError: (
|
|
112
|
-
let r = new Map(
|
|
113
|
+
setParserError: (e, n) => t((t) => {
|
|
114
|
+
let r = new Map(t.parserUIStates), i = r.get(e) || {
|
|
113
115
|
isLoading: !1,
|
|
114
116
|
isError: !1,
|
|
115
117
|
isTesting: !1
|
|
116
118
|
};
|
|
117
|
-
return r.set(
|
|
119
|
+
return r.set(e, {
|
|
118
120
|
...i,
|
|
119
121
|
isError: n !== null,
|
|
120
122
|
errorMessage: n || void 0
|
|
121
123
|
}), { parserUIStates: r };
|
|
122
124
|
}),
|
|
123
|
-
setParserTesting: (
|
|
124
|
-
let r = new Map(
|
|
125
|
+
setParserTesting: (e, n) => t((t) => {
|
|
126
|
+
let r = new Map(t.parserUIStates), i = r.get(e) || {
|
|
125
127
|
isLoading: !1,
|
|
126
128
|
isError: !1,
|
|
127
129
|
isTesting: !1
|
|
128
130
|
};
|
|
129
|
-
return r.set(
|
|
131
|
+
return r.set(e, {
|
|
130
132
|
...i,
|
|
131
133
|
isTesting: n
|
|
132
134
|
}), { parserUIStates: r };
|
|
133
135
|
}),
|
|
134
|
-
markParserDirty: (
|
|
135
|
-
markParserClean: (
|
|
136
|
-
let n = new Set(
|
|
137
|
-
return n.delete(
|
|
138
|
-
}),
|
|
139
|
-
clearAllDirty: () =>
|
|
140
|
-
setTestInput: (
|
|
141
|
-
setTestOutput: (
|
|
142
|
-
setTestError: (
|
|
143
|
-
setTestExecutionTime: (
|
|
144
|
-
clearTestResults: () =>
|
|
136
|
+
markParserDirty: (e) => t((t) => ({ dirtyParserIds: /* @__PURE__ */ new Set([...t.dirtyParserIds, e]) })),
|
|
137
|
+
markParserClean: (e) => t((t) => {
|
|
138
|
+
let n = new Set(t.dirtyParserIds);
|
|
139
|
+
return n.delete(e), { dirtyParserIds: n };
|
|
140
|
+
}),
|
|
141
|
+
clearAllDirty: () => t({ dirtyParserIds: /* @__PURE__ */ new Set() }),
|
|
142
|
+
setTestInput: (e) => t({ testInput: e }),
|
|
143
|
+
setTestOutput: (e) => t({ testOutput: e }),
|
|
144
|
+
setTestError: (e) => t({ testError: e }),
|
|
145
|
+
setTestExecutionTime: (e) => t({ testExecutionTime: e }),
|
|
146
|
+
clearTestResults: () => t({
|
|
145
147
|
testOutput: null,
|
|
146
148
|
testError: null,
|
|
147
149
|
testExecutionTime: null
|
|
148
150
|
}),
|
|
149
|
-
getParserById: (e) =>
|
|
151
|
+
getParserById: (e) => n().parsers.get(e),
|
|
150
152
|
getFilteredParsers: () => {
|
|
151
|
-
let e =
|
|
152
|
-
if (e.typeFilter && (
|
|
153
|
-
let
|
|
154
|
-
|
|
153
|
+
let e = n(), t = Array.from(e.parsers.values());
|
|
154
|
+
if (e.typeFilter && (t = t.filter((t) => t.type === e.typeFilter)), e.statusFilter && (t = t.filter((t) => t.status === e.statusFilter)), e.searchQuery.trim()) {
|
|
155
|
+
let n = e.searchQuery.toLowerCase();
|
|
156
|
+
t = t.filter((e) => e.name.toLowerCase().includes(n) || e.description?.toLowerCase().includes(n) || e.inputSinkKey?.toLowerCase().includes(n));
|
|
155
157
|
}
|
|
156
|
-
return
|
|
158
|
+
return t.sort((e, t) => new Date(t.updatedAt).getTime() - new Date(e.updatedAt).getTime());
|
|
157
159
|
},
|
|
158
160
|
getDirtyParsers: () => {
|
|
159
|
-
let e =
|
|
161
|
+
let e = n();
|
|
160
162
|
return Array.from(e.dirtyParserIds).map((t) => e.parsers.get(t)).filter((e) => e !== void 0);
|
|
161
163
|
},
|
|
162
|
-
reset: () =>
|
|
164
|
+
reset: () => t(a)
|
|
163
165
|
}), {
|
|
164
166
|
name: "bigconsole-parser-store",
|
|
165
|
-
storage:
|
|
167
|
+
storage: i(),
|
|
166
168
|
partialize: (e) => ({
|
|
167
169
|
typeFilter: e.typeFilter,
|
|
168
170
|
statusFilter: e.statusFilter,
|
|
169
171
|
searchQuery: e.searchQuery
|
|
170
172
|
})
|
|
171
173
|
}), { name: "ParserStore" }));
|
|
172
|
-
export {
|
|
174
|
+
export { o as useParserStore };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who owns a dashboard template published from BigConsole.
|
|
3
|
+
*
|
|
4
|
+
* A "Publish as Template" draft is a devportal application. The Developer
|
|
5
|
+
* Portal lists applications per developer organization, so a draft created
|
|
6
|
+
* without one (personally owned) was invisible to anyone looking at an
|
|
7
|
+
* organization's My Applications list (BOFF-10779). The publish dialog
|
|
8
|
+
* therefore asks who publishes the template, and defaults to whatever the
|
|
9
|
+
* Developer Portal currently has selected so the draft lands where the author
|
|
10
|
+
* is about to look for it.
|
|
11
|
+
*
|
|
12
|
+
* @module bigconsole/utils/publishOwner
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* localStorage key the Developer Portal microfrontend uses for its selected
|
|
16
|
+
* organization. Both microfrontends run inside the same app shell origin, so
|
|
17
|
+
* reading it here keeps the two in step without any shared runtime state.
|
|
18
|
+
*/
|
|
19
|
+
export declare const DEVPORTAL_ACTIVE_ORG_STORAGE_KEY = "devportal_active_org_v1";
|
|
20
|
+
/** Values the Developer Portal stores instead of an org id (Personal / All scopes). */
|
|
21
|
+
export declare const DEVPORTAL_PERSONAL_SCOPE = "__personal__";
|
|
22
|
+
export declare const DEVPORTAL_ALL_SCOPE = "__all__";
|
|
23
|
+
/** Developer organization role, as reported by `myDeveloperOrganizations`. */
|
|
24
|
+
export type PublishOwnerOrgRole = 'OWNER' | 'ADMIN' | 'DEVELOPER' | 'VIEWER';
|
|
25
|
+
export interface PublishOwnerOrgSource {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
kind: string;
|
|
29
|
+
members?: ReadonlyArray<{
|
|
30
|
+
userId: string;
|
|
31
|
+
role: string;
|
|
32
|
+
isActive: boolean;
|
|
33
|
+
}> | null;
|
|
34
|
+
}
|
|
35
|
+
export interface PublishOwnerOption {
|
|
36
|
+
/** Developer organization id, or null for a personally owned draft. */
|
|
37
|
+
organizationId: string | null;
|
|
38
|
+
/** Organization name; empty for the personal option (the dialog labels it). */
|
|
39
|
+
name: string;
|
|
40
|
+
/** The current user's role in the organization, when known. */
|
|
41
|
+
role: PublishOwnerOrgRole | null;
|
|
42
|
+
/**
|
|
43
|
+
* True when the backend would refuse to create an application under this
|
|
44
|
+
* organization for the current user (viewers and inactive members).
|
|
45
|
+
*/
|
|
46
|
+
disabled: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Why the option is disabled, so the dialog can say so: an inactive
|
|
49
|
+
* membership wins over the role, because reactivation is what the user
|
|
50
|
+
* needs whatever their role is. Null when the option is selectable.
|
|
51
|
+
*/
|
|
52
|
+
disabledReason: PublishOwnerDisabledReason | null;
|
|
53
|
+
}
|
|
54
|
+
/** Why an organization cannot be chosen as the owner. */
|
|
55
|
+
export type PublishOwnerDisabledReason = 'inactive' | 'viewer';
|
|
56
|
+
/**
|
|
57
|
+
* Build the "Publish as" options: every non-PHYSICAL organization the user
|
|
58
|
+
* belongs to (devportal refuses applications under seller orgs), followed by
|
|
59
|
+
* the personal option. Organizations where the user is a viewer or an
|
|
60
|
+
* inactive member stay listed but disabled, so the user can see why they are
|
|
61
|
+
* not selectable instead of wondering where the org went.
|
|
62
|
+
*/
|
|
63
|
+
export declare function buildPublishOwnerOptions(orgs: ReadonlyArray<PublishOwnerOrgSource>, currentUserId: string | null | undefined): PublishOwnerOption[];
|
|
64
|
+
/**
|
|
65
|
+
* Pick the owner the dialog starts with:
|
|
66
|
+
* 1. the organization currently selected in the Developer Portal, when the
|
|
67
|
+
* user may publish under it;
|
|
68
|
+
* 2. otherwise the user's only selectable organization;
|
|
69
|
+
* 3. otherwise Personal.
|
|
70
|
+
* The Portal's "Personal" scope selects Personal directly; its "All" scope
|
|
71
|
+
* expresses no preference and falls through to rule 2.
|
|
72
|
+
*/
|
|
73
|
+
export declare function resolveDefaultPublishOwner(options: ReadonlyArray<PublishOwnerOption>, devportalSelection: string | null): string | null;
|
|
74
|
+
/** Read the Developer Portal's selected organization; null when unavailable. */
|
|
75
|
+
export declare function readDevportalActiveOrg(storage: Pick<Storage, 'getItem'> | null | undefined): string | null;
|
|
76
|
+
/** Display name of the chosen owner; null for Personal or an unknown id. */
|
|
77
|
+
export declare function publishOwnerName(options: ReadonlyArray<PublishOwnerOption>, organizationId: string | null): string | null;
|
|
78
|
+
/** The organizations request, as the hook issues it (injected for tests). */
|
|
79
|
+
export type FetchPublishOwnerOrgs = () => Promise<{
|
|
80
|
+
data: {
|
|
81
|
+
myDeveloperOrganizations?: ReadonlyArray<PublishOwnerOrgSource> | null;
|
|
82
|
+
} | null;
|
|
83
|
+
errors?: ReadonlyArray<{
|
|
84
|
+
message: string;
|
|
85
|
+
}>;
|
|
86
|
+
}>;
|
|
87
|
+
export type PublishOwnerOrgsLoad = {
|
|
88
|
+
orgs: PublishOwnerOrgSource[];
|
|
89
|
+
error: null;
|
|
90
|
+
} | {
|
|
91
|
+
orgs: [];
|
|
92
|
+
error: string;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Run the organizations request and reduce it to orgs-or-error. Never throws:
|
|
96
|
+
* a GraphQL error, a missing field or a network failure all become `error`,
|
|
97
|
+
* which the dialog explains inline (Personal stays available), so no caller
|
|
98
|
+
* needs a try/catch and no failure escapes to a global error handler.
|
|
99
|
+
*/
|
|
100
|
+
export declare function loadPublishOwnerOrganizations(fetchOrgs: FetchPublishOwnerOrgs): Promise<PublishOwnerOrgsLoad>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// src/bigconsole/utils/publishOwner.ts
|
|
2
|
+
var e = "devportal_active_org_v1", t = "__personal__", n = "__all__", r = /* @__PURE__ */ new Set([
|
|
3
|
+
"OWNER",
|
|
4
|
+
"ADMIN",
|
|
5
|
+
"DEVELOPER",
|
|
6
|
+
"VIEWER"
|
|
7
|
+
]);
|
|
8
|
+
function i(e) {
|
|
9
|
+
return r.has(e);
|
|
10
|
+
}
|
|
11
|
+
function a(e, t) {
|
|
12
|
+
return [...e.filter((e) => e.kind !== "PHYSICAL").map((e) => {
|
|
13
|
+
let n = t ? e.members?.find((e) => e.userId === t) : void 0, r = n && i(n.role) ? n.role : null, a = n?.isActive === !1 ? "inactive" : r === "VIEWER" ? "viewer" : null;
|
|
14
|
+
return {
|
|
15
|
+
organizationId: e.id,
|
|
16
|
+
name: e.name,
|
|
17
|
+
role: r,
|
|
18
|
+
disabled: a !== null,
|
|
19
|
+
disabledReason: a
|
|
20
|
+
};
|
|
21
|
+
}).sort((e, t) => e.name.localeCompare(t.name)), {
|
|
22
|
+
organizationId: null,
|
|
23
|
+
name: "",
|
|
24
|
+
role: null,
|
|
25
|
+
disabled: !1,
|
|
26
|
+
disabledReason: null
|
|
27
|
+
}];
|
|
28
|
+
}
|
|
29
|
+
function o(e, t) {
|
|
30
|
+
let n = e.filter((e) => e.organizationId !== null && !e.disabled);
|
|
31
|
+
if (t === "__personal__") return null;
|
|
32
|
+
if (t && t !== "__all__") {
|
|
33
|
+
let e = n.find((e) => e.organizationId === t);
|
|
34
|
+
if (e) return e.organizationId;
|
|
35
|
+
}
|
|
36
|
+
return n.length === 1 ? n[0]?.organizationId ?? null : null;
|
|
37
|
+
}
|
|
38
|
+
function s(t) {
|
|
39
|
+
if (!t) return null;
|
|
40
|
+
try {
|
|
41
|
+
return t.getItem(e);
|
|
42
|
+
} catch {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function c(e, t) {
|
|
47
|
+
return t ? e.find((e) => e.organizationId === t)?.name ?? null : null;
|
|
48
|
+
}
|
|
49
|
+
async function l(e) {
|
|
50
|
+
try {
|
|
51
|
+
let t = await e(), n = t.errors?.[0];
|
|
52
|
+
if (n) return {
|
|
53
|
+
orgs: [],
|
|
54
|
+
error: n.message
|
|
55
|
+
};
|
|
56
|
+
let r = t.data?.myDeveloperOrganizations;
|
|
57
|
+
return r ? {
|
|
58
|
+
orgs: [...r],
|
|
59
|
+
error: null
|
|
60
|
+
} : {
|
|
61
|
+
orgs: [],
|
|
62
|
+
error: "The developer organizations response was empty."
|
|
63
|
+
};
|
|
64
|
+
} catch (e) {
|
|
65
|
+
return {
|
|
66
|
+
orgs: [],
|
|
67
|
+
error: e instanceof Error ? e.message : String(e)
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
export { e as DEVPORTAL_ACTIVE_ORG_STORAGE_KEY, n as DEVPORTAL_ALL_SCOPE, t as DEVPORTAL_PERSONAL_SCOPE, a as buildPublishOwnerOptions, l as loadPublishOwnerOrganizations, c as publishOwnerName, s as readDevportalActiveOrg, o as resolveDefaultPublishOwner };
|
|
@@ -62,6 +62,9 @@ export type CreateApplicationVersionInput = {
|
|
|
62
62
|
requiredScopes?: Array<string> | null | undefined;
|
|
63
63
|
version: string;
|
|
64
64
|
};
|
|
65
|
+
/** DIGITAL orgs publish Applications to the store; PHYSICAL orgs list physical goods via the seller portal. Not user-selectable — fixed at creation by which flow provisioned the org. See BOFF-7285. */
|
|
66
|
+
export type DeveloperOrgKind = 'DIGITAL' | 'PHYSICAL';
|
|
67
|
+
export type DeveloperOrgRole = 'ADMIN' | 'DEVELOPER' | 'OWNER' | 'VIEWER';
|
|
65
68
|
export type PricingModel = 'FREE' | 'PAID_ONETIME' | 'SUBSCRIPTION';
|
|
66
69
|
export type ProductNature = 'DIGITAL' | 'PHYSICAL';
|
|
67
70
|
export type ProductStatus = 'ARCHIVED' | 'DEPRECATED' | 'DRAFT' | 'PENDING_REVIEW' | 'PUBLISHED' | 'REJECTED' | 'UNLISTED';
|
|
@@ -206,8 +209,24 @@ export type GetDashboardTemplateDetailQuery = {
|
|
|
206
209
|
content: Record<string, unknown> | null;
|
|
207
210
|
} | null;
|
|
208
211
|
};
|
|
212
|
+
export type GetPublishOwnerOrganizationsQueryVariables = Exact<{
|
|
213
|
+
[key: string]: never;
|
|
214
|
+
}>;
|
|
215
|
+
export type GetPublishOwnerOrganizationsQuery = {
|
|
216
|
+
myDeveloperOrganizations: Array<{
|
|
217
|
+
id: string;
|
|
218
|
+
name: string;
|
|
219
|
+
kind: Types.DeveloperOrgKind;
|
|
220
|
+
members: Array<{
|
|
221
|
+
userId: string;
|
|
222
|
+
role: Types.DeveloperOrgRole;
|
|
223
|
+
isActive: boolean;
|
|
224
|
+
}>;
|
|
225
|
+
}>;
|
|
226
|
+
};
|
|
209
227
|
export declare const CreateDashboardTemplateAppDocument: DocumentNode<CreateDashboardTemplateAppMutation, CreateDashboardTemplateAppMutationVariables>;
|
|
210
228
|
export declare const CreateDashboardTemplateVersionDocument: DocumentNode<CreateDashboardTemplateVersionMutation, CreateDashboardTemplateVersionMutationVariables>;
|
|
211
229
|
export declare const BrowseDashboardTemplatesDocument: DocumentNode<BrowseDashboardTemplatesQuery, BrowseDashboardTemplatesQueryVariables>;
|
|
212
230
|
export declare const GetDashboardTemplateDetailDocument: DocumentNode<GetDashboardTemplateDetailQuery, GetDashboardTemplateDetailQueryVariables>;
|
|
231
|
+
export declare const GetPublishOwnerOrganizationsDocument: DocumentNode<GetPublishOwnerOrganizationsQuery, GetPublishOwnerOrganizationsQueryVariables>;
|
|
213
232
|
export {};
|
|
@@ -538,5 +538,84 @@ var e = {
|
|
|
538
538
|
}]
|
|
539
539
|
}
|
|
540
540
|
}]
|
|
541
|
+
}, i = {
|
|
542
|
+
kind: "Document",
|
|
543
|
+
definitions: [{
|
|
544
|
+
kind: "OperationDefinition",
|
|
545
|
+
operation: "query",
|
|
546
|
+
name: {
|
|
547
|
+
kind: "Name",
|
|
548
|
+
value: "GetPublishOwnerOrganizations"
|
|
549
|
+
},
|
|
550
|
+
selectionSet: {
|
|
551
|
+
kind: "SelectionSet",
|
|
552
|
+
selections: [{
|
|
553
|
+
kind: "Field",
|
|
554
|
+
name: {
|
|
555
|
+
kind: "Name",
|
|
556
|
+
value: "myDeveloperOrganizations"
|
|
557
|
+
},
|
|
558
|
+
selectionSet: {
|
|
559
|
+
kind: "SelectionSet",
|
|
560
|
+
selections: [
|
|
561
|
+
{
|
|
562
|
+
kind: "Field",
|
|
563
|
+
name: {
|
|
564
|
+
kind: "Name",
|
|
565
|
+
value: "id"
|
|
566
|
+
}
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
kind: "Field",
|
|
570
|
+
name: {
|
|
571
|
+
kind: "Name",
|
|
572
|
+
value: "name"
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
kind: "Field",
|
|
577
|
+
name: {
|
|
578
|
+
kind: "Name",
|
|
579
|
+
value: "kind"
|
|
580
|
+
}
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
kind: "Field",
|
|
584
|
+
name: {
|
|
585
|
+
kind: "Name",
|
|
586
|
+
value: "members"
|
|
587
|
+
},
|
|
588
|
+
selectionSet: {
|
|
589
|
+
kind: "SelectionSet",
|
|
590
|
+
selections: [
|
|
591
|
+
{
|
|
592
|
+
kind: "Field",
|
|
593
|
+
name: {
|
|
594
|
+
kind: "Name",
|
|
595
|
+
value: "userId"
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
kind: "Field",
|
|
600
|
+
name: {
|
|
601
|
+
kind: "Name",
|
|
602
|
+
value: "role"
|
|
603
|
+
}
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
kind: "Field",
|
|
607
|
+
name: {
|
|
608
|
+
kind: "Name",
|
|
609
|
+
value: "isActive"
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
]
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
]
|
|
616
|
+
}
|
|
617
|
+
}]
|
|
618
|
+
}
|
|
619
|
+
}]
|
|
541
620
|
};
|
|
542
|
-
export { n as BrowseDashboardTemplatesDocument, e as CreateDashboardTemplateAppDocument, t as CreateDashboardTemplateVersionDocument, r as GetDashboardTemplateDetailDocument };
|
|
621
|
+
export { n as BrowseDashboardTemplatesDocument, e as CreateDashboardTemplateAppDocument, t as CreateDashboardTemplateVersionDocument, r as GetDashboardTemplateDetailDocument, i as GetPublishOwnerOrganizationsDocument };
|
|
@@ -3466,6 +3466,15 @@ export type GetDrilldownTargetDashboardQuery = {
|
|
|
3466
3466
|
};
|
|
3467
3467
|
} | null;
|
|
3468
3468
|
};
|
|
3469
|
+
export type GetParserScopeDashboardQueryVariables = Exact<{
|
|
3470
|
+
id: string | number;
|
|
3471
|
+
}>;
|
|
3472
|
+
export type GetParserScopeDashboardQuery = {
|
|
3473
|
+
getDashboard: {
|
|
3474
|
+
id: string;
|
|
3475
|
+
name: string;
|
|
3476
|
+
} | null;
|
|
3477
|
+
};
|
|
3469
3478
|
export type GetTemplateQueryVariables = Exact<{
|
|
3470
3479
|
id: string | number;
|
|
3471
3480
|
}>;
|
|
@@ -8711,6 +8720,7 @@ export declare const GetDashboardShareDocument: DocumentNode<GetDashboardShareQu
|
|
|
8711
8720
|
export declare const GetDashboardViewDocument: DocumentNode<GetDashboardViewQuery, GetDashboardViewQueryVariables>;
|
|
8712
8721
|
export declare const GetDefaultDashboardViewDocument: DocumentNode<GetDefaultDashboardViewQuery, GetDefaultDashboardViewQueryVariables>;
|
|
8713
8722
|
export declare const GetDrilldownTargetDashboardDocument: DocumentNode<GetDrilldownTargetDashboardQuery, GetDrilldownTargetDashboardQueryVariables>;
|
|
8723
|
+
export declare const GetParserScopeDashboardDocument: DocumentNode<GetParserScopeDashboardQuery, GetParserScopeDashboardQueryVariables>;
|
|
8714
8724
|
export declare const GetTemplateDocument: DocumentNode<GetTemplateQuery, GetTemplateQueryVariables>;
|
|
8715
8725
|
export declare const ListDashboardEmbedPoliciesDocument: DocumentNode<ListDashboardEmbedPoliciesQuery, ListDashboardEmbedPoliciesQueryVariables>;
|
|
8716
8726
|
export declare const ListDashboardSharesDocument: DocumentNode<ListDashboardSharesQuery, ListDashboardSharesQueryVariables>;
|