@quadnix/octo 0.0.21 → 0.0.23

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 (352) hide show
  1. package/dist/app.type.d.ts +124 -27
  2. package/dist/app.type.js +77 -7
  3. package/dist/app.type.js.map +1 -1
  4. package/dist/decorators/action.decorator.d.ts +7 -8
  5. package/dist/decorators/action.decorator.js +45 -44
  6. package/dist/decorators/action.decorator.js.map +1 -1
  7. package/dist/decorators/anchor.decorator.d.ts +2 -2
  8. package/dist/decorators/anchor.decorator.js +16 -11
  9. package/dist/decorators/anchor.decorator.js.map +1 -1
  10. package/dist/decorators/enable-hook.decorator.js +2 -2
  11. package/dist/decorators/enable-hook.decorator.js.map +1 -1
  12. package/dist/decorators/event-source.decorator.d.ts +1 -1
  13. package/dist/decorators/event-source.decorator.js +7 -2
  14. package/dist/decorators/event-source.decorator.js.map +1 -1
  15. package/dist/decorators/factory.decorator.d.ts +32 -1
  16. package/dist/decorators/factory.decorator.js +35 -3
  17. package/dist/decorators/factory.decorator.js.map +1 -1
  18. package/dist/decorators/model.decorator.d.ts +3 -2
  19. package/dist/decorators/model.decorator.js +24 -11
  20. package/dist/decorators/model.decorator.js.map +1 -1
  21. package/dist/decorators/module.decorator.d.ts +4 -71
  22. package/dist/decorators/module.decorator.js +18 -58
  23. package/dist/decorators/module.decorator.js.map +1 -1
  24. package/dist/decorators/on-event.decorator.d.ts +1 -1
  25. package/dist/decorators/on-event.decorator.js +7 -2
  26. package/dist/decorators/on-event.decorator.js.map +1 -1
  27. package/dist/decorators/overlay.decorator.d.ts +3 -2
  28. package/dist/decorators/overlay.decorator.js +23 -11
  29. package/dist/decorators/overlay.decorator.js.map +1 -1
  30. package/dist/decorators/resource.decorator.d.ts +3 -2
  31. package/dist/decorators/resource.decorator.js +23 -11
  32. package/dist/decorators/resource.decorator.js.map +1 -1
  33. package/dist/decorators/validate.decorator.d.ts +4 -4
  34. package/dist/decorators/validate.decorator.js +16 -2
  35. package/dist/decorators/validate.decorator.js.map +1 -1
  36. package/dist/errors/container.error.d.ts +11 -0
  37. package/dist/errors/container.error.js +20 -0
  38. package/dist/errors/container.error.js.map +1 -0
  39. package/dist/errors/index.d.ts +6 -0
  40. package/dist/errors/index.js +7 -0
  41. package/dist/errors/index.js.map +1 -0
  42. package/dist/errors/input.error.d.ts +11 -0
  43. package/dist/errors/input.error.js +21 -0
  44. package/dist/errors/input.error.js.map +1 -0
  45. package/dist/errors/module.error.d.ts +4 -0
  46. package/dist/errors/module.error.js +8 -0
  47. package/dist/errors/module.error.js.map +1 -0
  48. package/dist/errors/node.error.d.ts +36 -0
  49. package/dist/errors/node.error.js +60 -0
  50. package/dist/errors/node.error.js.map +1 -0
  51. package/dist/errors/schema.error.d.ts +4 -0
  52. package/dist/errors/schema.error.js +8 -0
  53. package/dist/errors/schema.error.js.map +1 -0
  54. package/dist/errors/transaction.error.d.ts +35 -0
  55. package/dist/errors/transaction.error.js +58 -0
  56. package/dist/errors/transaction.error.js.map +1 -0
  57. package/dist/events/action.event.d.ts +13 -0
  58. package/dist/events/action.event.js +11 -0
  59. package/dist/events/action.event.js.map +1 -0
  60. package/dist/events/event.model.d.ts +6 -12
  61. package/dist/events/event.model.js +5 -11
  62. package/dist/events/event.model.js.map +1 -1
  63. package/dist/events/hook/commit.hook.event.d.ts +25 -0
  64. package/dist/events/hook/commit.hook.event.js +26 -0
  65. package/dist/events/hook/commit.hook.event.js.map +1 -0
  66. package/dist/events/hook/hook.event.d.ts +9 -0
  67. package/dist/events/hook/hook.event.js +10 -0
  68. package/dist/events/hook/hook.event.js.map +1 -0
  69. package/dist/events/hook/index.d.ts +4 -0
  70. package/dist/events/hook/index.js +5 -0
  71. package/dist/events/hook/index.js.map +1 -0
  72. package/dist/events/hook/model.hook.event.d.ts +25 -0
  73. package/dist/events/hook/model.hook.event.js +26 -0
  74. package/dist/events/hook/model.hook.event.js.map +1 -0
  75. package/dist/events/hook/resource.hook.event.d.ts +25 -0
  76. package/dist/events/hook/resource.hook.event.js +26 -0
  77. package/dist/events/hook/resource.hook.event.js.map +1 -0
  78. package/dist/events/index.d.ts +7 -0
  79. package/dist/events/index.js +8 -0
  80. package/dist/events/index.js.map +1 -0
  81. package/dist/events/module.event.d.ts +1 -6
  82. package/dist/events/module.event.js +0 -5
  83. package/dist/events/module.event.js.map +1 -1
  84. package/dist/events/registration.event.d.ts +9 -51
  85. package/dist/events/registration.event.js +16 -64
  86. package/dist/events/registration.event.js.map +1 -1
  87. package/dist/events/serialization.event.d.ts +24 -37
  88. package/dist/events/serialization.event.js +49 -33
  89. package/dist/events/serialization.event.js.map +1 -1
  90. package/dist/events/transaction.event.d.ts +45 -26
  91. package/dist/events/transaction.event.js +43 -25
  92. package/dist/events/transaction.event.js.map +1 -1
  93. package/dist/{decorators → functions/container}/container.d.ts +45 -31
  94. package/dist/{decorators → functions/container}/container.js +90 -58
  95. package/dist/functions/container/container.js.map +1 -0
  96. package/dist/{decorators → functions/container}/test-container.d.ts +5 -13
  97. package/dist/{decorators → functions/container}/test-container.js +31 -43
  98. package/dist/functions/container/test-container.js.map +1 -0
  99. package/dist/functions/dependency/dependency.d.ts +6 -6
  100. package/dist/functions/dependency/dependency.js +4 -3
  101. package/dist/functions/dependency/dependency.js.map +1 -1
  102. package/dist/functions/diff/diff-metadata.d.ts +4 -6
  103. package/dist/functions/diff/diff-metadata.js +4 -3
  104. package/dist/functions/diff/diff-metadata.js.map +1 -1
  105. package/dist/functions/diff/diff.d.ts +12 -7
  106. package/dist/functions/diff/diff.js +9 -12
  107. package/dist/functions/diff/diff.js.map +1 -1
  108. package/dist/functions/diff/diff.utility.d.ts +24 -24
  109. package/dist/functions/diff/diff.utility.js +46 -25
  110. package/dist/functions/diff/diff.utility.js.map +1 -1
  111. package/dist/functions/hook/commit.hook.d.ts +14 -3
  112. package/dist/functions/hook/commit.hook.js +16 -16
  113. package/dist/functions/hook/commit.hook.js.map +1 -1
  114. package/dist/functions/hook/hook.interface.d.ts +7 -6
  115. package/dist/functions/hook/model-action.hook.d.ts +17 -5
  116. package/dist/functions/hook/model-action.hook.js +20 -39
  117. package/dist/functions/hook/model-action.hook.js.map +1 -1
  118. package/dist/functions/hook/resource-action.hook.d.ts +17 -5
  119. package/dist/functions/hook/resource-action.hook.js +18 -18
  120. package/dist/functions/hook/resource-action.hook.js.map +1 -1
  121. package/dist/functions/node/node-action.abstract.d.ts +7 -0
  122. package/dist/functions/node/node-action.abstract.js +20 -0
  123. package/dist/functions/node/node-action.abstract.js.map +1 -0
  124. package/dist/functions/node/node.abstract.d.ts +93 -0
  125. package/dist/functions/node/node.abstract.js +342 -0
  126. package/dist/functions/node/node.abstract.js.map +1 -0
  127. package/dist/functions/node/node.interface.d.ts +176 -0
  128. package/dist/functions/node/node.interface.js +2 -0
  129. package/dist/functions/node/node.interface.js.map +1 -0
  130. package/dist/functions/schema/schema.d.ts +4 -0
  131. package/dist/functions/schema/schema.js +38 -0
  132. package/dist/functions/schema/schema.js.map +1 -0
  133. package/dist/index.d.ts +31 -33
  134. package/dist/index.js +32 -16
  135. package/dist/index.js.map +1 -1
  136. package/dist/main.d.ts +34 -22
  137. package/dist/main.js +92 -53
  138. package/dist/main.js.map +1 -1
  139. package/dist/models/account/account.model.d.ts +23 -0
  140. package/dist/models/account/account.model.js +67 -0
  141. package/dist/models/account/account.model.js.map +1 -0
  142. package/dist/models/account/account.schema.d.ts +7 -0
  143. package/dist/models/account/account.schema.js +12 -0
  144. package/dist/models/account/account.schema.js.map +1 -0
  145. package/dist/models/app/app.model.d.ts +6 -15
  146. package/dist/models/app/app.model.js +26 -31
  147. package/dist/models/app/app.model.js.map +1 -1
  148. package/dist/models/app/app.schema.d.ts +3 -0
  149. package/dist/models/app/app.schema.js +21 -0
  150. package/dist/models/app/app.schema.js.map +1 -0
  151. package/dist/models/deployment/deployment.model.d.ts +6 -13
  152. package/dist/models/deployment/deployment.model.js +11 -16
  153. package/dist/models/deployment/deployment.model.js.map +1 -1
  154. package/dist/models/deployment/deployment.schema.d.ts +7 -0
  155. package/dist/models/deployment/deployment.schema.js +25 -0
  156. package/dist/models/deployment/deployment.schema.js.map +1 -0
  157. package/dist/models/environment/environment.model.d.ts +5 -15
  158. package/dist/models/environment/environment.model.js +10 -28
  159. package/dist/models/environment/environment.model.js.map +1 -1
  160. package/dist/models/environment/environment.schema.d.ts +13 -0
  161. package/dist/models/environment/environment.schema.js +38 -0
  162. package/dist/models/environment/environment.schema.js.map +1 -0
  163. package/dist/models/execution/execution.model.d.ts +6 -14
  164. package/dist/models/execution/execution.model.js +15 -28
  165. package/dist/models/execution/execution.model.js.map +1 -1
  166. package/dist/models/execution/execution.schema.d.ts +14 -0
  167. package/dist/models/execution/execution.schema.js +34 -0
  168. package/dist/models/execution/execution.schema.js.map +1 -0
  169. package/dist/models/filesystem/filesystem.model.d.ts +10 -0
  170. package/dist/models/filesystem/filesystem.model.js +43 -0
  171. package/dist/models/filesystem/filesystem.model.js.map +1 -0
  172. package/dist/models/filesystem/filesystem.schema.d.ts +3 -0
  173. package/dist/models/filesystem/filesystem.schema.js +21 -0
  174. package/dist/models/filesystem/filesystem.schema.js.map +1 -0
  175. package/dist/models/image/image.model.d.ts +7 -41
  176. package/dist/models/image/image.model.js +17 -32
  177. package/dist/models/image/image.model.js.map +1 -1
  178. package/dist/models/image/image.schema.d.ts +9 -0
  179. package/dist/models/image/image.schema.js +31 -0
  180. package/dist/models/image/image.schema.js.map +1 -0
  181. package/dist/models/model-action.interface.d.ts +5 -19
  182. package/dist/models/model.abstract.d.ts +28 -316
  183. package/dist/models/model.abstract.js +180 -557
  184. package/dist/models/model.abstract.js.map +1 -1
  185. package/dist/models/model.interface.d.ts +42 -21
  186. package/dist/models/pipeline/pipeline.model.d.ts +5 -8
  187. package/dist/models/pipeline/pipeline.model.js +10 -16
  188. package/dist/models/pipeline/pipeline.model.js.map +1 -1
  189. package/dist/models/pipeline/pipeline.schema.d.ts +4 -0
  190. package/dist/models/pipeline/pipeline.schema.js +22 -0
  191. package/dist/models/pipeline/pipeline.schema.js.map +1 -0
  192. package/dist/models/region/region.model.d.ts +8 -9
  193. package/dist/models/region/region.model.js +25 -17
  194. package/dist/models/region/region.model.js.map +1 -1
  195. package/dist/models/region/region.schema.d.ts +3 -0
  196. package/dist/models/region/region.schema.js +21 -0
  197. package/dist/models/region/region.schema.js.map +1 -0
  198. package/dist/models/server/server.model.d.ts +5 -11
  199. package/dist/models/server/server.model.js +13 -16
  200. package/dist/models/server/server.model.js.map +1 -1
  201. package/dist/models/server/server.schema.d.ts +6 -0
  202. package/dist/models/server/server.schema.js +24 -0
  203. package/dist/models/server/server.schema.js.map +1 -0
  204. package/dist/models/service/service.model.d.ts +4 -10
  205. package/dist/models/service/service.model.js +12 -16
  206. package/dist/models/service/service.model.js.map +1 -1
  207. package/dist/models/service/service.schema.d.ts +6 -0
  208. package/dist/models/service/service.schema.js +24 -0
  209. package/dist/models/service/service.schema.js.map +1 -0
  210. package/dist/models/subnet/subnet.model.d.ts +10 -35
  211. package/dist/models/subnet/subnet.model.js +16 -47
  212. package/dist/models/subnet/subnet.model.js.map +1 -1
  213. package/dist/models/subnet/subnet.schema.d.ts +33 -0
  214. package/dist/models/subnet/subnet.schema.js +48 -0
  215. package/dist/models/subnet/subnet.schema.js.map +1 -0
  216. package/dist/modules/module.abstract.d.ts +21 -0
  217. package/dist/modules/module.abstract.js +14 -0
  218. package/dist/modules/module.abstract.js.map +1 -0
  219. package/dist/modules/module.container.d.ts +32 -18
  220. package/dist/modules/module.container.js +134 -81
  221. package/dist/modules/module.container.js.map +1 -1
  222. package/dist/modules/module.interface.d.ts +15 -2
  223. package/dist/modules/test-module.container.d.ts +33 -15
  224. package/dist/modules/test-module.container.js +264 -35
  225. package/dist/modules/test-module.container.js.map +1 -1
  226. package/dist/overlays/anchor.abstract.d.ts +13 -8
  227. package/dist/overlays/anchor.abstract.js.map +1 -1
  228. package/dist/overlays/anchor.interface.d.ts +5 -8
  229. package/dist/overlays/anchor.schema.d.ts +8 -0
  230. package/dist/overlays/anchor.schema.js +9 -0
  231. package/dist/overlays/anchor.schema.js.map +1 -0
  232. package/dist/overlays/overlay-data.repository.d.ts +3 -6
  233. package/dist/overlays/overlay-data.repository.js +17 -38
  234. package/dist/overlays/overlay-data.repository.js.map +1 -1
  235. package/dist/overlays/overlay.abstract.d.ts +15 -17
  236. package/dist/overlays/overlay.abstract.js +30 -44
  237. package/dist/overlays/overlay.abstract.js.map +1 -1
  238. package/dist/overlays/overlay.interface.d.ts +3 -7
  239. package/dist/overlays/overlay.schema.d.ts +8 -0
  240. package/dist/overlays/overlay.schema.js +9 -0
  241. package/dist/overlays/overlay.schema.js.map +1 -0
  242. package/dist/resources/resource-action.interface.d.ts +4 -3
  243. package/dist/resources/resource-data.repository.d.ts +16 -7
  244. package/dist/resources/resource-data.repository.js +118 -42
  245. package/dist/resources/resource-data.repository.js.map +1 -1
  246. package/dist/resources/resource.abstract.d.ts +56 -16
  247. package/dist/resources/resource.abstract.js +326 -19
  248. package/dist/resources/resource.abstract.js.map +1 -1
  249. package/dist/resources/resource.interface.d.ts +39 -8
  250. package/dist/resources/resource.schema.d.ts +14 -0
  251. package/dist/resources/resource.schema.js +11 -0
  252. package/dist/resources/resource.schema.js.map +1 -0
  253. package/dist/services/capture/capture.service.d.ts +6 -7
  254. package/dist/services/capture/capture.service.js +8 -5
  255. package/dist/services/capture/capture.service.js.map +1 -1
  256. package/dist/services/event/event.service.d.ts +3 -4
  257. package/dist/services/event/event.service.js +7 -9
  258. package/dist/services/event/event.service.js.map +1 -1
  259. package/dist/services/input/input.service.d.ts +62 -6
  260. package/dist/services/input/input.service.js +290 -14
  261. package/dist/services/input/input.service.js.map +1 -1
  262. package/dist/services/schema-translation/schema-translation.service.d.ts +13 -0
  263. package/dist/services/schema-translation/schema-translation.service.js +42 -0
  264. package/dist/services/schema-translation/schema-translation.service.js.map +1 -0
  265. package/dist/services/serialization/model/model-serialization.service.d.ts +1 -4
  266. package/dist/services/serialization/model/model-serialization.service.js +37 -33
  267. package/dist/services/serialization/model/model-serialization.service.js.map +1 -1
  268. package/dist/services/serialization/resource/resource-serialization.service.d.ts +5 -5
  269. package/dist/services/serialization/resource/resource-serialization.service.js +71 -96
  270. package/dist/services/serialization/resource/resource-serialization.service.js.map +1 -1
  271. package/dist/services/state-management/local.state-provider.d.ts +0 -1
  272. package/dist/services/state-management/local.state-provider.js +5 -7
  273. package/dist/services/state-management/local.state-provider.js.map +1 -1
  274. package/dist/services/state-management/state-management.service.d.ts +2 -3
  275. package/dist/services/state-management/state-management.service.js +19 -9
  276. package/dist/services/state-management/state-management.service.js.map +1 -1
  277. package/dist/services/state-management/state-provider.interface.d.ts +0 -1
  278. package/dist/services/state-management/test.state-provider.d.ts +0 -1
  279. package/dist/services/state-management/test.state-provider.js +2 -1
  280. package/dist/services/state-management/test.state-provider.js.map +1 -1
  281. package/dist/services/transaction/transaction.service.d.ts +18 -14
  282. package/dist/services/transaction/transaction.service.js +261 -132
  283. package/dist/services/transaction/transaction.service.js.map +1 -1
  284. package/dist/services/validation/validation.service.d.ts +2 -3
  285. package/dist/services/validation/validation.service.js +27 -12
  286. package/dist/services/validation/validation.service.js.map +1 -1
  287. package/dist/utilities/node/node.utility.d.ts +4 -0
  288. package/dist/utilities/node/node.utility.js +22 -0
  289. package/dist/utilities/node/node.utility.js.map +1 -0
  290. package/dist/utilities/object/object.utility.d.ts +3 -0
  291. package/dist/utilities/object/object.utility.js +33 -0
  292. package/dist/utilities/object/object.utility.js.map +1 -1
  293. package/dist/utilities/test-helpers/test-classes.d.ts +57 -0
  294. package/dist/utilities/test-helpers/test-classes.js +76 -0
  295. package/dist/utilities/test-helpers/test-classes.js.map +1 -0
  296. package/dist/utilities/test-helpers/test-models.d.ts +41 -0
  297. package/dist/utilities/test-helpers/test-models.js +224 -0
  298. package/dist/utilities/test-helpers/test-models.js.map +1 -0
  299. package/dist/utilities/test-helpers/test-overlays.d.ts +10 -0
  300. package/dist/utilities/test-helpers/test-overlays.js +53 -0
  301. package/dist/utilities/test-helpers/test-overlays.js.map +1 -0
  302. package/dist/utilities/test-helpers/test-resources.d.ts +22 -0
  303. package/dist/utilities/test-helpers/test-resources.js +162 -0
  304. package/dist/utilities/test-helpers/test-resources.js.map +1 -0
  305. package/dist/utilities/validation/validation.utility.d.ts +31 -3
  306. package/dist/utilities/validation/validation.utility.js +121 -2
  307. package/dist/utilities/validation/validation.utility.js.map +1 -1
  308. package/package.json +6 -6
  309. package/dist/decorators/container.js.map +0 -1
  310. package/dist/decorators/test-container.js.map +0 -1
  311. package/dist/events/error.event.d.ts +0 -35
  312. package/dist/events/error.event.js +0 -36
  313. package/dist/events/error.event.js.map +0 -1
  314. package/dist/events/hook.event.d.ts +0 -194
  315. package/dist/events/hook.event.js +0 -195
  316. package/dist/events/hook.event.js.map +0 -1
  317. package/dist/models/app/app.interface.d.ts +0 -9
  318. package/dist/models/app/app.interface.js +0 -2
  319. package/dist/models/app/app.interface.js.map +0 -1
  320. package/dist/models/deployment/deployment.interface.d.ts +0 -9
  321. package/dist/models/deployment/deployment.interface.js +0 -2
  322. package/dist/models/deployment/deployment.interface.js.map +0 -1
  323. package/dist/models/environment/environment.interface.d.ts +0 -12
  324. package/dist/models/environment/environment.interface.js +0 -2
  325. package/dist/models/environment/environment.interface.js.map +0 -1
  326. package/dist/models/execution/execution.interface.d.ts +0 -14
  327. package/dist/models/execution/execution.interface.js +0 -2
  328. package/dist/models/execution/execution.interface.js.map +0 -1
  329. package/dist/models/image/image.interface.d.ts +0 -12
  330. package/dist/models/image/image.interface.js +0 -2
  331. package/dist/models/image/image.interface.js.map +0 -1
  332. package/dist/models/pipeline/pipeline.interface.d.ts +0 -10
  333. package/dist/models/pipeline/pipeline.interface.js +0 -2
  334. package/dist/models/pipeline/pipeline.interface.js.map +0 -1
  335. package/dist/models/region/region.interface.d.ts +0 -9
  336. package/dist/models/region/region.interface.js +0 -2
  337. package/dist/models/region/region.interface.js.map +0 -1
  338. package/dist/models/server/server.interface.d.ts +0 -9
  339. package/dist/models/server/server.interface.js +0 -2
  340. package/dist/models/server/server.interface.js.map +0 -1
  341. package/dist/models/service/service.interface.d.ts +0 -9
  342. package/dist/models/service/service.interface.js +0 -2
  343. package/dist/models/service/service.interface.js.map +0 -1
  344. package/dist/models/subnet/subnet.interface.d.ts +0 -13
  345. package/dist/models/subnet/subnet.interface.js +0 -2
  346. package/dist/models/subnet/subnet.interface.js.map +0 -1
  347. package/dist/overlays/overlay.service.d.ts +0 -18
  348. package/dist/overlays/overlay.service.js +0 -45
  349. package/dist/overlays/overlay.service.js.map +0 -1
  350. package/dist/resources/shared-resource.abstract.d.ts +0 -13
  351. package/dist/resources/shared-resource.abstract.js +0 -47
  352. package/dist/resources/shared-resource.abstract.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { Container } from './container.js';
