@tstdl/base 0.81.35 → 0.82.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (419) 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/api/utils.js +3 -1
  11. package/api/utils.js.map +1 -1
  12. package/authentication/authentication-credentials.service.d.ts +6 -0
  13. package/authentication/authentication-credentials.service.js +17 -0
  14. package/authentication/authentication-credentials.service.js.map +1 -0
  15. package/authentication/authentication-session.repository.d.ts +6 -0
  16. package/authentication/authentication-session.repository.js +18 -0
  17. package/authentication/authentication-session.repository.js.map +1 -0
  18. package/authentication/authentication-token-payload.provider.d.ts +3 -0
  19. package/authentication/authentication-token-payload.provider.js +17 -0
  20. package/authentication/authentication-token-payload.provider.js.map +1 -0
  21. package/authentication/authentication.service.d.ts +42 -0
  22. package/authentication/authentication.service.js +133 -0
  23. package/authentication/authentication.service.js.map +1 -0
  24. package/authentication/models/authentication-credentials.model.d.ts +11 -0
  25. package/authentication/models/authentication-credentials.model.js +44 -0
  26. package/authentication/models/authentication-credentials.model.js.map +1 -0
  27. package/authentication/models/authentication-session.model.d.ts +14 -0
  28. package/authentication/models/authentication-session.model.js +59 -0
  29. package/authentication/models/authentication-session.model.js.map +1 -0
  30. package/authentication/models/index.d.ts +2 -0
  31. package/authentication/models/index.js +19 -0
  32. package/authentication/models/index.js.map +1 -0
  33. package/authentication/tokens.d.ts +2 -0
  34. package/authentication/tokens.js +6 -0
  35. package/authentication/tokens.js.map +1 -0
  36. package/collections/keyed-set.d.ts +1 -1
  37. package/collections/observable/observable-collection.d.ts +1 -1
  38. package/collections/observable/observable-list.d.ts +2 -2
  39. package/container/container.d.ts +3 -3
  40. package/container/container.js +3 -3
  41. package/container/container.js.map +1 -1
  42. package/container/decorators.d.ts +3 -3
  43. package/container/decorators.js +0 -1
  44. package/container/decorators.js.map +1 -1
  45. package/container/interfaces.d.ts +1 -1
  46. package/container/provider.d.ts +6 -6
  47. package/container/resolve-chain.d.ts +2 -2
  48. package/container/resolve-chain.js +1 -1
  49. package/container/resolve-chain.js.map +1 -1
  50. package/container/token.d.ts +3 -3
  51. package/container/type-info.d.ts +1 -1
  52. package/container/types.d.ts +4 -4
  53. package/core.d.ts +1 -1
  54. package/data-structures/linked-list.d.ts +1 -1
  55. package/data-structures/multi-key-map.d.ts +2 -2
  56. package/data-structures/sorted-array-list.d.ts +1 -1
  57. package/database/entity-repository.d.ts +2 -2
  58. package/database/entity.d.ts +3 -3
  59. package/database/module.d.ts +1 -1
  60. package/database/mongo/classes.d.ts +3 -3
  61. package/database/mongo/model/document.d.ts +3 -3
  62. package/database/mongo/module.d.ts +1 -1
  63. package/database/mongo/mongo-base.repository.d.ts +11 -11
  64. package/database/mongo/mongo-bulk.d.ts +1 -1
  65. package/database/mongo/mongo-entity-repository.d.ts +7 -7
  66. package/database/mongo/types.d.ts +16 -16
  67. package/database/query.d.ts +38 -38
  68. package/disposable/async-disposer.d.ts +3 -3
  69. package/distributed-loop/distributed-loop.d.ts +2 -2
  70. package/error/custom.error.d.ts +1 -1
  71. package/http/client/adapters/undici-http-client.adapter.d.ts +1 -1
  72. package/http/client/http-client-request.d.ts +5 -5
  73. package/http/client/http-client-response.d.ts +2 -2
  74. package/http/client/http-client.d.ts +5 -5
  75. package/http/http-body.d.ts +3 -1
  76. package/http/http-body.js +18 -12
  77. package/http/http-body.js.map +1 -1
  78. package/http/http-form.d.ts +2 -2
  79. package/http/http-headers.d.ts +3 -3
  80. package/http/http-query.d.ts +2 -2
  81. package/http/http-url-parameters.d.ts +2 -2
  82. package/http/http-value-map.d.ts +1 -1
  83. package/http/server/http-server-request.d.ts +1 -1
  84. package/http/server/http-server-response.d.ts +1 -1
  85. package/http/server/http-server.d.ts +1 -1
  86. package/http/server/node/node-http-server.d.ts +1 -1
  87. package/http/types.d.ts +5 -5
  88. package/http/utils.d.ts +3 -3
  89. package/image-service/imgproxy/imgproxy-image-service.d.ts +1 -1
  90. package/json-path/json-path.d.ts +4 -4
  91. package/key-value-store/key-value.store.d.ts +1 -1
  92. package/key-value-store/mongo/module.d.ts +1 -1
  93. package/key-value-store/mongo/mongo-key-value.model.d.ts +1 -1
  94. package/lock/lock.d.ts +4 -4
  95. package/lock/mongo/model.d.ts +1 -1
  96. package/lock/mongo/module.d.ts +1 -1
  97. package/lock/provider.d.ts +1 -1
  98. package/logger/logger.d.ts +6 -6
  99. package/mail/mail.client.d.ts +1 -1
  100. package/mail/mail.service.d.ts +3 -1
  101. package/mail/mail.service.js +11 -6
  102. package/mail/mail.service.js.map +1 -1
  103. package/mail/models/mail-address.model.d.ts +1 -1
  104. package/mail/models/mail-content.model.d.ts +1 -1
  105. package/mail/models/mail-data.model.d.ts +2 -1
  106. package/mail/models/mail-log.model.d.ts +2 -2
  107. package/mail/models/mail-send-result.model.d.ts +1 -1
  108. package/mail/models/mail-template.model.d.ts +1 -1
  109. package/mail/module.d.ts +4 -2
  110. package/mail/module.js +6 -2
  111. package/mail/module.js.map +1 -1
  112. package/mail/repositories/mongo-mail-log.repository.d.ts +2 -2
  113. package/mail/tokens.d.ts +1 -0
  114. package/mail/tokens.js +2 -1
  115. package/mail/tokens.js.map +1 -1
  116. package/message-bus/local/types.d.ts +1 -1
  117. package/message-bus/message-bus.d.ts +1 -1
  118. package/migration/migration-state.d.ts +2 -2
  119. package/migration/migrator.d.ts +4 -4
  120. package/migration/mongo/module.d.ts +1 -1
  121. package/module/module-metric-reporter.d.ts +2 -2
  122. package/module/module.d.ts +1 -1
  123. package/module/modules/function.module.d.ts +1 -1
  124. package/module/modules/web-server.module.d.ts +1 -1
  125. package/notification/api.d.ts +3 -6
  126. package/notification/api.js +2 -5
  127. package/notification/api.js.map +1 -1
  128. package/notification/models/index.d.ts +2 -0
  129. package/notification/models/index.js +19 -0
  130. package/notification/models/index.js.map +1 -0
  131. package/notification/models/notification-channel-job.model.d.ts +3 -0
  132. package/notification/models/notification-channel-job.model.js +3 -0
  133. package/notification/models/notification-channel-job.model.js.map +1 -0
  134. package/notification/models/notification.model.d.ts +27 -0
  135. package/notification/{model.js → models/notification.model.js} +28 -16
  136. package/notification/models/notification.model.js.map +1 -0
  137. package/notification/module.d.ts +1 -1
  138. package/notification/notification-channel.service.d.ts +5 -0
  139. package/notification/notification-channel.service.js +7 -0
  140. package/notification/notification-channel.service.js.map +1 -0
  141. package/notification/notification.service.d.ts +8 -0
  142. package/notification/notification.service.js +40 -0
  143. package/notification/notification.service.js.map +1 -0
  144. package/object-storage/object-storage.d.ts +2 -2
  145. package/object-storage/object.d.ts +1 -1
  146. package/object-storage/s3/s3.object-storage-provider.d.ts +1 -1
  147. package/openid-connect/mongo-oidc-state.repository.d.ts +1 -1
  148. package/openid-connect/oidc-configuration.service.d.ts +1 -1
  149. package/openid-connect/oidc-state.model.d.ts +2 -2
  150. package/openid-connect/oidc.service-model.d.ts +8 -8
  151. package/orm/decorators.d.ts +26 -0
  152. package/orm/decorators.js +170 -0
  153. package/orm/decorators.js.map +1 -1
  154. package/orm/entity-definition.model.d.ts +51 -0
  155. package/orm/entity-definition.model.js +27 -0
  156. package/orm/entity-definition.model.js.map +1 -0
  157. package/orm/index.d.ts +1 -0
  158. package/orm/index.js +18 -0
  159. package/orm/index.js.map +1 -0
  160. package/orm/models/entity.d.ts +22 -0
  161. package/orm/models/entity.js +87 -0
  162. package/orm/models/entity.js.map +1 -0
  163. package/orm/models/index.d.ts +1 -0
  164. package/orm/models/index.js +18 -0
  165. package/orm/models/index.js.map +1 -0
  166. package/orm/repository/mongo/classes.d.ts +25 -0
  167. package/orm/repository/mongo/classes.js +33 -0
  168. package/orm/repository/mongo/classes.js.map +1 -0
  169. package/orm/repository/mongo/module.d.ts +8 -0
  170. package/orm/repository/mongo/module.js +88 -0
  171. package/orm/repository/mongo/module.js.map +1 -0
  172. package/orm/repository/mongo/mongo-repository.d.ts +11 -0
  173. package/orm/repository/mongo/mongo-repository.js +55 -0
  174. package/orm/repository/mongo/mongo-repository.js.map +1 -0
  175. package/orm/repository/mongo/mongo-transaction.d.ts +10 -0
  176. package/orm/repository/mongo/mongo-transaction.js +28 -0
  177. package/orm/repository/mongo/mongo-transaction.js.map +1 -0
  178. package/orm/repository/repository.d.ts +75 -0
  179. package/orm/repository/repository.js +182 -0
  180. package/orm/repository/repository.js.map +1 -0
  181. package/orm/repository/transaction.d.ts +26 -0
  182. package/orm/repository/transaction.js +65 -0
  183. package/orm/repository/transaction.js.map +1 -0
  184. package/orm/{types.d.ts → types/definition.d.ts} +5 -5
  185. package/orm/{types.js → types/definition.js} +8 -8
  186. package/orm/types/definition.js.map +1 -0
  187. package/orm/types/index.d.ts +3 -0
  188. package/orm/types/index.js +20 -0
  189. package/orm/types/index.js.map +1 -0
  190. package/orm/types/options.d.ts +36 -0
  191. package/orm/types/options.js +5 -0
  192. package/orm/types/options.js.map +1 -0
  193. package/orm/types/query.d.ts +110 -0
  194. package/orm/types/query.js +10 -0
  195. package/orm/types/query.js.map +1 -0
  196. package/package.json +5 -5
  197. package/pdf/pdf.service.d.ts +3 -3
  198. package/pool/pool.d.ts +4 -4
  199. package/promise/cancelable-promise.d.ts +1 -1
  200. package/promise/lazy-promise.d.ts +1 -1
  201. package/queue/mongo/job.d.ts +2 -2
  202. package/queue/mongo/queue.js +2 -2
  203. package/queue/mongo/queue.js.map +1 -1
  204. package/queue/queue.d.ts +11 -6
  205. package/queue/queue.js +2 -1
  206. package/queue/queue.js.map +1 -1
  207. package/reflection/decorator-data.js +2 -1
  208. package/reflection/decorator-data.js.map +1 -1
  209. package/reflection/registry.d.ts +18 -17
  210. package/reflection/registry.js +25 -10
  211. package/reflection/registry.js.map +1 -1
  212. package/reflection/types.d.ts +34 -34
  213. package/reflection/utils.d.ts +8 -8
  214. package/reflection/utils.js +6 -6
  215. package/reflection/utils.js.map +1 -1
  216. package/rpc/endpoints/message-port.rpc-endpoint.d.ts +3 -3
  217. package/rpc/model.d.ts +22 -22
  218. package/rpc/rpc.d.ts +1 -1
  219. package/rxjs/intersection-observer.d.ts +1 -1
  220. package/rxjs/mutation-observer.d.ts +1 -1
  221. package/rxjs/performance-observer.d.ts +1 -1
  222. package/rxjs/resize-observer.d.ts +1 -1
  223. package/rxjs/slow-array.d.ts +1 -1
  224. package/rxjs/touch.d.ts +1 -1
  225. package/schema/array-constraints/maximum-length.d.ts +2 -2
  226. package/schema/array-constraints/maximum-length.js +2 -2
  227. package/schema/array-constraints/maximum-length.js.map +1 -1
  228. package/schema/array-constraints/minimum-length.d.ts +2 -2
  229. package/schema/array-constraints/minimum-length.js +2 -2
  230. package/schema/array-constraints/minimum-length.js.map +1 -1
  231. package/schema/constraints/enumeration.d.ts +4 -4
  232. package/schema/constraints/enumeration.js +5 -5
  233. package/schema/constraints/enumeration.js.map +1 -1
  234. package/schema/constraints/generic.d.ts +4 -4
  235. package/schema/constraints/generic.js +2 -2
  236. package/schema/constraints/generic.js.map +1 -1
  237. package/schema/constraints/integer.d.ts +2 -2
  238. package/schema/constraints/integer.js +3 -2
  239. package/schema/constraints/integer.js.map +1 -1
  240. package/schema/constraints/length.d.ts +1 -1
  241. package/schema/constraints/literal.d.ts +2 -2
  242. package/schema/constraints/literal.js +2 -2
  243. package/schema/constraints/literal.js.map +1 -1
  244. package/schema/constraints/maximum-date.d.ts +2 -2
  245. package/schema/constraints/maximum-date.js +3 -2
  246. package/schema/constraints/maximum-date.js.map +1 -1
  247. package/schema/constraints/maximum-length.d.ts +2 -2
  248. package/schema/constraints/maximum-length.js +2 -2
  249. package/schema/constraints/maximum-length.js.map +1 -1
  250. package/schema/constraints/maximum.d.ts +2 -2
  251. package/schema/constraints/maximum.js +3 -2
  252. package/schema/constraints/maximum.js.map +1 -1
  253. package/schema/constraints/minimum-date.d.ts +2 -2
  254. package/schema/constraints/minimum-date.js +3 -2
  255. package/schema/constraints/minimum-date.js.map +1 -1
  256. package/schema/constraints/minimum-length.d.ts +2 -2
  257. package/schema/constraints/minimum-length.js +2 -2
  258. package/schema/constraints/minimum-length.js.map +1 -1
  259. package/schema/constraints/minimum.d.ts +2 -2
  260. package/schema/constraints/minimum.js +3 -2
  261. package/schema/constraints/minimum.js.map +1 -1
  262. package/schema/constraints/pattern.d.ts +2 -2
  263. package/schema/constraints/pattern.js +3 -2
  264. package/schema/constraints/pattern.js.map +1 -1
  265. package/schema/decorators/types.d.ts +3 -3
  266. package/schema/decorators/utils.d.ts +4 -1
  267. package/schema/decorators/utils.js +1 -1
  268. package/schema/decorators/utils.js.map +1 -1
  269. package/schema/schema.d.ts +4 -4
  270. package/schema/schema.error.d.ts +1 -1
  271. package/schema/schema.js +10 -13
  272. package/schema/schema.js.map +1 -1
  273. package/schema/schemas/any.d.ts +1 -1
  274. package/schema/schemas/array.d.ts +2 -2
  275. package/schema/schemas/array.js +2 -2
  276. package/schema/schemas/array.js.map +1 -1
  277. package/schema/schemas/boolean.d.ts +1 -1
  278. package/schema/schemas/date.d.ts +2 -2
  279. package/schema/schemas/date.js +2 -2
  280. package/schema/schemas/date.js.map +1 -1
  281. package/schema/schemas/enumeration.d.ts +2 -2
  282. package/schema/schemas/enumeration.js +2 -2
  283. package/schema/schemas/enumeration.js.map +1 -1
  284. package/schema/schemas/instance.d.ts +1 -1
  285. package/schema/schemas/literal.d.ts +2 -2
  286. package/schema/schemas/literal.js +2 -2
  287. package/schema/schemas/literal.js.map +1 -1
  288. package/schema/schemas/nullable.d.ts +1 -1
  289. package/schema/schemas/number.d.ts +2 -2
  290. package/schema/schemas/number.js +2 -2
  291. package/schema/schemas/number.js.map +1 -1
  292. package/schema/schemas/object.d.ts +1 -1
  293. package/schema/schemas/omit.d.ts +2 -2
  294. package/schema/schemas/omit.js.map +1 -1
  295. package/schema/schemas/one-or-many.d.ts +2 -2
  296. package/schema/schemas/optional.d.ts +1 -1
  297. package/schema/schemas/readable-stream.d.ts +1 -1
  298. package/schema/schemas/record.d.ts +1 -1
  299. package/schema/schemas/regexp.d.ts +1 -1
  300. package/schema/schemas/string.d.ts +2 -2
  301. package/schema/schemas/string.js +3 -3
  302. package/schema/schemas/string.js.map +1 -1
  303. package/schema/schemas/uint8-array.d.ts +2 -2
  304. package/schema/schemas/uint8-array.js +3 -3
  305. package/schema/schemas/uint8-array.js.map +1 -1
  306. package/schema/schemas/union.d.ts +1 -1
  307. package/schema/schemas/unknown.d.ts +1 -1
  308. package/schema/transformers/generic.d.ts +1 -1
  309. package/schema/types/index.d.ts +5 -0
  310. package/schema/types/index.js +22 -0
  311. package/schema/types/index.js.map +1 -0
  312. package/schema/types/schema-array-constraint.d.ts +5 -0
  313. package/schema/types/schema-array-constraint.js +7 -0
  314. package/schema/types/schema-array-constraint.js.map +1 -0
  315. package/schema/types/schema-value-coercer.d.ts +8 -0
  316. package/schema/types/schema-value-coercer.js +7 -0
  317. package/schema/types/schema-value-coercer.js.map +1 -0
  318. package/schema/types/schema-value-constraint.d.ts +8 -0
  319. package/schema/types/schema-value-constraint.js +7 -0
  320. package/schema/types/schema-value-constraint.js.map +1 -0
  321. package/schema/types/schema-value-transformer.d.ts +7 -0
  322. package/schema/types/schema-value-transformer.js +7 -0
  323. package/schema/types/schema-value-transformer.js.map +1 -0
  324. package/schema/{types.d.ts → types/types.d.ts} +47 -57
  325. package/schema/types/types.js +174 -0
  326. package/schema/types/types.js.map +1 -0
  327. package/schema/utils/schema.js +1 -1
  328. package/schema/utils/schema.js.map +1 -1
  329. package/schema/utils/value-type.d.ts +1 -1
  330. package/schema/utils/value-type.js +1 -1
  331. package/schema/utils/value-type.js.map +1 -1
  332. package/search-index/elastic/config.d.ts +1 -1
  333. package/search-index/elastic/model/elastic-query.d.ts +15 -15
  334. package/search-index/elastic/model/index-mapping.d.ts +14 -14
  335. package/search-index/elastic/model/sort.d.ts +3 -3
  336. package/search-index/elastic/module.d.ts +1 -1
  337. package/search-index/search-index.d.ts +1 -1
  338. package/search-index/search-result.d.ts +2 -2
  339. package/serializer/handlers/error.d.ts +1 -1
  340. package/serializer/handlers/map.d.ts +1 -1
  341. package/serializer/handlers/regex.d.ts +1 -1
  342. package/serializer/handlers/set.d.ts +1 -1
  343. package/serializer/serializable.d.ts +6 -6
  344. package/serializer/serializer.d.ts +1 -1
  345. package/serializer/types.d.ts +15 -15
  346. package/sse/server-sent-events.d.ts +3 -3
  347. package/tailwind/theme-adapter.d.ts +1 -1
  348. package/templates/module.d.ts +1 -1
  349. package/templates/providers/file.provider-template.d.ts +2 -2
  350. package/templates/providers/file.provider-template.js +2 -1
  351. package/templates/providers/file.provider-template.js.map +1 -1
  352. package/templates/renderers/handlebars.template-renderer.d.ts +9 -9
  353. package/templates/renderers/mjml.template-renderer.d.ts +3 -3
  354. package/templates/renderers/string.template-renderer.d.ts +1 -1
  355. package/templates/resolvers/file.template-resolver.d.ts +2 -2
  356. package/templates/template.model.d.ts +1 -1
  357. package/templates/template.renderer.d.ts +4 -4
  358. package/templates/template.service.d.ts +1 -1
  359. package/text/dynamic-text.model.d.ts +1 -1
  360. package/text/localizable-text.model.d.ts +1 -1
  361. package/text/localization.service.d.ts +11 -11
  362. package/theme/theme-service.d.ts +6 -6
  363. package/threading/thread-pool.d.ts +1 -1
  364. package/threading/thread-worker.d.ts +1 -1
  365. package/types/geo-json.d.ts +12 -12
  366. package/types.d.ts +91 -91
  367. package/utils/any-iterable-iterator.d.ts +3 -3
  368. package/utils/array/array.d.ts +14 -1
  369. package/utils/array/array.js +16 -2
  370. package/utils/array/array.js.map +1 -1
  371. package/utils/async-iterable-helpers/parallel/types.d.ts +2 -2
  372. package/utils/async-iterable-helpers/types.d.ts +7 -7
  373. package/utils/backoff.d.ts +5 -5
  374. package/utils/benchmark.d.ts +1 -1
  375. package/utils/binary-search.d.ts +1 -1
  376. package/utils/binary.js.map +1 -1
  377. package/utils/cancellation-token.d.ts +1 -1
  378. package/utils/compression.d.ts +1 -1
  379. package/utils/cryptography.d.ts +11 -11
  380. package/utils/date-time.d.ts +8 -7
  381. package/utils/date-time.js +6 -2
  382. package/utils/date-time.js.map +1 -1
  383. package/utils/equals.d.ts +3 -3
  384. package/utils/factory-map.d.ts +1 -1
  385. package/utils/format-error.d.ts +1 -1
  386. package/utils/function/memoize.d.ts +1 -1
  387. package/utils/helpers.d.ts +1 -1
  388. package/utils/iterable-helpers/types.d.ts +6 -6
  389. package/utils/jwt.d.ts +4 -4
  390. package/utils/math.d.ts +1 -1
  391. package/utils/merge.d.ts +1 -1
  392. package/utils/middleware.d.ts +9 -9
  393. package/utils/moving-metric.d.ts +1 -1
  394. package/utils/object/decycle.d.ts +1 -1
  395. package/utils/object/dereference.d.ts +1 -1
  396. package/utils/object/forward-ref.d.ts +2 -2
  397. package/utils/object/lazy-property.d.ts +5 -5
  398. package/utils/object/merge.d.ts +1 -1
  399. package/utils/object/object.js +1 -2
  400. package/utils/object/object.js.map +1 -1
  401. package/utils/object/property-name.d.ts +5 -5
  402. package/utils/patch-worker.d.ts +1 -1
  403. package/utils/periodic-sampler.d.ts +1 -1
  404. package/utils/provider-function-iterable.d.ts +2 -2
  405. package/utils/proxy.d.ts +1 -1
  406. package/utils/singleton.d.ts +2 -2
  407. package/utils/sort.d.ts +2 -2
  408. package/utils/stream/stream-helper-types.d.ts +5 -5
  409. package/utils/type-guards.d.ts +3 -3
  410. package/utils/url-builder.d.ts +4 -4
  411. package/web-types.d.ts +4 -4
  412. package/notification/model.d.ts +0 -18
  413. package/notification/model.js.map +0 -1
  414. package/orm/mongo/mongo-repository.d.ts +0 -2
  415. package/orm/mongo/mongo-repository.js +0 -7
  416. package/orm/mongo/mongo-repository.js.map +0 -1
  417. package/orm/types.js.map +0 -1
  418. package/schema/types.js +0 -102
  419. package/schema/types.js.map +0 -1
@@ -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
  };
@@ -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;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AAI,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;