@etsoo/react 1.3.30 → 1.3.34

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
@@ -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/lib/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './app/CoreConstants';
1
2
  export * from './app/InputDialogProps';
2
3
  export * from './app/IServiceAppSettings';
3
4
  export * from './app/IServicePage';
package/lib/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // app
2
+ export * from './app/CoreConstants';
2
3
  export * from './app/InputDialogProps';
3
4
  export * from './app/IServiceAppSettings';
4
5
  export * from './app/IServicePage';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.3.30",
3
+ "version": "1.3.34",
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",
53
+ "@etsoo/appscript": "^1.1.50",
54
54
  "@etsoo/notificationbase": "^1.0.93",
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.2",
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
@@ -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
  }
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  // app
2
+ export * from './app/CoreConstants';
2
3
  export * from './app/InputDialogProps';
3
4
  export * from './app/IServiceAppSettings';
4
5
  export * from './app/IServicePage';