@quillsql/admin 1.8.6 → 1.8.8

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/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
3
  import React__default, { CSSProperties, ForwardRefExoticComponent, RefAttributes } from 'react';
4
- import { EventTracking, InternalFilter, QuillReport as QuillReport$1, QuillTheme as QuillTheme$1 } from '@quillsql/react';
4
+ import { EventTracking, InternalFilter, QuillResults, QuillReport as QuillReport$1, QuillTheme as QuillTheme$1, ChangelogEntry } from '@quillsql/react';
5
5
 
6
6
  type QuillTenant = {
7
7
  name: string;
@@ -101,16 +101,18 @@ interface BaseQuillProviderProps {
101
101
  }
102
102
  interface QuillCloudProviderProps extends BaseQuillProviderProps {
103
103
  queryEndpoint: never;
104
+ streamEndpoint: never;
104
105
  queryHeaders?: never;
105
106
  withCredentials?: never;
106
107
  }
107
108
  interface SelfHostedProviderProps extends BaseQuillProviderProps {
108
109
  queryEndpoint: string;
110
+ streamEndpoint?: string;
109
111
  queryHeaders?: object;
110
112
  withCredentials?: boolean;
111
113
  }
112
114
  type QuillProviderProps = QuillCloudProviderProps | SelfHostedProviderProps;
113
- declare function AdminProvider({ children, publicKey, queryEndpoint, queryHeaders, withCredentials, clerkOrgId, onOnboardComplete, flagsList, getAuthorizationToken, theme, eventTracking, onRequestAddVirtualTable, hideEnvDropdown, }: QuillProviderProps): react_jsx_runtime.JSX.Element;
115
+ declare function AdminProvider({ children, publicKey, queryEndpoint, streamEndpoint, queryHeaders, withCredentials, clerkOrgId, onOnboardComplete, flagsList, getAuthorizationToken, theme, eventTracking, onRequestAddVirtualTable, hideEnvDropdown, }: QuillProviderProps): react_jsx_runtime.JSX.Element;
114
116
 
115
117
  interface QuillFetchOptions {
116
118
  client: Pick<QuillProviderClient, 'clientId' | 'queryEndpoint' | 'queryHeaders' | 'withCredentials'>;
@@ -123,13 +125,6 @@ interface QuillFetchOptions {
123
125
  getToken: () => Promise<string>;
124
126
  adminMode?: boolean;
125
127
  }
126
- interface QuillResults {
127
- data?: any;
128
- queries?: any;
129
- status?: string;
130
- error?: string;
131
- message?: string;
132
- }
133
128
 
134
129
  interface ColumnsByTable {
135
130
  tableName: string;
@@ -163,6 +158,7 @@ type Table = {
163
158
  isSelectStar: boolean;
164
159
  displayName: string;
165
160
  name: string;
161
+ description?: string;
166
162
  columns: ColumnInternal[];
167
163
  viewQuery: string;
168
164
  customFieldInfo: any;
@@ -335,6 +331,7 @@ interface State {
335
331
  loading: boolean;
336
332
  publicKey: string;
337
333
  queryEndpoint: string;
334
+ streamEndpoint?: string;
338
335
  queryHeaders: object | undefined;
339
336
  withCredentials: boolean | undefined;
340
337
  client: any;
@@ -376,7 +373,12 @@ interface State {
376
373
  tenantField: string;
377
374
  tenantIds: (string | number)[];
378
375
  }[] | (string | number)[];
379
- activeSandboxId?: string | null;
376
+ /** Source (live) client id when viewing a sandbox environment. */
377
+ sandboxParentClientId: string | null;
378
+ /** Agent sandbox client id from the client task response. */
379
+ sandboxClientId: string | null;
380
+ /** Agent sandbox session id from the client task response. */
381
+ sandboxSessionId: string | null;
380
382
  /**
381
383
  * When true, dashboard / virtual-table surfaces omit the in-page environment
382
384
  * selector (e.g. when the host app renders env selection in a global header).
@@ -392,6 +394,12 @@ type Action = {
392
394
  } | {
393
395
  type: 'SET_CLIENTS';
394
396
  payload: any[];
397
+ } | {
398
+ type: 'PATCH_CLIENT_NAME';
399
+ payload: {
400
+ clientId: string;
401
+ name: string;
402
+ };
395
403
  } | {
396
404
  type: 'UPDATE_CLIENTS';
397
405
  payload: any;
@@ -478,8 +486,12 @@ type Action = {
478
486
  type: 'SET_ALL_STATE';
479
487
  payload: any;
480
488
  } | {
481
- type: 'SET_ACTIVE_SANDBOX_ID';
482
- payload: string | null;
489
+ type: 'SET_SANDBOX_FIELDS';
490
+ payload: {
491
+ sandboxParentClientId: string | null;
492
+ sandboxClientId: string | null;
493
+ sandboxSessionId: string | null;
494
+ };
483
495
  } | {
484
496
  type: 'SET_HIDE_ENV_DROPDOWN';
485
497
  payload: boolean;
@@ -495,7 +507,8 @@ declare const useAdmin: () => {
495
507
  state: State;
496
508
  dispatch: React.Dispatch<Action>;
497
509
  clientLoading: boolean;
498
- setClient: (client: QuillProviderClient, fetchTenantInfo?: boolean, preserveSelectedDashboard?: boolean) => void;
510
+ setClient: (client: QuillProviderClient, fetchTenantInfo?: boolean, preserveSelectedDashboard?: boolean, resetSandbox?: boolean, forceRefresh?: boolean) => void;
511
+ refreshClientsList: (clientId?: string) => Promise<any[]>;
499
512
  getToken: () => Promise<string>;
500
513
  quillFetchWithToken: (options: Omit<QuillFetchOptions, "getToken">) => Promise<QuillResults>;
501
514
  eventTracking: EventTracking | null;
@@ -508,8 +521,7 @@ declare function DashboardManager({ navigateToVirtualTableManager: navigateToVir
508
521
  containerStyle?: CSSProperties;
509
522
  }): react_jsx_runtime.JSX.Element;
510
523
 
511
- declare function ChartQueryBuilder({ activeComponent, onExit, containerStyle, destinationDashboard, }: {
512
- activeComponent: string;
524
+ declare function ChartQueryBuilder({ onExit, containerStyle, destinationDashboard, }: {
513
525
  onExit?: (report?: QuillReport$1) => void;
514
526
  containerStyle?: CSSProperties;
515
527
  destinationDashboard: string;
@@ -528,10 +540,11 @@ declare function CreateEnvironment({ onOnboardComplete, containerStyle, }: {
528
540
 
529
541
  interface EnvSelectPopoverProps {
530
542
  clients: any[];
531
- setClient: (client: any) => void;
543
+ setClient: (client: any, refreshTenants?: boolean) => void;
532
544
  client: any;
533
545
  theme: any;
534
- onSelectedEditEnvironment?: (environment: string) => void;
546
+ /** Open edit-environment UI (caller should expect `state.client` to become the active sandbox first). */
547
+ onSelectedEditEnvironment?: () => void;
535
548
  parentRef: React.RefObject<HTMLDivElement | null>;
536
549
  isLoading?: boolean;
537
550
  onCreateNewEnvironment?: () => void;
@@ -587,7 +600,7 @@ declare function QuillSelectComponentWithCombo({ options, value, width, onChange
587
600
  declare function EditEnvironmentModal({ isOpen, setIsOpen, onSave, ModalComponent, TextInputComponent, ButtonComponent, HeaderComponent, SecondaryButtonComponent, }: {
588
601
  isOpen: boolean;
589
602
  setIsOpen: (isOpen: boolean) => void;
590
- onSave: () => void;
603
+ onSave: () => void | Promise<void>;
591
604
  ModalComponent: any;
592
605
  TextInputComponent: ForwardRefExoticComponent<TextInputPrimitiveProps & RefAttributes<HTMLInputElement>> | ((props: TextInputPrimitiveProps) => React__default.JSX.Element);
593
606
  ButtonComponent: any;
@@ -676,19 +689,31 @@ interface AgentChatState {
676
689
  setMessages: React.Dispatch<React.SetStateAction<ChatMessage[]>>;
677
690
  session: SessionInfo | null;
678
691
  setSession: React.Dispatch<React.SetStateAction<SessionInfo | null>>;
679
- sessionInitializedForClientId: string | null;
680
- setSessionInitializedForClientId: React.Dispatch<React.SetStateAction<string | null>>;
681
692
  showToolOutputs: boolean;
682
693
  setShowToolOutputs: React.Dispatch<React.SetStateAction<boolean>>;
694
+ changelogEntries: ChangelogEntry[];
695
+ setChangelogEntries: (entries: ChangelogEntry[]) => void;
696
+ clearChangelogEntries: () => void;
697
+ /** Widgets + app-data refresh; only for fetch-changelog-list results. */
698
+ applyFetchChangelogListResult?: (entries: ChangelogEntry[]) => Promise<void>;
683
699
  }
684
700
  declare function useAgentChat(): AgentChatState;
685
701
 
686
702
  declare function exportChatAsMarkdown(messages: ChatMessage[]): void;
687
703
 
704
+ declare function useSandboxSession(): {
705
+ sessionId: string | null;
706
+ sandboxClientId: string | null;
707
+ sourceClientId: string | null;
708
+ session: SessionInfo | null;
709
+ };
710
+
711
+ declare function clearQuillSandboxStorage(): void;
712
+
688
713
  /**
689
714
  * Environment selector plus create / edit environment modals.
690
715
  * Used in GlobalHeader and can be mounted in host app nav when managers use hideEnvDropdown.
691
716
  */
692
717
  declare function EnvironmentSwitcherWithModals(): react_jsx_runtime.JSX.Element;
693
718
 
694
- export { AdminProvider, AgentChat, AgentChatPanel, type AgentChatProps, ButtonPrimitive, ChartQueryBuilder as ChartBuilder, type ChatMessage, CreateEnvironment, CreateEnvironmentModal, DashboardManager, EditEnvironmentModal, EnvSelectPopover, EnvironmentSwitcherWithModals, HeaderPrimitive, ModalPrimitive, QuillSelectComponentWithCombo, SecondaryButtonPrimitive, type SessionInfo, TextInputPrimitive, type ToolCall, VirtualTableManager, exportChatAsMarkdown, useAdmin, useAgentChat };
719
+ export { AdminProvider, AgentChat, AgentChatPanel, type AgentChatProps, ButtonPrimitive, ChartQueryBuilder as ChartBuilder, type ChatMessage, CreateEnvironment, CreateEnvironmentModal, DashboardManager, EditEnvironmentModal, EnvSelectPopover, EnvironmentSwitcherWithModals, HeaderPrimitive, ModalPrimitive, QuillSelectComponentWithCombo, SecondaryButtonPrimitive, type SessionInfo, TextInputPrimitive, type ToolCall, VirtualTableManager, clearQuillSandboxStorage, exportChatAsMarkdown, useAdmin, useAgentChat, useSandboxSession };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
3
  import React__default, { CSSProperties, ForwardRefExoticComponent, RefAttributes } from 'react';
4
- import { EventTracking, InternalFilter, QuillReport as QuillReport$1, QuillTheme as QuillTheme$1 } from '@quillsql/react';
4
+ import { EventTracking, InternalFilter, QuillResults, QuillReport as QuillReport$1, QuillTheme as QuillTheme$1, ChangelogEntry } from '@quillsql/react';
5
5
 
6
6
  type QuillTenant = {
7
7
  name: string;
@@ -101,16 +101,18 @@ interface BaseQuillProviderProps {
101
101
  }
102
102
  interface QuillCloudProviderProps extends BaseQuillProviderProps {
103
103
  queryEndpoint: never;
104
+ streamEndpoint: never;
104
105
  queryHeaders?: never;
105
106
  withCredentials?: never;
106
107
  }
107
108
  interface SelfHostedProviderProps extends BaseQuillProviderProps {
108
109
  queryEndpoint: string;
110
+ streamEndpoint?: string;
109
111
  queryHeaders?: object;
110
112
  withCredentials?: boolean;
111
113
  }
112
114
  type QuillProviderProps = QuillCloudProviderProps | SelfHostedProviderProps;
113
- declare function AdminProvider({ children, publicKey, queryEndpoint, queryHeaders, withCredentials, clerkOrgId, onOnboardComplete, flagsList, getAuthorizationToken, theme, eventTracking, onRequestAddVirtualTable, hideEnvDropdown, }: QuillProviderProps): react_jsx_runtime.JSX.Element;
115
+ declare function AdminProvider({ children, publicKey, queryEndpoint, streamEndpoint, queryHeaders, withCredentials, clerkOrgId, onOnboardComplete, flagsList, getAuthorizationToken, theme, eventTracking, onRequestAddVirtualTable, hideEnvDropdown, }: QuillProviderProps): react_jsx_runtime.JSX.Element;
114
116
 
115
117
  interface QuillFetchOptions {
116
118
  client: Pick<QuillProviderClient, 'clientId' | 'queryEndpoint' | 'queryHeaders' | 'withCredentials'>;
@@ -123,13 +125,6 @@ interface QuillFetchOptions {
123
125
  getToken: () => Promise<string>;
124
126
  adminMode?: boolean;
125
127
  }
126
- interface QuillResults {
127
- data?: any;
128
- queries?: any;
129
- status?: string;
130
- error?: string;
131
- message?: string;
132
- }
133
128
 
134
129
  interface ColumnsByTable {
135
130
  tableName: string;
@@ -163,6 +158,7 @@ type Table = {
163
158
  isSelectStar: boolean;
164
159
  displayName: string;
165
160
  name: string;
161
+ description?: string;
166
162
  columns: ColumnInternal[];
167
163
  viewQuery: string;
168
164
  customFieldInfo: any;
@@ -335,6 +331,7 @@ interface State {
335
331
  loading: boolean;
336
332
  publicKey: string;
337
333
  queryEndpoint: string;
334
+ streamEndpoint?: string;
338
335
  queryHeaders: object | undefined;
339
336
  withCredentials: boolean | undefined;
340
337
  client: any;
@@ -376,7 +373,12 @@ interface State {
376
373
  tenantField: string;
377
374
  tenantIds: (string | number)[];
378
375
  }[] | (string | number)[];
379
- activeSandboxId?: string | null;
376
+ /** Source (live) client id when viewing a sandbox environment. */
377
+ sandboxParentClientId: string | null;
378
+ /** Agent sandbox client id from the client task response. */
379
+ sandboxClientId: string | null;
380
+ /** Agent sandbox session id from the client task response. */
381
+ sandboxSessionId: string | null;
380
382
  /**
381
383
  * When true, dashboard / virtual-table surfaces omit the in-page environment
382
384
  * selector (e.g. when the host app renders env selection in a global header).
@@ -392,6 +394,12 @@ type Action = {
392
394
  } | {
393
395
  type: 'SET_CLIENTS';
394
396
  payload: any[];
397
+ } | {
398
+ type: 'PATCH_CLIENT_NAME';
399
+ payload: {
400
+ clientId: string;
401
+ name: string;
402
+ };
395
403
  } | {
396
404
  type: 'UPDATE_CLIENTS';
397
405
  payload: any;
@@ -478,8 +486,12 @@ type Action = {
478
486
  type: 'SET_ALL_STATE';
479
487
  payload: any;
480
488
  } | {
481
- type: 'SET_ACTIVE_SANDBOX_ID';
482
- payload: string | null;
489
+ type: 'SET_SANDBOX_FIELDS';
490
+ payload: {
491
+ sandboxParentClientId: string | null;
492
+ sandboxClientId: string | null;
493
+ sandboxSessionId: string | null;
494
+ };
483
495
  } | {
484
496
  type: 'SET_HIDE_ENV_DROPDOWN';
485
497
  payload: boolean;
@@ -495,7 +507,8 @@ declare const useAdmin: () => {
495
507
  state: State;
496
508
  dispatch: React.Dispatch<Action>;
497
509
  clientLoading: boolean;
498
- setClient: (client: QuillProviderClient, fetchTenantInfo?: boolean, preserveSelectedDashboard?: boolean) => void;
510
+ setClient: (client: QuillProviderClient, fetchTenantInfo?: boolean, preserveSelectedDashboard?: boolean, resetSandbox?: boolean, forceRefresh?: boolean) => void;
511
+ refreshClientsList: (clientId?: string) => Promise<any[]>;
499
512
  getToken: () => Promise<string>;
500
513
  quillFetchWithToken: (options: Omit<QuillFetchOptions, "getToken">) => Promise<QuillResults>;
501
514
  eventTracking: EventTracking | null;
@@ -508,8 +521,7 @@ declare function DashboardManager({ navigateToVirtualTableManager: navigateToVir
508
521
  containerStyle?: CSSProperties;
509
522
  }): react_jsx_runtime.JSX.Element;
510
523
 
511
- declare function ChartQueryBuilder({ activeComponent, onExit, containerStyle, destinationDashboard, }: {
512
- activeComponent: string;
524
+ declare function ChartQueryBuilder({ onExit, containerStyle, destinationDashboard, }: {
513
525
  onExit?: (report?: QuillReport$1) => void;
514
526
  containerStyle?: CSSProperties;
515
527
  destinationDashboard: string;
@@ -528,10 +540,11 @@ declare function CreateEnvironment({ onOnboardComplete, containerStyle, }: {
528
540
 
529
541
  interface EnvSelectPopoverProps {
530
542
  clients: any[];
531
- setClient: (client: any) => void;
543
+ setClient: (client: any, refreshTenants?: boolean) => void;
532
544
  client: any;
533
545
  theme: any;
534
- onSelectedEditEnvironment?: (environment: string) => void;
546
+ /** Open edit-environment UI (caller should expect `state.client` to become the active sandbox first). */
547
+ onSelectedEditEnvironment?: () => void;
535
548
  parentRef: React.RefObject<HTMLDivElement | null>;
536
549
  isLoading?: boolean;
537
550
  onCreateNewEnvironment?: () => void;
@@ -587,7 +600,7 @@ declare function QuillSelectComponentWithCombo({ options, value, width, onChange
587
600
  declare function EditEnvironmentModal({ isOpen, setIsOpen, onSave, ModalComponent, TextInputComponent, ButtonComponent, HeaderComponent, SecondaryButtonComponent, }: {
588
601
  isOpen: boolean;
589
602
  setIsOpen: (isOpen: boolean) => void;
590
- onSave: () => void;
603
+ onSave: () => void | Promise<void>;
591
604
  ModalComponent: any;
592
605
  TextInputComponent: ForwardRefExoticComponent<TextInputPrimitiveProps & RefAttributes<HTMLInputElement>> | ((props: TextInputPrimitiveProps) => React__default.JSX.Element);
593
606
  ButtonComponent: any;
@@ -676,19 +689,31 @@ interface AgentChatState {
676
689
  setMessages: React.Dispatch<React.SetStateAction<ChatMessage[]>>;
677
690
  session: SessionInfo | null;
678
691
  setSession: React.Dispatch<React.SetStateAction<SessionInfo | null>>;
679
- sessionInitializedForClientId: string | null;
680
- setSessionInitializedForClientId: React.Dispatch<React.SetStateAction<string | null>>;
681
692
  showToolOutputs: boolean;
682
693
  setShowToolOutputs: React.Dispatch<React.SetStateAction<boolean>>;
694
+ changelogEntries: ChangelogEntry[];
695
+ setChangelogEntries: (entries: ChangelogEntry[]) => void;
696
+ clearChangelogEntries: () => void;
697
+ /** Widgets + app-data refresh; only for fetch-changelog-list results. */
698
+ applyFetchChangelogListResult?: (entries: ChangelogEntry[]) => Promise<void>;
683
699
  }
684
700
  declare function useAgentChat(): AgentChatState;
685
701
 
686
702
  declare function exportChatAsMarkdown(messages: ChatMessage[]): void;
687
703
 
704
+ declare function useSandboxSession(): {
705
+ sessionId: string | null;
706
+ sandboxClientId: string | null;
707
+ sourceClientId: string | null;
708
+ session: SessionInfo | null;
709
+ };
710
+
711
+ declare function clearQuillSandboxStorage(): void;
712
+
688
713
  /**
689
714
  * Environment selector plus create / edit environment modals.
690
715
  * Used in GlobalHeader and can be mounted in host app nav when managers use hideEnvDropdown.
691
716
  */
692
717
  declare function EnvironmentSwitcherWithModals(): react_jsx_runtime.JSX.Element;
693
718
 
694
- export { AdminProvider, AgentChat, AgentChatPanel, type AgentChatProps, ButtonPrimitive, ChartQueryBuilder as ChartBuilder, type ChatMessage, CreateEnvironment, CreateEnvironmentModal, DashboardManager, EditEnvironmentModal, EnvSelectPopover, EnvironmentSwitcherWithModals, HeaderPrimitive, ModalPrimitive, QuillSelectComponentWithCombo, SecondaryButtonPrimitive, type SessionInfo, TextInputPrimitive, type ToolCall, VirtualTableManager, exportChatAsMarkdown, useAdmin, useAgentChat };
719
+ export { AdminProvider, AgentChat, AgentChatPanel, type AgentChatProps, ButtonPrimitive, ChartQueryBuilder as ChartBuilder, type ChatMessage, CreateEnvironment, CreateEnvironmentModal, DashboardManager, EditEnvironmentModal, EnvSelectPopover, EnvironmentSwitcherWithModals, HeaderPrimitive, ModalPrimitive, QuillSelectComponentWithCombo, SecondaryButtonPrimitive, type SessionInfo, TextInputPrimitive, type ToolCall, VirtualTableManager, clearQuillSandboxStorage, exportChatAsMarkdown, useAdmin, useAgentChat, useSandboxSession };