attlaz-client 1.5.8 → 1.5.9
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,14 +1,13 @@
|
|
|
1
1
|
import { HttpClientRequest } from './HttpClientRequest';
|
|
2
2
|
import { HttpClientResponse } from './HttpClientResponse';
|
|
3
3
|
export declare class HttpClient {
|
|
4
|
-
static
|
|
5
|
-
static
|
|
6
|
-
static
|
|
7
|
-
static
|
|
8
|
-
static
|
|
9
|
-
static
|
|
10
|
-
static
|
|
11
|
-
static HTTP_UNAVAILABLE: string;
|
|
4
|
+
static HTTP_BAD_REQUEST: number;
|
|
5
|
+
static HTTP_UNAUTHORIZED: number;
|
|
6
|
+
static HTTP_FORBIDDEN: number;
|
|
7
|
+
static HTTP_NOTFOUND: number;
|
|
8
|
+
static HTTP_NOT_ALLOWED: number;
|
|
9
|
+
static HTTP_UNPROCESSABLE_ENTITY: number;
|
|
10
|
+
static HTTP_UNAVAILABLE: number;
|
|
12
11
|
static get(url: string, requestData?: any): Promise<any>;
|
|
13
12
|
static request(request: HttpClientRequest): Promise<any>;
|
|
14
13
|
static request2(request: HttpClientRequest): Promise<HttpClientResponse>;
|
package/dist/Http/HttpClient.js
CHANGED
|
@@ -93,11 +93,10 @@ class HttpClient {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
exports.HttpClient = HttpClient;
|
|
96
|
-
HttpClient.
|
|
97
|
-
HttpClient.
|
|
98
|
-
HttpClient.
|
|
99
|
-
HttpClient.
|
|
100
|
-
HttpClient.
|
|
101
|
-
HttpClient.
|
|
102
|
-
HttpClient.
|
|
103
|
-
HttpClient.HTTP_UNAVAILABLE = '503';
|
|
96
|
+
HttpClient.HTTP_BAD_REQUEST = 400;
|
|
97
|
+
HttpClient.HTTP_UNAUTHORIZED = 401;
|
|
98
|
+
HttpClient.HTTP_FORBIDDEN = 403;
|
|
99
|
+
HttpClient.HTTP_NOTFOUND = 404;
|
|
100
|
+
HttpClient.HTTP_NOT_ALLOWED = 405;
|
|
101
|
+
HttpClient.HTTP_UNPROCESSABLE_ENTITY = 422;
|
|
102
|
+
HttpClient.HTTP_UNAVAILABLE = 503;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare class ClientError implements Error {
|
|
2
2
|
message: string;
|
|
3
3
|
name: string;
|
|
4
|
-
code:
|
|
4
|
+
code: number | null;
|
|
5
5
|
stack: string;
|
|
6
|
-
constructor(message: string, code?:
|
|
6
|
+
constructor(message: string, code?: number | null);
|
|
7
7
|
static fromError(error: Error | any): ClientError;
|
|
8
8
|
static byStatus(statusCode: number, statusText: string): ClientError | null;
|
|
9
9
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ClientError = void 0;
|
|
4
4
|
const HttpClient_1 = require("../../Http/HttpClient");
|
|
5
5
|
class ClientError {
|
|
6
|
-
constructor(message, code =
|
|
6
|
+
constructor(message, code = null) {
|
|
7
7
|
this.message = message;
|
|
8
8
|
this.code = code;
|
|
9
9
|
}
|
|
@@ -71,7 +71,7 @@ class ClientError {
|
|
|
71
71
|
break;
|
|
72
72
|
default:
|
|
73
73
|
console.error('Unknown status code "' + statusCode + '"', { code: statusCode, text: statusText });
|
|
74
|
-
return new ClientError('Status code ' + statusCode + ': ' + statusText, statusCode
|
|
74
|
+
return new ClientError('Status code ' + statusCode + ': ' + statusText, statusCode);
|
|
75
75
|
}
|
|
76
76
|
return null;
|
|
77
77
|
}
|