@databrainhq/plugin 0.9.6 → 0.9.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/README.md CHANGED
@@ -1,26 +1,26 @@
1
- # @databrainhq/plugin
2
-
3
- > Databrain app ui plugin.
4
-
5
- [![NPM](https://img.shields.io/npm/v/@databrainhq/plugin.svg)](https://www.npmjs.com/package/@databrainhq/plugin) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
6
-
7
- ## Install
8
-
9
- ```bash
10
- npm install @databrainhq/plugin
11
- ```
12
-
13
- ## Usage
14
-
15
- ```tsx
16
- import { Dashboard } from '@databrainhq/plugin';
17
- import '@databrainhq/plugin/dist/style.css';
18
-
19
- const Example = () => {
20
- return <Dashboard token={/* Your Guest Token */} />;
21
- };
22
- ```
23
-
24
- ## License
25
-
26
- MIT © [databrainhq](https://github.com/databrainhq)
1
+ # @databrainhq/plugin
2
+
3
+ > Databrain app ui plugin.
4
+
5
+ [![NPM](https://img.shields.io/npm/v/@databrainhq/plugin.svg)](https://www.npmjs.com/package/@databrainhq/plugin) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @databrainhq/plugin
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```tsx
16
+ import { Dashboard } from '@databrainhq/plugin';
17
+ import '@databrainhq/plugin/dist/style.css';
18
+
19
+ const Example = () => {
20
+ return <Dashboard token={/* Your Guest Token */} />;
21
+ };
22
+ ```
23
+
24
+ ## License
25
+
26
+ MIT © [databrainhq](https://github.com/databrainhq)
@@ -6,6 +6,7 @@ declare type Props = {
6
6
  metricItem?: ExternalMetrics;
7
7
  client: string;
8
8
  companyTenancyType: string;
9
+ filterValues?: Record<string, string>;
9
10
  };
10
- export declare const DownloadRawCsvModal: ({ onCloseModal, isShowRawCsvModal, metricItem, client, companyTenancyType, }: Props) => JSX.Element;
11
+ export declare const DownloadRawCsvModal: ({ onCloseModal, isShowRawCsvModal, metricItem, client, companyTenancyType, filterValues, }: Props) => JSX.Element;
11
12
  export default DownloadRawCsvModal;
@@ -18,6 +18,6 @@ export declare type MetricCardProps = {
18
18
  onArchive?: (metricId: string) => void;
19
19
  onEdit?: (metric: ExternalMetrics, metricData?: Record<string, any>[]) => void;
20
20
  onTableView?: (metric: ExternalMetrics, metricData?: Record<string, any>[]) => void;
21
- onDownloadRawCsv?: (metric: ExternalMetrics) => void;
21
+ onDownloadRawCsv?: (metric: ExternalMetrics, filterValues: Record<string, any>) => void;
22
22
  };
23
23
  export declare const MetricCard: React.FC<MetricCardProps>;
@@ -61,3 +61,6 @@ export declare const FREQUENCY: {
61
61
  label: string;
62
62
  }[];
63
63
  export declare const RAW_CSV_OPTIONS: string[];
64
+ export declare const NONE = "NONE";
65
+ export declare const REQUESTED = "REQUESTED";
66
+ export declare const AVAILABLE = "AVAILABLE";
@@ -1,6 +1,6 @@
1
1
  import { FieldValues } from 'react-hook-form';
2
2
  import { ExternalMetrics } from '@/utils/generated/graphql';
3
- declare const useDownloadRawCsv: (onCloseModal: (value: boolean) => void, metricItem?: ExternalMetrics) => {
3
+ declare const useDownloadRawCsv: (onCloseModal: (value: boolean) => void, metricItem?: ExternalMetrics, filterValues?: Record<string, string>) => {
4
4
  isLoading: boolean;
5
5
  downloadCsvError: string;
6
6
  onSubmitDownloadCsv: ({ companyId, sqlQuery, values, clientName, tenancyType, metricName, workspaceId, }: {
@@ -20,17 +20,25 @@ declare const useDownloadRawCsv: (onCloseModal: (value: boolean) => void, metric
20
20
  isExpired: boolean;
21
21
  error: string | null | undefined;
22
22
  expireUrlIn: number;
23
+ status: string;
23
24
  } | {
24
25
  urls: never[];
25
26
  lastUpdatedAt: number;
26
27
  isExpired: boolean;
27
28
  error: null;
28
29
  expireUrlIn: number;
30
+ status: string;
29
31
  };
30
32
  handleDownload: (url: string) => void;
31
33
  csvDownloadUrlError: string;
32
- saveRawCsvDetails: ({ values, clientName, tenancyType, }: {
33
- values: FieldValues;
34
+ saveRawCsvDetails: ({ clientName, tenancyType, expirationMinutes, onSuccess, }: {
35
+ onSuccess: () => void;
36
+ expirationMinutes: number;
37
+ clientName?: string | undefined;
38
+ tenancyType?: string | undefined;
39
+ }) => void;
40
+ onRequestToDownload: ({ clientName, tenancyType, requestStatus, }: {
41
+ requestStatus: string;
34
42
  clientName?: string | undefined;
35
43
  tenancyType?: string | undefined;
36
44
  }) => void;