@databrainhq/plugin 0.8.25 → 0.9.0

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.
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare type Props = {
3
+ onCancel: () => void;
4
+ };
5
+ declare const ScheduleEmailForm: ({ onCancel }: Props) => JSX.Element;
6
+ export default ScheduleEmailForm;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const ScheduleEmail: () => JSX.Element;
3
+ export default ScheduleEmail;
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import { FieldValues, Control } from 'react-hook-form';
3
+ declare type Props = {
4
+ control: Control<FieldValues, object>;
5
+ placeholder?: string;
6
+ name?: string;
7
+ id?: string;
8
+ value?: string;
9
+ label?: string;
10
+ type: string;
11
+ onBlur?: () => void;
12
+ onFocus?: () => void;
13
+ onKeyDown?: () => void;
14
+ onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
15
+ defaultValue?: string | number | readonly string[] | undefined;
16
+ error?: any;
17
+ icon?: any;
18
+ checked?: boolean;
19
+ isDisabled?: boolean;
20
+ labelClass?: string;
21
+ inputClass?: string;
22
+ className?: string;
23
+ innerPlaceholder?: boolean;
24
+ innerPlaceholderText?: string;
25
+ min?: number;
26
+ onChangeTags?: (tags: string[]) => void;
27
+ defaultTagValue?: string[];
28
+ };
29
+ declare const TagInputField: ({ control, placeholder, name, label, onChangeTags, defaultTagValue, }: Props) => JSX.Element;
30
+ export default TagInputField;
@@ -40,3 +40,23 @@ export declare const DESTINATIONS: Record<string, string>;
40
40
  export declare const DATABASE_NAME = "{{DATABASE_NAME}}";
41
41
  export declare const CLIENT_NAME_VAR_NUM = "'client_id_variable'";
42
42
  export declare const DATABASE = "DATABASE";
43
+ export declare const WEEK_DAYS: {
44
+ value: string;
45
+ label: string;
46
+ }[];
47
+ export declare const TIME_ZONES: {
48
+ value: string;
49
+ label: string;
50
+ }[];
51
+ export declare const TIME: {
52
+ value: string;
53
+ label: string;
54
+ }[];
55
+ export declare const DATE_NUM: {
56
+ value: string;
57
+ label: string;
58
+ }[];
59
+ export declare const FREQUENCY: {
60
+ value: string;
61
+ label: string;
62
+ }[];
@@ -1,6 +1,18 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
- import { DashboardProps } from './EmbededDashboard';
2
+ import { ThemeType } from '@/utils/theme';
3
+ export interface DashboardProps {
4
+ token: string;
5
+ options?: {
6
+ headerVariant?: 'static' | 'floating';
7
+ disableMetricCreation?: boolean;
8
+ disableMetricUpdation?: boolean;
9
+ disableMetricDeletion?: boolean;
10
+ disableLayoutCustomization?: boolean;
11
+ chartColors?: string[];
12
+ };
13
+ theme?: ThemeType;
14
+ }
3
15
  declare type PluginProviderProps = PropsWithChildren & Omit<DashboardProps, 'token'>;
4
- export declare const PluginProvider: React.FC<PluginProviderProps>;
5
- export declare const Dashboard: React.FC<DashboardProps>;
16
+ export declare const PluginProvider: ({ children, theme }: PluginProviderProps) => JSX.Element;
17
+ export declare const Dashboard: React.MemoExoticComponent<({ token, options, theme }: DashboardProps) => JSX.Element>;
6
18
  export {};
@@ -0,0 +1,6 @@
1
+ import { PropsWithChildren } from 'react';
2
+ declare type DashboardProviderProps = PropsWithChildren & {
3
+ token: string;
4
+ };
5
+ declare const DashboardProvider: ({ token, children }: DashboardProviderProps) => JSX.Element;
6
+ export default DashboardProvider;
@@ -1,12 +1,14 @@
1
1
  import React from 'react';
2
2
  import { ThemeType } from '@/utils';
