@etsoo/react 1.3.31 → 1.3.35

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.
@@ -3,6 +3,10 @@ import { IActionResult, IUser } from '@etsoo/appscript';
3
3
  * SmartERP user interface
4
4
  */
5
5
  export interface ISmartERPUser extends IUser {
6
+ /**
7
+ * Service refresh token
8
+ */
9
+ readonly serviceToken?: string;
6
10
  }
7
11
  /**
8
12
  * SmartERP user login result
@@ -142,7 +142,7 @@ export class ReactApp extends CoreApp {
142
142
  await callback();
143
143
  else
144
144
  await this.tryLogin();
145
- }, {
145
+ }, undefined, {
146
146
  okLabel: labels.cancel,
147
147
  primaryButton: { fullWidth: true, autoFocus: false },
148
148
  inputs: progress
@@ -2,6 +2,10 @@
2
2
  * Refresh token request data
3
3
  */
4
4
  export declare type RefreshTokenRQ = {
5
+ /**
6
+ * Service id
7
+ */
8
+ serviceId?: number;
5
9
  /**
6
10
  * Time zone
7
11
  */
@@ -31,7 +31,11 @@ export class ServiceApp extends ReactApp {
31
31
  * @param coreUser Core system user
32
32
  */
33
33
  userLoginEx(user, refreshToken, coreUser) {
34
+ // Service user login
34
35
  super.userLogin(user, refreshToken, false);
36
+ // Core system user
35
37
  this.coreUser = coreUser;
38
+ // Core system API token
39
+ this.api.authorize(this.settings.authScheme, coreUser.token);
36
40
  }
37
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.3.31",
3
+ "version": "1.3.35",
4
4
  "description": "TypeScript ReactJs framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -47,19 +47,19 @@
47
47
  "homepage": "https://github.com/ETSOO/AppReact#readme",
48
48
  "dependencies": {
49
49
  "@emotion/css": "^11.5.0",
50
- "@emotion/react": "^11.6.0",
50
+ "@emotion/react": "^11.7.0",
51
51
  "@emotion/style": "^0.8.0",
52
52
  "@emotion/styled": "^11.6.0",
53
- "@etsoo/appscript": "^1.1.48",
54
- "@etsoo/notificationbase": "^1.0.93",
53
+ "@etsoo/appscript": "^1.1.50",
54
+ "@etsoo/notificationbase": "^1.0.94",
55
55
  "@etsoo/shared": "^1.0.75",
56
- "@mui/icons-material": "^5.1.1",
57
- "@mui/material": "^5.1.1",
56
+ "@mui/icons-material": "^5.2.0",
57
+ "@mui/material": "^5.2.2",
58
58
  "@reach/router": "^1.3.4",
59
59
  "@types/pica": "^5.1.3",
60
60
  "@types/pulltorefreshjs": "^0.1.5",
61
61
  "@types/reach__router": "^1.3.9",
62
- "@types/react": "^17.0.36",
62
+ "@types/react": "^17.0.37",
63
63
  "@types/react-avatar-editor": "^10.3.6",
64
64
  "@types/react-dom": "^17.0.11",
65
65
  "@types/react-input-mask": "^3.0.1",
@@ -81,13 +81,13 @@
81
81
  "@babel/runtime-corejs3": "^7.16.3",
82
82
  "@types/jest": "^27.0.3",
83
83
  "@types/react-test-renderer": "^17.0.1",
84
- "@typescript-eslint/eslint-plugin": "^5.4.0",
85
- "@typescript-eslint/parser": "^5.4.0",
84
+ "@typescript-eslint/eslint-plugin": "^5.5.0",
85
+ "@typescript-eslint/parser": "^5.5.0",
86
86
  "eslint": "^8.3.0",
87
87
  "eslint-config-airbnb-base": "^15.0.0",
88
88
  "eslint-plugin-import": "^2.25.3",
89
89
  "eslint-plugin-react": "^7.27.1",
90
- "jest": "^27.3.1",
90
+ "jest": "^27.4.3",
91
91
  "react-test-renderer": "^17.0.2",
92
92
  "ts-jest": "^27.0.7",
93
93
  "typescript": "^4.5.2"
@@ -3,7 +3,12 @@ import { IActionResult, IUser } from '@etsoo/appscript';
3
3
  /**
4
4
  * SmartERP user interface
5
5
  */
6
- export interface ISmartERPUser extends IUser {}
6
+ export interface ISmartERPUser extends IUser {
7
+ /**
8
+ * Service refresh token
9
+ */
10
+ readonly serviceToken?: string;
11
+ }
7
12
 
8
13
  /**
9
14
  * SmartERP user login result
@@ -266,6 +266,7 @@ export class ReactApp<
266
266
  if (callback) await callback();
267
267
  else await this.tryLogin();
268
268
  },
269
+ undefined,
269
270
  {
270
271
  okLabel: labels.cancel,
271
272
  primaryButton: { fullWidth: true, autoFocus: false },
@@ -2,6 +2,11 @@
2
2
  * Refresh token request data
3
3
  */
4
4
  export type RefreshTokenRQ = {
5
+ /**
6
+ * Service id
7
+ */
8
+ serviceId?: number;
9
+
5
10
  /**
6
11
  * Time zone
7
12
  */
@@ -58,7 +58,13 @@ export class ServiceApp<
58
58
  refreshToken: string,
59
59
  coreUser: ISmartERPUser
60
60
  ): void {
61
+ // Service user login
61
62
  super.userLogin(user, refreshToken, false);
63
+
64
+ // Core system user
62
65
  this.coreUser = coreUser;
66
+
67
+ // Core system API token
68
+ this.api.authorize(this.settings.authScheme, coreUser.token);
63
69
  }
64
70
  }