@steroidsjs/core 2.2.104 → 2.2.106
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/actions/modal.d.ts
CHANGED
|
@@ -9,13 +9,13 @@ export declare const openModal: (modal: any, props?: IModalProps) => {
|
|
|
9
9
|
group: any;
|
|
10
10
|
props: IModalProps;
|
|
11
11
|
};
|
|
12
|
-
export declare const modalMarkClosing: (id:
|
|
12
|
+
export declare const modalMarkClosing: (id: string, group?: string | null) => {
|
|
13
13
|
type: string;
|
|
14
|
-
id:
|
|
15
|
-
group:
|
|
14
|
+
id: string;
|
|
15
|
+
group: string;
|
|
16
16
|
};
|
|
17
|
-
export declare const closeModal: (id:
|
|
17
|
+
export declare const closeModal: (id: string, group?: string | null) => {
|
|
18
18
|
type: string;
|
|
19
|
-
id:
|
|
20
|
-
group:
|
|
19
|
+
id: string;
|
|
20
|
+
group: string;
|
|
21
21
|
};
|
|
@@ -5,9 +5,9 @@ export interface IShowNotificationParameters {
|
|
|
5
5
|
position?: 'top-right' | 'bottom-right' | 'top-left' | 'bottom-left' | string;
|
|
6
6
|
timeOut?: number;
|
|
7
7
|
}
|
|
8
|
-
export declare const closeNotification: (id?:
|
|
8
|
+
export declare const closeNotification: (id?: string | null) => {
|
|
9
9
|
type: string;
|
|
10
|
-
id:
|
|
10
|
+
id: string;
|
|
11
11
|
};
|
|
12
12
|
export declare const showNotification: (message: string, level?: ColorName, params?: IShowNotificationParameters) => (dispatch: any) => void;
|
|
13
13
|
export declare const setFlashes: (flashes: any) => ((dispatch: any) => void)[][];
|
package/actions/router.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
declare type TParams = Record<string, any> | null;
|
|
1
2
|
export declare const ROUTER_INIT_ROUTES = "ROUTER_INIT_ROUTES";
|
|
2
3
|
export declare const ROUTER_SET_PARAMS = "ROUTER_SET_PARAMS";
|
|
3
4
|
export declare const ROUTER_SET_DATA = "ROUTER_SET_DATA";
|
|
@@ -9,7 +10,8 @@ export declare const initParams: (params: any) => {
|
|
|
9
10
|
type: string;
|
|
10
11
|
params: any;
|
|
11
12
|
};
|
|
12
|
-
export declare const goToRoute: (routeId: any, params?:
|
|
13
|
+
export declare const goToRoute: (routeId: any, params?: TParams, isReplace?: boolean) => (dispatch: any, getState: any, { store }: {
|
|
13
14
|
store: any;
|
|
14
15
|
}) => any;
|
|
15
16
|
export declare const goToParent: (level?: number) => (dispatch: any, getState: any) => any;
|
|
17
|
+
export {};
|
|
@@ -102,34 +102,40 @@ var JwtHttpComponent = /** @class */ (function (_super) {
|
|
|
102
102
|
JwtHttpComponent.prototype.setRefreshTokenInterceptor = function (axiosInstance) {
|
|
103
103
|
var _this = this;
|
|
104
104
|
axiosInstance.interceptors.response.use(function (config) { return config; }, function (error) { return __awaiter(_this, void 0, void 0, function () {
|
|
105
|
-
var originalRequest, store, response, accessToken;
|
|
106
|
-
var
|
|
107
|
-
var
|
|
108
|
-
return __generator(this, function (
|
|
109
|
-
switch (
|
|
105
|
+
var originalRequest, store, response, accessToken, _a;
|
|
106
|
+
var _b;
|
|
107
|
+
var _c, _d;
|
|
108
|
+
return __generator(this, function (_e) {
|
|
109
|
+
switch (_e.label) {
|
|
110
110
|
case 0:
|
|
111
111
|
originalRequest = error.config;
|
|
112
112
|
if (!(error.response.status === 401
|
|
113
113
|
&& error.config
|
|
114
114
|
&& !error.config._isRetry
|
|
115
|
-
&& originalRequest.url !== this.getUrl((
|
|
115
|
+
&& originalRequest.url !== this.getUrl((_c = this.refreshTokenRequest) === null || _c === void 0 ? void 0 : _c.url))) return [3 /*break*/, 4];
|
|
116
116
|
this.removeAccessToken();
|
|
117
117
|
store = this._components.store;
|
|
118
|
-
|
|
119
|
-
_a[this.refreshTokenKey] = this._refreshToken,
|
|
120
|
-
_a))];
|
|
118
|
+
_e.label = 1;
|
|
121
119
|
case 1:
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
_e.trys.push([1, 3, , 4]);
|
|
121
|
+
return [4 /*yield*/, this.send(this.refreshTokenRequest.method, this.refreshTokenRequest.url, (_b = {},
|
|
122
|
+
_b[this.refreshTokenKey] = this._refreshToken,
|
|
123
|
+
_b))];
|
|
124
|
+
case 2:
|
|
125
|
+
response = _e.sent();
|
|
126
|
+
accessToken = (_d = response === null || response === void 0 ? void 0 : response.data) === null || _d === void 0 ? void 0 : _d[this.accessTokenKey];
|
|
124
127
|
if (accessToken) {
|
|
125
128
|
this.setAccessToken(accessToken);
|
|
126
129
|
originalRequest._isRetry = true;
|
|
127
130
|
originalRequest.headers.Authorization = 'Bearer ' + accessToken;
|
|
128
131
|
return [2 /*return*/, axiosInstance.request(originalRequest)];
|
|
129
132
|
}
|
|
133
|
+
return [3 /*break*/, 4];
|
|
134
|
+
case 3:
|
|
135
|
+
_a = _e.sent();
|
|
130
136
|
store.dispatch(auth_1.logout());
|
|
131
|
-
|
|
132
|
-
case
|
|
137
|
+
return [3 /*break*/, 4];
|
|
138
|
+
case 4: throw error;
|
|
133
139
|
}
|
|
134
140
|
});
|
|
135
141
|
}); });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steroidsjs/core",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.106",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Vladimir Kozhin <hello@kozhindev.com>",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"connected-react-router": "^6.9.1",
|
|
29
29
|
"domready": "^1.0.8",
|
|
30
30
|
"dot-prop-immutable": "^2.1.0",
|
|
31
|
-
"fileup-core": "^1.2.
|
|
31
|
+
"fileup-core": "^1.2.7",
|
|
32
32
|
"history": "^4.10.1",
|
|
33
33
|
"intl-messageformat": "^9.11.0",
|
|
34
34
|
"js-cookie": "^2.2.1",
|
package/reducers/screen.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const SCREEN_PHONE = "phone";
|
|
2
2
|
export declare const SCREEN_TABLET = "tablet";
|
|
3
3
|
export declare const SCREEN_DESKTOP = "desktop";
|
|
4
|
-
declare
|
|
4
|
+
export declare type TMediaDevice = typeof SCREEN_PHONE | typeof SCREEN_TABLET | typeof SCREEN_DESKTOP;
|
|
5
|
+
export interface IScreenInitialState {
|
|
5
6
|
width: number;
|
|
6
7
|
media: {
|
|
7
|
-
|
|
8
|
-
tablet: number;
|
|
9
|
-
desktop: number;
|
|
8
|
+
[key in TMediaDevice]: number;
|
|
10
9
|
};
|
|
11
|
-
}
|
|
10
|
+
}
|
|
11
|
+
declare const _default: (state: IScreenInitialState, action: any) => {
|
|
12
12
|
width: any;
|
|
13
13
|
media: {
|
|
14
14
|
phone: number;
|
package/reducers/screen.js
CHANGED
|
@@ -12,15 +12,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
var _a;
|
|
14
14
|
exports.__esModule = true;
|
|
15
|
-
exports.isDesktop = exports.isTablet = exports.isPhone = exports.getDeviceType = exports.SCREEN_DESKTOP = exports.SCREEN_TABLET = exports.
|
|
15
|
+
exports.isDesktop = exports.isTablet = exports.isPhone = exports.getDeviceType = exports.SCREEN_DESKTOP = exports.SCREEN_TABLET = exports.SCREEN_PHONE = void 0;
|
|
16
16
|
var screen_1 = require("../actions/screen");
|
|
17
|
-
exports.
|
|
17
|
+
exports.SCREEN_PHONE = 'phone';
|
|
18
18
|
exports.SCREEN_TABLET = 'tablet';
|
|
19
19
|
exports.SCREEN_DESKTOP = 'desktop';
|
|
20
20
|
var initialState = {
|
|
21
21
|
width: 1280,
|
|
22
22
|
media: (_a = {},
|
|
23
|
-
_a[exports.
|
|
23
|
+
_a[exports.SCREEN_PHONE] = 320,
|
|
24
24
|
_a[exports.SCREEN_TABLET] = 768,
|
|
25
25
|
_a[exports.SCREEN_DESKTOP] = 1024,
|
|
26
26
|
_a)
|
|
@@ -38,7 +38,7 @@ exports["default"] = (function (state, action) {
|
|
|
38
38
|
});
|
|
39
39
|
var getDeviceType = function (state) {
|
|
40
40
|
if (state.screen.width < state.screen.media[exports.SCREEN_TABLET]) {
|
|
41
|
-
return exports.
|
|
41
|
+
return exports.SCREEN_PHONE;
|
|
42
42
|
}
|
|
43
43
|
if (state.screen.width < state.screen.media[exports.SCREEN_DESKTOP]) {
|
|
44
44
|
return exports.SCREEN_TABLET;
|
|
@@ -46,7 +46,7 @@ var getDeviceType = function (state) {
|
|
|
46
46
|
return exports.SCREEN_DESKTOP;
|
|
47
47
|
};
|
|
48
48
|
exports.getDeviceType = getDeviceType;
|
|
49
|
-
var isPhone = function (state) { return exports.getDeviceType(state) === exports.
|
|
49
|
+
var isPhone = function (state) { return exports.getDeviceType(state) === exports.SCREEN_PHONE; };
|
|
50
50
|
exports.isPhone = isPhone;
|
|
51
51
|
var isTablet = function (state) { return exports.getDeviceType(state) === exports.SCREEN_TABLET; };
|
|
52
52
|
exports.isTablet = isTablet;
|