@jsb188/app 1.1.3 → 1.1.5
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/constants/app.ts +37 -4
- package/constants/organization.ts +12 -0
- package/i18n/{user.ts → account.ts} +11 -33
- package/i18n/app.ts +14 -20
- package/i18n/auth.ts +56 -20
- package/i18n/error.ts +24 -14
- package/i18n/form.ts +41 -3
- package/main.ts +2 -2
- package/package.json +6 -6
- package/types/account.d.ts +62 -0
- package/types/ai.d.ts +3 -0
- package/types/app.d.ts +2 -1
- package/types/auth.d.ts +7 -1
- package/types/form.d.ts +9 -3
- package/types/organization.d.ts +76 -20
- package/utils/api.ts +0 -1
- package/utils/datetime.ts +128 -29
- package/utils/logic.ts +23 -9
- package/utils/number.ts +86 -7
- package/utils/object.ts +139 -67
- package/utils/organization.ts +102 -0
- package/utils/string.ts +55 -9
- package/utils/timeZone.ts +497 -4
- package/utils/url_client.ts +17 -22
- package/utils/user.ts +0 -105
- package/constants/journal.ts +0 -118
- package/types/journal.d.ts +0 -35
- package/types/user.d.ts +0 -52
- package/utils/journal.ts +0 -20
package/constants/app.ts
CHANGED
|
@@ -7,7 +7,9 @@ export const NOTIF_EXPIRE_DAYS = 30;
|
|
|
7
7
|
|
|
8
8
|
export const DOM_IDS = {
|
|
9
9
|
sidebarInput: 'sidebar_input',
|
|
10
|
-
mainFocusTextarea: '
|
|
10
|
+
mainFocusTextarea: 'main_tx',
|
|
11
|
+
mainBodyScrollArea: 'main_scr',
|
|
12
|
+
popOverScrollArea: 'pop_over_scr',
|
|
11
13
|
};
|
|
12
14
|
|
|
13
15
|
// Local storage
|
|
@@ -25,9 +27,7 @@ export const STORAGE_KEYS = {
|
|
|
25
27
|
// Support e-mails
|
|
26
28
|
|
|
27
29
|
export const SUPPORT_EMAILS = {
|
|
28
|
-
|
|
29
|
-
big_planet: 'hi@kajiwoto.ai',
|
|
30
|
-
cosmic: 'hi@kajiwoto.ai',
|
|
30
|
+
marketday: 'hello@marketday.ai'
|
|
31
31
|
} as Record<string, string>;
|
|
32
32
|
|
|
33
33
|
// Social media
|
|
@@ -45,3 +45,36 @@ export const SOCIAL_URLS = {
|
|
|
45
45
|
x: string;
|
|
46
46
|
x_username: string;
|
|
47
47
|
}>;
|
|
48
|
+
|
|
49
|
+
// Languages
|
|
50
|
+
|
|
51
|
+
export const SUPPORTED_LANGUAGES = [
|
|
52
|
+
'ENGLISH',
|
|
53
|
+
'SPANISH',
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
// Colors
|
|
57
|
+
|
|
58
|
+
export const COLORS = [
|
|
59
|
+
'red',
|
|
60
|
+
'orange',
|
|
61
|
+
'brown',
|
|
62
|
+
'amber',
|
|
63
|
+
'yellow',
|
|
64
|
+
'lime',
|
|
65
|
+
'green',
|
|
66
|
+
'emerald',
|
|
67
|
+
'teal',
|
|
68
|
+
'cyan',
|
|
69
|
+
'sky',
|
|
70
|
+
'blue',
|
|
71
|
+
'indigo',
|
|
72
|
+
'violet',
|
|
73
|
+
'purple',
|
|
74
|
+
'fuchsia',
|
|
75
|
+
'pink',
|
|
76
|
+
'rose',
|
|
77
|
+
'slate',
|
|
78
|
+
'zinc',
|
|
79
|
+
'stone'
|
|
80
|
+
];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Organization constants
|
|
2
|
+
// IMPORTANT NOTE: Array order must *never* change, indexes are used to create PDF URLs
|
|
3
|
+
|
|
4
|
+
export const OPERATION_ENUMS = ['ARABLE', 'LIVESTOCK'];
|
|
5
|
+
|
|
6
|
+
// Employee ACL
|
|
7
|
+
|
|
8
|
+
export const ROLE_ENUMS = ['MEMBER', 'MANAGER', 'ADMIN', 'OWNER']; // first is default value
|
|
9
|
+
|
|
10
|
+
// Role categories (used for reminders)
|
|
11
|
+
|
|
12
|
+
export const ROLE_CATEGORY_ENUMS = ['EMPLOYEES_ONLY', 'MANAGERS_ONLY'];
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
en: {
|
|
3
|
-
|
|
4
|
-
displayName_ph: 'e.g. "Jane Doe"',
|
|
5
|
-
displayName_info: 'Display name is how others will see you.',
|
|
3
|
+
name_ph: 'e.g. "Jane Doe"',
|
|
6
4
|
pronouns: 'Pronouns',
|
|
7
5
|
pronouns_ph: 'Enter your pronouns',
|
|
8
6
|
about: 'About me',
|
|
@@ -12,21 +10,25 @@ export default {
|
|
|
12
10
|
username_info: 'Username, ID, and e-mail is used to log in to your account.',
|
|
13
11
|
email: 'E-mail',
|
|
14
12
|
email_ph: 'e.g. jane_doe@email.com',
|
|
15
|
-
phone: '
|
|
16
|
-
// phone_ph: 'e.g. 222-333-4444',
|
|
13
|
+
phone: 'Phone number',
|
|
17
14
|
phone_ph: 'e.g. 123-444-5555',
|
|
18
15
|
password: 'Password',
|
|
19
16
|
password_ph: 'Enter your password',
|
|
20
|
-
passwordRepeat: 'Password (
|
|
17
|
+
passwordRepeat: 'Password (repeat)',
|
|
21
18
|
search_ph: 'Search @ or ID',
|
|
22
19
|
no_one_found_: 'No one found: "%{query}"',
|
|
23
|
-
from_friends_list: 'From your friends list',
|
|
24
|
-
not_friends_yet: 'Not friends yet',
|
|
25
20
|
profile_no_desc: 'This user hasn\'t written anything about themselves.',
|
|
26
21
|
no_one_found: 'No one found with this query.',
|
|
27
22
|
|
|
28
23
|
// App settings
|
|
29
24
|
account: 'Account',
|
|
25
|
+
fName: 'First name',
|
|
26
|
+
lName: 'Last name',
|
|
27
|
+
language: 'Language',
|
|
28
|
+
ai_language: 'Preferred language for AI',
|
|
29
|
+
timeZone: 'Time zone',
|
|
30
|
+
your_account: 'Your account',
|
|
31
|
+
your_preferences: 'Your preferences',
|
|
30
32
|
profile: 'Profile',
|
|
31
33
|
profile_desc: 'Change how your profile looks to others.',
|
|
32
34
|
personas: 'Personas',
|
|
@@ -64,37 +66,13 @@ export default {
|
|
|
64
66
|
copy_id: 'Copy ID',
|
|
65
67
|
|
|
66
68
|
// Profile
|
|
67
|
-
|
|
69
|
+
avatar_color: 'Avatar color',
|
|
68
70
|
open_profile: 'Open profile',
|
|
69
71
|
cards_ct: '%{smart_count} Card||||%{smart_count} Cards',
|
|
70
72
|
report_user: 'Report user',
|
|
71
73
|
profile_deactivated_desc: 'This account has been deactivated.',
|
|
72
74
|
phone_numbers: 'Phone numbers',
|
|
73
75
|
|
|
74
|
-
// Friend status
|
|
75
|
-
blocked: 'Blocked',
|
|
76
|
-
blocked_by_me: 'You blocked this user.',
|
|
77
|
-
blocked_by_other: 'You are blocked.',
|
|
78
|
-
friends: 'Friends',
|
|
79
|
-
friends_msg: 'You are friends.',
|
|
80
|
-
friend_status: 'Friend status',
|
|
81
|
-
friend_request: 'Friend',
|
|
82
|
-
friend_requests_ct: '%{smart_count} Friend request||||%{smart_count} Friend requests',
|
|
83
|
-
friend_requested: 'Requested',
|
|
84
|
-
friend_requested_msg: 'You received a friend request.',
|
|
85
|
-
recent_friends: 'Recent friends',
|
|
86
|
-
sent_friend_msg: 'You sent a friend request.',
|
|
87
|
-
accept_friend: 'Accept request',
|
|
88
|
-
add_friend: 'Add friend',
|
|
89
|
-
add_friend_msg: 'You must be friends to send direct messages.',
|
|
90
|
-
send_friend: 'Send friend request',
|
|
91
|
-
sent_friend: 'Friend requested',
|
|
92
|
-
unblock: 'Unblock',
|
|
93
|
-
block: 'Block',
|
|
94
|
-
remove_friend: 'Remove friend',
|
|
95
|
-
ignore_friend: 'Ignore request',
|
|
96
|
-
cancel_friend: 'Cancel request',
|
|
97
|
-
|
|
98
76
|
// Search instructions
|
|
99
77
|
search_instr_1: 'Search by user ID',
|
|
100
78
|
search_instr_2: 'Search by @username',
|
package/i18n/app.ts
CHANGED
|
@@ -6,12 +6,25 @@ export default {
|
|
|
6
6
|
privacy: 'Privacy Policy',
|
|
7
7
|
tos: 'Terms of Service',
|
|
8
8
|
|
|
9
|
-
//
|
|
9
|
+
// Routes
|
|
10
10
|
route_: 'App | %{text}',
|
|
11
11
|
route_auth: 'Log in or sign up',
|
|
12
|
+
route_auth_signup: 'Create an account',
|
|
12
13
|
route_not_found: 'Page Not Found',
|
|
13
14
|
route_not_found_desc: 'The page you are looking for does not exist.',
|
|
14
15
|
|
|
16
|
+
// Toolbar titles
|
|
17
|
+
// NOTE: If i18n.has(routeName) -> /app/ routes will show the title in the toolbar
|
|
18
|
+
toolbar_title_logs: 'Logs',
|
|
19
|
+
toolbar_title_ai_chat: 'AI',
|
|
20
|
+
|
|
21
|
+
// General
|
|
22
|
+
open_app: 'Open app',
|
|
23
|
+
home: 'Home',
|
|
24
|
+
timezone_set_to_: 'Time zone is set to: %{timeZone}',
|
|
25
|
+
latest_updates: 'Latest updates',
|
|
26
|
+
update_notes: 'Update notes',
|
|
27
|
+
|
|
15
28
|
// @home screen
|
|
16
29
|
hey_: 'Hey, ',
|
|
17
30
|
how_to_use_app: 'How to use this app',
|
|
@@ -40,20 +53,6 @@ export default {
|
|
|
40
53
|
message_you_3: 'Your messages are colorful.',
|
|
41
54
|
message_you_4: 'Because you are special!',
|
|
42
55
|
|
|
43
|
-
// Theme names
|
|
44
|
-
theme_terracotta: 'Terracotta',
|
|
45
|
-
theme_envy_green: 'Envy green',
|
|
46
|
-
theme_vaporwave: 'Vaporwave',
|
|
47
|
-
theme_facetious: 'Facetious',
|
|
48
|
-
theme_sebastian_garden: 'Sebastian\'s garden',
|
|
49
|
-
theme_bob_deep_sea: 'Bob\'s deep sea',
|
|
50
|
-
theme_saif_flowers: 'Saif\'s flowers',
|
|
51
|
-
theme_bona_mocha: 'Bona\'s mocha',
|
|
52
|
-
theme_naffe_heart: 'Naffe\'s heart',
|
|
53
|
-
theme_dominic_aquarium: 'Dominic\'s aquarium',
|
|
54
|
-
theme_xavii_toothpaste: 'Xavii\'s toothpaste',
|
|
55
|
-
theme_miyu_sugar_sherbet: 'Miyu\'s sugar sherbet',
|
|
56
|
-
|
|
57
56
|
// Settings
|
|
58
57
|
settings: 'Settings',
|
|
59
58
|
appearance: 'Appearance',
|
|
@@ -87,11 +86,6 @@ export default {
|
|
|
87
86
|
notif_message_CO_OWNER_ADDED: 'You became a co-owner. You have live and moderation permissions.',
|
|
88
87
|
notif_message_CO_OWNER_INVITE: 'You received an invitation to become a co-owner for this chat.',
|
|
89
88
|
|
|
90
|
-
// Homepage; Top banner
|
|
91
|
-
hp_desc_1: 'is a ',
|
|
92
|
-
hp_desc_2: 'community owned',
|
|
93
|
-
hp_desc_3: 'messaging app.',
|
|
94
|
-
|
|
95
89
|
// Homepage; Roadmap
|
|
96
90
|
roadmap: 'Roadmap',
|
|
97
91
|
|
package/i18n/auth.ts
CHANGED
|
@@ -2,23 +2,32 @@ export default {
|
|
|
2
2
|
en: {
|
|
3
3
|
// Login
|
|
4
4
|
welcome_back: 'Welcome back',
|
|
5
|
-
|
|
5
|
+
log_in: 'Log in',
|
|
6
|
+
log_in_sign_up: 'Log in / Sign up',
|
|
6
7
|
open_app: 'Open app',
|
|
7
8
|
continue_with_google: 'Continue with Google',
|
|
8
9
|
continue_with_discord: 'Continue with Discord',
|
|
9
10
|
continue_with_apple: 'Continue with Apple',
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
continue_with_phone: 'Continue with Phone',
|
|
12
|
+
login_opts_main: 'Phone number or e-mail',
|
|
12
13
|
verify_your_acc: 'Verify your account',
|
|
13
|
-
resend_verification_email: 'Send verification e-mail', // This is for title of <ModalHeader /> in <AuthSwitch />
|
|
14
14
|
reset_password: 'Reset password',
|
|
15
15
|
forgot_password_: 'Forgot password or username?',
|
|
16
16
|
signup_email: 'Sign up using e-mail',
|
|
17
|
-
|
|
17
|
+
log_in_w_existing: 'Log in with an existing account',
|
|
18
|
+
log_in_other_methods: 'Log in using other methods',
|
|
18
19
|
change_password: 'Change password',
|
|
19
20
|
you_are_verified_: 'You are verified!',
|
|
20
|
-
account_is_verified: 'Thank you for verifying your account with e-mail address:
|
|
21
|
-
continue_to_login: 'Continue to
|
|
21
|
+
account_is_verified: 'Thank you for verifying your account with e-mail address: **%{emailAddress}**. Please log in again using your password.',
|
|
22
|
+
continue_to_login: 'Continue to log in',
|
|
23
|
+
continue_to_app: 'Continue to app',
|
|
24
|
+
|
|
25
|
+
// Phone 2FA
|
|
26
|
+
send_verification_code_msg: 'Enter your phone number and we will send you a verification code for authentication.',
|
|
27
|
+
send_verification_code: 'Send verification code',
|
|
28
|
+
confirm_verification_code_instr: 'Enter the verification code sent to your phone. Please wait few minutes if you did not receive it.',
|
|
29
|
+
resend_verification_code: 'Re-send verification code',
|
|
30
|
+
verification_code_wrong: 'Verification code you entered is incorrect. Please try again.',
|
|
22
31
|
|
|
23
32
|
// Auth
|
|
24
33
|
username_not_found: 'No one was found with that username.',
|
|
@@ -27,32 +36,52 @@ export default {
|
|
|
27
36
|
you_are_logged_in: 'You are signed in.',
|
|
28
37
|
password_changed_msg: 'Your password has been changed.',
|
|
29
38
|
request_reset_password_instr: 'Enter your e-mail address and we will send you instructions to reset your password.',
|
|
30
|
-
resend_verification_instr: 'Enter your e-mail address
|
|
39
|
+
resend_verification_instr: 'Enter your e-mail address and we will send you an e-mail to verify your account.',
|
|
31
40
|
reset_password_instr: 'Choose a new password for your account with the e-mail address: %{emailAddress}',
|
|
32
|
-
|
|
41
|
+
_verify_your_email: ' to verify your e-mail.',
|
|
42
|
+
_verify_your_phone: ' to verify your phone number.',
|
|
43
|
+
account_secured_: 'Account secured!',
|
|
44
|
+
one_last_step_: 'One last step!',
|
|
45
|
+
add_password: 'Add password',
|
|
46
|
+
add_password_log_in_msg: 'Please add a password to your account (%{identifier}) for security. You will be logged in afterwards.',
|
|
47
|
+
add_password_fin_msg: 'Your account has been secured with a password. From now on, you may use your password to log in.',
|
|
33
48
|
|
|
34
49
|
// Auth - check fails
|
|
35
50
|
no_account_with_phone: 'No account was found with that phone number.',
|
|
36
51
|
no_account_with_email: 'No account was found with that e-mail address.',
|
|
37
|
-
not_valid_email_or_phone: 'That is not a valid phone number or
|
|
52
|
+
not_valid_email_or_phone: 'That is not a valid phone number or e-mail address.',
|
|
38
53
|
|
|
39
54
|
// Reset password (requested)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
55
|
+
reset_password_requested_msg: (
|
|
56
|
+
'Check your e-mail, <strong>%{emailAddress}</strong> ' +
|
|
57
|
+
'for instructions to reset your password.'
|
|
58
|
+
),
|
|
59
|
+
if_need_more_help_email: (
|
|
60
|
+
'If you need assistance, please contact us at ' +
|
|
61
|
+
'[%{emailAddress}](mailto:%{emailAddress}).'
|
|
62
|
+
),
|
|
63
|
+
|
|
64
|
+
// Invite required
|
|
65
|
+
invite_required: 'Invite required',
|
|
66
|
+
invite_required_msg: (
|
|
67
|
+
'Account creation is currently not opened to the public. ' +
|
|
68
|
+
'Ask your team for an invite or contact us at ' +
|
|
69
|
+
'[%{emailAddress}](mailto:%{emailAddress}) to create an account.'
|
|
70
|
+
),
|
|
43
71
|
|
|
44
72
|
// Sign up
|
|
45
73
|
sign_up: 'Sign up',
|
|
46
74
|
create_account: 'Create an account',
|
|
47
75
|
agree_and_continue: 'Agree and continue',
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
76
|
+
sign_up_notice_msg: (
|
|
77
|
+
'By selecting "Agree and continue", I agree to the ' +
|
|
78
|
+
'[Terms of Service](/tos) and acknowledge the ' +
|
|
79
|
+
'[Privacy Policy](/privacy).'
|
|
80
|
+
),
|
|
51
81
|
email_sent: 'E-mail sent',
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
check_email_4: ' or re-send another verification link to your e-mail.',
|
|
82
|
+
check_email_msg: 'Please check your e-mail for instructions to verify your account.',
|
|
83
|
+
// check_email_3: 'Click "continue" to log in as ',
|
|
84
|
+
// check_email_4: ' or re-send another verification link to your e-mail.',
|
|
56
85
|
check_email: 'Check your e-mail',
|
|
57
86
|
not_verified_yet: 'Please verify your e-mail and try again.',
|
|
58
87
|
resend_change_verification: 'Re-send verification link or change e-mail',
|
|
@@ -60,6 +89,13 @@ export default {
|
|
|
60
89
|
verify_email_msg: 'Send a new verification link to your e-mail.',
|
|
61
90
|
resend_verification: 'Send verification e-mail',
|
|
62
91
|
|
|
92
|
+
// Sign up success
|
|
93
|
+
account_created: 'Account created',
|
|
94
|
+
account_created_msg: (
|
|
95
|
+
'Your account has been created successfully. Please follow the instructions ' +
|
|
96
|
+
'in the e-mail we sent you to verify your account.'
|
|
97
|
+
),
|
|
98
|
+
|
|
63
99
|
// Sign out
|
|
64
100
|
sign_out: 'Sign out',
|
|
65
101
|
signing_out_: 'Signing you out...'
|
package/i18n/error.ts
CHANGED
|
@@ -4,7 +4,8 @@ export default {
|
|
|
4
4
|
invalid: 'Invalid',
|
|
5
5
|
network_error_title: 'Network error',
|
|
6
6
|
unknown_error: 'An unknown error occured.',
|
|
7
|
-
network_error: 'Failed to connect to server
|
|
7
|
+
network_error: 'Failed to connect to server.\nPlease try again in a moment.',
|
|
8
|
+
network_or_outage_error: 'Failed to connect to server. If your internet connection is stable, our servers may be experiencing an outage.',
|
|
8
9
|
app_error_title: 'App crashed',
|
|
9
10
|
app_error: 'Uh-oh, please refresh the page and tell someone.',
|
|
10
11
|
not_allowed: 'Not allowed',
|
|
@@ -39,16 +40,16 @@ export default {
|
|
|
39
40
|
20003: 'Please use "Continue with Google" to log in. (%{value})',
|
|
40
41
|
'20004_title': 'Continue with Apple',
|
|
41
42
|
20004: 'Please use "Continue with Apple" to log in. (%{value})',
|
|
42
|
-
20005: 'Could not find
|
|
43
|
-
20006: 'Could not find
|
|
44
|
-
20007: 'Could not find
|
|
43
|
+
20005: 'Could not find the account with that username (@%{value})',
|
|
44
|
+
20006: 'Could not find the account with that e-mail. (%{value})',
|
|
45
|
+
20007: 'Could not find the account with that ID. (%{value})',
|
|
45
46
|
20008: 'Your password is incorrect. You have %{value} try(s) remaining.',
|
|
46
47
|
20009: 'Please wait 10 minutes before trying to log in again.',
|
|
47
|
-
20010: '
|
|
48
|
+
20010: 'This account could not be found.',
|
|
48
49
|
20011: 'Your token expired, please request a new link.',
|
|
49
50
|
20012: 'Your token is invalid, please request a new link.',
|
|
50
|
-
20013: '
|
|
51
|
-
20014: '
|
|
51
|
+
20013: 'Account already exists with that e-mail address. (%{value})',
|
|
52
|
+
20014: 'Account already exists with that username. (%{value})',
|
|
52
53
|
20015: "We couldn't find that user in our database.",
|
|
53
54
|
20016: 'You are being rate limited. Please try again in a moment.',
|
|
54
55
|
20017: 'Please check your-email before requesting another verification link or wait few more seconds.',
|
|
@@ -60,7 +61,7 @@ export default {
|
|
|
60
61
|
20022: 'You are not allowed to chat here.',
|
|
61
62
|
20023: 'You must be friends to send direct messages.',
|
|
62
63
|
20024: "You've been temporarily timed out.",
|
|
63
|
-
20025: '
|
|
64
|
+
20025: 'Account associated with "%{value}" has been banned. If this is an error, please send us an e-mail.',
|
|
64
65
|
20026: 'You were blocked by this user.',
|
|
65
66
|
20027: 'Your IP has been banned. If this is an error, please send us an e-mail.',
|
|
66
67
|
20028: 'Please disable your VPN and try again.',
|
|
@@ -84,10 +85,18 @@ export default {
|
|
|
84
85
|
20046: 'Your new password must be different from your current password.',
|
|
85
86
|
20047: 'You must enter a valid password.',
|
|
86
87
|
20048: 'This action is forbidden because you deleted your account.',
|
|
87
|
-
20049: 'You
|
|
88
|
+
20049: 'You haven\'t verified your account yet.',
|
|
88
89
|
20050: 'This page does not exist.',
|
|
89
|
-
20051: '
|
|
90
|
+
20051: 'We couldn\'t find an account associated with that phone number. (%{value})',
|
|
90
91
|
20052: 'You do not have access to this organization\'s data.',
|
|
92
|
+
20053: 'You haven\'t verified your account yet.',
|
|
93
|
+
20054: 'You need an invitation to create an account.',
|
|
94
|
+
20055: 'You are sending too many verification codes. Please slow down.',
|
|
95
|
+
20056: 'Account associated with "%{value}" has been banned. If this is an error, please send us an e-mail.',
|
|
96
|
+
20057: 'Your verification code expired. Please request a new code.',
|
|
97
|
+
20058: 'You do not have permissions to edit this log. Please contact your administrator.',
|
|
98
|
+
20059: 'This log was not found.\nIt may have been deleted.',
|
|
99
|
+
20060: 'You do not have permissions to delete this log. Please contact your administrator.',
|
|
91
100
|
|
|
92
101
|
'29999_title': 'Not ready',
|
|
93
102
|
29999: 'AI chat is not ready right now.',
|
|
@@ -95,14 +104,14 @@ export default {
|
|
|
95
104
|
// 3x
|
|
96
105
|
|
|
97
106
|
30000: 'An unknown error occured.',
|
|
98
|
-
30003: "We're having trouble accessing the server.
|
|
107
|
+
30003: "We're having trouble accessing the server.",
|
|
99
108
|
30004: 'We made a mistake in our code. We will fix this soon.',
|
|
100
|
-
30010: 'Google
|
|
101
|
-
30011: 'Something went wrong with your Google authentication attempt.
|
|
109
|
+
30010: 'Google servers are not responding right now.',
|
|
110
|
+
30011: 'Something went wrong with your Google authentication attempt.',
|
|
102
111
|
30013: 'Our database is in maintenance. Please try again in a moment.',
|
|
103
112
|
30014: 'Stripe CardElement is incorrect.',
|
|
104
113
|
30015: 'Invalid payment form values.',
|
|
105
|
-
30016: 'Stripe API request failed with an unknown reason.
|
|
114
|
+
30016: 'Stripe API request failed with an unknown reason.',
|
|
106
115
|
30017: 'Your bank declined your payment method. Please try again with a different card.',
|
|
107
116
|
30018: 'Your card was declined too many times by Stripe. Please try again later.',
|
|
108
117
|
30019: 'Your card has expired. Please try again with a different card.',
|
|
@@ -129,6 +138,7 @@ export default {
|
|
|
129
138
|
msg_password_special: 'Your password must contain at least one special character.',
|
|
130
139
|
msg_password_insecure: 'Your password is not secure enough.',
|
|
131
140
|
msg_password_mismatch: 'Your password confirmation did not match.',
|
|
141
|
+
msg_phone_invalid: '"%{value}" is not a valid phone number.',
|
|
132
142
|
msg_note_too_long: 'Your room note is too long. It must be less than %{length} characters.',
|
|
133
143
|
|
|
134
144
|
// File errors
|
package/i18n/form.ts
CHANGED
|
@@ -2,19 +2,24 @@ export default {
|
|
|
2
2
|
en: {
|
|
3
3
|
yes: 'Yes',
|
|
4
4
|
no: 'No',
|
|
5
|
-
|
|
5
|
+
no_nevermind: 'No, nevermind',
|
|
6
6
|
ok: 'OK',
|
|
7
7
|
or: 'or',
|
|
8
|
+
warning: 'Warning',
|
|
8
9
|
cancel: 'Cancel',
|
|
9
10
|
continue: 'Continue',
|
|
11
|
+
continue_editing: 'Continue editing',
|
|
10
12
|
apply: 'Apply',
|
|
11
13
|
apply_filters: 'Apply filters',
|
|
12
14
|
hide: 'Hide',
|
|
13
15
|
show: 'Show',
|
|
16
|
+
deleted: 'Deleted',
|
|
17
|
+
delete: 'Delete',
|
|
14
18
|
try_again: 'Try again',
|
|
15
19
|
refresh_page: 'Refresh page',
|
|
16
20
|
search: 'Search',
|
|
17
21
|
no_results: 'No results',
|
|
22
|
+
change: 'Change',
|
|
18
23
|
save: 'Save',
|
|
19
24
|
saving_: 'Saving...',
|
|
20
25
|
undo_changes: 'Undo changes',
|
|
@@ -60,6 +65,36 @@ export default {
|
|
|
60
65
|
success: 'Success',
|
|
61
66
|
success_: 'Success!',
|
|
62
67
|
help: 'Help',
|
|
68
|
+
start: 'Start',
|
|
69
|
+
end: 'End',
|
|
70
|
+
time: 'Time',
|
|
71
|
+
time_with_zone: 'Time (%{timeZone})',
|
|
72
|
+
date: 'Date',
|
|
73
|
+
start_date: 'Start date',
|
|
74
|
+
end_date: 'End date',
|
|
75
|
+
esc: 'ESC',
|
|
76
|
+
settings: 'Settings',
|
|
77
|
+
note: 'Note',
|
|
78
|
+
details: 'Details',
|
|
79
|
+
quantity: 'Quantity',
|
|
80
|
+
quantity_ph: '7.5',
|
|
81
|
+
unit: 'Unit',
|
|
82
|
+
price: 'Price',
|
|
83
|
+
cropId: 'Crop',
|
|
84
|
+
logged_edited_at: 'Logged %{logDate}. Updated %{editDate}.',
|
|
85
|
+
logged_at: 'Logged %{logDate}.',
|
|
86
|
+
category: 'Category',
|
|
87
|
+
activity: 'Activity',
|
|
88
|
+
activity_ph: 'Type of activity',
|
|
89
|
+
crop: 'Crop',
|
|
90
|
+
crop_ph: 'Select crop',
|
|
91
|
+
concentration: 'Concentration',
|
|
92
|
+
concentration_ph: '0.5',
|
|
93
|
+
concentration_unit: 'Concentration unit',
|
|
94
|
+
concentration_unit_ph: 'mg/L',
|
|
95
|
+
water_quantity: 'Quantity (water)',
|
|
96
|
+
water_unit: 'Unit (water)',
|
|
97
|
+
water_unit_ph: 'gallons, litres',
|
|
63
98
|
|
|
64
99
|
// Day periods
|
|
65
100
|
greet_MORNING: 'Good morning, %{name}.',
|
|
@@ -71,7 +106,10 @@ export default {
|
|
|
71
106
|
comm_type_EMAIL: 'E-mail',
|
|
72
107
|
comm_type_SMS: 'SMS',
|
|
73
108
|
|
|
74
|
-
//
|
|
75
|
-
|
|
109
|
+
// Languages
|
|
110
|
+
lang: {
|
|
111
|
+
ENGLISH: 'English',
|
|
112
|
+
SPANISH: 'Spanish',
|
|
113
|
+
},
|
|
76
114
|
},
|
|
77
115
|
};
|
package/main.ts
CHANGED
|
@@ -5,7 +5,7 @@ import billing from './i18n/billing';
|
|
|
5
5
|
import datetime from './i18n/datetime';
|
|
6
6
|
import error from './i18n/error';
|
|
7
7
|
import form from './i18n/form';
|
|
8
|
-
import
|
|
8
|
+
import account from './i18n/account';
|
|
9
9
|
|
|
10
10
|
// Get the correct type for ENV
|
|
11
11
|
let ENV: Map<string, string | boolean | number> = new Map();
|
|
@@ -26,7 +26,7 @@ export function configI18n(texts: Record<string, any>) {
|
|
|
26
26
|
datetime: datetime[locale],
|
|
27
27
|
error: error[locale],
|
|
28
28
|
form: form[locale],
|
|
29
|
-
|
|
29
|
+
account: account[locale],
|
|
30
30
|
} as Record<string, any>;
|
|
31
31
|
|
|
32
32
|
for (const key in texts) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsb188/app",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "Contains all the basic requirements for all @jsb188 apps.",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "jsb188",
|
|
@@ -14,27 +14,27 @@
|
|
|
14
14
|
"./constants/app": "./constants/app.ts",
|
|
15
15
|
"./constants/billing": "./constants/billing.ts",
|
|
16
16
|
"./constants/emoji": "./constants/emoji.ts",
|
|
17
|
-
"./constants/
|
|
17
|
+
"./constants/organization": "./constants/organization.ts",
|
|
18
18
|
"./constants/user": "./constants/user.ts",
|
|
19
19
|
"./constants/ws": "./constants/ws.ts",
|
|
20
20
|
"./utils/api": "./utils/api.ts",
|
|
21
21
|
"./utils/billing": "./utils/billing.ts",
|
|
22
22
|
"./utils/datetime": "./utils/datetime.ts",
|
|
23
23
|
"./utils/emoji": "./utils/emoji.ts",
|
|
24
|
-
"./utils/journal": "./utils/journal.ts",
|
|
25
24
|
"./utils/logic": "./utils/logic.ts",
|
|
26
25
|
"./utils/number": "./utils/number.ts",
|
|
27
26
|
"./utils/object": "./utils/object.ts",
|
|
27
|
+
"./utils/organization": "./utils/organization.ts",
|
|
28
28
|
"./utils/string": "./utils/string.ts",
|
|
29
|
+
"./utils/timeZone": "./utils/timeZone.ts",
|
|
29
30
|
"./utils/url_client": "./utils/url_client.ts",
|
|
30
31
|
"./utils/user": "./utils/user.ts",
|
|
32
|
+
"./types/account.d": "./types/account.d.ts",
|
|
31
33
|
"./types/ai.d": "./types/ai.d.ts",
|
|
32
34
|
"./types/app.d": "./types/app.d.ts",
|
|
33
35
|
"./types/auth.d": "./types/auth.d.ts",
|
|
34
36
|
"./types/form.d": "./types/form.d.ts",
|
|
35
|
-
"./types/
|
|
36
|
-
"./types/organization.d": "./types/organization.d.ts",
|
|
37
|
-
"./types/user.d": "./types/user.d.ts"
|
|
37
|
+
"./types/organization.d": "./types/organization.d.ts"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"node-polyglot": "^2.6.0",
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { OrganizationACL, OrganizationRoleEnum } from './organization.d.ts';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Account; phone
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export interface AccountPhoneObj {
|
|
8
|
+
id: number;
|
|
9
|
+
number: string;
|
|
10
|
+
primary: boolean;
|
|
11
|
+
// verified: boolean; // Assume verified when data is fetched
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Account
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export interface AccountObj {
|
|
19
|
+
id: number;
|
|
20
|
+
profile: {
|
|
21
|
+
id: number;
|
|
22
|
+
firstName: string;
|
|
23
|
+
lastName: string;
|
|
24
|
+
storageId: number | null;
|
|
25
|
+
// phone: AccountPhoneObj | null; // ?? This is a coding mistake, I think
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface AccountData extends AccountObj {
|
|
30
|
+
phone: {
|
|
31
|
+
id: number;
|
|
32
|
+
number: string;
|
|
33
|
+
primary: boolean;
|
|
34
|
+
verified: boolean;
|
|
35
|
+
banned: boolean;
|
|
36
|
+
editAt: Date;
|
|
37
|
+
};
|
|
38
|
+
email: {
|
|
39
|
+
id: number;
|
|
40
|
+
email: string;
|
|
41
|
+
primary: boolean;
|
|
42
|
+
verified: boolean;
|
|
43
|
+
banned: boolean;
|
|
44
|
+
editAt: Date;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Account with membership
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
export interface AccountMembershipData {
|
|
53
|
+
id: number;
|
|
54
|
+
accountId: number;
|
|
55
|
+
organizationId: number;
|
|
56
|
+
role: OrganizationRoleEnum;
|
|
57
|
+
acl: OrganizationACL;
|
|
58
|
+
primary: boolean;
|
|
59
|
+
createdAt: Date;
|
|
60
|
+
updatedAt: Date;
|
|
61
|
+
account: AccountData;
|
|
62
|
+
}
|
package/types/ai.d.ts
CHANGED
|
@@ -12,11 +12,14 @@ export type AIEventErrorName =
|
|
|
12
12
|
| 'AI_COULD_NOT_RESOLVE'
|
|
13
13
|
| 'AI_CONTEXT_ERR'
|
|
14
14
|
| 'AI_ORG_ACL_FAILED'
|
|
15
|
+
| 'SETUP_INCOMPLETE_ORG'
|
|
15
16
|
| 'MISSING_API_KEY'
|
|
16
17
|
| 'LLM_PROVIDER_NOT_FOUND'
|
|
18
|
+
| 'LLM_SERVICE_ERR'
|
|
17
19
|
| 'MODERATION_MISSING'
|
|
18
20
|
| 'MODERATION_SERVICE_ERR'
|
|
19
21
|
| 'UNKNOWN_LLM_ERR'
|
|
22
|
+
| 'TWILIO_API_ERR'
|
|
20
23
|
| 'UNFINISHED_LOGIC';
|
|
21
24
|
|
|
22
25
|
// AI chat
|
package/types/app.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { COLORS } from '../constants/app';
|
|
1
2
|
|
|
2
3
|
// Modal; App settings
|
|
3
4
|
|
|
@@ -24,7 +25,7 @@ export interface EditUserPlusModalProps extends EditIfaceModalProps {
|
|
|
24
25
|
|
|
25
26
|
export type DarkOrLightEnum = 'light' | 'dark';
|
|
26
27
|
|
|
27
|
-
export type ColorEnum =
|
|
28
|
+
export type ColorEnum = typeof COLORS[number];
|
|
28
29
|
|
|
29
30
|
// Stripe types
|
|
30
31
|
|