@databrainhq/plugin 0.7.24 → 0.8.1

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 (34) hide show
  1. package/dist/components/ChartPopup/components/UnderlyingData/index.d.ts +11 -0
  2. package/dist/components/ChartPopup/index.d.ts +14 -0
  3. package/dist/components/Charts/AreaChart.d.ts +1 -1
  4. package/dist/components/Charts/BarChart.d.ts +2 -1
  5. package/dist/components/Charts/BoxPlot.d.ts +1 -1
  6. package/dist/components/Charts/BubbleChart.d.ts +1 -1
  7. package/dist/components/Charts/ComboChart.d.ts +1 -1
  8. package/dist/components/Charts/DoughnutChart.d.ts +1 -1
  9. package/dist/components/Charts/FunnelChart.d.ts +1 -1
  10. package/dist/components/Charts/GaugeChart.d.ts +1 -1
  11. package/dist/components/Charts/Histogram.d.ts +1 -1
  12. package/dist/components/Charts/LineChart.d.ts +2 -1
  13. package/dist/components/Charts/PieChart.d.ts +1 -1
  14. package/dist/components/Charts/RowChart.d.ts +1 -1
  15. package/dist/components/Charts/SankeyChart.d.ts +1 -1
  16. package/dist/components/Charts/ScatterChart.d.ts +1 -1
  17. package/dist/components/Charts/StackedBarChart.d.ts +1 -1
  18. package/dist/components/Charts/SteppedAreaChart.d.ts +1 -1
  19. package/dist/components/Charts/WaterfallChart.d.ts +1 -1
  20. package/dist/components/MetricChart/MetricChart.d.ts +2 -1
  21. package/dist/components/MetricList/MetricList.d.ts +1 -0
  22. package/dist/components/MetricList/components/DeleteMetricModal.d.ts +7 -0
  23. package/dist/components/MetricList/components/MetricCard.d.ts +1 -0
  24. package/dist/components/MetricList/index.d.ts +1 -0
  25. package/dist/components/ToggleButton/index.d.ts +1 -0
  26. package/dist/consts/app.d.ts +3 -0
  27. package/dist/hooks/useEmbeddedDashboard.d.ts +1 -0
  28. package/dist/hooks/useUnderlyingData.d.ts +15 -0
  29. package/dist/index.es.js +1343 -701
  30. package/dist/index.umd.js +76 -57
  31. package/dist/style.css +1 -1
  32. package/dist/types/app.d.ts +6 -0
  33. package/dist/utils/generated/graphql.d.ts +113 -7
  34. package/package.json +1 -1
@@ -150,3 +150,9 @@ export declare type MetricData = {
150
150
  createdBy: string;
151
151
  dateCreated: string;
152
152
  };
