@quadnix/octo 0.0.30 → 0.2.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 (383) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +117 -8
  3. package/dist/app.type.d.ts +277 -19
  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 +4 -6
  18. package/dist/decorators/model.decorator.js +2 -7
  19. package/dist/decorators/model.decorator.js.map +1 -1
  20. package/dist/decorators/module.decorator.d.ts +16 -10
  21. package/dist/decorators/module.decorator.js +16 -10
  22. package/dist/decorators/module.decorator.js.map +1 -1
  23. package/dist/decorators/on-event.decorator.d.ts +7 -2
  24. package/dist/decorators/on-event.decorator.js +5 -0
  25. package/dist/decorators/on-event.decorator.js.map +1 -1
  26. package/dist/decorators/resource.decorator.d.ts +50 -1
  27. package/dist/decorators/resource.decorator.js +38 -1
  28. package/dist/decorators/resource.decorator.js.map +1 -1
  29. package/dist/decorators/validate.decorator.d.ts +15 -1
  30. package/dist/decorators/validate.decorator.js +15 -1
  31. package/dist/decorators/validate.decorator.js.map +1 -1
  32. package/dist/errors/container.error.d.ts +18 -0
  33. package/dist/errors/container.error.js +18 -0
  34. package/dist/errors/container.error.js.map +1 -1
  35. package/dist/errors/index.d.ts +1 -0
  36. package/dist/errors/index.js +1 -0
  37. package/dist/errors/index.js.map +1 -1
  38. package/dist/errors/module.error.d.ts +6 -0
  39. package/dist/errors/module.error.js +6 -0
  40. package/dist/errors/module.error.js.map +1 -1
  41. package/dist/errors/node.error.d.ts +56 -0
  42. package/dist/errors/node.error.js +56 -0
  43. package/dist/errors/node.error.js.map +1 -1
  44. package/dist/errors/schema.error.d.ts +14 -1
  45. package/dist/errors/schema.error.js +11 -1
  46. package/dist/errors/schema.error.js.map +1 -1
  47. package/dist/errors/terraform.error.d.ts +20 -0
  48. package/dist/errors/terraform.error.js +24 -0
  49. package/dist/errors/terraform.error.js.map +1 -0
  50. package/dist/errors/transaction.error.d.ts +93 -2
  51. package/dist/errors/transaction.error.js +83 -0
  52. package/dist/errors/transaction.error.js.map +1 -1
  53. package/dist/events/action.event.d.ts +8 -4
  54. package/dist/events/action.event.js +2 -4
  55. package/dist/events/action.event.js.map +1 -1
  56. package/dist/events/command.event.d.ts +43 -0
  57. package/dist/events/command.event.js +33 -0
  58. package/dist/events/command.event.js.map +1 -0
  59. package/dist/events/event.model.d.ts +26 -8
  60. package/dist/events/event.model.js +15 -7
  61. package/dist/events/event.model.js.map +1 -1
  62. package/dist/events/hook/commit.hook.event.d.ts +1 -7
  63. package/dist/events/hook/commit.hook.event.js +0 -6
  64. package/dist/events/hook/commit.hook.event.js.map +1 -1
  65. package/dist/events/hook/hook.event.d.ts +1 -3
  66. package/dist/events/hook/hook.event.js +0 -2
  67. package/dist/events/hook/hook.event.js.map +1 -1
  68. package/dist/events/hook/model.hook.event.d.ts +1 -7
  69. package/dist/events/hook/model.hook.event.js +0 -6
  70. package/dist/events/hook/model.hook.event.js.map +1 -1
  71. package/dist/events/hook/resource.hook.event.d.ts +1 -7
  72. package/dist/events/hook/resource.hook.event.js +0 -6
  73. package/dist/events/hook/resource.hook.event.js.map +1 -1
  74. package/dist/events/index.d.ts +5 -0
  75. package/dist/events/index.js +5 -0
  76. package/dist/events/index.js.map +1 -1
  77. package/dist/events/mode-result.event.d.ts +57 -0
  78. package/dist/events/mode-result.event.js +24 -0
  79. package/dist/events/mode-result.event.js.map +1 -0
  80. package/dist/events/mode.event.d.ts +61 -0
  81. package/dist/events/mode.event.js +32 -0
  82. package/dist/events/mode.event.js.map +1 -0
  83. package/dist/events/module.event.d.ts +7 -5
  84. package/dist/events/module.event.js +3 -4
  85. package/dist/events/module.event.js.map +1 -1
  86. package/dist/events/registration.event.d.ts +19 -15
  87. package/dist/events/registration.event.js +18 -14
  88. package/dist/events/registration.event.js.map +1 -1
  89. package/dist/events/serialization.event.d.ts +16 -13
  90. package/dist/events/serialization.event.js +15 -12
  91. package/dist/events/serialization.event.js.map +1 -1
  92. package/dist/events/state.event.d.ts +102 -0
  93. package/dist/events/state.event.js +69 -0
  94. package/dist/events/state.event.js.map +1 -0
  95. package/dist/events/terraform.event.d.ts +78 -0
  96. package/dist/events/terraform.event.js +55 -0
  97. package/dist/events/terraform.event.js.map +1 -0
  98. package/dist/events/transaction.event.d.ts +3 -40
  99. package/dist/events/transaction.event.js +1 -29
  100. package/dist/events/transaction.event.js.map +1 -1
  101. package/dist/functions/container/container.d.ts +54 -13
  102. package/dist/functions/container/container.js +64 -19
  103. package/dist/functions/container/container.js.map +1 -1
  104. package/dist/functions/container/test-container.d.ts +43 -29
  105. package/dist/functions/container/test-container.js +71 -43
  106. package/dist/functions/container/test-container.js.map +1 -1
  107. package/dist/functions/dependency/dependency.d.ts +84 -23
  108. package/dist/functions/dependency/dependency.js +84 -14
  109. package/dist/functions/dependency/dependency.js.map +1 -1
  110. package/dist/functions/diff/aggregate-resource-actions.d.ts +19 -0
  111. package/dist/functions/diff/aggregate-resource-actions.js +41 -0
  112. package/dist/functions/diff/aggregate-resource-actions.js.map +1 -0
  113. package/dist/functions/diff/diff-metadata.d.ts +21 -3
  114. package/dist/functions/diff/diff-metadata.js +18 -0
  115. package/dist/functions/diff/diff-metadata.js.map +1 -1
  116. package/dist/functions/diff/diff.d.ts +68 -7
  117. package/dist/functions/diff/diff.js +44 -3
  118. package/dist/functions/diff/diff.js.map +1 -1
  119. package/dist/functions/hook/commit.hook.d.ts +16 -1
  120. package/dist/functions/hook/commit.hook.js +21 -6
  121. package/dist/functions/hook/commit.hook.js.map +1 -1
  122. package/dist/functions/hook/model-action.hook.d.ts +16 -1
  123. package/dist/functions/hook/model-action.hook.js +21 -6
  124. package/dist/functions/hook/model-action.hook.js.map +1 -1
  125. package/dist/functions/hook/resource-action.hook.d.ts +16 -1
  126. package/dist/functions/hook/resource-action.hook.js +21 -6
  127. package/dist/functions/hook/resource-action.hook.js.map +1 -1
  128. package/dist/functions/node/node-action.abstract.d.ts +23 -2
  129. package/dist/functions/node/node-action.abstract.js +22 -8
  130. package/dist/functions/node/node-action.abstract.js.map +1 -1
  131. package/dist/functions/node/node.abstract.d.ts +56 -5
  132. package/dist/functions/node/node.abstract.js +106 -22
  133. package/dist/functions/node/node.abstract.js.map +1 -1
  134. package/dist/functions/node/node.interface.d.ts +3 -1
  135. package/dist/functions/schema/schema.d.ts +7 -0
  136. package/dist/functions/schema/schema.js +10 -1
  137. package/dist/functions/schema/schema.js.map +1 -1
  138. package/dist/index.d.ts +12 -6
  139. package/dist/index.js +9 -4
  140. package/dist/index.js.map +1 -1
  141. package/dist/index.type.d.ts +5 -0
  142. package/dist/index.type.js +2 -0
  143. package/dist/index.type.js.map +1 -0
  144. package/dist/main.d.ts +245 -14
  145. package/dist/main.js +377 -72
  146. package/dist/main.js.map +1 -1
  147. package/dist/models/account/account.model.d.ts +43 -7
  148. package/dist/models/account/account.model.js +56 -8
  149. package/dist/models/account/account.model.js.map +1 -1
  150. package/dist/models/account/account.schema.d.ts +13 -1
  151. package/dist/models/account/account.schema.js +12 -0
  152. package/dist/models/account/account.schema.js.map +1 -1
  153. package/dist/models/app/app.model.d.ts +13 -8
  154. package/dist/models/app/app.model.js +17 -32
  155. package/dist/models/app/app.model.js.map +1 -1
  156. package/dist/models/app/app.schema.d.ts +6 -0
  157. package/dist/models/app/app.schema.js +6 -0
  158. package/dist/models/app/app.schema.js.map +1 -1
  159. package/dist/models/deployment/deployment.model.d.ts +13 -1
  160. package/dist/models/deployment/deployment.model.js +16 -4
  161. package/dist/models/deployment/deployment.model.js.map +1 -1
  162. package/dist/models/deployment/deployment.schema.d.ts +6 -0
  163. package/dist/models/deployment/deployment.schema.js +6 -0
  164. package/dist/models/deployment/deployment.schema.js.map +1 -1
  165. package/dist/models/environment/environment.model.d.ts +15 -3
  166. package/dist/models/environment/environment.model.js +22 -10
  167. package/dist/models/environment/environment.model.js.map +1 -1
  168. package/dist/models/environment/environment.schema.d.ts +2 -0
  169. package/dist/models/environment/environment.schema.js +2 -0
  170. package/dist/models/environment/environment.schema.js.map +1 -1
  171. package/dist/models/execution/execution.model.d.ts +21 -3
  172. package/dist/models/execution/execution.model.js +47 -29
  173. package/dist/models/execution/execution.model.js.map +1 -1
  174. package/dist/models/execution/execution.schema.d.ts +11 -0
  175. package/dist/models/execution/execution.schema.js +11 -0
  176. package/dist/models/execution/execution.schema.js.map +1 -1
  177. package/dist/models/filesystem/filesystem.model.d.ts +27 -1
  178. package/dist/models/filesystem/filesystem.model.js +30 -4
  179. package/dist/models/filesystem/filesystem.model.js.map +1 -1
  180. package/dist/models/filesystem/filesystem.schema.d.ts +5 -0
  181. package/dist/models/filesystem/filesystem.schema.js +5 -0
  182. package/dist/models/filesystem/filesystem.schema.js.map +1 -1
  183. package/dist/models/image/image.model.d.ts +19 -5
  184. package/dist/models/image/image.model.js +25 -11
  185. package/dist/models/image/image.model.js.map +1 -1
  186. package/dist/models/image/image.schema.d.ts +8 -0
  187. package/dist/models/image/image.schema.js +8 -0
  188. package/dist/models/image/image.schema.js.map +1 -1
  189. package/dist/models/model-action.interface.d.ts +17 -4
  190. package/dist/models/model.abstract.d.ts +96 -1
  191. package/dist/models/model.abstract.js +107 -8
  192. package/dist/models/model.abstract.js.map +1 -1
  193. package/dist/models/model.interface.d.ts +3 -0
  194. package/dist/models/pipeline/pipeline.model.d.ts +14 -2
  195. package/dist/models/pipeline/pipeline.model.js +19 -7
  196. package/dist/models/pipeline/pipeline.model.js.map +1 -1
  197. package/dist/models/pipeline/pipeline.schema.d.ts +8 -0
  198. package/dist/models/pipeline/pipeline.schema.js +8 -0
  199. package/dist/models/pipeline/pipeline.schema.js.map +1 -1
  200. package/dist/models/region/region.model.d.ts +16 -1
  201. package/dist/models/region/region.model.js +19 -4
  202. package/dist/models/region/region.model.js.map +1 -1
  203. package/dist/models/region/region.schema.d.ts +6 -0
  204. package/dist/models/region/region.schema.js +6 -0
  205. package/dist/models/region/region.schema.js.map +1 -1
  206. package/dist/models/server/server.model.d.ts +15 -3
  207. package/dist/models/server/server.model.js +18 -6
  208. package/dist/models/server/server.model.js.map +1 -1
  209. package/dist/models/server/server.schema.d.ts +3 -1
  210. package/dist/models/server/server.schema.js +3 -1
  211. package/dist/models/server/server.schema.js.map +1 -1
  212. package/dist/models/service/service.model.d.ts +37 -6
  213. package/dist/models/service/service.model.js +65 -11
  214. package/dist/models/service/service.model.js.map +1 -1
  215. package/dist/models/service/service.schema.d.ts +48 -1
  216. package/dist/models/service/service.schema.js +56 -1
  217. package/dist/models/service/service.schema.js.map +1 -1
  218. package/dist/models/subnet/subnet.model.d.ts +27 -3
  219. package/dist/models/subnet/subnet.model.js +40 -16
  220. package/dist/models/subnet/subnet.model.js.map +1 -1
  221. package/dist/models/subnet/subnet.schema.d.ts +9 -0
  222. package/dist/models/subnet/subnet.schema.js +9 -0
  223. package/dist/models/subnet/subnet.schema.js.map +1 -1
  224. package/dist/modes/apply-transaction.d.ts +23 -0
  225. package/dist/modes/apply-transaction.js +25 -0
  226. package/dist/modes/apply-transaction.js.map +1 -0
  227. package/dist/modes/commit.mode.d.ts +54 -0
  228. package/dist/modes/commit.mode.js +235 -0
  229. package/dist/modes/commit.mode.js.map +1 -0
  230. package/dist/modes/generate.mode.d.ts +30 -0
  231. package/dist/modes/generate.mode.js +50 -0
  232. package/dist/modes/generate.mode.js.map +1 -0
  233. package/dist/modes/run-action.mode.d.ts +30 -0
  234. package/dist/modes/run-action.mode.js +140 -0
  235. package/dist/modes/run-action.mode.js.map +1 -0
  236. package/dist/modes/validate.mode.d.ts +186 -0
  237. package/dist/modes/validate.mode.js +558 -0
  238. package/dist/modes/validate.mode.js.map +1 -0
  239. package/dist/modules/module.abstract.d.ts +51 -0
  240. package/dist/modules/module.abstract.js +36 -0
  241. package/dist/modules/module.abstract.js.map +1 -1
  242. package/dist/modules/module.container.d.ts +43 -1
  243. package/dist/modules/module.container.js +77 -5
  244. package/dist/modules/module.container.js.map +1 -1
  245. package/dist/modules/test-module.container.d.ts +139 -25
  246. package/dist/modules/test-module.container.js +383 -199
  247. package/dist/modules/test-module.container.js.map +1 -1
  248. package/dist/overlays/anchor.abstract.d.ts +32 -1
  249. package/dist/overlays/anchor.abstract.js +42 -11
  250. package/dist/overlays/anchor.abstract.js.map +1 -1
  251. package/dist/overlays/anchor.schema.d.ts +21 -0
  252. package/dist/overlays/anchor.schema.js +21 -0
  253. package/dist/overlays/anchor.schema.js.map +1 -1
  254. package/dist/overlays/overlay-data.repository.d.ts +18 -0
  255. package/dist/overlays/overlay-data.repository.js +18 -0
  256. package/dist/overlays/overlay-data.repository.js.map +1 -1
  257. package/dist/overlays/overlay.abstract.d.ts +56 -1
  258. package/dist/overlays/overlay.abstract.js +79 -20
  259. package/dist/overlays/overlay.abstract.js.map +1 -1
  260. package/dist/overlays/overlay.schema.d.ts +20 -0
  261. package/dist/overlays/overlay.schema.js +20 -0
  262. package/dist/overlays/overlay.schema.js.map +1 -1
  263. package/dist/resources/resource-action.interface.d.ts +29 -3
  264. package/dist/resources/resource-data.repository.d.ts +63 -1
  265. package/dist/resources/resource-data.repository.js +94 -4
  266. package/dist/resources/resource-data.repository.js.map +1 -1
  267. package/dist/resources/resource.abstract.d.ts +163 -6
  268. package/dist/resources/resource.abstract.js +223 -59
  269. package/dist/resources/resource.abstract.js.map +1 -1
  270. package/dist/resources/resource.interface.d.ts +0 -2
  271. package/dist/resources/resource.schema.d.ts +39 -1
  272. package/dist/resources/resource.schema.js +38 -0
  273. package/dist/resources/resource.schema.js.map +1 -1
  274. package/dist/resources/terraform-resource.abstract.d.ts +44 -0
  275. package/dist/resources/terraform-resource.abstract.js +45 -0
  276. package/dist/resources/terraform-resource.abstract.js.map +1 -0
  277. package/dist/services/event/event.service.d.ts +32 -5
  278. package/dist/services/event/event.service.js +58 -16
  279. package/dist/services/event/event.service.js.map +1 -1
  280. package/dist/services/input/input.service.d.ts +82 -5
  281. package/dist/services/input/input.service.js +143 -12
  282. package/dist/services/input/input.service.js.map +1 -1
  283. package/dist/services/schema-translation/schema-translation.service.d.ts +9 -0
  284. package/dist/services/schema-translation/schema-translation.service.js +9 -0
  285. package/dist/services/schema-translation/schema-translation.service.js.map +1 -1
  286. package/dist/services/serialization/model/model-serialization.service.d.ts +25 -3
  287. package/dist/services/serialization/model/model-serialization.service.js +113 -62
  288. package/dist/services/serialization/model/model-serialization.service.js.map +1 -1
  289. package/dist/services/serialization/resource/resource-serialization.service.d.ts +36 -6
  290. package/dist/services/serialization/resource/resource-serialization.service.js +77 -28
  291. package/dist/services/serialization/resource/resource-serialization.service.js.map +1 -1
  292. package/dist/services/state-management/local.state-provider.d.ts +67 -4
  293. package/dist/services/state-management/local.state-provider.js +168 -41
  294. package/dist/services/state-management/local.state-provider.js.map +1 -1
  295. package/dist/services/state-management/remote.state-provider.d.ts +216 -0
  296. package/dist/services/state-management/remote.state-provider.js +645 -0
  297. package/dist/services/state-management/remote.state-provider.js.map +1 -0
  298. package/dist/services/state-management/state-management.service.d.ts +195 -17
  299. package/dist/services/state-management/state-management.service.js +259 -10
  300. package/dist/services/state-management/state-management.service.js.map +1 -1
  301. package/dist/services/state-management/state-provider.interface.d.ts +98 -3
  302. package/dist/services/state-management/state-provider.interface.js +14 -1
  303. package/dist/services/state-management/state-provider.interface.js.map +1 -1
  304. package/dist/services/state-management/terraform-state.service.d.ts +99 -0
  305. package/dist/services/state-management/terraform-state.service.js +197 -0
  306. package/dist/services/state-management/terraform-state.service.js.map +1 -0
  307. package/dist/services/state-management/test.state-provider.d.ts +42 -4
  308. package/dist/services/state-management/test.state-provider.js +77 -25
  309. package/dist/services/state-management/test.state-provider.js.map +1 -1
  310. package/dist/services/terraform/terraform.service.d.ts +480 -0
  311. package/dist/services/terraform/terraform.service.js +1082 -0
  312. package/dist/services/terraform/terraform.service.js.map +1 -0
  313. package/dist/services/terraform/terraform.type.d.ts +387 -0
  314. package/dist/services/terraform/terraform.type.js +579 -0
  315. package/dist/services/terraform/terraform.type.js.map +1 -0
  316. package/dist/services/transaction/transaction.service.d.ts +110 -10
  317. package/dist/services/transaction/transaction.service.js +570 -251
  318. package/dist/services/transaction/transaction.service.js.map +1 -1
  319. package/dist/services/validation/validation.service.d.ts +15 -3
  320. package/dist/services/validation/validation.service.js +12 -0
  321. package/dist/services/validation/validation.service.js.map +1 -1
  322. package/dist/utilities/array/array.utility.d.ts +3 -0
  323. package/dist/utilities/array/array.utility.js +3 -0
  324. package/dist/utilities/array/array.utility.js.map +1 -1
  325. package/dist/{functions → utilities}/diff/diff.utility.d.ts +19 -3
  326. package/dist/{functions → utilities}/diff/diff.utility.js +57 -41
  327. package/dist/utilities/diff/diff.utility.js.map +1 -0
  328. package/dist/utilities/file/file.utility.d.ts +16 -2
  329. package/dist/utilities/file/file.utility.js +23 -61
  330. package/dist/utilities/file/file.utility.js.map +1 -1
  331. package/dist/utilities/hcl/hcl.utility.d.ts +128 -0
  332. package/dist/utilities/hcl/hcl.utility.js +402 -0
  333. package/dist/utilities/hcl/hcl.utility.js.map +1 -0
  334. package/dist/utilities/http/http.utility.d.ts +57 -0
  335. package/dist/utilities/http/http.utility.js +98 -0
  336. package/dist/utilities/http/http.utility.js.map +1 -0
  337. package/dist/utilities/node/node.utility.d.ts +3 -0
  338. package/dist/utilities/node/node.utility.js +3 -0
  339. package/dist/utilities/node/node.utility.js.map +1 -1
  340. package/dist/utilities/object/object.utility.d.ts +12 -0
  341. package/dist/utilities/object/object.utility.js +12 -0
  342. package/dist/utilities/object/object.utility.js.map +1 -1
  343. package/dist/utilities/project/project.utility.d.ts +28 -0
  344. package/dist/utilities/project/project.utility.js +35 -0
  345. package/dist/utilities/project/project.utility.js.map +1 -0
  346. package/dist/utilities/string/string.utility.d.ts +41 -0
  347. package/dist/utilities/string/string.utility.js +65 -0
  348. package/dist/utilities/string/string.utility.js.map +1 -0
  349. package/dist/utilities/terraform/terraform.utility.d.ts +276 -0
  350. package/dist/utilities/terraform/terraform.utility.js +623 -0
  351. package/dist/utilities/terraform/terraform.utility.js.map +1 -0
  352. package/dist/utilities/test-helpers/test-classes.d.ts +36 -30
  353. package/dist/utilities/test-helpers/test-classes.js +38 -39
  354. package/dist/utilities/test-helpers/test-classes.js.map +1 -1
  355. package/dist/utilities/test-helpers/test-models.d.ts +8 -1
  356. package/dist/utilities/test-helpers/test-models.js +37 -12
  357. package/dist/utilities/test-helpers/test-models.js.map +1 -1
  358. package/dist/utilities/test-helpers/test-modes.d.ts +315 -0
  359. package/dist/utilities/test-helpers/test-modes.js +486 -0
  360. package/dist/utilities/test-helpers/test-modes.js.map +1 -0
  361. package/dist/utilities/test-helpers/test-modules.d.ts +47 -0
  362. package/dist/utilities/test-helpers/test-modules.js +85 -0
  363. package/dist/utilities/test-helpers/test-modules.js.map +1 -0
  364. package/dist/utilities/test-helpers/test-overlays.d.ts +20 -2
  365. package/dist/utilities/test-helpers/test-overlays.js +56 -6
  366. package/dist/utilities/test-helpers/test-overlays.js.map +1 -1
  367. package/dist/utilities/test-helpers/test-resources.d.ts +23 -3
  368. package/dist/utilities/test-helpers/test-resources.js +83 -23
  369. package/dist/utilities/test-helpers/test-resources.js.map +1 -1
  370. package/dist/utilities/validation/validation.utility.d.ts +24 -0
  371. package/dist/utilities/validation/validation.utility.js +24 -0
  372. package/dist/utilities/validation/validation.utility.js.map +1 -1
  373. package/package.json +12 -6
  374. package/dist/functions/diff/diff.utility.js.map +0 -1
  375. package/dist/services/capture/capture.service.d.ts +0 -19
  376. package/dist/services/capture/capture.service.js +0 -43
  377. package/dist/services/capture/capture.service.js.map +0 -1
  378. package/dist/services/state-management/local-encryption.state-provider.d.ts +0 -20
  379. package/dist/services/state-management/local-encryption.state-provider.js +0 -90
  380. package/dist/services/state-management/local-encryption.state-provider.js.map +0 -1
  381. package/dist/utilities/cidr/cidr.utility.d.ts +0 -10
  382. package/dist/utilities/cidr/cidr.utility.js +0 -51
  383. package/dist/utilities/cidr/cidr.utility.js.map +0 -1
