@databrainhq/plugin 0.11.37 → 0.11.39

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.
Files changed (36) hide show
  1. package/README.md +233 -233
  2. package/dist/components/ExternalMetricForm/index.d.ts +2 -2
  3. package/dist/components/MetricCreation/MetricCreation.d.ts +1 -1
  4. package/dist/components/MetricList/MetricList.d.ts +1 -2
  5. package/dist/components/MetricList/components/DownloadRawCsvModal/index.d.ts +1 -1
  6. package/dist/components/MetricList/components/FullScreenView/index.d.ts +1 -1
  7. package/dist/components/MetricList/components/MetricCards/MetricCard.d.ts +1 -1
  8. package/dist/components/MetricList/components/index.d.ts +0 -1
  9. package/dist/consts/api.d.ts +37 -0
  10. package/dist/helpers/groupBy.d.ts +4 -8
  11. package/dist/hooks/index.d.ts +0 -2
  12. package/dist/hooks/useApplyAdminTheme.d.ts +1 -2
  13. package/dist/hooks/useDashboardContext.d.ts +4 -4
  14. package/dist/hooks/useDownloadRawCsv.d.ts +6 -44
  15. package/dist/hooks/useEmbeddedMetric.d.ts +2 -3
  16. package/dist/hooks/useExternalMetric.d.ts +14 -3
  17. package/dist/hooks/useGenerateDatasetMetrics.d.ts +9 -11
  18. package/dist/hooks/useMetricCard.d.ts +1 -2
  19. package/dist/hooks/useNewEmbeddedDashboard.d.ts +4 -4
  20. package/dist/hooks/useScheduleEmail.d.ts +2 -11
  21. package/dist/queries/externalDashboard.mutation.d.ts +43 -0
  22. package/dist/queries/externalDashboard.query.d.ts +13 -0
  23. package/dist/queries/metric.mutation.d.ts +13 -0
  24. package/dist/queries/metric.query.d.ts +7 -0
  25. package/dist/types/metricCreate.d.ts +1 -1
  26. package/dist/types/queryTypes.d.ts +239 -0
  27. package/dist/utils/fetcher.d.ts +10 -1
  28. package/dist/webcomponents.es.js +27968 -28495
  29. package/dist/webcomponents.umd.js +235 -569
  30. package/package.json +107 -108
  31. package/src/index.ts +7 -7
  32. package/dist/components/MetricList/components/MetricCards/SingleValueCard.d.ts +0 -3
  33. package/dist/helpers/timesAgo.d.ts +0 -2
  34. package/dist/hooks/useEmbeddedDashboard.d.ts +0 -67
  35. package/dist/hooks/useGenerateEmbeddedMetric.d.ts +0 -15
  36. package/dist/utils/generated/graphql.d.ts +0 -4514
