@tstdl/base 0.89.0 → 0.89.1
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/examples/api/authentication.js +1 -1
- package/examples/api/basic-overview.js +1 -1
- package/examples/api/custom-authentication.js +1 -1
- package/examples/api/streaming.js +1 -1
- package/examples/http/client.js +1 -1
- package/http/client/adapters/{undici-http-client.adapter.d.ts → undici.adapter.d.ts} +4 -2
- package/http/client/adapters/{undici-http-client.adapter.js → undici.adapter.js} +3 -15
- package/http/client/index.d.ts +0 -1
- package/http/client/index.js +0 -1
- package/package.json +2 -1
- package/http/client/adapters/index.d.ts +0 -1
- package/http/client/adapters/index.js +0 -1
|
@@ -7,7 +7,7 @@ import { AuthenticationClientService, configureAuthenticationClient } from '../.
|
|
|
7
7
|
import { AuthenticationApiController, AuthenticationService as AuthenticationServerService, configureAuthenticationServer } from '../../authentication/server/index.js';
|
|
8
8
|
import { MongoAuthenticationCredentialsRepository, configureMongoAuthenticationCredentialsRepository } from '../../authentication/server/mongo/mongo-authentication-credentials.repository.js';
|
|
9
9
|
import { MongoAuthenticationSessionRepository, configureMongoAuthenticationSessionRepository } from '../../authentication/server/mongo/mongo-authentication-session.repository.js';
|
|
10
|
-
import { configureUndiciHttpClientAdapter } from '../../http/client/adapters/undici
|
|
10
|
+
import { configureUndiciHttpClientAdapter } from '../../http/client/adapters/undici.adapter.js';
|
|
11
11
|
import { configureHttpClient } from '../../http/client/module.js';
|
|
12
12
|
import { configureNodeHttpServer } from '../../http/server/node/module.js';
|
|
13
13
|
import { inject, injectAsync } from '../../injector/inject.js';
|
|
@@ -12,7 +12,7 @@ import { compileClient } from '../../api/client/index.js';
|
|
|
12
12
|
import { defineApi } from '../../api/index.js';
|
|
13
13
|
import { apiController, configureApiServer } from '../../api/server/index.js';
|
|
14
14
|
import { Application } from '../../application/application.js';
|
|
15
|
-
import { configureUndiciHttpClientAdapter } from '../../http/client/adapters/undici
|
|
15
|
+
import { configureUndiciHttpClientAdapter } from '../../http/client/adapters/undici.adapter.js';
|
|
16
16
|
import { configureHttpClient } from '../../http/client/module.js';
|
|
17
17
|
import { configureNodeHttpServer } from '../../http/server/node/module.js';
|
|
18
18
|
import { inject } from '../../injector/inject.js';
|
|
@@ -18,7 +18,7 @@ import { AuthenticationService as AuthenticationServerService } from '../../auth
|
|
|
18
18
|
import { configureAuthenticationServer } from '../../authentication/server/module.js';
|
|
19
19
|
import { MongoAuthenticationCredentialsRepository, configureMongoAuthenticationCredentialsRepository } from '../../authentication/server/mongo/mongo-authentication-credentials.repository.js';
|
|
20
20
|
import { MongoAuthenticationSessionRepository, configureMongoAuthenticationSessionRepository } from '../../authentication/server/mongo/mongo-authentication-session.repository.js';
|
|
21
|
-
import { configureUndiciHttpClientAdapter } from '../../http/client/adapters/undici
|
|
21
|
+
import { configureUndiciHttpClientAdapter } from '../../http/client/adapters/undici.adapter.js';
|
|
22
22
|
import { configureHttpClient } from '../../http/client/module.js';
|
|
23
23
|
import { configureNodeHttpServer } from '../../http/server/node/module.js';
|
|
24
24
|
import { Singleton } from '../../injector/decorators.js';
|
|
@@ -10,7 +10,7 @@ import { defineApi } from '../../api/index.js';
|
|
|
10
10
|
import { apiController, configureApiServer } from '../../api/server/index.js';
|
|
11
11
|
import { Application } from '../../application/application.js';
|
|
12
12
|
import { CORE_LOGGER, configureTstdl, getGlobalInjector } from '../../core.js';
|
|
13
|
-
import { configureUndiciHttpClientAdapter } from '../../http/client/adapters/undici
|
|
13
|
+
import { configureUndiciHttpClientAdapter } from '../../http/client/adapters/undici.adapter.js';
|
|
14
14
|
import { configureHttpClient } from '../../http/client/module.js';
|
|
15
15
|
import { HttpServerResponse } from '../../http/server/index.js';
|
|
16
16
|
import { configureNodeHttpServer } from '../../http/server/node/index.js';
|
package/examples/http/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Application } from '../../application/application.js';
|
|
2
|
-
import { configureUndiciHttpClientAdapter } from '../../http/client/adapters/undici
|
|
2
|
+
import { configureUndiciHttpClientAdapter } from '../../http/client/adapters/undici.adapter.js';
|
|
3
3
|
import { HttpClient } from '../../http/client/index.js';
|
|
4
4
|
import { inject } from '../../injector/inject.js';
|
|
5
5
|
configureUndiciHttpClientAdapter();
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { Dispatcher } from 'undici';
|
|
2
|
+
import type { Resolvable } from '../../../injector/index.js';
|
|
3
|
+
import { resolveArgumentType } from '../../../injector/index.js';
|
|
2
4
|
import type { HttpClientRequest } from '../http-client-request.js';
|
|
3
5
|
import { HttpClientResponse } from '../http-client-response.js';
|
|
4
6
|
import { HttpClientAdapter } from '../http-client.adapter.js';
|
|
5
7
|
export type UndiciHttpClientAdapterOptions = {
|
|
6
8
|
dispatcher?: Dispatcher;
|
|
7
9
|
};
|
|
8
|
-
export declare class UndiciHttpClientAdapter extends HttpClientAdapter {
|
|
10
|
+
export declare class UndiciHttpClientAdapter extends HttpClientAdapter implements Resolvable<UndiciHttpClientAdapterOptions> {
|
|
9
11
|
private readonly options;
|
|
10
|
-
|
|
12
|
+
readonly [resolveArgumentType]: UndiciHttpClientAdapterOptions;
|
|
11
13
|
call(httpClientRequest: HttpClientRequest): Promise<HttpClientResponse>;
|
|
12
14
|
}
|
|
13
15
|
/**
|
|
@@ -4,17 +4,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
-
};
|
|
13
7
|
import { Readable } from 'node:stream';
|
|
14
8
|
import { request, errors as undiciErrors } from 'undici';
|
|
15
9
|
import { HttpHeaders } from '../../../http/http-headers.js';
|
|
16
10
|
import { HttpError, HttpErrorReason } from '../../../http/http.error.js';
|
|
17
|
-
import {
|
|
11
|
+
import { Singleton, injectArgument, resolveArgumentType } from '../../../injector/index.js';
|
|
18
12
|
import { Injector } from '../../../injector/injector.js';
|
|
19
13
|
import { toArray } from '../../../utils/array/array.js';
|
|
20
14
|
import { isDefined } from '../../../utils/type-guards.js';
|
|
@@ -22,11 +16,7 @@ import { HttpClientResponse } from '../http-client-response.js';
|
|
|
22
16
|
import { HttpClientAdapter } from '../http-client.adapter.js';
|
|
23
17
|
let defaultOptions = {};
|
|
24
18
|
let UndiciHttpClientAdapter = class UndiciHttpClientAdapter extends HttpClientAdapter {
|
|
25
|
-
options;
|
|
26
|
-
constructor(options = {}) {
|
|
27
|
-
super();
|
|
28
|
-
this.options = options;
|
|
29
|
-
}
|
|
19
|
+
options = injectArgument(this);
|
|
30
20
|
// eslint-disable-next-line max-lines-per-function, max-statements
|
|
31
21
|
async call(httpClientRequest) {
|
|
32
22
|
let body;
|
|
@@ -86,9 +76,7 @@ let UndiciHttpClientAdapter = class UndiciHttpClientAdapter extends HttpClientAd
|
|
|
86
76
|
}
|
|
87
77
|
};
|
|
88
78
|
UndiciHttpClientAdapter = __decorate([
|
|
89
|
-
Singleton({ defaultArgumentProvider: () => defaultOptions })
|
|
90
|
-
__param(0, InjectArg()),
|
|
91
|
-
__metadata("design:paramtypes", [Object])
|
|
79
|
+
Singleton({ defaultArgumentProvider: () => defaultOptions })
|
|
92
80
|
], UndiciHttpClientAdapter);
|
|
93
81
|
export { UndiciHttpClientAdapter };
|
|
94
82
|
/**
|
package/http/client/index.d.ts
CHANGED
package/http/client/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tstdl/base",
|
|
3
|
-
"version": "0.89.
|
|
3
|
+
"version": "0.89.1",
|
|
4
4
|
"author": "Patrick Hein",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"./error": "./error/index.js",
|
|
48
48
|
"./function": "./function/index.js",
|
|
49
49
|
"./http": "./http/index.js",
|
|
50
|
+
"./http/adapters/undici": "./http/client/adapters/undici.adapter.ts",
|
|
50
51
|
"./image-service": "./image-service/index.js",
|
|
51
52
|
"./injector": "./injector/index.js",
|
|
52
53
|
"./json-path": "./json-path/index.js",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './undici-http-client.adapter.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './undici-http-client.adapter.js';
|