1
+ import { Container } from '../functions/container/container.js';
2
2
  /**
3
3
  * A `@Factory` is a class decorator to be placed on top of a class that represents a factory.
4
4
  * A factory is responsible for creating instances of a class.
@@ -12,7 +12,7 @@ import { Container } from './container.js';
12
12
  * // Factory definition.
13
13
  * @Factory<MyService>(MyService, { metadata: { key: 'value' } })
14
14
  * export class MyServiceFactory {
15
- * static async create(arg1, arg2, ...): Promise<MyService> { ... }>
15
+ * static async create(arg1, arg2, ...): Promise<MyService> { ... }
16
16
  * }
17
17
  *
18
18
  * // Get instance using default factory.
@@ -27,11 +27,43 @@ import { Container } from './container.js';
27
27
  * @group Decorators
28
28
  * @param type The type of class that the factory creates.
29
29
  * @param options Allows registering multiple factories for the same class that differ by metadata.
30
+ * @remarks
31
+ * If the factory is dependent on other factories, it should not block creation of its instance.
32
+ * ```ts
33
+ * // Correct, since creation of instance is not blocked.
34
+ * // In this case, when multiple code paths are trying to get Container.get(MyService) at the same time,
35
+ * // each of them will `await` for OtherService to get resolved,
36
+ * // and the first to resolve will be able to create the instance, that the rest will re-use.
37
+ * export class MyServiceFactory {
38
+ * private static instance: MyService;
39
+ * static async create(): Promise<MyService> {
40
+ * const otherInstance = await Container.get(OtherService);
41
+ * if (!this.instance) {
42
+ * this.instance = new MyService(otherInstance);
43
+ * }
44
+ * }
45
+ * }
46
+ * ```
47
+ * ```ts
48
+ * // Wrong, since creation of instance is blocked.
49
+ * // In this case, when multiple code paths are trying to get Container.get(MyService) at the same time,
50
+ * // each of them will get a new instance since during `await` there is race condition.
51
+ * export class MyServiceFactory {
52
+ * private static instance: MyService;
53
+ * static async create(): Promise<MyService> {
54
+ * if (!this.instance) {
55
+ * const otherInstance = await Container.get(OtherService);
56
+ * this.instance = new MyService(otherInstance);
57
+ * }
58
+ * }
59
+ * }
60
+ * ```
30
61
  * @returns The decorated class.
31
62
  */
