@wireapp/api-client 27.75.0 → 27.75.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,6 +1,7 @@
1
1
  import { BackendError } from './';
2
2
  export declare class BackendErrorMapper {
3
3
  static get ERRORS(): Record<number, Record<string, Record<string, BackendError>>>;
4
+ private static logUnmapped;
4
5
  static map(error: BackendError): BackendError;
5
6
  }
6
7
  //# sourceMappingURL=BackendErrorMapper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BackendErrorMapper.d.ts","sourceRoot":"","sources":["../../src/http/BackendErrorMapper.ts"],"names":[],"mappings":"AAiCA,OAAO,EAAC,YAAY,EAAgC,MAAM,IAAI,CAAC;AAE/D,qBAAa,kBAAkB;IAC7B,WAAkB,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAuDvF;WAEa,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY;CAYrD"}
1
+ {"version":3,"file":"BackendErrorMapper.d.ts","sourceRoot":"","sources":["../../src/http/BackendErrorMapper.ts"],"names":[],"mappings":"AAiCA,OAAO,EAAC,YAAY,EAAgC,MAAM,IAAI,CAAC;AAE/D,qBAAa,kBAAkB;IAC7B,WAAkB,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CA4DvF;IAED,OAAO,CAAC,MAAM,CAAC,WAAW;WAWZ,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY;CAarD"}
@@ -45,6 +45,9 @@ class BackendErrorMapper {
45
45
  'Token expired': new auth_1.TokenExpiredError('Authentication failed because the token is expired.'),
46
46
  'Missing cookie and token': new auth_1.MissingCookieAndTokenError('Authentication failed because the cookie and token is missing.'),
47
47
  },
48
+ [_1.BackendErrorLabel.CLIENT_ERROR]: {
49
+ 'Failed reading: Invalid zauth token': new auth_1.InvalidTokenError('Authentication failed because the token is invalid.'),
50
+ },
48
51
  [_1.BackendErrorLabel.NOT_CONNECTED]: {
49
52
  'Users are not connected': new user_1.UnconnectedUserError('Users are not connected.'),
50
53
  },
@@ -75,17 +78,28 @@ class BackendErrorMapper {
75
78
  },
76
79
  };
77
80
  }
81
+ static logUnmapped(error, reason) {
82
+ if (process.env.NODE_ENV === 'development') {
83
+ console.warn('[BackendErrorMapper] Unmapped error:', {
84
+ code: error.code,
85
+ label: error.label,
86
+ message: error.message,
87
+ reason,
88
+ });
89
+ }
90
+ }
78
91
  static map(error) {
79
92
  try {
80
93
  const mappedError = BackendErrorMapper.ERRORS[Number(error.code)][error.label][error.message];
81
94
  if (mappedError) {
82
95
  return mappedError;
83
96
  }
84
- return error;
97
+ this.logUnmapped(error, 'No matching entry found in error mapping');
85
98
  }
86
99
  catch (mappingError) {
87
- return error;
100
+ this.logUnmapped(error, 'Error mapping lookup failed with exception');
88
101
  }
102
+ return error;
89
103
  }
90
104
  }
91
105
  exports.BackendErrorMapper = BackendErrorMapper;
@@ -1,4 +1,6 @@
1
+ import { QualifiedId } from '../QualifiedId';
1
2
  export interface UserDeleteData {
2
3
  id: string;
4
+ qualified_id: QualifiedId;
3
5
  }
4
6
  //# sourceMappingURL=UserDeleteData.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserDeleteData.d.ts","sourceRoot":"","sources":["../../../src/user/data/UserDeleteData.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ"}
1
+ {"version":3,"file":"UserDeleteData.d.ts","sourceRoot":"","sources":["../../../src/user/data/UserDeleteData.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAE3C,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,WAAW,CAAC;CAC3B"}
package/package.json CHANGED
@@ -48,7 +48,7 @@
48
48
  "cross-env": "10.0.0",
49
49
  "dotenv": "17.2.1",
50
50
  "jest": "^29.2.1",
51
- "nock": "14.0.9",
51
+ "nock": "14.0.10",
52
52
  "react": "18.3.1",
53
53
  "react-dom": "18.3.1",
54
54
  "rimraf": "6.0.1",
@@ -70,6 +70,6 @@
70
70
  "watch": "webpack serve --config webpack.browser.js",
71
71
  "prepare": "yarn dist"
72
72
  },
73
- "version": "27.75.0",
74
- "gitHead": "43f8d4d1d84f31778dcb048dfb326f9d9b4f4439"
73
+ "version": "27.75.2",
74
+ "gitHead": "d1fa49fc6ef6dea7898aeb4bebcde96e55054650"
75
75
  }