@etsoo/appscript 1.2.62 → 1.2.65

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.
@@ -160,6 +160,12 @@ test('Tests for getUnitLabel', () => {
160
160
  expect(app.getUnitLabel(12, true)).toBe('每年');
161
161
  });
162
162
 
163
+ test('Tests for isValidPassword', () => {
164
+ expect(app.isValidPassword('12345678')).toBeFalsy();
165
+ expect(app.isValidPassword('abcd3')).toBeFalsy();
166
+ expect(app.isValidPassword('1234abcd')).toBeTruthy();
167
+ });
168
+
163
169
  test('Tests for getRepeatOptions', () => {
164
170
  const options = BusinessUtils.getRepeatOptions(app.labelDelegate, [
165
171
  'MONTH',
@@ -303,6 +303,11 @@ export interface ICoreApp<S extends IAppSettings, N, C extends NotificationCallP
303
303
  * @returns Result
304
304
  */
305
305
  initCall(callback?: (result: boolean) => void, resetKeys?: boolean): Promise<void>;
306
+ /**
307
+ * Is valid password, override to implement custom check
308
+ * @param password Input password
309
+ */
310
+ isValidPassword(password: string): boolean;
306
311
  /**
307
312
  * Callback where exit a page
308
313
  */
@@ -496,6 +501,11 @@ export declare abstract class CoreApp<S extends IAppSettings, N, C extends Notif
496
501
  * Restore settings from persisted source
497
502
  */
498
503
  protected restore(): boolean;
504
+ /**
505
+ * Is valid password, override to implement custom check
506
+ * @param password Input password
507
+ */
508
+ isValidPassword(password: string): boolean;
499
509
  /**
500
510
  * Persist settings to source when application exit
501
511
  */
@@ -195,6 +195,20 @@ class CoreApp {
195
195
  }
196
196
  return false;
197
197
  }
198
+ /**
199
+ * Is valid password, override to implement custom check
200
+ * @param password Input password
201
+ */
202
+ isValidPassword(password) {
203
+ // Length check
204
+ if (password.length < 6)
205
+ return false;
206
+ // One letter and number required
207
+ if (/\d+/gi.test(password) && /[a-z]+/gi.test(password)) {
208
+ return true;
209
+ }
210
+ return false;
211
+ }
198
212
  /**
199
213
  * Persist settings to source when application exit
200
214
  */
@@ -8,6 +8,7 @@
8
8
  "approve": "Approve it",
9
9
  "back": "Back",
10
10
  "cancel": "Cancel",
11
+ "changePassword": "Change password",
11
12
  "clear": "Clear",
12
13
  "close": "Close",
13
14
  "confirm": "Confirm",
@@ -15,6 +16,8 @@
15
16
  "completeTip": "{0} completed",
16
17
  "copy": "Copy",
17
18
  "creation": "Creation",
19
+ "currentPassword": "Current password",
20
+ "currentPasswordRequired": "Please enter your current password",
18
21
  "currency": "Currency",
19
22
  "currencyAUD": "Australia Dollar $",
20
23
  "currencyCAD": "Canada Dollar $",
@@ -69,6 +72,9 @@
69
72
  "more": "More",
70
73
  "moreTag": "{0} more",
71
74
  "name": "Name",
75
+ "newPassword": "New password",
76
+ "newPasswordRequired": "Please enter your new password",
77
+ "newPasswordTip": "New password should be different",
72
78
  "newValue": "New value",
73
79
  "no": "No",
74
80
  "noChanges": "No changes yet",
@@ -81,6 +87,9 @@
81
87
  "openMenu": "Open menu",
82
88
  "operationSucceeded": "Operation succeeded",
83
89
  "pageNotFound": "Page Not Found",
90
+ "passwordChangeSuccess": "Password changed successfully, please sign in again",
91
+ "passwordRepeatError": "The two passwords entered are inconsistent",
92
+ "passwordTip": "The password cannot be less than 6 characters and contains at least one letter and number",
84
93
  "prompt": "Input",
85
94
  "pullToRefresh": "Pull down to refresh",
86
95
  "quarters": ["Q1", "Q2", "Q3", "Q4"],
@@ -91,6 +100,8 @@
91
100
  "reloginTip": "Please enter your password, resubmit the data after successful login",
92
101
  "remove": "Remove",
93
102
  "renew": "Renew",
103
+ "repeatPassword": "Repeat the password",
104
+ "repeatPasswordRequired": "Please repeat the new password",
94
105
  "reports": "Reports",
95
106
  "requiredField": "{0} is a required field",
96
107
  "resending": "Resending",
@@ -148,6 +159,7 @@
148
159
  "updateReady": "Update ready",
149
160
  "updateTip": "Restart the application to use the latest features",
150
161
  "user": "User",
162
+ "users": "Users",
151
163
  "view": "View",
152
164
  "warning": "Warning",
153
165
  "welcome": "{0}, welcome!"
@@ -2,12 +2,13 @@
2
2
  "accountant": "会计",
3
3
  "actions": "操作",
4
4
  "add": "添加",
5
- "audits": "稽核历史",
5
+ "audits": "操作历史",
6
6
  "authorizer": "授权人",
7
7
  "applicant": "申请人",
8
8
  "approve": "批准",
9
9
  "back": "后退",
10
10
  "cancel": "取消",
11
+ "changePassword": "修改密码",
11
12
  "clear": "清除",
12
13
  "close": "关闭",
13
14
  "confirm": "确认",
@@ -15,6 +16,8 @@
15
16
  "completeTip": "已完成 {0}",
16
17
  "copy": "复制",
17
18
  "creation": "登记时间",
19
+ "currentPassword": "当前密码",
20
+ "currentPasswordRequired": "请输入现在使用的密码",
18
21
  "currency": "币种",
19
22
  "currencyAUD": "澳元$",
20
23
  "currencyCAD": "加元$",
@@ -69,6 +72,9 @@
69
72
  "more": "更多",
70
73
  "moreTag": "({0}+)",
71
74
  "name": "姓名",
75
+ "newPassword": "新密码",
76
+ "newPasswordRequired": "请输入新密码",
77
+ "newPasswordTip": "请设置一个和现在的密码不一样的新密码",
72
78
  "newValue": "新值",
73
79
  "no": "否",
74
80
  "noChanges": "还没有任何修改",
@@ -81,6 +87,9 @@
81
87
  "openMenu": "打开菜单",
82
88
  "operationSucceeded": "操作成功",
83
89
  "pageNotFound": "找不到页面",
90
+ "passwordChangeSuccess": "密码修改成功,请重新登录",
91
+ "passwordRepeatError": "两次输入的密码不一致",
92
+ "passwordTip": "密码不能少于6个字符,且至少包含一个字母和数字",
84
93
  "prompt": "输入",
85
94
  "pullToRefresh": "下拉刷新",
86
95
  "quarters": ["一季度", "二季度", "三季度", "四季度"],
@@ -91,6 +100,8 @@
91
100
  "reloginTip": "请输入您的登录密码,登录成功后请重新提交数据",
92
101
  "remove": "移除",
93
102
  "renew": "续费",
103
+ "repeatPassword": "重复密码",
104
+ "repeatPasswordRequired": "请重复输入新密码",
94
105
  "reports": "统计报表",
95
106
  "requiredField": "'{0}'不能为空",
96
107
  "resending": "重新发送",
@@ -149,6 +160,7 @@
149
160
  "updateReady": "更新就绪",
150
161
  "updateTip": "重新启动应用程序以使用最新功能",
151
162
  "user": "用户",
163
+ "users": "用户",
152
164
  "view": "查看",
153
165
  "warning": "警告",
154
166
  "welcome": "{0}, 欢迎光临!"
@@ -2,12 +2,13 @@
2
2
  "accountant": "會計",
3
3
  "actions": "操作",
4
4
  "add": "添加",
5
- "audits": "稽核歷史",
5
+ "audits": "操作歷史",
6
6
  "authorizer": "授權人",
7
7
  "applicant": "申請人",
8
8
  "approve": "批准",
9
9
  "back": "後退",
10
10
  "cancel": "取消",
11
+ "changePassword": "修改密碼",
11
12
  "clear": "清除",
12
13
  "close": "關閉",
13
14
  "confirm": "確認",
@@ -15,6 +16,8 @@
15
16
  "completeTip": "已完成 {0}",
16
17
  "copy": "複製",
17
18
  "creation": "登記時間",
19
+ "currentPassword": "當前密碼",
20
+ "currentPasswordRequired": "請輸入現在使用的密碼",
18
21
  "currency": "幣種",
19
22
  "currencyAUD": "澳元$",
20
23
  "currencyCAD": "加元$",
@@ -69,6 +72,9 @@
69
72
  "more": "更多",
70
73
  "moreTag": "({0}+)",
71
74
  "name": "姓名",
75
+ "newPassword": "新密碼",
76
+ "newPasswordRequired": "請輸入新密碼",
77
+ "newPasswordTip": "請設置一個和現在的密碼不一樣的新密碼",
72
78
  "newValue": "舊值",
73
79
  "no": "否",
74
80
  "noChanges": "還沒有任何修改",
@@ -81,6 +87,9 @@
81
87
  "openMenu": "打開菜單",
82
88
  "operationSucceeded": "操作成功",
83
89
  "pageNotFound": "找不到頁面",
90
+ "passwordChangeSuccess": "密碼修改成功,請重新登錄",
91
+ "passwordRepeatError": "兩次輸入的密碼不一致",
92
+ "passwordTip": "密碼不能少於6個字符,且至少包含一個字母和數字",
84
93
  "prompt": "輸入",
85
94
  "pullToRefresh": "下拉刷新",
86
95
  "quarters": ["一季度", "二季度", "三季度", "四季度"],
@@ -93,6 +102,8 @@
93
102
  "renew": "續費",
94
103
  "reports": "統計報表",
95
104
  "requiredField": "'{0}'不能為空",
105
+ "repeatPassword": "重複密碼",
106
+ "repeatPasswordRequired": "請重複輸入新密碼",
96
107
  "resending": "重新發送",
97
108
  "reset": "重置",
98
109
  "rotateLeft": "左旋轉90°",
@@ -148,6 +159,7 @@
148
159
  "updateReady": "更新就緒",
149
160
  "updateTip": "重新啟動應用程序以使用最新功能",
150
161
  "user": "用戶",
162
+ "users": "用戶",
151
163
  "view": "查看",
152
164
  "warning": "警告",
153
165
  "welcome": "{0}, 歡迎光臨!"
@@ -26,6 +26,8 @@ export * from './result/ActionResult';
26
26
  export * from './result/ActionResultError';
27
27
  export * from './result/IActionResult';
28
28
  export * from './result/InitCallResult';
29
+ export * from './rq/LoginIdRQ';
30
+ export * from './rq/LoginRQ';
29
31
  export * from './state/Culture';
30
32
  export * from './state/State';
31
33
  export * from './state/User';
package/lib/cjs/index.js CHANGED
@@ -53,6 +53,9 @@ __exportStar(require("./result/ActionResult"), exports);
53
53
  __exportStar(require("./result/ActionResultError"), exports);
54
54
  __exportStar(require("./result/IActionResult"), exports);
55
55
  __exportStar(require("./result/InitCallResult"), exports);
56
+ // rq
57
+ __exportStar(require("./rq/LoginIdRQ"), exports);
58
+ __exportStar(require("./rq/LoginRQ"), exports);
56
59
  // state
57
60
  __exportStar(require("./state/Culture"), exports);
58
61
  __exportStar(require("./state/State"), exports);
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Login id request data
3
+ */
4
+ export declare type LoginIdRQ = {
5
+ /**
6
+ * Device id
7
+ */
8
+ deviceId: string;
9
+ /**
10
+ * Username, Email or mobile
11
+ */
12
+ id: string;
13
+ /**
14
+ * Country or region
15
+ */
16
+ region: string;
17
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
1
+ import { LoginIdRQ } from './LoginIdRQ';
2
+ /**
3
+ * Login request data
4
+ */
5
+ export declare type LoginRQ = LoginIdRQ & {
6
+ /**
7
+ * Password
8
+ */
9
+ pwd: string;
10
+ /**
11
+ * Organization
12
+ */
13
+ org?: number;
14
+ /**
15
+ * Time zone
16
+ */
17
+ timezone?: string;
18
+ /**
19
+ * Service id or uid
20
+ */
21
+ serviceId?: string;
22
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -303,6 +303,11 @@ export interface ICoreApp<S extends IAppSettings, N, C extends NotificationCallP
303
303
  * @returns Result
304
304
  */
305
305
  initCall(callback?: (result: boolean) => void, resetKeys?: boolean): Promise<void>;
306
+ /**
307
+ * Is valid password, override to implement custom check
308
+ * @param password Input password
309
+ */
310
+ isValidPassword(password: string): boolean;
306
311
  /**
307
312
  * Callback where exit a page
308
313
  */
@@ -496,6 +501,11 @@ export declare abstract class CoreApp<S extends IAppSettings, N, C extends Notif
496
501
  * Restore settings from persisted source
497
502
  */
498
503
  protected restore(): boolean;
504
+ /**
505
+ * Is valid password, override to implement custom check
506
+ * @param password Input password
507
+ */
508
+ isValidPassword(password: string): boolean;
499
509
  /**
500
510
  * Persist settings to source when application exit
501
511
  */
@@ -192,6 +192,20 @@ export class CoreApp {
192
192
  }
193
193
  return false;
194
194
  }
195
+ /**
196
+ * Is valid password, override to implement custom check
197
+ * @param password Input password
198
+ */
199
+ isValidPassword(password) {
200
+ // Length check
201
+ if (password.length < 6)
202
+ return false;
203
+ // One letter and number required
204
+ if (/\d+/gi.test(password) && /[a-z]+/gi.test(password)) {
205
+ return true;
206
+ }
207
+ return false;
208
+ }
195
209
  /**
196
210
  * Persist settings to source when application exit
197
211
  */
@@ -8,6 +8,7 @@
8
8
  "approve": "Approve it",
9
9
  "back": "Back",
10
10
  "cancel": "Cancel",
11
+ "changePassword": "Change password",
11
12
  "clear": "Clear",
12
13
  "close": "Close",
13
14
  "confirm": "Confirm",
@@ -15,6 +16,8 @@
15
16
  "completeTip": "{0} completed",
16
17
  "copy": "Copy",
17
18
  "creation": "Creation",
19
+ "currentPassword": "Current password",
20
+ "currentPasswordRequired": "Please enter your current password",
18
21
  "currency": "Currency",
19
22
  "currencyAUD": "Australia Dollar $",
20
23
  "currencyCAD": "Canada Dollar $",
@@ -69,6 +72,9 @@
69
72
  "more": "More",
70
73
  "moreTag": "{0} more",
71
74
  "name": "Name",
75
+ "newPassword": "New password",
76
+ "newPasswordRequired": "Please enter your new password",
77
+ "newPasswordTip": "New password should be different",
72
78
  "newValue": "New value",
73
79
  "no": "No",
74
80
  "noChanges": "No changes yet",
@@ -81,6 +87,9 @@
81
87
  "openMenu": "Open menu",
82
88
  "operationSucceeded": "Operation succeeded",
83
89
  "pageNotFound": "Page Not Found",
90
+ "passwordChangeSuccess": "Password changed successfully, please sign in again",
91
+ "passwordRepeatError": "The two passwords entered are inconsistent",
92
+ "passwordTip": "The password cannot be less than 6 characters and contains at least one letter and number",
84
93
  "prompt": "Input",
85
94
  "pullToRefresh": "Pull down to refresh",
86
95
  "quarters": ["Q1", "Q2", "Q3", "Q4"],
@@ -91,6 +100,8 @@
91
100
  "reloginTip": "Please enter your password, resubmit the data after successful login",
92
101
  "remove": "Remove",
93
102
  "renew": "Renew",
103
+ "repeatPassword": "Repeat the password",
104
+ "repeatPasswordRequired": "Please repeat the new password",
94
105
  "reports": "Reports",
95
106
  "requiredField": "{0} is a required field",
96
107
  "resending": "Resending",
@@ -148,6 +159,7 @@
148
159
  "updateReady": "Update ready",
149
160
  "updateTip": "Restart the application to use the latest features",
150
161
  "user": "User",
162
+ "users": "Users",
151
163
  "view": "View",
152
164
  "warning": "Warning",
153
165
  "welcome": "{0}, welcome!"
@@ -2,12 +2,13 @@
2
2
  "accountant": "会计",
3
3
  "actions": "操作",
4
4
  "add": "添加",
5
- "audits": "稽核历史",
5
+ "audits": "操作历史",
6
6
  "authorizer": "授权人",
7
7
  "applicant": "申请人",
8
8
  "approve": "批准",
9
9
  "back": "后退",
10
10
  "cancel": "取消",
11
+ "changePassword": "修改密码",
11
12
  "clear": "清除",
12
13
  "close": "关闭",
13
14
  "confirm": "确认",
@@ -15,6 +16,8 @@
15
16
  "completeTip": "已完成 {0}",
16
17
  "copy": "复制",
17
18
  "creation": "登记时间",
19
+ "currentPassword": "当前密码",
20
+ "currentPasswordRequired": "请输入现在使用的密码",
18
21
  "currency": "币种",
19
22
  "currencyAUD": "澳元$",
20
23
  "currencyCAD": "加元$",
@@ -69,6 +72,9 @@
69
72
  "more": "更多",
70
73
  "moreTag": "({0}+)",
71
74
  "name": "姓名",
75
+ "newPassword": "新密码",
76
+ "newPasswordRequired": "请输入新密码",
77
+ "newPasswordTip": "请设置一个和现在的密码不一样的新密码",
72
78
  "newValue": "新值",
73
79
  "no": "否",
74
80
  "noChanges": "还没有任何修改",
@@ -81,6 +87,9 @@
81
87
  "openMenu": "打开菜单",
82
88
  "operationSucceeded": "操作成功",
83
89
  "pageNotFound": "找不到页面",
90
+ "passwordChangeSuccess": "密码修改成功,请重新登录",
91
+ "passwordRepeatError": "两次输入的密码不一致",
92
+ "passwordTip": "密码不能少于6个字符,且至少包含一个字母和数字",
84
93
  "prompt": "输入",
85
94
  "pullToRefresh": "下拉刷新",
86
95
  "quarters": ["一季度", "二季度", "三季度", "四季度"],
@@ -91,6 +100,8 @@
91
100
  "reloginTip": "请输入您的登录密码,登录成功后请重新提交数据",
92
101
  "remove": "移除",
93
102
  "renew": "续费",
103
+ "repeatPassword": "重复密码",
104
+ "repeatPasswordRequired": "请重复输入新密码",
94
105
  "reports": "统计报表",
95
106
  "requiredField": "'{0}'不能为空",
96
107
  "resending": "重新发送",
@@ -149,6 +160,7 @@
149
160
  "updateReady": "更新就绪",
150
161
  "updateTip": "重新启动应用程序以使用最新功能",
151
162
  "user": "用户",
163
+ "users": "用户",
152
164
  "view": "查看",
153
165
  "warning": "警告",
154
166
  "welcome": "{0}, 欢迎光临!"
@@ -2,12 +2,13 @@
2
2
  "accountant": "會計",
3
3
  "actions": "操作",
4
4
  "add": "添加",
5
- "audits": "稽核歷史",
5
+ "audits": "操作歷史",
6
6
  "authorizer": "授權人",
7
7
  "applicant": "申請人",
8
8
  "approve": "批准",
9
9
  "back": "後退",
10
10
  "cancel": "取消",
11
+ "changePassword": "修改密碼",
11
12
  "clear": "清除",
12
13
  "close": "關閉",
13
14
  "confirm": "確認",
@@ -15,6 +16,8 @@
15
16
  "completeTip": "已完成 {0}",
16
17
  "copy": "複製",
17
18
  "creation": "登記時間",
19
+ "currentPassword": "當前密碼",
20
+ "currentPasswordRequired": "請輸入現在使用的密碼",
18
21
  "currency": "幣種",
19
22
  "currencyAUD": "澳元$",
20
23
  "currencyCAD": "加元$",
@@ -69,6 +72,9 @@
69
72
  "more": "更多",
70
73
  "moreTag": "({0}+)",
71
74
  "name": "姓名",
75
+ "newPassword": "新密碼",
76
+ "newPasswordRequired": "請輸入新密碼",
77
+ "newPasswordTip": "請設置一個和現在的密碼不一樣的新密碼",
72
78
  "newValue": "舊值",
73
79
  "no": "否",
74
80
  "noChanges": "還沒有任何修改",
@@ -81,6 +87,9 @@
81
87
  "openMenu": "打開菜單",
82
88
  "operationSucceeded": "操作成功",
83
89
  "pageNotFound": "找不到頁面",
90
+ "passwordChangeSuccess": "密碼修改成功,請重新登錄",
91
+ "passwordRepeatError": "兩次輸入的密碼不一致",
92
+ "passwordTip": "密碼不能少於6個字符,且至少包含一個字母和數字",
84
93
  "prompt": "輸入",
85
94
  "pullToRefresh": "下拉刷新",
86
95
  "quarters": ["一季度", "二季度", "三季度", "四季度"],
@@ -93,6 +102,8 @@
93
102
  "renew": "續費",
94
103
  "reports": "統計報表",
95
104
  "requiredField": "'{0}'不能為空",
105
+ "repeatPassword": "重複密碼",
106
+ "repeatPasswordRequired": "請重複輸入新密碼",
96
107
  "resending": "重新發送",
97
108
  "reset": "重置",
98
109
  "rotateLeft": "左旋轉90°",
@@ -148,6 +159,7 @@
148
159
  "updateReady": "更新就緒",
149
160
  "updateTip": "重新啟動應用程序以使用最新功能",
150
161
  "user": "用戶",
162
+ "users": "用戶",
151
163
  "view": "查看",
152
164
  "warning": "警告",
153
165
  "welcome": "{0}, 歡迎光臨!"
@@ -26,6 +26,8 @@ export * from './result/ActionResult';
26
26
  export * from './result/ActionResultError';
27
27
  export * from './result/IActionResult';
28
28
  export * from './result/InitCallResult';
29
+ export * from './rq/LoginIdRQ';
30
+ export * from './rq/LoginRQ';
29
31
  export * from './state/Culture';
30
32
  export * from './state/State';
31
33
  export * from './state/User';
package/lib/mjs/index.js CHANGED
@@ -34,6 +34,9 @@ export * from './result/ActionResult';
34
34
  export * from './result/ActionResultError';
35
35
  export * from './result/IActionResult';
36
36
  export * from './result/InitCallResult';
37
+ // rq
38
+ export * from './rq/LoginIdRQ';
39
+ export * from './rq/LoginRQ';
37
40
  // state
38
41
  export * from './state/Culture';
39
42
  export * from './state/State';
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Login id request data
3
+ */
4
+ export declare type LoginIdRQ = {
5
+ /**
6
+ * Device id
7
+ */
8
+ deviceId: string;
9
+ /**
10
+ * Username, Email or mobile
11
+ */
12
+ id: string;
13
+ /**
14
+ * Country or region
15
+ */
16
+ region: string;
17
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ import { LoginIdRQ } from './LoginIdRQ';
2
+ /**
3
+ * Login request data
4
+ */
5
+ export declare type LoginRQ = LoginIdRQ & {
6
+ /**
7
+ * Password
8
+ */
9
+ pwd: string;
10
+ /**
11
+ * Organization
12
+ */
13
+ org?: number;
14
+ /**
15
+ * Time zone
16
+ */
17
+ timezone?: string;
18
+ /**
19
+ * Service id or uid
20
+ */
21
+ serviceId?: string;
22
+ };
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.2.62",
3
+ "version": "1.2.65",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -65,8 +65,8 @@
65
65
  "@babel/preset-env": "^7.18.9",
66
66
  "@babel/runtime-corejs3": "^7.18.9",
67
67
  "@types/jest": "^28.1.6",
68
- "@typescript-eslint/eslint-plugin": "^5.30.7",
69
- "@typescript-eslint/parser": "^5.30.7",
68
+ "@typescript-eslint/eslint-plugin": "^5.31.0",
69
+ "@typescript-eslint/parser": "^5.31.0",
70
70
  "eslint": "^8.20.0",
71
71
  "eslint-config-airbnb-base": "^15.0.0",
72
72
  "eslint-plugin-import": "^2.26.0",
@@ -420,6 +420,12 @@ export interface ICoreApp<
420
420
  resetKeys?: boolean
421
421
  ): Promise<void>;
422
422
 
423
+ /**
424
+ * Is valid password, override to implement custom check
425
+ * @param password Input password
426
+ */
427
+ isValidPassword(password: string): boolean;
428
+
423
429
  /**
424
430
  * Callback where exit a page
425
431
  */
@@ -795,6 +801,22 @@ export abstract class CoreApp<
795
801
  return false;
796
802
  }
797
803
 
804
+ /**
805
+ * Is valid password, override to implement custom check
806
+ * @param password Input password
807
+ */
808
+ isValidPassword(password: string) {
809
+ // Length check
810
+ if (password.length < 6) return false;
811
+
812
+ // One letter and number required
813
+ if (/\d+/gi.test(password) && /[a-z]+/gi.test(password)) {
814
+ return true;
815
+ }
816
+
817
+ return false;
818
+ }
819
+
798
820
  /**
799
821
  * Persist settings to source when application exit
800
822
  */
@@ -8,6 +8,7 @@
8
8
  "approve": "Approve it",
9
9
  "back": "Back",
10
10
  "cancel": "Cancel",
11
+ "changePassword": "Change password",
11
12
  "clear": "Clear",
12
13
  "close": "Close",
13
14
  "confirm": "Confirm",
@@ -15,6 +16,8 @@
15
16
  "completeTip": "{0} completed",
16
17
  "copy": "Copy",
17
18
  "creation": "Creation",
19
+ "currentPassword": "Current password",
20
+ "currentPasswordRequired": "Please enter your current password",
18
21
  "currency": "Currency",
19
22
  "currencyAUD": "Australia Dollar $",
20
23
  "currencyCAD": "Canada Dollar $",
@@ -69,6 +72,9 @@
69
72
  "more": "More",
70
73
  "moreTag": "{0} more",
71
74
  "name": "Name",
75
+ "newPassword": "New password",
76
+ "newPasswordRequired": "Please enter your new password",
77
+ "newPasswordTip": "New password should be different",
72
78
  "newValue": "New value",
73
79
  "no": "No",
74
80
  "noChanges": "No changes yet",
@@ -81,6 +87,9 @@
81
87
  "openMenu": "Open menu",
82
88
  "operationSucceeded": "Operation succeeded",
83
89
  "pageNotFound": "Page Not Found",
90
+ "passwordChangeSuccess": "Password changed successfully, please sign in again",
91
+ "passwordRepeatError": "The two passwords entered are inconsistent",
92
+ "passwordTip": "The password cannot be less than 6 characters and contains at least one letter and number",
84
93
  "prompt": "Input",
85
94
  "pullToRefresh": "Pull down to refresh",
86
95
  "quarters": ["Q1", "Q2", "Q3", "Q4"],
@@ -91,6 +100,8 @@
91
100
  "reloginTip": "Please enter your password, resubmit the data after successful login",
92
101
  "remove": "Remove",
93
102
  "renew": "Renew",
103
+ "repeatPassword": "Repeat the password",
104
+ "repeatPasswordRequired": "Please repeat the new password",
94
105
  "reports": "Reports",
95
106
  "requiredField": "{0} is a required field",
96
107
  "resending": "Resending",
@@ -148,6 +159,7 @@
148
159
  "updateReady": "Update ready",
149
160
  "updateTip": "Restart the application to use the latest features",
150
161
  "user": "User",
162
+ "users": "Users",
151
163
  "view": "View",
152
164
  "warning": "Warning",
153
165
  "welcome": "{0}, welcome!"
@@ -2,12 +2,13 @@
2
2
  "accountant": "会计",
3
3
  "actions": "操作",
4
4
  "add": "添加",
5
- "audits": "稽核历史",
5
+ "audits": "操作历史",
6
6
  "authorizer": "授权人",
7
7
  "applicant": "申请人",
8
8
  "approve": "批准",
9
9
  "back": "后退",
10
10
  "cancel": "取消",
11
+ "changePassword": "修改密码",
11
12
  "clear": "清除",
12
13
  "close": "关闭",
13
14
  "confirm": "确认",
@@ -15,6 +16,8 @@
15
16
  "completeTip": "已完成 {0}",
16
17
  "copy": "复制",
17
18
  "creation": "登记时间",
19
+ "currentPassword": "当前密码",
20
+ "currentPasswordRequired": "请输入现在使用的密码",
18
21
  "currency": "币种",
19
22
  "currencyAUD": "澳元$",
20
23
  "currencyCAD": "加元$",
@@ -69,6 +72,9 @@
69
72
  "more": "更多",
70
73
  "moreTag": "({0}+)",
71
74
  "name": "姓名",
75
+ "newPassword": "新密码",
76
+ "newPasswordRequired": "请输入新密码",
77
+ "newPasswordTip": "请设置一个和现在的密码不一样的新密码",
72
78
  "newValue": "新值",
73
79
  "no": "否",
74
80
  "noChanges": "还没有任何修改",
@@ -81,6 +87,9 @@
81
87
  "openMenu": "打开菜单",
82
88
  "operationSucceeded": "操作成功",
83
89
  "pageNotFound": "找不到页面",
90
+ "passwordChangeSuccess": "密码修改成功,请重新登录",
91
+ "passwordRepeatError": "两次输入的密码不一致",
92
+ "passwordTip": "密码不能少于6个字符,且至少包含一个字母和数字",
84
93
  "prompt": "输入",
85
94
  "pullToRefresh": "下拉刷新",
86
95
  "quarters": ["一季度", "二季度", "三季度", "四季度"],
@@ -91,6 +100,8 @@
91
100
  "reloginTip": "请输入您的登录密码,登录成功后请重新提交数据",
92
101
  "remove": "移除",
93
102
  "renew": "续费",
103
+ "repeatPassword": "重复密码",
104
+ "repeatPasswordRequired": "请重复输入新密码",
94
105
  "reports": "统计报表",
95
106
  "requiredField": "'{0}'不能为空",
96
107
  "resending": "重新发送",
@@ -149,6 +160,7 @@
149
160
  "updateReady": "更新就绪",
150
161
  "updateTip": "重新启动应用程序以使用最新功能",
151
162
  "user": "用户",
163
+ "users": "用户",
152
164
  "view": "查看",
153
165
  "warning": "警告",
154
166
  "welcome": "{0}, 欢迎光临!"
@@ -2,12 +2,13 @@
2
2
  "accountant": "會計",
3
3
  "actions": "操作",
4
4
  "add": "添加",
5
- "audits": "稽核歷史",
5
+ "audits": "操作歷史",
6
6
  "authorizer": "授權人",
7
7
  "applicant": "申請人",
8
8
  "approve": "批准",
9
9
  "back": "後退",
10
10
  "cancel": "取消",
11
+ "changePassword": "修改密碼",
11
12
  "clear": "清除",
12
13
  "close": "關閉",
13
14
  "confirm": "確認",
@@ -15,6 +16,8 @@
15
16
  "completeTip": "已完成 {0}",
16
17
  "copy": "複製",
17
18
  "creation": "登記時間",
19
+ "currentPassword": "當前密碼",
20
+ "currentPasswordRequired": "請輸入現在使用的密碼",
18
21
  "currency": "幣種",
19
22
  "currencyAUD": "澳元$",
20
23
  "currencyCAD": "加元$",
@@ -69,6 +72,9 @@
69
72
  "more": "更多",
70
73
  "moreTag": "({0}+)",
71
74
  "name": "姓名",
75
+ "newPassword": "新密碼",
76
+ "newPasswordRequired": "請輸入新密碼",
77
+ "newPasswordTip": "請設置一個和現在的密碼不一樣的新密碼",
72
78
  "newValue": "舊值",
73
79
  "no": "否",
74
80
  "noChanges": "還沒有任何修改",
@@ -81,6 +87,9 @@
81
87
  "openMenu": "打開菜單",
82
88
  "operationSucceeded": "操作成功",
83
89
  "pageNotFound": "找不到頁面",
90
+ "passwordChangeSuccess": "密碼修改成功,請重新登錄",
91
+ "passwordRepeatError": "兩次輸入的密碼不一致",
92
+ "passwordTip": "密碼不能少於6個字符,且至少包含一個字母和數字",
84
93
  "prompt": "輸入",
85
94
  "pullToRefresh": "下拉刷新",
86
95
  "quarters": ["一季度", "二季度", "三季度", "四季度"],
@@ -93,6 +102,8 @@
93
102
  "renew": "續費",
94
103
  "reports": "統計報表",
95
104
  "requiredField": "'{0}'不能為空",
105
+ "repeatPassword": "重複密碼",
106
+ "repeatPasswordRequired": "請重複輸入新密碼",
96
107
  "resending": "重新發送",
97
108
  "reset": "重置",
98
109
  "rotateLeft": "左旋轉90°",
@@ -148,6 +159,7 @@
148
159
  "updateReady": "更新就緒",
149
160
  "updateTip": "重新啟動應用程序以使用最新功能",
150
161
  "user": "用戶",
162
+ "users": "用戶",
151
163
  "view": "查看",
152
164
  "warning": "警告",
153
165
  "welcome": "{0}, 歡迎光臨!"
package/src/index.ts CHANGED
@@ -44,6 +44,10 @@ export * from './result/ActionResultError';
44
44
  export * from './result/IActionResult';
45
45
  export * from './result/InitCallResult';
46
46
 
47
+ // rq
48
+ export * from './rq/LoginIdRQ';
49
+ export * from './rq/LoginRQ';
50
+
47
51
  // state
48
52
  export * from './state/Culture';
49
53
  export * from './state/State';
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Login id request data
3
+ */
4
+ export type LoginIdRQ = {
5
+ /**
6
+ * Device id
7
+ */
8
+ deviceId: string;
9
+
10
+ /**
11
+ * Username, Email or mobile
12
+ */
13
+ id: string;
14
+
15
+ /**
16
+ * Country or region
17
+ */
18
+ region: string;
19
+ };
@@ -0,0 +1,26 @@
1
+ import { LoginIdRQ } from './LoginIdRQ';
2
+
3
+ /**
4
+ * Login request data
5
+ */
6
+ export type LoginRQ = LoginIdRQ & {
7
+ /**
8
+ * Password
9
+ */
10
+ pwd: string;
11
+
12
+ /**
13
+ * Organization
14
+ */
15
+ org?: number;
16
+
17
+ /**
18
+ * Time zone
19
+ */
20
+ timezone?: string;
21
+
22
+ /**
23
+ * Service id or uid
24
+ */
25
+ serviceId?: string;
26
+ };