32
63
  export function Factory(type, options) {
64
+ const container = Container.getInstance();
33
65
  return function (constructor) {
34
- Container.registerFactory(type, constructor, options);
66
+ container.registerFactory(type, constructor, options);
35
67
  };
36
68
  }
37
69
  //# sourceMappingURL=factory.decorator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"factory.decorator.js","sourceRoot":"","sources":["../../src/decorators/factory.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,OAAO,CACrB,IAA+B,EAC/B,OAEC;IAED,OAAO,UAAU,WAA2D;QAC1E,SAAS,CAAC,eAAe,CAAI,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"factory.decorator.js","sourceRoot":"","sources":["../../src/decorators/factory.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,MAAM,UAAU,OAAO,CACrB,IAA+B,EAC/B,OAEC;IAED,MAAM,SAAS,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;IAE1C,OAAO,UAAU,WAA2D;QAC1E,SAAS,CAAC,eAAe,CAAI,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC,CAAC;AACJ,CAAC"}
@@ -1,14 +1,15 @@
1
+ import { type Constructable, type ModelSchema, type UnknownModel } from '../app.type.js';
1
2
  /**
2
3
  * A `@Model` is a class decorator to be placed on top of a class that represents a model.
3
4
  * - A model must extend the {@link AModel} class.
4
5
  *
5
6
  * @example
6
7
  * ```ts
7
- * @Model()
8
+ * @Model('my-package', 'my-name')
8
9
  * export class MyModel extends AModel<IMyModel, MyModel> { ... }
9
10
  * ```
10
11
  * @group Decorators
11
12
  * @returns The decorated class.
12
13
  * @see Definition of [Models](/docs/fundamentals/models).
13
14
  */