153
+ export declare type GetUnderlyingData = ({ columnName, value, setData, setLoading, }: {
154
+ columnName: string;
155
+ value: any;
156
+ setData: React.Dispatch<React.SetStateAction<any[]>>;
157
+ setLoading: React.Dispatch<React.SetStateAction<boolean>>;
158
+ }) => void;
@@ -59,6 +59,7 @@ export declare type EmbeddedDashboardDataOutput = {
59
59
  externalMetrics?: Maybe<Array<Maybe<Scalars['json']>>>;
60
60
  guestToken?: Maybe<Scalars['String']>;
61
61
  isAllowedToCreateMetrics?: Maybe<Scalars['Boolean']>;
62
+ isAllowedToDeleteMetrics?: Maybe<Scalars['Boolean']>;
62
63
  isLive?: Maybe<Scalars['Boolean']>;
63
64
  isTestKey?: Maybe<Scalars['Boolean']>;
64
65
  rlsSettings?: Maybe<Scalars['json']>;
@@ -120,6 +121,26 @@ export declare type GenerateExternalMetricQueryOutput = {
120
121
  __typename?: 'GenerateExternalMetricQueryOutput';
121
122
  query: Scalars['String'];
122
123
  };
124
+ export declare type GetUnderlyingDataInput = {
125
+ columnName: Scalars['String'];
126
+ companyId: Scalars['String'];
127
+ query: Scalars['String'];
128
+ value: Scalars['json'];
129
+ };
130
+ export declare type GetUnderlyingDataOutput = {
131
+ __typename?: 'GetUnderlyingDataOutput';
132
+ data: Array<Maybe<Scalars['json']>>;
133
+ timeTaken: Scalars['Int'];
134
+ };
135
+ export declare type GetUnderlyingSqlQueryInput = {
136
+ columnName: Scalars['String'];
137
+ sqlQuery: Scalars['String'];
138
+ value: Scalars['json'];
139
+ };
140
+ export declare type GetUnderlyingSqlQueryOutput = {
141
+ __typename?: 'GetUnderlyingSqlQueryOutput';
142
+ query: Scalars['String'];
143
+ };
123
144
  export declare type PreviewTableData = {
124
145
  __typename?: 'PreviewTableData';
125
146
  data?: Maybe<Scalars['json']>;
@@ -253,6 +274,7 @@ export declare type CompanySubsetTables = {
253
274
  __typename?: 'companySubsetTables';
254
275
  companyId: Scalars['uuid'];
255
276
  isAllowMetricCreation: Scalars['Boolean'];
277
+ isAllowMetricDeletion: Scalars['Boolean'];
256
278
  tableList: Scalars['jsonb'];
257
279
  };
258
280
  /** subset of tables of user database */
@@ -266,12 +288,14 @@ export declare type CompanySubsetTables_Bool_Exp = {
266
288
  _or?: InputMaybe<Array<CompanySubsetTables_Bool_Exp>>;
267
289
  companyId?: InputMaybe<Uuid_Comparison_Exp>;
268
290
  isAllowMetricCreation?: InputMaybe<Boolean_Comparison_Exp>;
291
+ isAllowMetricDeletion?: InputMaybe<Boolean_Comparison_Exp>;
269
292
  tableList?: InputMaybe<Jsonb_Comparison_Exp>;
270
293
  };
271
294
  /** Ordering options when selecting data from "companySubsetTables". */
272
295
  export declare type CompanySubsetTables_Order_By = {
273
296
  companyId?: InputMaybe<Order_By>;
274
297
  isAllowMetricCreation?: InputMaybe<Order_By>;
298
+ isAllowMetricDeletion?: InputMaybe<Order_By>;
275
299
  tableList?: InputMaybe<Order_By>;
276
300
  };
277
301
  /** select columns of table "companySubsetTables" */
@@ -281,6 +305,8 @@ export declare enum CompanySubsetTables_Select_Column {
281
305
  /** column name */
282
306
  IsAllowMetricCreation = "isAllowMetricCreation",
283
307
  /** column name */
308
+ IsAllowMetricDeletion = "isAllowMetricDeletion",
309
+ /** column name */
284
310
  TableList = "tableList"
285
311
  }
286
312
  /** columns and relationships of "externalDashboardMetrics" */
@@ -567,6 +593,7 @@ export declare type ExternalMetrics = {
567
593
  isCreatedByClient: Scalars['Boolean'];
568
594
  isEnableGroupBy: Scalars['Boolean'];
569
595
  isLive: Scalars['Boolean'];
596
+ isMarkedDeleted: Scalars['Boolean'];
570
597
  metricId: Scalars['String'];
571
598
  metricQuery?: Maybe<Scalars['String']>;
572
599
  name: Scalars['String'];
@@ -740,6 +767,7 @@ export declare type ExternalMetrics_Bool_Exp = {
740
767
  isCreatedByClient?: InputMaybe<Boolean_Comparison_Exp>;
741
768
  isEnableGroupBy?: InputMaybe<Boolean_Comparison_Exp>;
742
769
  isLive?: InputMaybe<Boolean_Comparison_Exp>;
770
+ isMarkedDeleted?: InputMaybe<Boolean_Comparison_Exp>;
743
771
  metricId?: InputMaybe<String_Comparison_Exp>;
744
772
  metricQuery?: InputMaybe<String_Comparison_Exp>;
745
773
  name?: InputMaybe<String_Comparison_Exp>;
@@ -861,6 +889,7 @@ export declare type ExternalMetrics_Order_By = {
861
889
  isCreatedByClient?: InputMaybe<Order_By>;
862
890
  isEnableGroupBy?: InputMaybe<Order_By>;
863
891
  isLive?: InputMaybe<Order_By>;
892
+ isMarkedDeleted?: InputMaybe<Order_By>;
864
893
  metricId?: InputMaybe<Order_By>;
865
894
  metricQuery?: InputMaybe<Order_By>;
866
895
  name?: InputMaybe<Order_By>;
@@ -872,6 +901,10 @@ export declare type ExternalMetrics_Order_By = {
872
901
  timeGrain?: InputMaybe<Order_By>;
873
902
  updatedAt?: InputMaybe<Order_By>;
874
903
  };
904
+ /** primary key columns input for table: externalMetrics */
905
+ export declare type ExternalMetrics_Pk_Columns_Input = {
906
+ id: Scalars['uuid'];
907
+ };
875
908
  /** select columns of table "externalMetrics" */
876
909
  export declare enum ExternalMetrics_Select_Column {
877
910
  /** column name */
@@ -905,6 +938,8 @@ export declare enum ExternalMetrics_Select_Column {
905
938
  /** column name */
906
939
  IsLive = "isLive",
907
940
  /** column name */
941
+ IsMarkedDeleted = "isMarkedDeleted",
942
+ /** column name */
908
943
  MetricId = "metricId",
909
944
  /** column name */
910
945
  MetricQuery = "metricQuery",
@@ -925,10 +960,14 @@ export declare enum ExternalMetrics_Select_Column {
925
960
  /** column name */
926
961
  UpdatedAt = "updatedAt"
927
962
  }
928
- /** placeholder for update columns of table "externalMetrics" (current role has no relevant permissions) */
963
+ /** input type for updating data in table "externalMetrics" */
964
+ export declare type ExternalMetrics_Set_Input = {
965
+ isMarkedDeleted?: InputMaybe<Scalars['Boolean']>;
966
+ };
967
+ /** update columns of table "externalMetrics" */
929
968
  export declare enum ExternalMetrics_Update_Column {
930
- /** placeholder (do not use) */
931
- Placeholder = "_PLACEHOLDER"
969
+ /** column name */
970
+ IsMarkedDeleted = "isMarkedDeleted"
932
971
  }
933
972
  /** columns and relationships of "guestTokens" */
934
973
  export declare type GuestTokens = {
@@ -1018,6 +1057,8 @@ export declare type Mutation_Root = {
1018
1057
  generateDatasetMetrics?: Maybe<GenerateDatasetMetricsOutput>;
1019
1058
  generateEmbeddedMetic?: Maybe<GenerateEmbeddedMeticOutput>;
1020
1059
  generateExternalMetricQuery?: Maybe<GenerateExternalMetricQueryOutput>;
1060
+ getUnderlyingData?: Maybe<GetUnderlyingDataOutput>;
1061
+ getUnderlyingSqlQuery?: Maybe<GetUnderlyingSqlQueryOutput>;
1021
1062
  /** insert data into the table: "externalDashboardMetrics" */
1022
1063
  insert_externalDashboardMetrics?: Maybe<ExternalDashboardMetrics_Mutation_Response>;
1023
1064
  /** insert a single row into the table: "externalDashboardMetrics" */
@@ -1031,6 +1072,10 @@ export declare type Mutation_Root = {
1031
1072
  /** insert a single row into the table: "externalMetrics" */
1032
1073
  insert_externalMetrics_one?: Maybe<ExternalMetrics>;
1033
1074
  previewTable?: Maybe<PreviewTableOutput>;
1075
+ /** update data of the table: "externalMetrics" */
1076
+ update_externalMetrics?: Maybe<ExternalMetrics_Mutation_Response>;
1077
+ /** update single row of the table: "externalMetrics" */
1078
+ update_externalMetrics_by_pk?: Maybe<ExternalMetrics>;
1034
1079
  };
1035
1080
  /** mutation root */
1036
1081
  export declare type Mutation_RootCompanySubsetTableDataArgs = {
@@ -1061,6 +1106,14 @@ export declare type Mutation_RootGenerateExternalMetricQueryArgs = {
1061
1106
  input: GenerateExternalMetricQueryInput;
1062
1107
  };
1063
1108
  /** mutation root */
1109
+ export declare type Mutation_RootGetUnderlyingDataArgs = {
1110
+ input: GetUnderlyingDataInput;
1111
+ };
1112
+ /** mutation root */
1113
+ export declare type Mutation_RootGetUnderlyingSqlQueryArgs = {
1114
+ input: GetUnderlyingSqlQueryInput;
1115
+ };
1116
+ /** mutation root */
1064
1117
  export declare type Mutation_RootInsert_ExternalDashboardMetricsArgs = {
1065
1118
  objects: Array<ExternalDashboardMetrics_Insert_Input>;
1066
1119
  on_conflict?: InputMaybe<ExternalDashboardMetrics_On_Conflict>;
@@ -1094,6 +1147,16 @@ export declare type Mutation_RootInsert_ExternalMetrics_OneArgs = {
1094
1147
  export declare type Mutation_RootPreviewTableArgs = {
1095
1148
  input: PreviewTableInput;
1096
1149
  };
1150
+ /** mutation root */
1151
+ export declare type Mutation_RootUpdate_ExternalMetricsArgs = {
1152
+ _set?: InputMaybe<ExternalMetrics_Set_Input>;
1153
+ where: ExternalMetrics_Bool_Exp;
1154
+ };
1155
+ /** mutation root */
1156
+ export declare type Mutation_RootUpdate_ExternalMetrics_By_PkArgs = {
1157
+ _set?: InputMaybe<ExternalMetrics_Set_Input>;
1158
+ pk_columns: ExternalMetrics_Pk_Columns_Input;
1159
+ };
1097
1160
  /** column ordering options */
1098
1161
  export declare enum Order_By {
1099
1162
  /** in ascending order, nulls last */
@@ -1690,14 +1753,15 @@ export declare type GuestTokenParamsQuery = {
1690
1753
  params: any;
1691
1754
  } | null;
1692
1755
  };
1693
- export declare type MetricCreationAccessQueryVariables = Exact<{
1756
+ export declare type MetricAccessQueryVariables = Exact<{
1694
1757
  companyId?: InputMaybe<Scalars['uuid']>;
1695
1758
  }>;
1696
- export declare type MetricCreationAccessQuery = {
1759
+ export declare type MetricAccessQuery = {
1697
1760
  __typename?: 'query_root';
1698
1761
  companySubsetTables: Array<{
1699
1762
  __typename?: 'companySubsetTables';
1700
1763
  isAllowMetricCreation: boolean;
1764
+ isAllowMetricDeletion: boolean;
1701
1765
  }>;
1702
1766
  };
1703
1767
  export declare type GetThemesQueryVariables = Exact<{
@@ -1716,6 +1780,30 @@ export declare type GetThemesQuery = {
1716
1780
  chart: any;
1717
1781
  }>;
1718
1782
  };
1783
+ export declare type UnderlyingDataMutationVariables = Exact<{
1784
+ columnName?: InputMaybe<Scalars['String']>;
1785
+ companyId?: InputMaybe<Scalars['String']>;
1786
+ query?: InputMaybe<Scalars['String']>;
1787
+ value?: InputMaybe<Scalars['json']>;
1788
+ }>;
1789
+ export declare type UnderlyingDataMutation = {
1790
+ __typename?: 'mutation_root';
1791
+ getUnderlyingData?: {
1792
+ __typename?: 'GetUnderlyingDataOutput';
1793
+ data: Array<any | null>;
1794
+ timeTaken: number;
1795
+ } | null;
1796
+ };
1797
+ export declare type MarkDeleteMetricMutationVariables = Exact<{
1798
+ id?: Scalars['uuid'];
1799
+ }>;
1800
+ export declare type MarkDeleteMetricMutation = {
1801
+ __typename?: 'mutation_root';
1802
+ update_externalMetrics_by_pk?: {
1803
+ __typename?: 'externalMetrics';
1804
+ id: any;
1805
+ } | null;
1806
+ };
1719
1807
  export declare type PreviewTableMutationVariables = Exact<{
1720
1808
  companyId?: InputMaybe<Scalars['String']>;
1721
1809
  tableName?: InputMaybe<Scalars['String']>;
@@ -1845,10 +1933,28 @@ export declare const ExternalDashboardListDocument = "\n query ExternalDashbo
1845
1933
  export declare const useExternalDashboardListQuery: <TData = ExternalDashboardListQuery, TError = unknown>(variables?: ExternalDashboardListQueryVariables, options?: UseQueryOptions<ExternalDashboardListQuery, TError, TData, import("react-query").QueryKey> | undefined) => import("react-query").UseQueryResult<TData, TError>;
1846
1934
  export declare const GuestTokenParamsDocument = "\n query GuestTokenParams($id: uuid = \"\") {\n guestTokens_by_pk(id: $id) {\n clientId\n companyId\n id\n params\n }\n}\n ";
1847
1935
  export declare const useGuestTokenParamsQuery: <TData = GuestTokenParamsQuery, TError = unknown>(variables?: GuestTokenParamsQueryVariables, options?: UseQueryOptions<GuestTokenParamsQuery, TError, TData, import("react-query").QueryKey> | undefined) => import("react-query").UseQueryResult<TData, TError>;
1848
- export declare const MetricCreationAccessDocument = "\n query MetricCreationAccess($companyId: uuid = \"\") {\n companySubsetTables(where: {companyId: {_eq: $companyId}}) {\n isAllowMetricCreation\n }\n}\n ";
1849
- export declare const useMetricCreationAccessQuery: <TData = MetricCreationAccessQuery, TError = unknown>(variables?: MetricCreationAccessQueryVariables, options?: UseQueryOptions<MetricCreationAccessQuery, TError, TData, import("react-query").QueryKey> | undefined) => import("react-query").UseQueryResult<TData, TError>;
1936
+ export declare const MetricAccessDocument = "\n query MetricAccess($companyId: uuid = \"\") {\n companySubsetTables(where: {companyId: {_eq: $companyId}}) {\n isAllowMetricCreation\n isAllowMetricDeletion\n }\n}\n ";
1937
+ export declare const useMetricAccessQuery: <TData = MetricAccessQuery, TError = unknown>(variables?: MetricAccessQueryVariables, options?: UseQueryOptions<MetricAccessQuery, TError, TData, import("react-query").QueryKey> | undefined) => import("react-query").UseQueryResult<TData, TError>;
1850
1938
  export declare const GetThemesDocument = "\n query GetThemes($companyId: uuid! = \"\") {\n themes(where: {companyId: {_eq: $companyId}}) {\n id\n companyId\n general\n dashboard\n cardTitle\n cardDescription\n chart\n }\n}\n ";
1851
1939
  export declare const useGetThemesQuery: <TData = GetThemesQuery, TError = unknown>(variables?: GetThemesQueryVariables, options?: UseQueryOptions<GetThemesQuery, TError, TData, import("react-query").QueryKey> | undefined) => import("react-query").UseQueryResult<TData, TError>;
1940
+ export declare const UnderlyingDataDocument = "\n mutation UnderlyingData($columnName: String = \"\", $companyId: String = \"\", $query: String = \"\", $value: json = \"\") {\n getUnderlyingData(\n input: {columnName: $columnName, companyId: $companyId, query: $query, value: $value}\n ) {\n data\n timeTaken\n }\n}\n ";
1941
+ export declare const useUnderlyingDataMutation: <TError = unknown, TContext = unknown>(options?: UseMutationOptions<UnderlyingDataMutation, TError, Exact<{
1942
+ columnName?: InputMaybe<string> | undefined;
1943
+ companyId?: InputMaybe<string> | undefined;
1944
+ query?: InputMaybe<string> | undefined;
1945
+ value?: InputMaybe<Scalars['json']>;
1946
+ }>, TContext> | undefined) => import("react-query").UseMutationResult<UnderlyingDataMutation, TError, Exact<{
1947
+ columnName?: InputMaybe<string> | undefined;
1948
+ companyId?: InputMaybe<string> | undefined;
1949
+ query?: InputMaybe<string> | undefined;
1950
+ value?: InputMaybe<Scalars['json']>;
1951
+ }>, TContext>;
1952
+ export declare const MarkDeleteMetricDocument = "\n mutation MarkDeleteMetric($id: uuid! = \"\") {\n update_externalMetrics_by_pk(\n pk_columns: {id: $id}\n _set: {isMarkedDeleted: true}\n ) {\n id\n }\n}\n ";
1953
+ export declare const useMarkDeleteMetricMutation: <TError = unknown, TContext = unknown>(options?: UseMutationOptions<MarkDeleteMetricMutation, TError, Exact<{
1954
+ id?: Scalars['uuid'];
1955
+ }>, TContext> | undefined) => import("react-query").UseMutationResult<MarkDeleteMetricMutation, TError, Exact<{
1956
+ id?: Scalars['uuid'];
1957
+ }>, TContext>;
1852
1958
  export declare const PreviewTableDocument = "\n mutation PreviewTable($companyId: String = \"\", $tableName: String = \"\", $limit: Int = 10) {\n previewTable(\n input: {companyId: $companyId, tableName: $tableName, limit: $limit}\n ) {\n data {\n data\n isError\n name\n }\n error {\n message\n }\n }\n}\n ";
1853
1959
  export declare const usePreviewTableMutation: <TError = unknown, TContext = unknown>(options?: UseMutationOptions<PreviewTableMutation, TError, Exact<{
1854
1960
  companyId?: InputMaybe<string> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@databrainhq/plugin",
3
- "version": "0.7.24",
3
+ "version": "0.8.1",
4
4
  "description": "Databrain app dashboard ui plugin.",
5
5
  "author": "",
6
6
  "license": "MIT",