package/dist/app.type.js CHANGED
@@ -1,48 +1,96 @@
1
1
  /* Classes */
2
2
  /**
3
+ * An anchor found by schema, paired with the translation needed to read it as that schema.
4
+ *
5
+ * {@link AModel.getAnchorsMatchingSchema} returns these rather than raw anchors: the anchor you
6
+ * matched may have been declared against a different version of the schema, and this is what keeps
7
+ * that difference out of your module. Read it with `getSchemaInstance()`.
8
+ *
3
9
  * @group Types
4
10
  */
5
11
  export class MatchingAnchor {
12
+ /**
13
+ * @param actual The anchor that was matched.
14
+ * @param schemaTranslator Reads `actual` as the matched schema, when the two differ.
15
+ */
6
16
  constructor(actual, schemaTranslator) {
7
17
  this.actual = actual;
8
18
  this.schemaTranslator = schemaTranslator;
9
19
  }
10
- hasSchemaTranslator() {
11
- return !!this.schemaTranslator;
12
- }
20
+ /**
21
+ * The anchor itself, with its properties hidden - read those through
22
+ * {@link MatchingAnchor.getSchemaInstance}.
23
+ */
13
24
  getActual() {
14
25
  return this.actual;
15
26
  }
27
+ /**
28
+ * The anchor read as the schema you matched on.
29
+ */
16
30
  getSchemaInstance() {
17
31
  return this.hasSchemaTranslator() ? this.schemaTranslator(this.actual.synth()) : this.actual.synth();
18
32
  }
33
+ /**
34
+ * Whether the match went through a schema translation.
35
+ */
36
+ hasSchemaTranslator() {
37
+ return !!this.schemaTranslator;
38
+ }
19
39
  }
