@jsb188/app 1.1.10 → 1.1.12
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/package.json +57 -45
- package/src/constants/agent.ts +51 -41
- package/src/constants/app.ts +34 -13
- package/src/constants/emoji.ts +9144 -8936
- package/src/constants/other.ts +1 -5
- package/src/constants/user.ts +16 -25
- package/src/constants/wsActions.ts +27 -0
- package/src/i18n/account.ts +129 -107
- package/src/i18n/agent.ts +331 -73
- package/src/i18n/agentToolBusiness.ts +196 -0
- package/src/i18n/agentToolGrid.ts +137 -0
- package/src/i18n/agentToolWorkflow.ts +101 -0
- package/src/i18n/agent_note.ts +109 -0
- package/src/i18n/app.ts +107 -91
- package/src/i18n/auth.ts +117 -102
- package/src/i18n/billing.ts +5 -92
- package/src/i18n/c.ts +907 -0
- package/src/i18n/campaign.ts +919 -0
- package/src/i18n/country.ts +248 -248
- package/src/i18n/datetime.ts +32 -26
- package/src/i18n/editor.ts +58 -0
- package/src/i18n/error.ts +577 -192
- package/src/i18n/field_doc_editor.ts +21 -0
- package/src/i18n/field_doc_programs.ts +52 -0
- package/src/i18n/field_docs.ts +190 -0
- package/src/i18n/index.ts +42 -19
- package/src/i18n/log.ts +272 -238
- package/src/i18n/memory.ts +53 -0
- package/src/i18n/message.ts +3 -4
- package/src/i18n/note.ts +19 -0
- package/src/i18n/org.ts +164 -109
- package/src/i18n/schedule.ts +209 -0
- package/src/i18n/sheet.ts +333 -4
- package/src/i18n/sheet_formula.ts +165 -0
- package/src/i18n/workflow.ts +109 -23
- package/src/main.ts +68 -64
- package/src/platform.ts +90 -49
- package/src/types/ai.d.ts +52 -23
- package/src/types/app.d.ts +95 -44
- package/src/types/auth.d.ts +66 -40
- package/src/types/console.d.ts +3 -0
- package/src/types/other.d.ts +13 -6
- package/src/types.d.ts +12 -14
- package/src/utils/account.ts +64 -58
- package/src/utils/api.ts +326 -77
- package/src/utils/authSession.ts +24 -0
- package/src/utils/clientIP.ts +213 -0
- package/src/utils/color.ts +279 -0
- package/src/utils/cron.ts +49 -18
- package/src/utils/csv.ts +19 -0
- package/src/utils/datetime.ts +445 -117
- package/src/utils/deferredSave.ts +89 -0
- package/src/utils/email.ts +50 -0
- package/src/utils/emoji.ts +107 -84
- package/src/utils/expression.helpers.ts +470 -0
- package/src/utils/expression.test.ts +793 -0
- package/src/utils/expression.ts +2261 -0
- package/src/utils/interval.ts +80 -0
- package/src/utils/language.ts +9 -0
- package/src/utils/logic.ts +141 -121
- package/src/utils/managedSession.ts +34 -0
- package/src/utils/managedSessionBff.test.ts +60 -0
- package/src/utils/managedSessionBff.ts +117 -0
- package/src/utils/number.ts +85 -38
- package/src/utils/object.ts +227 -30
- package/src/utils/promise.ts +98 -0
- package/src/utils/queryReset.ts +266 -0
- package/src/utils/recurringTask.ts +60 -0
- package/src/utils/schema.ts +293 -0
- package/src/utils/string.test.ts +205 -208
- package/src/utils/string.ts +426 -463
- package/src/utils/timeZone.ts +309 -851
- package/src/utils/url_client.ts +145 -72
- package/tsconfig.json +10 -10
- package/src/constants/billing.ts +0 -146
- package/src/i18n/form.ts +0 -376
- package/src/i18n/product.ts +0 -76
- package/src/types/form.d.ts +0 -97
- package/src/utils/billing.ts +0 -134
package/package.json
CHANGED
|
@@ -1,47 +1,59 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
2
|
+
"name": "@jsb188/app",
|
|
3
|
+
"version": "1.1.12",
|
|
4
|
+
"description": "Contains all the basic requirements for all @jsb188 apps.",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"author": "jsb188",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "src/main.ts",
|
|
9
|
+
"types": "src/types.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./src/main.ts",
|
|
12
|
+
"./platform.ts": "./src/platform.ts",
|
|
13
|
+
"./i18n/index.ts": "./src/i18n/index.ts",
|
|
14
|
+
"./constants/agent.ts": "./src/constants/agent.ts",
|
|
15
|
+
"./constants/app.ts": "./src/constants/app.ts",
|
|
16
|
+
"./constants/emoji.ts": "./src/constants/emoji.ts",
|
|
17
|
+
"./constants/other.ts": "./src/constants/other.ts",
|
|
18
|
+
"./constants/user.ts": "./src/constants/user.ts",
|
|
19
|
+
"./constants/wsActions.ts": "./src/constants/wsActions.ts",
|
|
20
|
+
"./utils/account.ts": "./src/utils/account.ts",
|
|
21
|
+
"./utils/api.ts": "./src/utils/api.ts",
|
|
22
|
+
"./utils/authSession.ts": "./src/utils/authSession.ts",
|
|
23
|
+
"./utils/clientIP.ts": "./src/utils/clientIP.ts",
|
|
24
|
+
"./utils/managedSession.ts": "./src/utils/managedSession.ts",
|
|
25
|
+
"./utils/managedSessionBff.ts": "./src/utils/managedSessionBff.ts",
|
|
26
|
+
"./utils/color.ts": "./src/utils/color.ts",
|
|
27
|
+
"./utils/csv.ts": "./src/utils/csv.ts",
|
|
28
|
+
"./utils/datetime.ts": "./src/utils/datetime.ts",
|
|
29
|
+
"./utils/deferredSave.ts": "./src/utils/deferredSave.ts",
|
|
30
|
+
"./utils/email.ts": "./src/utils/email.ts",
|
|
31
|
+
"./utils/expression.helpers.ts": "./src/utils/expression.helpers.ts",
|
|
32
|
+
"./utils/emoji.ts": "./src/utils/emoji.ts",
|
|
33
|
+
"./utils/cron.ts": "./src/utils/cron.ts",
|
|
34
|
+
"./utils/interval.ts": "./src/utils/interval.ts",
|
|
35
|
+
"./utils/language.ts": "./src/utils/language.ts",
|
|
36
|
+
"./utils/logic.ts": "./src/utils/logic.ts",
|
|
37
|
+
"./utils/number.ts": "./src/utils/number.ts",
|
|
38
|
+
"./utils/object.ts": "./src/utils/object.ts",
|
|
39
|
+
"./utils/promise.ts": "./src/utils/promise.ts",
|
|
40
|
+
"./utils/queryReset.ts": "./src/utils/queryReset.ts",
|
|
41
|
+
"./utils/recurringTask.ts": "./src/utils/recurringTask.ts",
|
|
42
|
+
"./utils/schema.ts": "./src/utils/schema.ts",
|
|
43
|
+
"./utils/string.ts": "./src/utils/string.ts",
|
|
44
|
+
"./utils/timeZone.ts": "./src/utils/timeZone.ts",
|
|
45
|
+
"./utils/url_client.ts": "./src/utils/url_client.ts",
|
|
46
|
+
"./types/ai.d.ts": "./src/types/ai.d.ts",
|
|
47
|
+
"./types/app.d.ts": "./src/types/app.d.ts",
|
|
48
|
+
"./types/auth.d.ts": "./src/types/auth.d.ts",
|
|
49
|
+
"./types/other.d.ts": "./src/types/other.d.ts"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"node-polyglot": "^2.6.0",
|
|
53
|
+
"luxon": "^3.7.2",
|
|
54
|
+
"cron-parser": "^5.6.2"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
58
|
+
}
|
|
47
59
|
}
|
package/src/constants/agent.ts
CHANGED
|
@@ -1,49 +1,59 @@
|
|
|
1
|
-
|
|
2
1
|
// AI agent inboxes
|
|
3
2
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
export const EMAIL_BASE_DOMAINS = ['marketday.ai'] as const;
|
|
4
|
+
export const ALLOWED_EMAIL_SUBDOMAINS = ['agent', 'outbound', 'do-not-reply'] as const;
|
|
5
|
+
// Organization handles belong only on these purpose-specific domains; the root is reserved for platform addresses.
|
|
6
|
+
export const ALLOWED_EMAIL_DOMAINS = ALLOWED_EMAIL_SUBDOMAINS.flatMap(getEmailDomains);
|
|
7
|
+
export const ALLOWED_EMAIL_SENDER_DOMAINS = [...EMAIL_BASE_DOMAINS, ...ALLOWED_EMAIL_DOMAINS];
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* Return every full email domain for one hard-coded inbox prefix.
|
|
11
|
+
*/
|
|
12
|
+
function getEmailDomains(prefix: (typeof ALLOWED_EMAIL_SUBDOMAINS)[number]): string[] {
|
|
13
|
+
return EMAIL_BASE_DOMAINS.map((baseDomain) => `${prefix}.${baseDomain}`);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Domain used as the per-org broadcast/outbound From address:
|
|
17
|
+
// <org emailHandle>@outbound.<primary base domain>. Verified once in Postmark
|
|
18
|
+
// at the domain level, so every org handle sends as an authenticated sender.
|
|
19
|
+
export const OUTBOUND_EMAIL_DOMAINS = getEmailDomains('outbound');
|
|
20
|
+
export const OUTBOUND_EMAIL_DOMAIN = OUTBOUND_EMAIL_DOMAINS[0];
|
|
21
|
+
export const DO_NOT_REPLY_EMAIL_DOMAINS = getEmailDomains('do-not-reply');
|
|
22
|
+
export const DO_NOT_REPLY_EMAIL_DOMAIN = DO_NOT_REPLY_EMAIL_DOMAINS[0];
|
|
23
|
+
|
|
24
|
+
export const AGENT_EMAIL_DOMAINS = getEmailDomains('agent');
|
|
25
|
+
export const AGENT_EMAIL_DOMAIN = AGENT_EMAIL_DOMAINS[0];
|
|
13
26
|
|
|
14
27
|
export const OPERATION_INBOX_DOMAINS = {
|
|
15
|
-
|
|
16
|
-
RESTAURANT: GROUP_TO_INBOX_DOMAINS.vendor,
|
|
17
|
-
DEFAULT: GROUP_TO_INBOX_DOMAINS.default,
|
|
28
|
+
DEFAULT: AGENT_EMAIL_DOMAINS,
|
|
18
29
|
};
|
|
19
30
|
|
|
31
|
+
// ASSISTANT remains the internal capability and memory key for the unified Agent inbox.
|
|
32
|
+
export const DOMAIN_TO_INBOX = Object.fromEntries(AGENT_EMAIL_DOMAINS.map((domain) => [domain, 'ASSISTANT'] as const)) as Record<
|
|
33
|
+
string,
|
|
34
|
+
'ASSISTANT'
|
|
35
|
+
>;
|
|
36
|
+
|
|
37
|
+
// Inboxes that are NOT ready for production yet. Inbound mail to them is rejected, and campaigns show their
|
|
38
|
+
// addresses as disabled From options. Remove an inbox here to enable it everywhere.
|
|
39
|
+
export const DISABLED_INBOXES: ReadonlyArray<'ASSISTANT'> = [];
|
|
20
40
|
|
|
21
|
-
export const
|
|
22
|
-
|
|
23
|
-
'agent.marketday.ai': 'ASSISTANT',
|
|
24
|
-
'assistant.marketday.ai': 'ASSISTANT',
|
|
25
|
-
|
|
26
|
-
// General inquiry
|
|
27
|
-
'general.marketday.ai': 'GENERAL_INQUIRY',
|
|
28
|
-
'info.marketday.ai': 'GENERAL_INQUIRY',
|
|
29
|
-
'inquiry.marketday.ai': 'GENERAL_INQUIRY',
|
|
30
|
-
|
|
31
|
-
// Orders
|
|
32
|
-
'orders.marketday.ai': 'ORDERS',
|
|
33
|
-
} as const;
|
|
34
|
-
|
|
35
|
-
export const REQUEST_SOURCE_ENUMS = [
|
|
36
|
-
'SMS',
|
|
37
|
-
'WEB',
|
|
38
|
-
'EMAIL',
|
|
39
|
-
'WORKFLOW'
|
|
40
|
-
] as const;
|
|
41
|
-
|
|
42
|
-
export const WORKFLOW_RUN_STATUS_ENUMS = [
|
|
43
|
-
'STARTED',
|
|
44
|
-
'COMPLETED',
|
|
45
|
-
'COMPLETED_PARTIAL',
|
|
46
|
-
'ERRORED',
|
|
47
|
-
'QUEUED',
|
|
48
|
-
'CANCELED',
|
|
41
|
+
export const CAMPAIGN_REPLY_TO_AGENT_DOMAINS = [
|
|
42
|
+
...new Set([...Object.values(OPERATION_INBOX_DOMAINS).flat(), ...DO_NOT_REPLY_EMAIL_DOMAINS]),
|
|
49
43
|
];
|
|
44
|
+
|
|
45
|
+
export const REQUEST_SOURCE_ENUMS = ['SMS', 'WEB', 'EMAIL', 'WORKFLOW'] as const;
|
|
46
|
+
|
|
47
|
+
export const WORKFLOW_RUN_STATUS_ENUMS = ['STARTED', 'COMPLETED', 'COMPLETED_PARTIAL', 'ERRORED', 'QUEUED', 'CANCELED'];
|
|
48
|
+
|
|
49
|
+
export const WORKFLOW_KIND_ENUMS = ['WORKFLOW', 'REMINDER'];
|
|
50
|
+
|
|
51
|
+
export const WORKFLOW_TRIGGER_TYPE_ENUMS = ['LOG', 'SCHEDULE', 'ONCE'];
|
|
52
|
+
|
|
53
|
+
export const WORKFLOW_WAIT_CHANNEL_ENUMS = ['SMS', 'EMAIL'];
|
|
54
|
+
|
|
55
|
+
export const WORKFLOW_LIFECYCLE_STATUS_ENUMS = ['INACTIVE', 'ACTIVE', 'SCHEDULED', 'IN_PROGRESS', 'COMPLETED'];
|
|
56
|
+
|
|
57
|
+
export const WORKFLOW_SORT_ENUMS = ['CREATED_DESC', 'LAST_RUN_DESC', 'TITLE_ASC'];
|
|
58
|
+
|
|
59
|
+
export const WORKFLOW_RUN_SORT_ENUMS = ['LATEST_ACTIVITY_DESC'];
|
package/src/constants/app.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export const APP_NAME = 'Marketday';
|
|
1
2
|
|
|
2
3
|
// Max file size (client)
|
|
3
4
|
|
|
@@ -16,6 +17,7 @@ export const DOM_IDS = {
|
|
|
16
17
|
|
|
17
18
|
export const END_BUTTON_WIDTH = '40px';
|
|
18
19
|
export const DATE_WIDTH = '100px';
|
|
20
|
+
export const DATE_AND_TIME_WIDTH = '180px';
|
|
19
21
|
export const DATE_AND_BUTTON_WIDTH = DATE_WIDTH + ' ' + END_BUTTON_WIDTH;
|
|
20
22
|
|
|
21
23
|
// Common, repeatable classnames
|
|
@@ -27,10 +29,14 @@ export const COMMON_CLASSNAMES = {
|
|
|
27
29
|
modalScreenSplitContent: 'h_top px_md pb_md gap_lg',
|
|
28
30
|
modalScreenHeading: 'pt_lg pb_df ft_normal ft_xs cl_darker_2 ls_2',
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
// These are x-paddings used for consistency around content
|
|
33
|
+
tableRowXPadding: 'px_20',
|
|
34
|
+
contentXPadding: 'px_28',
|
|
35
|
+
contentPadding_shadow_offset: 'p_27',
|
|
36
|
+
contentXPadding_shadow_offset: 'px_27',
|
|
37
|
+
contentLeftPadding: 'pl_28',
|
|
38
|
+
contentSidebarClosedPadding: 'pl_8',
|
|
39
|
+
contentXMargin: 'mx_28',
|
|
34
40
|
};
|
|
35
41
|
|
|
36
42
|
// Local storage
|
|
@@ -41,6 +47,9 @@ export const STORAGE_KEYS = {
|
|
|
41
47
|
LAST_VERSION: 'LV:', // ":" at end means it's a prefix
|
|
42
48
|
CURRENT_ACCOUNT_ID: 'CU:',
|
|
43
49
|
|
|
50
|
+
// Personalization
|
|
51
|
+
TABLE_COLUMNS_WIDTH: 'TC:',
|
|
52
|
+
|
|
44
53
|
// Settings
|
|
45
54
|
LIGHT_MODE: 'LM:',
|
|
46
55
|
} as Record<string, string>;
|
|
@@ -59,6 +68,7 @@ export const COMPANY_ADDRESS = {
|
|
|
59
68
|
// Support emails
|
|
60
69
|
|
|
61
70
|
export const APP_EMAILS = {
|
|
71
|
+
assistant: 'assistant@marketday.ai',
|
|
62
72
|
support: 'hello@marketday.ai',
|
|
63
73
|
} as Record<string, string>;
|
|
64
74
|
|
|
@@ -69,10 +79,13 @@ export const SOCIAL_URLS = {
|
|
|
69
79
|
x: 'https://x.com/?',
|
|
70
80
|
x_username: '?',
|
|
71
81
|
},
|
|
72
|
-
} as Record<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
82
|
+
} as Record<
|
|
83
|
+
string,
|
|
84
|
+
{
|
|
85
|
+
x: string;
|
|
86
|
+
x_username: string;
|
|
87
|
+
}
|
|
88
|
+
>;
|
|
76
89
|
|
|
77
90
|
// Colors
|
|
78
91
|
|
|
@@ -104,7 +117,7 @@ export const COLORS = [
|
|
|
104
117
|
|
|
105
118
|
export const MAJOR_COLORS = [
|
|
106
119
|
'red',
|
|
107
|
-
|
|
120
|
+
'amber',
|
|
108
121
|
'yellow',
|
|
109
122
|
'emerald', // Using "emerald" instead of "green" because its closer to brand color
|
|
110
123
|
'blue',
|
|
@@ -114,10 +127,18 @@ export const MAJOR_COLORS = [
|
|
|
114
127
|
|
|
115
128
|
// Languages
|
|
116
129
|
|
|
117
|
-
export const SUPPORTED_LANGUAGES = [
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
130
|
+
export const SUPPORTED_LANGUAGES = ['en', 'es'];
|
|
131
|
+
|
|
132
|
+
export const SUPPORTED_LOG_LANGUAGES = ['en', 'es', 'fr', 'pt', 'de', 'it', 'vi', 'zh-Hans'] as const;
|
|
133
|
+
|
|
134
|
+
export type SupportedLogLanguage = (typeof SUPPORTED_LOG_LANGUAGES)[number];
|
|
135
|
+
|
|
136
|
+
/*
|
|
137
|
+
* Return whether a value is one of the languages supported for log translation.
|
|
138
|
+
*/
|
|
139
|
+
export function isSupportedLogLanguage(value: unknown): value is SupportedLogLanguage {
|
|
140
|
+
return typeof value === 'string' && (SUPPORTED_LOG_LANGUAGES as readonly string[]).includes(value);
|
|
141
|
+
}
|
|
121
142
|
|
|
122
143
|
// Countries
|
|
123
144
|
|