@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.
Files changed (244) hide show
  1. package/api/client/client.d.ts +3 -3
  2. package/api/default-error-handlers.d.ts +1 -1
  3. package/api/response.d.ts +8 -8
  4. package/api/server/api-controller.d.ts +1 -1
  5. package/api/server/gateway.d.ts +9 -9
  6. package/api/server/middlewares/cors.middleware.d.ts +1 -1
  7. package/api/server/module.d.ts +1 -1
  8. package/api/types.d.ts +30 -30
  9. package/api/utils.d.ts +1 -1
  10. package/authentication/authentication-credentials.service.d.ts +6 -0
  11. package/authentication/authentication-credentials.service.js +17 -0
  12. package/authentication/authentication-credentials.service.js.map +1 -0
  13. package/authentication/authentication-session.service.d.ts +6 -0
  14. package/authentication/authentication-session.service.js +17 -0
  15. package/authentication/authentication-session.service.js.map +1 -0
  16. package/authentication/authentication-token-payload.provider.d.ts +3 -0
  17. package/authentication/authentication-token-payload.provider.js +17 -0
  18. package/authentication/authentication-token-payload.provider.js.map +1 -0
  19. package/authentication/authentication.service.d.ts +42 -0
  20. package/authentication/authentication.service.js +133 -0
  21. package/authentication/authentication.service.js.map +1 -0
  22. package/authentication/models/authentication-credentials.model.d.ts +6 -0
  23. package/authentication/models/authentication-credentials.model.js +37 -0
  24. package/authentication/models/authentication-credentials.model.js.map +1 -0
  25. package/authentication/models/authentication-session.model.d.ts +9 -0
  26. package/authentication/models/authentication-session.model.js +52 -0
  27. package/authentication/models/authentication-session.model.js.map +1 -0
  28. package/authentication/models/index.d.ts +2 -0
  29. package/authentication/models/index.js +19 -0
  30. package/authentication/models/index.js.map +1 -0
  31. package/authentication/tokens.d.ts +2 -0
  32. package/authentication/tokens.js +6 -0
  33. package/authentication/tokens.js.map +1 -0
  34. package/collections/keyed-set.d.ts +1 -1
  35. package/collections/observable/observable-collection.d.ts +1 -1
  36. package/collections/observable/observable-list.d.ts +2 -2
  37. package/container/container.d.ts +3 -3
  38. package/container/decorators.d.ts +3 -3
  39. package/container/interfaces.d.ts +1 -1
  40. package/container/provider.d.ts +6 -6
  41. package/container/resolve-chain.d.ts +2 -2
  42. package/container/token.d.ts +3 -3
  43. package/container/type-info.d.ts +1 -1
  44. package/container/types.d.ts +4 -4
  45. package/core.d.ts +1 -1
  46. package/data-structures/linked-list.d.ts +1 -1
  47. package/data-structures/multi-key-map.d.ts +2 -2
  48. package/data-structures/sorted-array-list.d.ts +1 -1
  49. package/database/entity-repository.d.ts +2 -2
  50. package/database/entity.d.ts +3 -3
  51. package/database/module.d.ts +1 -1
  52. package/database/mongo/classes.d.ts +3 -3
  53. package/database/mongo/model/document.d.ts +3 -3
  54. package/database/mongo/module.d.ts +1 -1
  55. package/database/mongo/mongo-base.repository.d.ts +11 -11
  56. package/database/mongo/mongo-bulk.d.ts +1 -1
  57. package/database/mongo/mongo-entity-repository.d.ts +7 -7
  58. package/database/mongo/types.d.ts +16 -16
  59. package/database/query.d.ts +38 -38
  60. package/disposable/async-disposer.d.ts +3 -3
  61. package/distributed-loop/distributed-loop.d.ts +2 -2
  62. package/error/custom.error.d.ts +1 -1
  63. package/http/client/adapters/undici-http-client.adapter.d.ts +1 -1
  64. package/http/client/http-client-request.d.ts +5 -5
  65. package/http/client/http-client-response.d.ts +2 -2
  66. package/http/client/http-client.d.ts +5 -5
  67. package/http/http-body.d.ts +3 -1
  68. package/http/http-body.js +18 -12
  69. package/http/http-body.js.map +1 -1
  70. package/http/http-form.d.ts +2 -2
  71. package/http/http-headers.d.ts +3 -3
  72. package/http/http-query.d.ts +2 -2
  73. package/http/http-url-parameters.d.ts +2 -2
  74. package/http/http-value-map.d.ts +1 -1
  75. package/http/server/http-server-request.d.ts +1 -1
  76. package/http/server/http-server-response.d.ts +1 -1
  77. package/http/server/http-server.d.ts +1 -1
  78. package/http/server/node/node-http-server.d.ts +1 -1
  79. package/http/types.d.ts +5 -5
  80. package/http/utils.d.ts +3 -3
  81. package/image-service/imgproxy/imgproxy-image-service.d.ts +1 -1
  82. package/json-path/json-path.d.ts +4 -4
  83. package/key-value-store/key-value.store.d.ts +1 -1
  84. package/key-value-store/mongo/module.d.ts +1 -1
  85. package/key-value-store/mongo/mongo-key-value.model.d.ts +1 -1
  86. package/lock/lock.d.ts +4 -4
  87. package/lock/mongo/model.d.ts +1 -1
  88. package/lock/mongo/module.d.ts +1 -1
  89. package/lock/provider.d.ts +1 -1
  90. package/logger/logger.d.ts +6 -6
  91. package/mail/mail.client.d.ts +1 -1
  92. package/mail/models/mail-address.model.d.ts +1 -1
  93. package/mail/models/mail-content.model.d.ts +1 -1
  94. package/mail/models/mail-data.model.d.ts +1 -1
  95. package/mail/models/mail-log.model.d.ts +2 -2
  96. package/mail/models/mail-send-result.model.d.ts +1 -1
  97. package/mail/models/mail-template.model.d.ts +1 -1
  98. package/mail/module.d.ts +1 -1
  99. package/mail/repositories/mongo-mail-log.repository.d.ts +2 -2
  100. package/message-bus/local/types.d.ts +1 -1
  101. package/message-bus/message-bus.d.ts +1 -1
  102. package/migration/migration-state.d.ts +2 -2
  103. package/migration/migrator.d.ts +4 -4
  104. package/migration/mongo/module.d.ts +1 -1
  105. package/module/module-metric-reporter.d.ts +2 -2
  106. package/module/module.d.ts +1 -1
  107. package/module/modules/function.module.d.ts +1 -1
  108. package/module/modules/web-server.module.d.ts +1 -1
  109. package/notification/api.d.ts +1 -1
  110. package/notification/module.d.ts +1 -1
  111. package/object-storage/object-storage.d.ts +2 -2
  112. package/object-storage/object.d.ts +1 -1
  113. package/object-storage/s3/s3.object-storage-provider.d.ts +1 -1
  114. package/openid-connect/mongo-oidc-state.repository.d.ts +1 -1
  115. package/openid-connect/oidc-configuration.service.d.ts +1 -1
  116. package/openid-connect/oidc-state.model.d.ts +2 -2
  117. package/openid-connect/oidc.service-model.d.ts +8 -8
  118. package/orm/types.d.ts +4 -4
  119. package/package.json +3 -3
  120. package/pdf/pdf.service.d.ts +3 -3
  121. package/pool/pool.d.ts +4 -4
  122. package/promise/cancelable-promise.d.ts +1 -1
  123. package/promise/lazy-promise.d.ts +1 -1
  124. package/queue/mongo/job.d.ts +2 -2
  125. package/queue/mongo/queue.js +2 -2
  126. package/queue/mongo/queue.js.map +1 -1
  127. package/queue/queue.d.ts +11 -6
  128. package/queue/queue.js +2 -1
  129. package/queue/queue.js.map +1 -1
  130. package/reflection/registry.d.ts +9 -9
  131. package/reflection/types.d.ts +32 -32
  132. package/reflection/utils.d.ts +5 -5
  133. package/rpc/endpoints/message-port.rpc-endpoint.d.ts +3 -3
  134. package/rpc/model.d.ts +22 -22
  135. package/rpc/rpc.d.ts +1 -1
  136. package/rxjs/intersection-observer.d.ts +1 -1
  137. package/rxjs/mutation-observer.d.ts +1 -1
  138. package/rxjs/performance-observer.d.ts +1 -1
  139. package/rxjs/resize-observer.d.ts +1 -1
  140. package/rxjs/slow-array.d.ts +1 -1
  141. package/rxjs/touch.d.ts +1 -1
  142. package/schema/constraints/generic.d.ts +2 -2
  143. package/schema/constraints/length.d.ts +1 -1
  144. package/schema/decorators/types.d.ts +3 -3
  145. package/schema/schema.d.ts +4 -4
  146. package/schema/schema.error.d.ts +1 -1
  147. package/schema/schema.js +10 -13
  148. package/schema/schema.js.map +1 -1
  149. package/schema/schemas/any.d.ts +1 -1
  150. package/schema/schemas/array.d.ts +1 -1
  151. package/schema/schemas/boolean.d.ts +1 -1
  152. package/schema/schemas/date.d.ts +1 -1
  153. package/schema/schemas/enumeration.d.ts +1 -1
  154. package/schema/schemas/instance.d.ts +1 -1
  155. package/schema/schemas/literal.d.ts +1 -1
  156. package/schema/schemas/nullable.d.ts +1 -1
  157. package/schema/schemas/number.d.ts +1 -1
  158. package/schema/schemas/object.d.ts +1 -1
  159. package/schema/schemas/one-or-many.d.ts +2 -2
  160. package/schema/schemas/optional.d.ts +1 -1
  161. package/schema/schemas/readable-stream.d.ts +1 -1
  162. package/schema/schemas/record.d.ts +1 -1
  163. package/schema/schemas/regexp.d.ts +1 -1
  164. package/schema/schemas/string.d.ts +1 -1
  165. package/schema/schemas/uint8-array.d.ts +1 -1
  166. package/schema/schemas/union.d.ts +1 -1
  167. package/schema/schemas/unknown.d.ts +1 -1
  168. package/schema/transformers/generic.d.ts +1 -1
  169. package/schema/types.d.ts +31 -31
  170. package/search-index/elastic/config.d.ts +1 -1
  171. package/search-index/elastic/model/elastic-query.d.ts +15 -15
  172. package/search-index/elastic/model/index-mapping.d.ts +14 -14
  173. package/search-index/elastic/model/sort.d.ts +3 -3
  174. package/search-index/elastic/module.d.ts +1 -1
  175. package/search-index/search-index.d.ts +1 -1
  176. package/search-index/search-result.d.ts +2 -2
  177. package/serializer/handlers/error.d.ts +1 -1
  178. package/serializer/handlers/map.d.ts +1 -1
  179. package/serializer/handlers/regex.d.ts +1 -1
  180. package/serializer/handlers/set.d.ts +1 -1
  181. package/serializer/serializable.d.ts +6 -6
  182. package/serializer/serializer.d.ts +1 -1
  183. package/serializer/types.d.ts +15 -15
  184. package/sse/server-sent-events.d.ts +3 -3
  185. package/tailwind/theme-adapter.d.ts +1 -1
  186. package/templates/module.d.ts +1 -1
  187. package/templates/providers/file.provider-template.d.ts +2 -2
  188. package/templates/providers/file.provider-template.js +2 -1
  189. package/templates/providers/file.provider-template.js.map +1 -1
  190. package/templates/renderers/handlebars.template-renderer.d.ts +9 -9
  191. package/templates/renderers/mjml.template-renderer.d.ts +3 -3
  192. package/templates/renderers/string.template-renderer.d.ts +1 -1
  193. package/templates/resolvers/file.template-resolver.d.ts +2 -2
  194. package/templates/template.model.d.ts +1 -1
  195. package/templates/template.renderer.d.ts +4 -4
  196. package/templates/template.service.d.ts +1 -1
  197. package/text/dynamic-text.model.d.ts +1 -1
  198. package/text/localizable-text.model.d.ts +1 -1
  199. package/text/localization.service.d.ts +11 -11
  200. package/theme/theme-service.d.ts +6 -6
  201. package/threading/thread-pool.d.ts +1 -1
  202. package/threading/thread-worker.d.ts +1 -1
  203. package/types/geo-json.d.ts +12 -12
  204. package/types.d.ts +91 -91
  205. package/utils/any-iterable-iterator.d.ts +3 -3
  206. package/utils/async-iterable-helpers/parallel/types.d.ts +2 -2
  207. package/utils/async-iterable-helpers/types.d.ts +7 -7
  208. package/utils/backoff.d.ts +5 -5
  209. package/utils/benchmark.d.ts +1 -1
  210. package/utils/binary-search.d.ts +1 -1
  211. package/utils/binary.js.map +1 -1
  212. package/utils/cancellation-token.d.ts +1 -1
  213. package/utils/compression.d.ts +1 -1
  214. package/utils/cryptography.d.ts +11 -11
  215. package/utils/date-time.d.ts +8 -7
  216. package/utils/date-time.js +6 -2
  217. package/utils/date-time.js.map +1 -1
  218. package/utils/equals.d.ts +3 -3
  219. package/utils/factory-map.d.ts +1 -1
  220. package/utils/format-error.d.ts +1 -1
  221. package/utils/function/memoize.d.ts +1 -1
  222. package/utils/helpers.d.ts +1 -1
  223. package/utils/iterable-helpers/types.d.ts +6 -6
  224. package/utils/jwt.d.ts +4 -4
  225. package/utils/math.d.ts +1 -1
  226. package/utils/merge.d.ts +1 -1
  227. package/utils/middleware.d.ts +9 -9
  228. package/utils/moving-metric.d.ts +1 -1
  229. package/utils/object/decycle.d.ts +1 -1
  230. package/utils/object/dereference.d.ts +1 -1
  231. package/utils/object/forward-ref.d.ts +2 -2
  232. package/utils/object/lazy-property.d.ts +5 -5
  233. package/utils/object/merge.d.ts +1 -1
  234. package/utils/object/property-name.d.ts +5 -5
  235. package/utils/patch-worker.d.ts +1 -1
  236. package/utils/periodic-sampler.d.ts +1 -1
  237. package/utils/provider-function-iterable.d.ts +2 -2
  238. package/utils/proxy.d.ts +1 -1
  239. package/utils/singleton.d.ts +2 -2
  240. package/utils/sort.d.ts +2 -2
  241. package/utils/stream/stream-helper-types.d.ts +5 -5
  242. package/utils/type-guards.d.ts +3 -3
  243. package/utils/url-builder.d.ts +4 -4
  244. 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,2 @@