14
- export declare function Model(): (constructor: any) => void;
15
+ export declare function Model<T extends UnknownModel>(packageName: string, modelName: string, schema: Constructable<ModelSchema<T>>): (constructor: any) => void;
@@ -1,29 +1,42 @@
1
- import { RegistrationErrorEvent } from '../events/error.event.js';
2
- import { EventService } from '../services/event/event.service.js';
1
+ import { NodeType } from '../app.type.js';
2
+ import { Container } from '../functions/container/container.js';
3
+ import { AModel } from '../models/model.abstract.js';
4
+ import { AOverlay } from '../overlays/overlay.abstract.js';
3
5
  import { ModelSerializationService } from '../services/serialization/model/model-serialization.service.js';
4
- import { Container } from './container.js';
6
+ import { ValidationUtility } from '../utilities/validation/validation.utility.js';
5
7
  /**
6
8
  * A `@Model` is a class decorator to be placed on top of a class that represents a model.
7
9
  * - A model must extend the {@link AModel} class.
8
10
  *
9
11
  * @example
10
12
  * ```ts
11
- * @Model()
13
+ * @Model('my-package', 'my-name')
12
14
  * export class MyModel extends AModel<IMyModel, MyModel> { ... }
13
15
  * ```
14
16
  * @group Decorators
15
17
  * @returns The decorated class.
16
18
  * @see Definition of [Models](/docs/fundamentals/models).
17
19
  */
