@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
@@ -1,101 +1,101 @@
1
1
  import type { Flatten, StringMap } from "../types";
2
2
  import type { Geometry } from "../types/geo-json";
3
- export declare type QueryOptions<T = any> = {
3
+ export type QueryOptions<T = any> = {
4
4
  sort?: Sort<T>[];
5
5
  skip?: number;
6
6
  limit?: number;
7
7
  };
8
- export declare type LogicalQuery<T = any> = LogicalAndQuery<T> | LogicalOrQuery<T> | LogicalNorQuery<T>;
9
- export declare type LogicalQueryTypes = keyof (LogicalAndQuery & LogicalOrQuery & LogicalNorQuery);
8
+ export type LogicalQuery<T = any> = LogicalAndQuery<T> | LogicalOrQuery<T> | LogicalNorQuery<T>;
9
+ export type LogicalQueryTypes = keyof (LogicalAndQuery & LogicalOrQuery & LogicalNorQuery);
10
10
  export declare const allLogicalQueryTypes: LogicalQueryTypes[];
11
- export declare type ComparisonQueryBody<T = any> = {
11
+ export type ComparisonQueryBody<T = any> = {
12
12
  [P in keyof T]?: ComparisonQueryOrValue<T[P]>;
13
13
  } & StringMap<ComparisonQueryOrValue>;
14
- export declare type ComparisonQueryOrValue<T = any> = ComparisonQuery<T> | T | Flatten<T>;
15
- export declare type ComparisonQuery<T = any> = Partial<ComparisonNotQuery<T> & ComparisonEqualsQuery<T> & ComparisonNotEqualsQuery<T> & ComparisonExistsQuery & ComparisonItemQuery<T> & ComparisonInQuery<T> & ComparisonNotInQuery<T> & ComparisonAllQuery<T> & ComparisonGreaterThanQuery<T> & ComparisonGreaterThanOrEqualsQuery<T> & ComparisonLessThanQuery<T> & ComparisonLessThanOrEqualsQuery<T> & ComparisonRegexQuery & ComparisonTextQuery & ComparisonGeoShapeQuery & ComparisonGeoDistanceQuery>;
16
- export declare type ComparisonQueryTypes = keyof ComparisonQuery;
14
+ export type ComparisonQueryOrValue<T = any> = ComparisonQuery<T> | T | Flatten<T>;
15
+ export type ComparisonQuery<T = any> = Partial<ComparisonNotQuery<T> & ComparisonEqualsQuery<T> & ComparisonNotEqualsQuery<T> & ComparisonExistsQuery & ComparisonItemQuery<T> & ComparisonInQuery<T> & ComparisonNotInQuery<T> & ComparisonAllQuery<T> & ComparisonGreaterThanQuery<T> & ComparisonGreaterThanOrEqualsQuery<T> & ComparisonLessThanQuery<T> & ComparisonLessThanOrEqualsQuery<T> & ComparisonRegexQuery & ComparisonTextQuery & ComparisonGeoShapeQuery & ComparisonGeoDistanceQuery>;
16
+ export type ComparisonQueryTypes = keyof ComparisonQuery;
17
17
  export declare const allComparisonQueryTypes: ComparisonQueryTypes[];
18
- export declare type SpecialQuery<T = any> = Partial<TextSpanQuery<T>>;
19
- export declare type SpecialQueryTypes = keyof SpecialQuery;
18
+ export type SpecialQuery<T = any> = Partial<TextSpanQuery<T>>;
19
+ export type SpecialQueryTypes = keyof SpecialQuery;
20
20
  export declare const allSpecialQueryTypes: SpecialQueryTypes[];
21
- export declare type Query<T = any> = LogicalQuery<T> | (ComparisonQueryBody<T> & SpecialQuery<T>);
22
- export declare type QueryTypes = LogicalQueryTypes | ComparisonQueryTypes | SpecialQueryTypes;
21
+ export type Query<T = any> = LogicalQuery<T> | (ComparisonQueryBody<T> & SpecialQuery<T>);
22
+ export type QueryTypes = LogicalQueryTypes | ComparisonQueryTypes | SpecialQueryTypes;
23
23
  export declare const allQueryTypes: ("$and" | "$or" | "$nor" | "$not" | "$eq" | "$neq" | "$exists" | "$item" | "$in" | "$nin" | "$all" | "$gt" | "$gte" | "$lt" | "$lte" | "$regex" | "$text" | "$geoShape" | "$geoDistance" | "$textSpan")[];
24
- export declare type Order = 'asc' | 'desc';
24
+ export type Order = 'asc' | 'desc';
25
25
  export declare const allOrders: Order[];
26
- export declare type Operator = 'and' | 'or';
26
+ export type Operator = 'and' | 'or';
27
27
  export declare const allOperators: Operator[];
28
- export declare type Sort<T = any> = {
28
+ export type Sort<T = any> = {
29
29
  field: (Extract<keyof T, string> | '$score');
30
30
  order?: Order;
31
31
  };
32
- export declare type LogicalAndQuery<T = any> = {
32
+ export type LogicalAndQuery<T = any> = {
33
33
  $and: Query<T>[];
34
34
  };
35
- export declare type LogicalOrQuery<T = any> = {
35
+ export type LogicalOrQuery<T = any> = {
36
36
  $or: Query<T>[];
37
37
  };
38
- export declare type LogicalNorQuery<T = any> = {
38
+ export type LogicalNorQuery<T = any> = {
39
39
  $nor: Query<T>[];
40
40
  };
41
- export declare type ComparisonValue<T> = T | Flatten<T>;
42
- export declare type ComparisonValueWithRegex<T> = T extends string ? ComparisonValue<T | RegExp> : T extends string[] ? ComparisonValue<(Flatten<T> | RegExp)[]> : (T | Flatten<T>);
43
- export declare type ComparisonNotQuery<T = any> = {
41
+ export type ComparisonValue<T> = T | Flatten<T>;
42
+ export type ComparisonValueWithRegex<T> = T extends string ? ComparisonValue<T | RegExp> : T extends string[] ? ComparisonValue<(Flatten<T> | RegExp)[]> : (T | Flatten<T>);
43
+ export type ComparisonNotQuery<T = any> = {
44
44
  $not: ComparisonQuery<T>;
45
45
  };
46
- export declare type ComparisonEqualsQuery<T = any> = {
46
+ export type ComparisonEqualsQuery<T = any> = {
47
47
  $eq: ComparisonValueWithRegex<T>;
48
48
  };
49
- export declare type ComparisonNotEqualsQuery<T = any> = {
49
+ export type ComparisonNotEqualsQuery<T = any> = {
50
50
  $neq: ComparisonValueWithRegex<T>;
51
51
  };
52
- export declare type ComparisonExistsQuery = {
52
+ export type ComparisonExistsQuery = {
53
53
  $exists: ComparisonValue<boolean>;
54
54
  };
55
- export declare type ComparisonItemQuery<T = any> = {
55
+ export type ComparisonItemQuery<T = any> = {
56
56
  $item: T extends (infer U)[] ? U extends Record<any, any> ? Query<U> : ComparisonQuery<U> : never;
57
57
  };
58
- export declare type ComparisonInQuery<T = any> = {
58
+ export type ComparisonInQuery<T = any> = {
59
59
  $in: ComparisonValueWithRegex<T>[];
60
60
  };
61
- export declare type ComparisonNotInQuery<T = any> = {
61
+ export type ComparisonNotInQuery<T = any> = {
62
62
  $nin: ComparisonValueWithRegex<T>[];
63
63
  };
64
- export declare type ComparisonAllQuery<T = any> = {
64
+ export type ComparisonAllQuery<T = any> = {
65
65
  $all: ComparisonValueWithRegex<T>[];
66
66
  };
67
- export declare type ComparisonGreaterThanQuery<T = any> = {
67
+ export type ComparisonGreaterThanQuery<T = any> = {
68
68
  $gt: ComparisonValue<T>;
69
69
  };
70
- export declare type ComparisonGreaterThanOrEqualsQuery<T = any> = {
70
+ export type ComparisonGreaterThanOrEqualsQuery<T = any> = {
71
71
  $gte: ComparisonValue<T>;
72
72
  };
73
- export declare type ComparisonLessThanQuery<T = any> = {
73
+ export type ComparisonLessThanQuery<T = any> = {
74
74
  $lt: ComparisonValue<T>;
75
75
  };
76
- export declare type ComparisonLessThanOrEqualsQuery<T = any> = {
76
+ export type ComparisonLessThanOrEqualsQuery<T = any> = {
77
77
  $lte: ComparisonValue<T>;
78
78
  };
79
- export declare type ComparisonRegexQuery = {
79
+ export type ComparisonRegexQuery = {
80
80
  $regex: string | RegExp | {
81
81
  pattern: string;
82
82
  flags: string;
83
83
  };
84
84
  };
85
- export declare type ComparisonTextQuery = {
85
+ export type ComparisonTextQuery = {
86
86
  $text: string | {
87
87
  text: string;
88
88
  operator?: Operator;
89
89
  };
90
90
  };
91
- export declare type GeoShapeRelation = 'intersects' | 'within' | 'disjoint' | 'contains';
92
- export declare type ComparisonGeoShapeQuery = {
91
+ export type GeoShapeRelation = 'intersects' | 'within' | 'disjoint' | 'contains';
92
+ export type ComparisonGeoShapeQuery = {
93
93
  $geoShape: {
94
94
  geometry: Geometry;
95
95
  relation: GeoShapeRelation;
96
96
  };
97
97
  };
98
- export declare type ComparisonGeoDistanceQuery = {
98
+ export type ComparisonGeoDistanceQuery = {
99
99
  $geoDistance: {
100
100
  longitude: number;
101
101
  latitude: number;
@@ -109,9 +109,9 @@ export declare type ComparisonGeoDistanceQuery = {
109
109
  minDistance?: number;
110
110
  };
111
111
  };
112
- export declare type TextSpanQueryMode = 'best' | 'most' | 'cross';
112
+ export type TextSpanQueryMode = 'best' | 'most' | 'cross';
113
113
  export declare const allTextSpanQueryModes: TextSpanQueryMode[];
114
- export declare type TextSpanQuery<T = any> = {
114
+ export type TextSpanQuery<T = any> = {
115
115
  $textSpan: {
116
116
  fields: (Extract<keyof T, string>)[];
117
117
  text: string;
@@ -3,12 +3,12 @@ import { CancellationToken } from '../utils/cancellation-token';
3
3
  import type { AsyncDisposable, Disposable } from './disposable';
4
4
  import { disposeAsync } from './disposable';
5
5
  declare const deferrerToken: unique symbol;
6
- export declare type TaskFunction = () => any;
7
- export declare type Task = {
6
+ export type TaskFunction = () => any;
7
+ export type Task = {
8
8
  priority: number;
9
9
  taskFunction: TaskFunction;
10
10
  };
11
- export declare type Deferrer = {
11
+ export type Deferrer = {
12
12
  [deferrerToken]: CancellationToken;
13
13
  yield(): void;
14
14
  };
@@ -3,9 +3,9 @@ import { resolveArgumentType } from "../container";
3
3
  import { LockProvider } from "../lock";
4
4
  import type { ReadonlyCancellationToken } from "../utils/cancellation-token";
5
5
  import type { LoopController } from './controller';
6
- export declare type LoopFunction = (controller: LoopController) => any | Promise<any>;
6
+ export type LoopFunction = (controller: LoopController) => any | Promise<any>;
7
7
  /** loop key */
8
- export declare type DistributedLoopArgument = string;
8
+ export type DistributedLoopArgument = string;
9
9
  export declare class DistributedLoop implements Injectable<DistributedLoopArgument> {
10
10
  private readonly key;
11
11
  private readonly lockProvider;
@@ -1,4 +1,4 @@
1
- export declare type CustomErrorOptions = {
1
+ export type CustomErrorOptions = {
2
2
  /**
3
3
  * name of error
4
4
  *
@@ -2,7 +2,7 @@ import type { Dispatcher } from 'undici';
2
2
  import type { HttpClientRequest } from '../http-client-request';
3
3
  import { HttpClientResponse } from '../http-client-response';
4
4
  import { HttpClientAdapter } from '../http-client.adapter';
5
- export declare type UndiciHttpClientAdapterOptions = {
5
+ export type UndiciHttpClientAdapterOptions = {
6
6
  dispatcher?: Dispatcher;
7
7
  };
8
8
  export declare class UndiciHttpClientAdapter extends HttpClientAdapter {
@@ -12,7 +12,7 @@ import type { HttpUrlParametersObject } from '../http-url-parameters';
12
12
  import { HttpUrlParameters } from '../http-url-parameters';
13
13
  import type { HttpMethod } from '../types';
14
14
  /** only one type at a time is supported. If multiple are set, behaviour is undefined */
15
- export declare type HttpRequestBody = {
15
+ export type HttpRequestBody = {
16
16
  text?: string;
17
17
  json?: UndefinableJson;
18
18
  form?: HttpForm;
@@ -20,7 +20,7 @@ export declare type HttpRequestBody = {
20
20
  blob?: Blob;
21
21
  stream?: ReadableStream<Uint8Array>;
22
22
  };
23
- export declare type HttpRequestAuthorization = {
23
+ export type HttpRequestAuthorization = {
24
24
  basic?: {
25
25
  username: string;
26
26
  password: string;
@@ -28,7 +28,7 @@ export declare type HttpRequestAuthorization = {
28
28
  bearer?: string;
29
29
  token?: string;
30
30
  };
31
- export declare type HttpClientRequestOptions = Partial<TypedOmit<HttpClientRequest, 'url' | 'method' | 'abortToken' | 'abort' | 'headers' | 'query' | 'body'>> & {
31
+ export type HttpClientRequestOptions = Partial<TypedOmit<HttpClientRequest, 'url' | 'method' | 'abortToken' | 'abort' | 'headers' | 'query' | 'body'>> & {
32
32
  urlParameter?: HttpUrlParametersObject | HttpUrlParameters;
33
33
  headers?: HttpHeadersObject | HttpHeaders;
34
34
  query?: HttpQueryObject | HttpQuery;
@@ -42,11 +42,11 @@ export declare type HttpClientRequestOptions = Partial<TypedOmit<HttpClientReque
42
42
  };
43
43
  abortToken?: ReadonlyCancellationToken;
44
44
  };
45
- export declare type HttpClientRequestObject = HttpClientRequestOptions & {
45
+ export type HttpClientRequestObject = HttpClientRequestOptions & {
46
46
  url: string;
47
47
  method?: HttpMethod;
48
48
  };
49
- export declare type CredentialsOptions = 'omit' | 'same-origin' | 'include';
49
+ export type CredentialsOptions = 'omit' | 'same-origin' | 'include';
50
50
  export declare class HttpClientRequest implements Disposable {
51
51
  private readonly _abortToken;
52
52
  url: string;
@@ -4,11 +4,11 @@ import { HttpBody } from '../http-body';
4
4
  import type { HttpHeadersObject } from '../http-headers';
5
5
  import { HttpHeaders } from '../http-headers';
6
6
  import type { HttpClientRequest, HttpClientRequestObject } from './http-client-request';
7
- export declare type HttpClientResponseObject = TypedOmit<HttpClientResponse, 'hasBody' | 'request' | 'headers' | 'close' | 'asObject'> & {
7
+ export type HttpClientResponseObject = TypedOmit<HttpClientResponse, 'hasBody' | 'request' | 'headers' | 'close' | 'asObject'> & {
8
8
  request: HttpClientRequestObject;
9
9
  headers: HttpHeadersObject;
10
10
  };
11
- export declare type HttpClientResponseOptions = {
11
+ export type HttpClientResponseOptions = {
12
12
  request: HttpClientRequest;
13
13
  statusCode: number;
14
14
  statusMessage: string;
@@ -7,7 +7,7 @@ import type { HttpClientRequestOptions } from './http-client-request';
7
7
  import { HttpClientRequest } from './http-client-request';
8
8
  import type { HttpClientResponse } from './http-client-response';
9
9
  import { HttpClientAdapter } from './http-client.adapter';
10
- export declare type HttpClientOptions = {
10
+ export type HttpClientOptions = {
11
11
  /**
12
12
  * base url for requests when only path is provided
13
13
  */
@@ -22,11 +22,11 @@ export declare type HttpClientOptions = {
22
22
  */
23
23
  enableErrorHandling?: boolean;
24
24
  };
25
- export declare type HttpClientHandler = AsyncMiddlewareHandler<HttpClientRequest, HttpClientResponse>;
26
- export declare type HttpClientMiddleware = AsyncMiddleware<HttpClientRequest, HttpClientResponse>;
27
- export declare type HttpClientMiddlewareNext = AsyncMiddlewareNext<HttpClientRequest, HttpClientResponse>;
25
+ export type HttpClientHandler = AsyncMiddlewareHandler<HttpClientRequest, HttpClientResponse>;
26
+ export type HttpClientMiddleware = AsyncMiddleware<HttpClientRequest, HttpClientResponse>;
27
+ export type HttpClientMiddlewareNext = AsyncMiddlewareNext<HttpClientRequest, HttpClientResponse>;
28
28
  export declare const HTTP_CLIENT_OPTIONS: import("../../container").InjectionToken<HttpClientOptions, any>;
29
- export declare type HttpClientArgument = HttpClientOptions;
29
+ export type HttpClientArgument = HttpClientOptions;
30
30
  export declare class HttpClient implements Injectable<HttpClientArgument> {
31
31
  private readonly adapter;
32
32
  private readonly options;
@@ -2,10 +2,11 @@ import type { UndefinableJson } from "../types";
2
2
  import type { AnyIterable } from "../utils/any-iterable-iterator";
3
3
  import type { HttpHeaders } from './http-headers';
4
4
  import type { ReadBodyOptions } from './utils';
5
- export declare type HttpBodySource = undefined | Uint8Array | Blob | AnyIterable<Uint8Array> | ReadableStream<Uint8Array>;
5
+ export type HttpBodySource = undefined | Uint8Array | Blob | AnyIterable<Uint8Array> | ReadableStream<Uint8Array>;
6
6
  export declare class HttpBody {
7
7
  private readonly body;
8
8
  private readonly headers;
9
+ private bodyAlreadyRead;
9
10
  get available(): boolean;
10
11
  get byteLength(): number | undefined;
11
12
  constructor(body: HttpBodySource, headers: HttpHeaders);
@@ -16,4 +17,5 @@ export declare class HttpBody {
16
17
  readAsBinaryStream(options?: ReadBodyOptions): ReadableStream<Uint8Array>;
17
18
  readAsTextStream(options?: ReadBodyOptions): ReadableStream<string>;
18
19
  readAsStream(options?: ReadBodyOptions): ReadableStream<string> | ReadableStream<Uint8Array>;
20
+ private prepareBodyRead;
19
21
  }
package/http/http-body.js CHANGED
@@ -6,6 +6,7 @@ const utils_1 = require("./utils");
6
6
  class HttpBody {
7
7
  body;
8
8
  headers;
9
+ bodyAlreadyRead;
9
10
  get available() {
10
11
  return (0, type_guards_1.isNotNullOrUndefined)(this.body);
11
12
  }
@@ -15,40 +16,45 @@ class HttpBody {
15
16
  constructor(body, headers) {
16
17
  this.body = body;
17
18
  this.headers = headers;
19
+ this.bodyAlreadyRead = false;
18
20
  }
19
21
  async readAsBuffer(options) {
20
- ensureBodyExists(this.body);
22
+ this.prepareBodyRead();
21
23
  return (0, utils_1.readBodyAsBuffer)(this.body, this.headers, options);
22
24
  }
23
25
  async readAsText(options) {
24
- ensureBodyExists(this.body);
26
+ this.prepareBodyRead();
25
27
  return (0, utils_1.readBodyAsText)(this.body, this.headers, options);
26
28
  }
27
29
  async readAsJson(options) {
28
- ensureBodyExists(this.body);
30
+ this.prepareBodyRead();
29
31
  return (0, utils_1.readBodyAsJson)(this.body, this.headers, options);
30
32
  }
31
33
  async read(options) {
32
- ensureBodyExists(this.body);
34
+ this.prepareBodyRead();
33
35
  return (0, utils_1.readBody)(this.body, this.headers, options);
34
36
  }
35
37
  readAsBinaryStream(options) {
36
- ensureBodyExists(this.body);
38
+ this.prepareBodyRead();
37
39
  return (0, utils_1.readBodyAsBinaryStream)(this.body, this.headers, options);
38
40
  }
39
41
  readAsTextStream(options) {
40
- ensureBodyExists(this.body);
42
+ this.prepareBodyRead();
41
43
  return (0, utils_1.readBodyAsTextStream)(this.body, this.headers, options);
42
44
  }
43
45
  readAsStream(options) {
44
- ensureBodyExists(this.body);
46
+ this.prepareBodyRead();
45
47
  return (0, utils_1.readBodyAsStream)(this.body, this.headers, options);
46
48
  }
47
- }
48
- exports.HttpBody = HttpBody;
49
- function ensureBodyExists(body) {
50
- if ((0, type_guards_1.isNullOrUndefined)(body)) {
51
- throw new Error('Body not available');
49
+ prepareBodyRead() {
50
+ if ((0, type_guards_1.isNullOrUndefined)(this.body)) {
51
+ throw new Error('Body not available.');
52
+ }
53
+ if (this.bodyAlreadyRead) {
54
+ throw new Error('Body was already read.');
55
+ }
56
+ this.bodyAlreadyRead = true;
52
57
  }
53
58
  }
59
+ exports.HttpBody = HttpBody;
54
60
  //# sourceMappingURL=http-body.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http-body.js","sourceRoot":"","sources":["../../source/http/http-body.ts"],"names":[],"mappings":";;;AAEA,sDAA8E;AAG9E,mCAAqJ;AAIrJ,MAAa,QAAQ;IACF,IAAI,CAAiB;IACrB,OAAO,CAAc;IAEtC,IAAI,SAAS;QACX,OAAO,IAAA,kCAAoB,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;IACpC,CAAC;IAED,YAAY,IAAoB,EAAE,OAAoB;QACpD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAAyB;QAC1C,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5B,OAAO,IAAA,wBAAgB,EAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,OAAyB;QACxC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5B,OAAO,IAAA,sBAAc,EAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED,KAAK,CAAC,UAAU,CAAsB,OAAyB;QAC7D,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5B,OAAO,IAAA,sBAAc,EAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAe,CAAC;IACxE,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAyB;QAClC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5B,OAAO,IAAA,gBAAQ,EAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;IAED,kBAAkB,CAAC,OAAyB;QAC1C,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5B,OAAO,IAAA,8BAAsB,EAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IAED,gBAAgB,CAAC,OAAyB;QACxC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5B,OAAO,IAAA,4BAAoB,EAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;IAED,YAAY,CAAC,OAAyB;QACpC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5B,OAAO,IAAA,wBAAgB,EAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;CACF;AAnDD,4BAmDC;AAED,SAAS,gBAAgB,CAAC,IAAoB;IAC5C,IAAI,IAAA,+BAAiB,EAAC,IAAI,CAAC,EAAE;QAC3B,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;KACvC;AACH,CAAC"}
1
+ {"version":3,"file":"http-body.js","sourceRoot":"","sources":["../../source/http/http-body.ts"],"names":[],"mappings":";;;AAEA,sDAA8E;AAG9E,mCAAqJ;AAIrJ,MAAa,QAAQ;IACF,IAAI,CAAiB;IACrB,OAAO,CAAc;IAE9B,eAAe,CAAU;IAEjC,IAAI,SAAS;QACX,OAAO,IAAA,kCAAoB,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;IACpC,CAAC;IAED,YAAY,IAAoB,EAAE,OAAoB;QACpD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAAyB;QAC1C,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,IAAA,wBAAgB,EAAC,IAAI,CAAC,IAAK,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,OAAyB;QACxC,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,IAAA,sBAAc,EAAC,IAAI,CAAC,IAAK,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;IAED,KAAK,CAAC,UAAU,CAAsB,OAAyB;QAC7D,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,IAAA,sBAAc,EAAC,IAAI,CAAC,IAAK,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAe,CAAC;IACzE,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAyB;QAClC,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,IAAA,gBAAQ,EAAC,IAAI,CAAC,IAAK,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAED,kBAAkB,CAAC,OAAyB;QAC1C,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,IAAA,8BAAsB,EAAC,IAAI,CAAC,IAAK,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;IAED,gBAAgB,CAAC,OAAyB;QACxC,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,IAAA,4BAAoB,EAAC,IAAI,CAAC,IAAK,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED,YAAY,CAAC,OAAyB;QACpC,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,IAAA,wBAAgB,EAAC,IAAI,CAAC,IAAK,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAEO,eAAe;QACrB,IAAI,IAAA,+BAAiB,EAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAChC,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;SACxC;QAED,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;SAC3C;QAED,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;IAC9B,CAAC;CACF;AAnED,4BAmEC"}
@@ -1,8 +1,8 @@
1
1
  import type { HttpValueMapInput } from './http-value-map';
2
2
  import { HttpValueMap } from './http-value-map';
3
3
  import type { HttpValueObject, NormalizedHttpValueObject } from './types';
4
- export declare type HttpFormObject = HttpValueObject;
5
- export declare type NormalizedHttpFormObject = NormalizedHttpValueObject;
4
+ export type HttpFormObject = HttpValueObject;
5
+ export type NormalizedHttpFormObject = NormalizedHttpValueObject;
6
6
  export declare class HttpForm extends HttpValueMap<HttpForm> {
7
7
  constructor(input?: HttpValueMapInput);
8
8
  static fromURLSearchParams(urlSearchParams: URLSearchParams): HttpForm;
@@ -1,9 +1,9 @@
1
1
  import type { HttpValueMapInput } from './http-value-map';
2
2
  import { HttpValueMap } from './http-value-map';
3
3
  import type { HttpValueObject, NormalizedHttpValueObject } from './types';
4
- export declare type HttpHeadersObject = HttpValueObject;
5
- export declare type HttpHeadersInput = HttpValueMapInput;
6
- export declare type NormalizedHttpHeadersObject = NormalizedHttpValueObject;
4
+ export type HttpHeadersObject = HttpValueObject;
5
+ export type HttpHeadersInput = HttpValueMapInput;
6
+ export type NormalizedHttpHeadersObject = NormalizedHttpValueObject;
7
7
  export declare class HttpHeaders extends HttpValueMap<HttpHeaders> {
8
8
  get accept(): string | undefined;
9
9
  set accept(value: string | undefined);
@@ -1,8 +1,8 @@
1
1
  import type { HttpValueMapInput } from './http-value-map';
2
2
  import { HttpValueMap } from './http-value-map';
3
3
  import type { HttpValueObject, NormalizedHttpValueObject } from './types';
4
- export declare type HttpQueryObject = HttpValueObject;
5
- export declare type NormalizedHttpQueryObject = NormalizedHttpValueObject;
4
+ export type HttpQueryObject = HttpValueObject;
5
+ export type NormalizedHttpQueryObject = NormalizedHttpValueObject;
6
6
  export declare class HttpQuery extends HttpValueMap<HttpQuery> {
7
7
  constructor(input?: HttpValueMapInput);
8
8
  static fromURLSearchParams(urlSearchParams: URLSearchParams): HttpQuery;
@@ -1,8 +1,8 @@
1
1
  import type { HttpValueMapInput } from './http-value-map';
2
2
  import { HttpValueMap } from './http-value-map';
3
3
  import type { HttpValueObject, NormalizedHttpValueObject } from './types';
4
- export declare type HttpUrlParametersObject = HttpValueObject;
5
- export declare type NormalizedHttpUrlParametersObject = NormalizedHttpValueObject;
4
+ export type HttpUrlParametersObject = HttpValueObject;
5
+ export type NormalizedHttpUrlParametersObject = NormalizedHttpValueObject;
6
6
  export declare class HttpUrlParameters extends HttpValueMap<HttpUrlParameters> {
7
7
  constructor(input?: HttpValueMapInput);
8
8
  clone(): HttpUrlParameters;
@@ -1,6 +1,6 @@
1
1
  import type { OneOrMany, Record } from "../types";
2
2
  import type { HttpValue, NormalizedHttpValue, NormalizedHttpValueObject } from './types';
3
- export declare type HttpValueMapInput = Record<string, OneOrMany<HttpValue> | undefined> | Iterable<[string, OneOrMany<HttpValue> | undefined]>;
3
+ export type HttpValueMapInput = Record<string, OneOrMany<HttpValue> | undefined> | Iterable<[string, OneOrMany<HttpValue> | undefined]>;
4
4
  export declare abstract class HttpValueMap<TThis extends HttpValueMap<any>> implements Iterable<[string, OneOrMany<HttpValue>]> {
5
5
  private readonly valueType;
6
6
  private readonly caseInsensitive;
@@ -5,7 +5,7 @@ import { HttpBody } from '../http-body';
5
5
  import type { HttpHeaders } from '../http-headers';
6
6
  import type { HttpQuery } from '../http-query';
7
7
  import type { HttpMethod } from '../types';
8
- export declare type HttpServerRequestObject = Pick<HttpServerRequest, 'url' | 'method' | 'headers' | 'query' | 'ip'> & {
8
+ export type HttpServerRequestObject = Pick<HttpServerRequest, 'url' | 'method' | 'headers' | 'query' | 'ip'> & {
9
9
  body: HttpBody | HttpBodySource;
10
10
  context?: StringMap;
11
11
  };
@@ -2,7 +2,7 @@ import type { SeverSentEvents } from "../../sse";
2
2
  import type { UndefinableJson } from "../../types";
3
3
  import type { HttpHeadersInput } from '../http-headers';
4
4
  import { HttpHeaders } from '../http-headers';
5
- export declare type HttpServerResponseOptions = {
5
+ export type HttpServerResponseOptions = {
6
6
  statusCode?: number | undefined;
7
7
  statusMessage?: string | undefined;
8
8
  headers?: HttpHeadersInput | HttpHeaders;
@@ -1,7 +1,7 @@
1
1
  import type { AsyncDisposable } from "../../disposable";
2
2
  import { disposeAsync } from "../../disposable";
3
3
  import type { HttpServerRequest, HttpServerResponse } from "./";
4
- export declare type HttpServerRequestContext<Context = unknown> = {
4
+ export type HttpServerRequestContext<Context = unknown> = {
5
5
  request: HttpServerRequest;
6
6
  context: Context;
7
7
  respond(response: HttpServerResponse): Promise<void>;
@@ -7,7 +7,7 @@ import { Logger } from "../../../logger";
7
7
  import * as Http from 'http';
8
8
  import type { HttpServerRequestContext } from '../http-server';
9
9
  import { HttpServer } from '../http-server';
10
- export declare type NodeHttpServerContext = {
10
+ export type NodeHttpServerContext = {
11
11
  nodeRequest: Http.IncomingMessage;
12
12
  nodeResponse: Http.ServerResponse;
13
13
  };
package/http/types.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import type { OneOrMany } from "../types";
2
- export declare type HttpValue = string | number | boolean | null;
3
- export declare type NormalizedHttpValue = string;
4
- export declare type HttpValueObject = Record<string, OneOrMany<HttpValue>>;
5
- export declare type NormalizedHttpValueObject = Record<string, OneOrMany<string>>;
6
- export declare type HttpMethod = 'HEAD' | 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS';
2
+ export type HttpValue = string | number | boolean | null;
3
+ export type NormalizedHttpValue = string;
4
+ export type HttpValueObject = Record<string, OneOrMany<HttpValue>>;
5
+ export type NormalizedHttpValueObject = Record<string, OneOrMany<string>>;
6
+ export type HttpMethod = 'HEAD' | 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS';
7
7
  export declare function normalizeHttpValue(value: OneOrMany<HttpValue>): OneOrMany<string>;
8
8
  export declare function normalizeSingleHttpValue(value: HttpValue): string;
9
9
  export declare function denormalizeHttpValue(value: OneOrMany<HttpValue>): OneOrMany<HttpValue>;
package/http/utils.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import type { HttpHeaders } from "./http-headers";
2
2
  import type { UndefinableJson } from "../types";
3
3
  import type { AnyIterable } from "../utils/any-iterable-iterator";
4
- declare type Body = Uint8Array | Blob | AnyIterable<Uint8Array> | ReadableStream<Uint8Array>;
5
- export declare type ReadBodyOptions = {
4
+ type Body = Uint8Array | Blob | AnyIterable<Uint8Array> | ReadableStream<Uint8Array>;
5
+ export type ReadBodyOptions = {
6
6
  maxBytes?: number;
7
7
  };
8
- export declare type ReadBodyAsJsonOptions = ReadBodyOptions & {
8
+ export type ReadBodyAsJsonOptions = ReadBodyOptions & {
9
9
  fallbackToText?: boolean;
10
10
  };
11
11
  export declare function readBodyAsBinaryStream(body: Body, headers: HttpHeaders, options?: ReadBodyOptions): ReadableStream<Uint8Array>;
@@ -2,7 +2,7 @@ import type { Injectable } from "../../container";
2
2
  import { resolveArgumentType } from "../../container";
3
3
  import type { ImageOptions } from '../image-service';
4
4
  import { ImageService } from '../image-service';
5
- export declare type ImgproxyImageServiceConfig = {
5
+ export type ImgproxyImageServiceConfig = {
6
6
  endpoint: string;
7
7
  key: string;
8
8
  salt: string;
@@ -1,5 +1,5 @@
1
- export declare type JsonPathNode = PropertyKey;
2
- export declare type JsonPathInput = string | JsonPath | Iterable<JsonPathNode>;
1
+ export type JsonPathNode = PropertyKey;
2
+ export type JsonPathInput = string | JsonPath | Iterable<JsonPathNode>;
3
3
  export declare class JsonPath<T = any> implements Iterable<JsonPathNode> {
4
4
  private readonly _options;
5
5
  private _path;
@@ -26,7 +26,7 @@ export declare class JsonPath<T = any> implements Iterable<JsonPathNode> {
26
26
  options(options: JsonPathOptions): JsonPath;
27
27
  [Symbol.iterator](): Iterator<PropertyKey>;
28
28
  }
29
- export declare type JsonPathOptions = {
29
+ export type JsonPathOptions = {
30
30
  /** encode as array.0 instead of array[0] */
31
31
  treatArrayAsObject?: boolean;
32
32
  /** encode as ['foo'] instead of .foo */
@@ -34,7 +34,7 @@ export declare type JsonPathOptions = {
34
34
  /** dont prepend $ */
35
35
  noDollar?: boolean;
36
36
  };
37
- export declare type JsonPathContext = {
37
+ export type JsonPathContext = {
38
38
  /** if path contains symbols, they are required in order to be mapped, otherwise they are created from global symbol registry */
39
39
  symbols?: symbol[];
40
40
  };
@@ -2,7 +2,7 @@ import type { Injectable } from "../container";
2
2
  import { resolveArgumentType } from "../container";
3
3
  import type { StringMap } from '../types';
4
4
  /** key value store module */
5
- export declare type KeyValueStoreArgument = string;
5
+ export type KeyValueStoreArgument = string;
6
6
  export declare abstract class KeyValueStore<KV extends StringMap> implements Injectable<KeyValueStoreArgument> {
7
7
  readonly module: string;
8
8
  readonly [resolveArgumentType]: KeyValueStoreArgument;
@@ -1,6 +1,6 @@
1
1
  import type { MongoRepositoryConfig } from "../../database/mongo";
2
2
  import type { MongoKeyValue } from './mongo-key-value.model';
3
- export declare type MongoKeyValueStoreModuleConfig = {
3
+ export type MongoKeyValueStoreModuleConfig = {
4
4
  defaultKeyValueRepositoryConfig: MongoRepositoryConfig<MongoKeyValue> | undefined;
5
5
  };
6
6
  export declare const mongoKeyValueStoreModuleConfig: MongoKeyValueStoreModuleConfig;
@@ -1,5 +1,5 @@
1
1
  import type { Entity } from "../../database";
2
- export declare type MongoKeyValue<T = unknown> = Entity & {
2
+ export type MongoKeyValue<T = unknown> = Entity & {
3
3
  module: string;
4
4
  key: string;
5
5
  value: T;
package/lock/lock.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import type { Injectable } from "../container";
2
2
  import { resolveArgumentType } from "../container";
3
- export declare type LockedFunction<R> = (controller: LockController) => R | Promise<R>;
4
- export declare type AcquireResult<Throw extends boolean> = Throw extends true ? LockController : (LockController | false);
5
- export declare type UsingResult<Throw extends boolean, R> = Throw extends true ? ({
3
+ export type LockedFunction<R> = (controller: LockController) => R | Promise<R>;
4
+ export type AcquireResult<Throw extends boolean> = Throw extends true ? LockController : (LockController | false);
5
+ export type UsingResult<Throw extends boolean, R> = Throw extends true ? ({
6
6
  success: true;
7
7
  result: R;
8
8
  }) : ({
@@ -22,7 +22,7 @@ export interface LockController {
22
22
  release(): Promise<void>;
23
23
  }
24
24
  /** resource */
25
- export declare type LockArgument = string | {
25
+ export type LockArgument = string | {
26
26
  prefix?: string;
27
27
  resource: string;
28
28
  };
@@ -1,5 +1,5 @@
1
1
  import type { Entity } from "../../database";
2
- export declare type MongoLockEntity = Entity & {
2
+ export type MongoLockEntity = Entity & {
3
3
  resource: string;
4
4
  key: string;
5
5
  expiration: Date;
@@ -1,6 +1,6 @@
1
1
  import type { MongoRepositoryConfig } from "../../database/mongo";
2
2
  import type { MongoLockEntity } from './model';
3
- export declare type MongoLockModuleConfig = {
3
+ export type MongoLockModuleConfig = {
4
4
  lockEntityRepositoryConfig: MongoRepositoryConfig<MongoLockEntity> | undefined;
5
5
  };
6
6
  export declare const mongoLockModuleConfig: MongoLockModuleConfig;
@@ -2,7 +2,7 @@ import type { Injectable } from "../container";
2
2
  import { resolveArgumentType } from "../container";
3
3
  import type { Lock } from './lock';
4
4
  /** prefix */
5
- export declare type LockProviderArgument = string;
5
+ export type LockProviderArgument = string;
6
6
  export declare abstract class LockProvider implements Injectable<LockProviderArgument> {
7
7
  readonly [resolveArgumentType]: LockProviderArgument;
8
8
  abstract prefix(prefix: string): LockProvider;