@databrainhq/plugin 0.14.38 → 0.14.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.
@@ -44,4 +44,6 @@ export declare const METRIC_SHARE_CSV_PATH: string;
44
44
  export declare const METRIC_SHARE_CSV_MUTATION = "invokeShareCsv";
45
45
  export declare const METRIC_MARK_ARCHIVED_PATH: string;
46
46
  export declare const METRIC_MARK_ARCHIVED_MUTATION = "markArchived";
47
+ export declare const METRIC_EXECUTE_PYTHON_CODE_PATH: string;
48
+ export declare const METRIC_EXECUTE_PYTHON_CODE_MUTATION = "executePython";
47
49
  export declare const METRIC_DOWNLOAD_RAW_CSV_PATH: string;
@@ -8,3 +8,4 @@ export * from './useArchiveMetric';
8
8
  export * from './useEmbeddedMetric';
9
9
  export * from './useDrag';
10
10
  export * from './useDrop';
11
+ export * from './usePythonResults';
@@ -15,5 +15,6 @@ declare const useDownloadRawCsv: ({ onCloseModal, sharingSettingsId, metricItem,
15
15
  register: import("react-hook-form").UseFormRegister<FieldValues>;
16
16
  control: import("react-hook-form").Control<FieldValues, any>;
17
17
  setValue: import("react-hook-form").UseFormSetValue<FieldValues>;
18
+ errors: import("react-hook-form").FieldErrors<FieldValues>;
18
19
  };
19
20
  export default useDownloadRawCsv;
@@ -0,0 +1,17 @@
1
+ import { RlsCondition, SqlError, TableColumn } from '@/types';
2
+ export declare const usePythonResults: ({ setError, setLoading, setData, }: {
3
+ setError?: ((error: SqlError) => void) | undefined;
4
+ setLoading?: ((loading: boolean) => void) | undefined;
5
+ setData?: ((data: Record<string, any>[]) => void) | undefined;
6
+ }) => {
7
+ pythonResult: Record<string, any>[];
8
+ pythonError: string;
9
+ isLoadingPython: boolean;
10
+ pythonColumns: TableColumn[];
11
+ executePython: ({ code, clientId, rlsConditions, companyId, }: {
12
+ code: string;
13
+ clientId?: string | undefined;
14
+ rlsConditions?: RlsCondition[] | undefined;
15
+ companyId: string;
16
+ }) => Promise<void>;
17
+ };
@@ -24,5 +24,6 @@ declare const useScheduleEmail: ({ onCancel }: Params) => {
24
24
  scheduleReportConfig: any;
25
25
  onDelete: (e?: import("react").BaseSyntheticEvent<object, any, any> | undefined) => Promise<void>;
26
26
  isDeleted: boolean;
27
+ errors: import("react-hook-form").FieldErrors<FieldValues>;
27
28
  };
28
29
  export default useScheduleEmail;
@@ -1,4 +1,4 @@
1
- import { UseMetricColumnMutationInputType, UseMetricUnderlyingDataMutationInputType, UseMetricShareCsvMutationInputType, UseMarkArchivedMutationInputType } from '@/types/queryTypes';
1
+ import { UseMetricColumnMutationInputType, UseMetricUnderlyingDataMutationInputType, UseMetricShareCsvMutationInputType, UseMarkArchivedMutationInputType, UseExecutePythonMutationInputType } from '@/types/queryTypes';
2
2
  export declare const useMetricColumnMutation: () => import("react-query").UseMutationResult<{
3
3
  data: unknown;
4
4
  }, unknown, UseMetricColumnMutationInputType, unknown>;
@@ -11,3 +11,6 @@ export declare const useMetricShareCsvMutation: () => import("react-query").UseM
11
11
  export declare const useMarkArchivedMutation: () => import("react-query").UseMutationResult<{
12
12
  data: unknown;
13
13
  }, unknown, UseMarkArchivedMutationInputType, unknown>;
14
+ export declare const useExecutePythonMutation: () => import("react-query").UseMutationResult<{
15
+ data: unknown;
16
+ }, unknown, UseExecutePythonMutationInputType, unknown>;
@@ -1,3 +1,4 @@
1
+ import { RlsCondition } from './app';
1
2
  import { DatasetMetricCreationConfiguration } from './metricCreate';
2
3
  export type UseDashboardDataQueryInputType = {
3
4
  token: string;
@@ -113,6 +114,12 @@ export type UseMarkArchivedMutationInputType = {
113
114
  id?: string;
114
115
  clientId?: string;
115
116
  };
117
+ export type UseExecutePythonMutationInputType = {
118
+ code: string;
119
+ clientId?: string;
120
+ companyId: string;
121
+ rlsConditions?: RlsCondition[];
122
+ };
116
123
  export type ExternalMetricsInsertInput = {
117
124
  chartOptions?: any;
118
125
  clientDeletedMetrics?: any;