18
- export function Model() {
20
+ export function Model(packageName, modelName, schema) {
21
+ const container = Container.getInstance();
19
22
  return function (constructor) {
20
- Container.get(ModelSerializationService)
21
- .then((modelSerializationService) => {
22
- modelSerializationService.registerClass(constructor.name, constructor);
23
- })
24
- .catch((error) => {
25
- EventService.getInstance().emit(new RegistrationErrorEvent(error));
23
+ if (!ValidationUtility.validateRegex(packageName, /^[@A-Za-z][\w-]+[A-Za-z]$/)) {
24
+ throw new Error(`Invalid package name: ${packageName}`);
25
+ }
26
+ if (!ValidationUtility.validateRegex(modelName, /^[A-Za-z][\w-]+[A-Za-z]$/)) {
27
+ throw new Error(`Invalid model name: ${modelName}`);
28
+ }
29
+ if (!(constructor.prototype instanceof AModel) || constructor.prototype instanceof AOverlay) {
30
+ throw new Error(`Class "${constructor.name}" must extend the AModel class!`);
31
+ }
32
+ constructor.NODE_NAME = modelName;
33
+ constructor.NODE_PACKAGE = packageName;
34
+ constructor.NODE_SCHEMA = schema;
35
+ constructor.NODE_TYPE = NodeType.MODEL;
36
+ const promise = container.get(ModelSerializationService).then((modelSerializationService) => {
37
+ modelSerializationService.registerClass(`${packageName}/${constructor.name}`, constructor);
26
38
  });
39
+ container.registerStartupUnhandledPromise(promise);
27
40
  };
28
41
  }
29
42
  //# sourceMappingURL=model.decorator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"model.decorator.js","sourceRoot":"","sources":["../../src/decorators/model.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAC3G,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,KAAK;IACnB,OAAO,UAAU,WAAgB;QAC/B,SAAS,CAAC,GAAG,CAAC,yBAAyB,CAAC;aACrC,IAAI,CAAC,CAAC,yBAAyB,EAAE,EAAE;YAClC,yBAAy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AAY,QAAQ,EAAE,CAAC;YAC5F,MAAM,IAAI,KAAK,CAAC,UAAU,WAAW,CAAC,IAAI,iCAAiC,CAAC,CAAC;QAC/E,CAAC;QAED,WAAW,CAAC,SAAS,GAAG,SAAS,CAAC;QAClC,WAAW,CAAC,YAAY,GAAG,WAAW,CAAC;QACvC,WAAW,CAAC,WAAW,GAAG,MAAM,CAAC;QACjC,WAAW,CAAC,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC;QAEvC,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC,CAAC,yBAAyB,EAAE,EAAE;YAC1F,yBAAyB,CAAC,aAAa,CAAC,GAAG,WAAW,IAAI,WAAW,CAAC,IAAI,EAAE,EAAE,WAAW,CAAC,CAAC;QAC7F,CAAC,CAAC,CAAC;QACH,SAAS,CAAC,+BAA+B,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC,CAAC;AACJ,CAAC"}
@@ -1,88 +1,21 @@
1
- import type { Constructable } from '../app.type.js';
2
- import type { Octo } from '../main.js';
3
- import type { IModelAction } from '../models/model-action.interface.js';
4
- import { type IModule } from '../modules/module.interface.js';
5
- import type { IResourceAction } from '../resources/resource-action.interface.js';
1
+ import type { Constructable, ModuleSchema } from '../app.type.js';
6
2
  /**
7
3
  * A `@Module` is a class decorator to be placed on top of a class that represents a module.
8
4
  * - A Module class must implement the {@link IModule} interface.
9
- * - A Module class constructor is injected with the outputs of the modules it imports.
10
5
  * - The {@link IModule.onInit} method is called to initialize the module,
11
6
  * and is where you will *define* your infrastructure.
12
7
  *
13
8
  * @example
14
9
  * ```ts
15
- * @Module({
16
- * args: [{ isArg: (app: App) => app instanceof App, name: 'app' }],
17
- * imports: [OtherModule],
18
- * postModelActionHooks: [{ ACTION_NAME: 'SomeAction', collectInput: () => { ... }, handle: () => { ... } }],
19
- * })
10
+ * @Module<MyInputInterface, OutputModel>('my-package', {})
20
11
  * export class MyModule implements IModule<Region> {
21
- * constructor(app: App) { ... }
12
+ * constructor(inputs: IMyInputs) { ... }
22
13
  *
23
14
  * async onInit(): Promise<Region> { ... }
24
15
  * }
25
16
  * ```
26
17
  * @group Decorators
27
- * @param options - Options to the module.
28
- * @param options.args - (optional) An array of arg validators to verify the args passed to the module's constructor.
29
- * - The `isArg` method receives an argument, and you must do your own type checking and return a boolean.
30
- * - The `name` property is the name of the argument.
31
- * @param options.imports - (optional) An array of modules to import.
32
- * @param options.postCommitHooks - (optional) An array of post-commit hooks.
33
- * - The `callback` method will be called after the transaction is committed.
34
- * This method receives the same arguments as {@link Octo.commitTransaction}.
35
- * @param options.postModelActionHooks - (optional) An array of post-model action hooks.
36
- * - The `ACTION_NAME` identifies the action on which this hook is registered.
37
- * - The `collectInput` method can be used to enrich the action inputs. It works the same as in {@link IModelAction}.
38
- * - The `handle` method will be called after the action is executed.
39
- * This method receives the same arguments as {@link IModelAction.handle}.
40
- * @param options.postResourceActionHooks - (optional) An array of post-resource action hooks.
41
- * - The `ACTION_NAME` identifies the action on which this hook is registered.
42
- * - The `handle` method will be called after the action is executed.
43
- * This method receives the same arguments as {@link IResourceAction.handle}.
44
- * @param options.preCommitHooks - (optional) An array of pre-commit hooks.
45
- * - The `callback` method will be called before the transaction is committed.
46
- * This method receives the same arguments as {@link Octo.commitTransaction}.
47
- * @param options.preModelActionHooks - (optional) An array of pre-model action hooks.
48
- * - The `ACTION_NAME` identifies the action on which this hook is registered.
49
- * - The `collectInput` method can be used to enrich the action inputs. It works the same as in {@link IModelAction}.
50
- * - The `handle` method will be called before the action is executed.
51
- * This method receives the same arguments as {@link IModelAction.handle}.
52
- * @param options.preResourceActionHooks - (optional) An array of pre-resource action hooks.
53
- * - The `ACTION_NAME` identifies the action on which this hook is registered.
54
- * - The `handle` method will be called before the action is executed.
55
18
  * @returns The decorated class.
56
19
  * @see Definition of [Modules](/docs/fundamentals/modules).
57
20
  */
58
- export declare function Module({ args, imports, postCommitHooks, postModelActionHooks, postResourceActionHooks, preCommitHooks, preModelActionHooks, preResourceActionHooks, }: {
59
- args?: {
60
- isArg: (arg: unknown) => boolean;
61
- name: string;
62
- }[];
63
- imports?: (Constructable<IModule<unknown>> | string)[];
64
- postCommitHooks?: {
65
- callback: Octo['commitTransaction'];
66
- }[];
67
- postModelActionHooks?: {
68
- ACTION_NAME: string;
69
- collectInput?: IModelAction['collectInput'];
70
- handle: IModelAction['handle'];
71
- }[];
72
- postResourceActionHooks?: {
73
- ACTION_NAME: string;
74
- handle: IResourceAction['handle'];
75
- }[];
76
- preCommitHooks?: {
77
- callback: Octo['commitTransaction'];
78
- }[];
79
- preModelActionHooks?: {
80
- ACTION_NAME: string;
81
- collectInput?: IModelAction['collectInput'];
82
- handle: IModelAction['handle'];
83
- }[];
84
- preResourceActionHooks?: {
85
- ACTION_NAME: string;
86
- handle: IResourceAction['handle'];
87
- }[];
88
- }): (constructor: any) => void;
21
+ export declare function Module<T>(packageName: string, schema: Constructable<ModuleSchema<T>>): (constructor: any) => void;
@@ -1,81 +1,41 @@
1
- import { RegistrationErrorEvent } from '../events/error.event.js';
1
+ import { Container } from '../functions/container/container.js';
2
+ import { AModule } from '../modules/module.abstract.js';
2
3
  import { ModuleContainer } from '../modules/module.container.js';
3
- import { EventService } from '../services/event/event.service.js';
4
- import { Container } from './container.js';
4
+ import { ValidationUtility } from '../utilities/validation/validation.utility.js';
5
5
  /**
6
6
  * A `@Module` is a class decorator to be placed on top of a class that represents a module.
7
7
  * - A Module class must implement the {@link IModule} interface.
8
- * - A Module class constructor is injected with the outputs of the modules it imports.
9
8
  * - The {@link IModule.onInit} method is called to initialize the module,
10
9
  * and is where you will *define* your infrastructure.
11
10
  *
12
11
  * @example
13
12
  * ```ts
14
- * @Module({
15
- * args: [{ isArg: (app: App) => app instanceof App, name: 'app' }],
16
- * imports: [OtherModule],
17
- * postModelActionHooks: [{ ACTION_NAME: 'SomeAction', collectInput: () => { ... }, handle: () => { ... } }],
18
- * })
13
+ * @Module<MyInputInterface, OutputModel>('my-package', {})
19
14
  * export class MyModule implements IModule<Region> {
20
- * constructor(app: App) { ... }
15
+ * constructor(inputs: IMyInputs) { ... }
21
16
  *
22
17
  * async onInit(): Promise<Region> { ... }
23
18
  * }
24
19
  * ```
25
20
  * @group Decorators
26
- * @param options - Options to the module.
27
- * @param options.args - (optional) An array of arg validators to verify the args passed to the module's constructor.
28
- * - The `isArg` method receives an argument, and you must do your own type checking and return a boolean.
29
- * - The `name` property is the name of the argument.
30
- * @param options.imports - (optional) An array of modules to import.
31
- * @param options.postCommitHooks - (optional) An array of post-commit hooks.
32
- * - The `callback` method will be called after the transaction is committed.
33
- * This method receives the same arguments as {@link Octo.commitTransaction}.
34
- * @param options.postModelActionHooks - (optional) An array of post-model action hooks.
35
- * - The `ACTION_NAME` identifies the action on which this hook is registered.
36
- * - The `collectInput` method can be used to enrich the action inputs. It works the same as in {@link IModelAction}.
37
- * - The `handle` method will be called after the action is executed.
38
- * This method receives the same arguments as {@link IModelAction.handle}.
39
- * @param options.postResourceActionHooks - (optional) An array of post-resource action hooks.
40
- * - The `ACTION_NAME` identifies the action on which this hook is registered.
41
- * - The `handle` method will be called after the action is executed.
42
- * This method receives the same arguments as {@link IResourceAction.handle}.
43
- * @param options.preCommitHooks - (optional) An array of pre-commit hooks.
44
- * - The `callback` method will be called before the transaction is committed.
45
- * This method receives the same arguments as {@link Octo.commitTransaction}.
46
- * @param options.preModelActionHooks - (optional) An array of pre-model action hooks.
47
- * - The `ACTION_NAME` identifies the action on which this hook is registered.
48
- * - The `collectInput` method can be used to enrich the action inputs. It works the same as in {@link IModelAction}.
49
- * - The `handle` method will be called before the action is executed.
50
- * This method receives the same arguments as {@link IModelAction.handle}.
51
- * @param options.preResourceActionHooks - (optional) An array of pre-resource action hooks.
52
- * - The `ACTION_NAME` identifies the action on which this hook is registered.
53
- * - The `handle` method will be called before the action is executed.
54
21
  * @returns The decorated class.
55
22
  * @see Definition of [Modules](/docs/fundamentals/modules).
56
23
  */
57
- export function Module({ args = [], imports = [], postCommitHooks = [], postModelActionHooks = [], postResourceActionHooks = [], preCommitHooks = [], preModelActionHooks = [], preResourceActionHooks = [], }) {
24
+ export function Module(packageName, schema) {
25
+ const container = Container.getInstance();
58
26
  return function (constructor) {
59
- Container.get(ModuleContainer)
60
- .then((moduleContainer) => {
61
- // Verify classes with @Module implements IModule.
62
- if (!('onInit' in constructor.prototype)) {
63
- throw new Error(`Class "${constructor.name}" does not implement IModule!`);
64
- }
65
- moduleContainer.register(constructor, {
66
- args,
67
- imports,
68
- postCommitHooks,
69
- postModelActionHooks,
70
- postResourceActionHooks,
71
- preCommitHooks,
72
- preModelActionHooks,
73
- preResourceActionHooks,
74
- });
75
- })
76
- .catch((error) => {
77
- EventService.getInstance().emit(new RegistrationErrorEvent(error));
27
+ if (!ValidationUtility.validateRegex(packageName, /^[@A-Za-z][\w-]+[A-Za-z]$/)) {
28
+ throw new Error(`Invalid package name: ${packageName}`);
29
+ }
30
+ if (!(constructor.prototype instanceof AModule)) {
31
+ throw new Error(`Class "${constructor.name}" must extend the AModule class!`);
32
+ }
33
+ constructor.MODULE_PACKAGE = packageName;
34
+ constructor.MODULE_SCHEMA = schema;
35
+ const promise = container.get(ModuleContainer).then((moduleContainer) => {
36
+ moduleContainer.register(constructor, { packageName });
78
37
  });
38
+ container.registerStartupUnhandledPromise(promise);
79
39
  };
80
40
  }
81
41
  //# sourceMappingURL=module.decorator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"module.decorator.js","sourceRoot":"","sources":["../../src/decorators/module.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGjE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAM,UAAU,MAAM,CAAC,EACrB,IAAI,GAAG,EAAE,EACT,OAAO,GAAG,EAAE,EACZ,eAAe,GAAG,EAAE,EACpB,oBAAoB,GAAG,EAAE,EACzB,uBAAuB,GAAG,EAAE,EAC5B,cAAc,GAAG,EAAE,EACnB,mBAAmB,GAAG,EAAE,EACxB,sBAAsB,GAAG,EAAE,GAwB5B;IACC,OAAO,UAAU,WAA4C;QAC3D,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC;aAC3B,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE;YACxB,kDAAkD;YAClD,IAAI,CAAC,CAAC,QAAQ,IAAI,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC;gBACzC,MAAM,IAAI,KAAK,CAAC,UAAU,WAAW,CAAC,IAAI,+BAA+B,CAAC,CAAC;YAC7E,CAAC;YAED,eAAe,CAAC,QAAQ,CAAC,WAAW,EAAE;gBACpC,IAAI;gBACJ,OAAO;gBACP,eAAe;gBACf,oBAAoB;gBACpB,uBAAuB;gBACvB,cAAc;gBACd,mBAAmB;gBACnB,sBAAsB;aACvB,CAAC,CAAC;QACL,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,YAAY,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,IAAI,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"module.decorator.js","sourceRoot":"","sources":["../../src/decorators/module.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,MAAM,CAAI,WAAmB,EAAE,MAAsC;IACnF,MAAM,SAAS,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;IAE1C,OAAO,UAAU,WAAgB;QAC/B,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,WAAW,EAAE,2BAA2B,CAAC,EAAE,CAAC;YAC/E,MAAM,IAAI,KAAK,CAAC,yBAAyB,WAAW,EAAE,CAAC,CAAC;QAC1D,CAAC;QACD,IAAI,CAAC,CAAC,WAAW,CAAC,SAAS,YAAY,OAAO,CAAC,EAAE,CAAC;YAChD,MAAM,IAAI,KAAK,CAAC,UAAU,WAAW,CAAC,IAAI,kCAAkC,CAAC,CAAC;QAChF,CAAC;QAED,WAAW,CAAC,cAAc,GAAG,WAAW,CAAC;QACzC,WAAW,CAAC,aAAa,GAAG,MAAM,CAAC;QAEnC,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE;YACtE,eAAe,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;QACH,SAAS,CAAC,+BAA+B,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC,CAAC;AACJ,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { Constructable } from '../app.type.js';
2
- import type { Event } from '../events/event.model.js';
2
+ import type { Event } from '../events/index.js';
3
3
  /**
4
4
  * An `@OnEvent` is a method decorator to listen to an event.
5
5
  *
@@ -1,3 +1,4 @@
1
+ import { Container } from '../functions/container/container.js';
1
2
  import { EventService } from '../services/event/event.service.js';
2
3
  /**
3
4
  * An `@OnEvent` is a method decorator to listen to an event.
@@ -17,8 +18,12 @@ import { EventService } from '../services/event/event.service.js';
17
18
  * @returns The decorated method.
18
19
  */
19
20
  export function OnEvent(ofType) {
20
- return function (target, propertyKey, descriptor) {
21
- EventService.getInstance().registerListeners(ofType, target, descriptor);
21
+ const container = Container.getInstance();
22
+ return function (target, _propertyKey, descriptor) {
23
+ const promise = container.get(EventService).then((eventService) => {
24
+ eventService.registerListeners(ofType, target, descriptor);
25
+ });
26
+ container.registerStartupUnhandledPromise(promise);
22
27
  };
23
28
  }
24
29
  //# sourceMappingURL=on-event.decorator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"on-event.decorator.js","sourceRoot":"","sources":["../../src/decorators/on-event.decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,OAAO,CACrB,MAAqC;IAErC,OAAO,UAAU,MAAW,EAAE,WAAmB,EAAE,UAA8B;QAC/E,YAAY,CAAC,WAAW,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAC3E,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"on-event.decorator.js","sourceRoot":"","sources":["../../src/decorators/on-event.decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,OAAO,CACrB,MAAqC;IAErC,MAAM,SAAS,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;IAE1C,OAAO,UAAU,MAAW,EAAE,YAAoB,EAAE,UAA8B;QAChF,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE;YAChE,YAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;QACH,SAAS,CAAC,+BAA+B,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC,CAAC;AACJ,CAAC"}
@@ -1,14 +1,15 @@
1
+ import { type Constructable, type OverlaySchema, type UnknownOverlay } from '../app.type.js';
1
2
  /**
2
3
  * An `@Overlay` is a class decorator to be placed on top of a class that represents an overlay.
3
4
  * - An overlay must extend the {@link AOverlay} class.
4
5
  *
5
6
  * @example
6
7
  * ```ts
7
- * @Overlay()
8
+ * @Overlay('my-package', 'my-name')
8
9
  * export class MyOverlay extends AOverlay<MyOverlay> { ... }
9
10
  * ```
10
11
  * @group Decorators
11
12
  * @returns The decorated class.
12
13
  * @see Definition of [Overlays](/docs/fundamentals/overlay-and-anchor).
13
14
  */
14
- export declare function Overlay(): (constructor: any) => void;
15
+ export declare function Overlay<T extends UnknownOverlay>(packageName: string, overlayName: string, schema: Constructable<OverlaySchema<T>>): (constructor: any) => void;
@@ -1,29 +1,41 @@
1
- import { RegistrationErrorEvent } from '../events/error.event.js';
2
- import { EventService } from '../services/event/event.service.js';
1
+ import { NodeType } from '../app.type.js';
2
+ import { Container } from '../functions/container/container.js';
3
+ import { AOverlay } from '../overlays/overlay.abstract.js';
3
4
  import { ModelSerializationService } from '../services/serialization/model/model-serialization.service.js';
4
- import { Container } from './container.js';
5
+ import { ValidationUtility } from '../utilities/validation/validation.utility.js';
5
6
  /**
6
7
  * An `@Overlay` is a class decorator to be placed on top of a class that represents an overlay.
7
8
  * - An overlay must extend the {@link AOverlay} class.
8
9
  *
9
10
  * @example
10
11
  * ```ts
11
- * @Overlay()
12
+ * @Overlay('my-package', 'my-name')
12
13
  * export class MyOverlay extends AOverlay<MyOverlay> { ... }
13
14
  * ```
14
15
  * @group Decorators
15
16
  * @returns The decorated class.
16
17
  * @see Definition of [Overlays](/docs/fundamentals/overlay-and-anchor).
17
18
  */
18
- export function Overlay() {
19
+ export function Overlay(packageName, overlayName, schema) {
20
+ const container = Container.getInstance();
19
21
  return function (constructor) {
20
- Container.get(ModelSerializationService)
21
- .then((modelSerializationService) => {
22
- modelSerializationService.registerClass(constructor.name, constructor);
23
- })
24
- .catch((error) => {
25
- EventService.getInstance().emit(new RegistrationErrorEvent(error));
22
+ if (!ValidationUtility.validateRegex(packageName, /^[@A-Za-z][\w-]+[A-Za-z]$/)) {
23
+ throw new Error(`Invalid package name: ${packageName}`);
24
+ }
25
+ if (!ValidationUtility.validateRegex(overlayName, /^[A-Za-z][\w-]+[A-Za-z]$/)) {
26
+ throw new Error(`Invalid overlay name: ${overlayName}`);
27
+ }
28
+ if (!(constructor.prototype instanceof AOverlay)) {
29
+ throw new Error(`Class "${constructor.name}" must extend the AOverlay class!`);
30
+ }
31
+ constructor.NODE_NAME = overlayName;
32
+ constructor.NODE_PACKAGE = packageName;
33
+ constructor.NODE_SCHEMA = schema;
34
+ constructor.NODE_TYPE = NodeType.OVERLAY;
35
+ const promise = container.get(ModelSerializationService).then((modelSerializationService) => {
36
+ modelSerializationService.registerClass(`${packageName}/${constructor.name}`, constructor);
26
37
  });
38
+ container.registerStartupUnhandledPromise(promise);
27
39
  };
28
40
  }
29
41
  //# sourceMappingURL=overlay.decorator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"overlay.decorator.js","sourceRoot":"","sources":["../../src/decorators/overlay.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAC3G,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,OAAO;IACrB,OAAO,UAAU,WAAgB;QAC/B,SAAS,CAAC,GAAG,CAAC,yBAAyB,CAAC;aACrC,IAAI,CAAC,CAAC,yBAAyB,EAAE,EAAE;YAClC,yBAAyB,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACzE,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,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ACvC,WAAW,CAAC,WAAW,GAAG,MAAM,CAAC;QACjC,WAAW,CAAC,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC;QAEzC,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC,CAAC,yBAAyB,EAAE,EAAE;YAC1F,yBAAyB,CAAC,aAAa,CAAC,GAAG,WAAW,IAAI,WAAW,CAAC,IAAI,EAAE,EAAE,WAAW,CAAC,CAAC;QAC7F,CAAC,CAAC,CAAC;QACH,SAAS,CAAC,+BAA+B,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC,CAAC;AACJ,CAAC"}
@@ -1,14 +1,15 @@
1
+ import { type Constructable, type ResourceSchema, type UnknownResource } from '../app.type.js';
1
2
  /**
2
3
  * A `@Resource` is a class decorator to be placed on top of a class that represents a resource.
3
4
  * - A resource must extend the {@link AResource} class.
4
5
  *
5
6
  * @example
6
7
  * ```ts
7
- * @Resource()
8
+ * @Resource('my-package', 'my-name')
8
9
  * export class MyResource extends AResource<MyResource> { ... }
9
10
  * ```
10
11
  * @group Decorators
11
12
  * @returns The decorated class.
12
13
  * @see Definition of [Resources](http://localhost:3000/docs/fundamentals/resources).
13
14
  */
14
- export declare function Resource(): (constructor: any) => void;
15
+ export declare function Resource<T extends UnknownResource>(packageName: string, resourceName: string, schema: Constructable<ResourceSchema<T>>): (constructor: any) => void;
@@ -1,29 +1,41 @@
1
- import { RegistrationErrorEvent } from '../events/error.event.js';
2
- import { EventService } from '../services/event/event.service.js';
1
+ import { NodeType } from '../app.type.js';
2
+ import { Container } from '../functions/container/container.js';
3
+ import { AResource } from '../resources/resource.abstract.js';
3
4
  import { ResourceSerializationService } from '../services/serialization/resource/resource-serialization.service.js';
4
- import { Container } from './container.js';
5
+ import { ValidationUtility } from '../utilities/validation/validation.utility.js';
5
6
  /**
6
7
  * A `@Resource` is a class decorator to be placed on top of a class that represents a resource.
7
8
  * - A resource must extend the {@link AResource} class.
8
9
  *
9
10
  * @example
10
11
  * ```ts
11
- * @Resource()
12
+ * @Resource('my-package', 'my-name')
12
13
  * export class MyResource extends AResource<MyResource> { ... }
13
14
  * ```
14
15
  * @group Decorators
15
16
  * @returns The decorated class.
16
17
  * @see Definition of [Resources](http://localhost:3000/docs/fundamentals/resources).
17
18
  */
18
- export function Resource() {
19
+ export function Resource(packageName, resourceName, schema) {
20
+ const container = Container.getInstance();
19
21
  return function (constructor) {
20
- Container.get(ResourceSerializationService)
21
- .then((resourceSerializationService) => {
22
- resourceSerializationService.registerClass(constructor.name, constructor);
23
- })
24
- .catch((error) => {
25
- EventService.getInstance().emit(new RegistrationErrorEvent(error));
22
+ if (!ValidationUtility.validateRegex(packageName, /^[@A-Za-z][\w-]+[A-Za-z]$/)) {
23
+ throw new Error(`Invalid package name: ${packageName}`);
24
+ }
25
+ if (!ValidationUtility.validateRegex(resourceName, /^[A-Za-z][\w-]+[A-Za-z]$/)) {
26
+ throw new Error(`Invalid resource name: ${resourceName}`);
27
+ }
28
+ if (!(constructor.prototype instanceof AResource)) {
29
+ throw new Error(`Class "${constructor.name}" must extend the AResource class!`);
30
+ }
31
+ constructor.NODE_NAME = resourceName;
32
+ constructor.NODE_PACKAGE = packageName;
33
+ constructor.NODE_SCHEMA = schema;
34
+ constructor.NODE_TYPE = NodeType.RESOURCE;
35
+ const promise = container.get(ResourceSerializationService).then((resourceSerializationService) => {
36
+ resourceSerializationService.registerClass(`${packageName}/${constructor.name}`, constructor);
26
37
  });
38
+ container.registerStartupUnhandledPromise(promise);
27
39
  };
28
40
  }
29
41
  //# sourceMappingURL=resource.decorator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resource.decorator.js","sourceRoot":"","sources":["../../src/decorators/resource.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,4BAA4B,EAAE,M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,YAAY,EAAE,0BAA0B,CAAC,EAAE,CAAC;YAC/E,MAAM,IAAI,KAAK,CAAC,0BAA0B,YAAY,EAAE,CAAC,CAAC;QAC5D,CAAC;QACD,IAAI,CAAC,CAAC,WAAW,CAAC,SAAS,YAAY,SAAS,CAAC,EAAE,CAAC;YAClD,MAAM,IAAI,KAAK,CAAC,UAAU,WAAW,CAAC,IAAI,oCAAoC,CAAC,CAAC;QAClF,CAAC;QAED,WAAW,CAAC,SAAS,GAAG,YAAY,CAAC;QACrC,WAAW,CAAC,YAAY,GAAG,WAAW,CAAC;QACvC,WAAW,CAAC,WAAW,GAAG,MAAM,CAAC;QACjC,WAAW,CAAC,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAAC;QAE1C,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,IAAI,CAAC,CAAC,4BAA4B,EAAE,EAAE;YAChG,4BAA4B,CAAC,aAAa,CAAC,GAAG,WAAW,IAAI,WAAW,CAAC,IAAI,EAAE,EAAE,WAAW,CAAC,CAAC;QAChG,CAAC,CAAC,CAAC;QACH,SAAS,CAAC,+BAA+B,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC,CAAC;AACJ,CAAC"}
@@ -1,9 +1,9 @@
1
- import type { ValidationType } from '../app.type.js';
1
+ import type { ValidationType, ValidationTypeOptions } from '../app.type.js';
2
2
  type ValidationOptions<T> = {
3
+ destruct?: (value: any) => T[];
3
4
  options: {
4
- [key in ValidationType]?: any;
5
+ [key in ValidationType]?: ValidationTypeOptions[key];
5
6
  };
6
- destruct?: (value: any) => T[];
7
7
  };
8
- export declare function Validate<T>(validators: ValidationOptions<T> | ValidationOptions<T>[]): (target: any, propertyKey: string) => void;
8
+ export declare function Validate<T>(validators: ValidationOptions<T> | ValidationOptions<T>[], transform?: (value: any) => any): (target: any, propertyKey: string) => void;
9
9
  export {};
@@ -1,20 +1,34 @@
1
+ import { ValidationTransactionError } from '../errors/index.js';
1
2
  import { ValidationService } from '../services/validation/validation.service.js';
2
- export function Validate(validators) {
3
+ export function Validate(validators, transform) {
3
4
  return function (target, propertyKey) {
4
5
  const symbol = Symbol();
5
6
  Object.defineProperty(target, propertyKey, {
7
+ enumerable: true,
6
8
  get: function () {
7
9
  return this[symbol];
8
10
  },
9
11
  set: function (newValue) {
12
+ if (newValue === undefined) {
13
+ this[symbol] = undefined;
14
+ return;
15
+ }
16
+ if (transform) {
17
+ newValue = transform(newValue);
18
+ }
10
19
  if (!Array.isArray(validators)) {
11
20
  validators = [validators];
12
21
  }
22
+ const validationService = new ValidationService();
13
23
  for (const validator of validators) {
14
24
  for (const [type, constraint] of Object.entries(validator.options)) {
15
- ValidationService.getInstance().addSubject(type, constraint, target, propertyKey, newValue, validator.destruct);
25
+ validationService.addSubject(type, constraint, target, propertyKey, newValue, validator.destruct);
16
26
  }
17
27
  }
28
+ const result = validationService.validate();
29
+ if (!result.pass) {
30
+ throw new ValidationTransactionError('Validation error!', result);
31
+ }
18
32
  this[symbol] = newValue;
19
33
  },
20
34
  });
@@ -1 +1 @@
1
- {"version":3,"file":"validate.decorator.js","sourceRoot":"","sources":["../../src/decorators/validate.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAOjF,MAAM,UAAU,QAAQ,CACtB,UAAyD;IAEzD,OAAO,UAAU,MAAW,EAAE,WAAmB;QAC/C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC;QAExB,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE;YACzC,GAAG,EAAE;gBACH,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;YACtB,CAAC;YACD,GAAG,EAAE,UAAU,QAAa;gBAC1B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;oBAC/B,UAAU,GAAG,CAAC,UAAU,CAAC,CAAC;gBAC5B,CAAC;gBAED,KAAK,MAAM,SAAS,IAAI,UA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gBAC5B,CAAC;gBAED,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,EAAE,CAAC;gBAClD,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;oBACnC,KAAK,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;wBACnE,iBAAiB,CAAC,UAAU,CAC1B,IAAsB,EACtB,UAAU,EACV,MAAM,EACN,WAAW,EACX,QAAQ,EACR,SAAS,CAAC,QAAQ,CACnB,CAAC;oBACJ,CAAC;gBACH,CAAC;gBAED,MAAM,MAAM,GAAG,iBAAiB,CAAC,QAAQ,EAAE,CAAC;gBAC5C,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;oBACjB,MAAM,IAAI,0BAA0B,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;gBACpE,CAAC;gBAED,IAAI,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC;YAC1B,CAAC;SACF,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { Constructable } from '../app.type.js';
2
+ export declare class ContainerError extends Error {
3
+ readonly type: string;
4
+ constructor(message: string, type: Constructable<unknown> | string);
5
+ }
6
+ export declare class ContainerRegistrationError extends ContainerError {
7
+ constructor(message: string, type: Constructable<unknown> | string);
8
+ }
9
+ export declare class ContainerResolutionError extends ContainerError {
10
+ constructor(message: string, type: Constructable<unknown> | string);
11
+ }