@etsoo/appscript 1.1.77 → 1.1.81
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/cjs/app/CoreApp.js +2 -5
- package/lib/cjs/state/User.d.ts +8 -0
- package/lib/mjs/app/CoreApp.js +2 -5
- package/lib/mjs/state/User.d.ts +8 -0
- package/package.json +12 -12
- package/src/app/CoreApp.ts +2 -4
- package/src/state/User.ts +10 -0
package/lib/cjs/app/CoreApp.js
CHANGED
|
@@ -569,10 +569,7 @@ class CoreApp {
|
|
|
569
569
|
const refreshToken = shared_1.StorageUtils.getLocalData(this.headerTokenField, '');
|
|
570
570
|
if (refreshToken === '')
|
|
571
571
|
return null;
|
|
572
|
-
|
|
573
|
-
if (result == undefined)
|
|
574
|
-
return null;
|
|
575
|
-
return result;
|
|
572
|
+
return refreshToken;
|
|
576
573
|
}
|
|
577
574
|
/**
|
|
578
575
|
* Get all regions
|
|
@@ -746,7 +743,7 @@ class CoreApp {
|
|
|
746
743
|
return url;
|
|
747
744
|
// From relative root, like home:/react/, url: /about => /react/about
|
|
748
745
|
if (url.startsWith('/'))
|
|
749
|
-
return home + url.
|
|
746
|
+
return home + url.substring(1);
|
|
750
747
|
const pathname = window.location.pathname;
|
|
751
748
|
// Relative
|
|
752
749
|
const pos = pathname.indexOf(home);
|
package/lib/cjs/state/User.d.ts
CHANGED
|
@@ -28,6 +28,10 @@ export interface IUserData {
|
|
|
28
28
|
*/
|
|
29
29
|
readonly token: string;
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* User data property keys
|
|
33
|
+
*/
|
|
34
|
+
export declare type UserKey = keyof IUserData;
|
|
31
35
|
/**
|
|
32
36
|
* User interface
|
|
33
37
|
*/
|
|
@@ -36,4 +40,8 @@ export interface IUser extends IUserData, IState {
|
|
|
36
40
|
* Authorized or not
|
|
37
41
|
*/
|
|
38
42
|
authorized: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Last update changed fields
|
|
45
|
+
*/
|
|
46
|
+
lastChangedFields?: UserKey[];
|
|
39
47
|
}
|
package/lib/mjs/app/CoreApp.js
CHANGED
|
@@ -566,10 +566,7 @@ export class CoreApp {
|
|
|
566
566
|
const refreshToken = StorageUtils.getLocalData(this.headerTokenField, '');
|
|
567
567
|
if (refreshToken === '')
|
|
568
568
|
return null;
|
|
569
|
-
|
|
570
|
-
if (result == undefined)
|
|
571
|
-
return null;
|
|
572
|
-
return result;
|
|
569
|
+
return refreshToken;
|
|
573
570
|
}
|
|
574
571
|
/**
|
|
575
572
|
* Get all regions
|
|
@@ -743,7 +740,7 @@ export class CoreApp {
|
|
|
743
740
|
return url;
|
|
744
741
|
// From relative root, like home:/react/, url: /about => /react/about
|
|
745
742
|
if (url.startsWith('/'))
|
|
746
|
-
return home + url.
|
|
743
|
+
return home + url.substring(1);
|
|
747
744
|
const pathname = window.location.pathname;
|
|
748
745
|
// Relative
|
|
749
746
|
const pos = pathname.indexOf(home);
|
package/lib/mjs/state/User.d.ts
CHANGED
|
@@ -28,6 +28,10 @@ export interface IUserData {
|
|
|
28
28
|
*/
|
|
29
29
|
readonly token: string;
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* User data property keys
|
|
33
|
+
*/
|
|
34
|
+
export declare type UserKey = keyof IUserData;
|
|
31
35
|
/**
|
|
32
36
|
* User interface
|
|
33
37
|
*/
|
|
@@ -36,4 +40,8 @@ export interface IUser extends IUserData, IState {
|
|
|
36
40
|
* Authorized or not
|
|
37
41
|
*/
|
|
38
42
|
authorized: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Last update changed fields
|
|
45
|
+
*/
|
|
46
|
+
lastChangedFields?: UserKey[];
|
|
39
47
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/appscript",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.81",
|
|
4
4
|
"description": "Applications shared TypeScript framework",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -54,24 +54,24 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@etsoo/notificationbase": "^1.0.94",
|
|
56
56
|
"@etsoo/restclient": "^1.0.62",
|
|
57
|
-
"@etsoo/shared": "^1.0.
|
|
57
|
+
"@etsoo/shared": "^1.0.78",
|
|
58
58
|
"@types/crypto-js": "^4.0.2",
|
|
59
59
|
"crypto-js": "^4.1.1"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@babel/cli": "^7.16.0",
|
|
63
|
-
"@babel/core": "^7.16.
|
|
64
|
-
"@babel/plugin-transform-runtime": "^7.16.
|
|
65
|
-
"@babel/preset-env": "^7.16.
|
|
66
|
-
"@babel/runtime-corejs3": "^7.16.
|
|
63
|
+
"@babel/core": "^7.16.5",
|
|
64
|
+
"@babel/plugin-transform-runtime": "^7.16.5",
|
|
65
|
+
"@babel/preset-env": "^7.16.5",
|
|
66
|
+
"@babel/runtime-corejs3": "^7.16.5",
|
|
67
67
|
"@types/jest": "^27.0.3",
|
|
68
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
69
|
-
"@typescript-eslint/parser": "^5.
|
|
70
|
-
"eslint": "^8.
|
|
68
|
+
"@typescript-eslint/eslint-plugin": "^5.7.0",
|
|
69
|
+
"@typescript-eslint/parser": "^5.7.0",
|
|
70
|
+
"eslint": "^8.5.0",
|
|
71
71
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
72
72
|
"eslint-plugin-import": "^2.25.3",
|
|
73
|
-
"jest": "^27.4.
|
|
74
|
-
"ts-jest": "^27.1.
|
|
75
|
-
"typescript": "^4.5.
|
|
73
|
+
"jest": "^27.4.5",
|
|
74
|
+
"ts-jest": "^27.1.2",
|
|
75
|
+
"typescript": "^4.5.4"
|
|
76
76
|
}
|
|
77
77
|
}
|
package/src/app/CoreApp.ts
CHANGED
|
@@ -1180,9 +1180,7 @@ export abstract class CoreApp<
|
|
|
1180
1180
|
|
|
1181
1181
|
if (refreshToken === '') return null;
|
|
1182
1182
|
|
|
1183
|
-
|
|
1184
|
-
if (result == undefined) return null;
|
|
1185
|
-
return result;
|
|
1183
|
+
return refreshToken;
|
|
1186
1184
|
}
|
|
1187
1185
|
|
|
1188
1186
|
/**
|
|
@@ -1375,7 +1373,7 @@ export abstract class CoreApp<
|
|
|
1375
1373
|
if (home === '') return url;
|
|
1376
1374
|
|
|
1377
1375
|
// From relative root, like home:/react/, url: /about => /react/about
|
|
1378
|
-
if (url.startsWith('/')) return home + url.
|
|
1376
|
+
if (url.startsWith('/')) return home + url.substring(1);
|
|
1379
1377
|
|
|
1380
1378
|
const pathname = window.location.pathname;
|
|
1381
1379
|
|
package/src/state/User.ts
CHANGED
|
@@ -35,6 +35,11 @@ export interface IUserData {
|
|
|
35
35
|
readonly token: string;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* User data property keys
|
|
40
|
+
*/
|
|
41
|
+
export type UserKey = keyof IUserData;
|
|
42
|
+
|
|
38
43
|
/**
|
|
39
44
|
* User interface
|
|
40
45
|
*/
|
|
@@ -43,4 +48,9 @@ export interface IUser extends IUserData, IState {
|
|
|
43
48
|
* Authorized or not
|
|
44
49
|
*/
|
|
45
50
|
authorized: boolean;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Last update changed fields
|
|
54
|
+
*/
|
|
55
|
+
lastChangedFields?: UserKey[];
|
|
46
56
|
}
|