@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
@@ -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;
@@ -1,16 +1,16 @@
1
1
  import type { Injectable } from "../container";
2
2
  import { resolveArgumentType } from "../container";
3
3
  import { LogLevel } from './level';
4
- export declare type LogEntry = string;
5
- export declare type LogEntryProvider = () => LogEntry;
6
- export declare type LogEntryOrProvider = LogEntry | LogEntryProvider;
7
- export declare type LoggerStatic = new (level: LogLevel) => Logger;
8
- export declare type LogErrorOptions = {
4
+ export type LogEntry = string;
5
+ export type LogEntryProvider = () => LogEntry;
6
+ export type LogEntryOrProvider = LogEntry | LogEntryProvider;
7
+ export type LoggerStatic = new (level: LogLevel) => Logger;
8
+ export type LogErrorOptions = {
9
9
  includeRest?: boolean;
10
10
  includeStack?: boolean;
11
11
  };
12
12
  /** either string as a module shorthand or object */
13
- export declare type LoggerArgument = string | undefined | {
13
+ export type LoggerArgument = string | undefined | {
14
14
  level?: LogLevel;
15
15
  module?: string | string[];
16
16
  prefix?: string;
@@ -1,7 +1,7 @@
1
1
  import type { Injectable } from "../container";
2
2
  import { resolveArgumentType } from "../container";
3
3
  import type { MailData, MailSendResult } from './models';
4
- export declare type MailClientConfig = {
4
+ export type MailClientConfig = {
5
5
  host: string;
6
6
  port: number;
7
7
  secure?: boolean;
@@ -4,13 +4,15 @@ import type { TypedOmit } from "../types";
4
4
  import { MailLogRepository } from './mail-log.repository';
5
5
  import { MailClient } from './mail.client';
6
6
  import type { MailData, MailSendResult } from './models';
7
+ import { DefaultMailData } from './models';
7
8
  export declare class MailService {
8
9
  private readonly mailClient;
9
10
  private readonly templateService;
10
11
  private readonly mailLogRepository;
12
+ private readonly defaultData;
11
13
  private readonly logger;
12
14
  private readonly mailDataSourceTemplateKey;
13
- constructor(mailClient: MailClient, templateService: TemplateService, mailLogRepository: MailLogRepository | undefined, logger: Logger);
15
+ constructor(mailClient: MailClient, templateService: TemplateService, mailLogRepository: MailLogRepository | undefined, defaultData: DefaultMailData, logger: Logger);
14
16
  send(mailData: MailData): Promise<MailSendResult>;
15
17
  sendTemplate(key: string, mailData: TypedOmit<MailData, 'content' | 'subject'>, templateContext?: object): Promise<MailSendResult>;
16
18
  }
@@ -22,33 +22,37 @@ const format_error_1 = require("../utils/format-error");
22
22
  const type_guards_1 = require("../utils/type-guards");
23
23
  const mail_log_repository_1 = require("./mail-log.repository");
24
24
  const mail_client_1 = require("./mail.client");
25
+ const tokens_1 = require("./tokens");
25
26
  let MailService = MailService_1 = class MailService {
26
27
  mailClient;
27
28
  templateService;
28
29
  mailLogRepository;
30
+ defaultData;
29
31
  logger;
30
32
  mailDataSourceTemplateKey;
31
- constructor(mailClient, templateService, mailLogRepository, logger) {
33
+ constructor(mailClient, templateService, mailLogRepository, defaultData, logger) {
32
34
  this.mailClient = mailClient;
33
35
  this.templateService = templateService;
34
36
  this.mailLogRepository = mailLogRepository;
37
+ this.defaultData = defaultData;
35
38
  this.logger = logger;
36
39
  this.mailDataSourceTemplateKey = new WeakMap();
37
40
  }
38
41
  async send(mailData) {
42
+ const data = { ...this.defaultData, ...mailData };
39
43
  let mailLog;
40
44
  if ((0, type_guards_1.isDefined)(this.mailLogRepository)) {
41
45
  const log = {
42
46
  timestamp: (0, date_time_1.currentTimestamp)(),
43
- templateKey: this.mailDataSourceTemplateKey.get(mailData) ?? null,
44
- data: mailData,
47
+ templateKey: this.mailDataSourceTemplateKey.get(data) ?? null,
48
+ data,
45
49
  sendResult: null,
46
50
  errors: null
47
51
  };
48
52
  mailLog = await this.mailLogRepository.insert(log);
49
53
  }
50
54
  try {
51
- const result = await this.mailClient.send(mailData);
55
+ const result = await this.mailClient.send(data);
52
56
  if ((0, type_guards_1.isDefined)(mailLog)) {
53
57
  await this.mailLogRepository.patch(mailLog, { sendResult: result });
54
58
  }
@@ -77,9 +81,10 @@ MailService = MailService_1 = __decorate([
77
81
  (0, container_1.singleton)(),
78
82
  __param(2, (0, container_1.inject)(mail_log_repository_1.MailLogRepository)),
79
83
  __param(2, (0, container_1.optional)()),
80
- __param(3, (0, container_1.resolveArg)(MailService_1.name)),
84
+ __param(3, (0, container_1.inject)(tokens_1.MAIL_DEFAULT_DATA)),
85
+ __param(4, (0, container_1.resolveArg)(MailService_1.name)),
81
86
  __metadata("design:paramtypes", [mail_client_1.MailClient,
82
- templates_1.TemplateService, Object, logger_1.Logger])
87
+ templates_1.TemplateService, Object, Object, logger_1.Logger])
83
88
  ], MailService);
84
89
  exports.MailService = MailService;
85
90
  //# sourceMappingURL=mail.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mail.service.js","sourceRoot":"","sources":["../../source/mail/mail.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAsE;AAEtE,sCAAkC;AAClC,4CAA8C;AAE9C,kDAAqD;AACrD,wDAAmD;AACnD,sDAAgD;AAChD,+DAA0D;AAC1D,+CAA2C;AAIpC,IAAM,WAAW,mBAAjB,MAAM,WAAW;IACL,UAAU,CAAa;IACvB,eAAe,CAAkB;IAC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wEvB;AAxEY,kCAAW"}
@@ -1,4 +1,4 @@
1
- export declare type MailAddress = string | {
1
+ export type MailAddress = string | {
2
2
  name: string;
3
3
  address: string;
4
4
  };
@@ -1,4 +1,4 @@
1
- export declare type MailContent = {
1
+ export type MailContent = {
2
2
  text?: string;
3
3
  html?: string;
4
4
  };
@@ -1,7 +1,7 @@
1
1
  import type { OneOrMany } from "../../types";
2
2
  import type { MailAddress } from './mail-address.model';
3
3
  import type { MailContent } from './mail-content.model';
4
- export declare type MailData = {
4
+ export type MailData = {
5
5
  content: MailContent;
6
6
  from?: MailAddress;
7
7
  to?: OneOrMany<MailAddress>;
@@ -18,3 +18,4 @@ export declare type MailData = {
18
18
  */
19
19
  headers?: Record<string, string | string[]>;
20
20
  };
21
+ export type DefaultMailData = Partial<MailData>;
@@ -1,11 +1,11 @@
1
1
  import type { Entity, NewEntity } from "../../database";
2
2
  import type { MailData } from './mail-data.model';
3
3
  import type { MailSendResult } from './mail-send-result.model';
4
- export declare type MailLog = Entity & {
4
+ export type MailLog = Entity & {
5
5
  timestamp: number;
6
6
  templateKey: string | null;
7
7
  data: MailData;
8
8
  sendResult: MailSendResult | null;
9
9
  errors: string[] | null;
10
10
  };
11
- export declare type NewMailLog = NewEntity<MailLog>;
11
+ export type NewMailLog = NewEntity<MailLog>;
@@ -1,5 +1,5 @@
1
1
  import type { MailAddress } from './mail-address.model';
2
- export declare type MailSendResult = {
2
+ export type MailSendResult = {
3
3
  messageId: string;
4
4
  accepted: MailAddress[];
5
5
  rejected: MailAddress[];
@@ -1,5 +1,5 @@
1
1
  import type { Template, TemplateField } from "../../templates";
2
- export declare type MailTemplate = Template<{
2
+ export type MailTemplate = Template<{
3
3
  subject: false;
4
4
  html: false;
5
5
  text: false;
package/mail/module.d.ts CHANGED
@@ -2,13 +2,15 @@ import type { Type } from "../types";
2
2
  import { MailLogRepository } from './mail-log.repository';
3
3
  import type { MailClientConfig } from './mail.client';
4
4
  import { MailClient } from './mail.client';
5
- export declare type MailModuleConfig = {
5
+ import type { DefaultMailData } from './models';
6
+ export type MailModuleConfig = {
6
7
  clientConfig: MailClientConfig;
7
8
  client: Type<MailClient>;
8
9
  logRepository: Type<MailLogRepository> | undefined;
10
+ defaultData: DefaultMailData;
9
11
  };
10
12
  export declare const mailModuleConfig: MailModuleConfig;
11
13
  /**
12
14
  * configure mail module
13
15
  */
14
- export declare function configureMail({ clientConfig, client, logRepository }: Partial<MailModuleConfig>): void;
16
+ export declare function configureMail({ clientConfig, client, logRepository, defaultData }: Partial<MailModuleConfig>): void;
package/mail/module.js CHANGED
@@ -9,12 +9,13 @@ const tokens_1 = require("./tokens");
9
9
  exports.mailModuleConfig = {
10
10
  clientConfig: { host: '127.0.0.1', port: 25 },
11
11
  client: (0, container_1.stubClass)(mail_client_1.MailClient),
12
- logRepository: (0, container_1.stubClass)(mail_log_repository_1.MailLogRepository)
12
+ logRepository: (0, container_1.stubClass)(mail_log_repository_1.MailLogRepository),
13
+ defaultData: {}
13
14
  };
14
15
  /**
15
16
  * configure mail module
16
17
  */
17
- function configureMail({ clientConfig, client, logRepository }) {
18
+ function configureMail({ clientConfig, client, logRepository, defaultData }) {
18
19
  if ((0, type_guards_1.isDefined)(clientConfig)) {
19
20
  container_1.container.registerSingleton(tokens_1.MAIL_CLIENT_CONFIG, { useValue: clientConfig });
20
21
  }
@@ -24,6 +25,9 @@ function configureMail({ clientConfig, client, logRepository }) {
24
25
  if ((0, type_guards_1.isDefined)(logRepository)) {
25
26
  container_1.container.registerSingleton(mail_log_repository_1.MailLogRepository, { useToken: logRepository });
26
27
  }
28
+ if ((0, type_guards_1.isDefined)(defaultData)) {
29
+ container_1.container.registerSingleton(tokens_1.MAIL_DEFAULT_DATA, { useValue: defaultData });
30
+ }
27
31
  }
28
32
  exports.configureMail = configureMail;
29
33
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sourceRoot":"","sources":["../../source/mail/module.ts"],"names":[],"mappings":";;;AAAA,4CAA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G;AACH,SAAgB,aAAa,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAA6B;IAC3G,IAAI,IAAA,uBAAS,EAAC,YAAY,CAAC,EAAE;QAC3B,qBAAS,CAAC,iBAAiB,CAAC,2BAAkB,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAC;KAC7E;IAED,IAAI,IAAA,uBAAS,EAAC,MAAM,CAAC,EAAE;QACrB,qBAAS,CAAC,iBAAiB,CAAC,wBAAU,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;KAC/D;IAED,IAAI,IAAA,uBAAS,EAAC,aAAa,CAAC,EAAE;QAC5B,qBAAS,CAAC,iBAAiB,CAAC,uCAAiB,EAAE,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC,CAAC;KAC7E;IAED,IAAI,IAAA,uBAAS,EAAC,WAAW,CAAC,EAAE;QAC1B,qBAAS,CAAC,iBAAiB,CAAC,0BAAiB,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC;KAC3E;AACH,CAAC;AAhBD,sCAgBC"}
@@ -4,10 +4,10 @@ import type { CollectionArgument } from "../../database/mongo";
4
4
  import { Collection, MongoEntityRepository } from "../../database/mongo";
5
5
  import { Logger } from "../../logger";
6
6
  import type { MailLog } from '../models';
7
- export declare type MongoMailLogRepositoryConfig = {
7
+ export type MongoMailLogRepositoryConfig = {
8
8
  config?: MongoMailLogRepositoryArgument;
9
9
  };
10
- export declare type MongoMailLogRepositoryArgument = CollectionArgument<MailLog>;
10
+ export type MongoMailLogRepositoryArgument = CollectionArgument<MailLog>;
11
11
  export declare const mongoMailLogRepositoryConfig: MongoMailLogRepositoryConfig;
12
12
  export declare class MongoMailLogRepository extends MongoEntityRepository<MailLog> implements Injectable<MongoMailLogRepositoryArgument> {
13
13
  [resolveArgumentType]: MongoMailLogRepositoryArgument;
package/mail/tokens.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  import type { MailClientConfig } from './mail.client';
2
2
  export declare const MAIL_CLIENT_CONFIG: import("../container").InjectionToken<MailClientConfig, any>;
3
+ export declare const MAIL_DEFAULT_DATA: import("../container").InjectionToken<Partial<import("./models").MailData>, any>;
package/mail/tokens.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MAIL_CLIENT_CONFIG = void 0;
3
+ exports.MAIL_DEFAULT_DATA = exports.MAIL_CLIENT_CONFIG = void 0;
4
4
  const container_1 = require("../container");
5
5
  exports.MAIL_CLIENT_CONFIG = (0, container_1.injectionToken)('MAIL_CLIENT_CONFIG');
6
+ exports.MAIL_DEFAULT_DATA = (0, container_1.injectionToken)('MAIL_DEFAULT_DATA');
6
7
  //# sourceMappingURL=tokens.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../source/mail/tokens.ts"],"names":[],"mappings":";;;AAAA,4CAA6C;AAGhC,QAAA,kBAAkB,GAAG,IAAA,0BAAc,EAAmB,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../source/mail/tokens.ts"],"names":[],"mappings":";;;AAAA,4CAA6C;AAIhC,QAAA,kBAAkB,GAAG,IAAA,0BAAc,EAAmB,oBAAoB,CAAC,CAAC;AAE5E,QAAA,iBAAiB,GAAG,IAAA,0BAAc,EAAkB,mBAAmB,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- export declare type LocalMessageBusItem<T = unknown> = {
1
+ export type LocalMessageBusItem<T = unknown> = {
2
2
  source: symbol;
3
3
  message: T;
4
4
  };
@@ -3,7 +3,7 @@ import { resolveArgumentType } from "../container";
3
3
  import type { Observable } from 'rxjs';
4
4
  import type { AsyncDisposable } from '../disposable';
5
5
  import { disposeAsync } from '../disposable';
6
- export declare type MessageBusArgument = string;
6
+ export type MessageBusArgument = string;
7
7
  export declare abstract class MessageBus<T> implements AsyncDisposable, Injectable<MessageBusArgument> {
8
8
  readonly [resolveArgumentType]: string;
9
9
  /** messages from other instances */
@@ -1,6 +1,6 @@
1
1
  import type { Entity, NewEntity } from "../database";
2
- export declare type MigrationState = Entity & {
2
+ export type MigrationState = Entity & {
3
3
  name: string;
4
4
  revision: number;
5
5
  };
6
- export declare type NewMigrationState = NewEntity<MigrationState>;
6
+ export type NewMigrationState = NewEntity<MigrationState>;
@@ -1,19 +1,19 @@
1
1
  import { LockProvider } from "../lock";
2
2
  import { Logger } from "../logger";
3
3
  import { MigrationStateRepository } from './migration-state-repository';
4
- export declare type MigrationDefinition<T = void> = {
4
+ export type MigrationDefinition<T = void> = {
5
5
  name: string;
6
6
  migrations: Migration<T>[];
7
7
  };
8
- export declare type Migration<T = void> = {
8
+ export type Migration<T = void> = {
9
9
  from: 'init' | number | number[];
10
10
  to: number;
11
11
  migrator: (control: MigrationControl) => Promise<T> | T;
12
12
  };
13
- export declare type MigrationControl = {
13
+ export type MigrationControl = {
14
14
  restart: () => void;
15
15
  };
16
- export declare type MigrationResult<T> = {
16
+ export type MigrationResult<T> = {
17
17
  from: 'init' | number;
18
18
  to: number;
19
19
  time: number;
@@ -1,6 +1,6 @@
1
1
  import type { MongoRepositoryConfig } from "../../database/mongo";
2
2
  import type { MigrationState } from "..";
3
- export declare type MongoMigrationStateRepositoryModuleConfig = {
3
+ export type MongoMigrationStateRepositoryModuleConfig = {
4
4
  defaultMigrationStateRepositoryConfig: MongoRepositoryConfig<MigrationState> | undefined;
5
5
  };
6
6
  export declare const mongoMigrationStateRepositoryModuleConfig: MongoMigrationStateRepositoryModuleConfig;
@@ -2,12 +2,12 @@ import type { ReadonlyCancellationToken } from "../utils/cancellation-token";
2
2
  import type { MetricAggregation, MetricAggregationOptions } from "../utils/moving-metric";
3
3
  import { MovingMetric } from "../utils/moving-metric";
4
4
  import type { ModuleMetric } from './module';
5
- export declare type MetricReport<Aggregation extends MetricAggregation> = {
5
+ export type MetricReport<Aggregation extends MetricAggregation> = {
6
6
  displayName: string;
7
7
  aggregation: Aggregation;
8
8
  aggregationOptions?: MetricAggregationOptions<Aggregation>;
9
9
  };
10
- export declare type MetricReportRegistration = {
10
+ export type MetricReportRegistration = {
11
11
  metric: ModuleMetric;
12
12
  moving: MovingMetric;
13
13
  reports: MetricReport<MetricAggregation>[];
@@ -3,7 +3,7 @@ export declare enum ModuleMetricType {
3
3
  Counter = 0,
4
4
  Gauge = 1
5
5
  }
6
- export declare type ModuleMetric = {
6
+ export type ModuleMetric = {
7
7
  type: ModuleMetricType;
8
8
  labels?: string[];
9
9
  getValue(): number;
@@ -1,7 +1,7 @@
1
1
  import type { ReadonlyCancellationToken } from "../../utils/cancellation-token";
2
2
  import type { Module } from '../module';
3
3
  import { ModuleBase } from '../module-base';
4
- export declare type FunctionModuleFunction = (cancellationToken: ReadonlyCancellationToken) => void | Promise<void>;
4
+ export type FunctionModuleFunction = (cancellationToken: ReadonlyCancellationToken) => void | Promise<void>;
5
5
  export declare class FunctionModule extends ModuleBase implements Module {
6
6
  private readonly fn;
7
7
  readonly metrics: {};
@@ -7,7 +7,7 @@ import type { ReadonlyCancellationToken } from "../../utils/cancellation-token";
7
7
  import type { Module } from '../module';
8
8
  import { ModuleMetricType } from '../module';
9
9
  import { ModuleBase } from '../module-base';
10
- export declare type WebServerModuleConfiguration = {
10
+ export type WebServerModuleConfiguration = {
11
11
  port: number;
12
12
  };
13
13
  export declare const webServerModuleConfiguration: WebServerModuleConfiguration;
@@ -1,17 +1,14 @@
1
1
  import type { ApiServerResult } from "../api";
2
- import { Notification } from './model';
2
+ import { Notification } from './models';
3
3
  declare const notificationApiDefinition: {
4
4
  readonly resource: string;
5
5
  endpoints: {
6
6
  get: {
7
- parameters: import("../schema").ObjectSchema<{
8
- for: string;
9
- }>;
10
- result: import("../schema").ValueSchema<Notification[]>;
7
+ result: import("../schema").ValueSchema<Notification<unknown>[]>;
11
8
  };
12
9
  };
13
10
  };
14
- declare type NotificationApiDefinition = typeof notificationApiDefinition;
11
+ type NotificationApiDefinition = typeof notificationApiDefinition;
15
12
  export declare class NotificationApi {
16
13
  get(): Promise<ApiServerResult<NotificationApiDefinition, 'get'>>;
17
14
  }
@@ -10,16 +10,13 @@ exports.NotificationApi = void 0;
10
10
  const api_1 = require("../api");
11
11
  const server_1 = require("../api/server");
12
12
  const schema_1 = require("../schema");
13
- const model_1 = require("./model");
13
+ const models_1 = require("./models");
14
14
  const module_1 = require("./module");
15
15
  const notificationApiDefinition = (0, api_1.defineApi)({
16
16
  get resource() { return module_1.notificationModuleConfig.apiResource; },
17
17
  endpoints: {
18
18
  get: {
19
- parameters: (0, schema_1.object)({
20
- for: (0, schema_1.string)()
21
- }),
22
- result: (0, schema_1.array)(model_1.Notification)
19
+ result: (0, schema_1.array)(models_1.Notification)
23
20
  }
24
21
  }
25
22
  });
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../../source/notification/api.ts"],"names":[],"mappings":";;;;;;;;;AACA,gCAAkC;AAClC,0CAA6C;AAC7C,sCAAiD;AACjD,mCAAuC;AACvC,qCAAoD;AAEpD,MAAM,yBAAyB,GAAG,IAAA,eAAS,EAAC;IAC1C,IAAI,QAAQ,KAAK,OAAO,iCAAwB,CAAC,WAAW,CAAC,CAAC,CAAC;IAC/D,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,IAAA,eAAM,EAAC;gBACjB,GAAG,EAAE,IAAA,eAAM,GAAE;aACd,CAAC;YACF,MAAM,EAAE,IAAA,cAAK,EAAC,oBAAY,CAAC;SAC5B;KACF;CACF,CAAC,CAAC;AAMI,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,KAAK,CAAC,GAAG;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;CACF,CAAA;AAJY,eAAe;IAD3B,IAAA,sBAAa,EAAC,yBAAyB,CAAC;GAC5B,eAAe,CAI3B;AAJY,0CAAe"}
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../source/notification/api.ts"],"names":[],"mappings":";;;;;;;;;AACA,gCAAkC;AAClC,0CAA6C;AAC7C,sCAAiC;AACjC,qCAAwC;AACxC,qCAAoD;AAEpD,MAAM,yBAAyB,GAAG,IAAA,eAAS,EAAC;IAC1C,IAAI,QAAQ,KAAK,OAAO,iCAAwB,CAAC,WAAW,CAAC,CAAC,CAAC;IAC/D,SAAS,EAAE;QACT,GAAG,EAAE;YACH,MAAM,EAAE,IAAA,cAAK,EAAC,qBAAY,CAAC;SAC5B;KACF;CACF,CAAC,CAAC;AAKI,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,KAAK,CAAC,GAAG;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;CACF,CAAA;AAJY,eAAe;IAD3B,IAAA,sBAAa,EAAC,yBAAyB,CAAC;GAC5B,eAAe,CAI3B;AAJY,0CAAe"}
@@ -0,0 +1,2 @@
1
+ export * from './notification-channel-job.model';
2
+ export * from './notification.model';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./notification-channel-job.model"), exports);
18
+ __exportStar(require("./notification.model"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/notification/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAiD;AACjD,uDAAqC"}