camstreamerlib 3.5.1 → 3.5.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.
- package/DefaultAgent.d.ts +2 -2
- package/DefaultAgent.js +6 -5
- package/package.json +1 -1
package/DefaultAgent.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare class DefaultAgent implements IClient {
|
|
|
9
9
|
private pass;
|
|
10
10
|
private httpRequestSender;
|
|
11
11
|
constructor(opt?: HttpOptions);
|
|
12
|
-
get(path: string, parameters?: Record<string, string>, headers?: Record<string, string
|
|
13
|
-
post(path: string, data: string | Buffer | FormData, parameters?: Record<string, string>, headers?: Record<string, string
|
|
12
|
+
get(path: string, parameters?: Record<string, string>, headers?: Record<string, string>, timeout?: number): Promise<Response>;
|
|
13
|
+
post(path: string, data: string | Buffer | FormData, parameters?: Record<string, string>, headers?: Record<string, string>, timeout?: number): Promise<Response>;
|
|
14
14
|
private getBaseConnectionParams;
|
|
15
15
|
}
|
package/DefaultAgent.js
CHANGED
|
@@ -28,21 +28,21 @@ class DefaultAgent {
|
|
|
28
28
|
}
|
|
29
29
|
this.httpRequestSender = new HttpRequestSender_1.HttpRequestSender(agentOptions);
|
|
30
30
|
}
|
|
31
|
-
get(path, parameters = {}, headers) {
|
|
31
|
+
get(path, parameters = {}, headers, timeout) {
|
|
32
32
|
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const options = this.getBaseConnectionParams('GET', path, parameters);
|
|
33
|
+
const options = this.getBaseConnectionParams('GET', path, parameters, timeout);
|
|
34
34
|
options.headers = headers;
|
|
35
35
|
return this.httpRequestSender.sendRequest(options);
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
post(path, data, parameters = {}, headers) {
|
|
38
|
+
post(path, data, parameters = {}, headers, timeout) {
|
|
39
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
const options = this.getBaseConnectionParams('POST', path, parameters);
|
|
40
|
+
const options = this.getBaseConnectionParams('POST', path, parameters, timeout);
|
|
41
41
|
options.headers = headers;
|
|
42
42
|
return this.httpRequestSender.sendRequest(options, data);
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
getBaseConnectionParams(method, path, params) {
|
|
45
|
+
getBaseConnectionParams(method, path, params, timeout) {
|
|
46
46
|
if (path.indexOf('?') === -1) {
|
|
47
47
|
path += '?';
|
|
48
48
|
}
|
|
@@ -61,6 +61,7 @@ class DefaultAgent {
|
|
|
61
61
|
path: path,
|
|
62
62
|
user: this.user,
|
|
63
63
|
pass: this.pass,
|
|
64
|
+
timeout,
|
|
64
65
|
};
|
|
65
66
|
}
|
|
66
67
|
}
|