package/package.json CHANGED
@@ -1,108 +1,107 @@
1
- {
2
- "name": "@databrainhq/plugin",
3
- "version": "0.11.37",
4
- "description": "Databrain app ui plugin.",
5
- "author": "",
6
- "license": "MIT",
7
- "repository": "databrainhq/plugin",
8
- "main": "src/index.ts",
9
- "exports": {
10
- ".": {
11
- "import": "./src/index.ts",
12
- "require": "./src/index.ts"
13
- },
14
- "./web": {
15
- "import": "./dist/webcomponents.es.js",
16
- "require": "./dist/webcomponents.umd.js",
17
- "types": "./dist/webcomponents.d.ts"
18
- }
19
- },
20
- "scripts": {
21
- "start:repl": "vite --host 0.0.0.0",
22
- "start": "vite --port 3005",
23
- "build:css": "tailwindcss build -i src/index.css -o dist/index.css",
24
- "build": "tsc && vite build",
25
- "husky": "husky install",
26
- "predeploy": "cd example && npm install && npm run build",
27
- "lint": "eslint --ext .tsx,.ts --ignore-path .gitignore --fix src",
28
- "codegen": "graphql-codegen --config codegen.yml -r dotenv/config",
29
- "prepare": "npm run build",
30
- "storybook:repl": "storybook dev -p 6006 --host 0.0.0.0",
31
- "storybook": "storybook dev -p 6006",
32
- "build-storybook": "storybook build"
33
- },
34
- "devDependencies": {
35
- "@commitlint/cli": "^17.0.3",
36
- "@commitlint/config-conventional": "^17.0.3",
37
- "@graphql-codegen/cli": "^2.16.4",
38
- "@graphql-codegen/introspection": "^2.2.3",
39
- "@graphql-codegen/typescript": "^2.8.7",
40
- "@graphql-codegen/typescript-operations": "^2.5.12",
41
- "@graphql-codegen/typescript-react-apollo": "^3.3.7",
42
- "@graphql-codegen/typescript-react-query": "^3.6.2",
43
- "@headlessui/react": "^1.7.2",
44
- "@iconify/json": "^2.2.6",
45
- "@r2wc/react-to-web-component": "^2.0.2",
46
- "@storybook/addon-essentials": "^7.0.9",
47
- "@storybook/addon-interactions": "^7.0.9",
48
- "@storybook/addon-links": "^7.0.9",
49
- "@storybook/blocks": "^7.0.9",
50
- "@storybook/react": "^7.0.9",
51
- "@storybook/react-vite": "^7.0.9",
52
- "@storybook/testing-library": "^0.0.14-next.2",
53
- "@svgr/core": "^6.5.1",
54
- "@tanstack/match-sorter-utils": "^8.8.4",
55
- "@tanstack/react-table": "^8.7.9",
56
- "@types/react": "^18.0.26",
57
- "@types/react-datepicker": "^4.11.2",
58
- "@types/react-dom": "^18.0.10",
59
- "@types/react-grid-layout": "^1.3.2",
60
- "@typescript-eslint/eslint-plugin": "^4.31.1",
61
- "@typescript-eslint/parser": "^4.31.1",
62
- "@vitejs/plugin-react": "^4.0",
63
- "ace-builds": "^1.17.0",
64
- "autoprefixer": "^10.4.7",
65
- "babel-eslint": "^10.0.3",
66
- "babel-loader": "^9.1.2",
67
- "classnames": "^2.3.2",
68
- "cross-env": "^7.0.2",
69
- "echarts": "^5.4.1",
70
- "echarts-for-react": "^3.0.2",
71
- "eslint": "^7.32.0",
72
- "eslint-config-airbnb": "^18.2.1",
73
- "eslint-config-airbnb-typescript": "^14.0.0",
74
- "eslint-config-prettier": "^8.3.0",
75
- "eslint-plugin-import": "^2.24.2",
76
- "eslint-plugin-jsx-a11y": "^6.6.0",
77
- "eslint-plugin-prettier": "^4.0.0",
78
- "eslint-plugin-react": "^7.30.1",
79
- "eslint-plugin-react-hooks": "^4.6.0",
80
- "eslint-plugin-unicorn": "^36.0.0",
81
- "graphql": "^16.6.0",
82
- "husky": "^8.0.1",
83
- "lint-staged": "^13.0.3",
84
- "postcss": "^8.4.21",
85
- "prettier": "^2.0.4",
86
- "react": "^18.2.0",
87
- "react-ace": "^10.1.0",
88
- "react-datepicker": "^4.11.0",
89
- "react-dom": "^18.2.0",
90
- "react-error-boundary": "^3.1.4",
91
- "react-grid-layout": "^1.3.4",
92
- "react-hook-form": "^7.33.1",
93
- "react-query": "^3.39.2",
94
- "simplebar-react": "^3.2.4",
95
- "storybook": "^7.0.9",
96
- "tailwindcss": "^3.2.4",
97
- "ts-node": "^10.9.1",
98
- "typescript": "^4.6.3",
99
- "unplugin-icons": "^0.14.7",
100
- "vite": "^4.3",
101
- "vite-plugin-css-injected-by-js": "^3.1.1",
102
- "vite-plugin-dts": "^2.3",
103
- "vite-tsconfig-paths": "^4.0.3"
104
- },
105
- "files": [
106
- "dist"
107
- ]
108
- }
1
+ {
2
+ "name": "@databrainhq/plugin",
3
+ "version": "0.11.39",
4
+ "description": "Databrain app ui plugin.",
5
+ "author": "",
6
+ "license": "MIT",
7
+ "repository": "databrainhq/plugin",
8
+ "main": "src/index.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./src/index.ts",
12
+ "require": "./src/index.ts"
13
+ },
14
+ "./web": {
15
+ "import": "./dist/webcomponents.es.js",
16
+ "require": "./dist/webcomponents.umd.js",
17
+ "types": "./dist/webcomponents.d.ts"
18
+ }
19
+ },
20
+ "scripts": {
21
+ "start:repl": "vite --host 0.0.0.0",
22
+ "start": "vite --port 3005",
23
+ "build:css": "tailwindcss build -i src/index.css -o dist/index.css",
24
+ "build": "tsc && vite build",
25
+ "husky": "husky install",
26
+ "predeploy": "cd example && npm install && npm run build",
27
+ "lint": "eslint --ext .tsx,.ts --ignore-path .gitignore --fix src",
28
+ "prepare": "npm run build",
29
+ "storybook:repl": "storybook dev -p 6006 --host 0.0.0.0",
30
+ "storybook": "storybook dev -p 6006",
31
+ "build-storybook": "storybook build"
32
+ },
33
+ "devDependencies": {
34
+ "@commitlint/cli": "^17.0.3",
35
+ "@commitlint/config-conventional": "^17.0.3",
36
+ "@graphql-codegen/cli": "^2.16.4",
37
+ "@graphql-codegen/introspection": "^2.2.3",
38
+ "@graphql-codegen/typescript": "^2.8.7",
39
+ "@graphql-codegen/typescript-operations": "^2.5.12",
40
+ "@graphql-codegen/typescript-react-apollo": "^3.3.7",
41
+ "@graphql-codegen/typescript-react-query": "^3.6.2",
42
+ "@headlessui/react": "^1.7.2",
43
+ "@iconify/json": "^2.2.6",
44
+ "@r2wc/react-to-web-component": "^2.0.2",
45
+ "@storybook/addon-essentials": "^7.0.9",
46
+ "@storybook/addon-interactions": "^7.0.9",
47
+ "@storybook/addon-links": "^7.0.9",
48
+ "@storybook/blocks": "^7.0.9",
49
+ "@storybook/react": "^7.0.9",
50
+ "@storybook/react-vite": "^7.0.9",
51
+ "@storybook/testing-library": "^0.0.14-next.2",
52
+ "@svgr/core": "^6.5.1",
53
+ "@tanstack/match-sorter-utils": "^8.8.4",
54
+ "@tanstack/react-table": "^8.7.9",
55
+ "@types/react": "^18.0.26",
56
+ "@types/react-datepicker": "^4.11.2",
57
+ "@types/react-dom": "^18.0.10",
58
+ "@types/react-grid-layout": "^1.3.2",
59
+ "@typescript-eslint/eslint-plugin": "^4.31.1",
60
+ "@typescript-eslint/parser": "^4.31.1",
61
+ "@vitejs/plugin-react": "^4.0",
62
+ "ace-builds": "^1.17.0",
63
+ "autoprefixer": "^10.4.7",
64
+ "babel-eslint": "^10.0.3",
65
+ "babel-loader": "^9.1.2",
66
+ "classnames": "^2.3.2",
67
+ "cross-env": "^7.0.2",
68
+ "echarts": "^5.4.1",
69
+ "echarts-for-react": "^3.0.2",
70
+ "eslint": "^7.32.0",
71
+ "eslint-config-airbnb": "^18.2.1",
72
+ "eslint-config-airbnb-typescript": "^14.0.0",
73
+ "eslint-config-prettier": "^8.3.0",
74
+ "eslint-plugin-import": "^2.24.2",
75
+ "eslint-plugin-jsx-a11y": "^6.6.0",
76
+ "eslint-plugin-prettier": "^4.0.0",
77
+ "eslint-plugin-react": "^7.30.1",
78
+ "eslint-plugin-react-hooks": "^4.6.0",
79
+ "eslint-plugin-unicorn": "^36.0.0",
80
+ "graphql": "^16.6.0",
81
+ "husky": "^8.0.1",
82
+ "lint-staged": "^13.0.3",
83
+ "postcss": "^8.4.21",
84
+ "prettier": "^2.0.4",
85
+ "react": "^18.2.0",
86
+ "react-ace": "^10.1.0",
87
+ "react-datepicker": "^4.11.0",
88
+ "react-dom": "^18.2.0",
89
+ "react-error-boundary": "^3.1.4",
90
+ "react-grid-layout": "^1.3.4",
91
+ "react-hook-form": "^7.33.1",
92
+ "react-query": "^3.39.2",
93
+ "simplebar-react": "^3.2.4",
94
+ "storybook": "^7.0.9",
95
+ "tailwindcss": "^3.2.4",
96
+ "ts-node": "^10.9.1",
97
+ "typescript": "^4.6.3",
98
+ "unplugin-icons": "^0.14.7",
99
+ "vite": "^4.3",
100
+ "vite-plugin-css-injected-by-js": "^3.1.1",
101
+ "vite-plugin-dts": "^2.3",
102
+ "vite-tsconfig-paths": "^4.0.3"
103
+ },
104
+ "files": [
105
+ "dist"
106
+ ]
107
+ }
package/src/index.ts CHANGED
@@ -1,7 +1,7 @@
1
- export * from './containers';
2
- export * as utils from './utils';
3
- export * as consts from './consts';
4
- export * as helpers from './helpers';
5
- export * as hooks from './hooks';
6
- export * as types from './types';
7
- export * as Ui from './components';
1
+ export * from './containers';
2
+ export * as utils from './utils';
3
+ export * as consts from './consts';
4
+ export * as helpers from './helpers';
5
+ export * as hooks from './hooks';
6
+ export * as types from './types';
7
+ export * as Ui from './components';
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { MetricCardProps } from '@/components/MetricList/components/MetricCards/MetricCard';
3
- export declare const SingleValueCard: React.FC<Omit<MetricCardProps, 'onMaximize'>>;
@@ -1,2 +0,0 @@
1
- declare const timeAgo: (unixTimestamp: number) => string;
2
- export default timeAgo;
@@ -1,67 +0,0 @@
1
- export declare const useEmbeddedDashboard: ({ token, dashboardId, }: {
2
- token: string;
3
- dashboardId?: string | undefined;
4
- }) => {
5
- isLoading: boolean;
6
- data: {
7
- clientId: string | undefined;
8
- companyId: any;
9
- isLiveMode: any;
10
- externalDashboardMetrics: {
11
- __typename?: "externalDashboardMetrics" | undefined;
12
- externalMetricId: any;
13
- externalDashboardId: any;
14
- externalMetric: {
15
- __typename?: "externalMetrics" | undefined;
16
- chartOptions: any;
17
- clientId?: string | null | undefined;
18
- companyId: any;
19
- companyIntegrationId: any;
20
- createdAt: any;
21
- createdBy?: string | null | undefined;
22
- description: string;
23
- id: any;
24
- inputFields?: any;
25
- integrationName: string;
26
- isCreatedByClient: boolean;
27
- isLive: boolean;
28
- metricId: string;
29
- metricQuery?: string | null | undefined;
30
- name: string;
31
- outputColumns?: string | null | undefined;
32
- query: string;
33
- timeGrain?: string | null | undefined;
34
- updatedAt: any;
35
- selectedGroupBy: any;
36
- isEnableGroupBy: boolean;
37
- groupBy: any;
38
- resizeAttributes: any;
39
- rlsConditions: any;
40
- clickActions: any;
41
- drillDownSettings?: any;
42
- datasetMetricSettings?: any;
43
- companyIntegration: {
44
- __typename?: "companyIntegrations" | undefined;
45
- name: string;
46
- workspaceId: any;
47
- };
48
- };
49
- }[] | undefined;
50
- externalDashboard: {
51
- __typename?: "externalDashboards" | undefined;
52
- id: any;
53
- name: string;
54
- filters: any;
55
- layout: any;
56
- } | undefined;
57
- externalDashboardId: any;
58
- rlsSettings: any;
59
- companyTenancyType: any;
60
- isAllowedToCreateMetrics: boolean;
61
- isAllowedToDeleteMetrics: boolean;
62
- isAllowedToUpdateMetrics: boolean;
63
- isAllowedToChangeLayout: boolean;
64
- workspace: any;
65
- sharingSettingsId: any;
66
- };
67
- };
@@ -1,15 +0,0 @@
1
- /// <reference types="react" />
2
- import { FieldValues } from 'react-hook-form';
3
- type Params = {
4
- clientId: string | null;
5
- companyId: string | null;
6
- setError: React.Dispatch<React.SetStateAction<string>>;
7
- setLoading: React.Dispatch<React.SetStateAction<boolean>>;
8
- setData: React.Dispatch<React.SetStateAction<any[] | undefined>>;
9
- setQuery: React.Dispatch<React.SetStateAction<string>>;
10
- setMetricQuery: React.Dispatch<React.SetStateAction<string | undefined>>;
11
- };
12
- export declare const useGenerateEmbeddedMetric: ({ clientId, companyId, setData, setError, setLoading, setQuery, setMetricQuery, }: Params) => {
13
- generateEmbeddedMetric: (data: FieldValues) => void;
14
- };
15
- export {};