@wireapp/api-client 27.89.0 → 27.89.2

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.
@@ -1,25 +1,8 @@
1
- import { StatusCodes as StatusCode } from 'http-status-codes';
2
1
  import { MLSGroupOutOfSyncError } from '../conversation/';
3
- import { BackendError, BackendErrorLabel } from './';
4
- type BackendErrorWithLabel = BackendError & {
5
- label: BackendErrorLabel;
6
- };
7
- type ErrorBuilder = (e: BackendErrorWithLabel) => BackendError;
8
- type ErrorLabelToBuilderMap = Partial<Record<BackendErrorLabel, ErrorBuilder>>;
9
- type StatusCodeToLabelMap = Partial<Record<StatusCode, ErrorLabelToBuilderMap>>;
10
- export declare class BackendErrorMapper {
11
- /**
12
- * Baseline/default handler for each (code, label). Used when no message variant matches.
13
- */
14
- static defaultHandlers: StatusCodeToLabelMap;
15
- /**
16
- * Message-specific variants for known texts under a given (code,label).
17
- * Provides finer granularity when wording matches; otherwise we fall back to defaultHandlers.
18
- */
19
- private static messageVariantHandlers;
20
- private static logUnmapped;
21
- static isMlsGroupOutOfSyncError(error: BackendError): error is MLSGroupOutOfSyncError;
22
- static map(error: BackendError): BackendError;
23
- }
24
- export {};
2
+ import { BackendError } from './';
3
+ export declare function isMlsGroupOutOfSyncError(error: BackendError): error is MLSGroupOutOfSyncError;
4
+ /**
5
+ * Map a BackendError to a more specific error instance based on its code, label, and message.
6
+ */
7
+ export declare function mapBackendError(error: BackendError): BackendError;
25
8
  //# sourceMappingURL=BackendErrorMapper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BackendErrorMapper.d.ts","sourceRoot":"","sources":["../../src/http/BackendErrorMapper.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,WAAW,IAAI,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAc5D,OAAO,EAGL,sBAAsB,EAIvB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAC,YAAY,EAAE,iBAAiB,EAAC,MAAM,IAAI,CAAC;AAEnD,KAAK,qBAAqB,GAAG,YAAY,GAAG;IAAC,KAAK,EAAE,iBAAiB,CAAA;CAAC,CAAC;AACvE,KAAK,YAAY,GAAG,CAAC,CAAC,EAAE,qBAAqB,KAAK,YAAY,CAAC;AAG/D,KAAK,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC,CAAC;AAE/E,KAAK,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,sBAAsB,CAAC,CAAC,CAAC;AAQhF,qBAAa,kBAAkB;IAC7B;;OAEG;IACH,OAAc,eAAe,EAAE,oBAAoB,CAmDjD;IAEF;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB,CA6CnC;IAEF,OAAO,CAAC,MAAM,CAAC,WAAW;WAWZ,wBAAwB,CAAC,KAAK,EAAE,YAAY,GAAG,KAAK,IAAI,sBAAsB;WAQ9E,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY;CAyBrD"}
1
+ {"version":3,"file":"BackendErrorMapper.d.ts","sourceRoot":"","sources":["../../src/http/BackendErrorMapper.ts"],"names":[],"mappings":"AAiCA,OAAO,EAGL,sBAAsB,EAIvB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAC,YAAY,EAAoB,MAAM,IAAI,CAAC;AA+InD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,YAAY,GAAG,KAAK,IAAI,sBAAsB,CAM7F;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,CAuCjE"}
@@ -18,7 +18,8 @@
18
18
  *
19
19
  */
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.BackendErrorMapper = void 0;
21
+ exports.isMlsGroupOutOfSyncError = isMlsGroupOutOfSyncError;
22
+ exports.mapBackendError = mapBackendError;
22
23
  const http_status_codes_1 = require("http-status-codes");
23
24
  const commons_1 = require("@wireapp/commons");
24
25
  const auth_1 = require("../auth/");
@@ -27,113 +28,132 @@ const team_1 = require("../team/");
27
28
  const user_1 = require("../user/");
28
29
  const _1 = require("./");