1
+ export * from './authentication-credentials.model';
2
+ export * from './authentication-session.model';
@@ -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,2 @@
1
+ import type { AuthenticationServiceOptions } from './authentication.service';
2
+ export declare const AUTHENTICATION_SERVICE_OPTIONS: import("../container").InjectionToken<AuthenticationServiceOptions, any>;
@@ -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 declare type Selector<T> = (value: T) => any;
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;
@@ -1,6 +1,6 @@
1
1
  import type { Observable } from 'rxjs';
2
2
  import type { Collection } from '../collection';
3
- export declare type ObservableCollectionChangeEvent<T> = {
3
+ export type ObservableCollectionChangeEvent<T> = {
4
4
  add?: T[];
5
5
  remove?: T[];
6
6
  };
@@ -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 declare type ObservableListIndexedEvent<T> = {
5
+ export type ObservableListIndexedEvent<T> = {
6
6
  value: T;
7
7
  index: number;
8
8
  };
9
- export declare type ObservableListIndexedChangeEvent<T> = {
9
+ export type ObservableListIndexedChangeEvent<T> = {
10
10
  add?: ObservableListIndexedEvent<T>[];
11
11
  remove?: ObservableListIndexedEvent<T>[];
12
12
  };
@@ -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 declare type Lifecycle = 'transient' | 'singleton' | 'resolution';
14
- export declare type RegistrationOptions<T, A = unknown> = {
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 declare type Registration<T = any, A = any> = {
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
- declare type InjectDecorator = Decorator<'property' | 'accessor' | 'constructorParameter'>;
8
- export declare type InjectableOptions<T, A> = RegistrationOptions<T> & {
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 declare type InjectableOptionsWithoutLifecycle<T, A> = Simplify<TypedOmit<InjectableOptions<T, A>, 'lifecycle'>>;
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 declare type InjectableArgument<T, Fallback> = T extends Injectable<infer A> ? A : Fallback;
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
@@ -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 declare type Factory<T, A = any> = (argument: InjectableArgument<T, A> | undefined, context: ResolveContext) => T | Promise<T>;
6
- export declare type Provider<T = any, A = any> = ClassProvider<T> | ValueProvider<T> | TokenProvider<T, A> | FactoryProvider<T, A>;
7
- export declare type ClassProvider<T = any> = {
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 declare type ValueProvider<T = any> = {
10
+ export type ValueProvider<T = any> = {
11
11
  useValue: T;
12
12
  };
13
- export declare type TokenProvider<T = any, A = any> = {
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 declare type FactoryProvider<T = any, A = unknown> = {
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 declare type ResolveChainNodeBase<Type extends string> = {
3
+ export type ResolveChainNodeBase<Type extends string> = {
4
4
  type: Type;
5
5
  };
6
- export declare type ResolveChainNode = ResolveChainNodeBase<'token'> & {
6
+ export type ResolveChainNode = ResolveChainNodeBase<'token'> & {
7
7
  token: InjectionToken;
8
8
  } | ResolveChainNodeBase<'parameter'> & {
9
9
  constructor: AbstractConstructor;
@@ -1,10 +1,10 @@
1
1
  import type { Constructor } from "../types";
2
2
  declare const parameter: unique symbol;
3
- export declare type ParameterizedInjectionToken<T, A> = SimpleInjectionToken<T> & {
3
+ export type ParameterizedInjectionToken<T, A> = SimpleInjectionToken<T> & {
4
4
  [parameter]?: A;
5
5
  };
6
- export declare type SimpleInjectionToken<T> = Constructor<T> | Function | object | string | symbol;
7
- export declare type InjectionToken<T = any, A = any> = SimpleInjectionToken<T> | ParameterizedInjectionToken<T, A>;
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 {};
@@ -1,6 +1,6 @@
1
1
  import type { InjectionToken } from './token';
2
2
  import type { ArgumentProvider, ForwardRefInjectionToken, Mapper } from './types';
3
- export declare type InjectMetadata = {
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 */
@@ -1,8 +1,8 @@
1
1
  import type { Container } from './container';
2
2
  import type { InjectionToken } from './token';
3
- export declare type ResolveContext = Pick<Container, 'resolve' | 'resolveAsync'> & {
3
+ export type ResolveContext = Pick<Container, 'resolve' | 'resolveAsync'> & {
4
4
  isAsync: boolean;
5
5
  };
6
- export declare type Mapper<T = any, U = unknown> = (value: T) => U | Promise<U>;
7
- export declare type ArgumentProvider<T = unknown> = (context: ResolveContext) => T | Promise<T>;
8
- export declare type ForwardRefInjectionToken<T = any, A = any> = Exclude<InjectionToken<T, A>, Function> | (() => InjectionToken<T, A>);
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 declare type CoreConfiguration = {
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 declare type LinkedListNode<T> = {
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
- declare type Node = {
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
- declare type NewMapProvider = () => Map<any, Node>;
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 declare type RangeType = 'inclusive' | 'exclusive';
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 declare type UpdateOptions = {
4
+ export type UpdateOptions = {
5
5
  upsert?: boolean;
6
6
  };
7
- export declare type EntityPatch<T extends Entity = Entity> = Partial<Omit<T, 'id'>>;
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>;
@@ -1,7 +1,7 @@
1
- export declare type Entity<Id = string> = {
1
+ export type Entity<Id = string> = {
2
2
  id: Id;
3
3
  };
4
- export declare type NewEntity<T extends Entity | MaybeNewEntity = Entity> = Omit<T, 'id'>;
5
- export declare type MaybeNewEntity<T extends Entity = Entity> = NewEntity<T> & {
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
  };
@@ -1,4 +1,4 @@
1
- export declare type DatabaseModuleConfig = {
1
+ export type DatabaseModuleConfig = {
2
2
  idLength: number;
3
3
  idAlphabet: string;
4
4
  };
@@ -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 declare type MongoClientArgument = MongoConnection;
7
+ export type MongoClientArgument = MongoConnection;
8
8
  /** database name */
9
- export declare type DatabaseArgument = string | {
9
+ export type DatabaseArgument = string | {
10
10
  connection?: MongoConnection;
11
11
  database?: string;
12
12
  };
13
- export declare type CollectionArgument<T extends Entity<any> = Entity, TDb extends Entity<any> = T> = MongoRepositoryConfig<T, TDb>;
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 declare type MongoDocument<T extends MaybeNewEntity> = OptionalUnlessRequiredId<Omit<T, 'id'> & {
5
+ export type MongoDocument<T extends MaybeNewEntity> = OptionalUnlessRequiredId<Omit<T, 'id'> & {
6
6
  _id: T['id'];
7
7
  }>;
8
- export declare type MongoDocumentWithPartialId<T extends MaybeNewEntity> = OptionalId<Omit<T, 'id'> & {
8
+ export type MongoDocumentWithPartialId<T extends MaybeNewEntity> = OptionalId<Omit<T, 'id'> & {
9
9
  _id?: T['id'];
10
10
  }>;
11
- export declare type MongoDocumentWithoutId<T extends MaybeNewEntity> = Omit<T, 'id'>;
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>;
@@ -1,5 +1,5 @@
1
1
  import type { MongoConnection } from './types';
2
- export declare type MongoModuleConfig = {
2
+ export type MongoModuleConfig = {
3
3
  defaultConnection: MongoConnection;
4
4
  defaultDatabase: string | undefined;
5
5
  logPrefix: string;
@@ -8,41 +8,41 @@ export declare const enum ProjectionMode {
8
8
  Include = 0,
9
9
  Exclude = 1
10
10
  }
11
- export declare type Projection<T, M extends ProjectionMode> = {
11
+ export type Projection<T, M extends ProjectionMode> = {
12
12
  [P in keyof T]?: M extends ProjectionMode.Include ? true : false;
13
13
  };
14
- export declare type ProjectedEntity<T, M extends ProjectionMode, P extends Projection<T, M>> = M extends ProjectionMode.Include ? {
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 declare type ReplaceOptions = {
19
+ export type ReplaceOptions = {
20
20
  upsert?: boolean;
21
21
  };
22
- export declare type UpdateOptions = {
22
+ export type UpdateOptions = {
23
23
  upsert?: boolean;
24
24
  };
25
- export declare type UpdateResult = {
25
+ export type UpdateResult = {
26
26
  matchedCount: number;
27
27
  modifiedCount: number;
28
28
  };
29
- export declare type LoadOptions<T extends Entity> = {
29
+ export type LoadOptions<T extends Entity> = {
30
30
  limit?: number;
31
31
  skip?: number;
32
32
  sort?: Sort<T>;
33
33
  };
34
- export declare type LoadAndDeleteOptions<T extends Entity> = LoadOptions<T>;
35
- export declare type LoadManyOptions<T extends Entity> = LoadOptions<T>;
36
- export declare type LoadAndUpdateOptions<T extends Entity> = LoadOptions<T> & {
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 declare type CountOptions = {
41
+ export type CountOptions = {
42
42
  limit?: number;
43
43
  skip?: number;
44
44
  };
45
- export declare type InsertIfNotExistsByFilterItem<T extends Entity> = {
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 declare type BulkResult = {
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 declare type MongoEntityRepositoryOptions<T extends Entity<any>> = {
9
+ export type MongoEntityRepositoryOptions<T extends Entity<any>> = {
10
10
  logger: Logger;
11
11
  indexes?: TypedIndexDescription<T>[];
12
12
  };
13
- export declare type MappingItemTransformer<T extends Entity<any> = any, TKey extends keyof T = any> = (value: T[TKey]) => any;
14
- export declare type MappingItem<T extends Entity<any>, TDb extends Entity<any>, TKey extends keyof T = keyof T, TDbKey extends keyof TDb = keyof TDb> = {
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 declare type TransformerMapping<T extends Entity<any>, TDb extends Entity<any>> = {
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 declare type TransformerMappingMap<T extends Entity<any> = any, TDb extends Entity<any> = any> = Map<keyof T, MappingItem<T, TDb>>;
23
- export declare type EntityTransformer<T extends Entity<any>, TDb extends Entity<any>> = {
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 declare type InsertIfNotExistsByQueryItem<T extends Entity<any>> = {
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 declare type MongoConnection = {
5
+ export type MongoConnection = {
6
6
  url: string;
7
7
  } & Mongo.MongoClientOptions;
8
- export declare type MongoRepositoryConfig<T extends Entity, TDb extends Entity = T> = {
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 declare type Filter<T extends Entity = Entity> = Mongo.Filter<MongoDocument<T>>;
18
- export declare type UpdateFilter<T extends Entity = Entity> = Mongo.UpdateFilter<MongoDocument<T>>;
19
- export declare type BulkOperation<T extends Entity = Entity> = InsertOneOperation<T> | ReplaceOneOperation<T> | UpdateOneOperation<T> | UpdateManyOperation<T> | DeleteOneOperation<T> | DeleteManyOperation<T>;
20
- export declare type InsertOneOperation<T extends Entity = Entity> = {
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 declare type ReplaceOneOperation<T extends Entity = Entity> = {
23
+ export type ReplaceOneOperation<T extends Entity = Entity> = {
24
24
  replaceOne: Mongo.ReplaceOneModel<MongoDocument<T>>;
25
25
  };
26
- export declare type UpdateOneOperation<T extends Entity = Entity> = {
26
+ export type UpdateOneOperation<T extends Entity = Entity> = {
27
27
  updateOne: Mongo.UpdateOneModel<MongoDocument<T>>;
28
28
  };
29
- export declare type UpdateManyOperation<T extends Entity = Entity> = {
29
+ export type UpdateManyOperation<T extends Entity = Entity> = {
30
30
  updateMany: Mongo.UpdateManyModel<MongoDocument<T>>;
31
31
  };
32
- export declare type DeleteOneOperation<T extends Entity = Entity> = {
32
+ export type DeleteOneOperation<T extends Entity = Entity> = {
33
33
  deleteOne: Mongo.DeleteOneModel<MongoDocument<T>>;
34
34
  };
35
- export declare type DeleteManyOperation<T extends Entity = Entity> = {
35
+ export type DeleteManyOperation<T extends Entity = Entity> = {
36
36
  deleteMany: Mongo.DeleteManyModel<MongoDocument<T>>;
37
37
  };
38
- export declare type SortObject<T extends Entity = Entity> = {
38
+ export type SortObject<T extends Entity = Entity> = {
39
39
  [P in keyof MongoDocument<T>]?: 1 | -1;
40
40
  };
41
- export declare type SortArrayItem<T extends Entity = Entity> = [keyof MongoDocument<T> & string, 1 | -1];
42
- export declare type SortArray<T extends Entity = Entity> = SortArrayItem<T>[];
43
- export declare type Sort<T extends Entity = Entity> = SortArray<T> | SortObject<T>;
44
- export declare type TypedIndexDescription<T extends Entity = Entity> = Omit<Mongo.IndexDescription, 'key' | 'partialFilterExpression'> & {
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
  };