@etsoo/react 1.3.28 → 1.3.32
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/lib/app/CoreConstants.d.ts +13 -0
- package/lib/app/CoreConstants.js +14 -0
- package/lib/app/IServiceUser.d.ts +5 -1
- package/lib/app/ISmartERPUser.d.ts +14 -0
- package/lib/app/ISmartERPUser.js +1 -0
- package/lib/app/ReactApp.d.ts +1 -1
- package/lib/app/RefreshTokenRQ.d.ts +9 -0
- package/lib/app/RefreshTokenRQ.js +1 -0
- package/lib/app/ServiceApp.d.ts +12 -0
- package/lib/app/ServiceApp.js +10 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +3 -0
- package/package.json +8 -8
- package/src/app/CoreConstants.ts +14 -0
- package/src/app/IServiceUser.ts +6 -1
- package/src/app/ISmartERPUser.ts +16 -0
- package/src/app/ReactApp.ts +1 -1
- package/src/app/RefreshTokenRQ.ts +9 -0
- package/src/app/ServiceApp.ts +21 -0
- package/src/index.ts +3 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core constants
|
|
3
|
+
*/
|
|
4
|
+
export declare namespace CoreConstants {
|
|
5
|
+
/**
|
|
6
|
+
* Rresh token cache field
|
|
7
|
+
*/
|
|
8
|
+
const FieldRefreshToken = "RefreshToken";
|
|
9
|
+
/**
|
|
10
|
+
* Refresh token header field name
|
|
11
|
+
*/
|
|
12
|
+
const TokenHeaderRefresh = "SmartERPRefreshToken";
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core constants
|
|
3
|
+
*/
|
|
4
|
+
export var CoreConstants;
|
|
5
|
+
(function (CoreConstants) {
|
|
6
|
+
/**
|
|
7
|
+
* Rresh token cache field
|
|
8
|
+
*/
|
|
9
|
+
CoreConstants.FieldRefreshToken = 'RefreshToken';
|
|
10
|
+
/**
|
|
11
|
+
* Refresh token header field name
|
|
12
|
+
*/
|
|
13
|
+
CoreConstants.TokenHeaderRefresh = 'SmartERPRefreshToken';
|
|
14
|
+
})(CoreConstants || (CoreConstants = {}));
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { IUser } from '@etsoo/appscript';
|
|
1
|
+
import { IActionResult, IUser } from '@etsoo/appscript';
|
|
2
2
|
/**
|
|
3
3
|
* Service user interface
|
|
4
4
|
*/
|
|
5
5
|
export interface IServiceUser extends IUser {
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* Service user login result
|
|
9
|
+
*/
|
|
10
|
+
export declare type ServiceLoginResult = IActionResult<IServiceUser>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IActionResult, IUser } from '@etsoo/appscript';
|
|
2
|
+
/**
|
|
3
|
+
* SmartERP user interface
|
|
4
|
+
*/
|
|
5
|
+
export interface ISmartERPUser extends IUser {
|
|
6
|
+
/**
|
|
7
|
+
* Service refresh token
|
|
8
|
+
*/
|
|
9
|
+
readonly serviceToken?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* SmartERP user login result
|
|
13
|
+
*/
|
|
14
|
+
export declare type SmartERPLoginResult = IActionResult<ISmartERPUser>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/app/ReactApp.d.ts
CHANGED
|
@@ -144,7 +144,7 @@ export declare class ReactApp<S extends IAppSettings, D extends IUser, P extends
|
|
|
144
144
|
* @param refreshToken Refresh token
|
|
145
145
|
* @param keep Keep in local storage or not
|
|
146
146
|
*/
|
|
147
|
-
userLogin(user: IUserData, refreshToken
|
|
147
|
+
userLogin(user: IUserData, refreshToken: string, keep?: boolean): void;
|
|
148
148
|
/**
|
|
149
149
|
* User logout
|
|
150
150
|
* @param clearToken Clear refresh token or not
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/app/ServiceApp.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IApi } from '@etsoo/appscript';
|
|
2
|
+
import { ISmartERPUser } from '..';
|
|
2
3
|
import { IServiceAppSettings } from './IServiceAppSettings';
|
|
3
4
|
import { IServicePageData } from './IServicePage';
|
|
4
5
|
import { IServiceUser } from './IServiceUser';
|
|
@@ -14,10 +15,21 @@ export declare class ServiceApp<P extends IServicePageData = IServicePageData, U
|
|
|
14
15
|
* Core system API
|
|
15
16
|
*/
|
|
16
17
|
readonly coreApi: IApi;
|
|
18
|
+
/**
|
|
19
|
+
* Core system user
|
|
20
|
+
*/
|
|
21
|
+
coreUser?: ISmartERPUser;
|
|
17
22
|
/**
|
|
18
23
|
* Constructor
|
|
19
24
|
* @param settings Settings
|
|
20
25
|
* @param name Application name
|
|
21
26
|
*/
|
|
22
27
|
constructor(settings: S, name: string);
|
|
28
|
+
/**
|
|
29
|
+
* User login extended
|
|
30
|
+
* @param user New user
|
|
31
|
+
* @param refreshToken Refresh token
|
|
32
|
+
* @param coreUser Core system user
|
|
33
|
+
*/
|
|
34
|
+
userLoginEx(user: IServiceUser, refreshToken: string, coreUser: ISmartERPUser): void;
|
|
23
35
|
}
|
package/lib/app/ServiceApp.js
CHANGED
|
@@ -24,4 +24,14 @@ export class ServiceApp extends ReactApp {
|
|
|
24
24
|
this.setApi(api);
|
|
25
25
|
this.coreApi = api;
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* User login extended
|
|
29
|
+
* @param user New user
|
|
30
|
+
* @param refreshToken Refresh token
|
|
31
|
+
* @param coreUser Core system user
|
|
32
|
+
*/
|
|
33
|
+
userLoginEx(user, refreshToken, coreUser) {
|
|
34
|
+
super.userLogin(user, refreshToken, false);
|
|
35
|
+
this.coreUser = coreUser;
|
|
36
|
+
}
|
|
27
37
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
export * from './app/CoreConstants';
|
|
1
2
|
export * from './app/InputDialogProps';
|
|
2
3
|
export * from './app/IServiceAppSettings';
|
|
3
4
|
export * from './app/IServicePage';
|
|
4
5
|
export * from './app/IServiceUser';
|
|
6
|
+
export * from './app/ISmartERPUser';
|
|
5
7
|
export * from './app/Labels';
|
|
6
8
|
export * from './app/ReactApp';
|
|
9
|
+
export * from './app/RefreshTokenRQ';
|
|
7
10
|
export * from './app/ServiceApp';
|
|
8
11
|
export * from './app/Utils';
|
|
9
12
|
export * from './components/GridColumn';
|
package/lib/index.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
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';
|
|
5
6
|
export * from './app/IServiceUser';
|
|
7
|
+
export * from './app/ISmartERPUser';
|
|
6
8
|
export * from './app/Labels';
|
|
7
9
|
export * from './app/ReactApp';
|
|
10
|
+
export * from './app/RefreshTokenRQ';
|
|
8
11
|
export * from './app/ServiceApp';
|
|
9
12
|
export * from './app/Utils';
|
|
10
13
|
// components
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/react",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.32",
|
|
4
4
|
"description": "TypeScript ReactJs framework",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -50,21 +50,21 @@
|
|
|
50
50
|
"@emotion/react": "^11.6.0",
|
|
51
51
|
"@emotion/style": "^0.8.0",
|
|
52
52
|
"@emotion/styled": "^11.6.0",
|
|
53
|
-
"@etsoo/appscript": "^1.1.
|
|
53
|
+
"@etsoo/appscript": "^1.1.49",
|
|
54
54
|
"@etsoo/notificationbase": "^1.0.93",
|
|
55
|
-
"@etsoo/shared": "^1.0.
|
|
56
|
-
"@mui/icons-material": "^5.
|
|
57
|
-
"@mui/material": "^5.
|
|
55
|
+
"@etsoo/shared": "^1.0.75",
|
|
56
|
+
"@mui/icons-material": "^5.2.0",
|
|
57
|
+
"@mui/material": "^5.2.0",
|
|
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.
|
|
62
|
+
"@types/react": "^17.0.36",
|
|
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",
|
|
66
66
|
"@types/react-window": "^1.8.5",
|
|
67
|
-
"pica": "^
|
|
67
|
+
"pica": "^8.0.0",
|
|
68
68
|
"pulltorefreshjs": "^0.1.22",
|
|
69
69
|
"react": "^17.0.2",
|
|
70
70
|
"react-avatar-editor": "^12.0.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@types/react-test-renderer": "^17.0.1",
|
|
84
84
|
"@typescript-eslint/eslint-plugin": "^5.4.0",
|
|
85
85
|
"@typescript-eslint/parser": "^5.4.0",
|
|
86
|
-
"eslint": "^8.
|
|
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",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core constants
|
|
3
|
+
*/
|
|
4
|
+
export namespace CoreConstants {
|
|
5
|
+
/**
|
|
6
|
+
* Rresh token cache field
|
|
7
|
+
*/
|
|
8
|
+
export const FieldRefreshToken = 'RefreshToken';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Refresh token header field name
|
|
12
|
+
*/
|
|
13
|
+
export const TokenHeaderRefresh = 'SmartERPRefreshToken';
|
|
14
|
+
}
|
package/src/app/IServiceUser.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { IUser } from '@etsoo/appscript';
|
|
1
|
+
import { IActionResult, IUser } from '@etsoo/appscript';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Service user interface
|
|
5
5
|
*/
|
|
6
6
|
export interface IServiceUser extends IUser {}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Service user login result
|
|
10
|
+
*/
|
|
11
|
+
export type ServiceLoginResult = IActionResult<IServiceUser>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IActionResult, IUser } from '@etsoo/appscript';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SmartERP user interface
|
|
5
|
+
*/
|
|
6
|
+
export interface ISmartERPUser extends IUser {
|
|
7
|
+
/**
|
|
8
|
+
* Service refresh token
|
|
9
|
+
*/
|
|
10
|
+
readonly serviceToken?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* SmartERP user login result
|
|
15
|
+
*/
|
|
16
|
+
export type SmartERPLoginResult = IActionResult<ISmartERPUser>;
|
package/src/app/ReactApp.ts
CHANGED
package/src/app/ServiceApp.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createClient, IApi } from '@etsoo/appscript';
|
|
2
|
+
import { ISmartERPUser } from '..';
|
|
2
3
|
import { IServiceAppSettings } from './IServiceAppSettings';
|
|
3
4
|
import { IServicePageData } from './IServicePage';
|
|
4
5
|
import { IServiceUser } from './IServiceUser';
|
|
@@ -20,6 +21,11 @@ export class ServiceApp<
|
|
|
20
21
|
*/
|
|
21
22
|
readonly coreApi: IApi;
|
|
22
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Core system user
|
|
26
|
+
*/
|
|
27
|
+
coreUser?: ISmartERPUser;
|
|
28
|
+
|
|
23
29
|
/**
|
|
24
30
|
* Constructor
|
|
25
31
|
* @param settings Settings
|
|
@@ -40,4 +46,19 @@ export class ServiceApp<
|
|
|
40
46
|
this.setApi(api);
|
|
41
47
|
this.coreApi = api;
|
|
42
48
|
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* User login extended
|
|
52
|
+
* @param user New user
|
|
53
|
+
* @param refreshToken Refresh token
|
|
54
|
+
* @param coreUser Core system user
|
|
55
|
+
*/
|
|
56
|
+
userLoginEx(
|
|
57
|
+
user: IServiceUser,
|
|
58
|
+
refreshToken: string,
|
|
59
|
+
coreUser: ISmartERPUser
|
|
60
|
+
): void {
|
|
61
|
+
super.userLogin(user, refreshToken, false);
|
|
62
|
+
this.coreUser = coreUser;
|
|
63
|
+
}
|
|
43
64
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
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';
|
|
5
6
|
export * from './app/IServiceUser';
|
|
7
|
+
export * from './app/ISmartERPUser';
|
|
6
8
|
export * from './app/Labels';
|
|
7
9
|
export * from './app/ReactApp';
|
|
10
|
+
export * from './app/RefreshTokenRQ';
|
|
8
11
|
export * from './app/ServiceApp';
|
|
9
12
|
export * from './app/Utils';
|
|
10
13
|
|