@quillsql/admin 1.8.5 → 1.8.7

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;
@@ -335,6 +330,7 @@ interface State {
335
330
  loading: boolean;
336
331
  publicKey: string;
337
332
  queryEndpoint: string;
333
+ streamEndpoint?: string;
338
334
  queryHeaders: object | undefined;
339
335
  withCredentials: boolean | undefined;
340
336
  client: any;
@@ -376,7 +372,12 @@ interface State {
376
372
  tenantField: string;
377
373
  tenantIds: (string | number)[];
378
374
  }[] | (string | number)[];
379
- activeSandboxId?: string | null;
375
+ /** Source (live) client id when viewing a sandbox environment. */
376
+ sandboxParentClientId: string | null;
377
+ /** Agent sandbox client id from the client task response. */
378
+ sandboxClientId: string | null;
379
+ /** Agent sandbox session id from the client task response. */
380
+ sandboxSessionId: string | null;
380
381
  /**
381
382
  * When true, dashboard / virtual-table surfaces omit the in-page environment
382
383
  * selector (e.g. when the host app renders env selection in a global header).
@@ -392,6 +393,12 @@ type Action = {
392
393
  } | {
393
394
  type: 'SET_CLIENTS';
394
395
  payload: any[];
396
+ } | {
397
+ type: 'PATCH_CLIENT_NAME';
398
+ payload: {
399
+ clientId: string;
400
+ name: string;
401
+ };
395
402
  } | {
396
403
  type: 'UPDATE_CLIENTS';
397
404
  payload: any;
@@ -478,8 +485,12 @@ type Action = {
478
485
  type: 'SET_ALL_STATE';
479
486
  payload: any;
480
487
  } | {
481
- type: 'SET_ACTIVE_SANDBOX_ID';
482
- payload: string | null;
488
+ type: 'SET_SANDBOX_FIELDS';
489
+ payload: {
490
+ sandboxParentClientId: string | null;
491
+ sandboxClientId: string | null;
492
+ sandboxSessionId: string | null;
493
+ };
483
494
  } | {
484
495
  type: 'SET_HIDE_ENV_DROPDOWN';
485
496
  payload: boolean;
@@ -495,7 +506,8 @@ declare const useAdmin: () => {
495
506
  state: State;
496
507
  dispatch: React.Dispatch<Action>;
497
508
  clientLoading: boolean;
498
- setClient: (client: QuillProviderClient, fetchTenantInfo?: boolean, preserveSelectedDashboard?: boolean) => void;
509
+ setClient: (client: QuillProviderClient, fetchTenantInfo?: boolean, preserveSelectedDashboard?: boolean, resetSandbox?: boolean, forceRefresh?: boolean) => void;
510
+ refreshClientsList: (clientId?: string) => Promise<any[]>;
499
511
  getToken: () => Promise<string>;
500
512
  quillFetchWithToken: (options: Omit<QuillFetchOptions, "getToken">) => Promise<QuillResults>;
501
513
  eventTracking: EventTracking | null;
@@ -508,8 +520,7 @@ declare function DashboardManager({ navigateToVirtualTableManager: navigateToVir
508
520
  containerStyle?: CSSProperties;
509
521
  }): react_jsx_runtime.JSX.Element;
510
522
 
511
- declare function ChartQueryBuilder({ activeComponent, onExit, containerStyle, destinationDashboard, }: {
512
- activeComponent: string;
523
+ declare function ChartQueryBuilder({ onExit, containerStyle, destinationDashboard, }: {
513
524
  onExit?: (report?: QuillReport$1) => void;
514
525
  containerStyle?: CSSProperties;
515
526
  destinationDashboard: string;
@@ -528,10 +539,11 @@ declare function CreateEnvironment({ onOnboardComplete, containerStyle, }: {
528
539
 
529
540
  interface EnvSelectPopoverProps {
530
541
  clients: any[];
531
- setClient: (client: any) => void;
542
+ setClient: (client: any, refreshTenants?: boolean) => void;
532
543
  client: any;
533
544
  theme: any;
534
- onSelectedEditEnvironment?: (environment: string) => void;
545
+ /** Open edit-environment UI (caller should expect `state.client` to become the active sandbox first). */
546
+ onSelectedEditEnvironment?: () => void;
535
547
  parentRef: React.RefObject<HTMLDivElement | null>;
536
548
  isLoading?: boolean;
537
549
  onCreateNewEnvironment?: () => void;
@@ -587,7 +599,7 @@ declare function QuillSelectComponentWithCombo({ options, value, width, onChange
587
599
  declare function EditEnvironmentModal({ isOpen, setIsOpen, onSave, ModalComponent, TextInputComponent, ButtonComponent, HeaderComponent, SecondaryButtonComponent, }: {
588
600
  isOpen: boolean;
589
601
  setIsOpen: (isOpen: boolean) => void;
590
- onSave: () => void;
602
+ onSave: () => void | Promise<void>;
591
603
  ModalComponent: any;
592
604
  TextInputComponent: ForwardRefExoticComponent<TextInputPrimitiveProps & RefAttributes<HTMLInputElement>> | ((props: TextInputPrimitiveProps) => React__default.JSX.Element);
593
605
  ButtonComponent: any;
@@ -676,10 +688,13 @@ interface AgentChatState {
676
688
  setMessages: React.Dispatch<React.SetStateAction<ChatMessage[]>>;
677
689
  session: SessionInfo | null;
678
690
  setSession: React.Dispatch<React.SetStateAction<SessionInfo | null>>;
679
- sessionInitializedForClientId: string | null;
680
- setSessionInitializedForClientId: React.Dispatch<React.SetStateAction<string | null>>;
681
691
  showToolOutputs: boolean;
682
692
  setShowToolOutputs: React.Dispatch<React.SetStateAction<boolean>>;
693
+ changelogEntries: ChangelogEntry[];
694
+ setChangelogEntries: (entries: ChangelogEntry[]) => void;
695
+ clearChangelogEntries: () => void;
696
+ /** Widgets + app-data refresh; only for fetch-changelog-list results. */
697
+ applyFetchChangelogListResult?: (entries: ChangelogEntry[]) => Promise<void>;
683
698
  }
684
699
  declare function useAgentChat(): AgentChatState;
685
700
 
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;
@@ -335,6 +330,7 @@ interface State {
335
330
  loading: boolean;
336
331
  publicKey: string;
337
332
  queryEndpoint: string;
333
+ streamEndpoint?: string;
338
334
  queryHeaders: object | undefined;
339
335
  withCredentials: boolean | undefined;
340
336
  client: any;
@@ -376,7 +372,12 @@ interface State {
376
372
  tenantField: string;
377
373
  tenantIds: (string | number)[];
378
374
  }[] | (string | number)[];
379
- activeSandboxId?: string | null;
375
+ /** Source (live) client id when viewing a sandbox environment. */
376
+ sandboxParentClientId: string | null;
377
+ /** Agent sandbox client id from the client task response. */
378
+ sandboxClientId: string | null;
379
+ /** Agent sandbox session id from the client task response. */
380
+ sandboxSessionId: string | null;
380
381
  /**
381
382
  * When true, dashboard / virtual-table surfaces omit the in-page environment
382
383
  * selector (e.g. when the host app renders env selection in a global header).
@@ -392,6 +393,12 @@ type Action = {
392
393
  } | {
393
394
  type: 'SET_CLIENTS';
394
395
  payload: any[];
396
+ } | {
397
+ type: 'PATCH_CLIENT_NAME';
398
+ payload: {
399
+ clientId: string;
400
+ name: string;
401
+ };
395
402
  } | {
396
403
  type: 'UPDATE_CLIENTS';
397
404
  payload: any;
@@ -478,8 +485,12 @@ type Action = {
478
485
  type: 'SET_ALL_STATE';
479
486
  payload: any;
480
487
  } | {
481
- type: 'SET_ACTIVE_SANDBOX_ID';
482
- payload: string | null;
488
+ type: 'SET_SANDBOX_FIELDS';
489
+ payload: {
490
+ sandboxParentClientId: string | null;
491
+ sandboxClientId: string | null;
492
+ sandboxSessionId: string | null;
493
+ };
483
494
  } | {
484
495
  type: 'SET_HIDE_ENV_DROPDOWN';
485
496
  payload: boolean;
@@ -495,7 +506,8 @@ declare const useAdmin: () => {
495
506
  state: State;
496
507
  dispatch: React.Dispatch<Action>;
497
508
  clientLoading: boolean;
498
- setClient: (client: QuillProviderClient, fetchTenantInfo?: boolean, preserveSelectedDashboard?: boolean) => void;
509
+ setClient: (client: QuillProviderClient, fetchTenantInfo?: boolean, preserveSelectedDashboard?: boolean, resetSandbox?: boolean, forceRefresh?: boolean) => void;
510
+ refreshClientsList: (clientId?: string) => Promise<any[]>;
499
511
  getToken: () => Promise<string>;
500
512
  quillFetchWithToken: (options: Omit<QuillFetchOptions, "getToken">) => Promise<QuillResults>;
501
513
  eventTracking: EventTracking | null;
@@ -508,8 +520,7 @@ declare function DashboardManager({ navigateToVirtualTableManager: navigateToVir
508
520
  containerStyle?: CSSProperties;
509
521
  }): react_jsx_runtime.JSX.Element;
510
522
 
511
- declare function ChartQueryBuilder({ activeComponent, onExit, containerStyle, destinationDashboard, }: {
512
- activeComponent: string;
523
+ declare function ChartQueryBuilder({ onExit, containerStyle, destinationDashboard, }: {
513
524
  onExit?: (report?: QuillReport$1) => void;
514
525
  containerStyle?: CSSProperties;
515
526
  destinationDashboard: string;
@@ -528,10 +539,11 @@ declare function CreateEnvironment({ onOnboardComplete, containerStyle, }: {
528
539
 
529
540
  interface EnvSelectPopoverProps {
530
541
  clients: any[];
531
- setClient: (client: any) => void;
542
+ setClient: (client: any, refreshTenants?: boolean) => void;
532
543
  client: any;
533
544
  theme: any;
534
- onSelectedEditEnvironment?: (environment: string) => void;
545
+ /** Open edit-environment UI (caller should expect `state.client` to become the active sandbox first). */
546
+ onSelectedEditEnvironment?: () => void;
535
547
  parentRef: React.RefObject<HTMLDivElement | null>;
536
548
  isLoading?: boolean;
537
549
  onCreateNewEnvironment?: () => void;
@@ -587,7 +599,7 @@ declare function QuillSelectComponentWithCombo({ options, value, width, onChange
587
599
  declare function EditEnvironmentModal({ isOpen, setIsOpen, onSave, ModalComponent, TextInputComponent, ButtonComponent, HeaderComponent, SecondaryButtonComponent, }: {
588
600
  isOpen: boolean;
589
601
  setIsOpen: (isOpen: boolean) => void;
590
- onSave: () => void;
602
+ onSave: () => void | Promise<void>;
591
603
  ModalComponent: any;
592
604
  TextInputComponent: ForwardRefExoticComponent<TextInputPrimitiveProps & RefAttributes<HTMLInputElement>> | ((props: TextInputPrimitiveProps) => React__default.JSX.Element);
593
605
  ButtonComponent: any;
@@ -676,10 +688,13 @@ interface AgentChatState {
676
688
  setMessages: React.Dispatch<React.SetStateAction<ChatMessage[]>>;
677
689
  session: SessionInfo | null;
678
690
  setSession: React.Dispatch<React.SetStateAction<SessionInfo | null>>;
679
- sessionInitializedForClientId: string | null;
680
- setSessionInitializedForClientId: React.Dispatch<React.SetStateAction<string | null>>;
681
691
  showToolOutputs: boolean;
682
692
  setShowToolOutputs: React.Dispatch<React.SetStateAction<boolean>>;
693
+ changelogEntries: ChangelogEntry[];
694
+ setChangelogEntries: (entries: ChangelogEntry[]) => void;
695
+ clearChangelogEntries: () => void;
696
+ /** Widgets + app-data refresh; only for fetch-changelog-list results. */
697
+ applyFetchChangelogListResult?: (entries: ChangelogEntry[]) => Promise<void>;
683
698
  }
684
699
  declare function useAgentChat(): AgentChatState;
685
700