@quadnix/octo 0.0.29 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (362) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +25 -3
  3. package/dist/app.type.d.ts +143 -4
  4. package/dist/app.type.js +80 -9
  5. package/dist/app.type.js.map +1 -1
  6. package/dist/decorators/action.decorator.d.ts +10 -6
  7. package/dist/decorators/action.decorator.js +19 -6
  8. package/dist/decorators/action.decorator.js.map +1 -1
  9. package/dist/decorators/anchor.decorator.d.ts +12 -5
  10. package/dist/decorators/anchor.decorator.js +12 -5
  11. package/dist/decorators/anchor.decorator.js.map +1 -1
  12. package/dist/decorators/enable-hook.decorator.d.ts +1 -1
  13. package/dist/decorators/enable-hook.decorator.js +1 -1
  14. package/dist/decorators/factory.decorator.d.ts +18 -34
  15. package/dist/decorators/factory.decorator.js +18 -34
  16. package/dist/decorators/factory.decorator.js.map +1 -1
  17. package/dist/decorators/model.decorator.d.ts +1 -1
  18. package/dist/decorators/model.decorator.js +1 -1
  19. package/dist/decorators/module.decorator.d.ts +16 -10
  20. package/dist/decorators/module.decorator.js +16 -10
  21. package/dist/decorators/module.decorator.js.map +1 -1
  22. package/dist/decorators/on-event.decorator.d.ts +5 -0
  23. package/dist/decorators/on-event.decorator.js +5 -0
  24. package/dist/decorators/on-event.decorator.js.map +1 -1
  25. package/dist/decorators/validate.decorator.d.ts +15 -1
  26. package/dist/decorators/validate.decorator.js +15 -1
  27. package/dist/decorators/validate.decorator.js.map +1 -1
  28. package/dist/errors/container.error.d.ts +18 -0
  29. package/dist/errors/container.error.js +18 -0
  30. package/dist/errors/container.error.js.map +1 -1
  31. package/dist/errors/index.d.ts +1 -0
  32. package/dist/errors/index.js +1 -0
  33. package/dist/errors/index.js.map +1 -1
  34. package/dist/errors/module.error.d.ts +6 -0
  35. package/dist/errors/module.error.js +6 -0
  36. package/dist/errors/module.error.js.map +1 -1
  37. package/dist/errors/node.error.d.ts +56 -0
  38. package/dist/errors/node.error.js +56 -0
  39. package/dist/errors/node.error.js.map +1 -1
  40. package/dist/errors/schema.error.d.ts +6 -0
  41. package/dist/errors/schema.error.js +6 -0
  42. package/dist/errors/schema.error.js.map +1 -1
  43. package/dist/errors/terraform.error.d.ts +19 -0
  44. package/dist/errors/terraform.error.js +23 -0
  45. package/dist/errors/terraform.error.js.map +1 -0
  46. package/dist/errors/transaction.error.d.ts +77 -0
  47. package/dist/errors/transaction.error.js +83 -0
  48. package/dist/errors/transaction.error.js.map +1 -1
  49. package/dist/events/action.event.d.ts +0 -2
  50. package/dist/events/action.event.js +0 -2
  51. package/dist/events/action.event.js.map +1 -1
  52. package/dist/events/event.model.d.ts +21 -5
  53. package/dist/events/event.model.js +11 -5
  54. package/dist/events/event.model.js.map +1 -1
  55. package/dist/events/hook/commit.hook.event.d.ts +0 -6
  56. package/dist/events/hook/commit.hook.event.js +0 -6
  57. package/dist/events/hook/commit.hook.event.js.map +1 -1
  58. package/dist/events/hook/hook.event.d.ts +0 -2
  59. package/dist/events/hook/hook.event.js +0 -2
  60. package/dist/events/hook/hook.event.js.map +1 -1
  61. package/dist/events/hook/model.hook.event.d.ts +0 -6
  62. package/dist/events/hook/model.hook.event.js +0 -6
  63. package/dist/events/hook/model.hook.event.js.map +1 -1
  64. package/dist/events/hook/resource.hook.event.d.ts +0 -6
  65. package/dist/events/hook/resource.hook.event.js +0 -6
  66. package/dist/events/hook/resource.hook.event.js.map +1 -1
  67. package/dist/events/index.d.ts +3 -0
  68. package/dist/events/index.js +3 -0
  69. package/dist/events/index.js.map +1 -1
  70. package/dist/events/mode-result.event.d.ts +57 -0
  71. package/dist/events/mode-result.event.js +24 -0
  72. package/dist/events/mode-result.event.js.map +1 -0
  73. package/dist/events/mode.event.d.ts +57 -0
  74. package/dist/events/mode.event.js +32 -0
  75. package/dist/events/mode.event.js.map +1 -0
  76. package/dist/events/module.event.d.ts +0 -2
  77. package/dist/events/module.event.js +0 -2
  78. package/dist/events/module.event.js.map +1 -1
  79. package/dist/events/registration.event.d.ts +18 -14
  80. package/dist/events/registration.event.js +18 -14
  81. package/dist/events/registration.event.js.map +1 -1
  82. package/dist/events/serialization.event.d.ts +15 -12
  83. package/dist/events/serialization.event.js +15 -12
  84. package/dist/events/serialization.event.js.map +1 -1
  85. package/dist/events/terraform.event.d.ts +42 -0
  86. package/dist/events/terraform.event.js +31 -0
  87. package/dist/events/terraform.event.js.map +1 -0
  88. package/dist/events/transaction.event.d.ts +0 -37
  89. package/dist/events/transaction.event.js +0 -28
  90. package/dist/events/transaction.event.js.map +1 -1
  91. package/dist/functions/container/container.d.ts +54 -13
  92. package/dist/functions/container/container.js +63 -18
  93. package/dist/functions/container/container.js.map +1 -1
  94. package/dist/functions/container/test-container.d.ts +43 -29
  95. package/dist/functions/container/test-container.js +71 -43
  96. package/dist/functions/container/test-container.js.map +1 -1
  97. package/dist/functions/dependency/dependency.d.ts +82 -8
  98. package/dist/functions/dependency/dependency.js +80 -14
  99. package/dist/functions/dependency/dependency.js.map +1 -1
  100. package/dist/functions/diff/aggregate-resource-actions.d.ts +19 -0
  101. package/dist/functions/diff/aggregate-resource-actions.js +41 -0
  102. package/dist/functions/diff/aggregate-resource-actions.js.map +1 -0
  103. package/dist/functions/diff/diff-metadata.d.ts +21 -3
  104. package/dist/functions/diff/diff-metadata.js +18 -0
  105. package/dist/functions/diff/diff-metadata.js.map +1 -1
  106. package/dist/functions/diff/diff.d.ts +55 -1
  107. package/dist/functions/diff/diff.js +44 -3
  108. package/dist/functions/diff/diff.js.map +1 -1
  109. package/dist/functions/diff/diff.utility.d.ts +17 -2
  110. package/dist/functions/diff/diff.utility.js +53 -38
  111. package/dist/functions/diff/diff.utility.js.map +1 -1
  112. package/dist/functions/hook/commit.hook.d.ts +16 -1
  113. package/dist/functions/hook/commit.hook.js +21 -6
  114. package/dist/functions/hook/commit.hook.js.map +1 -1
  115. package/dist/functions/hook/model-action.hook.d.ts +16 -1
  116. package/dist/functions/hook/model-action.hook.js +21 -6
  117. package/dist/functions/hook/model-action.hook.js.map +1 -1
  118. package/dist/functions/hook/resource-action.hook.d.ts +16 -1
  119. package/dist/functions/hook/resource-action.hook.js +21 -6
  120. package/dist/functions/hook/resource-action.hook.js.map +1 -1
  121. package/dist/functions/node/node-action.abstract.d.ts +23 -0
  122. package/dist/functions/node/node-action.abstract.js +20 -0
  123. package/dist/functions/node/node-action.abstract.js.map +1 -1
  124. package/dist/functions/node/node.abstract.d.ts +56 -5
  125. package/dist/functions/node/node.abstract.js +85 -12
  126. package/dist/functions/node/node.abstract.js.map +1 -1
  127. package/dist/functions/node/node.interface.d.ts +1 -0
  128. package/dist/functions/schema/schema.d.ts +7 -0
  129. package/dist/functions/schema/schema.js +9 -0
  130. package/dist/functions/schema/schema.js.map +1 -1
  131. package/dist/index.d.ts +5 -1
  132. package/dist/index.js +4 -1
  133. package/dist/index.js.map +1 -1
  134. package/dist/main.d.ts +244 -14
  135. package/dist/main.js +361 -72
  136. package/dist/main.js.map +1 -1
  137. package/dist/models/account/account.model.d.ts +37 -7
  138. package/dist/models/account/account.model.js +40 -8
  139. package/dist/models/account/account.model.js.map +1 -1
  140. package/dist/models/account/account.schema.d.ts +13 -1
  141. package/dist/models/account/account.schema.js +12 -0
  142. package/dist/models/account/account.schema.js.map +1 -1
  143. package/dist/models/app/app.model.d.ts +16 -1
  144. package/dist/models/app/app.model.js +19 -4
  145. package/dist/models/app/app.model.js.map +1 -1
  146. package/dist/models/app/app.schema.d.ts +6 -0
  147. package/dist/models/app/app.schema.js +6 -0
  148. package/dist/models/app/app.schema.js.map +1 -1
  149. package/dist/models/deployment/deployment.model.d.ts +13 -1
  150. package/dist/models/deployment/deployment.model.js +16 -4
  151. package/dist/models/deployment/deployment.model.js.map +1 -1
  152. package/dist/models/deployment/deployment.schema.d.ts +2 -0
  153. package/dist/models/deployment/deployment.schema.js +2 -0
  154. package/dist/models/deployment/deployment.schema.js.map +1 -1
  155. package/dist/models/environment/environment.model.d.ts +13 -1
  156. package/dist/models/environment/environment.model.js +20 -8
  157. package/dist/models/environment/environment.model.js.map +1 -1
  158. package/dist/models/environment/environment.schema.d.ts +2 -0
  159. package/dist/models/environment/environment.schema.js +2 -0
  160. package/dist/models/environment/environment.schema.js.map +1 -1
  161. package/dist/models/execution/execution.model.d.ts +20 -2
  162. package/dist/models/execution/execution.model.js +46 -28
  163. package/dist/models/execution/execution.model.js.map +1 -1
  164. package/dist/models/execution/execution.schema.d.ts +11 -0
  165. package/dist/models/execution/execution.schema.js +11 -0
  166. package/dist/models/execution/execution.schema.js.map +1 -1
  167. package/dist/models/filesystem/filesystem.model.d.ts +27 -1
  168. package/dist/models/filesystem/filesystem.model.js +30 -4
  169. package/dist/models/filesystem/filesystem.model.js.map +1 -1
  170. package/dist/models/filesystem/filesystem.schema.d.ts +5 -0
  171. package/dist/models/filesystem/filesystem.schema.js +5 -0
  172. package/dist/models/filesystem/filesystem.schema.js.map +1 -1
  173. package/dist/models/image/image.model.d.ts +17 -4
  174. package/dist/models/image/image.model.js +20 -7
  175. package/dist/models/image/image.model.js.map +1 -1
  176. package/dist/models/image/image.schema.d.ts +8 -0
  177. package/dist/models/image/image.schema.js +8 -0
  178. package/dist/models/image/image.schema.js.map +1 -1
  179. package/dist/models/model-action.interface.d.ts +17 -4
  180. package/dist/models/model.abstract.d.ts +96 -1
  181. package/dist/models/model.abstract.js +106 -7
  182. package/dist/models/model.abstract.js.map +1 -1
  183. package/dist/models/model.interface.d.ts +3 -0
  184. package/dist/models/pipeline/pipeline.model.d.ts +13 -1
  185. package/dist/models/pipeline/pipeline.model.js +18 -6
  186. package/dist/models/pipeline/pipeline.model.js.map +1 -1
  187. package/dist/models/pipeline/pipeline.schema.d.ts +8 -0
  188. package/dist/models/pipeline/pipeline.schema.js +8 -0
  189. package/dist/models/pipeline/pipeline.schema.js.map +1 -1
  190. package/dist/models/region/region.model.d.ts +16 -1
  191. package/dist/models/region/region.model.js +19 -4
  192. package/dist/models/region/region.model.js.map +1 -1
  193. package/dist/models/region/region.schema.d.ts +6 -0
  194. package/dist/models/region/region.schema.js +6 -0
  195. package/dist/models/region/region.schema.js.map +1 -1
  196. package/dist/models/server/server.model.d.ts +13 -1
  197. package/dist/models/server/server.model.js +16 -4
  198. package/dist/models/server/server.model.js.map +1 -1
  199. package/dist/models/server/server.schema.d.ts +3 -1
  200. package/dist/models/server/server.schema.js +3 -1
  201. package/dist/models/server/server.schema.js.map +1 -1
  202. package/dist/models/service/service.model.d.ts +15 -1
  203. package/dist/models/service/service.model.js +15 -1
  204. package/dist/models/service/service.model.js.map +1 -1
  205. package/dist/models/service/service.schema.d.ts +4 -1
  206. package/dist/models/service/service.schema.js +4 -1
  207. package/dist/models/service/service.schema.js.map +1 -1
  208. package/dist/models/subnet/subnet.model.d.ts +27 -3
  209. package/dist/models/subnet/subnet.model.js +40 -16
  210. package/dist/models/subnet/subnet.model.js.map +1 -1
  211. package/dist/models/subnet/subnet.schema.d.ts +9 -0
  212. package/dist/models/subnet/subnet.schema.js +9 -0
  213. package/dist/models/subnet/subnet.schema.js.map +1 -1
  214. package/dist/modes/apply-transaction.d.ts +23 -0
  215. package/dist/modes/apply-transaction.js +25 -0
  216. package/dist/modes/apply-transaction.js.map +1 -0
  217. package/dist/modes/commit.mode.d.ts +54 -0
  218. package/dist/modes/commit.mode.js +235 -0
  219. package/dist/modes/commit.mode.js.map +1 -0
  220. package/dist/modes/generate.mode.d.ts +29 -0
  221. package/dist/modes/generate.mode.js +49 -0
  222. package/dist/modes/generate.mode.js.map +1 -0
  223. package/dist/modes/run-action.mode.d.ts +30 -0
  224. package/dist/modes/run-action.mode.js +140 -0
  225. package/dist/modes/run-action.mode.js.map +1 -0
  226. package/dist/modes/validate.mode.d.ts +162 -0
  227. package/dist/modes/validate.mode.js +480 -0
  228. package/dist/modes/validate.mode.js.map +1 -0
  229. package/dist/modules/module.abstract.d.ts +51 -0
  230. package/dist/modules/module.abstract.js +36 -0
  231. package/dist/modules/module.abstract.js.map +1 -1
  232. package/dist/modules/module.container.d.ts +36 -0
  233. package/dist/modules/module.container.js +36 -0
  234. package/dist/modules/module.container.js.map +1 -1
  235. package/dist/modules/test-module.container.d.ts +139 -24
  236. package/dist/modules/test-module.container.js +410 -163
  237. package/dist/modules/test-module.container.js.map +1 -1
  238. package/dist/overlays/anchor.abstract.d.ts +32 -1
  239. package/dist/overlays/anchor.abstract.js +42 -11
  240. package/dist/overlays/anchor.abstract.js.map +1 -1
  241. package/dist/overlays/anchor.schema.d.ts +21 -0
  242. package/dist/overlays/anchor.schema.js +21 -0
  243. package/dist/overlays/anchor.schema.js.map +1 -1
  244. package/dist/overlays/overlay-data.repository.d.ts +18 -0
  245. package/dist/overlays/overlay-data.repository.js +18 -0
  246. package/dist/overlays/overlay-data.repository.js.map +1 -1
  247. package/dist/overlays/overlay.abstract.d.ts +56 -1
  248. package/dist/overlays/overlay.abstract.js +79 -20
  249. package/dist/overlays/overlay.abstract.js.map +1 -1
  250. package/dist/overlays/overlay.schema.d.ts +20 -0
  251. package/dist/overlays/overlay.schema.js +20 -0
  252. package/dist/overlays/overlay.schema.js.map +1 -1
  253. package/dist/resources/resource-action.interface.d.ts +26 -2
  254. package/dist/resources/resource-data.repository.d.ts +63 -1
  255. package/dist/resources/resource-data.repository.js +94 -4
  256. package/dist/resources/resource-data.repository.js.map +1 -1
  257. package/dist/resources/resource.abstract.d.ts +118 -3
  258. package/dist/resources/resource.abstract.js +166 -33
  259. package/dist/resources/resource.abstract.js.map +1 -1
  260. package/dist/resources/resource.schema.d.ts +29 -1
  261. package/dist/resources/resource.schema.js +28 -0
  262. package/dist/resources/resource.schema.js.map +1 -1
  263. package/dist/resources/terraform-resource.abstract.d.ts +44 -0
  264. package/dist/resources/terraform-resource.abstract.js +45 -0
  265. package/dist/resources/terraform-resource.abstract.js.map +1 -0
  266. package/dist/services/event/event.service.d.ts +30 -3
  267. package/dist/services/event/event.service.js +58 -16
  268. package/dist/services/event/event.service.js.map +1 -1
  269. package/dist/services/input/input.service.d.ts +52 -3
  270. package/dist/services/input/input.service.js +72 -8
  271. package/dist/services/input/input.service.js.map +1 -1
  272. package/dist/services/schema-translation/schema-translation.service.d.ts +9 -0
  273. package/dist/services/schema-translation/schema-translation.service.js +9 -0
  274. package/dist/services/schema-translation/schema-translation.service.js.map +1 -1
  275. package/dist/services/serialization/model/model-serialization.service.d.ts +26 -2
  276. package/dist/services/serialization/model/model-serialization.service.js +110 -62
  277. package/dist/services/serialization/model/model-serialization.service.js.map +1 -1
  278. package/dist/services/serialization/resource/resource-serialization.service.d.ts +33 -4
  279. package/dist/services/serialization/resource/resource-serialization.service.js +64 -28
  280. package/dist/services/serialization/resource/resource-serialization.service.js.map +1 -1
  281. package/dist/services/state-management/file-app-lock.utility.d.ts +43 -0
  282. package/dist/services/state-management/file-app-lock.utility.js +124 -0
  283. package/dist/services/state-management/file-app-lock.utility.js.map +1 -0
  284. package/dist/services/state-management/local-encryption.state-provider.d.ts +53 -2
  285. package/dist/services/state-management/local-encryption.state-provider.js +75 -49
  286. package/dist/services/state-management/local-encryption.state-provider.js.map +1 -1
  287. package/dist/services/state-management/local.state-provider.d.ts +49 -2
  288. package/dist/services/state-management/local.state-provider.js +70 -49
  289. package/dist/services/state-management/local.state-provider.js.map +1 -1
  290. package/dist/services/state-management/state-management.service.d.ts +141 -6
  291. package/dist/services/state-management/state-management.service.js +149 -4
  292. package/dist/services/state-management/state-management.service.js.map +1 -1
  293. package/dist/services/state-management/state-provider.interface.d.ts +55 -1
  294. package/dist/services/state-management/terraform-state.service.d.ts +76 -0
  295. package/dist/services/state-management/terraform-state.service.js +154 -0
  296. package/dist/services/state-management/terraform-state.service.js.map +1 -0
  297. package/dist/services/state-management/test.state-provider.d.ts +38 -1
  298. package/dist/services/state-management/test.state-provider.js +52 -21
  299. package/dist/services/state-management/test.state-provider.js.map +1 -1
  300. package/dist/services/terraform/terraform.service.d.ts +426 -0
  301. package/dist/services/terraform/terraform.service.js +995 -0
  302. package/dist/services/terraform/terraform.service.js.map +1 -0
  303. package/dist/services/terraform/terraform.type.d.ts +387 -0
  304. package/dist/services/terraform/terraform.type.js +579 -0
  305. package/dist/services/terraform/terraform.type.js.map +1 -0
  306. package/dist/services/transaction/transaction.service.d.ts +86 -10
  307. package/dist/services/transaction/transaction.service.js +387 -232
  308. package/dist/services/transaction/transaction.service.js.map +1 -1
  309. package/dist/services/validation/validation.service.d.ts +13 -1
  310. package/dist/services/validation/validation.service.js +12 -0
  311. package/dist/services/validation/validation.service.js.map +1 -1
  312. package/dist/utilities/array/array.utility.d.ts +3 -0
  313. package/dist/utilities/array/array.utility.js +3 -0
  314. package/dist/utilities/array/array.utility.js.map +1 -1
  315. package/dist/utilities/file/file.utility.d.ts +15 -0
  316. package/dist/utilities/file/file.utility.js +18 -1
  317. package/dist/utilities/file/file.utility.js.map +1 -1
  318. package/dist/utilities/hcl/hcl.utility.d.ts +61 -0
  319. package/dist/utilities/hcl/hcl.utility.js +229 -0
  320. package/dist/utilities/hcl/hcl.utility.js.map +1 -0
  321. package/dist/utilities/node/node.utility.d.ts +3 -0
  322. package/dist/utilities/node/node.utility.js +3 -0
  323. package/dist/utilities/node/node.utility.js.map +1 -1
  324. package/dist/utilities/object/object.utility.d.ts +12 -0
  325. package/dist/utilities/object/object.utility.js +12 -0
  326. package/dist/utilities/object/object.utility.js.map +1 -1
  327. package/dist/utilities/project/project.utility.d.ts +28 -0
  328. package/dist/utilities/project/project.utility.js +35 -0
  329. package/dist/utilities/project/project.utility.js.map +1 -0
  330. package/dist/utilities/string/string.utility.d.ts +21 -0
  331. package/dist/utilities/string/string.utility.js +39 -0
  332. package/dist/utilities/string/string.utility.js.map +1 -0
  333. package/dist/utilities/terraform/terraform.utility.d.ts +227 -0
  334. package/dist/utilities/terraform/terraform.utility.js +434 -0
  335. package/dist/utilities/terraform/terraform.utility.js.map +1 -0
  336. package/dist/utilities/test-helpers/test-classes.d.ts +18 -31
  337. package/dist/utilities/test-helpers/test-classes.js +18 -41
  338. package/dist/utilities/test-helpers/test-classes.js.map +1 -1
  339. package/dist/utilities/test-helpers/test-models.js +12 -0
  340. package/dist/utilities/test-helpers/test-models.js.map +1 -1
  341. package/dist/utilities/test-helpers/test-modes.d.ts +315 -0
  342. package/dist/utilities/test-helpers/test-modes.js +463 -0
  343. package/dist/utilities/test-helpers/test-modes.js.map +1 -0
  344. package/dist/utilities/test-helpers/test-modules.d.ts +41 -0
  345. package/dist/utilities/test-helpers/test-modules.js +79 -0
  346. package/dist/utilities/test-helpers/test-modules.js.map +1 -0
  347. package/dist/utilities/test-helpers/test-overlays.d.ts +17 -1
  348. package/dist/utilities/test-helpers/test-overlays.js +49 -5
  349. package/dist/utilities/test-helpers/test-overlays.js.map +1 -1
  350. package/dist/utilities/test-helpers/test-resources.d.ts +19 -1
  351. package/dist/utilities/test-helpers/test-resources.js +61 -3
  352. package/dist/utilities/test-helpers/test-resources.js.map +1 -1
  353. package/dist/utilities/validation/validation.utility.d.ts +24 -0
  354. package/dist/utilities/validation/validation.utility.js +24 -0
  355. package/dist/utilities/validation/validation.utility.js.map +1 -1
  356. package/package.json +6 -5
  357. package/dist/services/capture/capture.service.d.ts +0 -19
  358. package/dist/services/capture/capture.service.js +0 -43
  359. package/dist/services/capture/capture.service.js.map +0 -1
  360. package/dist/utilities/cidr/cidr.utility.d.ts +0 -10
  361. package/dist/utilities/cidr/cidr.utility.js +0 -51
  362. package/dist/utilities/cidr/cidr.utility.js.map +0 -1
