@allgemein/http 1.4.1 → 1.5.0
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/adapters/http/got/HttpGotAdapter.d.ts +17 -10
- package/adapters/http/got/HttpGotAdapter.js +48 -28
- package/adapters/http/got/HttpGotAdapter.js.map +1 -1
- package/adapters/http/got/IHttpGotPromise.d.ts +1 -1
- package/adapters/http/got/IHttpGotPromise.js +1 -2
- package/browser.d.ts +12 -12
- package/browser.js +12 -28
- package/browser.js.map +1 -1
- package/index.d.ts +14 -14
- package/index.js +14 -30
- package/index.js.map +1 -1
- package/libs/Constants.js +1 -2
- package/libs/errors/RequestError.js +1 -5
- package/libs/errors/RequestError.js.map +1 -1
- package/libs/errors/TimeoutError.js +1 -5
- package/libs/errors/TimeoutError.js.map +1 -1
- package/libs/http/HttpFactory.d.ts +2 -2
- package/libs/http/HttpFactory.js +7 -11
- package/libs/http/HttpFactory.js.map +1 -1
- package/libs/http/IHttp.d.ts +8 -8
- package/libs/http/IHttp.js +1 -4
- package/libs/http/IHttp.js.map +1 -1
- package/libs/http/IHttpDeleteOptions.d.ts +1 -1
- package/libs/http/IHttpDeleteOptions.js +1 -2
- package/libs/http/IHttpGetOptions.d.ts +1 -1
- package/libs/http/IHttpGetOptions.js +1 -2
- package/libs/http/IHttpHeadOptions.d.ts +1 -1
- package/libs/http/IHttpHeadOptions.js +1 -2
- package/libs/http/IHttpOptions.js +1 -2
- package/libs/http/IHttpPatchOptions.d.ts +1 -1
- package/libs/http/IHttpPatchOptions.js +1 -2
- package/libs/http/IHttpPostOptions.d.ts +1 -1
- package/libs/http/IHttpPostOptions.js +1 -2
- package/libs/http/IHttpPutOptions.d.ts +1 -1
- package/libs/http/IHttpPutOptions.js +1 -2
- package/libs/http/IHttpResponse.js +1 -2
- package/libs/http/IHttpStreamOptions.d.ts +1 -1
- package/libs/http/IHttpStreamOptions.js +1 -2
- package/package.json +3 -2
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
import { ILoggerApi } from '@allgemein/logging';
|
|
2
|
-
import { IHttp } from '../../../libs/http/IHttp';
|
|
3
|
-
import { IHttpGetOptions } from '../../../libs/http/IHttpGetOptions';
|
|
4
|
-
import { IHttpDeleteOptions } from '../../../libs/http/IHttpDeleteOptions';
|
|
5
|
-
import { IHttpPostOptions } from '../../../libs/http/IHttpPostOptions';
|
|
6
|
-
import { IHttpPutOptions } from '../../../libs/http/IHttpPutOptions';
|
|
7
|
-
import { IHttpHeadOptions } from '../../../libs/http/IHttpHeadOptions';
|
|
8
|
-
import { IHttpPatchOptions } from '../../../libs/http/IHttpPatchOptions';
|
|
9
|
-
import { IHttpGotPromise } from './IHttpGotPromise';
|
|
10
|
-
import { IHttpStream } from '../../../libs/http/IHttpResponse';
|
|
11
|
-
import { ClassType } from '../../../libs/Constants';
|
|
2
|
+
import { IHttp } from '../../../libs/http/IHttp.js';
|
|
3
|
+
import { IHttpGetOptions } from '../../../libs/http/IHttpGetOptions.js';
|
|
4
|
+
import { IHttpDeleteOptions } from '../../../libs/http/IHttpDeleteOptions.js';
|
|
5
|
+
import { IHttpPostOptions } from '../../../libs/http/IHttpPostOptions.js';
|
|
6
|
+
import { IHttpPutOptions } from '../../../libs/http/IHttpPutOptions.js';
|
|
7
|
+
import { IHttpHeadOptions } from '../../../libs/http/IHttpHeadOptions.js';
|
|
8
|
+
import { IHttpPatchOptions } from '../../../libs/http/IHttpPatchOptions.js';
|
|
9
|
+
import { IHttpGotPromise } from './IHttpGotPromise.js';
|
|
10
|
+
import { IHttpStream } from '../../../libs/http/IHttpResponse.js';
|
|
11
|
+
import { ClassType } from '../../../libs/Constants.js';
|
|
12
12
|
export declare class HttpGotAdapter implements IHttp {
|
|
13
13
|
static GOT: any;
|
|
14
14
|
static ProxyAgent: ClassType<any>;
|
|
15
15
|
readonly name: string;
|
|
16
16
|
private static wrap;
|
|
17
|
+
/**
|
|
18
|
+
* Workaround for got 11 on newer Node.js versions (>= 24.20): ClientRequest.end() now passes socket errors
|
|
19
|
+
* to its callback, which got forwards unwrapped from Request._final. The promise then rejects with the raw
|
|
20
|
+
* error (e.g. ERR_SOCKET_CLOSED_BEFORE_CONNECTION) and got's own RequestError / TimeoutError is emitted
|
|
21
|
+
* later without listener. The error is already handled by got's request 'error' listener, so ignore it here.
|
|
22
|
+
*/
|
|
23
|
+
private static patchGotFinal;
|
|
17
24
|
isAvailable(logger?: ILoggerApi): boolean;
|
|
18
25
|
get(url: string, options?: IHttpGetOptions): IHttpGotPromise<any>;
|
|
19
26
|
get(url: string, options?: IHttpGetOptions & {
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
class HttpGotAdapter {
|
|
1
|
+
import { URL } from 'url';
|
|
2
|
+
import { JsonUtils } from '@allgemein/base/utils/JsonUtils.js';
|
|
3
|
+
import { RequestError } from '../../../libs/errors/RequestError.js';
|
|
4
|
+
import { TimeoutError } from '../../../libs/errors/TimeoutError.js';
|
|
5
|
+
import { createRequire } from 'node:module';
|
|
6
|
+
import { assign, get, has, isObjectLike } from "@allgemein/base";
|
|
7
|
+
const _require = createRequire(import.meta.url);
|
|
8
|
+
export class HttpGotAdapter {
|
|
10
9
|
constructor() {
|
|
11
10
|
this.name = 'got';
|
|
12
11
|
}
|
|
13
12
|
static wrap(url, method, options) {
|
|
14
13
|
const GOT = this.GOT;
|
|
15
|
-
if (
|
|
16
|
-
options.resolveBodyOnly =
|
|
14
|
+
if (has(options, 'passBody')) {
|
|
15
|
+
options.resolveBodyOnly = get(options, 'passBody', false);
|
|
17
16
|
}
|
|
18
|
-
if (
|
|
17
|
+
if (has(options, 'proxy') && options.proxy && HttpGotAdapter.ProxyAgent) {
|
|
19
18
|
const proxyHeaders = options.proxyHeaders || {};
|
|
20
|
-
const proxyUrl = new
|
|
19
|
+
const proxyUrl = new URL(options.proxy);
|
|
21
20
|
const hostName = proxyUrl.hostname;
|
|
22
21
|
const port = parseInt(proxyUrl.port, 0);
|
|
23
22
|
const tunnelOptions = {
|
|
@@ -26,17 +25,17 @@ class HttpGotAdapter {
|
|
|
26
25
|
port: port,
|
|
27
26
|
headers: proxyHeaders
|
|
28
27
|
};
|
|
29
|
-
if (
|
|
28
|
+
if (has(options, 'rejectUnauthorized')) {
|
|
30
29
|
tunnelOptions.rejectUnauthorized = options.rejectUnauthorized;
|
|
31
30
|
}
|
|
32
31
|
const agent = new HttpGotAdapter.ProxyAgent(tunnelOptions);
|
|
33
|
-
|
|
34
|
-
options.agent
|
|
32
|
+
// proxy agent handles http and https targets, so register it for both
|
|
33
|
+
options.agent = { http: agent, https: agent };
|
|
35
34
|
}
|
|
36
|
-
else if (
|
|
35
|
+
else if (has(options, 'proxy') && options.proxy && !HttpGotAdapter.ProxyAgent) {
|
|
37
36
|
throw new Error('proxy agent not imported');
|
|
38
37
|
}
|
|
39
|
-
if (
|
|
38
|
+
if (has(options, 'stream') && get(options, 'stream', false)) {
|
|
40
39
|
const stream = GOT.stream(url, options);
|
|
41
40
|
stream._ended = false;
|
|
42
41
|
stream.once('response', (res) => {
|
|
@@ -62,8 +61,8 @@ class HttpGotAdapter {
|
|
|
62
61
|
};
|
|
63
62
|
return stream;
|
|
64
63
|
}
|
|
65
|
-
if (
|
|
66
|
-
options['body'] =
|
|
64
|
+
if (has(options, 'body') && isObjectLike(options['body'])) {
|
|
65
|
+
options['body'] = JsonUtils.stringify(options['body']);
|
|
67
66
|
}
|
|
68
67
|
let p = null;
|
|
69
68
|
if (options) {
|
|
@@ -72,7 +71,7 @@ class HttpGotAdapter {
|
|
|
72
71
|
else {
|
|
73
72
|
p = GOT[method](url);
|
|
74
73
|
}
|
|
75
|
-
if (
|
|
74
|
+
if (get(options, 'passBody', false)) {
|
|
76
75
|
p = p.then((res) => {
|
|
77
76
|
if (options.responseType === 'json') {
|
|
78
77
|
return res;
|
|
@@ -82,24 +81,46 @@ class HttpGotAdapter {
|
|
|
82
81
|
}
|
|
83
82
|
return p.catch((err) => {
|
|
84
83
|
if (err.name === 'RequestError') {
|
|
85
|
-
const e = new
|
|
86
|
-
|
|
84
|
+
const e = new RequestError(err.message);
|
|
85
|
+
assign(e, err);
|
|
87
86
|
throw e;
|
|
88
87
|
}
|
|
89
88
|
else if (err.name === 'TimeoutError') {
|
|
90
|
-
const e = new
|
|
91
|
-
|
|
89
|
+
const e = new TimeoutError(err.message);
|
|
90
|
+
assign(e, err);
|
|
92
91
|
throw e;
|
|
93
92
|
}
|
|
94
93
|
throw err;
|
|
95
94
|
});
|
|
96
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Workaround for got 11 on newer Node.js versions (>= 24.20): ClientRequest.end() now passes socket errors
|
|
98
|
+
* to its callback, which got forwards unwrapped from Request._final. The promise then rejects with the raw
|
|
99
|
+
* error (e.g. ERR_SOCKET_CLOSED_BEFORE_CONNECTION) and got's own RequestError / TimeoutError is emitted
|
|
100
|
+
* later without listener. The error is already handled by got's request 'error' listener, so ignore it here.
|
|
101
|
+
*/
|
|
102
|
+
static patchGotFinal() {
|
|
103
|
+
try {
|
|
104
|
+
const Request = _require('got/dist/source/core/index.js').default;
|
|
105
|
+
if (!Request || Request.prototype.__allgemeinFinalPatched) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const _final = Request.prototype._final;
|
|
109
|
+
Request.prototype._final = function (callback) {
|
|
110
|
+
return _final.call(this, () => callback());
|
|
111
|
+
};
|
|
112
|
+
Request.prototype.__allgemeinFinalPatched = true;
|
|
113
|
+
}
|
|
114
|
+
catch (e) {
|
|
115
|
+
}
|
|
116
|
+
}
|
|
97
117
|
isAvailable(logger) {
|
|
98
118
|
try {
|
|
99
119
|
if (!HttpGotAdapter.GOT) {
|
|
100
|
-
HttpGotAdapter.GOT =
|
|
120
|
+
HttpGotAdapter.GOT = _require('got');
|
|
121
|
+
HttpGotAdapter.patchGotFinal();
|
|
101
122
|
try {
|
|
102
|
-
HttpGotAdapter.ProxyAgent =
|
|
123
|
+
HttpGotAdapter.ProxyAgent = _require('proxy-agent');
|
|
103
124
|
}
|
|
104
125
|
catch (e) {
|
|
105
126
|
if (logger) {
|
|
@@ -135,5 +156,4 @@ class HttpGotAdapter {
|
|
|
135
156
|
return HttpGotAdapter.wrap(url, 'patch', options);
|
|
136
157
|
}
|
|
137
158
|
}
|
|
138
|
-
exports.HttpGotAdapter = HttpGotAdapter;
|
|
139
159
|
//# sourceMappingURL=HttpGotAdapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpGotAdapter.js","sourceRoot":"","sources":["../../../../../src/adapters/http/got/HttpGotAdapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HttpGotAdapter.js","sourceRoot":"","sources":["../../../../../src/adapters/http/got/HttpGotAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAExB,OAAO,EAAC,SAAS,EAAC,MAAM,oCAAoC,CAAC;AAW7D,OAAO,EAAC,YAAY,EAAC,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAC,YAAY,EAAC,MAAM,sCAAsC,CAAC;AAElE,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE/D,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAGhD,MAAM,OAAO,cAAc;IAA3B;QAMW,SAAI,GAAW,KAAK,CAAC;IAwLhC,CAAC;IArLS,MAAM,CAAC,IAAI,CAAC,GAAW,EAAE,MAAc,EAAE,OAA2B;QAC1E,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QAErB,IAAI,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC;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E,OAAO,CAAC,CAAC;IACnD,CAAC;IAKD,GAAG,CAAC,GAAW,EAAE,OAA+C;QAC9D,OAAO,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAKD,MAAM,CAAC,GAAW,EAAE,OAAkD;QACpE,OAAO,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAKD,IAAI,CAAC,GAAW,EAAE,OAAgD;QAChE,OAAO,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAKD,KAAK,CAAC,GAAW,EAAE,OAAiD;QAClE,OAAO,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;CAEF"}
|
package/browser.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export * from './adapters/http/got/IHttpGotPromise';
|
|
2
|
-
export * from './libs/errors/RequestError';
|
|
3
|
-
export * from './libs/errors/TimeoutError';
|
|
4
|
-
export * from './libs/http/IHttp';
|
|
5
|
-
export * from './libs/http/IHttpDeleteOptions';
|
|
6
|
-
export * from './libs/http/IHttpGetOptions';
|
|
7
|
-
export * from './libs/http/IHttpHeadOptions';
|
|
8
|
-
export * from './libs/http/IHttpOptions';
|
|
9
|
-
export * from './libs/http/IHttpPatchOptions';
|
|
10
|
-
export * from './libs/http/IHttpPostOptions';
|
|
11
|
-
export * from './libs/http/IHttpPutOptions';
|
|
12
|
-
export * from './libs/http/IHttpResponse';
|
|
1
|
+
export * from './adapters/http/got/IHttpGotPromise.js';
|
|
2
|
+
export * from './libs/errors/RequestError.js';
|
|
3
|
+
export * from './libs/errors/TimeoutError.js';
|
|
4
|
+
export * from './libs/http/IHttp.js';
|
|
5
|
+
export * from './libs/http/IHttpDeleteOptions.js';
|
|
6
|
+
export * from './libs/http/IHttpGetOptions.js';
|
|
7
|
+
export * from './libs/http/IHttpHeadOptions.js';
|
|
8
|
+
export * from './libs/http/IHttpOptions.js';
|
|
9
|
+
export * from './libs/http/IHttpPatchOptions.js';
|
|
10
|
+
export * from './libs/http/IHttpPostOptions.js';
|
|
11
|
+
export * from './libs/http/IHttpPutOptions.js';
|
|
12
|
+
export * from './libs/http/IHttpResponse.js';
|
package/browser.js
CHANGED
|
@@ -1,29 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./adapters/http/got/IHttpGotPromise"), exports);
|
|
18
|
-
__exportStar(require("./libs/errors/RequestError"), exports);
|
|
19
|
-
__exportStar(require("./libs/errors/TimeoutError"), exports);
|
|
20
|
-
__exportStar(require("./libs/http/IHttp"), exports);
|
|
21
|
-
__exportStar(require("./libs/http/IHttpDeleteOptions"), exports);
|
|
22
|
-
__exportStar(require("./libs/http/IHttpGetOptions"), exports);
|
|
23
|
-
__exportStar(require("./libs/http/IHttpHeadOptions"), exports);
|
|
24
|
-
__exportStar(require("./libs/http/IHttpOptions"), exports);
|
|
25
|
-
__exportStar(require("./libs/http/IHttpPatchOptions"), exports);
|
|
26
|
-
__exportStar(require("./libs/http/IHttpPostOptions"), exports);
|
|
27
|
-
__exportStar(require("./libs/http/IHttpPutOptions"), exports);
|
|
28
|
-
__exportStar(require("./libs/http/IHttpResponse"), exports);
|
|
1
|
+
export * from './adapters/http/got/IHttpGotPromise.js';
|
|
2
|
+
export * from './libs/errors/RequestError.js';
|
|
3
|
+
export * from './libs/errors/TimeoutError.js';
|
|
4
|
+
export * from './libs/http/IHttp.js';
|
|
5
|
+
export * from './libs/http/IHttpDeleteOptions.js';
|
|
6
|
+
export * from './libs/http/IHttpGetOptions.js';
|
|
7
|
+
export * from './libs/http/IHttpHeadOptions.js';
|
|
8
|
+
export * from './libs/http/IHttpOptions.js';
|
|
9
|
+
export * from './libs/http/IHttpPatchOptions.js';
|
|
10
|
+
export * from './libs/http/IHttpPostOptions.js';
|
|
11
|
+
export * from './libs/http/IHttpPutOptions.js';
|
|
12
|
+
export * from './libs/http/IHttpResponse.js';
|
|
29
13
|
//# sourceMappingURL=browser.js.map
|
package/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC;AACvD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC"}
|
package/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export * from './adapters/http/got/HttpGotAdapter';
|
|
2
|
-
export * from './adapters/http/got/IHttpGotPromise';
|
|
3
|
-
export * from './libs/errors/RequestError';
|
|
4
|
-
export * from './libs/errors/TimeoutError';
|
|
5
|
-
export * from './libs/http/HttpFactory';
|
|
6
|
-
export * from './libs/http/IHttp';
|
|
7
|
-
export * from './libs/http/IHttpDeleteOptions';
|
|
8
|
-
export * from './libs/http/IHttpGetOptions';
|
|
9
|
-
export * from './libs/http/IHttpHeadOptions';
|
|
10
|
-
export * from './libs/http/IHttpOptions';
|
|
11
|
-
export * from './libs/http/IHttpPatchOptions';
|
|
12
|
-
export * from './libs/http/IHttpPostOptions';
|
|
13
|
-
export * from './libs/http/IHttpPutOptions';
|
|
14
|
-
export * from './libs/http/IHttpResponse';
|
|
1
|
+
export * from './adapters/http/got/HttpGotAdapter.js';
|
|
2
|
+
export * from './adapters/http/got/IHttpGotPromise.js';
|
|
3
|
+
export * from './libs/errors/RequestError.js';
|
|
4
|
+
export * from './libs/errors/TimeoutError.js';
|
|
5
|
+
export * from './libs/http/HttpFactory.js';
|
|
6
|
+
export * from './libs/http/IHttp.js';
|
|
7
|
+
export * from './libs/http/IHttpDeleteOptions.js';
|
|
8
|
+
export * from './libs/http/IHttpGetOptions.js';
|
|
9
|
+
export * from './libs/http/IHttpHeadOptions.js';
|
|
10
|
+
export * from './libs/http/IHttpOptions.js';
|
|
11
|
+
export * from './libs/http/IHttpPatchOptions.js';
|
|
12
|
+
export * from './libs/http/IHttpPostOptions.js';
|
|
13
|
+
export * from './libs/http/IHttpPutOptions.js';
|
|
14
|
+
export * from './libs/http/IHttpResponse.js';
|
package/index.js
CHANGED
|
@@ -1,31 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./adapters/http/got/HttpGotAdapter"), exports);
|
|
18
|
-
__exportStar(require("./adapters/http/got/IHttpGotPromise"), exports);
|
|
19
|
-
__exportStar(require("./libs/errors/RequestError"), exports);
|
|
20
|
-
__exportStar(require("./libs/errors/TimeoutError"), exports);
|
|
21
|
-
__exportStar(require("./libs/http/HttpFactory"), exports);
|
|
22
|
-
__exportStar(require("./libs/http/IHttp"), exports);
|
|
23
|
-
__exportStar(require("./libs/http/IHttpDeleteOptions"), exports);
|
|
24
|
-
__exportStar(require("./libs/http/IHttpGetOptions"), exports);
|
|
25
|
-
__exportStar(require("./libs/http/IHttpHeadOptions"), exports);
|
|
26
|
-
__exportStar(require("./libs/http/IHttpOptions"), exports);
|
|
27
|
-
__exportStar(require("./libs/http/IHttpPatchOptions"), exports);
|
|
28
|
-
__exportStar(require("./libs/http/IHttpPostOptions"), exports);
|
|
29
|
-
__exportStar(require("./libs/http/IHttpPutOptions"), exports);
|
|
30
|
-
__exportStar(require("./libs/http/IHttpResponse"), exports);
|
|
1
|
+
export * from './adapters/http/got/HttpGotAdapter.js';
|
|
2
|
+
export * from './adapters/http/got/IHttpGotPromise.js';
|
|
3
|
+
export * from './libs/errors/RequestError.js';
|
|
4
|
+
export * from './libs/errors/TimeoutError.js';
|
|
5
|
+
export * from './libs/http/HttpFactory.js';
|
|
6
|
+
export * from './libs/http/IHttp.js';
|
|
7
|
+
export * from './libs/http/IHttpDeleteOptions.js';
|
|
8
|
+
export * from './libs/http/IHttpGetOptions.js';
|
|
9
|
+
export * from './libs/http/IHttpHeadOptions.js';
|
|
10
|
+
export * from './libs/http/IHttpOptions.js';
|
|
11
|
+
export * from './libs/http/IHttpPatchOptions.js';
|
|
12
|
+
export * from './libs/http/IHttpPostOptions.js';
|
|
13
|
+
export * from './libs/http/IHttpPutOptions.js';
|
|
14
|
+
export * from './libs/http/IHttpResponse.js';
|
|
31
15
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC"}
|
package/libs/Constants.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RequestError = void 0;
|
|
4
|
-
class RequestError extends Error {
|
|
1
|
+
export class RequestError extends Error {
|
|
5
2
|
constructor(message) {
|
|
6
3
|
super(message);
|
|
7
4
|
Object.setPrototypeOf(this, RequestError.prototype);
|
|
8
5
|
}
|
|
9
6
|
}
|
|
10
|
-
exports.RequestError = RequestError;
|
|
11
7
|
//# sourceMappingURL=RequestError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestError.js","sourceRoot":"","sources":["../../../../src/libs/errors/RequestError.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestError.js","sourceRoot":"","sources":["../../../../src/libs/errors/RequestError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,YAAa,SAAQ,KAAK;IAErC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACtD,CAAC;CAEF"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TimeoutError = void 0;
|
|
4
|
-
class TimeoutError extends Error {
|
|
1
|
+
export class TimeoutError extends Error {
|
|
5
2
|
constructor(message) {
|
|
6
3
|
super(message);
|
|
7
4
|
Object.setPrototypeOf(this, TimeoutError.prototype);
|
|
8
5
|
}
|
|
9
6
|
}
|
|
10
|
-
exports.TimeoutError = TimeoutError;
|
|
11
7
|
//# sourceMappingURL=TimeoutError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeoutError.js","sourceRoot":"","sources":["../../../../src/libs/errors/TimeoutError.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TimeoutError.js","sourceRoot":"","sources":["../../../../src/libs/errors/TimeoutError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,YAAa,SAAQ,KAAK;IAErC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACtD,CAAC;CAEF"}
|
package/libs/http/HttpFactory.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const HttpGotAdapter_1 = require("../../adapters/http/got/HttpGotAdapter");
|
|
5
|
-
const lodash_1 = require("lodash");
|
|
6
|
-
class HttpFactory {
|
|
1
|
+
import { HttpGotAdapter } from '../../adapters/http/got/HttpGotAdapter.js';
|
|
2
|
+
import { has } from "@allgemein/base";
|
|
3
|
+
export class HttpFactory {
|
|
7
4
|
constructor() {
|
|
8
5
|
this.adapters = {};
|
|
9
6
|
}
|
|
@@ -44,7 +41,7 @@ class HttpFactory {
|
|
|
44
41
|
register(clazz) {
|
|
45
42
|
const adapter = Reflect.construct(clazz, []);
|
|
46
43
|
if (adapter) {
|
|
47
|
-
if (!
|
|
44
|
+
if (!has(this.adapters, adapter.name) && adapter.isAvailable()) {
|
|
48
45
|
if (Object.keys(this.adapters).length === 0) {
|
|
49
46
|
this.defaultAdapter = adapter.name;
|
|
50
47
|
}
|
|
@@ -60,7 +57,7 @@ class HttpFactory {
|
|
|
60
57
|
* @param name
|
|
61
58
|
*/
|
|
62
59
|
setDefault(name) {
|
|
63
|
-
if (
|
|
60
|
+
if (has(this.adapters, name)) {
|
|
64
61
|
this.defaultAdapter = name;
|
|
65
62
|
return true;
|
|
66
63
|
}
|
|
@@ -84,7 +81,7 @@ class HttpFactory {
|
|
|
84
81
|
if (!name) {
|
|
85
82
|
throw new Error('http factory: no default adapter defined. ' + Object.keys(this.adapters));
|
|
86
83
|
}
|
|
87
|
-
if (
|
|
84
|
+
if (has(this.adapters, name)) {
|
|
88
85
|
return Reflect.construct(this.adapters[name], []);
|
|
89
86
|
}
|
|
90
87
|
else {
|
|
@@ -92,7 +89,6 @@ class HttpFactory {
|
|
|
92
89
|
}
|
|
93
90
|
}
|
|
94
91
|
}
|
|
95
|
-
|
|
96
|
-
HttpFactory.CLASSES = [HttpGotAdapter_1.HttpGotAdapter];
|
|
92
|
+
HttpFactory.CLASSES = [HttpGotAdapter];
|
|
97
93
|
HttpFactory.__loaded__ = false;
|
|
98
94
|
//# sourceMappingURL=HttpFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpFactory.js","sourceRoot":"","sources":["../../../../src/libs/http/HttpFactory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HttpFactory.js","sourceRoot":"","sources":["../../../../src/libs/http/HttpFactory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,cAAc,EAAC,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAGpC,MAAM,OAAO,WAAW;IAAxB;QAQU,aAAQ,GAAwC,EAAE,CAAC;IAgG7D,CAAC;IA1FC;;OAEG;IACH,MAAM,CAAC,CAAC;QACN,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;QACpC,CAAC;QACD,OAAO,IAAI,CAAC,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AAc,GAAG,IAAI,CAAC;YAC3B,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,OAAe,IAAI;QACxB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC;QAC7B,CAAC;QACD,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,4CAA4C,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC7F,CAAC;QAED,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC;YAC7B,OAAO,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QACpD,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,iCAAiC,GAAG,IAAI,GAAG,YAAY,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC;;AAnGM,mBAAO,GAAuB,CAAC,cAAc,CAAC,AAAvC,CAAwC;AAE/C,sBAAU,GAAG,KAAK,AAAR,CAAS"}
|
package/libs/http/IHttp.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { IHttpGetOptions } from './IHttpGetOptions';
|
|
2
|
-
import { IHttpPromise, IHttpStream } from './IHttpResponse';
|
|
3
|
-
import { IHttpPostOptions } from './IHttpPostOptions';
|
|
4
|
-
import { IHttpPutOptions } from './IHttpPutOptions';
|
|
5
|
-
import { IHttpDeleteOptions } from './IHttpDeleteOptions';
|
|
6
|
-
import { IHttpHeadOptions } from './IHttpHeadOptions';
|
|
7
|
-
import { IHttpPatchOptions } from './IHttpPatchOptions';
|
|
8
|
-
import { IHttpStreamOptions } from './IHttpStreamOptions';
|
|
1
|
+
import { IHttpGetOptions } from './IHttpGetOptions.js';
|
|
2
|
+
import { IHttpPromise, IHttpStream } from './IHttpResponse.js';
|
|
3
|
+
import { IHttpPostOptions } from './IHttpPostOptions.js';
|
|
4
|
+
import { IHttpPutOptions } from './IHttpPutOptions.js';
|
|
5
|
+
import { IHttpDeleteOptions } from './IHttpDeleteOptions.js';
|
|
6
|
+
import { IHttpHeadOptions } from './IHttpHeadOptions.js';
|
|
7
|
+
import { IHttpPatchOptions } from './IHttpPatchOptions.js';
|
|
8
|
+
import { IHttpStreamOptions } from './IHttpStreamOptions.js';
|
|
9
9
|
export declare function isStream(pet: IHttpPromise<any> | IHttpStream<any>): pet is IHttpStream<any>;
|
|
10
10
|
export interface IHttp {
|
|
11
11
|
readonly name: string;
|
package/libs/http/IHttp.js
CHANGED
package/libs/http/IHttp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IHttp.js","sourceRoot":"","sources":["../../../../src/libs/http/IHttp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IHttp.js","sourceRoot":"","sources":["../../../../src/libs/http/IHttp.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,QAAQ,CAAC,GAAyC;IAChE,OAA0B,GAAI,CAAC,UAAU,KAAK,SAAS,CAAC;AAC1D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allgemein/http",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "Library for http request backend abstraction.",
|
|
5
6
|
"main": "index.js",
|
|
6
7
|
"browser": "browser.js",
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
},
|
|
25
26
|
"homepage": "https://github.com/allgemein-node/http#readme",
|
|
26
27
|
"devDependencies": {
|
|
27
|
-
"@allgemein/base": "^1.
|
|
28
|
+
"@allgemein/base": "^1.10.0",
|
|
28
29
|
"@types/got": "^9.6.11",
|
|
29
30
|
"got": "version-11",
|
|
30
31
|
"proxy-agent": "^4.0.1"
|