app-v3-scripts-editor 1.16.1 → 1.17.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.
- package/dist/app-v3-scripts-editor.css +1 -1
- package/dist/app-v3-scripts-editor.es.js +24684 -23902
- package/dist/app-v3-scripts-editor.umd.js +140 -141
- package/dist/src/lib/components/Blocks/Contact/trigger/types.d.ts +3 -3
- package/dist/src/lib/components/Blocks/Email/types.d.ts +3 -3
- package/dist/src/lib/components/Blocks/Notification/types.d.ts +3 -3
- package/dist/src/lib/components/Blocks/Schedule/block.d.ts +3 -0
- package/dist/src/lib/components/Blocks/Schedule/index.css.d.ts +17 -0
- package/dist/src/lib/components/Blocks/Schedule/index.d.ts +4 -0
- package/dist/src/lib/components/Blocks/Schedule/index.settings.d.ts +3 -0
- package/dist/src/lib/components/Blocks/Schedule/node.d.ts +3 -0
- package/dist/src/lib/components/Blocks/Schedule/setting/Action.d.ts +4 -0
- package/dist/src/lib/components/Blocks/Schedule/setting/Output.d.ts +5 -0
- package/dist/src/lib/components/Blocks/Schedule/setting/Setting.d.ts +4 -0
- package/dist/src/lib/components/Blocks/Schedule/types.d.ts +91 -0
- package/dist/src/lib/components/Scripts/types.d.ts +1 -0
- package/dist/src/lib/components/Shared/SuggestVariableNode/flatten.d.ts +3 -0
- package/dist/src/lib/components/Shared/SuggestVariableNode/index.d.ts +3 -6
- package/dist/src/lib/components/Shared/SuggestVariableNode/type.d.ts +25 -0
- package/dist/src/lib/constants/block-types.d.ts +1 -0
- package/dist/src/lib/constants/common.d.ts +4 -2
- package/dist/src/lib/constants/date-time.d.ts +2 -0
- package/dist/src/lib/constants/initial-script.d.ts +1 -0
- package/dist/src/lib/constants/node-types.d.ts +1 -0
- package/dist/src/lib/constants/sidebar-buttons.d.ts +2 -1
- package/dist/src/lib/hooks/use-variable-suggest/index.d.ts +17 -0
- package/dist/src/lib/provider/instance-context/index.d.ts +1 -0
- package/dist/src/lib/utils/common.d.ts +8 -3
- package/dist/src/services/output/useGetOutput.d.ts +5 -1
- package/dist/src/services/types.d.ts +9 -1
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@ import { Node, NodeProps } from '@xyflow/react';
|
|
|
2
2
|
import { IFilterGroup } from '../../../../../services';
|
|
3
3
|
import { BlockTypeProps } from '../../../../constants';
|
|
4
4
|
export declare enum CONTACT_TRIGGER_TYPE {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
CREATED = "created",
|
|
6
|
+
UPDATED = "updated",
|
|
7
|
+
DELETED = "deleted",
|
|
8
8
|
TIME = "TIME"
|
|
9
9
|
}
|
|
10
10
|
export declare const ContactTriggerTypeLabel: {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Node, NodeProps } from '@xyflow/react';
|
|
2
2
|
import { BlockTypeProps } from '../../../constants';
|
|
3
3
|
export declare enum EMAIL_ACTION_TYPE {
|
|
4
|
-
|
|
4
|
+
SEND_MAIL = "SEND_MAIL"
|
|
5
5
|
}
|
|
6
6
|
export declare const EmailTypeLabel: {
|
|
7
|
-
|
|
7
|
+
SEND_MAIL: string;
|
|
8
8
|
};
|
|
9
9
|
export declare const EmailTypeDescription: {
|
|
10
|
-
|
|
10
|
+
SEND_MAIL: string;
|
|
11
11
|
};
|
|
12
12
|
export declare const EmailTypeList: EMAIL_ACTION_TYPE[];
|
|
13
13
|
export interface EmailNodeData extends Record<string, unknown> {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Node, NodeProps } from '@xyflow/react';
|
|
2
2
|
import { BlockTypeProps } from '../../../constants';
|
|
3
3
|
export declare enum NOTIFICATION_ACTION_TYPE {
|
|
4
|
-
|
|
4
|
+
SEND_IN_APP_WEB = "SEND_IN_APP_WEB",
|
|
5
5
|
TELEGRAM = "TELEGRAM"
|
|
6
6
|
}
|
|
7
7
|
export declare const NotificationTypeLabel: {
|
|
8
|
-
|
|
8
|
+
SEND_IN_APP_WEB: string;
|
|
9
9
|
TELEGRAM: string;
|
|
10
10
|
};
|
|
11
11
|
export declare const NotificationTypeDescription: {
|
|
12
|
-
|
|
12
|
+
SEND_IN_APP_WEB: string;
|
|
13
13
|
TELEGRAM: string;
|
|
14
14
|
};
|
|
15
15
|
export declare const NotificationTypeList: NOTIFICATION_ACTION_TYPE[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const wrapper: string;
|
|
2
|
+
export declare const container: string;
|
|
3
|
+
export declare const iconWrapper: string;
|
|
4
|
+
export declare const iconPrimaryStyle: string;
|
|
5
|
+
export declare const iconAbsoluteStyle: string;
|
|
6
|
+
export declare const settingsContainer: string;
|
|
7
|
+
export declare const alertGroup: string;
|
|
8
|
+
export declare const radioGroup: string;
|
|
9
|
+
export declare const radioSpace: string;
|
|
10
|
+
export declare const radioItem: string;
|
|
11
|
+
export declare const radioContent: string;
|
|
12
|
+
export declare const checkIconWrapper: string;
|
|
13
|
+
export declare const triangle: string;
|
|
14
|
+
export declare const checkIcon: string;
|
|
15
|
+
export declare const emailTypeGroup: string;
|
|
16
|
+
export declare const radioButton: string;
|
|
17
|
+
export declare const radioCol: string;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Node, NodeProps } from '@xyflow/react';
|
|
2
|
+
import { BlockTypeProps } from '../../../constants';
|
|
3
|
+
import { default as dayjs } from 'dayjs';
|
|
4
|
+
export declare enum SCHEDULE_ACTION_TYPE {
|
|
5
|
+
DAILY = "DAILY",
|
|
6
|
+
WEEKLY = "WEEKLY",
|
|
7
|
+
MONTHLY = "MONTHLY",
|
|
8
|
+
PERIODIC = "PERIODIC"
|
|
9
|
+
}
|
|
10
|
+
export declare enum SCHEDULE_VALIDITY_TYPE {
|
|
11
|
+
DEFAULT_2_YEARS = "DEFAULT_2_YEARS",
|
|
12
|
+
CUSTOM = "CUSTOM"
|
|
13
|
+
}
|
|
14
|
+
export declare enum DAYS_OF_WEEK {
|
|
15
|
+
MON = "MON",
|
|
16
|
+
TUE = "TUE",
|
|
17
|
+
WED = "WED",
|
|
18
|
+
THU = "THU",
|
|
19
|
+
FRI = "FRI",
|
|
20
|
+
SAT = "SAT",
|
|
21
|
+
SUN = "SUN"
|
|
22
|
+
}
|
|
23
|
+
export declare enum MONTHLY_DAY_TYPES {
|
|
24
|
+
FIRST_DAY = "FIRST_DAY",
|
|
25
|
+
LAST_DAY = "LAST_DAY",
|
|
26
|
+
CUSTOM = "CUSTOM"
|
|
27
|
+
}
|
|
28
|
+
export declare enum INTERVAL_UNITS {
|
|
29
|
+
MINUTES = "MINUTES",
|
|
30
|
+
HOURS = "HOURS",
|
|
31
|
+
DAYS = "DAYS"
|
|
32
|
+
}
|
|
33
|
+
export declare const ScheduleTypeLabel: {
|
|
34
|
+
DAILY: string;
|
|
35
|
+
WEEKLY: string;
|
|
36
|
+
MONTHLY: string;
|
|
37
|
+
PERIODIC: string;
|
|
38
|
+
};
|
|
39
|
+
export declare const ScheduleTypeDescription: {
|
|
40
|
+
DAILY: string;
|
|
41
|
+
WEEKLY: string;
|
|
42
|
+
MONTHLY: string;
|
|
43
|
+
PERIODIC: string;
|
|
44
|
+
};
|
|
45
|
+
export declare const ScheduleTypeList: SCHEDULE_ACTION_TYPE[];
|
|
46
|
+
export declare const ScheduleValidityTypeLabel: {
|
|
47
|
+
DEFAULT_2_YEARS: string;
|
|
48
|
+
CUSTOM: string;
|
|
49
|
+
};
|
|
50
|
+
export declare const ScheduleValidityTypeList: SCHEDULE_VALIDITY_TYPE[];
|
|
51
|
+
export declare const DayOfWeekLabel: {
|
|
52
|
+
MON: string;
|
|
53
|
+
FRI: string;
|
|
54
|
+
TUE: string;
|
|
55
|
+
SAT: string;
|
|
56
|
+
WED: string;
|
|
57
|
+
SUN: string;
|
|
58
|
+
THU: string;
|
|
59
|
+
};
|
|
60
|
+
export declare const DayOfWeekList: DAYS_OF_WEEK[];
|
|
61
|
+
export declare const MonthlyDayTypesLabel: {
|
|
62
|
+
FIRST_DAY: string;
|
|
63
|
+
LAST_DAY: string;
|
|
64
|
+
CUSTOM: string;
|
|
65
|
+
};
|
|
66
|
+
export declare const MonthlyDayTypesList: MONTHLY_DAY_TYPES[];
|
|
67
|
+
export declare const IntervalUnitsLabel: {
|
|
68
|
+
MINUTES: string;
|
|
69
|
+
HOURS: string;
|
|
70
|
+
DAYS: string;
|
|
71
|
+
};
|
|
72
|
+
export declare const IntervalUnitsList: INTERVAL_UNITS[];
|
|
73
|
+
export interface ScheduleNodeData extends Record<string, unknown> {
|
|
74
|
+
title: string;
|
|
75
|
+
type: SCHEDULE_ACTION_TYPE;
|
|
76
|
+
trigger_time?: string | dayjs.Dayjs;
|
|
77
|
+
validity_type: SCHEDULE_VALIDITY_TYPE;
|
|
78
|
+
validity_end_date?: string | dayjs.Dayjs;
|
|
79
|
+
days_of_week?: DAYS_OF_WEEK[];
|
|
80
|
+
month_day_type: MONTHLY_DAY_TYPES;
|
|
81
|
+
specific_day?: number;
|
|
82
|
+
interval_value?: number;
|
|
83
|
+
interval_unit?: INTERVAL_UNITS;
|
|
84
|
+
output: {
|
|
85
|
+
object: string;
|
|
86
|
+
slug: string;
|
|
87
|
+
type: string;
|
|
88
|
+
}[];
|
|
89
|
+
}
|
|
90
|
+
export type BlockScheduleProps = BlockTypeProps<ScheduleNodeData>;
|
|
91
|
+
export type ScheduleNodeProps = NodeProps<Node<ScheduleNodeData>>;
|
|
@@ -39,5 +39,6 @@ export interface ScriptEditorInterface {
|
|
|
39
39
|
export interface ScriptEditorProps {
|
|
40
40
|
onAlertsChange?: (values: UseErrorsAndInfosReturn) => void;
|
|
41
41
|
type: "autocall" | "autoflow";
|
|
42
|
+
onReady?: (ready: boolean) => void;
|
|
42
43
|
}
|
|
43
44
|
export type { EdgeProps, GlobalSettingData, Node, ReactFlowJsonObject };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { AutoCompleteProps } from 'antd';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} & AutoCompleteProps;
|
|
6
|
-
declare const SuggestVariableNodeContainer: React.FC<SuggestVariableNodeContainerProps>;
|
|
7
|
-
export default SuggestVariableNodeContainer;
|
|
2
|
+
import { UseVariableSuggestOptions } from './type';
|
|
3
|
+
declare const VariableSuggestAutoComplete: (props: UseVariableSuggestOptions & AutoCompleteProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default VariableSuggestAutoComplete;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DATA_TYPE_PROPERTY } from '../../../constants/common';
|
|
2
|
+
export interface VariableLeaf {
|
|
3
|
+
object: string;
|
|
4
|
+
type: DATA_TYPE_PROPERTY;
|
|
5
|
+
slug: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
fullPath: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
export interface VariableOption {
|
|
11
|
+
value: string;
|
|
12
|
+
data: VariableLeaf;
|
|
13
|
+
}
|
|
14
|
+
export interface UseVariableSuggestOptions {
|
|
15
|
+
isCheckPrefix?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface VariableGroupOption {
|
|
18
|
+
label: string;
|
|
19
|
+
options: VariableLeafOption[];
|
|
20
|
+
}
|
|
21
|
+
export interface VariableLeafOption {
|
|
22
|
+
value: string;
|
|
23
|
+
data: VariableLeaf;
|
|
24
|
+
}
|
|
25
|
+
export type VariableAutoCompleteOption = VariableGroupOption | VariableLeafOption;
|
|
@@ -12,6 +12,7 @@ export declare enum BlockType {
|
|
|
12
12
|
CALLBOT_TRIGGER = "CALLBOT_TRIGGER",
|
|
13
13
|
ORDER_TRIGGER = "ORDER_TRIGGER",
|
|
14
14
|
CONTACT_ACTION = "CONTACT_ACTION",
|
|
15
|
+
SCHEDULE_AT = "SCHEDULE_AT",
|
|
15
16
|
CALLBOT_ACTION = "CALLBOT_ACTION",
|
|
16
17
|
ORDER_ACTION = "ORDER_ACTION",
|
|
17
18
|
EMAIL = "EMAIL",
|
|
@@ -108,9 +108,11 @@ export declare enum DATA_TYPE_PROPERTY {
|
|
|
108
108
|
associateproperty = "associateproperty",
|
|
109
109
|
phoneproperty = "phoneproperty",
|
|
110
110
|
fileproperty = "fileproperty",
|
|
111
|
-
singleassociateproperty = "singleassociateproperty"
|
|
111
|
+
singleassociateproperty = "singleassociateproperty",
|
|
112
|
+
multiemailproperty = "multiemailproperty",
|
|
113
|
+
multiphoneproperty = "multiphoneproperty"
|
|
112
114
|
}
|
|
113
115
|
export declare const CAMPAIGN_TYPE_NAME: Record<string, string>;
|
|
114
116
|
export declare const DATE_FORMAT_BY_OPERATOR: Record<string, string>;
|
|
115
|
-
export declare const iconPropertyMap: Record<DATA_TYPE_PROPERTY, any>;
|
|
117
|
+
export declare const iconPropertyMap: Record<DATA_TYPE_PROPERTY | string, any>;
|
|
116
118
|
export declare const operatorMap: Record<string, string>;
|
|
@@ -13,6 +13,7 @@ export declare const nodeTypes: {
|
|
|
13
13
|
BRANCH: import('react').FC<import('../components/Blocks/Branch/types').BlockBranchProps>;
|
|
14
14
|
AI_AGENT: import('react').FC<import('../components/Blocks/AIAgent/types').BlockAIAgentProps>;
|
|
15
15
|
NOTIFICATION: import('react').FC<import('../components/Blocks/Notification/types').BlockNotificationProps>;
|
|
16
|
+
SCHEDULE_AT: import('react').FC<import('../components/Blocks/Schedule/types').BlockScheduleProps>;
|
|
16
17
|
};
|
|
17
18
|
export declare const getNodeColor: (node: any) => string;
|
|
18
19
|
export default nodeTypes;
|
|
@@ -20,7 +20,8 @@ export interface AutoFlowSidebarButton {
|
|
|
20
20
|
group?: string | number;
|
|
21
21
|
items?: AutoFlowSidebarButton[];
|
|
22
22
|
}
|
|
23
|
-
export declare const
|
|
23
|
+
export declare const DEFAULT_CALLBOT_SIDEBAR_BUTTONS: BlockType[];
|
|
24
|
+
export declare const DEFAULT_AUTOFLOW_SIDEBAR_BUTTONS: BlockType[];
|
|
24
25
|
export declare const autoCallSidebarButtons: AutoCallSidebarButton[];
|
|
25
26
|
export declare const autoFlowSidebarButtons: AutoFlowSidebarButton[];
|
|
26
27
|
export declare const iconColors: Record<BlockType, string>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AutoCompleteProps } from 'antd';
|
|
2
|
+
import { UseVariableSuggestOptions } from '../../components/Shared/SuggestVariableNode/type';
|
|
3
|
+
export declare function useVariableSuggest(upstreamNodes: any[], options?: UseVariableSuggestOptions & AutoCompleteProps): {
|
|
4
|
+
value: any;
|
|
5
|
+
open: boolean;
|
|
6
|
+
options: import('../../components/Shared/SuggestVariableNode/type').VariableAutoCompleteOption[];
|
|
7
|
+
bindInput: {
|
|
8
|
+
ref: import('react').RefObject<HTMLInputElement>;
|
|
9
|
+
value: any;
|
|
10
|
+
onChange: (e: any) => void;
|
|
11
|
+
onClick: (e: any) => void;
|
|
12
|
+
status: "" | "warning" | "error";
|
|
13
|
+
onFocus: () => void;
|
|
14
|
+
onBlurCapture: () => void;
|
|
15
|
+
};
|
|
16
|
+
onSelect: (text: string, option: any) => void;
|
|
17
|
+
};
|
|
@@ -25,6 +25,7 @@ export interface InstanceScriptEditorProps {
|
|
|
25
25
|
onAlertsChange?: (values: UseErrorsAndInfosReturn) => void;
|
|
26
26
|
instanceId?: string;
|
|
27
27
|
mode: "view" | "edit";
|
|
28
|
+
onReady?: (ready: boolean) => void;
|
|
28
29
|
}
|
|
29
30
|
interface InstanceContextProviderProps extends InstanceScriptEditorProps {
|
|
30
31
|
children: ReactNode;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { TreeDataNode } from 'antd';
|
|
2
|
+
import { IFilter, IFilterGroup, IOutput } from '../../services';
|
|
3
|
+
import { DATA_TYPE_PROPERTY } from '../constants/common';
|
|
3
4
|
export declare function getInitialsAvatarName(name: string): string;
|
|
4
5
|
export declare function getSuffixCount(name: string): number;
|
|
5
6
|
export declare const formatTitleCondition: (condition: IFilter) => {
|
|
@@ -40,5 +41,9 @@ export declare const formatFilterGroupsToForm: (object?: string, chartFilterGrou
|
|
|
40
41
|
groups: IFilterGroup[];
|
|
41
42
|
};
|
|
42
43
|
export declare function slugifyUnderscore(str: string): string;
|
|
43
|
-
export declare function
|
|
44
|
+
export declare function buildOutPutTreeNodes(outputs: IOutput["outputs"]): (TreeDataNode & {
|
|
45
|
+
meta?: {
|
|
46
|
+
iconType?: DATA_TYPE_PROPERTY;
|
|
47
|
+
};
|
|
48
|
+
})[];
|
|
44
49
|
export {};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { AxiosError, AxiosResponse } from 'axios';
|
|
2
2
|
import { IOutput } from '../types';
|
|
3
3
|
export declare const getOutput = "output";
|
|
4
|
-
declare function useGetOutput(type
|
|
4
|
+
declare function useGetOutput({ type, action, enabled, }: {
|
|
5
|
+
type: string;
|
|
6
|
+
action: string;
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
}): import('@tanstack/react-query').UseQueryResult<AxiosResponse<IOutput, any>, AxiosError<unknown, any>>;
|
|
5
9
|
export default useGetOutput;
|
|
@@ -246,7 +246,15 @@ export interface IMailTemplate {
|
|
|
246
246
|
params: any;
|
|
247
247
|
}
|
|
248
248
|
export interface IOutput {
|
|
249
|
-
outputs:
|
|
249
|
+
outputs: {
|
|
250
|
+
id: string;
|
|
251
|
+
type: DATA_TYPE_PROPERTY;
|
|
252
|
+
slug: string;
|
|
253
|
+
name: string;
|
|
254
|
+
options: IOptionValue[];
|
|
255
|
+
structure?: IOutput["outputs"];
|
|
256
|
+
object?: string;
|
|
257
|
+
}[];
|
|
250
258
|
unknown_types?: [];
|
|
251
259
|
}
|
|
252
260
|
export type IListTypeInputOption = {
|