@zenify-omni/chat-js 0.1.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/LICENSE +21 -0
- package/README.md +28 -0
- package/api/campaign.js +19 -0
- package/api/chat.js +518 -0
- package/api/chatroom.js +254 -0
- package/api/contact.js +45 -0
- package/api/crm-organization.js +101 -0
- package/api/customer.js +143 -0
- package/api/facebook-labels.js +11 -0
- package/api/field.js +11 -0
- package/api/file.js +17 -0
- package/api/filter.js +50 -0
- package/api/group.js +11 -0
- package/api/iam.js +23 -0
- package/api/index.js +54 -0
- package/api/orgTree.js +45 -0
- package/api/post.js +111 -0
- package/api/queue.js +15 -0
- package/api/report.js +422 -0
- package/api/send.js +21 -0
- package/api/session-event.js +30 -0
- package/api/session.js +249 -0
- package/api/settings/assign-task.js +10 -0
- package/api/settings/channel.js +136 -0
- package/api/settings/chat-layout.js +37 -0
- package/api/settings/chat-timeout.js +10 -0
- package/api/settings/common.js +32 -0
- package/api/settings/config.js +19 -0
- package/api/settings/index.js +24 -0
- package/api/settings/ivr.js +25 -0
- package/api/settings/queue-v3.js +56 -0
- package/api/settings/queue.js +48 -0
- package/api/settings/routing.js +32 -0
- package/api/settings/service.js +31 -0
- package/api/settings.js +567 -0
- package/api/shipping.js +19 -0
- package/api/shopee.js +21 -0
- package/api/smart-qc/index.js +4 -0
- package/api/smart-qc/keyword.js +10 -0
- package/api/tag.js +11 -0
- package/api/user.js +177 -0
- package/client.js +391 -0
- package/config/env.js +76 -0
- package/constants/advance-filter.js +358 -0
- package/constants/auto-assign-tag.js +13 -0
- package/constants/chat-message.js +423 -0
- package/constants/chat-room-tag.js +7 -0
- package/constants/chat-source.js +68 -0
- package/constants/chatbot.js +58 -0
- package/constants/common.js +4 -0
- package/constants/crm-organization.js +75 -0
- package/constants/distribute.js +8 -0
- package/constants/distribution-log.js +14 -0
- package/constants/events.js +27 -0
- package/constants/file-upload.js +86 -0
- package/constants/lead.js +111 -0
- package/constants/mask-data-config.js +16 -0
- package/constants/month.js +78 -0
- package/constants/quick-filter.js +49 -0
- package/constants/regex.js +34 -0
- package/constants/setting.js +62 -0
- package/constants/shipping.js +12 -0
- package/constants/social.js +21 -0
- package/constants/sortable-fields.js +146 -0
- package/constants/tenant_config.js +154 -0
- package/constants/use-query-key.js +470 -0
- package/constants/user.js +293 -0
- package/exceptions/axios-error.js +24 -0
- package/exceptions/https-error.js +28 -0
- package/exceptions/validator-error.js +20 -0
- package/lib/avatar-color.js +31 -0
- package/lib/i18n/index.js +85 -0
- package/lib/i18n/language-store.js +74 -0
- package/lib/i18n/locales/en/campaign.json +3 -0
- package/lib/i18n/locales/en/chat.json +656 -0
- package/lib/i18n/locales/en/common.json +1846 -0
- package/lib/i18n/locales/en/customer.json +20 -0
- package/lib/i18n/locales/en/lead.json +5 -0
- package/lib/i18n/locales/en/lumi.json +4 -0
- package/lib/i18n/locales/en/notification.json +107 -0
- package/lib/i18n/locales/en/org.json +4 -0
- package/lib/i18n/locales/en/posts.json +8 -0
- package/lib/i18n/locales/en/settings.json +39 -0
- package/lib/i18n/locales/vi/campaign.json +3 -0
- package/lib/i18n/locales/vi/chat.json +660 -0
- package/lib/i18n/locales/vi/common.json +1846 -0
- package/lib/i18n/locales/vi/customer.json +20 -0
- package/lib/i18n/locales/vi/lead.json +5 -0
- package/lib/i18n/locales/vi/lumi.json +4 -0
- package/lib/i18n/locales/vi/notification.json +107 -0
- package/lib/i18n/locales/vi/org.json +4 -0
- package/lib/i18n/locales/vi/posts.json +8 -0
- package/lib/i18n/locales/vi/settings.json +39 -0
- package/lib/i18n/server-label.js +33 -0
- package/lib/phone.js +70 -0
- package/lib/user-avatar.js +21 -0
- package/package.json +45 -0
- package/socket/index.js +30 -0
- package/transport-registry.js +77 -0
- package/utils/access-detail.js +119 -0
- package/utils/auth.js +205 -0
- package/utils/chunk-reload-guard.js +4 -0
- package/utils/concurrency-limiter.js +30 -0
- package/utils/crm-organization.js +0 -0
- package/utils/currency.js +14 -0
- package/utils/customers.js +42 -0
- package/utils/data.js +178 -0
- package/utils/date.js +144 -0
- package/utils/debounced-invalidate.js +15 -0
- package/utils/emoticon.js +134 -0
- package/utils/export.js +7 -0
- package/utils/field-layout.js +33 -0
- package/utils/filter-adapters.js +9 -0
- package/utils/filter.js +18 -0
- package/utils/formatters.js +6 -0
- package/utils/image-compression.js +169 -0
- package/utils/leads.js +13 -0
- package/utils/microlink.js +20 -0
- package/utils/org-tree.js +108 -0
- package/utils/request.js +461 -0
- package/utils/session-end.js +19 -0
- package/utils/string.js +154 -0
- package/utils/table-display-config.js +80 -0
- package/utils/validation.js +49 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
const EXTRAFIELD_FILE_UPLOAD_MAXSIZE = 20;
|
|
2
|
+
const EXTRAFIELD_FILE_UPLOAD_MAXCOUNT = 5;
|
|
3
|
+
const EXTRAFIELD_IMAGE_UPLOAD_MAXSIZE = 5;
|
|
4
|
+
const EXTRAFIELD_IMAGE_UPLOAD_MAXCOUNT = 8;
|
|
5
|
+
const DEFAULT_UPLOAD_MAXSIZE = 20;
|
|
6
|
+
const DEFAULT_UPLOAD_MAXCOUNT = 5;
|
|
7
|
+
const MAXIMUM_FILE_SIZE_PERSONAL_ZALO = 150 * 1024 * 1024;
|
|
8
|
+
const MAXIMUM_FILE_SIZE_ZALO = 1024 * 1024;
|
|
9
|
+
const MAXIMUM_IMAGE_SIZE_PERSONAL_ZALO = 35 * 1024 * 1024;
|
|
10
|
+
const MAXIMUM_IMAGE_INPUT_SIZE_ZALO_OA = 25 * 1024 * 1024;
|
|
11
|
+
const MAXIMUM_IMAGE_INPUT_SIZE_PERSONAL_ZALO = 150 * 1024 * 1024;
|
|
12
|
+
const IMAGE_INPUT_SIZE_MULTIPLIER = 10;
|
|
13
|
+
const DEFAULT_FILE_SIZE = 5 * 1024 * 1024;
|
|
14
|
+
const DEFAULT_FILE_SIZE_CHATTING = 20 * 1024 * 1024;
|
|
15
|
+
const DEFAULT_IMAGE_SIZE = 5 * 1024 * 1024;
|
|
16
|
+
const MAXIMUM_IMAGE_SIZE_FACEBOOK = 8 * 1024 * 1024;
|
|
17
|
+
const ACCEPTED_FILE_TYPES_PERSONAL_ZALO = [
|
|
18
|
+
".doc",
|
|
19
|
+
".docx",
|
|
20
|
+
".pdf",
|
|
21
|
+
".csv",
|
|
22
|
+
".pptx",
|
|
23
|
+
".ppt",
|
|
24
|
+
".xls",
|
|
25
|
+
".xlsx",
|
|
26
|
+
".txt",
|
|
27
|
+
".xml"
|
|
28
|
+
];
|
|
29
|
+
const ACCEPTED_VIDEO_TYPES_PERSONAL_ZALO = [
|
|
30
|
+
".avi",
|
|
31
|
+
".mov",
|
|
32
|
+
".mp4",
|
|
33
|
+
".ogg",
|
|
34
|
+
".wmv",
|
|
35
|
+
".webm"
|
|
36
|
+
];
|
|
37
|
+
const ACCEPTED_FILE_TYPES_PERSONAL_ZALO_WITH_VIDEO = [
|
|
38
|
+
...ACCEPTED_FILE_TYPES_PERSONAL_ZALO,
|
|
39
|
+
...ACCEPTED_VIDEO_TYPES_PERSONAL_ZALO
|
|
40
|
+
];
|
|
41
|
+
const ACCEPTED_FILE_TYPES_ZALO = [".doc", ".docx", ".pdf"];
|
|
42
|
+
const ACCEPTED_FILE_TYPES_CUSTOM = [
|
|
43
|
+
".doc",
|
|
44
|
+
".docx",
|
|
45
|
+
".pdf",
|
|
46
|
+
".xls",
|
|
47
|
+
".xlsx",
|
|
48
|
+
".txt",
|
|
49
|
+
".mp4"
|
|
50
|
+
];
|
|
51
|
+
const ACCEPTED_FILE_TYPES_IMAGES = [".jpeg", ".png", ".jpg"];
|
|
52
|
+
const ACCEPTED_FILE_TYPES_IMAGES_ZALO_OA = [
|
|
53
|
+
".jpeg",
|
|
54
|
+
".png",
|
|
55
|
+
".jpg",
|
|
56
|
+
".gif",
|
|
57
|
+
".webp",
|
|
58
|
+
".bmp"
|
|
59
|
+
];
|
|
60
|
+
const ACCEPTED_FILE_TYPES_DEFAULT = "*/*";
|
|
61
|
+
export {
|
|
62
|
+
ACCEPTED_FILE_TYPES_CUSTOM,
|
|
63
|
+
ACCEPTED_FILE_TYPES_DEFAULT,
|
|
64
|
+
ACCEPTED_FILE_TYPES_IMAGES,
|
|
65
|
+
ACCEPTED_FILE_TYPES_IMAGES_ZALO_OA,
|
|
66
|
+
ACCEPTED_FILE_TYPES_PERSONAL_ZALO,
|
|
67
|
+
ACCEPTED_FILE_TYPES_PERSONAL_ZALO_WITH_VIDEO,
|
|
68
|
+
ACCEPTED_FILE_TYPES_ZALO,
|
|
69
|
+
ACCEPTED_VIDEO_TYPES_PERSONAL_ZALO,
|
|
70
|
+
DEFAULT_FILE_SIZE,
|
|
71
|
+
DEFAULT_FILE_SIZE_CHATTING,
|
|
72
|
+
DEFAULT_IMAGE_SIZE,
|
|
73
|
+
DEFAULT_UPLOAD_MAXCOUNT,
|
|
74
|
+
DEFAULT_UPLOAD_MAXSIZE,
|
|
75
|
+
EXTRAFIELD_FILE_UPLOAD_MAXCOUNT,
|
|
76
|
+
EXTRAFIELD_FILE_UPLOAD_MAXSIZE,
|
|
77
|
+
EXTRAFIELD_IMAGE_UPLOAD_MAXCOUNT,
|
|
78
|
+
EXTRAFIELD_IMAGE_UPLOAD_MAXSIZE,
|
|
79
|
+
IMAGE_INPUT_SIZE_MULTIPLIER,
|
|
80
|
+
MAXIMUM_FILE_SIZE_PERSONAL_ZALO,
|
|
81
|
+
MAXIMUM_FILE_SIZE_ZALO,
|
|
82
|
+
MAXIMUM_IMAGE_INPUT_SIZE_PERSONAL_ZALO,
|
|
83
|
+
MAXIMUM_IMAGE_INPUT_SIZE_ZALO_OA,
|
|
84
|
+
MAXIMUM_IMAGE_SIZE_FACEBOOK,
|
|
85
|
+
MAXIMUM_IMAGE_SIZE_PERSONAL_ZALO
|
|
86
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import i18n from "../lib/i18n/index.js";
|
|
2
|
+
const LEAD_STATIC_COLUMNS = Object.freeze({
|
|
3
|
+
get name() {
|
|
4
|
+
return i18n.t("common:label.customerName", {
|
|
5
|
+
defaultValue: "T\xEAn kh\xE1ch h\xE0ng"
|
|
6
|
+
});
|
|
7
|
+
},
|
|
8
|
+
get code() {
|
|
9
|
+
return i18n.t("common:label.customerCode", {
|
|
10
|
+
defaultValue: "M\xE3 kh\xE1ch h\xE0ng"
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
get phone() {
|
|
14
|
+
return i18n.t("common:label.phone", { defaultValue: "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i" });
|
|
15
|
+
},
|
|
16
|
+
email: "Email",
|
|
17
|
+
get dob() {
|
|
18
|
+
return i18n.t("common:label.dob", { defaultValue: "Ng\xE0y sinh" });
|
|
19
|
+
},
|
|
20
|
+
get source() {
|
|
21
|
+
return i18n.t("common:label.source", { defaultValue: "Ngu\u1ED3n" });
|
|
22
|
+
},
|
|
23
|
+
get organization() {
|
|
24
|
+
return i18n.t("common:label.organization", {
|
|
25
|
+
defaultValue: "T\u1ED5 ch\u1EE9c"
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
get group() {
|
|
29
|
+
return i18n.t("common:label.customerGroup", {
|
|
30
|
+
defaultValue: "Nh\xF3m kh\xE1ch h\xE0ng"
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
get city() {
|
|
34
|
+
return i18n.t("common:label.city", { defaultValue: "Th\xE0nh ph\u1ED1" });
|
|
35
|
+
},
|
|
36
|
+
get district_id() {
|
|
37
|
+
return i18n.t("common:label.district", { defaultValue: "Qu\u1EADn huy\u1EC7n" });
|
|
38
|
+
},
|
|
39
|
+
get created_at() {
|
|
40
|
+
return i18n.t("common:label.initTime", {
|
|
41
|
+
defaultValue: "Th\u1EDDi gian kh\u1EDFi t\u1EA1o"
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
get updated_at() {
|
|
45
|
+
return i18n.t("common:label.lastUpdated", {
|
|
46
|
+
defaultValue: "C\u1EADp nh\u1EADt l\u1EA7n cu\u1ED1i"
|
|
47
|
+
});
|
|
48
|
+
},
|
|
49
|
+
get customer_type() {
|
|
50
|
+
return i18n.t("common:label.customerTier", {
|
|
51
|
+
defaultValue: "H\u1EA1ng kh\xE1ch h\xE0ng"
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
get gender() {
|
|
55
|
+
return i18n.t("common:label.gender", { defaultValue: "Gi\u1EDBi t\xEDnh" });
|
|
56
|
+
},
|
|
57
|
+
get note() {
|
|
58
|
+
return i18n.t("common:label.note", { defaultValue: "Ghi ch\xFA" });
|
|
59
|
+
},
|
|
60
|
+
get address() {
|
|
61
|
+
return i18n.t("common:label.address", { defaultValue: "\u0110\u1ECBa ch\u1EC9" });
|
|
62
|
+
},
|
|
63
|
+
facebook: "Facebook",
|
|
64
|
+
get sub_phone() {
|
|
65
|
+
return i18n.t("common:label.secondaryPhone", {
|
|
66
|
+
defaultValue: "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i ph\u1EE5"
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
get sub_email() {
|
|
70
|
+
return i18n.t("common:label.secondaryEmail", {
|
|
71
|
+
defaultValue: "Email ph\u1EE5"
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
get sub_name() {
|
|
75
|
+
return i18n.t("common:label.customerAliasName", {
|
|
76
|
+
defaultValue: "T\xEAn ph\u1EE5 kh\xE1ch h\xE0ng"
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
tags: "Tags",
|
|
80
|
+
get lead_owner() {
|
|
81
|
+
return i18n.t("common:label.assignee", {
|
|
82
|
+
defaultValue: "Ng\u01B0\u1EDDi ph\u1EE5 tr\xE1ch"
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
get lead_source() {
|
|
86
|
+
return i18n.t("common:label.leadSource", {
|
|
87
|
+
defaultValue: "Ngu\u1ED3n ti\u1EC1m n\u0103ng"
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
get lead_stage() {
|
|
91
|
+
return i18n.t("common:label.stage", { defaultValue: "Giai \u0111o\u1EA1n" });
|
|
92
|
+
},
|
|
93
|
+
get createdBy() {
|
|
94
|
+
return i18n.t("common:label.creator", { defaultValue: "Ng\u01B0\u1EDDi t\u1EA1o" });
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
const DEFAULT_LEAD_COLUMN_KEYS = [
|
|
98
|
+
"name",
|
|
99
|
+
"phone",
|
|
100
|
+
"email",
|
|
101
|
+
"dob",
|
|
102
|
+
"source",
|
|
103
|
+
"organization",
|
|
104
|
+
"group",
|
|
105
|
+
"city",
|
|
106
|
+
"created_at"
|
|
107
|
+
];
|
|
108
|
+
export {
|
|
109
|
+
DEFAULT_LEAD_COLUMN_KEYS,
|
|
110
|
+
LEAD_STATIC_COLUMNS
|
|
111
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const DataTypes = Object.freeze({
|
|
2
|
+
PHONE_NUMBER: "phone_number",
|
|
3
|
+
EMAIL: "email",
|
|
4
|
+
NAME: "name",
|
|
5
|
+
ADDRESS: "address"
|
|
6
|
+
});
|
|
7
|
+
const KeyApplyTo = Object.freeze({
|
|
8
|
+
ROLE: "role",
|
|
9
|
+
USER: "user",
|
|
10
|
+
GROUP: "group",
|
|
11
|
+
ORGANIZATION: "organization"
|
|
12
|
+
});
|
|
13
|
+
export {
|
|
14
|
+
DataTypes,
|
|
15
|
+
KeyApplyTo
|
|
16
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import i18n from "../lib/i18n/index.js";
|
|
2
|
+
const MonthOptions = [
|
|
3
|
+
{
|
|
4
|
+
value: "01",
|
|
5
|
+
get label() {
|
|
6
|
+
return i18n.t("common:time.january", { defaultValue: "Th\xE1ng 1" });
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
value: "02",
|
|
11
|
+
get label() {
|
|
12
|
+
return i18n.t("common:time.february", { defaultValue: "Th\xE1ng 2" });
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
value: "03",
|
|
17
|
+
get label() {
|
|
18
|
+
return i18n.t("common:time.march", { defaultValue: "Th\xE1ng 3" });
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
value: "04",
|
|
23
|
+
get label() {
|
|
24
|
+
return i18n.t("common:time.april", { defaultValue: "Th\xE1ng 4" });
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
value: "05",
|
|
29
|
+
get label() {
|
|
30
|
+
return i18n.t("common:time.may", { defaultValue: "Th\xE1ng 5" });
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
value: "06",
|
|
35
|
+
get label() {
|
|
36
|
+
return i18n.t("common:time.june", { defaultValue: "Th\xE1ng 6" });
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
value: "07",
|
|
41
|
+
get label() {
|
|
42
|
+
return i18n.t("common:time.july", { defaultValue: "Th\xE1ng 7" });
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
value: "08",
|
|
47
|
+
get label() {
|
|
48
|
+
return i18n.t("common:time.august", { defaultValue: "Th\xE1ng 8" });
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
value: "09",
|
|
53
|
+
get label() {
|
|
54
|
+
return i18n.t("common:time.september", { defaultValue: "Th\xE1ng 9" });
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
value: "10",
|
|
59
|
+
get label() {
|
|
60
|
+
return i18n.t("common:time.october", { defaultValue: "Th\xE1ng 10" });
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
value: "11",
|
|
65
|
+
get label() {
|
|
66
|
+
return i18n.t("common:time.november", { defaultValue: "Th\xE1ng 11" });
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
value: "12",
|
|
71
|
+
get label() {
|
|
72
|
+
return i18n.t("common:time.december", { defaultValue: "Th\xE1ng 12" });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
];
|
|
76
|
+
export {
|
|
77
|
+
MonthOptions
|
|
78
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { RuleOperator } from "./advance-filter.js";
|
|
2
|
+
const QuickFilterOperator = Object.freeze({
|
|
3
|
+
Equal: "equal",
|
|
4
|
+
NotEqual: "not-equal",
|
|
5
|
+
Contain: "contain",
|
|
6
|
+
NotContain: "not-contain",
|
|
7
|
+
InDay: "in-day",
|
|
8
|
+
Between: "between",
|
|
9
|
+
Before: "before",
|
|
10
|
+
After: "after",
|
|
11
|
+
Today: "today",
|
|
12
|
+
ThisWeek: "this-week",
|
|
13
|
+
ThisMonth: "this-month",
|
|
14
|
+
Great: "gt",
|
|
15
|
+
Less: "lt",
|
|
16
|
+
Exist: "exist",
|
|
17
|
+
NotExist: "not-exist"
|
|
18
|
+
});
|
|
19
|
+
const QuickFilterOperatorControl = Object.freeze({
|
|
20
|
+
Text: "text",
|
|
21
|
+
MultiText: "multi-text",
|
|
22
|
+
Select: "select",
|
|
23
|
+
SearchSelect: "search-select",
|
|
24
|
+
AsyncSearchSelect: "async-search-select",
|
|
25
|
+
MultiSelect: "multi-select",
|
|
26
|
+
AsyncSearchMultiSelect: "async-search-multi-select",
|
|
27
|
+
Number: "number",
|
|
28
|
+
Date: "date",
|
|
29
|
+
SelectTag: "selectTag"
|
|
30
|
+
});
|
|
31
|
+
const AdvanceToQuickFilterOperatorMapping = Object.freeze({
|
|
32
|
+
[RuleOperator.Equal]: QuickFilterOperator.Equal,
|
|
33
|
+
[RuleOperator.NotEqual]: QuickFilterOperator.NotEqual,
|
|
34
|
+
[RuleOperator.In]: QuickFilterOperator.Contain,
|
|
35
|
+
[RuleOperator.NotIn]: QuickFilterOperator.NotContain,
|
|
36
|
+
[RuleOperator.GreatThan]: QuickFilterOperator.After,
|
|
37
|
+
[RuleOperator.LessThan]: QuickFilterOperator.Before,
|
|
38
|
+
[RuleOperator.Between]: QuickFilterOperator.Between,
|
|
39
|
+
[RuleOperator.GreatThanEqual]: QuickFilterOperator.Great,
|
|
40
|
+
[RuleOperator.LessThanEqual]: QuickFilterOperator.Less,
|
|
41
|
+
[RuleOperator.Date_Today]: QuickFilterOperator.Today,
|
|
42
|
+
[RuleOperator.This_Week]: QuickFilterOperator.ThisWeek,
|
|
43
|
+
[RuleOperator.This_Month]: QuickFilterOperator.ThisMonth
|
|
44
|
+
});
|
|
45
|
+
export {
|
|
46
|
+
AdvanceToQuickFilterOperatorMapping,
|
|
47
|
+
QuickFilterOperator,
|
|
48
|
+
QuickFilterOperatorControl
|
|
49
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const PHONE_NUMBER_REGEX = /\+(9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)\d{1,14}|\b[0123]\d{7,15}\b[+\-_?@!*]?/g;
|
|
2
|
+
const EMAIL_REGEX = /(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/g;
|
|
3
|
+
const URL_REGEX = /https?:\/\/(?:\([-a-zA-Z0-9@:%_+.~#?&/=]*\)|[-a-zA-Z0-9@:%_+.~#?&/=])+(\/(?:\([-a-zA-Z0-9@:%_+.~#?&/=]*\)|[-a-zA-Z0-9@:%_+.~#?&/=])*)?(\?(?:\([-a-zA-Z0-9@:%_+.~#?&/=]*\)|[-a-zA-Z0-9@:%_+.~#?&/=])*)?/gi;
|
|
4
|
+
const PHONE_NUMBER_REGEX_DEFAULT = /^(?=.{1,15}$)[+*0-9]+$/;
|
|
5
|
+
const BARE_DOMAIN_PATTERNS = [
|
|
6
|
+
"com",
|
|
7
|
+
"net",
|
|
8
|
+
"org",
|
|
9
|
+
"vn",
|
|
10
|
+
"io",
|
|
11
|
+
"info",
|
|
12
|
+
"edu",
|
|
13
|
+
"gov",
|
|
14
|
+
"app",
|
|
15
|
+
"dev",
|
|
16
|
+
"ai",
|
|
17
|
+
"page",
|
|
18
|
+
"site",
|
|
19
|
+
"online",
|
|
20
|
+
"store",
|
|
21
|
+
"tech"
|
|
22
|
+
];
|
|
23
|
+
const BARE_URL_REGEX = new RegExp(
|
|
24
|
+
`(?<![a-zA-Z0-9/:.@=&?#%-])(?:[a-zA-Z0-9][a-zA-Z0-9-]{1,61}\\.)+(?:${BARE_DOMAIN_PATTERNS.join("|")})(?:[/?#][-a-zA-Z0-9@:%_+.~#?&/=]*)?(?![a-zA-Z0-9.])`,
|
|
25
|
+
"gi"
|
|
26
|
+
);
|
|
27
|
+
export {
|
|
28
|
+
BARE_DOMAIN_PATTERNS,
|
|
29
|
+
BARE_URL_REGEX,
|
|
30
|
+
EMAIL_REGEX,
|
|
31
|
+
PHONE_NUMBER_REGEX,
|
|
32
|
+
PHONE_NUMBER_REGEX_DEFAULT,
|
|
33
|
+
URL_REGEX
|
|
34
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { CrmType } from "./user.js";
|
|
2
|
+
const TargetType = Object.freeze({
|
|
3
|
+
USER: "user",
|
|
4
|
+
// LEAD
|
|
5
|
+
CONTACT: "contact",
|
|
6
|
+
AGENT: "agent",
|
|
7
|
+
TICKET: "ticket",
|
|
8
|
+
DEAL: "deal",
|
|
9
|
+
TASK: "task",
|
|
10
|
+
SURVEY: "survey",
|
|
11
|
+
SURVEY_EVALUATION: "survey_evaluation",
|
|
12
|
+
ORDER: "order",
|
|
13
|
+
PRODUCT: "product",
|
|
14
|
+
ORGANIZATION: "organization"
|
|
15
|
+
});
|
|
16
|
+
const AttributeFieldType = Object.freeze({
|
|
17
|
+
Phone: "phone",
|
|
18
|
+
Text: "text",
|
|
19
|
+
Textarea: "textarea",
|
|
20
|
+
Number: "number",
|
|
21
|
+
Date: "date",
|
|
22
|
+
Select: "select",
|
|
23
|
+
MultiSelect: "multi-select",
|
|
24
|
+
Image: "image",
|
|
25
|
+
File: "file",
|
|
26
|
+
Formula: "formula",
|
|
27
|
+
Radio: "radio",
|
|
28
|
+
CheckBox: "checkbox"
|
|
29
|
+
});
|
|
30
|
+
const ObjectRuleSystemType = Object.freeze({
|
|
31
|
+
Dynamic: "dynamic",
|
|
32
|
+
Static: "static"
|
|
33
|
+
});
|
|
34
|
+
const LINK_MODE = Object.freeze({
|
|
35
|
+
ONE_WAY: "one_way",
|
|
36
|
+
TWO_WAY: "two_way"
|
|
37
|
+
});
|
|
38
|
+
const SettingTags = {
|
|
39
|
+
ORDER: "order",
|
|
40
|
+
PRODUCT: "product",
|
|
41
|
+
TICKET: "ticket",
|
|
42
|
+
SERVICE: "service",
|
|
43
|
+
LEAD: CrmType.Lead,
|
|
44
|
+
CONTACT: CrmType.Contact,
|
|
45
|
+
Chat: "chat",
|
|
46
|
+
ORGANIZATION: "organization",
|
|
47
|
+
COMMENT: "comment"
|
|
48
|
+
};
|
|
49
|
+
const ObjectRuleGroupDisplay = Object.freeze({
|
|
50
|
+
Common: "common",
|
|
51
|
+
ContactDetail: "contact_detail",
|
|
52
|
+
BasicInfo: "basic_info",
|
|
53
|
+
Extra: "extra"
|
|
54
|
+
});
|
|
55
|
+
export {
|
|
56
|
+
AttributeFieldType,
|
|
57
|
+
LINK_MODE,
|
|
58
|
+
ObjectRuleGroupDisplay,
|
|
59
|
+
ObjectRuleSystemType,
|
|
60
|
+
SettingTags,
|
|
61
|
+
TargetType
|
|
62
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const ShippingCarrierCode = Object.freeze({
|
|
2
|
+
VIETTEL_POST: "viettel_post",
|
|
3
|
+
BEST_EXPRESS: "best_express",
|
|
4
|
+
JNT: "jnt"
|
|
5
|
+
});
|
|
6
|
+
const HUB_SHIPPING_CARRIER_CODES = [
|
|
7
|
+
ShippingCarrierCode.BEST_EXPRESS,
|
|
8
|
+
ShippingCarrierCode.JNT
|
|
9
|
+
];
|
|
10
|
+
export {
|
|
11
|
+
ShippingCarrierCode
|
|
12
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const PageType = Object.freeze({
|
|
2
|
+
ZALO: 0,
|
|
3
|
+
FACEBOOK: 1,
|
|
4
|
+
TIKTOK: 2,
|
|
5
|
+
TIKTOK_BUSINESS: 5,
|
|
6
|
+
WHATSAPP: 7,
|
|
7
|
+
SHOPEE: 8,
|
|
8
|
+
GOOGLE: 3,
|
|
9
|
+
INSTAGRAM: 9,
|
|
10
|
+
SAPO: 10,
|
|
11
|
+
PANCAKE: 11,
|
|
12
|
+
MISA: 12,
|
|
13
|
+
// Partner app Shopee thứ hai, phục vụ nghiệp vụ đơn hàng (SHOPEE lo phần
|
|
14
|
+
// chat). Tách type để giữ riêng bộ uỷ quyền/app config, nhưng ở tầng
|
|
15
|
+
// chat/order vẫn dùng chung source 'shopee' với SHOPEE.
|
|
16
|
+
SHOPEE_ORDER: 13,
|
|
17
|
+
NHANHVN: 14
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
PageType
|
|
21
|
+
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
const SORTABLE_FIELDS = {
|
|
2
|
+
ticket: [
|
|
3
|
+
"created_at",
|
|
4
|
+
"updated_at",
|
|
5
|
+
"code",
|
|
6
|
+
"subject",
|
|
7
|
+
"status",
|
|
8
|
+
"priority_id",
|
|
9
|
+
"priority",
|
|
10
|
+
"due_date",
|
|
11
|
+
"first_response_at",
|
|
12
|
+
"resolved_at",
|
|
13
|
+
// Bổ sung 2026-06-01 (theo doc §4.1)
|
|
14
|
+
"source_detail",
|
|
15
|
+
"type_id",
|
|
16
|
+
"stage_id",
|
|
17
|
+
"call_count",
|
|
18
|
+
// Bổ sung 2026-06-02 (Group C — BE denormalize snapshot tự động)
|
|
19
|
+
"agent_name",
|
|
20
|
+
"customer_name",
|
|
21
|
+
"created_by_name",
|
|
22
|
+
"organize_name",
|
|
23
|
+
"campaign_name",
|
|
24
|
+
"pipeline_name",
|
|
25
|
+
"stage_order"
|
|
26
|
+
],
|
|
27
|
+
contact: [
|
|
28
|
+
"created_at",
|
|
29
|
+
"updated_at",
|
|
30
|
+
"name",
|
|
31
|
+
"code",
|
|
32
|
+
"email",
|
|
33
|
+
"phone",
|
|
34
|
+
"dob",
|
|
35
|
+
// Bổ sung 2026-06-01
|
|
36
|
+
"source",
|
|
37
|
+
"gender",
|
|
38
|
+
"address",
|
|
39
|
+
"crm_type",
|
|
40
|
+
// Bổ sung 2026-06-02 (Group C)
|
|
41
|
+
"city_name",
|
|
42
|
+
"district_name",
|
|
43
|
+
"organization_name",
|
|
44
|
+
"group_name"
|
|
45
|
+
],
|
|
46
|
+
organization: [
|
|
47
|
+
"created_at",
|
|
48
|
+
"updated_at",
|
|
49
|
+
"name",
|
|
50
|
+
"phone",
|
|
51
|
+
"email",
|
|
52
|
+
"website",
|
|
53
|
+
// Bổ sung 2026-06-01
|
|
54
|
+
"organization_type",
|
|
55
|
+
"address",
|
|
56
|
+
"member_count",
|
|
57
|
+
// Bổ sung 2026-06-02 (Group C)
|
|
58
|
+
"city_name",
|
|
59
|
+
"district_name",
|
|
60
|
+
"assignee_name",
|
|
61
|
+
"created_by_name"
|
|
62
|
+
],
|
|
63
|
+
deal: [
|
|
64
|
+
"created_at",
|
|
65
|
+
"updated_at",
|
|
66
|
+
"name",
|
|
67
|
+
"value",
|
|
68
|
+
"status",
|
|
69
|
+
"expected_close_date",
|
|
70
|
+
// Bổ sung 2026-06-01 (BE thêm $lookup users / deal_pipelines)
|
|
71
|
+
"customer_name",
|
|
72
|
+
"agent_name",
|
|
73
|
+
"user_name",
|
|
74
|
+
"pipeline_name",
|
|
75
|
+
// Bổ sung 2026-06-02 (Group C)
|
|
76
|
+
"stage_name",
|
|
77
|
+
"stage_order"
|
|
78
|
+
],
|
|
79
|
+
campaign: [
|
|
80
|
+
"created_at",
|
|
81
|
+
"updated_at",
|
|
82
|
+
"name",
|
|
83
|
+
"campaign_type",
|
|
84
|
+
"campaign_status",
|
|
85
|
+
"status"
|
|
86
|
+
],
|
|
87
|
+
smartqc: [
|
|
88
|
+
"created_at",
|
|
89
|
+
"updated_at",
|
|
90
|
+
"name",
|
|
91
|
+
"type",
|
|
92
|
+
"status",
|
|
93
|
+
// Bổ sung 2026-06-01
|
|
94
|
+
"total_conv",
|
|
95
|
+
"completed_conv",
|
|
96
|
+
"pending_conv"
|
|
97
|
+
],
|
|
98
|
+
workflow: [
|
|
99
|
+
"created_at",
|
|
100
|
+
"updated_at",
|
|
101
|
+
"name",
|
|
102
|
+
"status",
|
|
103
|
+
// Bổ sung 2026-06-01
|
|
104
|
+
"created_by_name"
|
|
105
|
+
],
|
|
106
|
+
knowledge: ["created_at", "updated_at", "title", "name", "type", "status"]
|
|
107
|
+
};
|
|
108
|
+
SORTABLE_FIELDS.lead = [...SORTABLE_FIELDS.contact];
|
|
109
|
+
const CUSTOM_FIELD_SORT_RE = /^ad_(str|long|date)_\d+$/;
|
|
110
|
+
const SORT_FIELD_ALIASES = {
|
|
111
|
+
ticket: {
|
|
112
|
+
duedate: "due_date",
|
|
113
|
+
// 2026-06-02 (Group C): cột lookup → field denormalize BE.
|
|
114
|
+
organize_id: "organize_name",
|
|
115
|
+
pipeline_id: "pipeline_name",
|
|
116
|
+
campaign_id: "campaign_name",
|
|
117
|
+
createdBy: "created_by_name"
|
|
118
|
+
},
|
|
119
|
+
// accessorKey FE → field BE thực dùng (theo doc 2026-06-01).
|
|
120
|
+
contact: {
|
|
121
|
+
customer_type: "crm_type",
|
|
122
|
+
// 2026-06-02 (Group C)
|
|
123
|
+
organization: "organization_name",
|
|
124
|
+
group: "group_name",
|
|
125
|
+
city: "city_name",
|
|
126
|
+
district_id: "district_name"
|
|
127
|
+
},
|
|
128
|
+
organization: {
|
|
129
|
+
// 2026-06-02 (Group C)
|
|
130
|
+
city_id: "city_name",
|
|
131
|
+
district_id: "district_name",
|
|
132
|
+
assignee_id: "assignee_name",
|
|
133
|
+
created_by: "created_by_name"
|
|
134
|
+
},
|
|
135
|
+
workflow: { created_by: "created_by_name" }
|
|
136
|
+
};
|
|
137
|
+
SORT_FIELD_ALIASES.lead = { ...SORT_FIELD_ALIASES.contact };
|
|
138
|
+
const resolveSortField = (module, columnKey) => SORT_FIELD_ALIASES[module]?.[columnKey] || columnKey;
|
|
139
|
+
const isSortableField = (module, field) => !!field && (SORTABLE_FIELDS[module]?.includes(field) || CUSTOM_FIELD_SORT_RE.test(field));
|
|
140
|
+
export {
|
|
141
|
+
CUSTOM_FIELD_SORT_RE,
|
|
142
|
+
SORTABLE_FIELDS,
|
|
143
|
+
SORT_FIELD_ALIASES,
|
|
144
|
+
isSortableField,
|
|
145
|
+
resolveSortField
|
|
146
|
+
};
|