3
- export interface DashboardProps {
4
- token: string;
3
+ export interface EmbeddedDashboardProps {
5
4
  options?: {
6
5
  headerVariant?: 'static' | 'floating';
7
6
  disableMetricCreation?: boolean;
7
+ disableMetricUpdation?: boolean;
8
+ disableMetricDeletion?: boolean;
9
+ disableLayoutCustomization?: boolean;
8
10
  chartColors?: string[];
9
11
  };
10
12
  theme?: ThemeType;
11
13
  }
12
- export declare const EmbeddedDashboard: React.FC<DashboardProps>;
14
+ export declare const EmbeddedDashboard: React.MemoExoticComponent<({ options, theme }: EmbeddedDashboardProps) => JSX.Element>;
@@ -0,0 +1,13 @@
1
+ interface ScheduleParams {
2
+ frequency: string;
3
+ weekDays: Record<string, boolean>;
4
+ date: {
5
+ value: string;
6
+ label: string;
7
+ }[];
8
+ hours: string;
9
+ time: string;
10
+ timezone: string;
11
+ }
12
+ declare const getNextScheduledTime: (params: ScheduleParams) => Date;
13
+ export default getNextScheduledTime;
@@ -3,7 +3,7 @@ export declare const groupByMultipleKeys: (rawData: any[] | undefined, keys: str
3
3
  export declare const groupMeasures: (rawData: any[] | undefined, dimensionKey: string, measureKeys: string[]) => any;
4
4
  export declare const updateGroupData: (data: any[] | undefined, keys: string[], selectedGroupBy: string[], setGroupedData: (value: React.SetStateAction<Record<string, any>[]>) => void) => void;
5
5
  export declare const updateDrilledData: (data: any[] | undefined, setGroupedData: (value: React.SetStateAction<Record<string, any>[]>) => void, measureKeys: string[], dimenstionKey: string) => void;
6
- export declare const findKeys: (obj: Record<string, any>) => {
6
+ export declare const findKeys: (arr: Record<string, any>[]) => {
7
7
  numberKeys: string[];
8
8
  stringKeys: string[];
9
9
  };
@@ -0,0 +1,29 @@
1
+ /// <reference types="react" />
2
+ import { EmbeddedDashboardMetricsQuery } from '@/utils/generated/graphql';
3
+ interface DashboardContextType {
4
+ isLoading: boolean | undefined;
5
+ token: string | undefined;
6
+ data: {
7
+ externalDashboardId: string;
8
+ companyId: string;
9
+ sharingSettingsId: string | undefined;
10
+ clientId: string | undefined;
11
+ isLiveMode: boolean;
12
+ externalDashboardMetrics: EmbeddedDashboardMetricsQuery['externalDashboardMetrics'] | undefined;
13
+ externalDashboard: {
14
+ __typename?: 'externalDashboards' | undefined;
15
+ id: any;
16
+ filters: any;
17
+ } | undefined;
18
+ rlsSettings: any | undefined;
19
+ companyTenancyType: any;
20
+ isAllowedToCreateMetrics: boolean | undefined;
21
+ isAllowedToDeleteMetrics: boolean | undefined;
22
+ isAllowedToUpdateMetrics: boolean | undefined;
23
+ isAllowedToChangeLayout: boolean | undefined;
24
+ workspace: any;
25
+ } | undefined;
26
+ }
27
+ export declare const DashboardContext: import("react").Context<DashboardContextType>;
28
+ export declare const useDashboardContext: () => DashboardContextType;
29
+ export {};
@@ -5,12 +5,14 @@ declare const useDownloadRawCsv: () => {
5
5
  setRawCsvModal: import("react").Dispatch<import("react").SetStateAction<boolean>>;
6
6
  isLoading: boolean;
7
7
  downloadCsvError: string;
8
- onSubmitDownloadCsv: ({ companyId, sqlQuery, values, clientName, tenancyType, }: {
8
+ onSubmitDownloadCsv: ({ companyId, sqlQuery, values, clientName, tenancyType, metricName, workspaceId, }: {
9
9
  values: FieldValues;
10
10
  sqlQuery: string;
11
11
  companyId: string;
12
12
  clientName?: string | undefined;
13
13
  tenancyType?: string | undefined;
14
+ metricName?: string | undefined;
15
+ workspaceId?: string | undefined;
14
16
  }) => void;
15
17
  handleSubmit: import("react-hook-form").UseFormHandleSubmit<FieldValues>;
16
18
  register: import("react-hook-form").UseFormRegister<FieldValues>;
@@ -38,6 +38,7 @@ export declare const useEmbeddedDashboard: (token: string) => {
38
38
  companyIntegration: {
39
39
  __typename?: "companyIntegrations" | undefined;
40
40
  name: string;
41
+ workspaceId: any;
41
42
  };
42
43
  };
43
44
  }[] | undefined;
@@ -54,5 +55,6 @@ export declare const useEmbeddedDashboard: (token: string) => {
54
55
  isAllowedToUpdateMetrics: boolean;
55
56
  isAllowedToChangeLayout: boolean;
56
57
  workspace: any;
58
+ sharingSettingsId: any;
57
59
  };
58
60
  };
@@ -0,0 +1,37 @@
1
+ /// <reference types="react" />
2
+ import { FieldValues } from 'react-hook-form';
3
+ declare type Params = {
4
+ onCancel: () => void;
5
+ };
6
+ declare const useScheduleEmail: ({ onCancel }: Params) => {
7
+ register: import("react-hook-form").UseFormRegister<FieldValues>;
8
+ handleSubmit: import("react-hook-form").UseFormHandleSubmit<FieldValues>;
9
+ watch: import("react-hook-form").UseFormWatch<FieldValues>;
10
+ control: import("react-hook-form").Control<FieldValues, object>;
11
+ setValue: import("react-hook-form").UseFormSetValue<FieldValues>;
12
+ getValues: import("react-hook-form").UseFormGetValues<FieldValues>;
13
+ reset: import("react-hook-form").UseFormReset<FieldValues>;
14
+ dashboardName: string;
15
+ chartOptions: {
16
+ value: any;
17
+ label: string;
18
+ }[];
19
+ onSave: (e?: import("react").BaseSyntheticEvent<object, any, any> | undefined) => Promise<void>;
20
+ isLoading: boolean;
21
+ isSuccess: boolean;
22
+ error: string;
23
+ isLoadingData: boolean;
24
+ scheduleReportConfig: {
25
+ __typename?: "scheduleEmailReports" | undefined;
26
+ externalDashboardId: any;
27
+ guestToken: any;
28
+ nextScheduledAt: string;
29
+ sharingSettingsId: any;
30
+ subject: string;
31
+ timeConfigurations: any;
32
+ id: any;
33
+ } | undefined;
34
+ onDelete: (e?: import("react").BaseSyntheticEvent<object, any, any> | undefined) => Promise<void>;
35
+ isDeleted: boolean;
36
+ };
37
+ export default useScheduleEmail;