@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
@@ -0,0 +1,480 @@
1
+ import { MatchingResource, type ResourceSchema, type TerraformFolderOutput, type UnknownResource } from '../../app.type.js';
2
+ import type { BaseResourceSchema } from '../../resources/resource.schema.js';
3
+ import { HclExpression, TerraformData, type TerraformLiteralType, TerraformResource, TerraformVariable } from './terraform.type.js';
4
+ /**
5
+ * Mapping of an octo resource to terraform. It is used during:
6
+ * - Validation: (octo diff <-> TF plan comparison).
7
+ * - Commit (tfstate outputs -> response population).
8
+ */
9
+ interface OctoTerraformResourceMapping {
10
+ /**
11
+ * Whether destroying the octo resource loses data, as its class declares.
12
+ */
13
+ destroyLosesData: boolean;
14
+ /**
15
+ * Set for external resources only: the single output carrying the entire response map.
16
+ */
17
+ entireResponseOutput?: string;
18
+ /**
19
+ * The terragrunt folder this octo resource lives in (one folder per octo module).
20
+ */
21
+ moduleId: string;
22
+ /**
23
+ * Per response key, and the name of the output it is published under.
24
+ * Empty array for external resources (see {@link entireResponseOutput}).
25
+ */
26
+ outputMappings: {
27
+ key: string;
28
+ outputName: string;
29
+ }[];
30
+ /**
31
+ * The octo resource context, used during validate to match a TF plan entry back to its octo resource.
32
+ */
33
+ resourceContext: string;
34
+ /**
35
+ * The octo resource's unique id, used to look it up in the registry.
36
+ */
37
+ resourceId: string;
38
+ /**
39
+ * The addresses of every TerraformResource block generated for this octo resource.
40
+ * Used during validate to check the TF plan covers them all.
41
+ */
42
+ terraformAddresses: string[];
43
+ }
44
+ /**
45
+ * One octo resource's slice of the terraform module being generated.
46
+ *
47
+ * Obtained from {@link TerraformModuleScope.addOctoTerraformResource}. Everything you emit through it
48
+ * is attributed to that octo resource, which is how Octo later maps a terraform plan entry, and a
49
+ * terraform output, back to the resource it belongs to.
50
+ *
51
+ * @group Resources
52
+ *
53
+ * @see {@link ATerraformResource} for where this is used.
54
+ */
55
+ export interface OctoTerraformResourceScope<TResponse extends BaseResourceSchema['response'] = BaseResourceSchema['response']> {
56
+ /**
57
+ * Emits one `resource "<type>" "<name>"` block for this octo resource.
58
+ * Multiple calls chain via `depends_on` in call order.
59
+ * The provider alias is applied automatically when the resource was registered with a provider context.
60
+ *
61
+ * Pass `options.chain: false` to keep a block out of the chain: it depends on neither the block
62
+ * before it nor is depended on by the block after it, and waits only on what its attributes
63
+ * reference. Use it for a block emitted once per item, like a file upload, where a chain would run
64
+ * the items one at a time and store every earlier address in each item's terraform state.
65
+ */
66
+ addTerraformResource(type: string, name: string, spec?: Record<string, unknown>, options?: {
67
+ chain?: boolean;
68
+ }): TerraformResource;
69
+ /**
70
+ * Declares the outputs for this resource — one entry per response key.
71
+ * Every response key must be declared; the commit phase reads exactly these outputs to
72
+ * reconstruct the full response.
73
+ */
74
+ output(outputs: Record<keyof TResponse & string, unknown>, options?: {
75
+ sensitiveKeys?: (keyof TResponse & string)[];
76
+ }): void;
77
+ }
78
+ interface TerraformModuleFiles {
79
+ mainTf: string;
80
+ outputsTf: string;
81
+ terragruntHcl: string;
82
+ variablesTf: string;
83
+ }
84
+ /**
85
+ * The terraform module folder a resource writes itself into.
86
+ *
87
+ * Octo hands one to {@link ATerraformResource.toHCL}, scoped to the folder that resource belongs to.
88
+ * It is a small HCL builder: register the octo resource, emit blocks on the scope it returns, and
89
+ * reference other resources through {@link TerraformModuleScope.getRef} rather than by writing
90
+ * addresses by hand - only `getRef` knows whether the producer lands in this folder or another one.
91
+ *
92
+ * @group Resources
93
+ *
94
+ * @see {@link ATerraformResource} for where this is used.
95
+ */
96
+ export interface TerraformModuleScope {
97
+ /**
98
+ * Wraps an octo resource whose lifecycle runs outside Terraform (e.g. a script or SDK call).
99
+ * Generates a `null_resource` + `data "external"` pair that calls `octo run-action`
100
+ * at apply time and exposes the result as outputs.
101
+ */
102
+ addOctoTerraformExternalResource<T extends UnknownResource>(octoResource: T): OctoTerraformResourceScope<ResourceSchema<T>['response']>;
103
+ /**
104
+ * Registers an octo resource as a native Terraform resource. Returns an
105
+ * {@link OctoTerraformResourceScope} on which you call `addTerraformResource()` to emit
106
+ * HCL blocks and `output()` to declare what other resources can reference.
107
+ *
108
+ * - Pass `options.explicitParents` for dependencies that aren't captured by attribute references alone.
109
+ * - Pass `options.provider` to pin the resource to a specific account/region provider.
110
+ */
111
+ addOctoTerraformResource<T extends UnknownResource>(octoResource: T, options?: {
112
+ explicitParents?: (UnknownResource | MatchingResource<BaseResourceSchema>)[];
113
+ provider?: TerraformProviderContext;
114
+ }): OctoTerraformResourceScope<ResourceSchema<T>['response']>;
115
+ /**
116
+ * Emits a `data "<type>" "<name>"` block. Use for read-only data sources that look
117
+ * up existing infrastructure (e.g. `aws_ami`, `aws_caller_identity`).
118
+ */
119
+ addTerraformData(type: string, name: string, spec?: Record<string, unknown>): TerraformData;
120
+ /**
121
+ * Returns the `<providerType>.<alias>` expression for a registered provider.
122
+ * Pass the result as the `provider` attribute when a resource must target a
123
+ * specific account/region different from the module's default.
124
+ */
125
+ getProviderAliasRef(accountId: string, regionId?: string): HclExpression;
126
+ /**
127
+ * Returns a reference to another resource's output that resolves correctly at
128
+ * render time: an inline TF expression when the producer is in the same module,
129
+ * or a `var.*` wired through terragrunt when it is in a different module.
130
+ */
131
+ getRef<T extends UnknownResource>(resource: T, key: keyof ResourceSchema<T>['response'] & string): HclExpression;
132
+ getRef<S extends BaseResourceSchema>(resource: MatchingResource<S>, key: keyof S['response'] & string): HclExpression;
133
+ /**
134
+ * Joins text and references into one quoted terraform string, for when a value is another
135
+ * resource's output with text of this resource's own around it. Each reference resolves as
136
+ * {@link TerraformModuleScope.getRef} does, so a producer in another folder is still wired in.
137
+ *
138
+ * @example
139
+ * ```ts
140
+ * // "https://${var.distribution_DomainName}/api/orders"
141
+ * terraform.interpolate('https://', terraform.getRef(distribution, 'DomainName'), '/api/orders');
142
+ * ```
143
+ */
144
+ interpolate(...parts: (string | HclExpression)[]): HclExpression;
145
+ /**
146
+ * Wraps a value in a `jsonencode(...)` call.
147
+ */
148
+ jsonencode(subject: object | unknown[]): HclExpression;
149
+ /**
150
+ * Returns the HCL for a file on the developer's disk, as a quoted string ready to pass to
151
+ * {@link TerraformModuleScope.raw} or to a terraform function such as `filemd5`.
152
+ *
153
+ * The path renders relative to the octo project root and is joined to `var.OCTO_PROJECT_ROOT` at
154
+ * plan time, so the generated folder holds the same text whichever machine wrote it. Terragrunt
155
+ * runs terraform from a copy of the folder, so a plain relative path would not resolve.
156
+ */
157
+ localPath(filePath: string): string;
158
+ /**
159
+ * Use `mapAttr()` when the provider schema defines a **map/object attribute** (`key = { }`).
160
+ * Use a plain JS object in the resource spec when the schema expects a **block** (`key { }`).
161
+ * The distinction matters: blocks have no `=`. Check the provider docs for each argument.
162
+ */
163
+ mapAttr(value: Record<string, unknown>): HclExpression;
164
+ /**
165
+ * The ID of the octo module this folder was generated for.
166
+ */
167
+ readonly moduleId: string;
168
+ /**
169
+ * Emits a value verbatim as a terraform expression (no quoting).
170
+ */
171
+ raw(value: unknown): HclExpression;
172
+ /**
173
+ * Returns a terraform `type(...)` expression for use in `variable` declarations.
174
+ */
175
+ type(schema: unknown): HclExpression;
176
+ /**
177
+ * Declares a user-supplied input variable for this module. Use when a value must
178
+ * be provided at apply time rather than derived from another resource's output.
179
+ */
180
+ variable(name: string, typeExpression: unknown, options: {
181
+ default: TerraformLiteralType;
182
+ sensitive: boolean;
183
+ }): TerraformVariable;
184
+ }
185
+ /**
186
+ * Every terraform resource requires a deployment target - which provider, account, and region to make the call to.
187
+ * This deployment target is automatically derived using accountId and regionId,
188
+ * rather than developers hard-coding the provider alias.
189
+ */
190
+ interface TerraformProviderContext {
191
+ accountId: string;
192
+ regionId?: string;
193
+ }
194
+ /**
195
+ * Collects what every resource emitted through {@link TerraformModuleScope}, wires the references
196
+ * between module folders, and renders the terragrunt files {@link Octo.generate} writes.
197
+ *
198
+ * @internal
199
+ */
200
+ export declare class TerraformService {
201
+ private readonly octoCommandPrefix;
202
+ private readonly indentLength;
203
+ private minTerraformVersion;
204
+ private readonly modules;
205
+ private readonly pendingExternalResourcesInputWiring;
206
+ private readonly providers;
207
+ private requiredProviders;
208
+ private readonly resourceRegistry;
209
+ private readonly sanitizedResourceIds;
210
+ /**
211
+ * @internal
212
+ */
213
+ private get step();
214
+ /**
215
+ * @internal
216
+ */
217
+ constructor(octoCommandPrefix?: string, indentLength?: number);
218
+ /**
219
+ * Sets the minimum terraform version and the `required_providers` sources/versions that render
220
+ * into every folder's config block (scoped to the providers each folder actually uses).
221
+ */
222
+ addTerraformConfig({ minTerraformVersion, providers, }?: {
223
+ minTerraformVersion?: string;
224
+ providers?: Record<string, {
225
+ minVersion?: string;
226
+ source: string;
227
+ }>;
228
+ }): void;
229
+ /**
230
+ * Registers a Terraform provider block for the given provider type, account, and region.
231
+ *
232
+ * An `aws` provider is also given `allowed_account_ids = [accountId]`, so terraform refuses at plan
233
+ * when the credentials it resolves belong to another account. It is omitted when `accountName` is
234
+ * set (the repository has asked for the id not to appear in committed terraform), when `spec`
235
+ * already carries `allowed_account_ids`, and when `spec` sets `skip_requesting_account_id`, which
236
+ * stops the provider learning the account there is to check.
237
+ *
238
+ * @param providerType - The terraform provider type, e.g. `aws`, `google`.
239
+ * @param accountId - The account/project/subscription ID.
240
+ * @param regionId - The region ID.
241
+ * @param spec - Provider arguments beyond `alias` and `region`.
242
+ * - Primitives become attributes (`key = value`).
243
+ * - Plain objects become blocks (`key { }`).
244
+ * - Wrap with `mapAttr()` when the provider schema expects a map attribute (`key = { }`).
245
+ * @param options - optional provider configurations.
246
+ * - options.accountName - What to call the account in the provider alias, in place of its id.
247
+ * `prod` renders `aws.prod-us-east-1` where the id renders `aws._123456789012-us-east-1`. Two
248
+ * accounts may not share a name within one provider type and region, and the generated terraform
249
+ * is committed, so a name is also how a repository keeps its account number out of it. It also
250
+ * drops the `allowed_account_ids` guard above, which would put that id straight back.
251
+ * - options.setRegionAttribute - Whether to write `region = <regionId>` onto the provider block.
252
+ * Defaults to true, except for the utility providers in {@link REGIONLESS_PROVIDER_TYPES}, which
253
+ * accept no arguments at all and fail the plan outright with
254
+ * `An argument named "region" is not expected here`. Set it explicitly to override either way -
255
+ * a regional provider this list does not know about still needs `false` passed by hand.
256
+ */
257
+ addTerraformProvider(providerType: string, accountId: string, regionId: string, spec?: Record<string, unknown>, { accountName, setRegionAttribute }?: {
258
+ accountName?: string;
259
+ setRegionAttribute?: boolean;
260
+ }): void;
261
+ /**
262
+ * Returns the folder record of the current sweep: one entry per folder-bearing module — a
263
+ * preloaded shell the sweep left empty is an emptied folder, not folder-bearing, so it drops out
264
+ * of the record. Call after the sweep has contributed every resource (the same point
265
+ * {@link renderAllModules} is valid).
266
+ */
267
+ getFolderRecords(): TerraformFolderOutput[];
268
+ /**
269
+ * The IDs of the module folders this run rendered.
270
+ */
271
+ getModuleIds(): string[];
272
+ /**
273
+ * How each octo resource maps into terraform, which validate and commit read to match a plan
274
+ * entry or an output back to the resource that produced it.
275
+ */
276
+ getOctoTerraformResourceMappings(): OctoTerraformResourceMapping[];
277
+ /**
278
+ * Resource→resource value-reference edges, keyed by the referenced (producer) resourceId → the set
279
+ * of resourceIds that reference it. Edges follow `getRef` value references only — the same graph
280
+ * terraform cascades replacement along (force-new). `depends_on`/explicit parents are excluded:
281
+ * an ordering edge carries no value and does not force a dependent's replacement.
282
+ *
283
+ * Used by validate to attribute terraform's transitive replacement cascade: when octo replaces a
284
+ * resource, terraform recreates everything that (transitively) references it, so those changes are
285
+ * expected rather than unattributed.
286
+ */
287
+ getResourceReferrers(): Map<string, Set<string>>;
288
+ /**
289
+ * Records that a resource takes over the terraform state of a resource octo committed, so terraform
290
+ * updates or replaces the infrastructure in place instead of creating the new resource beside the old.
291
+ * Within one folder, the folder renders a `moved` block from each of the old resource's addresses to
292
+ * the new one's. Between folders, the folder record lists the move, and `TerraformUtility`
293
+ * moves the state before terraform runs.
294
+ */
295
+ moveResource(fromModuleId: string, fromResourceId: string, toModuleId: string, toResourceId: string): void;
296
+ /**
297
+ * Phase 2 of rendering: prints the four files of every folder from the wiring computed in
298
+ * phase 1. Makes no decisions — when a {@link RefHclNode} renders, its answer is looked up in the
299
+ * folder's precomputed `resolvedRefs`. Cross-folder dependency cycles throw (in phase 1).
300
+ *
301
+ * A folder also keeps every provider block `previousFolders` recorded for it that none of its
302
+ * resources use any more, so terraform can still destroy what that provider created. A resource
303
+ * whose id moved to another account, for one, leaves its old address in the folder's state, bound
304
+ * to the old account's provider.
305
+ */
306
+ renderAllModules(previousFolders?: TerraformFolderOutput[]): Map<string, TerraformModuleFiles>;
307
+ /**
308
+ * Prints the four files of an **empty** folder from a recorded folder: a `main.tf` with the
309
+ * config block rebuilt from the recorded `required_providers` entries (plus null/external when
310
+ * the folder had external resources) and the recorded provider blocks verbatim; empty
311
+ * variables/outputs; a remote_state-only `terragrunt.hcl`.
312
+ *
313
+ * Reads no module state;
314
+ * the generate mode decides which folders are emptied and which recorded folder each renders from.
315
+ */
316
+ renderEmptyModule(record: TerraformFolderOutput): TerraformModuleFiles;
317
+ /**
318
+ * Drops everything the last run rendered, keeping the registered providers and config.
319
+ */
320
+ reset(): void;
321
+ /**
322
+ * Clears what a transaction's sweep contributed (modules, resources, wiring), keeping the
323
+ * per-process registrations (terraform config and providers) intact. Test harnesses that run
324
+ * multiple transactions in one process call this between them; a real octo process runs one
325
+ * transaction, so production code never resets.
326
+ */
327
+ resetTransactionState(): void;
328
+ /**
329
+ * The {@link TerraformModuleScope} handed to a resource's `toHCL()`, bound to one module folder.
330
+ */
331
+ scope(moduleId: string): TerraformModuleScope;
332
+ /**
333
+ * Generates the `null_resource` + `data "external"` wrapper for an external resource.
334
+ *
335
+ * Only the parts that depend on no other resource are built here:
336
+ * - the `null_resource` shell (its triggers and `local-exec` provisioners are filled in later),
337
+ * - the `data "external"` read of the response octo recorded, which terraform re-runs on every plan
338
+ * and every apply, and defers to apply time only while the `null_resource` is planned to change,
339
+ * - the single whole-result output (`data.external.<name>.result`) that carries the entire response.
340
+ *
341
+ * The external resource is never enumerated per response key: its response shape is unknown at
342
+ * generation time (the action has not run) and is, by the `data "external"` protocol, a flat map of
343
+ * strings. Refs to it (`getRef`) resolve by indexing this one expression; commit reads the whole map back.
344
+ *
345
+ * The parent-input wiring (triggers + create/destroy commands) reads every parent's outputs, which
346
+ * only all exist once registration is complete. It is therefore deferred to
347
+ * {@link wireExternalResourceInputs} (run at the start of {@link computeWiring}). This deferral is
348
+ * what lets the generate sweep contribute resources in any order, rather than parents-first.
349
+ */
350
+ private addOctoTerraformExternalResource;
351
+ /**
352
+ * @internal
353
+ */
354
+ private addOctoTerraformResource;
355
+ /**
356
+ * @internal
357
+ */
358
+ private addTerraformData;
359
+ /**
360
+ * Phase 1 of rendering: resolve every {@link RefHclNode} and compute each folder's wiring.
361
+ *
362
+ * For every folder: collect all refs made from it, then resolve each one —
363
+ * - producer in the same folder → the inline terraform expression,
364
+ * - producer in another folder → a `var.*` name, plus three recorded consequences: declare the
365
+ * variable, depend on the producer's folder, wire the input in terragrunt.hcl.
366
+ *
367
+ * Explicit parents resolve similarly: same folder → `depends_on` addresses; other folder → a
368
+ * terragrunt dependency. All ref errors and cross-folder cycles surface here — phase 2 cannot
369
+ * fail.
370
+ */
371
+ private computeWiring;
372
+ /**
373
+ * Depth-first search over folder dependencies; throws on the first cycle, naming its path and
374
+ * the refs/explicit parents forming each edge.
375
+ */
376
+ private detectModuleCycles;
377
+ /**
378
+ * Derives the registered provider for a deployment target using only `accountId` (+ `regionId`).
379
+ * The provider type was decided during provider registration.
380
+ *
381
+ * Without a `regionId` (global resources), any provider of the account matches — the first
382
+ * registered wins, since the alias only routes the region.
383
+ */
384
+ private findProvider;
385
+ /**
386
+ * The moves of a folder's record: the resources whose state moves in from another folder, with the
387
+ * outputs their consumers in other folders read.
388
+ */
389
+ private getFolderMoves;
390
+ /**
391
+ * The addresses a resource's state moves between. A block named `<resourceId><suffix>` moves from the
392
+ * block the old resource named `<its resourceId><suffix>`; a `from` the state does not hold moves nothing.
393
+ */
394
+ private getMoveAddresses;
395
+ /**
396
+ * The `moved` addresses of a folder, for the resources taking over a state the same folder holds.
397
+ */
398
+ private getMovedAddresses;
399
+ /**
400
+ * @internal
401
+ */
402
+ private getProviderAliasRef;
403
+ /**
404
+ * @internal
405
+ */
406
+ private getRef;
407
+ /**
408
+ * @internal
409
+ */
410
+ private interpolate;
411
+ /**
412
+ * @internal
413
+ */
414
+ private jsonencode;
415
+ /**
416
+ * Renders a local file path as `"${var.OCTO_PROJECT_ROOT}/<path from the project root>"`, and
417
+ * marks this folder as needing that variable declared.
418
+ *
419
+ * Separators are normalized to `/`, so a folder generated on Windows reads the same as one
420
+ * generated anywhere else.
421
+ */
422
+ private localPath;
423
+ /**
424
+ * @internal
425
+ */
426
+ private mapAttr;
427
+ /**
428
+ * @internal
429
+ */
430
+ private module;
431
+ /**
432
+ * @internal
433
+ */
434
+ private providerKey;
435
+ /**
436
+ * @internal
437
+ */
438
+ private raw;
439
+ /**
440
+ * Prints one folder's `terraform { required_version, required_providers }` config block.
441
+ */
442
+ private renderConfigBlock;
443
+ /**
444
+ * Prints one folder's `terragrunt.hcl`: a `dependency` block per producer folder (with
445
+ * `mock_outputs`, shallow-merged over any applied state, so `run --all -- plan` works both before the
446
+ * first apply and when intent renames a producer resource), and the `inputs` map wiring each auto
447
+ * variable to the producer's output.
448
+ */
449
+ private renderTerragrunt;
450
+ /**
451
+ * @internal
452
+ */
453
+ private type;
454
+ /**
455
+ * @internal
456
+ */
457
+ private variable;
458
+ /**
459
+ * Resolves the deferred parent-input wiring for every external resource: for each parent, expands
460
+ * its declared outputs into `--input` arguments on the `local-exec` create/destroy commands and
461
+ * into individual triggers (so the `when = destroy` provisioner can reach the raw values via
462
+ * `self.triggers`). Runs once all resources are registered, so it is independent of the order in
463
+ * which resources were contributed. Idempotent: clears the queue, so a repeat call is a no-op.
464
+ */
465
+ private wireExternalResourceInputs;
466
+ }
467
+ /**
468
+ * @internal
469
+ */
470
+ export declare class TerraformServiceFactory {
471
+ private static instance;
472
+ /**
473
+ * @internal
474
+ */
475
+ static create({ octoCommandPrefix, terraformFileIndentLength, }?: {
476
+ octoCommandPrefix?: string;
477
+ terraformFileIndentLength?: number;
478
+ }, forceNew?: boolean): Promise<TerraformService>;
479
+ }
480
+ export {};