@jsb188/app 1.1.4 → 1.1.6

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/i18n/datetime.ts CHANGED
@@ -1,21 +1,60 @@
1
1
  export default {
2
- en: {
3
- // Ago
4
- just_now: 'just now',
5
- in_minutes_ct: 'in %{smart_count} minute||||in %{smart_count} minutes',
6
- in_hours_ct: 'in %{smart_count} hour||||in %{smart_count} hours',
7
- minutes_ago_ct: '%{smart_count} minute ago||||%{smart_count} minutes ago',
8
- hours_ago_ct: '%{smart_count} hour ago||||%{smart_count} hours ago',
2
+ en: {
3
+ // General
4
+ year_: 'Year: %{year}',
9
5
 
10
- // Time period
11
- period_TOMORROW: 'Tomorrow',
12
- period_TODAY: 'Today',
13
- period_YESTERDAY: 'Yesterday',
14
- period_THIS_WEEK: 'This week',
15
- period_THIS_MONTH: 'This month',
16
- period_LAST_WEEK: 'Last week',
17
- period_LAST_MONTH: 'Last month',
18
- period_OLDER: 'History',
19
- period_UPCOMING: 'Upcoming',
20
- }
6
+ // Times count
7
+ weeks_ct: '%{smart_count} week||||%{smart_count} weeks',
8
+ days_ct: '%{smart_count} day||||%{smart_count} days',
9
+ hours_ct: '%{smart_count} hour||||%{smart_count} hours',
10
+ minutes_ct: '%{smart_count} minute||||%{smart_count} minutes',
11
+ seconds_ct: '%{smart_count} second||||%{smart_count} seconds',
12
+
13
+ // Ago
14
+ just_now: 'just now',
15
+ in_minutes_ct: 'in %{smart_count} minute||||in %{smart_count} minutes',
16
+ in_hours_ct: 'in %{smart_count} hour||||in %{smart_count} hours',
17
+ minutes_ago_ct: '%{smart_count} minute ago||||%{smart_count} minutes ago',
18
+ hours_ago_ct: '%{smart_count} hour ago||||%{smart_count} hours ago',
19
+ weeks_ago_ct: '%{smart_count} week ago||||%{smart_count} weeks ago',
20
+ months_ago_ct: '%{smart_count} month ago||||%{smart_count} months ago',
21
+
22
+ // Time period
23
+ period_TOMORROW: 'Tomorrow',
24
+ period_TODAY: 'Today',
25
+ period_YESTERDAY: 'Yesterday',
26
+ period_THIS_WEEK: 'This week',
27
+ period_THIS_MONTH: 'This month',
28
+ period_LAST_WEEK: 'Last week',
29
+ period_LAST_MONTH: 'Last month',
30
+ period_OLDER: 'History',
31
+ period_UPCOMING: 'Upcoming',
32
+
33
+ // Schedule
34
+ schedule: {
35
+ ONCE_fixed: 'Once on %{date}',
36
+ DAILY_fixed: 'Recurring every %{value} day', // Unused atm
37
+ WEEKLY_fixed: 'Recurring every %{value} week',
38
+ MONTHLY_fixed: 'Recurring every %{value} month', // Unused atm
39
+ YEARLY_fixed: 'Recurring every %{value} year', // Unused atm
40
+
41
+ ONCE: 'Once on %{date}',
42
+ DAILY: 'Recurring every day', // Unused atm
43
+ WEEKLY: 'Recurring every week',
44
+ MONTHLY: 'Recurring every month', // Unused atm
45
+ YEARLY: 'Recurring every year', // Unused atm
46
+
47
+ _on_: ' on %{daysOfWeek}'
48
+ },
49
+
50
+ daysOfWeek: {
51
+ 0: 'Sunday',
52
+ 1: 'Monday',
53
+ 2: 'Tuesday',
54
+ 3: 'Wednesday',
55
+ 4: 'Thursday',
56
+ 5: 'Friday',
57
+ 6: 'Saturday',
58
+ }
59
+ },
21
60
  };