29
30
  const logger = commons_1.LogFactory.getLogger('@wireapp/api-client/http/BackendErrorMapper');
30
- class BackendErrorMapper {
31
- /**
32
- * Baseline/default handler for each (code, label). Used when no message variant matches.
33
- */
34
- static defaultHandlers = {
35
- [http_status_codes_1.StatusCodes.BAD_REQUEST]: {
36
- [_1.BackendErrorLabel.CLIENT_ERROR]: e => new _1.BackendError('Wrong set of parameters.', e.label, e.code),
37
- [_1.BackendErrorLabel.INVALID_INVITATION_CODE]: e => new team_1.InvalidInvitationCodeError('Invalid invitation code.', e.label, e.code),
38
- },
39
- [http_status_codes_1.StatusCodes.FORBIDDEN]: {
40
- [_1.BackendErrorLabel.INVALID_CREDENTIALS]: e =>
41
- // default to logout-safe type for unknown messages
42
- new auth_1.InvalidTokenError('Authentication failed because the token is invalid.', e.label, e.code),
43
- [_1.BackendErrorLabel.CLIENT_ERROR]: e => new _1.BackendError('Operation not permitted.', e.label, e.code),
44
- [_1.BackendErrorLabel.NOT_CONNECTED]: e => new user_1.UnconnectedUserError('Users are not connected.', e.label, e.code),
45
- [_1.BackendErrorLabel.INVALID_OPERATION]: e => new conversation_1.ConversationOperationError('Cannot perform this operation.', e.label, e.code),
46
- [_1.BackendErrorLabel.SUSPENDED_ACCOUNT]: e => new auth_1.SuspendedAccountError('Account suspended.', e.label, e.code),
47
- },
48
- [http_status_codes_1.StatusCodes.TOO_MANY_REQUESTS]: {
49
- [_1.BackendErrorLabel.CLIENT_ERROR]: e => new auth_1.LoginTooFrequentError('Logins too frequent. User login temporarily disabled.', e.label, e.code),
31
+ // BAD_REQUEST / CLIENT_ERROR
32
+ const MESSAGE_BAD_REQUEST_SATISFY = 'Error in $: Failed reading: satisfy';
33
+ const MESSAGE_INVALID_CONVERSATION_UUID = "[path] 'cnv' invalid: Failed reading: Invalid UUID";
34
+ const MESSAGE_INVALID_USER_UUID = "[path] 'usr' invalid: Failed reading: Invalid UUID";
35
+ // FORBIDDEN / INVALID_CREDENTIALS and related variants
36
+ const MESSAGE_INVALID_ZAUTH_TOKEN = 'Invalid zauth token';
37
+ const MESSAGE_INVALID_TOKEN = 'Invalid token';
38
+ const MESSAGE_AUTHENTICATION_FAILED = 'Authentication failed.';
39
+ const MESSAGE_MISSING_COOKIE = 'Missing cookie';
40
+ const MESSAGE_TOKEN_EXPIRED = 'Token expired';
41
+ const MESSAGE_MISSING_COOKIE_AND_TOKEN = 'Missing cookie and token';
42
+ // FORBIDDEN / INVALID_OPERATION
43
+ const MESSAGE_INVALID_OPERATION_FOR_ONE_TO_ONE = 'invalid operation for 1:1 conversations';
44
+ // FORBIDDEN / CLIENT_ERROR variant
45
+ const MESSAGE_FAILED_READING_INVALID_ZAUTH_TOKEN = 'Failed reading: Invalid zauth token';
46
+ // Consolidated token-invalid messages to reduce duplication across variants.
47
+ const INVALID_TOKEN_MESSAGES = new Set([
48
+ MESSAGE_INVALID_ZAUTH_TOKEN,
49
+ MESSAGE_INVALID_TOKEN,
50
+ MESSAGE_FAILED_READING_INVALID_ZAUTH_TOKEN,
51
+ ]);
52
+ /**
53
+ * Baseline/default handler for each (code, label). Used when no message variant matches.
54
+ */
55
+ const defaultHandlers = {
56
+ [http_status_codes_1.StatusCodes.BAD_REQUEST]: {
57
+ [_1.BackendErrorLabel.CLIENT_ERROR]: e => new _1.BackendError('Wrong set of parameters.', e.label, e.code),
58
+ [_1.BackendErrorLabel.INVALID_INVITATION_CODE]: e => new team_1.InvalidInvitationCodeError('Invalid invitation code.', e.label, e.code),
59
+ [_1.BackendErrorLabel.MLS_INVALID_LEAF_NODE_SIGNATURE]: e => new conversation_1.MLSInvalidLeafNodeSignatureError('Invalid leaf node signature', e.label, e.code),
60
+ [_1.BackendErrorLabel.MLS_INVALID_LEAF_NODE_INDEX]: e => new conversation_1.MLSInvalidLeafNodeIndexError('Invalid leaf node index', e.label, e.code),
61
+ },
62
+ [http_status_codes_1.StatusCodes.FORBIDDEN]: {
63
+ [_1.BackendErrorLabel.INVALID_CREDENTIALS]: e =>
64
+ // default to logout-safe type for unknown messages
65
+ new auth_1.InvalidTokenError('Authentication failed because the token is invalid.', e.label, e.code),
66
+ [_1.BackendErrorLabel.CLIENT_ERROR]: e => new _1.BackendError('Operation not permitted.', e.label, e.code),
67
+ [_1.BackendErrorLabel.NOT_CONNECTED]: e => new user_1.UnconnectedUserError('Users are not connected.', e.label, e.code),
68
+ [_1.BackendErrorLabel.INVALID_OPERATION]: e => new conversation_1.ConversationOperationError('Cannot perform this operation.', e.label, e.code),
69
+ [_1.BackendErrorLabel.SUSPENDED_ACCOUNT]: e => new auth_1.SuspendedAccountError('Account suspended.', e.label, e.code),
70
+ },
71
+ [http_status_codes_1.StatusCodes.TOO_MANY_REQUESTS]: {
72
+ [_1.BackendErrorLabel.CLIENT_ERROR]: e => new auth_1.LoginTooFrequentError('Logins too frequent. User login temporarily disabled.', e.label, e.code),
73
+ },
74
+ [http_status_codes_1.StatusCodes.CONFLICT]: {
75
+ [_1.BackendErrorLabel.INVITE_EMAIL_EXISTS]: e => new team_1.InviteEmailInUseError('The given e-mail address is in use.', e.label, e.code),
76
+ [_1.BackendErrorLabel.KEY_EXISTS]: e => new auth_1.IdentifierExistsError('The given e-mail address is in use.', e.label, e.code),
77
+ [_1.BackendErrorLabel.MLS_STALE_MESSAGE]: e => new conversation_1.MLSStaleMessageError('The conversation epoch in a message is too old', e.label, e.code),
78
+ [_1.BackendErrorLabel.MLS_GROUP_OUT_OF_SYNC]: error => {
79
+ if (isMlsGroupOutOfSyncError(error)) {
80
+ return new conversation_1.MLSGroupOutOfSyncError(error.code, error.missing_users, error.message);
81
+ }
82
+ logger.warn('Failed to detect missing_users field in MLSGroupOutOfSyncError, using empty array for missing_users', { error });
83
+ return new conversation_1.MLSGroupOutOfSyncError(error.code, [], error.message);
50
84
  },
51
- [http_status_codes_1.StatusCodes.CONFLICT]: {
52
- [_1.BackendErrorLabel.INVITE_EMAIL_EXISTS]: e => new team_1.InviteEmailInUseError('The given e-mail address is in use.', e.label, e.code),
53
- [_1.BackendErrorLabel.KEY_EXISTS]: e => new auth_1.IdentifierExistsError('The given e-mail address is in use.', e.label, e.code),
54
- [_1.BackendErrorLabel.MLS_STALE_MESSAGE]: e => new conversation_1.MLSStaleMessageError('The conversation epoch in a message is too old', e.label, e.code),
55
- [_1.BackendErrorLabel.MLS_GROUP_OUT_OF_SYNC]: error => {
56
- if (BackendErrorMapper.isMlsGroupOutOfSyncError(error)) {
57
- return new conversation_1.MLSGroupOutOfSyncError(error.code, error.missing_users, error.message);
58
- }
59
- logger.warn('Failed to detect missing_users field in MLSGroupOutOfSyncError, using empty array for missing_users', { error });
60
- return new conversation_1.MLSGroupOutOfSyncError(error.code, [], error.message);
61
- },
85
+ },
86
+ [http_status_codes_1.StatusCodes.NOT_FOUND]: {
87
+ [_1.BackendErrorLabel.NOT_FOUND]: e => new team_1.ServiceNotFoundError('Service not found', e.label, e.code),
88
+ },
89
+ };
90
+ /**
91
+ * Message-specific variants for known texts under a given (code,label).
92
+ * Provides finer granularity when wording matches; otherwise we fall back to defaultHandlers.
93
+ */
94
+ const messageVariantHandlers = {
95
+ [http_status_codes_1.StatusCodes.BAD_REQUEST]: {
96
+ [_1.BackendErrorLabel.CLIENT_ERROR]: {
97
+ [MESSAGE_BAD_REQUEST_SATISFY]: e => new _1.BackendError('Wrong set of parameters.', e.label, e.code),
98
+ [MESSAGE_INVALID_CONVERSATION_UUID]: e => new conversation_1.ConversationIsUnknownError('Conversation ID is unknown.', e.label, e.code),
99
+ [MESSAGE_INVALID_USER_UUID]: e => new user_1.UserIsUnknownError('User ID is unknown.', e.label, e.code),
62
100
  },
63
- [http_status_codes_1.StatusCodes.NOT_FOUND]: {
64
- [_1.BackendErrorLabel.NOT_FOUND]: e => new team_1.ServiceNotFoundError('Service not found', e.label, e.code),
101
+ },
102
+ [http_status_codes_1.StatusCodes.FORBIDDEN]: {
103
+ [_1.BackendErrorLabel.INVALID_CREDENTIALS]: {
104
+ [MESSAGE_INVALID_ZAUTH_TOKEN]: e => new auth_1.InvalidTokenError('Authentication failed because the token is invalid.', e.label, e.code),
105
+ [MESSAGE_INVALID_TOKEN]: e => new auth_1.InvalidTokenError('Authentication failed because the token is invalid.', e.label, e.code),
106
+ [MESSAGE_AUTHENTICATION_FAILED]: e => new auth_1.InvalidCredentialsError('Authentication failed because of invalid credentials.', e.label, e.code),
107
+ [MESSAGE_MISSING_COOKIE]: e => new auth_1.MissingCookieError('Authentication failed because the cookie is missing.', e.label, e.code),
108
+ [MESSAGE_TOKEN_EXPIRED]: e => new auth_1.TokenExpiredError('Authentication failed because the token is expired.', e.label, e.code),
109
+ [MESSAGE_MISSING_COOKIE_AND_TOKEN]: e => new auth_1.MissingCookieAndTokenError('Authentication failed because both cookie and token are missing.', e.label, e.code),
65
110
  },
66
- };
67
- /**
68
- * Message-specific variants for known texts under a given (code,label).
69
- * Provides finer granularity when wording matches; otherwise we fall back to defaultHandlers.
70
- */
71
- static messageVariantHandlers = {
72
- [http_status_codes_1.StatusCodes.BAD_REQUEST]: {
73
- [_1.BackendErrorLabel.CLIENT_ERROR]: {
74
- 'Error in $: Failed reading: satisfy': e => new _1.BackendError('Wrong set of parameters.', e.label, e.code),
75
- "[path] 'cnv' invalid: Failed reading: Invalid UUID": e => new conversation_1.ConversationIsUnknownError('Conversation ID is unknown.', e.label, e.code),
76
- "[path] 'usr' invalid: Failed reading: Invalid UUID": e => new user_1.UserIsUnknownError('User ID is unknown.', e.label, e.code),
77
- },
78
- [_1.BackendErrorLabel.MLS_INVALID_LEAF_NODE_SIGNATURE]: {
79
- 'Invalid leaf node signature': e => new conversation_1.MLSInvalidLeafNodeSignatureError('Invalid leaf node signature', e.label, e.code),
80
- },
81
- [_1.BackendErrorLabel.MLS_INVALID_LEAF_NODE_INDEX]: {
82
- 'Invalid leaf node index': e => new conversation_1.MLSInvalidLeafNodeIndexError('Invalid leaf node index', e.label, e.code),
83
- },
111
+ [_1.BackendErrorLabel.INVALID_OPERATION]: {
112
+ [MESSAGE_INVALID_OPERATION_FOR_ONE_TO_ONE]: e => new conversation_1.ConversationOperationError('Cannot leave 1:1 conversation.', e.label, e.code),
84
113
  },
85
- [http_status_codes_1.StatusCodes.FORBIDDEN]: {
86
- [_1.BackendErrorLabel.INVALID_CREDENTIALS]: {
87
- 'Invalid zauth token': e => new auth_1.InvalidTokenError('Authentication failed because the token is invalid.', e.label, e.code),
88
- 'Invalid token': e => new auth_1.InvalidTokenError('Authentication failed because the token is invalid.', e.label, e.code),
89
- 'Authentication failed.': e => new auth_1.InvalidCredentialsError('Authentication failed because of invalid credentials.', e.label, e.code),
90
- 'Missing cookie': e => new auth_1.MissingCookieError('Authentication failed because the cookie is missing.', e.label, e.code),
91
- 'Token expired': e => new auth_1.TokenExpiredError('Authentication failed because the token is expired.', e.label, e.code),
92
- 'Missing cookie and token': e => new auth_1.MissingCookieAndTokenError('Authentication failed because both cookie and token are missing.', e.label, e.code),
93
- },
94
- [_1.BackendErrorLabel.INVALID_OPERATION]: {
95
- 'invalid operation for 1:1 conversations': e => new conversation_1.ConversationOperationError('Cannot leave 1:1 conversation.', e.label, e.code),
96
- },
97
- [_1.BackendErrorLabel.CLIENT_ERROR]: {
98
- 'Failed reading: Invalid zauth token': e => new auth_1.InvalidTokenError('Authentication failed because the token is invalid.', e.label, e.code),
99
- },
114
+ [_1.BackendErrorLabel.CLIENT_ERROR]: {
115
+ [MESSAGE_FAILED_READING_INVALID_ZAUTH_TOKEN]: e => new auth_1.InvalidTokenError('Authentication failed because the token is invalid.', e.label, e.code),
100
116
  },
101
- };
102
- static logUnmapped(error, reason) {
103
- if (process.env.NODE_ENV === 'development') {
104
- console.warn('[BackendErrorMapper] Unmapped error:', {
105
- code: error.code,
106
- label: error.label,
107
- message: error.message,
108
- reason,
109
- });
117
+ },
118
+ };
119
+ function isMlsGroupOutOfSyncError(error) {
120
+ return (error.code === http_status_codes_1.StatusCodes.CONFLICT &&
121
+ error.label === _1.BackendErrorLabel.MLS_GROUP_OUT_OF_SYNC &&
122
+ 'missing_users' in error);
123
+ }
124
+ /**
125
+ * Map a BackendError to a more specific error instance based on its code, label, and message.
126
+ */
127
+ function mapBackendError(error) {
128
+ const code = Number(error.code);
129
+ const label = error.label;
130
+ const message = (error.message ?? '').trim();
131
+ // Special-case: MLS group out of sync (structural field-based)
132
+ if (isMlsGroupOutOfSyncError(error)) {
133
+ return new conversation_1.MLSGroupOutOfSyncError(error.code, error.missing_users, error.message);
134
+ }
135
+ // Consolidated handling for common "invalid token" variants
136
+ if (code === http_status_codes_1.StatusCodes.FORBIDDEN) {
137
+ if ((label === _1.BackendErrorLabel.INVALID_CREDENTIALS || label === _1.BackendErrorLabel.CLIENT_ERROR) &&
138
+ INVALID_TOKEN_MESSAGES.has(message)) {
139
+ return new auth_1.InvalidTokenError('Authentication failed because the token is invalid.', label, code);
110
140
  }
111
141
  }
112
- static isMlsGroupOutOfSyncError(error) {
113
- return (error.code === http_status_codes_1.StatusCodes.CONFLICT &&
114
- error.label === _1.BackendErrorLabel.MLS_GROUP_OUT_OF_SYNC &&
115
- 'missing_users' in error);
142
+ // 1) Message-specific variant
143
+ const messageVariantHandler = messageVariantHandlers[code]?.[label]?.[message];
144
+ if (messageVariantHandler) {
145
+ const mapped = messageVariantHandler({ ...error, label });
146
+ logger.info('Mapped backend error with message variant', { error, mapped });
147
+ return mapped;
116
148
  }
117
- static map(error) {
118
- const code = Number(error.code);
119
- const label = error.label;
120
- const message = error.message ?? '';
121
- if (BackendErrorMapper.isMlsGroupOutOfSyncError(error)) {
122
- return new conversation_1.MLSGroupOutOfSyncError(error.code, error.missing_users, error.message);
123
- }
124
- // 1) Message-specific variant
125
- const messageVariantHandler = BackendErrorMapper.messageVariantHandlers[code]?.[label]?.[message];
126
- if (messageVariantHandler) {
127
- return messageVariantHandler(error);
128
- }
129
- // 2) Default fallback for this (code,label)
130
- const fallbackHandler = BackendErrorMapper.defaultHandlers[code]?.[label];
131
- if (fallbackHandler) {
132
- return fallbackHandler(error);
133
- }
134
- // 3) Unknown (code,label) — keep original but log in dev
135
- this.logUnmapped(error, 'No mapping for code+label (+message)');
136
- return error;
149
+ // 2) Default fallback for this (code,label)
150
+ const fallbackHandler = defaultHandlers[code]?.[label];
151
+ if (fallbackHandler) {
152
+ const mapped = fallbackHandler({ ...error, label });
153
+ logger.info('Mapped backend error with default handler', { error, mapped });
154
+ return mapped;
137
155
  }
156
+ // 3) Unknown (code,label) — keep original but log in dev
157
+ logger.warn('Failed to map backend error; returning original', { error });
158
+ return error;
138
159
  }
139
- exports.BackendErrorMapper = BackendErrorMapper;
@@ -1 +1 @@
1
- {"version":3,"file":"HttpClient.d.ts","sourceRoot":"","sources":["../../src/http/HttpClient.ts"],"names":[],"mappings":"AAmBA,OAAc,EAAC,UAAU,EAAgB,aAAa,EAAE,kBAAkB,EAAE,aAAa,EAAC,MAAM,OAAO,CAAC;AAKxG,OAAO,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAC;AAKpC,OAAO,EACL,eAAe,EACf,gBAAgB,EAEhB,iBAAiB,EAEjB,kBAAkB,EAEnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,YAAY,EAAsB,eAAe,EAA0B,MAAM,UAAU,CAAC;AAIpG,aAAK,KAAK;IACR,0BAA0B,gDAAgD;IAC1E,gBAAgB,sCAAsC;CACvD;AAED,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,0BAA0B,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,GAAG,IAAI,CAAC;IAE9F,EAAE,CAAC,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OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;CAO7B"}
@@ -170,7 +170,7 @@ class HttpClient extends events_1.EventEmitter {
170
170
  return retryWithTokenRefresh();
171
171
  }
172
172
  if (HttpClient.isBackendError(error)) {
173
- const mappedError = http_1.BackendErrorMapper.map(new http_1.BackendError(error.response.data.message, error.response.data.label, error.response.data.code));
173
+ const mappedError = (0, http_1.mapBackendError)(new http_1.BackendError(error.response.data.message, error.response.data.label, error.response.data.code));
174
174
  const isUnauthorized = mappedError.code === http_1.StatusCode.UNAUTHORIZED;
175
175
  const isExpiredTokenError = mappedError instanceof auth_1.TokenExpiredError;
176
176
  if ((isExpiredTokenError || isUnauthorized) && hasAccessToken && isFirstTry) {
package/package.json CHANGED
@@ -70,6 +70,6 @@
70
70
  "watch": "webpack serve --config webpack.browser.js",
71
71
  "prepare": "yarn dist"
72
72
  },
73
- "version": "27.89.0",
74
- "gitHead": "d82b189adc3ec421665351f9c410cb7b0623a25e"
73
+ "version": "27.89.2",
74
+ "gitHead": "e35d6c6badad9836f2d6909a9c4780a0a89451b5"
75
75
  }