eservices-core 1.0.347 → 1.0.348
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/dist/classes/CoreError.d.ts +1 -1
- package/dist/index.js +6 -5
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ export default class CoreError extends Error {
|
|
|
19
19
|
static UndefinedErrorId(id: number, array: any): CoreError;
|
|
20
20
|
static ApiError(error: any): CoreError;
|
|
21
21
|
static ApiNotAvailable(): CoreError;
|
|
22
|
-
static AuthServiceError(message: string, errors: string[] | null): CoreError;
|
|
22
|
+
static AuthServiceError(message: string | undefined, errors: string[] | null): CoreError;
|
|
23
23
|
static ApiResponseParseFailed(): CoreError;
|
|
24
24
|
static MissingIdInValuesEntity(values: any): CoreError;
|
|
25
25
|
static ObjectWithIdNotFound(id: number, array: any[]): CoreError;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* eservices-core v1.0.
|
|
2
|
+
* eservices-core v1.0.348
|
|
3
3
|
* (c) 2022 ESERVICES
|
|
4
4
|
*/
|
|
5
5
|
'use strict';
|
|
@@ -1864,7 +1864,7 @@ class CoreError extends Error {
|
|
|
1864
1864
|
Please try again later or submit a feedback if problem doesn't go.`);
|
|
1865
1865
|
}
|
|
1866
1866
|
static AuthServiceError(message, errors) {
|
|
1867
|
-
return new CoreError(message, errors);
|
|
1867
|
+
return new CoreError(message || 'Authorization Error', errors);
|
|
1868
1868
|
}
|
|
1869
1869
|
static ApiResponseParseFailed() {
|
|
1870
1870
|
return new CoreError(`Response is not a valide JSON`);
|
|
@@ -2056,7 +2056,7 @@ var NotificationSystem = new (_a = class NotificationSystem {
|
|
|
2056
2056
|
const cardId = NotificationSystem.cardId++;
|
|
2057
2057
|
this.store.push({
|
|
2058
2058
|
type, msg,
|
|
2059
|
-
children: children === null || children === void 0 ? void 0 : children.map((msg, id) => ({ msg, id })),
|
|
2059
|
+
children: (children === null || children === void 0 ? void 0 : children.map((msg, id) => ({ msg, id }))) || [],
|
|
2060
2060
|
id: cardId
|
|
2061
2061
|
});
|
|
2062
2062
|
if (timeout)
|
|
@@ -2116,8 +2116,9 @@ function requestHandler(callback, options = {}) {
|
|
|
2116
2116
|
* Показывается плашка сверху сайта
|
|
2117
2117
|
* */
|
|
2118
2118
|
if (options.error) {
|
|
2119
|
+
console.log(error);
|
|
2119
2120
|
if (error instanceof CoreError)
|
|
2120
|
-
NotificationSystem.add('error', error.message, error.details);
|
|
2121
|
+
NotificationSystem.add('error', error.message, error.details || {});
|
|
2121
2122
|
else {
|
|
2122
2123
|
NotificationSystem.add('error', error);
|
|
2123
2124
|
}
|
|
@@ -4817,7 +4818,7 @@ class authService {
|
|
|
4817
4818
|
}
|
|
4818
4819
|
static parseLoginProcessAnswer(answer) {
|
|
4819
4820
|
if (answer.statusCode >= 4)
|
|
4820
|
-
throw CoreError.UndefinedError(answer.statusName);
|
|
4821
|
+
throw CoreError.UndefinedError(answer.statusName.replace(/([A-Z][a-z])/g, ' $1').replace(/(\d)/g, ' $1'));
|
|
4821
4822
|
return answer;
|
|
4822
4823
|
}
|
|
4823
4824
|
}
|