package/i18n/error.ts CHANGED
@@ -4,16 +4,17 @@ 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. Please try again in a moment.',
8
- network_or_outage_error: 'Failed to connect to server. If your internect connection is stable, our servers may be experiencing an outage.',
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.',
9
9
  app_error_title: 'App crashed',
10
10
  app_error: 'Uh-oh, please refresh the page and tell someone.',
11
11
  not_allowed: 'Not allowed',
12
12
  not_allowed_perms: 'You do not have permission to do that.',
13
13
  login_changed: 'Login changed',
14
14
  link_expired: 'Link expired',
15
- link_expired_msg: 'This link expired. Please try again by requesting another link.',
16
- invalid_link_msg: 'This link is invalid. Please try again by requesting another link.',
15
+ invalid_link: 'Invalid link',
16
+ link_expired_msg: 'This link expired. Please try again by\n requesting another link.',
17
+ invalid_link_msg: 'This link is invalid. Please try again by\n requesting another link.',
17
18
 
18
19
  // 1x
19
20
  '10000_title': 'App updated!',
@@ -30,6 +31,7 @@ export default {
30
31
  10010: 'Your Apple login token was invalid.',
31
32
  10011: 'Apple API failed to respond.',
32
33
  10012: 'This browser tab will reload because you changed your login.',
34
+ 10013: 'Our e-mail service is experiencing an outage. Please try again in a moment.',
33
35
 
34
36
  // 2x
35
37
 
@@ -40,28 +42,29 @@ export default {
40
42
  20003: 'Please use "Continue with Google" to log in. (%{value})',
41
43
  '20004_title': 'Continue with Apple',
42
44
  20004: 'Please use "Continue with Apple" to log in. (%{value})',
43
- 20005: 'Could not find user with that username (@%{value})',
44
- 20006: 'Could not find user with that e-mail. (%{value})',
45
- 20007: 'Could not find user with that ID. (%{value})',
46
- 20008: 'Your password is incorrect. You have %{value} try(s) remaining.',
45
+ 20005: 'Could not find the account with that username (@%{value})',
46
+ 20006: 'Could not find the account with that e-mail. (%{value})',
47
+ 20007: 'Could not find the account with that ID. (%{value})',
48
+ 20008: 'Your password is incorrect. You have %{value} try remaining.||||Your password is incorrect. You have %{value} tries remaining.',
47
49
  20009: 'Please wait 10 minutes before trying to log in again.',
48
- 20010: 'Could not find user.',
50
+ 20010: 'This account could not be found.',
49
51
  20011: 'Your token expired, please request a new link.',
50
52
  20012: 'Your token is invalid, please request a new link.',
51
- 20013: 'User already exists with that e-mail address. (%{value})',
52
- 20014: 'User already exists with that username. (%{value})',
53
+ 20013: 'Account already exists with that e-mail address. (%{value})',
54
+ 20014: 'Account already exists with that username. (%{value})',
53
55
  20015: "We couldn't find that user in our database.",
54
56
  20016: 'You are being rate limited. Please try again in a moment.',
55
57
  20017: 'Please check your-email before requesting another verification link or wait few more seconds.',
56
58
  20018: "Your e-mail is already verified. There's no need to verify your e-mail again.",
57
- 20019: 'You are not logged in. Please log in and try again.',
59
+ '20019_title': 'Login expired',
60
+ 20019: 'Your login token expired. Please log in again.',
58
61
  20020: 'You do not have access to this chat.',
59
62
  '20021_title': 'Slow down!',
60
63
  20021: 'You are sending messages too fast.',
61
64
  20022: 'You are not allowed to chat here.',
62
65
  20023: 'You must be friends to send direct messages.',
63
66
  20024: "You've been temporarily timed out.",
64
- 20025: 'Your account (associated with %{value}) has been banned. If this is an error, please send us an e-mail.',
67
+ 20025: 'Account associated with "%{value}" has been banned. If this is an error, please send us an e-mail.',
65
68
  20026: 'You were blocked by this user.',
66
69
  20027: 'Your IP has been banned. If this is an error, please send us an e-mail.',
67
70
  20028: 'Please disable your VPN and try again.',
@@ -87,10 +90,19 @@ export default {
87
90
  20048: 'This action is forbidden because you deleted your account.',
88
91
  20049: 'You haven\'t verified your account yet.',
89
92
  20050: 'This page does not exist.',
90
- 20051: 'Could not find user with that phone number. (%{value})',
93
+ 20051: 'We couldn\'t find an account associated with that phone number. (%{value})',
91
94
  20052: 'You do not have access to this organization\'s data.',
92
95
  20053: 'You haven\'t verified your account yet.',
93
96
  20054: 'You need an invitation to create an account.',
97
+ 20055: 'You are sending too many verification codes. Please slow down.',
98
+ 20056: 'Account associated with "%{value}" has been banned. If this is an error, please send us an e-mail.',
99
+ 20057: 'Your verification code expired. Please request a new code.',
100
+ 20058: 'You do not have permissions to edit this log. Please contact your administrator.',
101
+ 20059: 'This log was not found.\nIt may have been deleted.',
102
+ 20060: 'You do not have permissions to delete this log. Please contact your administrator.',
103
+ 20061: 'You do not have permissions to perform this action. Please contact your administrator.',
104
+ 20062: '"%{value}" is not a valid e-mail address.',
105
+ 20063: 'You cannot change your e-mail to the same e-mail address.',
94
106
 
95
107
  '29999_title': 'Not ready',
96
108
  29999: 'AI chat is not ready right now.',
@@ -98,14 +110,15 @@ export default {
98
110
  // 3x
99
111
 
100
112
  30000: 'An unknown error occured.',
101
- 30003: "We're having trouble accessing the server. Please try again in a moment.",
113
+ 30002: 'We made an error in our code. We will fix this soon.',
114
+ 30003: "We're having trouble accessing the server.",
102
115
  30004: 'We made a mistake in our code. We will fix this soon.',
103
- 30010: 'Google is not responding right now. Please try again in a momment.',
104
- 30011: 'Something went wrong with your Google authentication attempt. Please try again in a moment.',
116
+ 30010: 'Google servers are not responding right now.',
117
+ 30011: 'Something went wrong with your Google authentication attempt.',
105
118
  30013: 'Our database is in maintenance. Please try again in a moment.',
106
119
  30014: 'Stripe CardElement is incorrect.',
107
120
  30015: 'Invalid payment form values.',
108
- 30016: 'Stripe API request failed with an unknown reason. Please try again in a moment.',
121
+ 30016: 'Stripe API request failed with an unknown reason.',
109
122
  30017: 'Your bank declined your payment method. Please try again with a different card.',
110
123
  30018: 'Your card was declined too many times by Stripe. Please try again later.',
111
124
  30019: 'Your card has expired. Please try again with a different card.',
@@ -132,6 +145,7 @@ export default {
132
145
  msg_password_special: 'Your password must contain at least one special character.',
133
146
  msg_password_insecure: 'Your password is not secure enough.',
134
147
  msg_password_mismatch: 'Your password confirmation did not match.',
148
+ msg_phone_invalid: '"%{value}" is not a valid phone number.',
135
149
  msg_note_too_long: 'Your room note is too long. It must be less than %{length} characters.',
136
150
 
137
151
  // File errors
package/i18n/form.ts CHANGED
@@ -2,24 +2,76 @@ export default {
2
2
  en: {
3
3
  yes: 'Yes',
4
4
  no: 'No',
5
- no_nm: 'No, nevermind',
5
+ no_nevermind: 'No, nevermind',
6
6
  ok: 'OK',
7
7
  or: 'or',
8
+ n_a: 'N/A',
9
+ unknown: 'Unknown',
10
+ void: 'Void', // Use uppercase if needed
11
+ location: 'Location',
12
+ warning: 'Warning',
8
13
  cancel: 'Cancel',
9
14
  continue: 'Continue',
15
+ continue_editing: 'Continue editing',
16
+ class: 'Class',
17
+ classification: 'Classification',
18
+ overview: 'Overview',
19
+ latest: 'Latest',
20
+ latest_activity: 'Latest Activity',
21
+ dob: 'DOB',
22
+ date_of_birth: 'Date of birth',
23
+ deceased: 'Deceased',
24
+ confirmation: 'Confirmation',
25
+ primary: 'Primary',
26
+ id: 'ID',
27
+ for: 'For',
28
+ sort_by: 'Sort by',
29
+ sort_list: 'Sort list',
10
30
  apply: 'Apply',
11
31
  apply_filters: 'Apply filters',
32
+ content_missing: 'Content missing',
33
+ content_not_found_msg: 'The content you are looking for could not be found.',
34
+ reports: 'Reports',
35
+ section: 'Section',
36
+ title: 'Title',
12
37
  hide: 'Hide',
13
38
  show: 'Show',
39
+ deleted: 'Deleted',
40
+ delete: 'Delete',
41
+ balance: 'Balance',
42
+ number: 'Number',
43
+ livestock: 'Livestock',
44
+ frequency: 'Frequency',
45
+ expiration: 'Expiration',
46
+ expiration_date: 'Expiration date',
47
+ document: 'Document',
48
+ documents: 'Documents',
49
+ document_type: 'Document type',
50
+ untitled_document: 'Untitled document',
14
51
  try_again: 'Try again',
15
52
  refresh_page: 'Refresh page',
53
+ authenticate: 'Authenticate',
54
+ please_verify: 'Please verify',
55
+ check_email: 'Check your e-mail',
56
+ request_will_complete_once_verified_msg: 'Your request will be completed once the verification is complete.',
57
+ your_request_is_completed_msg: 'Your request is completed.',
58
+ page_of: 'Page %{number} of %{total}',
59
+ subtotal: 'Subtotal',
60
+ total: 'Total',
61
+ receipts: 'Receipts',
62
+ market_receipts: 'Market receipts',
16
63
  search: 'Search',
64
+ submitted: 'Submitted',
17
65
  no_results: 'No results',
66
+ change: 'Change',
67
+ loading_: 'Loading...',
18
68
  save: 'Save',
19
69
  saving_: 'Saving...',
20
70
  undo_changes: 'Undo changes',
21
71
  save_changes: 'Save changes',
22
72
  unsaved_changes_msg: 'You have unsaved changes.',
73
+ table_of_contents: 'Table of contents',
74
+ copy_to_clipboard: 'Copy to clipboard',
23
75
  ai: 'AI',
24
76
  you: 'You',
25
77
  copied_: 'Copied!',
@@ -31,15 +83,60 @@ export default {
31
83
  join: 'Join',
32
84
  change_img: 'Change image',
33
85
  upload_img: 'Upload image',
86
+ upload_files: 'Upload files',
34
87
  keep_current_img: 'Keep current image',
35
88
  select_file: 'Select file',
89
+ task_: 'Task – %{text}',
90
+ tasks: 'Tasks',
91
+ latest_update: 'Latest update',
36
92
  name: 'Name',
93
+ item: 'Item',
94
+ items: 'Items',
95
+ tax: 'Tax',
96
+ price: 'Price',
97
+ unit: 'Unit',
98
+ unit_price: 'Unit Price',
99
+ price_ph: '1000.50',
100
+ tax_ph: '78.20',
101
+ purchase_summary: 'Purchase summary',
102
+ amount: 'Amount',
103
+ address: 'Address',
104
+ unknown_address: 'Unknown address',
105
+ line1: 'Line 1',
106
+ line1_ph: '1234 Main St.',
107
+ line2_optional: 'Line 2 (optional)',
108
+ line2_ph: 'Apartment, suite, unit, building, floor, etc.',
109
+ city: 'City',
110
+ city_ph: 'Some City',
111
+ state: 'State',
112
+ state_ph: 'CA',
113
+ country: 'Country',
114
+ country_ph: 'United States, Canada, etc.',
115
+ postalCode: 'Zip code', // USA uses zip code
116
+ postalCode_ph: '12345',
117
+ workflows: 'Workflows',
118
+ information: 'Information',
119
+ instructions: 'Instructions',
120
+ metadata: 'Metadata',
121
+ summary: 'Summary',
122
+ instructions_summary: 'Instructions summary',
123
+ status: 'Status',
124
+ orders: 'Orders',
125
+ 'order_#': 'Order #',
126
+ order_details: 'Order details',
127
+ type: 'Type',
37
128
  pin_to_top: 'Pin to top',
38
129
  create_new: 'Create new',
39
130
  upload: 'Upload',
40
131
  create: 'Create',
41
132
  invite: 'Invite',
42
133
  invited: 'Invited',
134
+ invoice_date: 'Invoice date',
135
+ sales: 'Sales',
136
+ sales_orders: 'Sales & orders',
137
+ actions: 'Actions',
138
+ ai_tasks: 'AI tasks',
139
+ ai_workflows: 'AI workflows',
43
140
  add: 'Add',
44
141
  remove: 'Remove',
45
142
  removed: 'Removed',
@@ -51,15 +148,104 @@ export default {
51
148
  dismiss: 'Dismiss',
52
149
  description: 'Description',
53
150
  no_desc: 'No description.',
151
+ no_additional_notes: 'No additional notes.',
54
152
  use_default: 'Use default',
55
153
  use_personal: 'Use personal',
56
154
  learn_more: 'Learn more',
155
+ department: 'Department',
57
156
  email: 'E-mail',
157
+ phone: 'Phone',
158
+ phone_number: 'Phone number',
159
+ partners: 'Partners',
160
+ partner: 'Partner',
161
+ contact_person: 'Contact person',
162
+ farms: 'Farms',
163
+ region: 'Region',
164
+ commodities: 'Commodities',
165
+ fsvp: 'FSVP',
166
+ risk: 'Risk',
167
+ operation: 'Operation',
168
+ grower: 'Grower',
169
+ growers: 'Growers',
170
+ domestic_growers: 'Domestic growers',
171
+ foreign_growers: 'Foreign growers',
172
+ vendors: 'Vendors',
173
+ 'vendors_#': 'Vendors #',
174
+ vendor: 'Vendor',
175
+ vendor_info: 'Vendor information',
176
+ vendor_name: 'Vendor name',
177
+ markets: 'Markets',
178
+ market: 'Market',
179
+ organization: 'Organization',
180
+ coordinator: 'Co-ordinator',
181
+ contact: 'Contact',
182
+ profile: 'Profile',
183
+ compliance: 'Compliance',
184
+ requirement: 'Requirement',
185
+ person_name: 'Person name',
186
+ primary_contact: 'Primary contact',
58
187
  thank_you: 'Thank you',
59
188
  click_here: 'Click here',
60
189
  success: 'Success',
61
190
  success_: 'Success!',
62
191
  help: 'Help',
192
+ advanced: 'Advanced',
193
+ start: 'Start',
194
+ started: 'Started',
195
+ end: 'End',
196
+ time: 'Time',
197
+ start_time: 'Start time',
198
+ end_time: 'End time',
199
+ time_with_zone: 'Time (%{timeZone})',
200
+ time_zone_: 'Time zone: %{timeZone}',
201
+ not_specified: 'Not specified',
202
+ attendance: 'Attendance',
203
+ attended_: 'Attended?',
204
+ ct_attending: '%{count} / %{total} attending',
205
+ ct_attended: '%{count} / %{total} attended',
206
+ day: 'Day',
207
+ all_day: 'All day',
208
+ date: 'Date',
209
+ daily: 'Daily',
210
+ weekly: 'Weekly',
211
+ monthly: 'Monthly',
212
+ schedule: 'Schedule',
213
+ scheduled: 'Scheduled',
214
+ created_by: 'Created by',
215
+ tasked_by: 'Tasked by',
216
+ updated: 'Updated',
217
+ next_due: 'Next due',
218
+ recurring: 'Recurring',
219
+ start_date: 'Start date',
220
+ end_date: 'End date',
221
+ event: 'Event',
222
+ esc: 'ESC',
223
+ settings: 'Settings',
224
+ note: 'Note',
225
+ notes: 'Notes',
226
+ details: 'Details',
227
+ temperature: 'Temperature',
228
+ water: 'Water',
229
+ quantity: 'Quantity',
230
+ quantity_ph: '7.5',
231
+ cropId: 'Crop',
232
+ logged_edited_at: 'Logged %{logDate}. Updated %{editDate}.',
233
+ logged_at: 'Logged %{logDate}.',
234
+ category: 'Category',
235
+ activity: 'Activity',
236
+ activity_ph: 'Type of activity',
237
+ crop: 'Crop',
238
+ crop_ph: 'Select crop',
239
+ concentration: 'Concentration',
240
+ concentration_ph: '0.5',
241
+ concentration_unit: 'Concentration unit',
242
+ concentration_unit_ph: 'mg/L',
243
+ water_quantity: 'Quantity (water)',
244
+ water_unit: 'Unit (water)',
245
+ water_unit_ph: 'gallons, litres',
246
+
247
+ // File Browser Plus module
248
+ fbp_upload_instructions: 'Click here to upload files, or drag and drop\n your files anywhere on the screen.',
63
249
 
64
250
  // Day periods
65
251
  greet_MORNING: 'Good morning, %{name}.',
@@ -71,7 +257,10 @@ export default {
71
257
  comm_type_EMAIL: 'E-mail',
72
258
  comm_type_SMS: 'SMS',
73
259
 
74
- // Sidebar
75
- activity: 'Activity',
260
+ // Languages
261
+ lang: {
262
+ en: 'English',
263
+ es: 'Spanish',
264
+ }
76
265
  },
77
266
  };
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 user from './i18n/user';
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
- user: user[locale],
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.4",
3
+ "version": "1.1.6",
4
4
  "description": "Contains all the basic requirements for all @jsb188 apps.",
5
5
  "license": "ISC",
6
6
  "author": "jsb188",
@@ -14,8 +14,9 @@
14
14
  "./constants/app": "./constants/app.ts",
15
15
  "./constants/billing": "./constants/billing.ts",
16
16
  "./constants/emoji": "./constants/emoji.ts",
17
+ "./constants/other": "./constants/other.ts",
17
18
  "./constants/user": "./constants/user.ts",
18
- "./constants/ws": "./constants/ws.ts",
19
+ "./constants/wsActions": "./constants/wsActions.ts",
19
20
  "./utils/api": "./utils/api.ts",
20
21
  "./utils/billing": "./utils/billing.ts",
21
22
  "./utils/datetime": "./utils/datetime.ts",
@@ -24,14 +25,15 @@
24
25
  "./utils/number": "./utils/number.ts",
25
26
  "./utils/object": "./utils/object.ts",
26
27
  "./utils/string": "./utils/string.ts",
28
+ "./utils/timeZone": "./utils/timeZone.ts",
27
29
  "./utils/url_client": "./utils/url_client.ts",
28
30
  "./utils/user": "./utils/user.ts",
31
+ "./types/account.d": "./types/account.d.ts",
29
32
  "./types/ai.d": "./types/ai.d.ts",
30
33
  "./types/app.d": "./types/app.d.ts",
31
34
  "./types/auth.d": "./types/auth.d.ts",
32
35
  "./types/form.d": "./types/form.d.ts",
33
- "./types/organization.d": "./types/organization.d.ts",
34
- "./types/user.d": "./types/user.d.ts"
36
+ "./types/other.d": "./types/other.d.ts"
35
37
  },
36
38
  "dependencies": {
37
39
  "node-polyglot": "^2.6.0",
@@ -0,0 +1,63 @@
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
+ verified: boolean;
11
+ }
12
+
13
+ /**
14
+ * Account
15
+ */
16
+
17
+ export interface AccountObj {
18
+ id: number;
19
+ settings: Record<string, any>;
20
+ profile: Partial<{
21
+ firstName: string;
22
+ lastName: string;
23
+ storageId: number | null;
24
+ // phone: AccountPhoneObj | null; // ?? This is a coding mistake, I think
25
+ }>;
26
+ }
27
+
28
+ export interface AccountData extends AccountObj {
29
+ __table: 'accounts';
30
+ phone: {
31
+ id: number;
32
+ number: string;
33
+ verified: boolean;
34
+ banned: boolean;
35
+ editAt: Date;
36
+ };
37
+ email: {
38
+ id: number;
39
+ address: string;
40
+ verified: boolean;
41
+ banned: boolean;
42
+ editAt: Date;
43
+ };
44
+ createdAt: Date;
45
+ updatedAt: Date;
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
+ notes?: string;
59
+ primary: boolean;
60
+ createdAt: Date;
61
+ updatedAt: Date;
62
+ account: AccountData;
63
+ }
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 = 'red' | 'orange' | 'brown' | 'amber' | 'yellow' | 'lime' | 'green' | 'emerald' | 'teal' | 'cyan' | 'sky' | 'blue' | 'indigo' | 'violet' | 'purple' | 'fuchsia' | 'pink' | 'rose' | 'slate' | 'zinc' | 'stone';
28
+ export type ColorEnum = typeof COLORS[number];
28
29
 
29
30
  // Stripe types
30
31
 
@@ -46,3 +47,27 @@ export interface SimpleErrorType {
46
47
  title?: string;
47
48
  message: string;
48
49
  }
50
+
51
+ // Web Socket events
52
+
53
+ type ResetQueryRuleEnum = 'ALWAYS' | 'IF_FRAGMENT_NOT_FOUND' | 'IF_FRAGMENT_FOUND' | 'NEVER';
54
+
55
+ export interface WSDataUpdateObj {
56
+ id: string;
57
+ route: string[]; // First items in the array have priority (Different org operations may not allow the actions handled by other org operations)
58
+ message?: string | null; // If null, nothing will be visible to the client.
59
+ messageType: 'NORMAL' | 'SUCCESS' | 'ERROR';
60
+ resetQueryKeys?: string[]; // List of query keys including {variablesKey}
61
+ resetQueryRule?: ResetQueryRuleEnum; // Defaults to "IF_FRAGMENT_FOUND"
62
+ reactiveFragmentKeys?: string[]; // Fragment keys that are used to trigger reactivity
63
+ fragments?: null | ({
64
+ name: string;
65
+ dataId: string;
66
+ data: any;
67
+ } | null)[];
68
+ }
69
+
70
+ export interface WSAppContextUpdateObj {
71
+ accountId: string;
72
+ updates: [any, any][];
73
+ }
package/types/auth.d.ts CHANGED
@@ -17,6 +17,8 @@ export interface AccountData {
17
17
 
18
18
  plus: any; // placeholder for later
19
19
 
20
+ settings: AccountSettings;
21
+
20
22
  profile: {
21
23
  id: string;
22
24
  firstName: string;
@@ -40,6 +42,7 @@ export interface AccountData {
40
42
 
41
43
  export interface AccountSettings {
42
44
  theme: string | null;
45
+ language: string;
43
46
  lightMode: LightModeEnum;
44
47
  timeZone: string | null;
45
48
  showSelfAvatar: boolean;
@@ -59,5 +62,7 @@ export interface AuthenticationData {
59
62
  primaryOrganizationId: string | null;
60
63
  activated: boolean;
61
64
  hasPassword: boolean;
62
- version: string;
65
+ webVersion: string;
66
+ mobileVersion: string;
67
+ alertUpdatesOnMount: boolean;
63
68
  }