@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
@@ -0,0 +1,3 @@
1
+ export type NotificationChannelJob<Type extends string = string> = {
2
+ type: Type;
3
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=notification-channel-job.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-channel-job.model.js","sourceRoot":"","sources":["../../../source/notification/models/notification-channel-job.model.ts"],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
1
+ import { Entity } from "../../orm/models";
2
+ export declare class Notification<T = unknown> extends Entity {
3
+ /**
4
+ * Receiver for the notification
5
+ */
6
+ receiver: string;
7
+ /**
8
+ * Channels over which the notification is sent
9
+ */
10
+ channels: string[];
11
+ /**
12
+ * Timestamp at which the notification was created
13
+ */
14
+ timestamp: number;
15
+ /**
16
+ * Timestamp at which the notification was marked as read
17
+ */
18
+ readTimestamp: number | null;
19
+ /**
20
+ * Custom data
21
+ */
22
+ data: T;
23
+ }
24
+ declare const NewNotification_base: import("../../types").Type<import("../../types").PartialProperty<Notification<any>, "id">, any>;
25
+ export declare class NewNotification extends NewNotification_base {
26
+ }
27
+ export {};
@@ -9,30 +9,39 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Notification = void 0;
13
- const schema_1 = require("../schema");
14
- let Notification = class Notification {
12
+ exports.NewNotification = exports.Notification = void 0;
13
+ const models_1 = require("../../orm/models");
14
+ const schema_1 = require("../../schema");
15
+ class Notification extends models_1.Entity {
15
16
  /**
16
- *
17
+ * Receiver for the notification
17
18
  */
18
- for;
19
+ receiver;
19
20
  /**
20
- * Timestamp at which the notification was created.
21
+ * Channels over which the notification is sent
22
+ */
23
+ channels;
24
+ /**
25
+ * Timestamp at which the notification was created
21
26
  */
22
27
  timestamp;
23
28
  /**
24
- * Timestamp at which the notification was marked as read.
29
+ * Timestamp at which the notification was marked as read
25
30
  */
26
- read;
31
+ readTimestamp;
27
32
  /**
28
- * Custom data.
33
+ * Custom data
29
34
  */
30
35
  data;
31
- };
36
+ }
32
37
  __decorate([
33
38
  (0, schema_1.Property)(),
34
39
  __metadata("design:type", String)
35
- ], Notification.prototype, "for", void 0);
40
+ ], Notification.prototype, "receiver", void 0);
41
+ __decorate([
42
+ (0, schema_1.Array)(String),
43
+ __metadata("design:type", Array)
44
+ ], Notification.prototype, "channels", void 0);
36
45
  __decorate([
37
46
  (0, schema_1.Property)(),
38
47
  __metadata("design:type", Number)
@@ -40,13 +49,16 @@ __decorate([
40
49
  __decorate([
41
50
  (0, schema_1.Property)(),
42
51
  __metadata("design:type", Object)
43
- ], Notification.prototype, "read", void 0);
52
+ ], Notification.prototype, "readTimestamp", void 0);
44
53
  __decorate([
45
54
  (0, schema_1.Any)(),
46
55
  __metadata("design:type", Object)
47
56
  ], Notification.prototype, "data", void 0);
48
- Notification = __decorate([
49
- (0, schema_1.Class)()
50
- ], Notification);
51
57
  exports.Notification = Notification;
52
- //# sourceMappingURL=model.js.map
58
+ let NewNotification = class NewNotification extends (0, models_1.newEntity)(Notification) {
59
+ };
60
+ NewNotification = __decorate([
61
+ (0, schema_1.Class)()
62
+ ], NewNotification);
63
+ exports.NewNotification = NewNotification;
64
+ //# sourceMappingURL=notification.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.model.js","sourceRoot":"","sources":["../../../source/notification/models/notification.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAiD;AACjD,yCAAuD;AAEvD,MAAa,YAA0B,SAAQ,eAAM;IACnD;;OAEG;IAEH,QAAQ,CAAS;IAEjB;;OAEG;IAEH,QAAQ,CAAW;IAEnB;;OAEG;IAEH,SAAS,CAAS;IAElB;;OAEG;IAEH,aAAa,CAAgB;IAE7B;;OAEG;IAEH,IAAI,CAAI;CACT;AA1BC;IAAC,IAAA,iBAAQ,GAAE;;8CACM;AAKjB;IAAC,IAAA,cAAK,EAAC,MAAM,CAAC;;8CACK;AAKnB;IAAC,IAAA,iBAAQ,GAAE;;+CACO;AAKlB;IAAC,IAAA,iBAAQ,GAAE;;mDACkB;AAK7B;IAAC,IAAA,YAAG,GAAE;;0CACE;AA7BV,oCA8BC;AAGM,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,IAAA,kBAAS,EAAC,YAAY,CAAC;CAAI,CAAA;AAAnD,eAAe;IAD3B,IAAA,cAAK,GAAE;GACK,eAAe,CAAoC;AAAnD,0CAAe"}
@@ -1,4 +1,4 @@
1
- export declare type NotificationModuleConfig = {
1
+ export type NotificationModuleConfig = {
2
2
  apiResource: string;
3
3
  };
4
4
  export declare const notificationModuleConfig: NotificationModuleConfig;
@@ -0,0 +1,5 @@
1
+ import type { NotificationChannelJob } from './models';
2
+ export declare abstract class NotificationChannel {
3
+ abstract type: string;
4
+ abstract handle(job: NotificationChannelJob): Promise<void>;
5
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotificationChannel = void 0;
4
+ class NotificationChannel {
5
+ }
6
+ exports.NotificationChannel = NotificationChannel;
7
+ //# sourceMappingURL=notification-channel.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-channel.service.js","sourceRoot":"","sources":["../../source/notification/notification-channel.service.ts"],"names":[],"mappings":";;;AAEA,MAAsB,mBAAmB;CAIxC;AAJD,kDAIC"}
@@ -0,0 +1,8 @@
1
+ import { Repository } from "../orm/repository/repository";
2
+ import type { Notification } from './models';
3
+ export declare class NotificationService<T> {
4
+ private readonly notificationRepository;
5
+ constructor(notificationRepository: Repository<Notification<T>>);
6
+ send(receiver: string, channels: string[], data: T): Promise<Notification<T>>;
7
+ markAsRead(id: string): Promise<void>;
8
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.NotificationService = void 0;
13
+ const container_1 = require("../container");
14
+ const repository_1 = require("../orm/repository/repository");
15
+ const utils_1 = require("../utils");
16
+ let NotificationService = class NotificationService {
17
+ notificationRepository;
18
+ constructor(notificationRepository) {
19
+ this.notificationRepository = notificationRepository;
20
+ }
21
+ async send(receiver, channels, data) {
22
+ const newNotification = {
23
+ receiver,
24
+ channels,
25
+ timestamp: (0, utils_1.currentTimestamp)(),
26
+ readTimestamp: null,
27
+ data
28
+ };
29
+ return this.notificationRepository.saveAndLoad(newNotification);
30
+ }
31
+ async markAsRead(id) {
32
+ return this.notificationRepository.patch(id, { readTimestamp: (0, utils_1.currentTimestamp)() });
33
+ }
34
+ };
35
+ NotificationService = __decorate([
36
+ (0, container_1.singleton)(),
37
+ __metadata("design:paramtypes", [repository_1.Repository])
38
+ ], NotificationService);
39
+ exports.NotificationService = NotificationService;
40
+ //# sourceMappingURL=notification.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.service.js","sourceRoot":"","sources":["../../source/notification/notification.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAwC;AACxC,6DAAyD;AACzD,oCAA2C;AAIpC,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IACb,sBAAsB,CAA8B;IAErE,YAAY,sBAAmD;QAC7D,IAAI,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,QAAgB,EAAE,QAAkB,EAAE,IAAO;QACtD,MAAM,eAAe,GAAoB;YACvC,QAAQ;YACR,QAAQ;YACR,SAAS,EAAE,IAAA,wBAAgB,GAAE;YAC7B,aAAa,EAAE,IAAI;YACnB,IAAI;SACL,CAAC;QAEF,OAAO,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,EAAU;QACzB,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,aAAa,EAAE,IAAA,wBAAgB,GAAE,EAAE,CAAC,CAAC;IACtF,CAAC;CACF,CAAA;AAtBY,mBAAmB;IAD/B,IAAA,qBAAS,GAAE;qCAI0B,uBAAU;GAHnC,mBAAmB,CAsB/B;AAtBY,kDAAmB"}
@@ -1,10 +1,10 @@
1
1
  import type { Injectable } from "../container";
2
2
  import { resolveArgumentType } from "../container";
3
3
  import type { ObjectMetadata, ObjectStorageObject } from './object';
4
- export declare type UploadObjectOptions = {
4
+ export type UploadObjectOptions = {
5
5
  metadata?: ObjectMetadata;
6
6
  };
7
- export declare type ObjectStorageArgument = string;
7
+ export type ObjectStorageArgument = string;
8
8
  export declare abstract class ObjectStorage implements Injectable<ObjectStorageArgument> {
9
9
  /**
10
10
  * object storage module
@@ -1,5 +1,5 @@
1
1
  import type { Record } from "../types";
2
- export declare type ObjectMetadata = Record<string>;
2
+ export type ObjectMetadata = Record<string>;
3
3
  export declare abstract class ObjectStorageObject {
4
4
  readonly module: string;
5
5
  readonly key: string;
@@ -1,7 +1,7 @@
1
1
  import { ObjectStorageProvider } from "..";
2
2
  import { S3ObjectStorage } from './s3.object-storage';
3
3
  export declare const S3_OBJECT_STORAGE_PROVIDER_CONFIG: import("../../container").InjectionToken<S3ObjectStorageProviderConfig, any>;
4
- export declare type S3ObjectStorageProviderConfig = {
4
+ export type S3ObjectStorageProviderConfig = {
5
5
  /**
6
6
  * s3 endpoint
7
7
  */
@@ -6,7 +6,7 @@ import { Logger } from "../logger";
6
6
  import type { TypedOmit } from "../types";
7
7
  import type { OidcState } from './oidc-state.model';
8
8
  import { OidcStateRepository } from './oidc-state.repository';
9
- export declare type MongoOidcState = TypedOmit<OidcState, 'expiration'> & {
9
+ export type MongoOidcState = TypedOmit<OidcState, 'expiration'> & {
10
10
  expiration: Date;
11
11
  };
12
12
  export declare class MongoOidcStateRepository extends MongoEntityRepository<OidcState, MongoOidcState> implements OidcStateRepository, Injectable<CollectionArgument<MongoOidcState>> {
@@ -1,5 +1,5 @@
1
1
  import { HttpClient } from "../http/client";
2
- export declare type OidcConfiguration = {
2
+ export type OidcConfiguration = {
3
3
  authorizationEndpoint: string;
4
4
  tokenEndpoint: string;
5
5
  revocationEndpoint?: string;
@@ -1,5 +1,5 @@
1
1
  import type { Entity, NewEntity } from "../database";
2
- export declare type OidcState<Data = any> = Entity & {
2
+ export type OidcState<Data = any> = Entity & {
3
3
  value: string;
4
4
  codeVerifier: string;
5
5
  endpoint: string;
@@ -8,4 +8,4 @@ export declare type OidcState<Data = any> = Entity & {
8
8
  expiration: number;
9
9
  data: Data;
10
10
  };
11
- export declare type NewOidcState<Data = any> = NewEntity<OidcState<Data>>;
11
+ export type NewOidcState<Data = any> = NewEntity<OidcState<Data>>;
@@ -1,4 +1,4 @@
1
- export declare type OidcInitParameters<Data = void> = {
1
+ export type OidcInitParameters<Data = void> = {
2
2
  endpoint: string;
3
3
  clientId: string;
4
4
  clientSecret: string;
@@ -8,7 +8,7 @@ export declare type OidcInitParameters<Data = void> = {
8
8
  /** custom data */
9
9
  data: Data;
10
10
  };
11
- export declare type OidcInitResult = {
11
+ export type OidcInitResult = {
12
12
  authorizationEndpoint: string;
13
13
  state: string;
14
14
  clientId: string;
@@ -16,31 +16,31 @@ export declare type OidcInitResult = {
16
16
  codeChallenge: string;
17
17
  codeChallengeMethod: string;
18
18
  };
19
- export declare type OidcToken<Raw = unknown> = {
19
+ export type OidcToken<Raw = unknown> = {
20
20
  tokenType: string;
21
21
  accessToken: string;
22
22
  idToken?: string;
23
23
  refreshToken?: string;
24
24
  raw: Raw;
25
25
  };
26
- export declare type OidcGetTokenParametersBase<GrantType extends string> = {
26
+ export type OidcGetTokenParametersBase<GrantType extends string> = {
27
27
  endpoint: string;
28
28
  grantType: GrantType;
29
29
  clientId: string;
30
30
  clientSecret: string;
31
31
  authType?: 'body' | 'basic-auth';
32
32
  };
33
- export declare type OidcGetTokenParametersWithClientCredentials = OidcGetTokenParametersBase<'client_credentials'> & {
33
+ export type OidcGetTokenParametersWithClientCredentials = OidcGetTokenParametersBase<'client_credentials'> & {
34
34
  scope?: string;
35
35
  };
36
- export declare type OidcGetTokenParametersWithAuthorizationCode = OidcGetTokenParametersBase<'authorization_code'> & {
36
+ export type OidcGetTokenParametersWithAuthorizationCode = OidcGetTokenParametersBase<'authorization_code'> & {
37
37
  scope?: string;
38
38
  code: string;
39
39
  codeVerifier: string;
40
40
  redirectUri: string;
41
41
  };
42
- export declare type OidcGetTokenParameters = OidcGetTokenParametersWithClientCredentials | OidcGetTokenParametersWithAuthorizationCode;
43
- export declare type OidcRefreshTokenParameters = {
42
+ export type OidcGetTokenParameters = OidcGetTokenParametersWithClientCredentials | OidcGetTokenParametersWithAuthorizationCode;
43
+ export type OidcRefreshTokenParameters = {
44
44
  endpoint: string;
45
45
  clientId: string;
46
46
  clientSecret: string;
@@ -0,0 +1,26 @@
1
+ import { JsonPath } from "../json-path";
2
+ import type { ObjectSchema } from "../schema/types";
3
+ import type { AbstractConstructor, TypedOmit } from "../types";
4
+ import type { EntityDefinition, FieldDefinition, IndexOptions } from './entity-definition.model';
5
+ export type EntityOptions = Partial<Pick<EntityDefinition, 'name' | 'indexes'>>;
6
+ export type FieldOptions = Partial<FieldDefinition>;
7
+ export declare function createEntityDecorator(options: EntityOptions): ClassDecorator;
8
+ export declare function createFieldDecorator(options: FieldOptions): PropertyDecorator;
9
+ export declare function Entity(options?: EntityOptions): ClassDecorator;
10
+ export declare function Field(options?: FieldOptions): PropertyDecorator;
11
+ export declare function NullableField(options?: TypedOmit<FieldOptions, 'nullable'>): PropertyDecorator;
12
+ export declare function PrimaryField(options?: FieldOptions): PropertyDecorator;
13
+ export declare function PrimaryGeneratedField(options?: FieldOptions): PropertyDecorator;
14
+ export declare function CreatedField(options?: TypedOmit<FieldOptions, 'type'>): PropertyDecorator;
15
+ export declare function UpdatedField(options?: TypedOmit<FieldOptions, 'type'>): PropertyDecorator;
16
+ export declare function DeletedField(options?: TypedOmit<FieldOptions, 'type'>): PropertyDecorator;
17
+ export declare function RevisionField(options?: TypedOmit<FieldOptions, 'type'>): PropertyDecorator;
18
+ export declare function Index(fields: string[], options?: IndexOptions): ClassDecorator;
19
+ export declare function Index(options?: IndexOptions): PropertyDecorator;
20
+ type GetEntityDefinitionData = {
21
+ entityOptions?: EntityOptions;
22
+ objectSchema?: ObjectSchema;
23
+ };
24
+ export declare function getEntityDefinition(typeOrData: AbstractConstructor | GetEntityDefinitionData): EntityDefinition;
25
+ export declare function getEntityDefinition(typeOrData: AbstractConstructor | GetEntityDefinitionData, path: JsonPath): EntityDefinition;
26
+ export {};
package/orm/decorators.js CHANGED
@@ -1,2 +1,172 @@
1
1
  "use strict";
2
+ /* eslint-disable @typescript-eslint/naming-convention */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.getEntityDefinition = exports.Index = exports.RevisionField = exports.DeletedField = exports.UpdatedField = exports.CreatedField = exports.PrimaryGeneratedField = exports.PrimaryField = exports.NullableField = exports.Field = exports.Entity = exports.createFieldDecorator = exports.createEntityDecorator = void 0;
5
+ const error_1 = require("../error");
6
+ const json_path_1 = require("../json-path");
7
+ const reflection_1 = require("../reflection");
8
+ const enumeration_1 = require("../schema/constraints/enumeration");
9
+ const integer_1 = require("../schema/constraints/integer");
10
+ const types_1 = require("../schema/types");
11
+ const utils_1 = require("../schema/utils");
12
+ const array_1 = require("../utils/array/array");
13
+ const distinct_1 = require("../utils/iterable-helpers/distinct");
14
+ const map_1 = require("../utils/iterable-helpers/map");
15
+ const object_1 = require("../utils/object");
16
+ const type_guards_1 = require("../utils/type-guards");
17
+ function getEntityOptions(typeOrMetadata) {
18
+ const metadata = (0, type_guards_1.isFunction)(typeOrMetadata) ? reflection_1.reflectionRegistry.getMetadata(typeOrMetadata) : typeOrMetadata;
19
+ (0, type_guards_1.assert)(metadata?.metadataType == 'type', 'EntityOptions is only available for classes.');
20
+ return metadata.data.tryGet('orm') ?? {};
21
+ }
22
+ function getFieldOptions(typeOrMetadata, property) {
23
+ const metadata = (0, type_guards_1.isFunction)(typeOrMetadata) ? reflection_1.reflectionRegistry.getMetadata(typeOrMetadata)?.properties.get((0, type_guards_1.assertDefinedPass)(property, 'Missing property parameter.')) : typeOrMetadata;
24
+ (0, type_guards_1.assert)(metadata?.metadataType == 'property', 'FieldOptions is only available for properties.');
25
+ return metadata.data.tryGet('orm') ?? {};
26
+ }
27
+ function createEntityDecorator(options) {
28
+ return (0, reflection_1.createClassDecorator)({ data: { orm: options }, mergeData: true });
29
+ }
30
+ exports.createEntityDecorator = createEntityDecorator;
31
+ function createFieldDecorator(options) {
32
+ return (0, reflection_1.createPropertyDecorator)({ data: { orm: options }, mergeData: true });
33
+ }
34
+ exports.createFieldDecorator = createFieldDecorator;
35
+ function Entity(options = {}) {
36
+ return createEntityDecorator(options);
37
+ }
38
+ exports.Entity = Entity;
39
+ function Field(options = {}) {
40
+ return createFieldDecorator(options);
41
+ }
42
+ exports.Field = Field;
43
+ function NullableField(options = {}) {
44
+ return Field({ ...options, nullable: true });
45
+ }
46
+ exports.NullableField = NullableField;
47
+ function PrimaryField(options) {
48
+ return Field({ ...options, primary: true });
49
+ }
50
+ exports.PrimaryField = PrimaryField;
51
+ function PrimaryGeneratedField(options) {
52
+ return PrimaryField({ ...options, generated: true });
53
+ }
54
+ exports.PrimaryGeneratedField = PrimaryGeneratedField;
55
+ function CreatedField(options) {
56
+ return Field({ ...options, type: 'created' });
57
+ }
58
+ exports.CreatedField = CreatedField;
59
+ function UpdatedField(options) {
60
+ return Field({ ...options, type: 'updated', nullable: true });
61
+ }
62
+ exports.UpdatedField = UpdatedField;
63
+ function DeletedField(options) {
64
+ return Field({ ...options, type: 'deleted', nullable: true });
65
+ }
66
+ exports.DeletedField = DeletedField;
67
+ function RevisionField(options) {
68
+ return Field({ ...options, type: 'revision' });
69
+ }
70
+ exports.RevisionField = RevisionField;
71
+ function Index(fieldsOrOptions, optionsOrNothing) {
72
+ const fields = (0, type_guards_1.isArray)(fieldsOrOptions) ? fieldsOrOptions : undefined;
73
+ const options = ((0, type_guards_1.isArray)(fieldsOrOptions) ? optionsOrNothing : fieldsOrOptions) ?? {};
74
+ return (0, reflection_1.createDecorator)({ class: true, property: true }, (data, metadata) => {
75
+ switch (data.type) {
76
+ case 'class':
77
+ const entityOptions = getEntityOptions(metadata);
78
+ (0, type_guards_1.assertArray)(fields, 'Fields can only be specified on class index decorator.');
79
+ Entity({ indexes: [...(entityOptions.indexes ?? []), { fields, ...options }] })(data.constructor);
80
+ break;
81
+ case 'property':
82
+ const fieldOptions = getFieldOptions(metadata);
83
+ Field({ indexes: [...(fieldOptions.indexes ?? []), options] })(data.prototype, data.propertyKey);
84
+ break;
85
+ default:
86
+ throw new error_1.NotSupportedError('Only works for classes and properties.');
87
+ }
88
+ });
89
+ }
90
+ exports.Index = Index;
91
+ function getEntityDefinition(typeOrData, path = json_path_1.JsonPath.ROOT) {
92
+ const type = (0, type_guards_1.isFunction)(typeOrData) ? typeOrData : undefined;
93
+ const typeMetadata = (0, type_guards_1.isDefined)(type) ? reflection_1.reflectionRegistry.getMetadata(type) : undefined;
94
+ if ((0, type_guards_1.isUndefined)(typeMetadata)) {
95
+ throw new Error(`Type not found in reflection. Missing decorators? (${path.path})`);
96
+ }
97
+ const entityOptions = (0, type_guards_1.isDefined)(typeMetadata) ? getEntityOptions(typeMetadata) : typeOrData.entityOptions;
98
+ const objectSchema = (0, type_guards_1.isFunction)(typeOrData) ? (0, utils_1.tryGetObjectSchemaFromReflection)(typeOrData) : typeOrData.objectSchema;
99
+ const properties = [...(0, distinct_1.distinct)([...typeMetadata.properties.keys(), ...(0, object_1.objectKeys)(objectSchema?.properties ?? {})])];
100
+ const fieldEntries = (0, map_1.map)(properties, (property) => {
101
+ const propertyName = property.toString();
102
+ const propertyMetadata = typeMetadata.properties.get(propertyName);
103
+ const fieldOptions = (0, type_guards_1.isDefined)(propertyMetadata) ? getFieldOptions(propertyMetadata) : undefined;
104
+ const propertySchema = objectSchema?.properties[propertyName];
105
+ const fieldType = fieldOptions?.type
106
+ ?? getFieldTypeFromSchema((0, type_guards_1.assertNotArrayPass)((0, type_guards_1.assertDefinedPass)(propertySchema, 'Could not get field type from schema.'), 'Only a single type is allowed as field type.'), path.add(propertyName));
107
+ return [propertyName, (0, object_1.filterObject)({
108
+ name: fieldOptions?.name,
109
+ type: fieldType,
110
+ primary: fieldOptions?.primary,
111
+ generated: fieldOptions?.generated,
112
+ nullable: fieldOptions?.nullable ?? ((0, types_1.isValueSchema)(propertySchema) ? (((propertySchema.nullable ?? false) || (propertySchema.optional ?? false)) ? true : undefined) : undefined),
113
+ indexes: fieldOptions?.indexes
114
+ }, type_guards_1.isDefined)];
115
+ });
116
+ return {
117
+ name: (0, type_guards_1.assertDefinedPass)(entityOptions?.name ?? type?.name, 'Entity name not defined.'),
118
+ indexes: entityOptions?.indexes,
119
+ fields: Object.fromEntries(fieldEntries)
120
+ };
121
+ }
122
+ exports.getEntityDefinition = getEntityDefinition;
123
+ function getFieldTypeFromSchema(schema, path) {
124
+ if ((0, types_1.isObjectSchema)(schema)) {
125
+ return { nested: getEntityDefinition({ objectSchema: schema }) };
126
+ }
127
+ if ((0, type_guards_1.isFunction)(schema)) {
128
+ return getFieldTypeFromType(schema, path);
129
+ }
130
+ if ((0, type_guards_1.isString)(schema)) {
131
+ throw new error_1.NotSupportedError(`Schema type "${schema}" is not supported as field type.`);
132
+ }
133
+ if ((0, types_1.isDeferredValueType)(schema)) {
134
+ return getFieldTypeFromSchema((0, types_1.resolveValueType)(schema), path);
135
+ }
136
+ if ((0, types_1.isTypeSchema)(schema)) {
137
+ return getFieldTypeFromSchema((0, types_1.resolveValueType)(schema.type), path);
138
+ }
139
+ return getFieldTypeFromValueSchema(schema, path);
140
+ }
141
+ function getFieldTypeFromValueSchema(schema, path) {
142
+ if ((0, type_guards_1.isDefined)(schema.valueConstraints)) {
143
+ const constraints = (0, array_1.toArray)(schema.valueConstraints ?? []);
144
+ const enumerationConstraint = constraints.find((constraint) => constraint instanceof enumeration_1.EnumerationConstraint);
145
+ const integerConstraint = constraints.find((constraint) => constraint instanceof integer_1.IntegerConstraint);
146
+ if ((0, type_guards_1.isDefined)(enumerationConstraint)) {
147
+ return { enumeration: enumerationConstraint.enumeration };
148
+ }
149
+ if ((0, type_guards_1.isDefined)(integerConstraint)) {
150
+ return 'integer';
151
+ }
152
+ }
153
+ const innerSchemas = (0, array_1.toArray)(schema.schema);
154
+ (0, type_guards_1.assert)(innerSchemas.length == 1, `Could not get field type from schema type as exactly 1 schema is required, but ${innerSchemas.length} were given.`);
155
+ const innerSchema = innerSchemas[0];
156
+ return getFieldTypeFromSchema(innerSchema, path);
157
+ }
158
+ function getFieldTypeFromType(type, path) {
159
+ switch (type) {
160
+ case String:
161
+ return 'string';
162
+ case Number:
163
+ return 'float';
164
+ case Boolean:
165
+ return 'boolean';
166
+ case Date:
167
+ return 'date-time';
168
+ default:
169
+ return { nested: getEntityDefinition(type, path) };
170
+ }
171
+ }
2
172
  //# sourceMappingURL=decorators.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../source/orm/decorators.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../source/orm/decorators.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAEzD,oCAA4C;AAC5C,4CAAuC;AAEvC,8CAAkH;AAClH,mEAAyE;AACzE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C,OAAO,EAAE,WAAW,EAAE,qBAAqB,CAAC,WAAW,EAAE,CAAC;SAC3D;QAED,IAAI,IAAA,uBAAS,EAAC,iBAAiB,CAAC,EAAE;YAChC,OAAO,SAAS,CAAC;SAClB;KACF;IAED,MAAM,YAAY,GAAG,IAAA,eAAO,EAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5C,IAAA,oBAAM,EAAC,YAAY,CAAC,MAAM,IAAI,CAAC,EAAE,kFAAkF,YAAY,CAAC,MAAM,cAAc,CAAC,CAAC;IACtJ,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAE,CAAC;IAErC,OAAO,sBAAsB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;AACnD,CAAC;AAED,SAAS,oBAAoB,CAAC,IAAyB,EAAE,IAAc;IACrE,QAAQ,IAAI,EAAE;QACZ,KAAK,MAAM;YACT,OAAO,QAAQ,CAAC;QAElB,KAAK,MAAM;YACT,OAAO,OAAO,CAAC;QAEjB,KAAK,OAAO;YACV,OAAO,SAAS,CAAC;QAEnB,KAAK,IAAI;YACP,OAAO,WAAW,CAAC;QAErB;YACE,OAAO,EAAE,MAAM,EAAE,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;KACtD;AACH,CAAC"}
@@ -0,0 +1,51 @@
1
+ import type { AbstractConstructor, Enumeration, Paths, Record } from "../types";
2
+ export type FieldType = SpecialFieldType | 'string' | 'integer' | 'float' | 'boolean' | 'date-time' | 'date' | 'time' | 'json' | {
3
+ nested: EntityDefinition;
4
+ } | {
5
+ enumeration: Enumeration;
6
+ };
7
+ export type SpecialFieldType = 'created' | 'updated' | 'deleted' | 'revision';
8
+ export type IndexOptions = {
9
+ unique?: boolean;
10
+ };
11
+ export type IndexDirection = 1 | -1 | 'asc' | 'desc';
12
+ export type EntityIndexDefinition<T = any> = IndexOptions & {
13
+ fields: (Paths<T> | [Paths<T>, IndexDirection])[] | {
14
+ [P in Paths<T>]?: IndexDirection;
15
+ };
16
+ };
17
+ export type FieldIndexDefinition = IndexOptions;
18
+ export type FieldDefinition = {
19
+ /** type of field in database */
20
+ type: FieldType;
21
+ /** type of property in object (used for conversion) */
22
+ propertyType?: AbstractConstructor | 'numeric-date';
23
+ /** field name in database */
24
+ name?: string;
25
+ primary?: boolean;
26
+ generated?: boolean;
27
+ nullable?: boolean;
28
+ indexes?: FieldIndexDefinition[];
29
+ };
30
+ export type EntityDefinition = {
31
+ name: string;
32
+ fields: Record<string, FieldDefinition>;
33
+ indexes?: EntityIndexDefinition[];
34
+ };
35
+ export type NormalizedEntityDefinition = {
36
+ name: string;
37
+ fields: Record<string, NormalizedFieldDefinition>;
38
+ fieldsEntries: (readonly [string, NormalizedFieldDefinition])[];
39
+ indexes: EntityIndexDefinition[];
40
+ };
41
+ export type NormalizedFieldDefinition = {
42
+ type: FieldType;
43
+ propertyType?: AbstractConstructor | 'numeric-date' | 'numeric-time';
44
+ name: string;
45
+ primary: boolean;
46
+ generated: boolean;
47
+ nullable: boolean;
48
+ indexes: FieldIndexDefinition[];
49
+ };
50
+ export declare function normalizeEntityDefinition(definition: EntityDefinition): NormalizedEntityDefinition;
51
+ export declare function normalizeFieldDefinition(field: string, definition: FieldDefinition): NormalizedFieldDefinition;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizeFieldDefinition = exports.normalizeEntityDefinition = void 0;
4
+ const object_1 = require("../utils/object");
5
+ function normalizeEntityDefinition(definition) {
6
+ const fieldsEntries = (0, object_1.objectEntries)(definition.fields).map(([field, fieldDefinition]) => [field, normalizeFieldDefinition(field, fieldDefinition)]);
7
+ return {
8
+ name: definition.name,
9
+ fields: Object.fromEntries(fieldsEntries),
10
+ fieldsEntries,
11
+ indexes: definition.indexes ?? []
12
+ };
13
+ }
14
+ exports.normalizeEntityDefinition = normalizeEntityDefinition;
15
+ function normalizeFieldDefinition(field, definition) {
16
+ return {
17
+ type: definition.type,
18
+ propertyType: definition.propertyType,
19
+ name: definition.name ?? field,
20
+ primary: definition.primary ?? false,
21
+ generated: definition.generated ?? false,
22
+ nullable: definition.nullable ?? false,
23
+ indexes: definition.indexes ?? []
24
+ };
25
+ }
26
+ exports.normalizeFieldDefinition = normalizeFieldDefinition;
27
+ //# sourceMappingURL=entity-definition.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-definition.model.js","sourceRoot":"","sources":["../../source/orm/entity-definition.model.ts"],"names":[],"mappings":";;;AACA,4CAA+C;AAyD/C,SAAgB,yBAAyB,CAAC,UAA4B;IACpE,MAAM,aAAa,GAAG,IAAA,sBAAa,EAAC,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,eAAe,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,wBAAwB,CAAC,KAAK,EAAE,eAAe,CAAC,CAAU,CAAC,CAAC;IAE7J,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC;QACzC,aAAa;QACb,OAAO,EAAE,UAAU,CAAC,OAAO,IAAI,EAAE;KAClC,CAAC;AACJ,CAAC;AATD,8DASC;AAED,SAAgB,wBAAwB,CAAC,KAAa,EAAE,UAA2B;IACjF,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,YAAY,EAAE,UAAU,CAAC,YAAY;QACrC,IAAI,EAAE,UAAU,CAAC,IAAI,IAAI,KAAK;QAC9B,OAAO,EAAE,UAAU,CAAC,OAAO,IAAI,KAAK;QACpC,SAAS,EAAE,UAAU,CAAC,SAAS,IAAI,KAAK;QACxC,QAAQ,EAAE,UAAU,CAAC,QAAQ,IAAI,KAAK;QACtC,OAAO,EAAE,UAAU,CAAC,OAAO,IAAI,EAAE;KAClC,CAAC;AACJ,CAAC;AAVD,4DAUC"}
package/orm/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './models';
package/orm/index.js ADDED
@@ -0,0 +1,18 @@
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("./models"), exports);
18
+ //# sourceMappingURL=index.js.map