20
40
  /**
41
+ * A model found by schema. See {@link MatchingAnchor}.
42
+ *
21
43
  * @group Types
22
44
  */
23
45
  export class MatchingModel {
46
+ /**
47
+ * @param actual The model that was matched.
48
+ * @param schemaTranslator Reads `actual` as the matched schema, when the two differ.
49
+ */
24
50
  constructor(actual, schemaTranslator) {
25
51
  this.actual = actual;
26
52
  this.schemaTranslator = schemaTranslator;
27
53
  }
28
- hasSchemaTranslator() {
29
- return !!this.schemaTranslator;
30
- }
54
+ /**
55
+ * The model itself, with its schema hidden - read it through
56
+ * {@link MatchingModel.getSchemaInstance}.
57
+ */
31
58
  getActual() {
32
59
  return this.actual;
33
60
  }
61
+ /**
62
+ * The model read as the schema you matched on.
63
+ */
34
64
  getSchemaInstance() {
35
65
  return this.hasSchemaTranslator() ? this.schemaTranslator(this.actual.synth()) : this.actual.synth();
36
66
  }
67
+ /**
68
+ * Whether the match went through a schema translation.
69
+ */
70
+ hasSchemaTranslator() {
71
+ return !!this.schemaTranslator;
72
+ }
37
73
  }