@@ -16,7 +16,7 @@ import { CommitHook } from '../functions/hook/commit.hook.js';
16
16
  *
17
17
  * @returns The decorated method.
18
18
  *
19
- * @see Definition of [Hooks](/docs/fundamentals/modules#hooks).
19
+ * @see Definition of [Hooks](/docs/techniques/hooks).
20
20
  */
21
21
  export function EnableHook(hook) {
22
22
  return function (_target, _propertyKey, descriptor) {
@@ -1,61 +1,45 @@
1
1
  import type { Constructable } from '../app.type.js';
2
2
  /**
3
3
  * A `@Factory` is a class decorator to be placed on top of a class that represents a factory.
4
- * A factory is responsible for creating instances of a class.
4
+ * A factory is responsible for creating instances of a class - Octo resolves every service through one
5
+ * rather than calling `new`, which is what lets you swap an internal implementation for your own.
5
6
  *
6
- * It is possible to generate multiple factories for the same class
7
- * by assigning a unique set of metadata to the factory.
8
- * Of all registered factories, only one can be the default factory.
7
+ * The same class may have several factories, told apart by their metadata.
8
+ * The factory registered without metadata is the default.
9
9
  *
10
10
  * @example
11
11
  * ```ts
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
+ * const container = Container.getInstance();
19
+ *
18
20
  * // Get instance using default factory.
19
- * const myService = await Container.get(MyService);
21
+ * const myService = await container.get(MyService);
20
22
  *
21
23
  * // Get instance using specific factory.
22
- * const myService = await Container.get(MyService, { metadata: { key: 'value' } });
24
+ * const myService = await container.get(MyService, { metadata: { key: 'value' } });
23
25
  *
24
26
  * // Pass args to factory.
25
- * const myService = await Container.get(MyService, { args: [arg1, arg2, ...] });
27
+ * const myService = await container.get(MyService, { args: [arg1, arg2] });
26
28
  * ```
27
29
  * @group Decorators
28
30
  * @param type The type of class that the factory creates.
29
31
  * @param options Allows registering multiple factories for the same class that differ by metadata.
30
32
  * @remarks
31
- * If the factory is dependent on other factories, it should not block creation of its instance.
33
+ * A factory that produces a singleton must `await` its own dependencies *before* the instance check.
34
+ * Awaiting inside the check is a race - concurrent callers each pass the check while suspended,
35
+ * and each gets a different instance.
32
36
  * ```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
- * }
37
+ * static async create(): Promise<MyService> {
38
+ * const otherInstance = await Container.get(OtherService); // Await first.
39
+ * if (!this.instance) {
40
+ * this.instance = new MyService(otherInstance);
58
41
  * }
42
+ * return this.instance;
59
43
  * }
60
44
  * ```
61
45
  * @returns The decorated class.
@@ -1,61 +1,45 @@
1
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
- * A factory is responsible for creating instances of a class.
4
+ * A factory is responsible for creating instances of a class - Octo resolves every service through one
5
+ * rather than calling `new`, which is what lets you swap an internal implementation for your own.
5
6
  *
6
- * It is possible to generate multiple factories for the same class
7
- * by assigning a unique set of metadata to the factory.
8
- * Of all registered factories, only one can be the default factory.
7
+ * The same class may have several factories, told apart by their metadata.
8
+ * The factory registered without metadata is the default.
9
9
  *
10
10
  * @example
11
11
  * ```ts
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
+ * const container = Container.getInstance();
19
+ *
18
20
  * // Get instance using default factory.
19
- * const myService = await Container.get(MyService);
21
+ * const myService = await container.get(MyService);
20
22
  *
21
23
  * // Get instance using specific factory.
22
- * const myService = await Container.get(MyService, { metadata: { key: 'value' } });
24
+ * const myService = await container.get(MyService, { metadata: { key: 'value' } });
23
25
  *
24
26
  * // Pass args to factory.
25
- * const myService = await Container.get(MyService, { args: [arg1, arg2, ...] });
27
+ * const myService = await container.get(MyService, { args: [arg1, arg2] });
26
28
  * ```
27
29
  * @group Decorators
28
30
  * @param type The type of class that the factory creates.
29
31
  * @param options Allows registering multiple factories for the same class that differ by metadata.
30
32
  * @remarks
31
- * If the factory is dependent on other factories, it should not block creation of its instance.
33
+ * A factory that produces a singleton must `await` its own dependencies *before* the instance check.
34
+ * Awaiting inside the check is a race - concurrent callers each pass the check while suspended,
35
+ * and each gets a different instance.
32
36
  * ```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
- * }
37
+ * static async create(): Promise<MyService> {
38
+ * const otherInstance = await Container.get(OtherService); // Await first.
39
+ * if (!this.instance) {
40
+ * this.instance = new MyService(otherInstance);
58
41
  * }
42
+ * return this.instance;
59
43
  * }
60
44
  * ```
61
45
  * @returns The decorated class.
@@ -1 +1 @@
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
+ {"version":3,"file":"factory.decorator.js","sourceRoot":"","sources":["../../src/decorators/factory.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;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"}
@@ -23,6 +23,6 @@ import { type Constructable, type ModelSchema, type UnknownModel } from '../app.
23
23
  * @returns The decorated class.
24
24
  *
25
25
  * @see Definition of [Models](/docs/fundamentals/models).
26
- * @see {@link App} and {@link Region} are a few base models. More can be found in the same folder.
26
+ * @see {@link App}, {@link Region}, and {@link Server} for the base models you can extend.
27
27
  */
28
28
  export declare function Model<T extends UnknownModel>(packageName: string, modelName: string, schema: Constructable<ModelSchema<T>>): (constructor: any) => void;
@@ -28,7 +28,7 @@ import { ValidationUtility } from '../utilities/validation/validation.utility.js
28
28
  * @returns The decorated class.
29
29
  *
30
30
  * @see Definition of [Models](/docs/fundamentals/models).
31
- * @see {@link App} and {@link Region} are a few base models. More can be found in the same folder.
31
+ * @see {@link App}, {@link Region}, and {@link Server} for the base models you can extend.
32
32
  */
33
33
  export function Model(packageName, modelName, schema) {
34
34
  const container = Container.getInstance();
@@ -1,21 +1,27 @@
1
1
  import type { Constructable, ModuleSchema } from '../app.type.js';
2
2
  /**
3
- * A `@Module` is a class decorator to be placed on top of a class that represents a module.
4
- * - A Module class must implement the {@link IModule} interface.
5
- * - The {@link IModule.onInit} method is called to initialize the module,
6
- * and is where you will *define* your infrastructure.
3
+ * A `@Module` is a class decorator and must be placed on top of a class representing a module.
4
+ * - A module must also extend the {@link AModule} class.
5
+ * - For type safety, the type of module being decorated is passed to the decorator.
6
+ *
7
+ * Decorating a class registers it with Octo, which is what makes the module loadable by name
8
+ * with {@link Octo.loadModule}.
7
9
  *
8
10
  * @example
9
11
  * ```ts
10
- * @Module<MyInputInterface, OutputModel>('my-package', {})
11
- * export class MyModule implements IModule<Region> {
12
- * constructor(inputs: IMyInputs) { ... }
13
- *
14
- * async onInit(): Promise<Region> { ... }
15
- * }
12
+ * @Module<MyModule>('@example', MyModuleSchema)
13
+ * export class MyModule extends AModule<MyModuleSchema, MyRegion> { ... }
16
14
  * ```
15
+ *
17
16
  * @group Decorators
17
+ *
18
+ * @param packageName - The name of the package under which the module is registered.
19
+ * Selecting a unique package name helps avoid collisions between same module class names across different libraries.
20
+ * You will reuse the same package name throughout your library for different Octo components you create.
21
+ * @param schema - The schema of the module, describing the inputs it accepts.
22
+ *
18
23
  * @returns The decorated class.
24
+ *
19
25
  * @see Definition of [Modules](/docs/fundamentals/modules).
20
26
  */
21
27
  export declare function Module<T>(packageName: string, schema: Constructable<ModuleSchema<T>>): (constructor: any) => void;
@@ -3,22 +3,28 @@ import { AModule } from '../modules/module.abstract.js';
3
3
  import { ModuleContainer } from '../modules/module.container.js';
4
4
  import { ValidationUtility } from '../utilities/validation/validation.utility.js';
5
5
  /**
6
- * A `@Module` is a class decorator to be placed on top of a class that represents a module.
7
- * - A Module class must implement the {@link IModule} interface.
8
- * - The {@link IModule.onInit} method is called to initialize the module,
9
- * and is where you will *define* your infrastructure.
6
+ * A `@Module` is a class decorator and must be placed on top of a class representing a module.
7
+ * - A module must also extend the {@link AModule} class.
8
+ * - For type safety, the type of module being decorated is passed to the decorator.
9
+ *
10
+ * Decorating a class registers it with Octo, which is what makes the module loadable by name
11
+ * with {@link Octo.loadModule}.
10
12
  *
11
13
  * @example
12
14
  * ```ts
13
- * @Module<MyInputInterface, OutputModel>('my-package', {})
14
- * export class MyModule implements IModule<Region> {
15
- * constructor(inputs: IMyInputs) { ... }
16
- *
17
- * async onInit(): Promise<Region> { ... }
18
- * }
15
+ * @Module<MyModule>('@example', MyModuleSchema)
16
+ * export class MyModule extends AModule<MyModuleSchema, MyRegion> { ... }
19
17
  * ```
18
+ *
20
19
  * @group Decorators
20
+ *
21
+ * @param packageName - The name of the package under which the module is registered.
22
+ * Selecting a unique package name helps avoid collisions between same module class names across different libraries.
23
+ * You will reuse the same package name throughout your library for different Octo components you create.
24
+ * @param schema - The schema of the module, describing the inputs it accepts.
25
+ *
21
26
  * @returns The decorated class.
27
+ *
22
28
  * @see Definition of [Modules](/docs/fundamentals/modules).
23
29
  */
24
30
  export function Module(packageName, schema) {
@@ -1 +1 @@
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,EA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,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"}
@@ -3,6 +3,11 @@ import type { Event } from '../events/index.js';
3
3
  /**
4
4
  * An `@OnEvent` is a method decorator to listen to an event.
5
5
  *
6
+ * Octo narrates everything it does as {@link Event}s. Subscribing is how you add logging, reporting,
7
+ * or notifications without changing the framework. A handler receives every event that is an instance
8
+ * of the given type, so listening to a base class such as {@link TransactionEvent} catches all of its
9
+ * subclasses.
10
+ *
6
11
  * @example
7
12
  * ```ts
8
13
  * // Async handler.
@@ -2,6 +2,11 @@ import { EventService } from '../services/event/event.service.js';
2
2
  /**
3
3
  * An `@OnEvent` is a method decorator to listen to an event.
4
4
  *
5
+ * Octo narrates everything it does as {@link Event}s. Subscribing is how you add logging, reporting,
6
+ * or notifications without changing the framework. A handler receives every event that is an instance
7
+ * of the given type, so listening to a base class such as {@link TransactionEvent} catches all of its
8
+ * subclasses.
9
+ *
5
10
  * @example
6
11
  * ```ts
7
12
  * // Async handler.
@@ -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,YAAoB,EAAE,UAA8B;QAChF,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,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,OAAO,CACrB,MAAqC;IAErC,OAAO,UAAU,MAAW,EAAE,YAAoB,EAAE,UAA8B;QAChF,YAAY,CAAC,WAAW,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAC3E,CAAC,CAAC;AACJ,CAAC"}
@@ -9,9 +9,23 @@ type ValidationOptions<T> = {
9
9
  * A `@Validate` is a property decorator to validate a property.
10
10
  * It is typically used in {@link Schema} to validate schema properties.
11
11
  *
12
+ * Validation runs on assignment, and a failure throws a {@link ValidationTransactionError}.
13
+ * Declaring constraints here is what lets a module reject bad inputs before any infrastructure is touched.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * @Validate({ options: { maxLength: 65535, minLength: 1 } })
18
+ * containerPort = Schema<number>();
19
+ * ```
20
+ *
12
21
  * @group Decorators
13
22
  *
14
- * @see Techniques for [Validation](/docs/techniques/validation).
23
+ * @param validators One constraint, or an array of them. Each constraint carries the `options` to apply,
24
+ * and an optional `destruct` to reduce the property into the list of values the constraints run against.
25
+ * Without `destruct`, the property value is validated as-is.
26
+ * @param transform Runs before validation, and **replaces** the stored value with what it returns.
27
+ *
28
+ * @see Techniques for [Validation](/docs/techniques/validation) for the full list of constraints.
15
29
  */
16
30
  export declare function Validate<T>(validators: ValidationOptions<T> | ValidationOptions<T>[], transform?: (value: any) => any): (target: any, propertyKey: string) => void;
17
31
  export {};
@@ -4,9 +4,23 @@ import { ValidationService } from '../services/validation/validation.service.js'
4
4
  * A `@Validate` is a property decorator to validate a property.
5
5
  * It is typically used in {@link Schema} to validate schema properties.
6
6
  *
7
+ * Validation runs on assignment, and a failure throws a {@link ValidationTransactionError}.
8
+ * Declaring constraints here is what lets a module reject bad inputs before any infrastructure is touched.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * @Validate({ options: { maxLength: 65535, minLength: 1 } })
13
+ * containerPort = Schema<number>();
14
+ * ```
15
+ *
7
16
  * @group Decorators
8
17
  *
9
- * @see Techniques for [Validation](/docs/techniques/validation).
18
+ * @param validators One constraint, or an array of them. Each constraint carries the `options` to apply,
19
+ * and an optional `destruct` to reduce the property into the list of values the constraints run against.
20
+ * Without `destruct`, the property value is validated as-is.
21
+ * @param transform Runs before validation, and **replaces** the stored value with what it returns.
22
+ *
23
+ * @see Techniques for [Validation](/docs/techniques/validation) for the full list of constraints.
10
24
  */
11
25
  export function Validate(validators, transform) {
12
26
  return function (target, propertyKey) {
@@ -1 +1 @@
1
- {"version":3,"file":"validate.decorator.js","sourceRoot":"","sources":["../../src/decorators/validate.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAOjF;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CACtB,UAAyD,EACzD,SAA+B;IAE/B,OAAO,UAAU,MAAW,EAAE,WAAmB;QAC/C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC;QAExB,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE;YACzC,UAAU,EAAE,IAAI;YAChB,GAAG,EAAE;gBACH,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;YACtB,CAAC;YACD,GAAG,EAAE,UAAU,QAAa;gBAC1B,I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AQ,CAAC;YAC1B,CAAC;SACF,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
@@ -1,20 +1,38 @@
1
1
  import type { Constructable } from '../app.type.js';
2
2
  /**
3
+ * Parent error class for all {@link Container} errors.
4
+ *
3
5
  * @group Errors/Container
4
6
  */
5
7
  export declare class ContainerError extends Error {
6
8
  readonly type: string;
9
+ /**
10
+ * @param message The error message.
11
+ * @param type The class the container was resolving or registering.
12
+ */
7
13
  constructor(message: string, type: Constructable<unknown> | string);
8
14
  }
9
15
  /**
16
+ * Thrown when a factory is registered for a class that already has one with the same metadata.
17
+ *
10
18
  * @group Errors/Container
11
19
  */
12
20
  export declare class ContainerRegistrationError extends ContainerError {
21
+ /**
22
+ * @param message The error message.
23
+ * @param type The class whose factory was being registered.
24
+ */
13
25
  constructor(message: string, type: Constructable<unknown> | string);
14
26
  }
15
27
  /**
28
+ * Thrown when a class is requested and no factory registers for it before the timeout - see {@link Container.setFactoryTimeout}.
29
+ *
16
30
  * @group Errors/Container
17
31
  */
18
32
  export declare class ContainerResolutionError extends ContainerError {
33
+ /**
34
+ * @param message The error message.
35
+ * @param type The class that could not be resolved.
36
+ */
19
37
  constructor(message: string, type: Constructable<unknown> | string);
20
38
  }
@@ -1,7 +1,13 @@
1
1
  /**
2
+ * Parent error class for all {@link Container} errors.
3
+ *
2
4
  * @group Errors/Container
3
5
  */
4
6
  export class ContainerError extends Error {
7
+ /**
8
+ * @param message The error message.
9
+ * @param type The class the container was resolving or registering.
10
+ */
5
11
  constructor(message, type) {
6
12
  super(message);
7
13
  this.type = typeof type === 'string' ? type : type.name;
@@ -9,18 +15,30 @@ export class ContainerError extends Error {
9
15
  }
10
16
  }
11
17
  /**
18
+ * Thrown when a factory is registered for a class that already has one with the same metadata.
19
+ *
12
20
  * @group Errors/Container
13
21
  */
14
22
  export class ContainerRegistrationError extends ContainerError {
23
+ /**
24
+ * @param message The error message.
25
+ * @param type The class whose factory was being registered.
26
+ */
15
27
  constructor(message, type) {
16
28
  super(message, type);
17
29
  Object.setPrototypeOf(this, ContainerRegistrationError.prototype);
18
30
  }
19
31
  }
20
32
  /**
33
+ * Thrown when a class is requested and no factory registers for it before the timeout - see {@link Container.setFactoryTimeout}.
34
+ *
21
35
  * @group Errors/Container
22
36
  */
23
37
  export class ContainerResolutionError extends ContainerError {
38
+ /**
39
+ * @param message The error message.
40
+ * @param type The class that could not be resolved.
41
+ */
24
42
  constructor(message, type) {
25
43
  super(message, type);
26
44
  Object.setPrototypeOf(this, ContainerResolutionError.prototype);
@@ -1 +1 @@
1
- {"version":3,"file":"container.error.js","sourceRoot":"","sources":["../../src/errors/container.error.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IAGvC,YAAY,OAAe,EAAE,IAAqC;QAChE,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAExD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,cAAc;IAC5D,YAAY,OAAe,EAAE,IAAqC;QAChE,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAErB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,0BAA0B,CAAC,SAAS,CAAC,CAAC;IACpE,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,cAAc;IAC1D,YAAY,OAAe,EAAE,IAAqC;QAChE,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAErB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,wBAAwB,CAAC,SAAS,CAAC,CAAC;IAClE,CAAC;CACF"}
1
+ {"version":3,"file":"container.error.js","sourceRoot":"","sources":["../../src/errors/container.error.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IAGvC;;;OAGG;IACH,YAAY,OAAe,EAAE,IAAqC;QAChE,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAExD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,0BAA2B,SAAQ,cAAc;IAC5D;;;OAGG;IACH,YAAY,OAAe,EAAE,IAAqC;QAChE,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAErB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,0BAA0B,CAAC,SAAS,CAAC,CAAC;IACpE,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,wBAAyB,SAAQ,cAAc;IAC1D;;;OAGG;IACH,YAAY,OAAe,EAAE,IAAqC;QAChE,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAErB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,wBAAwB,CAAC,SAAS,CAAC,CAAC;IAClE,CAAC;CACF"}
@@ -3,4 +3,5 @@ export * from './input.error.js';
3
3
  export * from './module.error.js';
4
4
  export * from './node.error.js';
5
5
  export * from './schema.error.js';
6
+ export * from './terraform.error.js';
6
7
  export * from './transaction.error.js';
@@ -3,5 +3,6 @@ export * from './input.error.js';
3
3
  export * from './module.error.js';
4
4
  export * from './node.error.js';
5
5
  export * from './schema.error.js';
6
+ export * from './terraform.error.js';
6
7
  export * from './transaction.error.js';
7
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC"}
@@ -1,7 +1,13 @@
1
1
  /**
2
+ * Thrown by a module that cannot satisfy its inputs. Raise it from {@link AModule.onInit} to fail a run before anything is built.
3
+ *
2
4
  * @group Errors/Module
3
5
  */
4
6
  export declare class ModuleError extends Error {
5
7
  readonly module: string;
8
+ /**
9
+ * @param message The error message.
10
+ * @param moduleName The module that raised it.
11
+ */
6
12
  constructor(message: string, moduleName: string);
7
13
  }
@@ -1,7 +1,13 @@
1
1
  /**
2
+ * Thrown by a module that cannot satisfy its inputs. Raise it from {@link AModule.onInit} to fail a run before anything is built.
3
+ *
2
4
  * @group Errors/Module
3
5
  */
4
6
  export class ModuleError extends Error {
7
+ /**
8
+ * @param message The error message.
9
+ * @param moduleName The module that raised it.
10
+ */
5
11
  constructor(message, moduleName) {
6
12
  super(message);
7
13
  this.module = moduleName;
@@ -1 +1 @@
1
- {"version":3,"file":"module.error.js","sourceRoot":"","sources":["../../src/errors/module.error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IAGpC,YAAY,OAAe,EAAE,UAAkB;QAC7C,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;QAEzB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;CACF"}
1
+ {"version":3,"file":"module.error.js","sourceRoot":"","sources":["../../src/errors/module.error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IAGpC;;;OAGG;IACH,YAAY,OAAe,EAAE,UAAkB;QAC7C,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;QAEzB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;CACF"}
@@ -3,61 +3,117 @@ import type { Dependency, IDependency } from '../functions/dependency/dependency
3
3
  import type { Diff } from '../functions/diff/diff.js';
4
4
  import type { AResource } from '../resources/resource.abstract.js';
5
5
  /**
6
+ * Thrown when a {@link Dependency} is given a second relationship, or asked to drop a behavior it does not have.
7
+ *
6
8
  * @group Errors/Node
7
9
  */
8
10
  export declare class DependencyError extends Error {
9
11
  readonly dependency: IDependency;
12
+ /**
13
+ * @param message The error message.
14
+ * @param dependency The dependency that was being changed.
15
+ */
10
16
  constructor(message: string, dependency: Dependency);
11
17
  }
12
18
  /**
19
+ * Thrown when state cannot be deserialized back into a node, e.g. because it references something no longer in the graph.
20
+ *
13
21
  * @group Errors/Node
14
22
  */
15
23
  export declare class NodeUnsynthError extends Error {
16
24
  readonly subject: string;
25
+ /**
26
+ * @param message The error message.
27
+ * @param subject The node, named by its ID, that could not be deserialized.
28
+ */
17
29
  constructor(message: string, subject: string);
18
30
  }
19
31
  /**
32
+ * Parent error class for all node errors.
33
+ *
20
34
  * @group Errors/Node
21
35
  */
22
36
  export declare class NodeError extends Error {
23
37
  readonly node: string;
38
+ /**
39
+ * @param message The error message.
40
+ * @param node The node the error is about.
41
+ */
24
42
  constructor(message: string, node: typeof AResource | UnknownNode);
25
43
  }
26
44
  /**
45
+ * Thrown when a node's context cannot be derived, which usually means it was never attached to a parent.
46
+ *
27
47
  * @group Errors/Node
28
48
  */
29
49
  export declare class ContextNodeError extends NodeError {
50
+ /**
51
+ * @param message The error message.
52
+ * @param node The node whose context could not be derived.
53
+ */
30
54
  constructor(message: string, node: UnknownNode);
31
55
  }
32
56
  /**
57
+ * Thrown when a model is used in a way its own rules forbid, e.g. adding a child that already exists.
58
+ *
33
59
  * @group Errors/Node
34
60
  */
35
61
  export declare class ModelError extends NodeError {
62
+ /**
63
+ * @param message The error message.
64
+ * @param model The model the error is about.
65
+ */
36
66
  constructor(message: string, model: UnknownModel);
37
67
  }
38
68
  /**
69
+ * Thrown when an overlay is used in a way its own rules forbid.
70
+ *
39
71
  * @group Errors/Node
40
72
  */
41
73
  export declare class OverlayError extends NodeError {
74
+ /**
75
+ * @param message The error message.
76
+ * @param overlay The overlay the error is about.
77
+ */
42
78
  constructor(message: string, overlay: UnknownOverlay);
43
79
  }
44
80
  /**
81
+ * Thrown when a resource is used in a way its own rules forbid, e.g. an invalid resource ID.
82
+ *
45
83
  * @group Errors/Node
46
84
  */
47
85
  export declare class ResourceError extends NodeError {
86
+ /**
87
+ * @param message The error message.
88
+ * @param resource The resource the error is about.
89
+ */
48
90
  constructor(message: string, resource: typeof AResource | UnknownResource);
49
91
  }
50
92
  /**
93
+ * Thrown when a diff cannot be applied back onto a resource, because its field or action is not one the resource knows how to handle.
94
+ *
51
95
  * @group Errors/Node
52
96
  */
53
97
  export declare class DiffInverseResourceError extends ResourceError {
54
98
  readonly diff: ReturnType<Diff['toJSON']>;
99
+ /**
100
+ * @param message The error message.
101
+ * @param resource The resource the diff was being applied to.
102
+ * @param diff The diff that could not be applied.
103
+ */
55
104
  constructor(message: string, resource: UnknownResource, diff: Diff);
56
105
  }
57
106
  /**
107
+ * Thrown when a resource is removed while other resources still depend on it. Carries the children that blocked it.
108
+ *
58
109
  * @group Errors/Node
59
110
  */
60
111
  export declare class RemoveResourceError extends ResourceError {
61
112
  readonly childrenResources: string[];
113
+ /**
114
+ * @param message The error message.
115
+ * @param resource The resource that could not be removed.
116
+ * @param childrenResources The resources still depending on it.
117
+ */
62
118
  constructor(message: string, resource: UnknownResource, childrenResources: UnknownResource[]);
63
119
  }