attlaz-client 1.5.7 → 1.5.8

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.
@@ -4,6 +4,7 @@ export declare class HttpClient {
4
4
  static HTTP_ERROR: string;
5
5
  static HTTP_BAD_REQUEST: string;
6
6
  static HTTP_UNAUTHORIZED: string;
7
+ static HTTP_FORBIDDEN: string;
7
8
  static HTTP_NOTFOUND: string;
8
9
  static HTTP_NOT_ALLOWED: string;
9
10
  static HTTP_UNPROCESSABLE_ENTITY: string;
@@ -96,6 +96,7 @@ exports.HttpClient = HttpClient;
96
96
  HttpClient.HTTP_ERROR = 'xxx';
97
97
  HttpClient.HTTP_BAD_REQUEST = '400';
98
98
  HttpClient.HTTP_UNAUTHORIZED = '401';
99
+ HttpClient.HTTP_FORBIDDEN = '403';
99
100
  HttpClient.HTTP_NOTFOUND = '404';
100
101
  HttpClient.HTTP_NOT_ALLOWED = '405';
101
102
  HttpClient.HTTP_UNPROCESSABLE_ENTITY = '422';
@@ -51,15 +51,18 @@ class ClientError {
51
51
  case 401:
52
52
  return new ClientError('Unauthorized', HttpClient_1.HttpClient.HTTP_UNAUTHORIZED);
53
53
  break;
54
- case 404:
55
- return new ClientError('Not Found', HttpClient_1.HttpClient.HTTP_NOTFOUND);
54
+ case 403:
55
+ return new ClientError('Forbidden', HttpClient_1.HttpClient.HTTP_FORBIDDEN);
56
56
  break;
57
57
  case 404:
58
- return new ClientError('Unprocessable Entity', HttpClient_1.HttpClient.HTTP_UNPROCESSABLE_ENTITY);
58
+ return new ClientError('Not Found', HttpClient_1.HttpClient.HTTP_NOTFOUND);
59
59
  break;
60
60
  case 405:
61
61
  return new ClientError('Not allowed', HttpClient_1.HttpClient.HTTP_NOT_ALLOWED);
62
62
  break;
63
+ case 422:
64
+ return new ClientError('Unprocessable Entity', HttpClient_1.HttpClient.HTTP_UNPROCESSABLE_ENTITY);
65
+ break;
63
66
  case 500:
64
67
  return new ClientError('Internal Server Error', HttpClient_1.HttpClient.HTTP_NOTFOUND);
65
68
  break;
@@ -68,7 +71,7 @@ class ClientError {
68
71
  break;
69
72
  default:
70
73
  console.error('Unknown status code "' + statusCode + '"', { code: statusCode, text: statusText });
71
- return new ClientError('Status code ' + statusCode + ': ' + statusText, HttpClient_1.HttpClient.HTTP_ERROR);
74
+ return new ClientError('Status code ' + statusCode + ': ' + statusText, statusCode.toString());
72
75
  }
73
76
  return null;
74
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.5.7",
3
+ "version": "1.5.8",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",