38
74
  /**
75
+ * A resource found by schema. See {@link MatchingAnchor}.
76
+ *
77
+ * Pass one wherever a resource parent is expected, and the translation is carried into the graph, so
78
+ * the child keeps reading its parent through the schema it was written against.
79
+ *
39
80
  * @group Types
40
81
  */
41
82
  export class MatchingResource {
83
+ /**
84
+ * @param actual The resource that was matched.
85
+ * @param schemaTranslator Reads `actual` as the matched schema, when the two differ.
86
+ */
42
87
  constructor(actual, schemaTranslator) {
43
88
  this.actual = actual;
44
89
  this.schemaTranslator = schemaTranslator;
45
90
  }
91
+ /**
92
+ * @internal
93
+ */
46
94
  addChild(...args) {
47
95
  const results = this.actual.addChild(...args);
48
96
  if (!(args[1].parents[args[1].parents.length - 1] instanceof MatchingResource) &&
@@ -52,18 +100,32 @@ export class MatchingResource {
52
100
  }
53
101
  return results;
54
102
  }
55
- hasSchemaTranslator() {
56
- return !!this.schemaTranslator;
57
- }
103
+ /**
104
+ * The resource itself, with its schema hidden - read it through
105
+ * {@link MatchingResource.getSchemaInstance}.
106
+ */
58
107
  getActual() {
59
108
  return this.actual;
60
109
  }
110
+ /**
111
+ * The resource read as the schema you matched on.
112
+ */
61
113
  getSchemaInstance() {
62
114
  return this.hasSchemaTranslator() ? this.schemaTranslator(this.actual.synth()) : this.actual.synth();
63
115
  }
116
+ /**
117
+ * The resource read as the schema you matched on, with its `response` typed as fully populated.
118
+ * Only call it from a resource action, where the parent is guaranteed to already exist.
119
+ */
64
120
  getSchemaInstanceInResourceAction() {
65
121
  return this.getSchemaInstance();
66
122
  }
123
+ /**
124
+ * Whether the match went through a schema translation.
125
+ */
126
+ hasSchemaTranslator() {
127
+ return !!this.schemaTranslator;
128
+ }
67
129
  }
68
130
  /* Enumerations */
69
131
  /**
@@ -91,12 +153,21 @@ export var ValidationType;
91
153
  })(ValidationType || (ValidationType = {}));
92
154
  /* Functions */
93
155
  /**
156
+ * Whether a node was registered under the given name, e.g. `region`.
157
+ *
158
+ * Use it to identify a base model without importing the subclass that implements it.
159
+ *
94
160
  * @group Types
95
161
  */
96
162
  export function hasNodeName(node, nodeName) {
97
163
  return node.constructor.NODE_NAME === nodeName;
98
164
  }
99
165
  /**
166
+ * Marks a placeholder value that a later step fills in - typically a resource property whose real
167
+ * value is only known once the infrastructure exists.
168
+ *
169
+ * It is a type assertion and nothing more; it emits the string you give it.
170
+ *
100
171
  * @group Types
101
172
  */
102
173
  export function stub(value) {
@@ -1 +1 @@
1
- {"version":3,"file":"app.type.js","sourceRoot":"","sources":["../src/app.type.ts"],"names":[],"mappings":"AAeA,aAAa;AAEb;;GAEG;AACH,MAAM,OAAO,cAAc;IACzB,YACmB,MAAuB,EACvB,gBAAoC;QADpC,WAAM,GAAN,MAAM,CAAiB;QACvB,qBAAgB,GAAhB,gBAAgB,CAAoB;IACpD,CAAC;IAEJ,mBAAmB;QACjB,OAAO,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAA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C,iBAAiB,EAA4E,CAAC;IAC5G,CAAC;IAED;;OAEG;IACH,mBAAmB;QACjB,OAAO,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;CACF;AAED,kBAAkB;AAElB;;GAEG;AACH,MAAM,CAAN,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,2BAAe,CAAA;IACf,+BAAmB,CAAA;IACnB,iCAAqB,CAAA;AACvB,CAAC,EAJW,QAAQ,KAAR,QAAQ,QAInB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cASX;AATD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,sCAAoB,CAAA;IACpB,0CAAwB,CAAA;IACxB,4CAA0B,CAAA;IAC1B,wCAAsB,CAAA;IACtB,0CAAwB,CAAA;IACxB,0CAAwB,CAAA;IACxB,iCAAe,CAAA;AACjB,CAAC,EATW,cAAc,KAAd,cAAc,QASzB;AAgBD,eAAe;AAEf;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,IAAiB,EAAE,QAAgB;IAC7D,OAAQ,IAAI,CAAC,WAA4B,CAAC,SAAS,KAAK,QAAQ,CAAC;AACnE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,IAAI,CAAI,KAAa;IACnC,OAAO,KAAU,CAAC;AACpB,CAAC"}
@@ -1,14 +1,18 @@
1
1
  import type { Constructable, UnknownNode } from '../app.type.js';
2
2
  /**
3
- * An `@Action` is a class decorator to be placed on top of a class that represents an action of one of ModelType.
4
- * - A NodeType.MODEL action must implement the {@link IModelAction} interface.
5
- * - A NodeType.OVERLAY action must implement the {@link IModelAction} interface.
6
- * - A NodeType.RESOURCE action must implement the {@link IResourceAction} interface.
3
+ * An `@Action` is a class decorator to be placed on top of a class that reacts to a change in the node it is
4
+ * declared for. Octo diffs your infrastructure on every run, and invokes the actions whose node changed.
5
+ *
6
+ * The interface the action implements is determined by the node it is declared for.
7
+ * - An action for a model or an overlay implements {@link IModelAction}, and produces resources.
8
+ * - An action for a resource implements {@link IResourceAction}, and talks to the cloud provider.
9
+ *
10
+ * The decorated class is resolved through the {@link Container}, so it must have a registered {@link Factory}.
7
11
  *
8
12
  * @example
9
13
  * ```ts
10
- * @Action(MyModelClass)
11
- * export class MyModelAction implements IModelAction { ... }
14
+ * @Action(MyModel)
15
+ * export class AddMyModelAction implements IModelAction<MyModule> { ... }
12
16
  * ```
13
17
  * @group Decorators
14
18
  * @param forNode The class of node for which this action is being declared.
@@ -5,25 +5,38 @@ import { AModel } from '../models/model.abstract.js';
5
5
  import { AOverlay } from '../overlays/overlay.abstract.js';
6
6
  import { AResource } from '../resources/resource.abstract.js';
7
7
  import { TransactionService } from '../services/transaction/transaction.service.js';
8
+ /**
9
+ * @internal
10
+ */
8
11
  function isModel(nodeClass) {
9
12
  return nodeClass.prototype instanceof AModel;
10
13
  }
14
+ /**
15
+ * @internal
16
+ */
11
17
  function isOverlay(nodeClass) {
12
18
  return nodeClass.prototype instanceof AOverlay;
13
19
  }
20
+ /**
21
+ * @internal
22
+ */
14
23
  function isResource(nodeClass) {
15
24
  return nodeClass.prototype instanceof AResource;
16
25
  }
17
26
  /**
18
- * An `@Action` is a class decorator to be placed on top of a class that represents an action of one of ModelType.
19
- * - A NodeType.MODEL action must implement the {@link IModelAction} interface.
20
- * - A NodeType.OVERLAY action must implement the {@link IModelAction} interface.
21
- * - A NodeType.RESOURCE action must implement the {@link IResourceAction} interface.
27
+ * An `@Action` is a class decorator to be placed on top of a class that reacts to a change in the node it is
28
+ * declared for. Octo diffs your infrastructure on every run, and invokes the actions whose node changed.
29
+ *
30
+ * The interface the action implements is determined by the node it is declared for.
31
+ * - An action for a model or an overlay implements {@link IModelAction}, and produces resources.
32
+ * - An action for a resource implements {@link IResourceAction}, and talks to the cloud provider.
33
+ *
34
+ * The decorated class is resolved through the {@link Container}, so it must have a registered {@link Factory}.
22
35
  *
23
36
  * @example
24
37
  * ```ts
25
- * @Action(MyModelClass)
26
- * export class MyModelAction implements IModelAction { ... }
38
+ * @Action(MyModel)
39
+ * export class AddMyModelAction implements IModelAction<MyModule> { ... }
27
40
  * ```
28
41
  * @group Decorators
29
42
  * @param forNode The class of node for which this action is being declared.
@@ -1 +1 @@
1
- {"version":3,"file":"action.decorator.js","sourceRoot":"","sources":["../../src/decorators/action.decorator.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAEpF,SAAS,OAAO,CAAC,SAAqC;IACpD,OAAO,SAAS,CAAC,SAAS,YAAY,MAAM,CAAC;AAC/C,CAAC;AAED,SAAS,SAAS,CAAC,SAAqC;IACtD,OAAO,SAAS,CAAC,SAAS,YAAY,QAAQ,CAAC;AACjD,CAAC;AAED,SAAS,UAAU,CAAC,SAAqC;IACvD,OAAO,SAAS,CAAC,SAAS,YAAY,SAAS,CAAC;AAClD,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,MAAM,CAAwB,OAAyB;IACrE,MAAM,SAAS,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;IAE1C,OAAO,UAAU,WAAgB;QAC/B,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,kBAAkB,EAAE,EAAE;YAClF,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC5C,yBAAyB;gBACzB,MAAM,WAAW,GAAG,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CAAC;YACvD,CAAC;iBAAM,IAAI,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC9B,2BAA2B;gBAC3B,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,GAAG,CAAsB,WAAW,CAAC,IAAI,CAAC,CAAC;gBAC/E,kBAAkB,CAAC,sBAAsB,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;gBAElE,kCAAkC;gBAClC,eAAe,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;YACvD,CAAC;iBAAM,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC/B,4BAA4B;gBAC5B,MAAM,cAAc,GAAG,MAAM,SAAS,CAAC,GAAG,CAAyB,WAAW,CAAC,IAAI,CAAC,CAAC;gBACrF,kBAAkB,CAAC,uBAAuB,CAAC,OAAO,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;gBAEtE,mCAAmC;gBACnC,kBAAkB,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;YAC7D,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,UAAU,OAAO,CAAC,IAAI,2CAA2C,CAAC,CAAC;YACrF,CAAC;QACH,CAAC,CAAC,CAAC;QACH,SAAS,CAAC,+BAA+B,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC,CAAC;AACJ,CAAC"}
@@ -1,14 +1,21 @@
1
1
  /**
2
- * An `@Anchor` is a class decorator to be placed on top of a class that represents an anchor.
3
- * - An anchor must extend the {@link AAnchor} class.
2
+ * An `@Anchor` is a class decorator and must be placed on top of a class representing an anchor.
3
+ * - An anchor must also extend the {@link AAnchor} class.
4
4
  *
5
5
  * @example
6
6
  * ```ts
7
- * @Anchor('my-package')
8
- * export class MyAnchor extends AAnchor { ... }
7
+ * @Anchor('@example')
8
+ * export class MyAnchor extends AAnchor<MyAnchorSchema, MyModel> { ... }
9
9
  * ```
10
+ *
10
11
  * @group Decorators
12
+ *
13
+ * @param packageName - The name of the package under which the anchor is registered.
14
+ * Selecting a unique package name helps avoid collisions between same anchor class names across different libraries.
15
+ * You will reuse the same package name throughout your library for different Octo components you create.
16
+ *
11
17
  * @returns The decorated class.
12
- * @see Definition of [Anchors](/docs/fundamentals/overlays).
18
+ *
19
+ * @see Definition of [Anchors](/docs/fundamentals/anchors).
13
20
  */
14
21
  export declare function Anchor(packageName: string): (constructor: any) => void;
@@ -3,17 +3,24 @@ import { AAnchor } from '../overlays/anchor.abstract.js';
3
3
  import { ModelSerializationService } from '../services/serialization/model/model-serialization.service.js';
4
4
  import { ValidationUtility } from '../utilities/validation/validation.utility.js';
5
5
  /**
6
- * An `@Anchor` is a class decorator to be placed on top of a class that represents an anchor.
7
- * - An anchor must extend the {@link AAnchor} class.
6
+ * An `@Anchor` is a class decorator and must be placed on top of a class representing an anchor.
7
+ * - An anchor must also extend the {@link AAnchor} class.
8
8
  *
9
9
  * @example
10
10
  * ```ts
11
- * @Anchor('my-package')
12
- * export class MyAnchor extends AAnchor { ... }
11
+ * @Anchor('@example')
12
+ * export class MyAnchor extends AAnchor<MyAnchorSchema, MyModel> { ... }
13
13
  * ```
14
+ *
14
15
  * @group Decorators
16
+ *
17
+ * @param packageName - The name of the package under which the anchor is registered.
18
+ * Selecting a unique package name helps avoid collisions between same anchor class names across different libraries.
19
+ * You will reuse the same package name throughout your library for different Octo components you create.
20
+ *
15
21
  * @returns The decorated class.
16
- * @see Definition of [Anchors](/docs/fundamentals/overlays).
22
+ *
23
+ * @see Definition of [Anchors](/docs/fundamentals/anchors).
17
24
  */
18
25
  export function Anchor(packageName) {
19
26
  const container = Container.getInstance();
@@ -1 +1 @@
1
- {"version":3,"file":"anchor.decorator.js","sourceRoot":"","sources":["../../src/decorators/anchor.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CA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;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,MAAM,CAAC,WAAmB;IACxC,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,YAAY,GAAG,WAAW,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"}
@@ -16,7 +16,7 @@ type Hook = 'CommitHook';
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 declare function EnableHook(hook: Hook): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
22
22
  export {};
@@ -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"}
@@ -1,4 +1,4 @@
1
- import { type Constructable, type ModelSchema, type UnknownModel } from '../app.type.js';
1
+ import { type Constructable, type ModelName, type ModelSchema, type UnknownModel } from '../app.type.js';
2
2
  /**
3
3
  * A `@Model` is a class decorator and must be placed on top of a class representing a model.
4
4
  * - A model must also extend a base model class.
@@ -15,14 +15,12 @@ import { type Constructable, type ModelSchema, type UnknownModel } from '../app.
15
15
  * @param packageName - The name of the package under which the model is registered.
16
16
  * Selecting a unique package name helps avoid collisions between same model class names across different libraries.
17
17
  * You will reuse the same package name throughout your library for different Octo components you create.
18
- * @param modelName - a string that uniquely represents the base model you are extending.
19
- * Octo provides names for each of the base models, and you must use the same name.
20
- * E.g. for region base model, the model name is `region`.
18
+ * @param modelName - The name of the base model you are extending, e.g. `region` for {@link Region}.
21
19
  * @param schema - The schema of the model.
22
20
  *
23
21
  * @returns The decorated class.
24
22
  *
25
23
  * @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.
24
+ * @see {@link App}, {@link Region}, and {@link Server} for the base models you can extend.
27
25
  */
28
- export declare function Model<T extends UnknownModel>(packageName: string, modelName: string, schema: Constructable<ModelSchema<T>>): (constructor: any) => void;
26
+ export declare function Model<T extends UnknownModel>(packageName: string, modelName: ModelName, schema: Constructable<ModelSchema<T>>): (constructor: any) => void;
@@ -20,15 +20,13 @@ import { ValidationUtility } from '../utilities/validation/validation.utility.js
20
20
  * @param packageName - The name of the package under which the model is registered.
21
21
  * Selecting a unique package name helps avoid collisions between same model class names across different libraries.
22
22
  * You will reuse the same package name throughout your library for different Octo components you create.
23
- * @param modelName - a string that uniquely represents the base model you are extending.
24
- * Octo provides names for each of the base models, and you must use the same name.
25
- * E.g. for region base model, the model name is `region`.
23
+ * @param modelName - The name of the base model you are extending, e.g. `region` for {@link Region}.
26
24
  * @param schema - The schema of the model.
27
25
  *
28
26
  * @returns The decorated class.
29
27
  *
30
28
  * @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.
29
+ * @see {@link App}, {@link Region}, and {@link Server} for the base models you can extend.
32
30
  */
33
31
  export function Model(packageName, modelName, schema) {
34
32
  const container = Container.getInstance();
@@ -36,9 +34,6 @@ export function Model(packageName, modelName, schema) {
36
34
  if (!ValidationUtility.validateRegex(packageName, /^[@A-Za-z][\w-]+[A-Za-z]$/)) {
37
35
  throw new Error(`Invalid package name: ${packageName}`);
38
36
  }
39
- if (!ValidationUtility.validateRegex(modelName, /^[A-Za-z][\w-]+[A-Za-z]$/)) {
40
- throw new Error(`Invalid model name: ${modelName}`);
41
- }
42
37
  if (!(constructor.prototype instanceof AModel) || constructor.prototype instanceof AOverlay) {
43
38
  throw new Error(`Class "${constructor.name}" must extend the AModel class!`);
44
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"model.decorator.js","sourceRoot":"","sources":["../../src/decorators/model.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,QAAQ,EAAqB,MAAM,gBAAgB,CAAC;AACnG,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAC3G,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,KAAK,CACnB,WAAmB,EACnB,SAAiB,EACjB,MAAqC;IAErC,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,iBAAiB,CAAC,aAAa,CAAC,SAAS,EAAE,0BAA0B,CAAC,EAAE,CAAC;YAC5E,MAAM,IAAI,KAAK,CAAC,uBAAuB,SAAS,EAAE,CAAC,CAAC;QACtD,CAAC;QACD,IAAI,CAAC,CAAC,WAAW,CAAC,SAAS,YAAY,MAAM,CAAC,IAAI,WAAW,CAAC,SAAS,YAAY,QAAQ,EAAE,CAAC;YAC5F,MAAM,IAAI,KAAK,CAAC,UAAU,WAAW,CAAC,IAAI,iCAAiC,CAAC,C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AAC;QAC1D,CAAC;QACD,IAAI,CAAC,CAAC,WAAW,CAAC,SAAS,YAAY,MAAM,CAAC,IAAI,WAAW,CAAC,SAAS,YAAY,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,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;