@tstdl/base 0.88.6 → 0.89.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/api/index.d.ts +7 -3
- package/api/index.js +7 -3
- package/application/index.d.ts +5 -0
- package/application/index.js +5 -0
- package/authentication/client/authentication.service.d.ts +1 -1
- package/authentication/client/authentication.service.js +4 -4
- package/authentication/client/http-client.middleware.d.ts +2 -2
- package/authentication/client/module.d.ts +2 -2
- package/authentication/client/module.js +2 -2
- package/authentication/index.d.ts +7 -0
- package/authentication/index.js +7 -0
- package/browser/index.d.ts +5 -0
- package/browser/index.js +5 -0
- package/cancellation/index.d.ts +4 -0
- package/cancellation/index.js +4 -0
- package/collections/index.d.ts +5 -0
- package/collections/index.js +5 -0
- package/cookie/index.d.ts +5 -0
- package/cookie/index.js +5 -0
- package/data-structures/index.d.ts +5 -0
- package/data-structures/index.js +5 -0
- package/database/index.d.ts +5 -0
- package/database/index.js +5 -0
- package/database/mongo/index.d.ts +5 -0
- package/database/mongo/index.js +5 -0
- package/database/mongo/module.js +1 -1
- package/decorators/index.d.ts +5 -0
- package/decorators/index.js +5 -0
- package/disposable/index.d.ts +5 -0
- package/disposable/index.js +5 -0
- package/distributed-loop/index.d.ts +5 -0
- package/distributed-loop/index.js +5 -0
- package/enumerable/index.d.ts +5 -0
- package/enumerable/index.js +5 -0
- package/error/index.d.ts +5 -0
- package/error/index.js +5 -0
- package/examples/api/authentication.js +1 -1
- package/examples/api/custom-authentication.js +1 -1
- package/function/index.d.ts +5 -0
- package/function/index.js +5 -0
- package/http/client/index.d.ts +1 -0
- package/http/client/index.js +1 -0
- package/http/index.d.ts +6 -0
- package/http/index.js +6 -0
- package/http/server/index.d.ts +2 -1
- package/http/server/index.js +2 -1
- package/image-service/index.d.ts +6 -0
- package/image-service/index.js +6 -0
- package/index.d.ts +5 -0
- package/index.js +5 -0
- package/injector/index.d.ts +5 -0
- package/injector/index.js +5 -0
- package/json-path/index.d.ts +5 -0
- package/json-path/index.js +5 -0
- package/key-value-store/index.d.ts +6 -0
- package/key-value-store/index.js +6 -0
- package/lock/index.d.ts +7 -0
- package/lock/index.js +7 -0
- package/lock/mongo/lock.d.ts +1 -2
- package/lock/mongo/lock.js +9 -9
- package/lock/mongo/provider.d.ts +3 -7
- package/lock/mongo/provider.js +14 -24
- package/logger/index.d.ts +7 -0
- package/logger/index.js +7 -0
- package/mail/index.d.ts +6 -1
- package/mail/index.js +6 -1
- package/mail/repositories/index.d.ts +2 -1
- package/mail/repositories/index.js +2 -1
- package/memory/index.d.ts +5 -0
- package/memory/index.js +5 -0
- package/message-bus/index.d.ts +7 -0
- package/message-bus/index.js +7 -0
- package/migration/index.d.ts +6 -0
- package/migration/index.js +6 -0
- package/module/index.d.ts +6 -0
- package/module/index.js +6 -0
- package/object-storage/index.d.ts +8 -2
- package/object-storage/index.js +8 -2
- package/openid-connect/index.d.ts +5 -0
- package/openid-connect/index.js +5 -0
- package/package.json +6 -24
- package/password/index.d.ts +5 -0
- package/password/index.js +5 -0
- package/pdf/pdf.service.d.ts +5 -0
- package/pdf/pdf.service.js +5 -0
- package/pool/index.d.ts +5 -0
- package/pool/index.js +5 -0
- package/promise/cancelable-promise.d.ts +10 -2
- package/promise/cancelable-promise.js +23 -19
- package/promise/custom-promise.d.ts +6 -0
- package/promise/custom-promise.js +14 -0
- package/promise/deferred-promise.d.ts +3 -3
- package/promise/deferred-promise.js +5 -8
- package/promise/index.d.ts +6 -0
- package/promise/index.js +6 -0
- package/promise/lazy-promise.d.ts +6 -6
- package/promise/lazy-promise.js +23 -15
- package/promise/types.d.ts +3 -0
- package/promise/types.js +1 -0
- package/signals/implementation/graph.d.ts +2 -15
- package/signals/implementation/graph.js +6 -1
- package/signals/implementation/to-observable.d.ts +1 -1
- package/signals/implementation/to-observable.js +1 -1
- package/signals/implementation/watch.d.ts +6 -0
- package/signals/implementation/watch.js +25 -2
- package/signals/index.d.ts +1 -0
- package/signals/index.js +1 -0
- package/signals/to-observable-2.d.ts +8 -0
- package/signals/to-observable-2.js +9 -0
- package/signals/to-signal-2.d.ts +4 -1
- package/utils/type-guards.d.ts +6 -0
- package/utils/type-guards.js +7 -0
- package/container/decorators.d.ts +0 -2
- package/container/decorators.js +0 -1
- package/container/index.d.ts +0 -3
- package/container/index.js +0 -3
- package/container/interfaces.d.ts +0 -2
- package/container/interfaces.js +0 -1
- package/container/token.d.ts +0 -2
- package/container/token.js +0 -1
package/api/index.d.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Create and consume HTTP APIs
|
|
3
|
+
*
|
|
4
|
+
* It has built-in support for validation and error handling.
|
|
3
5
|
*
|
|
4
6
|
* This module contains types and functions to define and register apis and error handlers.
|
|
5
7
|
*
|
|
6
8
|
* Consumers of these definitions are [client](api_client.html) and [server](api_server.html).
|
|
7
9
|
*
|
|
8
|
-
*
|
|
10
|
+
* Examples can be found in `source/examples/api/`.
|
|
9
11
|
*
|
|
10
|
-
* @module
|
|
12
|
+
* @module API
|
|
11
13
|
*/
|
|
14
|
+
export * from './client/index.js';
|
|
12
15
|
export * from './default-error-handlers.js';
|
|
13
16
|
export * from './response.js';
|
|
17
|
+
export * from './server/index.js';
|
|
14
18
|
export * from './types.js';
|
package/api/index.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Create and consume HTTP APIs
|
|
3
|
+
*
|
|
4
|
+
* It has built-in support for validation and error handling.
|
|
3
5
|
*
|
|
4
6
|
* This module contains types and functions to define and register apis and error handlers.
|
|
5
7
|
*
|
|
6
8
|
* Consumers of these definitions are [client](api_client.html) and [server](api_server.html).
|
|
7
9
|
*
|
|
8
|
-
*
|
|
10
|
+
* Examples can be found in `source/examples/api/`.
|
|
9
11
|
*
|
|
10
|
-
* @module
|
|
12
|
+
* @module API
|
|
11
13
|
*/
|
|
14
|
+
export * from './client/index.js';
|
|
12
15
|
export * from './default-error-handlers.js';
|
|
13
16
|
export * from './response.js';
|
|
17
|
+
export * from './server/index.js';
|
|
14
18
|
export * from './types.js';
|
package/application/index.d.ts
CHANGED
package/application/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import type { AfterResolve } from '../../injector/index.js';
|
|
|
4
4
|
import { afterResolve } from '../../injector/index.js';
|
|
5
5
|
import type { Record } from '../../types.js';
|
|
6
6
|
import type { SecretCheckResult, TokenPayload } from '../models/index.js';
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class AuthenticationClientService<AdditionalTokenPayload extends Record = Record, AuthenticationData = any> implements AfterResolve, AsyncDisposable {
|
|
8
8
|
private readonly client;
|
|
9
9
|
private readonly errorSubject;
|
|
10
10
|
private readonly tokenUpdateBus;
|
|
@@ -33,7 +33,7 @@ const authenticationDataStorageKey = 'AuthenticationService:authentication-data'
|
|
|
33
33
|
const tokenUpdateBusName = 'AuthenticationService:tokenUpdate';
|
|
34
34
|
const loggedOutBusName = 'AuthenticationService:loggedOut';
|
|
35
35
|
const refreshLockResource = 'AuthenticationService:refresh';
|
|
36
|
-
let
|
|
36
|
+
let AuthenticationClientService = class AuthenticationClientService {
|
|
37
37
|
client = inject(AUTHENTICATION_API_CLIENT);
|
|
38
38
|
errorSubject = new Subject();
|
|
39
39
|
tokenUpdateBus = inject((MessageBus), tokenUpdateBusName);
|
|
@@ -211,10 +211,10 @@ let AuthenticationService = class AuthenticationService {
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
};
|
|
214
|
-
|
|
214
|
+
AuthenticationClientService = __decorate([
|
|
215
215
|
Singleton(),
|
|
216
216
|
__param(0, Inject(INITIAL_AUTHENTICATION_DATA)),
|
|
217
217
|
__param(0, Optional()),
|
|
218
218
|
__metadata("design:paramtypes", [Object])
|
|
219
|
-
],
|
|
220
|
-
export {
|
|
219
|
+
], AuthenticationClientService);
|
|
220
|
+
export { AuthenticationClientService };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { HttpClientMiddleware } from '../../http/client/middleware.js';
|
|
2
2
|
import type { ValueOrAsyncProvider } from '../../utils/value-or-provider.js';
|
|
3
|
-
import type {
|
|
4
|
-
export declare function waitForAuthenticationCredentialsMiddleware(authenticationServiceOrProvider: ValueOrAsyncProvider<
|
|
3
|
+
import type { AuthenticationClientService } from './authentication.service.js';
|
|
4
|
+
export declare function waitForAuthenticationCredentialsMiddleware(authenticationServiceOrProvider: ValueOrAsyncProvider<AuthenticationClientService>): HttpClientMiddleware;
|
|
@@ -2,9 +2,9 @@ import type { ApiClientImplementation } from '../../api/index.js';
|
|
|
2
2
|
import { Injector } from '../../injector/injector.js';
|
|
3
3
|
import type { Type } from '../../types.js';
|
|
4
4
|
import type { AuthenticationApiDefinition } from '../authentication.api.js';
|
|
5
|
-
export type
|
|
5
|
+
export type AuthenticationClientModuleConfig = {
|
|
6
6
|
authenticationApiClient?: Type<ApiClientImplementation<AuthenticationApiDefinition<any, any>>>;
|
|
7
7
|
initialAuthenticationData?: unknown;
|
|
8
8
|
registerMiddleware?: boolean;
|
|
9
9
|
};
|
|
10
|
-
export declare function configureAuthenticationClient(config:
|
|
10
|
+
export declare function configureAuthenticationClient(config: AuthenticationClientModuleConfig, injector?: Injector | null): void;
|
|
@@ -2,7 +2,7 @@ import { HTTP_CLIENT_MIDDLEWARE } from '../../http/client/tokens.js';
|
|
|
2
2
|
import { getCurrentInjector } from '../../injector/inject.js';
|
|
3
3
|
import { Injector } from '../../injector/injector.js';
|
|
4
4
|
import { isDefined } from '../../utils/type-guards.js';
|
|
5
|
-
import {
|
|
5
|
+
import { AuthenticationClientService } from './authentication.service.js';
|
|
6
6
|
import { waitForAuthenticationCredentialsMiddleware } from './http-client.middleware.js';
|
|
7
7
|
import { AUTHENTICATION_API_CLIENT, INITIAL_AUTHENTICATION_DATA } from './tokens.js';
|
|
8
8
|
export function configureAuthenticationClient(config, injector = getCurrentInjector()) {
|
|
@@ -15,7 +15,7 @@ export function configureAuthenticationClient(config, injector = getCurrentInjec
|
|
|
15
15
|
if (isDefined(config.registerMiddleware)) {
|
|
16
16
|
(injector ?? Injector).register(HTTP_CLIENT_MIDDLEWARE, {
|
|
17
17
|
useFactory(_, context) {
|
|
18
|
-
const authenticationService = context.resolve(
|
|
18
|
+
const authenticationService = context.resolve(AuthenticationClientService, undefined, { forwardRef: true, forwardRefTypeHint: 'object' });
|
|
19
19
|
return waitForAuthenticationCredentialsMiddleware(authenticationService);
|
|
20
20
|
}
|
|
21
21
|
}, { multi: true });
|
package/authentication/index.js
CHANGED
package/browser/index.d.ts
CHANGED
package/browser/index.js
CHANGED
package/cancellation/index.d.ts
CHANGED
package/cancellation/index.js
CHANGED
package/collections/index.d.ts
CHANGED
package/collections/index.js
CHANGED
package/cookie/index.d.ts
CHANGED
package/cookie/index.js
CHANGED
package/data-structures/index.js
CHANGED
package/database/index.d.ts
CHANGED
package/database/index.js
CHANGED
package/database/mongo/index.js
CHANGED
package/database/mongo/module.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Collection, Database, MongoClient } from './classes.js';
|
|
|
6
6
|
export const mongoModuleConfig = {
|
|
7
7
|
defaultConnection: { url: 'mongodb://localhost:27017/test-db' },
|
|
8
8
|
defaultDatabase: undefined,
|
|
9
|
-
logPrefix: '
|
|
9
|
+
logPrefix: 'Mongo'
|
|
10
10
|
};
|
|
11
11
|
export function configureMongo(config) {
|
|
12
12
|
mongoModuleConfig.defaultDatabase = config.defaultDatabase ?? mongoModuleConfig.defaultDatabase;
|
package/decorators/index.d.ts
CHANGED
package/decorators/index.js
CHANGED
package/disposable/index.d.ts
CHANGED
package/disposable/index.js
CHANGED
package/enumerable/index.d.ts
CHANGED
package/enumerable/index.js
CHANGED
package/error/index.d.ts
CHANGED
package/error/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import '../../polyfills.js';
|
|
|
3
3
|
import { configureApiServer } from '../../api/server/index.js';
|
|
4
4
|
import { Application } from '../../application/application.js';
|
|
5
5
|
import { AuthenticationApiClient } from '../../authentication/client/api.client.js';
|
|
6
|
-
import {
|
|
6
|
+
import { AuthenticationClientService, configureAuthenticationClient } from '../../authentication/client/index.js';
|
|
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';
|
|
@@ -11,7 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
import '../../polyfills.js';
|
|
12
12
|
import { configureApiServer } from '../../api/server/index.js';
|
|
13
13
|
import { Application } from '../../application/application.js';
|
|
14
|
-
import {
|
|
14
|
+
import { AuthenticationClientService, configureAuthenticationClient, getAuthenticationApiClient } from '../../authentication/client/index.js';
|
|
15
15
|
import { AuthenticationTokenPayloadProvider } from '../../authentication/server/authentication-token-payload.provider.js';
|
|
16
16
|
import { AuthenticationApiController } from '../../authentication/server/authentication.api-controller.js';
|
|
17
17
|
import { AuthenticationService as AuthenticationServerService } from '../../authentication/server/authentication.service.js';
|
package/function/index.d.ts
CHANGED
package/function/index.js
CHANGED
package/http/client/index.d.ts
CHANGED
package/http/client/index.js
CHANGED
package/http/index.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP Server and Client
|
|
3
|
+
*
|
|
4
|
+
* @module HTTP
|
|
5
|
+
*/
|
|
1
6
|
export * from './client/index.js';
|
|
2
7
|
export * from './cookie-parser.js';
|
|
3
8
|
export * from './http-body.js';
|
|
@@ -7,5 +12,6 @@ export * from './http-query.js';
|
|
|
7
12
|
export * from './http-url-parameters.js';
|
|
8
13
|
export * from './http-value-map.js';
|
|
9
14
|
export * from './http.error.js';
|
|
15
|
+
export * from './server/index.js';
|
|
10
16
|
export * from './types.js';
|
|
11
17
|
export * from './utils.js';
|
package/http/index.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP Server and Client
|
|
3
|
+
*
|
|
4
|
+
* @module HTTP
|
|
5
|
+
*/
|
|
1
6
|
export * from './client/index.js';
|
|
2
7
|
export * from './cookie-parser.js';
|
|
3
8
|
export * from './http-body.js';
|
|
@@ -7,5 +12,6 @@ export * from './http-query.js';
|
|
|
7
12
|
export * from './http-url-parameters.js';
|
|
8
13
|
export * from './http-value-map.js';
|
|
9
14
|
export * from './http.error.js';
|
|
15
|
+
export * from './server/index.js';
|
|
10
16
|
export * from './types.js';
|
|
11
17
|
export * from './utils.js';
|
package/http/server/index.d.ts
CHANGED
package/http/server/index.js
CHANGED
package/image-service/index.d.ts
CHANGED
package/image-service/index.js
CHANGED
package/index.d.ts
CHANGED
package/index.js
CHANGED
package/injector/index.d.ts
CHANGED
package/injector/index.js
CHANGED
package/json-path/index.d.ts
CHANGED
package/json-path/index.js
CHANGED
package/key-value-store/index.js
CHANGED
package/lock/index.d.ts
CHANGED
package/lock/index.js
CHANGED
package/lock/mongo/lock.d.ts
CHANGED
|
@@ -3,8 +3,7 @@ import { Lock } from '../../lock/index.js';
|
|
|
3
3
|
import { Logger } from '../../logger/index.js';
|
|
4
4
|
import { MongoLockRepository } from './mongo-lock-repository.js';
|
|
5
5
|
export declare class MongoLock extends Lock {
|
|
6
|
-
private
|
|
7
|
-
private readonly logger;
|
|
6
|
+
#private;
|
|
8
7
|
constructor(lockRepository: MongoLockRepository, resource: string, logger: Logger);
|
|
9
8
|
acquire<Throw extends boolean>(timeout: number | undefined, throwOnFail: Throw): Promise<AcquireResult<Throw>>;
|
|
10
9
|
use<Throw extends boolean, R>(timeout: number | undefined, throwOnFail: Throw, func: LockedFunction<R>): Promise<UsingResult<Throw, R>>;
|