@tstdl/base 0.81.35 → 0.82.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/client/client.d.ts +3 -3
- package/api/default-error-handlers.d.ts +1 -1
- package/api/response.d.ts +8 -8
- package/api/server/api-controller.d.ts +1 -1
- package/api/server/gateway.d.ts +9 -9
- package/api/server/middlewares/cors.middleware.d.ts +1 -1
- package/api/server/module.d.ts +1 -1
- package/api/types.d.ts +30 -30
- package/api/utils.d.ts +1 -1
- package/authentication/authentication-credentials.service.d.ts +6 -0
- package/authentication/authentication-credentials.service.js +17 -0
- package/authentication/authentication-credentials.service.js.map +1 -0
- package/authentication/authentication-session.service.d.ts +6 -0
- package/authentication/authentication-session.service.js +17 -0
- package/authentication/authentication-session.service.js.map +1 -0
- package/authentication/authentication-token-payload.provider.d.ts +3 -0
- package/authentication/authentication-token-payload.provider.js +17 -0
- package/authentication/authentication-token-payload.provider.js.map +1 -0
- package/authentication/authentication.service.d.ts +42 -0
- package/authentication/authentication.service.js +133 -0
- package/authentication/authentication.service.js.map +1 -0
- package/authentication/models/authentication-credentials.model.d.ts +6 -0
- package/authentication/models/authentication-credentials.model.js +37 -0
- package/authentication/models/authentication-credentials.model.js.map +1 -0
- package/authentication/models/authentication-session.model.d.ts +9 -0
- package/authentication/models/authentication-session.model.js +52 -0
- package/authentication/models/authentication-session.model.js.map +1 -0
- package/authentication/models/index.d.ts +2 -0
- package/authentication/models/index.js +19 -0
- package/authentication/models/index.js.map +1 -0
- package/authentication/tokens.d.ts +2 -0
- package/authentication/tokens.js +6 -0
- package/authentication/tokens.js.map +1 -0
- package/collections/keyed-set.d.ts +1 -1
- package/collections/observable/observable-collection.d.ts +1 -1
- package/collections/observable/observable-list.d.ts +2 -2
- package/container/container.d.ts +3 -3
- package/container/decorators.d.ts +3 -3
- package/container/interfaces.d.ts +1 -1
- package/container/provider.d.ts +6 -6
- package/container/resolve-chain.d.ts +2 -2
- package/container/token.d.ts +3 -3
- package/container/type-info.d.ts +1 -1
- package/container/types.d.ts +4 -4
- package/core.d.ts +1 -1
- package/data-structures/linked-list.d.ts +1 -1
- package/data-structures/multi-key-map.d.ts +2 -2
- package/data-structures/sorted-array-list.d.ts +1 -1
- package/database/entity-repository.d.ts +2 -2
- package/database/entity.d.ts +3 -3
- package/database/module.d.ts +1 -1
- package/database/mongo/classes.d.ts +3 -3
- package/database/mongo/model/document.d.ts +3 -3
- package/database/mongo/module.d.ts +1 -1
- package/database/mongo/mongo-base.repository.d.ts +11 -11
- package/database/mongo/mongo-bulk.d.ts +1 -1
- package/database/mongo/mongo-entity-repository.d.ts +7 -7
- package/database/mongo/types.d.ts +16 -16
- package/database/query.d.ts +38 -38
- package/disposable/async-disposer.d.ts +3 -3
- package/distributed-loop/distributed-loop.d.ts +2 -2
- package/error/custom.error.d.ts +1 -1
- package/http/client/adapters/undici-http-client.adapter.d.ts +1 -1
- package/http/client/http-client-request.d.ts +5 -5
- package/http/client/http-client-response.d.ts +2 -2
- package/http/client/http-client.d.ts +5 -5
- package/http/http-body.d.ts +3 -1
- package/http/http-body.js +18 -12
- package/http/http-body.js.map +1 -1
- package/http/http-form.d.ts +2 -2
- package/http/http-headers.d.ts +3 -3
- package/http/http-query.d.ts +2 -2
- package/http/http-url-parameters.d.ts +2 -2
- package/http/http-value-map.d.ts +1 -1
- package/http/server/http-server-request.d.ts +1 -1
- package/http/server/http-server-response.d.ts +1 -1
- package/http/server/http-server.d.ts +1 -1
- package/http/server/node/node-http-server.d.ts +1 -1
- package/http/types.d.ts +5 -5
- package/http/utils.d.ts +3 -3
- package/image-service/imgproxy/imgproxy-image-service.d.ts +1 -1
- package/json-path/json-path.d.ts +4 -4
- package/key-value-store/key-value.store.d.ts +1 -1
- package/key-value-store/mongo/module.d.ts +1 -1
- package/key-value-store/mongo/mongo-key-value.model.d.ts +1 -1
- package/lock/lock.d.ts +4 -4
- package/lock/mongo/model.d.ts +1 -1
- package/lock/mongo/module.d.ts +1 -1
- package/lock/provider.d.ts +1 -1
- package/logger/logger.d.ts +6 -6
- package/mail/mail.client.d.ts +1 -1
- package/mail/models/mail-address.model.d.ts +1 -1
- package/mail/models/mail-content.model.d.ts +1 -1
- package/mail/models/mail-data.model.d.ts +1 -1
- package/mail/models/mail-log.model.d.ts +2 -2
- package/mail/models/mail-send-result.model.d.ts +1 -1
- package/mail/models/mail-template.model.d.ts +1 -1
- package/mail/module.d.ts +1 -1
- package/mail/repositories/mongo-mail-log.repository.d.ts +2 -2
- package/message-bus/local/types.d.ts +1 -1
- package/message-bus/message-bus.d.ts +1 -1
- package/migration/migration-state.d.ts +2 -2
- package/migration/migrator.d.ts +4 -4
- package/migration/mongo/module.d.ts +1 -1
- package/module/module-metric-reporter.d.ts +2 -2
- package/module/module.d.ts +1 -1
- package/module/modules/function.module.d.ts +1 -1
- package/module/modules/web-server.module.d.ts +1 -1
- package/notification/api.d.ts +1 -1
- package/notification/module.d.ts +1 -1
- package/object-storage/object-storage.d.ts +2 -2
- package/object-storage/object.d.ts +1 -1
- package/object-storage/s3/s3.object-storage-provider.d.ts +1 -1
- package/openid-connect/mongo-oidc-state.repository.d.ts +1 -1
- package/openid-connect/oidc-configuration.service.d.ts +1 -1
- package/openid-connect/oidc-state.model.d.ts +2 -2
- package/openid-connect/oidc.service-model.d.ts +8 -8
- package/orm/types.d.ts +4 -4
- package/package.json +3 -3
- package/pdf/pdf.service.d.ts +3 -3
- package/pool/pool.d.ts +4 -4
- package/promise/cancelable-promise.d.ts +1 -1
- package/promise/lazy-promise.d.ts +1 -1
- package/queue/mongo/job.d.ts +2 -2
- package/queue/mongo/queue.js +2 -2
- package/queue/mongo/queue.js.map +1 -1
- package/queue/queue.d.ts +11 -6
- package/queue/queue.js +2 -1
- package/queue/queue.js.map +1 -1
- package/reflection/registry.d.ts +9 -9
- package/reflection/types.d.ts +32 -32
- package/reflection/utils.d.ts +5 -5
- package/rpc/endpoints/message-port.rpc-endpoint.d.ts +3 -3
- package/rpc/model.d.ts +22 -22
- package/rpc/rpc.d.ts +1 -1
- package/rxjs/intersection-observer.d.ts +1 -1
- package/rxjs/mutation-observer.d.ts +1 -1
- package/rxjs/performance-observer.d.ts +1 -1
- package/rxjs/resize-observer.d.ts +1 -1
- package/rxjs/slow-array.d.ts +1 -1
- package/rxjs/touch.d.ts +1 -1
- package/schema/constraints/generic.d.ts +2 -2
- package/schema/constraints/length.d.ts +1 -1
- package/schema/decorators/types.d.ts +3 -3
- package/schema/schema.d.ts +4 -4
- package/schema/schema.error.d.ts +1 -1
- package/schema/schema.js +10 -13
- package/schema/schema.js.map +1 -1
- package/schema/schemas/any.d.ts +1 -1
- package/schema/schemas/array.d.ts +1 -1
- package/schema/schemas/boolean.d.ts +1 -1
- package/schema/schemas/date.d.ts +1 -1
- package/schema/schemas/enumeration.d.ts +1 -1
- package/schema/schemas/instance.d.ts +1 -1
- package/schema/schemas/literal.d.ts +1 -1
- package/schema/schemas/nullable.d.ts +1 -1
- package/schema/schemas/number.d.ts +1 -1
- package/schema/schemas/object.d.ts +1 -1
- package/schema/schemas/one-or-many.d.ts +2 -2
- package/schema/schemas/optional.d.ts +1 -1
- package/schema/schemas/readable-stream.d.ts +1 -1
- package/schema/schemas/record.d.ts +1 -1
- package/schema/schemas/regexp.d.ts +1 -1
- package/schema/schemas/string.d.ts +1 -1
- package/schema/schemas/uint8-array.d.ts +1 -1
- package/schema/schemas/union.d.ts +1 -1
- package/schema/schemas/unknown.d.ts +1 -1
- package/schema/transformers/generic.d.ts +1 -1
- package/schema/types.d.ts +31 -31
- package/search-index/elastic/config.d.ts +1 -1
- package/search-index/elastic/model/elastic-query.d.ts +15 -15
- package/search-index/elastic/model/index-mapping.d.ts +14 -14
- package/search-index/elastic/model/sort.d.ts +3 -3
- package/search-index/elastic/module.d.ts +1 -1
- package/search-index/search-index.d.ts +1 -1
- package/search-index/search-result.d.ts +2 -2
- package/serializer/handlers/error.d.ts +1 -1
- package/serializer/handlers/map.d.ts +1 -1
- package/serializer/handlers/regex.d.ts +1 -1
- package/serializer/handlers/set.d.ts +1 -1
- package/serializer/serializable.d.ts +6 -6
- package/serializer/serializer.d.ts +1 -1
- package/serializer/types.d.ts +15 -15
- package/sse/server-sent-events.d.ts +3 -3
- package/tailwind/theme-adapter.d.ts +1 -1
- package/templates/module.d.ts +1 -1
- package/templates/providers/file.provider-template.d.ts +2 -2
- package/templates/providers/file.provider-template.js +2 -1
- package/templates/providers/file.provider-template.js.map +1 -1
- package/templates/renderers/handlebars.template-renderer.d.ts +9 -9
- package/templates/renderers/mjml.template-renderer.d.ts +3 -3
- package/templates/renderers/string.template-renderer.d.ts +1 -1
- package/templates/resolvers/file.template-resolver.d.ts +2 -2
- package/templates/template.model.d.ts +1 -1
- package/templates/template.renderer.d.ts +4 -4
- package/templates/template.service.d.ts +1 -1
- package/text/dynamic-text.model.d.ts +1 -1
- package/text/localizable-text.model.d.ts +1 -1
- package/text/localization.service.d.ts +11 -11
- package/theme/theme-service.d.ts +6 -6
- package/threading/thread-pool.d.ts +1 -1
- package/threading/thread-worker.d.ts +1 -1
- package/types/geo-json.d.ts +12 -12
- package/types.d.ts +91 -91
- package/utils/any-iterable-iterator.d.ts +3 -3
- package/utils/async-iterable-helpers/parallel/types.d.ts +2 -2
- package/utils/async-iterable-helpers/types.d.ts +7 -7
- package/utils/backoff.d.ts +5 -5
- package/utils/benchmark.d.ts +1 -1
- package/utils/binary-search.d.ts +1 -1
- package/utils/binary.js.map +1 -1
- package/utils/cancellation-token.d.ts +1 -1
- package/utils/compression.d.ts +1 -1
- package/utils/cryptography.d.ts +11 -11
- package/utils/date-time.d.ts +8 -7
- package/utils/date-time.js +6 -2
- package/utils/date-time.js.map +1 -1
- package/utils/equals.d.ts +3 -3
- package/utils/factory-map.d.ts +1 -1
- package/utils/format-error.d.ts +1 -1
- package/utils/function/memoize.d.ts +1 -1
- package/utils/helpers.d.ts +1 -1
- package/utils/iterable-helpers/types.d.ts +6 -6
- package/utils/jwt.d.ts +4 -4
- package/utils/math.d.ts +1 -1
- package/utils/merge.d.ts +1 -1
- package/utils/middleware.d.ts +9 -9
- package/utils/moving-metric.d.ts +1 -1
- package/utils/object/decycle.d.ts +1 -1
- package/utils/object/dereference.d.ts +1 -1
- package/utils/object/forward-ref.d.ts +2 -2
- package/utils/object/lazy-property.d.ts +5 -5
- package/utils/object/merge.d.ts +1 -1
- package/utils/object/property-name.d.ts +5 -5
- package/utils/patch-worker.d.ts +1 -1
- package/utils/periodic-sampler.d.ts +1 -1
- package/utils/provider-function-iterable.d.ts +2 -2
- package/utils/proxy.d.ts +1 -1
- package/utils/singleton.d.ts +2 -2
- package/utils/sort.d.ts +2 -2
- package/utils/stream/stream-helper-types.d.ts +5 -5
- package/utils/type-guards.d.ts +3 -3
- package/utils/url-builder.d.ts +4 -4
- package/web-types.d.ts +4 -4
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AuthenticationSession = void 0;
|
|
13
|
+
const schema_1 = require("../../schema");
|
|
14
|
+
class AuthenticationSession {
|
|
15
|
+
subject;
|
|
16
|
+
begin;
|
|
17
|
+
end;
|
|
18
|
+
tokenId;
|
|
19
|
+
hashVersion;
|
|
20
|
+
refreshTokenSalt;
|
|
21
|
+
refreshTokenHash;
|
|
22
|
+
}
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, schema_1.Property)(),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], AuthenticationSession.prototype, "subject", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, schema_1.Property)(),
|
|
29
|
+
__metadata("design:type", Number)
|
|
30
|
+
], AuthenticationSession.prototype, "begin", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, schema_1.Property)(),
|
|
33
|
+
__metadata("design:type", Number)
|
|
34
|
+
], AuthenticationSession.prototype, "end", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, schema_1.Property)(),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], AuthenticationSession.prototype, "tokenId", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, schema_1.Property)(),
|
|
41
|
+
__metadata("design:type", Number)
|
|
42
|
+
], AuthenticationSession.prototype, "hashVersion", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, schema_1.Property)(),
|
|
45
|
+
__metadata("design:type", Uint8Array)
|
|
46
|
+
], AuthenticationSession.prototype, "refreshTokenSalt", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, schema_1.Property)(),
|
|
49
|
+
__metadata("design:type", Uint8Array)
|
|
50
|
+
], AuthenticationSession.prototype, "refreshTokenHash", void 0);
|
|
51
|
+
exports.AuthenticationSession = AuthenticationSession;
|
|
52
|
+
//# sourceMappingURL=authentication-session.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authentication-session.model.js","sourceRoot":"","sources":["../../../source/authentication/models/authentication-session.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAoC;AAEpC,MAAa,qBAAqB;IAEhC,OAAO,CAAS;IAGhB,KAAK,CAAS;IAGd,GAAG,CAAS;IAGZ,OAAO,CAAS;IAGhB,WAAW,CAAS;IAGpB,gBAAgB,CAAa;IAG7B,gBAAgB,CAAa;CAC9B;AApBC;IAAC,IAAA,iBAAQ,GAAE;;sDACK;AAEhB;IAAC,IAAA,iBAAQ,GAAE;;oDACG;AAEd;IAAC,IAAA,iBAAQ,GAAE;;kDACC;AAEZ;IAAC,IAAA,iBAAQ,GAAE;;sDACK;AAEhB;IAAC,IAAA,iBAAQ,GAAE;;0DACS;AAEpB;IAAC,IAAA,iBAAQ,GAAE;8BACO,UAAU;+DAAC;AAE7B;IAAC,IAAA,iBAAQ,GAAE;8BACO,UAAU;+DAAC;AApB/B,sDAqBC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
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("./authentication-credentials.model"), exports);
|
|
18
|
+
__exportStar(require("./authentication-session.model"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/authentication/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qEAAmD;AACnD,iEAA+C"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AUTHENTICATION_SERVICE_OPTIONS = void 0;
|
|
4
|
+
const container_1 = require("../container");
|
|
5
|
+
exports.AUTHENTICATION_SERVICE_OPTIONS = (0, container_1.injectionToken)('AUTHENTICATION_SERVICE_OPTIONS');
|
|
6
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../source/authentication/tokens.ts"],"names":[],"mappings":";;;AAAA,4CAA6C;AAGhC,QAAA,8BAA8B,GAAG,IAAA,0BAAc,EAA+B,gCAAgC,CAAC,CAAC"}
|
|
@@ -2,7 +2,7 @@ export declare enum KeyedSetMode {
|
|
|
2
2
|
Keep = 0,
|
|
3
3
|
Overwrite = 1
|
|
4
4
|
}
|
|
5
|
-
export
|
|
5
|
+
export type Selector<T> = (value: T) => any;
|
|
6
6
|
export declare class KeyedSet<T> implements Set<T> {
|
|
7
7
|
private readonly selector;
|
|
8
8
|
private readonly mode;
|
|
@@ -2,11 +2,11 @@ import type { Observable } from 'rxjs';
|
|
|
2
2
|
import type { List } from '../list';
|
|
3
3
|
import type { SortedList } from '../sorted-list';
|
|
4
4
|
import type { ObservableCollection } from './observable-collection';
|
|
5
|
-
export
|
|
5
|
+
export type ObservableListIndexedEvent<T> = {
|
|
6
6
|
value: T;
|
|
7
7
|
index: number;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type ObservableListIndexedChangeEvent<T> = {
|
|
10
10
|
add?: ObservableListIndexedEvent<T>[];
|
|
11
11
|
remove?: ObservableListIndexedEvent<T>[];
|
|
12
12
|
};
|
package/container/container.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ export declare const injectMetadataSymbol: unique symbol;
|
|
|
10
10
|
* singleton: each resolve will return the same instance
|
|
11
11
|
* resolution: the same instance will be resolved for each resolution of this dependency during a single resolution chain
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
14
|
-
export
|
|
13
|
+
export type Lifecycle = 'transient' | 'singleton' | 'resolution';
|
|
14
|
+
export type RegistrationOptions<T, A = unknown> = {
|
|
15
15
|
lifecycle?: Lifecycle;
|
|
16
16
|
/** default resolve argument used when neither token nor explicit resolve argument is provided */
|
|
17
17
|
defaultArgument?: InjectableArgument<T, A>;
|
|
@@ -32,7 +32,7 @@ export declare type RegistrationOptions<T, A = unknown> = {
|
|
|
32
32
|
/** custom metadata */
|
|
33
33
|
metadata?: Record;
|
|
34
34
|
};
|
|
35
|
-
export
|
|
35
|
+
export type Registration<T = any, A = any> = {
|
|
36
36
|
token: InjectionToken<T, A>;
|
|
37
37
|
provider: Provider<T, A>;
|
|
38
38
|
options: RegistrationOptions<T, A>;
|
|
@@ -4,14 +4,14 @@ import type { Lifecycle, RegistrationOptions } from './container';
|
|
|
4
4
|
import type { Provider } from './provider';
|
|
5
5
|
import type { InjectionToken } from './token';
|
|
6
6
|
import type { ArgumentProvider, ForwardRefInjectionToken, Mapper } from './types';
|
|
7
|
-
|
|
8
|
-
export
|
|
7
|
+
type InjectDecorator = Decorator<'property' | 'accessor' | 'constructorParameter'>;
|
|
8
|
+
export type InjectableOptions<T, A> = RegistrationOptions<T> & {
|
|
9
9
|
/** aliases (tokens) for the class. Useful for example for circular dependencies when you can't use the class itself as a token */
|
|
10
10
|
alias?: OneOrMany<InjectionToken>;
|
|
11
11
|
/** custom provider. Useful for example if initialization is required */
|
|
12
12
|
provider?: Provider<T, A>;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type InjectableOptionsWithoutLifecycle<T, A> = Simplify<TypedOmit<InjectableOptions<T, A>, 'lifecycle'>>;
|
|
15
15
|
/**
|
|
16
16
|
* Helper decorator to replace a class definition with an other
|
|
17
17
|
* can be used for example to type external classes with the {@link Injectable} interface
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const resolveArgumentType: unique symbol;
|
|
2
2
|
export declare const afterResolve: unique symbol;
|
|
3
|
-
export
|
|
3
|
+
export type InjectableArgument<T, Fallback> = T extends Injectable<infer A> ? A : Fallback;
|
|
4
4
|
export interface Injectable<T = unknown> {
|
|
5
5
|
/**
|
|
6
6
|
* type of resolve argument
|
package/container/provider.d.ts
CHANGED
|
@@ -2,15 +2,15 @@ import type { Constructor } from "../types";
|
|
|
2
2
|
import type { InjectableArgument } from './interfaces';
|
|
3
3
|
import type { InjectionToken } from './token';
|
|
4
4
|
import type { ResolveContext } from './types';
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
5
|
+
export type Factory<T, A = any> = (argument: InjectableArgument<T, A> | undefined, context: ResolveContext) => T | Promise<T>;
|
|
6
|
+
export type Provider<T = any, A = any> = ClassProvider<T> | ValueProvider<T> | TokenProvider<T, A> | FactoryProvider<T, A>;
|
|
7
|
+
export type ClassProvider<T = any> = {
|
|
8
8
|
useClass: Constructor<T>;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type ValueProvider<T = any> = {
|
|
11
11
|
useValue: T;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type TokenProvider<T = any, A = any> = {
|
|
14
14
|
useToken: InjectionToken<T, A>;
|
|
15
15
|
useTokenProvider?: undefined;
|
|
16
16
|
argument?: InjectableArgument<T, A>;
|
|
@@ -21,7 +21,7 @@ export declare type TokenProvider<T = any, A = any> = {
|
|
|
21
21
|
argument?: InjectableArgument<T, A>;
|
|
22
22
|
argumentProvider?: () => InjectableArgument<T, A>;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
24
|
+
export type FactoryProvider<T = any, A = unknown> = {
|
|
25
25
|
useFactory: Factory<T, A>;
|
|
26
26
|
};
|
|
27
27
|
export declare function classProvider<T>(constructor: Constructor<T>): ClassProvider<T>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { AbstractConstructor } from "../types";
|
|
2
2
|
import type { InjectionToken } from './token';
|
|
3
|
-
export
|
|
3
|
+
export type ResolveChainNodeBase<Type extends string> = {
|
|
4
4
|
type: Type;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type ResolveChainNode = ResolveChainNodeBase<'token'> & {
|
|
7
7
|
token: InjectionToken;
|
|
8
8
|
} | ResolveChainNodeBase<'parameter'> & {
|
|
9
9
|
constructor: AbstractConstructor;
|
package/container/token.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Constructor } from "../types";
|
|
2
2
|
declare const parameter: unique symbol;
|
|
3
|
-
export
|
|
3
|
+
export type ParameterizedInjectionToken<T, A> = SimpleInjectionToken<T> & {
|
|
4
4
|
[parameter]?: A;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
7
|
-
export
|
|
6
|
+
export type SimpleInjectionToken<T> = Constructor<T> | Function | object | string | symbol;
|
|
7
|
+
export type InjectionToken<T = any, A = any> = SimpleInjectionToken<T> | ParameterizedInjectionToken<T, A>;
|
|
8
8
|
export declare function injectionToken<T, A = any>(token: InjectionToken<T, A>): InjectionToken<T, A>;
|
|
9
9
|
export declare function getTokenName(token: InjectionToken | undefined): string;
|
|
10
10
|
export {};
|
package/container/type-info.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InjectionToken } from './token';
|
|
2
2
|
import type { ArgumentProvider, ForwardRefInjectionToken, Mapper } from './types';
|
|
3
|
-
export
|
|
3
|
+
export type InjectMetadata = {
|
|
4
4
|
/** token overwrite by inject decorator */
|
|
5
5
|
injectToken?: InjectionToken;
|
|
6
6
|
/** if defined, resolve the ForwardRefToken using ForwardRef strategy instead resolving the token */
|
package/container/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Container } from './container';
|
|
2
2
|
import type { InjectionToken } from './token';
|
|
3
|
-
export
|
|
3
|
+
export type ResolveContext = Pick<Container, 'resolve' | 'resolveAsync'> & {
|
|
4
4
|
isAsync: boolean;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
6
|
+
export type Mapper<T = any, U = unknown> = (value: T) => U | Promise<U>;
|
|
7
|
+
export type ArgumentProvider<T = unknown> = (context: ResolveContext) => T | Promise<T>;
|
|
8
|
+
export type ForwardRefInjectionToken<T = any, A = any> = Exclude<InjectionToken<T, A>, Function> | (() => InjectionToken<T, A>);
|
package/core.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const CORE_LOGGER: InjectionToken<Logger, any>;
|
|
|
6
6
|
export declare const disposer: AsyncDisposer;
|
|
7
7
|
export declare function connect(name: string, connectFunction: (() => Promise<any>), logger: Logger, maxTries?: number): Promise<void>;
|
|
8
8
|
export declare function disposeInstances(): Promise<void>;
|
|
9
|
-
export
|
|
9
|
+
export type CoreConfiguration = {
|
|
10
10
|
coreLogPrefix?: string;
|
|
11
11
|
logLevel?: LogLevel;
|
|
12
12
|
loggerToken?: InjectionToken<Logger, LoggerArgument>;
|
|
@@ -2,7 +2,7 @@ import type { TryDereference } from "../serializer/serializable";
|
|
|
2
2
|
import { Serializable } from "../serializer/serializable";
|
|
3
3
|
import type { Predicate } from "../utils/iterable-helpers/types";
|
|
4
4
|
import { List } from './list';
|
|
5
|
-
export
|
|
5
|
+
export type LinkedListNode<T> = {
|
|
6
6
|
/** item of node */
|
|
7
7
|
item: T;
|
|
8
8
|
/** previous node. Warning: it is not safe to use this reference on a removed node */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Collection } from './collection';
|
|
2
|
-
|
|
2
|
+
type Node = {
|
|
3
3
|
nodeKey: any;
|
|
4
4
|
parentNode: Node | undefined;
|
|
5
5
|
hasInnerMap: boolean;
|
|
@@ -7,7 +7,7 @@ declare type Node = {
|
|
|
7
7
|
hasValue: boolean;
|
|
8
8
|
value: any;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
type NewMapProvider = () => Map<any, Node>;
|
|
11
11
|
export declare class MultiKeyMap<K extends any[], T> extends Collection<[K, T], MultiKeyMap<K, T>> implements Map<K, T> {
|
|
12
12
|
private readonly newMapProvider;
|
|
13
13
|
private rootNode;
|
|
@@ -3,7 +3,7 @@ import { Serializable } from "../serializer";
|
|
|
3
3
|
import type { Predicate } from "../utils/iterable-helpers/types";
|
|
4
4
|
import { Comparator } from "../utils/sort";
|
|
5
5
|
import { List } from './list';
|
|
6
|
-
export
|
|
6
|
+
export type RangeType = 'inclusive' | 'exclusive';
|
|
7
7
|
export declare class SortedArrayList<T extends TComparator, TComparator = T> extends List<T, SortedArrayList<T, TComparator>> implements Serializable<SortedArrayList<T, TComparator>, T[]> {
|
|
8
8
|
private readonly comparator;
|
|
9
9
|
private backingArray;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Entity, MaybeNewEntity } from './entity';
|
|
2
2
|
import type { Query, QueryOptions } from './query';
|
|
3
3
|
export declare const repositoryType: unique symbol;
|
|
4
|
-
export
|
|
4
|
+
export type UpdateOptions = {
|
|
5
5
|
upsert?: boolean;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type EntityPatch<T extends Entity = Entity> = Partial<Omit<T, 'id'>>;
|
|
8
8
|
export declare abstract class EntityRepository<T extends Entity = Entity> {
|
|
9
9
|
readonly [repositoryType]: T;
|
|
10
10
|
abstract load<U extends T = T>(id: string): Promise<U>;
|
package/database/entity.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Entity<Id = string> = {
|
|
2
2
|
id: Id;
|
|
3
3
|
};
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type NewEntity<T extends Entity | MaybeNewEntity = Entity> = Omit<T, 'id'>;
|
|
5
|
+
export type MaybeNewEntity<T extends Entity = Entity> = NewEntity<T> & {
|
|
6
6
|
id?: T['id'];
|
|
7
7
|
};
|
package/database/module.d.ts
CHANGED
|
@@ -4,13 +4,13 @@ import type { Entity } from "..";
|
|
|
4
4
|
import { Collection as MongoCollection, Db, MongoClient as MongoMongoClient } from 'mongodb';
|
|
5
5
|
import type { MongoDocument } from './model';
|
|
6
6
|
import type { MongoConnection, MongoRepositoryConfig } from './types';
|
|
7
|
-
export
|
|
7
|
+
export type MongoClientArgument = MongoConnection;
|
|
8
8
|
/** database name */
|
|
9
|
-
export
|
|
9
|
+
export type DatabaseArgument = string | {
|
|
10
10
|
connection?: MongoConnection;
|
|
11
11
|
database?: string;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type CollectionArgument<T extends Entity<any> = Entity, TDb extends Entity<any> = T> = MongoRepositoryConfig<T, TDb>;
|
|
14
14
|
export declare class MongoClient extends MongoMongoClient implements Injectable<MongoClientArgument> {
|
|
15
15
|
readonly [resolveArgumentType]: MongoClientArgument;
|
|
16
16
|
}
|
|
@@ -2,13 +2,13 @@ import type { Entity, MaybeNewEntity, NewEntity } from "../..";
|
|
|
2
2
|
import type { OptionalId, OptionalUnlessRequiredId, WithId } from 'mongodb';
|
|
3
3
|
import type { ProjectedEntity, Projection } from '../mongo-base.repository';
|
|
4
4
|
import { ProjectionMode } from '../mongo-base.repository';
|
|
5
|
-
export
|
|
5
|
+
export type MongoDocument<T extends MaybeNewEntity> = OptionalUnlessRequiredId<Omit<T, 'id'> & {
|
|
6
6
|
_id: T['id'];
|
|
7
7
|
}>;
|
|
8
|
-
export
|
|
8
|
+
export type MongoDocumentWithPartialId<T extends MaybeNewEntity> = OptionalId<Omit<T, 'id'> & {
|
|
9
9
|
_id?: T['id'];
|
|
10
10
|
}>;
|
|
11
|
-
export
|
|
11
|
+
export type MongoDocumentWithoutId<T extends MaybeNewEntity> = Omit<T, 'id'>;
|
|
12
12
|
export declare function toEntity<T extends Entity>(document: WithId<MongoDocument<T>> | MongoDocument<T>): T;
|
|
13
13
|
export declare function toNewEntity<T extends MaybeNewEntity>(entity: T): NewEntity<T>;
|
|
14
14
|
export declare function toProjectedEntity<T extends Entity, M extends ProjectionMode, P extends Projection<T, M>>(document: MongoDocument<T> | MongoDocumentWithPartialId<T>): ProjectedEntity<T, M, P>;
|
|
@@ -8,41 +8,41 @@ export declare const enum ProjectionMode {
|
|
|
8
8
|
Include = 0,
|
|
9
9
|
Exclude = 1
|
|
10
10
|
}
|
|
11
|
-
export
|
|
11
|
+
export type Projection<T, M extends ProjectionMode> = {
|
|
12
12
|
[P in keyof T]?: M extends ProjectionMode.Include ? true : false;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type ProjectedEntity<T, M extends ProjectionMode, P extends Projection<T, M>> = M extends ProjectionMode.Include ? {
|
|
15
15
|
[K in keyof T]: P[K] extends true ? T[K] : undefined;
|
|
16
16
|
} : {
|
|
17
17
|
[K in keyof T]: P[K] extends false ? undefined : T[K];
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type ReplaceOptions = {
|
|
20
20
|
upsert?: boolean;
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type UpdateOptions = {
|
|
23
23
|
upsert?: boolean;
|
|
24
24
|
};
|
|
25
|
-
export
|
|
25
|
+
export type UpdateResult = {
|
|
26
26
|
matchedCount: number;
|
|
27
27
|
modifiedCount: number;
|
|
28
28
|
};
|
|
29
|
-
export
|
|
29
|
+
export type LoadOptions<T extends Entity> = {
|
|
30
30
|
limit?: number;
|
|
31
31
|
skip?: number;
|
|
32
32
|
sort?: Sort<T>;
|
|
33
33
|
};
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
export
|
|
34
|
+
export type LoadAndDeleteOptions<T extends Entity> = LoadOptions<T>;
|
|
35
|
+
export type LoadManyOptions<T extends Entity> = LoadOptions<T>;
|
|
36
|
+
export type LoadAndUpdateOptions<T extends Entity> = LoadOptions<T> & {
|
|
37
37
|
upsert?: boolean;
|
|
38
38
|
returnDocument?: FindOneAndUpdateOptions['returnDocument'];
|
|
39
39
|
sort?: Sort<T>;
|
|
40
40
|
};
|
|
41
|
-
export
|
|
41
|
+
export type CountOptions = {
|
|
42
42
|
limit?: number;
|
|
43
43
|
skip?: number;
|
|
44
44
|
};
|
|
45
|
-
export
|
|
45
|
+
export type InsertIfNotExistsByFilterItem<T extends Entity> = {
|
|
46
46
|
filter: Filter<T>;
|
|
47
47
|
entity: MaybeNewEntity<T>;
|
|
48
48
|
};
|
|
@@ -3,7 +3,7 @@ import type { BulkWriteResult } from 'mongodb';
|
|
|
3
3
|
import type { Collection } from './classes';
|
|
4
4
|
import type { ReplaceOptions, UpdateOptions } from './mongo-base.repository';
|
|
5
5
|
import type { Filter, UpdateFilter } from './types';
|
|
6
|
-
export
|
|
6
|
+
export type BulkResult = {
|
|
7
7
|
insertedCount: number;
|
|
8
8
|
matchedCount: number;
|
|
9
9
|
modifiedCount: number;
|
|
@@ -6,21 +6,21 @@ import type { Logger } from "../../logger";
|
|
|
6
6
|
import type { Collection } from './classes';
|
|
7
7
|
import { MongoBaseRepository } from './mongo-base.repository';
|
|
8
8
|
import type { TypedIndexDescription } from './types';
|
|
9
|
-
export
|
|
9
|
+
export type MongoEntityRepositoryOptions<T extends Entity<any>> = {
|
|
10
10
|
logger: Logger;
|
|
11
11
|
indexes?: TypedIndexDescription<T>[];
|
|
12
12
|
};
|
|
13
|
-
export
|
|
14
|
-
export
|
|
13
|
+
export type MappingItemTransformer<T extends Entity<any> = any, TKey extends keyof T = any> = (value: T[TKey]) => any;
|
|
14
|
+
export type MappingItem<T extends Entity<any>, TDb extends Entity<any>, TKey extends keyof T = keyof T, TDbKey extends keyof TDb = keyof TDb> = {
|
|
15
15
|
key: TDbKey;
|
|
16
16
|
transform: MappingItemTransformer<T, TKey>;
|
|
17
17
|
};
|
|
18
18
|
export declare function mapTo<T extends Entity<any>, TDb extends Entity<any>, TKey extends keyof T, TDbKey extends keyof TDb>(key: TDbKey, transform: (value: T[TKey]) => TDb[TDbKey]): MappingItem<T, TDb, TKey, TDbKey>;
|
|
19
|
-
export
|
|
19
|
+
export type TransformerMapping<T extends Entity<any>, TDb extends Entity<any>> = {
|
|
20
20
|
[P in keyof T]?: MappingItem<T, TDb, P>;
|
|
21
21
|
};
|
|
22
|
-
export
|
|
23
|
-
export
|
|
22
|
+
export type TransformerMappingMap<T extends Entity<any> = any, TDb extends Entity<any> = any> = Map<keyof T, MappingItem<T, TDb>>;
|
|
23
|
+
export type EntityTransformer<T extends Entity<any>, TDb extends Entity<any>> = {
|
|
24
24
|
/**
|
|
25
25
|
* function to transform the base entity to the mongo entity
|
|
26
26
|
*/
|
|
@@ -34,7 +34,7 @@ export declare type EntityTransformer<T extends Entity<any>, TDb extends Entity<
|
|
|
34
34
|
*/
|
|
35
35
|
mapping?: TransformerMapping<T, TDb>;
|
|
36
36
|
};
|
|
37
|
-
export
|
|
37
|
+
export type InsertIfNotExistsByQueryItem<T extends Entity<any>> = {
|
|
38
38
|
query: Query<T>;
|
|
39
39
|
entity: MaybeNewEntity<T>;
|
|
40
40
|
};
|
|
@@ -2,10 +2,10 @@ import type { Entity } from "..";
|
|
|
2
2
|
import type { Paths, TypedOmit } from "../../types";
|
|
3
3
|
import type * as Mongo from 'mongodb';
|
|
4
4
|
import type { MongoDocument } from './model';
|
|
5
|
-
export
|
|
5
|
+
export type MongoConnection = {
|
|
6
6
|
url: string;
|
|
7
7
|
} & Mongo.MongoClientOptions;
|
|
8
|
-
export
|
|
8
|
+
export type MongoRepositoryConfig<T extends Entity, TDb extends Entity = T> = {
|
|
9
9
|
connection?: MongoConnection;
|
|
10
10
|
database?: string;
|
|
11
11
|
collection: string;
|
|
@@ -14,34 +14,34 @@ export declare type MongoRepositoryConfig<T extends Entity, TDb extends Entity =
|
|
|
14
14
|
database: TDb;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
17
|
+
export type Filter<T extends Entity = Entity> = Mongo.Filter<MongoDocument<T>>;
|
|
18
|
+
export type UpdateFilter<T extends Entity = Entity> = Mongo.UpdateFilter<MongoDocument<T>>;
|
|
19
|
+
export type BulkOperation<T extends Entity = Entity> = InsertOneOperation<T> | ReplaceOneOperation<T> | UpdateOneOperation<T> | UpdateManyOperation<T> | DeleteOneOperation<T> | DeleteManyOperation<T>;
|
|
20
|
+
export type InsertOneOperation<T extends Entity = Entity> = {
|
|
21
21
|
insertOne: Mongo.InsertOneModel<MongoDocument<T>>;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
23
|
+
export type ReplaceOneOperation<T extends Entity = Entity> = {
|
|
24
24
|
replaceOne: Mongo.ReplaceOneModel<MongoDocument<T>>;
|
|
25
25
|
};
|
|
26
|
-
export
|
|
26
|
+
export type UpdateOneOperation<T extends Entity = Entity> = {
|
|
27
27
|
updateOne: Mongo.UpdateOneModel<MongoDocument<T>>;
|
|
28
28
|
};
|
|
29
|
-
export
|
|
29
|
+
export type UpdateManyOperation<T extends Entity = Entity> = {
|
|
30
30
|
updateMany: Mongo.UpdateManyModel<MongoDocument<T>>;
|
|
31
31
|
};
|
|
32
|
-
export
|
|
32
|
+
export type DeleteOneOperation<T extends Entity = Entity> = {
|
|
33
33
|
deleteOne: Mongo.DeleteOneModel<MongoDocument<T>>;
|
|
34
34
|
};
|
|
35
|
-
export
|
|
35
|
+
export type DeleteManyOperation<T extends Entity = Entity> = {
|
|
36
36
|
deleteMany: Mongo.DeleteManyModel<MongoDocument<T>>;
|
|
37
37
|
};
|
|
38
|
-
export
|
|
38
|
+
export type SortObject<T extends Entity = Entity> = {
|
|
39
39
|
[P in keyof MongoDocument<T>]?: 1 | -1;
|
|
40
40
|
};
|
|
41
|
-
export
|
|
42
|
-
export
|
|
43
|
-
export
|
|
44
|
-
export
|
|
41
|
+
export type SortArrayItem<T extends Entity = Entity> = [keyof MongoDocument<T> & string, 1 | -1];
|
|
42
|
+
export type SortArray<T extends Entity = Entity> = SortArrayItem<T>[];
|
|
43
|
+
export type Sort<T extends Entity = Entity> = SortArray<T> | SortObject<T>;
|
|
44
|
+
export type TypedIndexDescription<T extends Entity = Entity> = Omit<Mongo.IndexDescription, 'key' | 'partialFilterExpression'> & {
|
|
45
45
|
key: {
|
|
46
46
|
[P in Paths<T>]?: Mongo.IndexDirection;
|
|
47
47
|
};
|