@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 +26 -26
- package/dist/components/MetricList/components/DownloadRawCsvModal.d.ts +2 -1
- package/dist/components/MetricList/components/MetricCard.d.ts +1 -1
- package/dist/consts/app.d.ts +3 -0
- package/dist/hooks/useDownloadRawCsv.d.ts +11 -3
- package/dist/index.es.js +683 -320
- package/dist/index.umd.js +149 -125
- package/dist/style.css +1 -1
- package/dist/typings.d.ts +17 -17
- package/dist/utils/generated/graphql.d.ts +208 -2
- package/package.json +96 -96
package/README.md
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
# @databrainhq/plugin
|
|
2
|
-
|
|
3
|
-
> Databrain app ui plugin.
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/@databrainhq/plugin) [](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
|
+
[](https://www.npmjs.com/package/@databrainhq/plugin) [](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>;
|
package/dist/consts/app.d.ts
CHANGED
|
@@ -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: ({
|
|
33
|
-
|
|
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;
|