@burdenoff/microfe-bigconsole 2026.1119.4 → 2026.1119.6

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.
@@ -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 };
@@ -15,7 +15,8 @@ var t = "bigconsole:quota-exhausted", n = "QUOTA_NOT_PROVISIONED", r = {
15
15
  "refinegenerateddashboard",
16
16
  "regeneratedashboard",
17
17
  "conversationaldashboardedit",
18
- "previewpromptanalysis"
18
+ "previewpromptanalysis",
19
+ "bigconsoleask"
19
20
  ]), s = /* @__PURE__ */ new Set(["bigconsole.projects.count"]), c = /* @__PURE__ */ new Set(["bigconsole.sessions.count"]), l = /* @__PURE__ */ new Set(["bigconsole.commands.count"]);
20
21
  function u(e) {
21
22
  return typeof e == "object" && !!e;
@@ -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 };
@@ -49,6 +49,7 @@ export type BigConsoleAsOfUnavailableReason =
49
49
  | 'PAYLOAD_TOO_LARGE'
50
50
  /** The history could not be read. */
51
51
  | 'READ_FAILED';
52
+ export type BigConsoleAskStatus = 'CLARIFICATION_NEEDED' | 'INSUFFICIENT_DATA' | 'NO_MATCHING_DATA' | 'REFUSED' | 'UNAVAILABLE' | 'UNSUPPORTED' | 'VERIFIED';
52
53
  /** What kind of source item a report row describes. */
53
54
  export type BigConsoleBoardMigrationItemKind = 'FILTER' | 'WIDGET';
54
55
  /** What kind of query a source card ran. */
@@ -1790,6 +1791,61 @@ export type UpdateWorkflowInput = {
1790
1791
  name?: string | null | undefined;
1791
1792
  status?: FluidGridsWorkflowStatus | null | undefined;
1792
1793
  };
1794
+ export type BigConsoleAskQueryVariables = Exact<{
1795
+ question: string;
1796
+ }>;
1797
+ export type BigConsoleAskQuery = {
1798
+ bigconsoleAsk: {
1799
+ status: Types.BigConsoleAskStatus;
1800
+ headline: string | null;
1801
+ message: string | null;
1802
+ columns: Array<string>;
1803
+ rows: Record<string, unknown>;
1804
+ truncated: boolean;
1805
+ spec: Record<string, unknown> | null;
1806
+ chart: {
1807
+ type: string;
1808
+ categoryColumn: string;
1809
+ valueColumn: string;
1810
+ } | null;
1811
+ provenance: {
1812
+ sourceId: string;
1813
+ sourceName: string;
1814
+ sourceRevision: string;
1815
+ parser: string;
1816
+ grouping: Array<string>;
1817
+ aggregations: Array<string>;
1818
+ filters: Array<string>;
1819
+ timeRange: string | null;
1820
+ metricDefinition: string;
1821
+ query: string;
1822
+ limitations: Array<string>;
1823
+ fieldsUsed: Array<{
1824
+ id: string;
1825
+ name: string;
1826
+ type: string;
1827
+ }>;
1828
+ } | null;
1829
+ clarificationOptions: Array<{
1830
+ id: string;
1831
+ name: string;
1832
+ }>;
1833
+ usage: {
1834
+ model: string;
1835
+ tokensIn: number | null;
1836
+ tokensOut: number | null;
1837
+ credits: number | null;
1838
+ } | null;
1839
+ };
1840
+ };
1841
+ export type BigConsoleAskAddToDashboardMutationVariables = Exact<{
1842
+ spec: Record<string, unknown>;
1843
+ pageId: string | number;
1844
+ title?: string | null | undefined;
1845
+ }>;
1846
+ export type BigConsoleAskAddToDashboardMutation = {
1847
+ bigconsoleAskAddToDashboard: string;
1848
+ };
1793
1849
  export type BigConsoleDetectAnomaliesQueryVariables = Exact<{
1794
1850
  input: Types.BigConsoleDetectAnomaliesInput;
1795
1851
  }>;
@@ -8662,6 +8718,8 @@ export declare const LinkedDataSinkFieldsFragmentDoc: DocumentNode<LinkedDataSin
8662
8718
  export declare const DataSinkWorkflowLinkFieldsFragmentDoc: DocumentNode<DataSinkWorkflowLinkFieldsFragment, unknown>;
8663
8719
  export declare const WorkflowFullFieldsFragmentDoc: DocumentNode<WorkflowFullFieldsFragment, unknown>;
8664
8720
  export declare const WorkflowListItemFragmentDoc: DocumentNode<WorkflowListItemFragment, unknown>;
8721
+ export declare const BigConsoleAskDocument: DocumentNode<BigConsoleAskQuery, BigConsoleAskQueryVariables>;
8722
+ export declare const BigConsoleAskAddToDashboardDocument: DocumentNode<BigConsoleAskAddToDashboardMutation, BigConsoleAskAddToDashboardMutationVariables>;
8665
8723
  export declare const BigConsoleDetectAnomaliesDocument: DocumentNode<BigConsoleDetectAnomaliesQuery, BigConsoleDetectAnomaliesQueryVariables>;
8666
8724
  export declare const BigConsoleValidateConsoleDefinitionDocument: DocumentNode<BigConsoleValidateConsoleDefinitionQuery, BigConsoleValidateConsoleDefinitionQueryVariables>;
8667
8725
  export declare const BigConsoleShareMembersDocument: DocumentNode<BigConsoleShareMembersQuery, BigConsoleShareMembersQueryVariables>;