@ankhorage/infra 4.1.12 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (528) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +21 -32
  3. package/dist/cli/bin.d.ts +1 -8
  4. package/dist/cli/bin.d.ts.map +1 -1
  5. package/dist/cli/bin.js +2 -34
  6. package/dist/cli/bin.js.map +1 -1
  7. package/dist/cli/commands/destroy.d.ts +11 -0
  8. package/dist/cli/commands/destroy.d.ts.map +1 -0
  9. package/dist/cli/commands/destroy.js +51 -0
  10. package/dist/cli/commands/destroy.js.map +1 -0
  11. package/dist/cli/commands/down.d.ts +11 -0
  12. package/dist/cli/commands/down.d.ts.map +1 -0
  13. package/dist/cli/commands/down.js +27 -0
  14. package/dist/cli/commands/down.js.map +1 -0
  15. package/dist/cli/commands/generate.d.ts +11 -0
  16. package/dist/cli/commands/generate.d.ts.map +1 -0
  17. package/dist/cli/commands/generate.js +29 -0
  18. package/dist/cli/commands/generate.js.map +1 -0
  19. package/dist/cli/commands/outputs.d.ts +11 -0
  20. package/dist/cli/commands/outputs.d.ts.map +1 -0
  21. package/dist/cli/commands/outputs.js +25 -0
  22. package/dist/cli/commands/outputs.js.map +1 -0
  23. package/dist/cli/commands/plan.d.ts +11 -0
  24. package/dist/cli/commands/plan.d.ts.map +1 -0
  25. package/dist/cli/commands/plan.js +19 -0
  26. package/dist/cli/commands/plan.js.map +1 -0
  27. package/dist/cli/commands/status.d.ts +11 -0
  28. package/dist/cli/commands/status.d.ts.map +1 -0
  29. package/dist/cli/commands/status.js +19 -0
  30. package/dist/cli/commands/status.js.map +1 -0
  31. package/dist/cli/commands/up.d.ts +11 -0
  32. package/dist/cli/commands/up.d.ts.map +1 -0
  33. package/dist/cli/commands/up.js +28 -0
  34. package/dist/cli/commands/up.js.map +1 -0
  35. package/dist/cli/commands/validate.d.ts +11 -0
  36. package/dist/cli/commands/validate.d.ts.map +1 -0
  37. package/dist/cli/commands/validate.js +19 -0
  38. package/dist/cli/commands/validate.js.map +1 -0
  39. package/dist/cli/constants.d.ts +66 -0
  40. package/dist/cli/constants.d.ts.map +1 -0
  41. package/dist/cli/constants.js +19 -0
  42. package/dist/cli/constants.js.map +1 -0
  43. package/dist/cli/createDefaultInfraCommandContext.d.ts +4 -0
  44. package/dist/cli/createDefaultInfraCommandContext.d.ts.map +1 -0
  45. package/dist/{commandContext.js → cli/createDefaultInfraCommandContext.js} +4 -3
  46. package/dist/cli/createDefaultInfraCommandContext.js.map +1 -0
  47. package/dist/cli/createInfraRuntimeProvider.d.ts +5 -0
  48. package/dist/cli/createInfraRuntimeProvider.d.ts.map +1 -0
  49. package/dist/cli/createInfraRuntimeProvider.js +22 -0
  50. package/dist/cli/createInfraRuntimeProvider.js.map +1 -0
  51. package/dist/cli/createProviderCommandDescriptors.d.ts +4 -0
  52. package/dist/cli/createProviderCommandDescriptors.d.ts.map +1 -0
  53. package/dist/cli/createProviderCommandDescriptors.js +6 -0
  54. package/dist/cli/createProviderCommandDescriptors.js.map +1 -0
  55. package/dist/cli/findInfraCommand.d.ts +4 -0
  56. package/dist/cli/findInfraCommand.d.ts.map +1 -0
  57. package/dist/cli/findInfraCommand.js +6 -0
  58. package/dist/cli/findInfraCommand.js.map +1 -0
  59. package/dist/cli/index.d.ts +3 -8
  60. package/dist/cli/index.d.ts.map +1 -1
  61. package/dist/cli/index.js +2 -24
  62. package/dist/cli/index.js.map +1 -1
  63. package/dist/cli/renderInfraRootHelp.d.ts +3 -0
  64. package/dist/cli/renderInfraRootHelp.d.ts.map +1 -0
  65. package/dist/cli/renderInfraRootHelp.js +21 -0
  66. package/dist/cli/renderInfraRootHelp.js.map +1 -0
  67. package/dist/cli/renderUnknownInfraCommand.d.ts +3 -0
  68. package/dist/cli/renderUnknownInfraCommand.d.ts.map +1 -0
  69. package/dist/cli/renderUnknownInfraCommand.js +5 -0
  70. package/dist/cli/renderUnknownInfraCommand.js.map +1 -0
  71. package/dist/cli/runInfraCliAsync.d.ts +10 -0
  72. package/dist/cli/runInfraCliAsync.d.ts.map +1 -0
  73. package/dist/cli/runInfraCliAsync.js +34 -0
  74. package/dist/cli/runInfraCliAsync.js.map +1 -0
  75. package/dist/cli/runInfraCommandAsync.d.ts +4 -0
  76. package/dist/cli/runInfraCommandAsync.d.ts.map +1 -0
  77. package/dist/cli/runInfraCommandAsync.js +100 -0
  78. package/dist/cli/runInfraCommandAsync.js.map +1 -0
  79. package/dist/cli/utils/prepareInfraCommandOperationAsync.d.ts +4 -0
  80. package/dist/cli/utils/prepareInfraCommandOperationAsync.d.ts.map +1 -0
  81. package/dist/cli/utils/prepareInfraCommandOperationAsync.js +45 -0
  82. package/dist/cli/utils/prepareInfraCommandOperationAsync.js.map +1 -0
  83. package/dist/cli/utils/requireInfraSuccess.d.ts +7 -0
  84. package/dist/cli/utils/requireInfraSuccess.d.ts.map +1 -0
  85. package/dist/cli/utils/requireInfraSuccess.js +17 -0
  86. package/dist/cli/utils/requireInfraSuccess.js.map +1 -0
  87. package/dist/cli/utils/resolveInfraPersistence.d.ts +4 -0
  88. package/dist/cli/utils/resolveInfraPersistence.d.ts.map +1 -0
  89. package/dist/cli/utils/resolveInfraPersistence.js +17 -0
  90. package/dist/cli/utils/resolveInfraPersistence.js.map +1 -0
  91. package/dist/cli/utils/writeInfraEnvironmentOutputs.d.ts +5 -0
  92. package/dist/cli/utils/writeInfraEnvironmentOutputs.d.ts.map +1 -0
  93. package/dist/cli/utils/writeInfraEnvironmentOutputs.js +16 -0
  94. package/dist/cli/utils/writeInfraEnvironmentOutputs.js.map +1 -0
  95. package/dist/cli/utils/writeInfraStructured.d.ts +4 -0
  96. package/dist/cli/utils/writeInfraStructured.d.ts.map +1 -0
  97. package/dist/cli/utils/writeInfraStructured.js +8 -0
  98. package/dist/cli/utils/writeInfraStructured.js.map +1 -0
  99. package/dist/constants.d.ts +10 -0
  100. package/dist/constants.d.ts.map +1 -0
  101. package/dist/{packageMetadata.js → constants.js} +6 -3
  102. package/dist/constants.js.map +1 -0
  103. package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraCredentialPort.d.ts +4 -0
  104. package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraCredentialPort.d.ts.map +1 -0
  105. package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraCredentialPort.js +35 -0
  106. package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraCredentialPort.js.map +1 -0
  107. package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraSecretPort.d.ts +4 -0
  108. package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraSecretPort.d.ts.map +1 -0
  109. package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraSecretPort.js +23 -0
  110. package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraSecretPort.js.map +1 -0
  111. package/dist/features/environment-lifecycle/adapters/outbound/createNodeInfraAdapterPackageResolver.d.ts +4 -0
  112. package/dist/features/environment-lifecycle/adapters/outbound/createNodeInfraAdapterPackageResolver.d.ts.map +1 -0
  113. package/dist/features/environment-lifecycle/adapters/outbound/createNodeInfraAdapterPackageResolver.js +9 -0
  114. package/dist/features/environment-lifecycle/adapters/outbound/createNodeInfraAdapterPackageResolver.js.map +1 -0
  115. package/dist/features/environment-lifecycle/adapters/outbound/readStoredInfraStateAsync.d.ts +5 -0
  116. package/dist/features/environment-lifecycle/adapters/outbound/readStoredInfraStateAsync.d.ts.map +1 -0
  117. package/dist/features/environment-lifecycle/adapters/outbound/readStoredInfraStateAsync.js +28 -0
  118. package/dist/features/environment-lifecycle/adapters/outbound/readStoredInfraStateAsync.js.map +1 -0
  119. package/dist/features/environment-lifecycle/adapters/outbound/removeStoredInfraStateAsync.d.ts +4 -0
  120. package/dist/features/environment-lifecycle/adapters/outbound/removeStoredInfraStateAsync.d.ts.map +1 -0
  121. package/dist/features/environment-lifecycle/adapters/outbound/removeStoredInfraStateAsync.js +7 -0
  122. package/dist/features/environment-lifecycle/adapters/outbound/removeStoredInfraStateAsync.js.map +1 -0
  123. package/dist/features/environment-lifecycle/adapters/outbound/resolveInfraProjectAsync.d.ts +7 -0
  124. package/dist/features/environment-lifecycle/adapters/outbound/resolveInfraProjectAsync.d.ts.map +1 -0
  125. package/dist/{project.js → features/environment-lifecycle/adapters/outbound/resolveInfraProjectAsync.js} +10 -34
  126. package/dist/features/environment-lifecycle/adapters/outbound/resolveInfraProjectAsync.js.map +1 -0
  127. package/dist/features/environment-lifecycle/adapters/outbound/writeInfraGeneratedArtifactsAsync.d.ts +5 -0
  128. package/dist/features/environment-lifecycle/adapters/outbound/writeInfraGeneratedArtifactsAsync.d.ts.map +1 -0
  129. package/dist/features/environment-lifecycle/adapters/outbound/writeInfraGeneratedArtifactsAsync.js +28 -0
  130. package/dist/features/environment-lifecycle/adapters/outbound/writeInfraGeneratedArtifactsAsync.js.map +1 -0
  131. package/dist/features/environment-lifecycle/adapters/outbound/writeStoredInfraStateAsync.d.ts +4 -0
  132. package/dist/features/environment-lifecycle/adapters/outbound/writeStoredInfraStateAsync.d.ts.map +1 -0
  133. package/dist/features/environment-lifecycle/adapters/outbound/writeStoredInfraStateAsync.js +16 -0
  134. package/dist/features/environment-lifecycle/adapters/outbound/writeStoredInfraStateAsync.js.map +1 -0
  135. package/dist/features/environment-lifecycle/application/ports/outbound/infraAdapterPackage.d.ts +9 -0
  136. package/dist/features/environment-lifecycle/application/ports/outbound/infraAdapterPackage.d.ts.map +1 -0
  137. package/dist/features/environment-lifecycle/application/ports/outbound/infraAdapterPackage.js +2 -0
  138. package/dist/features/environment-lifecycle/application/ports/outbound/infraAdapterPackage.js.map +1 -0
  139. package/dist/features/environment-lifecycle/application/use-cases/collectInfraWorkloadsAsync.d.ts +4 -0
  140. package/dist/features/environment-lifecycle/application/use-cases/collectInfraWorkloadsAsync.d.ts.map +1 -0
  141. package/dist/features/environment-lifecycle/application/use-cases/collectInfraWorkloadsAsync.js +15 -0
  142. package/dist/features/environment-lifecycle/application/use-cases/collectInfraWorkloadsAsync.js.map +1 -0
  143. package/dist/features/environment-lifecycle/application/use-cases/destroyInfraEnvironmentAsync.d.ts +4 -0
  144. package/dist/features/environment-lifecycle/application/use-cases/destroyInfraEnvironmentAsync.d.ts.map +1 -0
  145. package/dist/features/environment-lifecycle/application/use-cases/destroyInfraEnvironmentAsync.js +84 -0
  146. package/dist/features/environment-lifecycle/application/use-cases/destroyInfraEnvironmentAsync.js.map +1 -0
  147. package/dist/features/environment-lifecycle/application/use-cases/downInfraEnvironmentAsync.d.ts +4 -0
  148. package/dist/features/environment-lifecycle/application/use-cases/downInfraEnvironmentAsync.d.ts.map +1 -0
  149. package/dist/features/environment-lifecycle/application/use-cases/downInfraEnvironmentAsync.js +55 -0
  150. package/dist/features/environment-lifecycle/application/use-cases/downInfraEnvironmentAsync.js.map +1 -0
  151. package/dist/features/environment-lifecycle/application/use-cases/generateInfraEnvironmentAsync.d.ts +4 -0
  152. package/dist/features/environment-lifecycle/application/use-cases/generateInfraEnvironmentAsync.d.ts.map +1 -0
  153. package/dist/features/environment-lifecycle/application/use-cases/generateInfraEnvironmentAsync.js +38 -0
  154. package/dist/features/environment-lifecycle/application/use-cases/generateInfraEnvironmentAsync.js.map +1 -0
  155. package/dist/features/environment-lifecycle/application/use-cases/getInfraEnvironmentOutputs.d.ts +4 -0
  156. package/dist/features/environment-lifecycle/application/use-cases/getInfraEnvironmentOutputs.d.ts.map +1 -0
  157. package/dist/features/environment-lifecycle/application/use-cases/getInfraEnvironmentOutputs.js +34 -0
  158. package/dist/features/environment-lifecycle/application/use-cases/getInfraEnvironmentOutputs.js.map +1 -0
  159. package/dist/features/environment-lifecycle/application/use-cases/planInfraEnvironmentAsync.d.ts +4 -0
  160. package/dist/features/environment-lifecycle/application/use-cases/planInfraEnvironmentAsync.d.ts.map +1 -0
  161. package/dist/features/environment-lifecycle/application/use-cases/planInfraEnvironmentAsync.js +57 -0
  162. package/dist/features/environment-lifecycle/application/use-cases/planInfraEnvironmentAsync.js.map +1 -0
  163. package/dist/features/environment-lifecycle/application/use-cases/prepareInfraOperationAsync.d.ts +5 -0
  164. package/dist/features/environment-lifecycle/application/use-cases/prepareInfraOperationAsync.d.ts.map +1 -0
  165. package/dist/features/environment-lifecycle/application/use-cases/prepareInfraOperationAsync.js +109 -0
  166. package/dist/features/environment-lifecycle/application/use-cases/prepareInfraOperationAsync.js.map +1 -0
  167. package/dist/features/environment-lifecycle/application/use-cases/resolveInfraAdaptersAsync.d.ts +6 -0
  168. package/dist/features/environment-lifecycle/application/use-cases/resolveInfraAdaptersAsync.d.ts.map +1 -0
  169. package/dist/features/environment-lifecycle/application/use-cases/resolveInfraAdaptersAsync.js +181 -0
  170. package/dist/features/environment-lifecycle/application/use-cases/resolveInfraAdaptersAsync.js.map +1 -0
  171. package/dist/features/environment-lifecycle/application/use-cases/statusInfraEnvironmentAsync.d.ts +4 -0
  172. package/dist/features/environment-lifecycle/application/use-cases/statusInfraEnvironmentAsync.d.ts.map +1 -0
  173. package/dist/features/environment-lifecycle/application/use-cases/statusInfraEnvironmentAsync.js +68 -0
  174. package/dist/features/environment-lifecycle/application/use-cases/statusInfraEnvironmentAsync.js.map +1 -0
  175. package/dist/features/environment-lifecycle/application/use-cases/upInfraEnvironmentAsync.d.ts +4 -0
  176. package/dist/features/environment-lifecycle/application/use-cases/upInfraEnvironmentAsync.d.ts.map +1 -0
  177. package/dist/features/environment-lifecycle/application/use-cases/upInfraEnvironmentAsync.js +98 -0
  178. package/dist/features/environment-lifecycle/application/use-cases/upInfraEnvironmentAsync.js.map +1 -0
  179. package/dist/features/environment-lifecycle/application/use-cases/validateInfraAdaptersAsync.d.ts +5 -0
  180. package/dist/features/environment-lifecycle/application/use-cases/validateInfraAdaptersAsync.d.ts.map +1 -0
  181. package/dist/features/environment-lifecycle/application/use-cases/validateInfraAdaptersAsync.js +17 -0
  182. package/dist/features/environment-lifecycle/application/use-cases/validateInfraAdaptersAsync.js.map +1 -0
  183. package/dist/features/environment-lifecycle/application/use-cases/validateInfraEnvironmentAsync.d.ts +4 -0
  184. package/dist/features/environment-lifecycle/application/use-cases/validateInfraEnvironmentAsync.d.ts.map +1 -0
  185. package/dist/features/environment-lifecycle/application/use-cases/validateInfraEnvironmentAsync.js +13 -0
  186. package/dist/features/environment-lifecycle/application/use-cases/validateInfraEnvironmentAsync.js.map +1 -0
  187. package/dist/features/environment-lifecycle/composition/createInfraCommandServices.d.ts +4 -0
  188. package/dist/features/environment-lifecycle/composition/createInfraCommandServices.d.ts.map +1 -0
  189. package/dist/features/environment-lifecycle/composition/createInfraCommandServices.js +43 -0
  190. package/dist/features/environment-lifecycle/composition/createInfraCommandServices.js.map +1 -0
  191. package/dist/features/environment-lifecycle/composition/createProjectInfraLifecycle.d.ts +4 -0
  192. package/dist/features/environment-lifecycle/composition/createProjectInfraLifecycle.d.ts.map +1 -0
  193. package/dist/features/environment-lifecycle/composition/createProjectInfraLifecycle.js +123 -0
  194. package/dist/features/environment-lifecycle/composition/createProjectInfraLifecycle.js.map +1 -0
  195. package/dist/features/environment-lifecycle/domain/orderInfraPlanActions.d.ts +4 -0
  196. package/dist/features/environment-lifecycle/domain/orderInfraPlanActions.d.ts.map +1 -0
  197. package/dist/features/environment-lifecycle/domain/orderInfraPlanActions.js +54 -0
  198. package/dist/features/environment-lifecycle/domain/orderInfraPlanActions.js.map +1 -0
  199. package/dist/features/environment-lifecycle/domain/resolveInfraEnvironment.d.ts +5 -0
  200. package/dist/features/environment-lifecycle/domain/resolveInfraEnvironment.d.ts.map +1 -0
  201. package/dist/features/environment-lifecycle/domain/resolveInfraEnvironment.js +39 -0
  202. package/dist/features/environment-lifecycle/domain/resolveInfraEnvironment.js.map +1 -0
  203. package/dist/features/environment-lifecycle/utils/appendInfraFailure.d.ts +7 -0
  204. package/dist/features/environment-lifecycle/utils/appendInfraFailure.d.ts.map +1 -0
  205. package/dist/features/environment-lifecycle/utils/appendInfraFailure.js +5 -0
  206. package/dist/features/environment-lifecycle/utils/appendInfraFailure.js.map +1 -0
  207. package/dist/features/environment-lifecycle/utils/createInfraExecutionContext.d.ts +5 -0
  208. package/dist/features/environment-lifecycle/utils/createInfraExecutionContext.d.ts.map +1 -0
  209. package/dist/features/environment-lifecycle/utils/createInfraExecutionContext.js +13 -0
  210. package/dist/features/environment-lifecycle/utils/createInfraExecutionContext.js.map +1 -0
  211. package/dist/features/environment-lifecycle/utils/createInfraFailure.d.ts +4 -0
  212. package/dist/features/environment-lifecycle/utils/createInfraFailure.d.ts.map +1 -0
  213. package/dist/features/environment-lifecycle/utils/createInfraFailure.js +5 -0
  214. package/dist/features/environment-lifecycle/utils/createInfraFailure.js.map +1 -0
  215. package/dist/features/environment-lifecycle/utils/createInfraLedger.d.ts +12 -0
  216. package/dist/features/environment-lifecycle/utils/createInfraLedger.d.ts.map +1 -0
  217. package/dist/features/environment-lifecycle/utils/createInfraLedger.js +14 -0
  218. package/dist/features/environment-lifecycle/utils/createInfraLedger.js.map +1 -0
  219. package/dist/features/environment-lifecycle/utils/infraIdentityKey.d.ts +4 -0
  220. package/dist/features/environment-lifecycle/utils/infraIdentityKey.d.ts.map +1 -0
  221. package/dist/features/environment-lifecycle/utils/infraIdentityKey.js +5 -0
  222. package/dist/features/environment-lifecycle/utils/infraIdentityKey.js.map +1 -0
  223. package/dist/features/environment-lifecycle/utils/isInfraStoredState.d.ts +4 -0
  224. package/dist/features/environment-lifecycle/utils/isInfraStoredState.d.ts.map +1 -0
  225. package/dist/features/environment-lifecycle/utils/isInfraStoredState.js +103 -0
  226. package/dist/features/environment-lifecycle/utils/isInfraStoredState.js.map +1 -0
  227. package/dist/features/environment-lifecycle/utils/mergeInfraOutputs.d.ts +4 -0
  228. package/dist/features/environment-lifecycle/utils/mergeInfraOutputs.d.ts.map +1 -0
  229. package/dist/features/environment-lifecycle/utils/mergeInfraOutputs.js +10 -0
  230. package/dist/features/environment-lifecycle/utils/mergeInfraOutputs.js.map +1 -0
  231. package/dist/features/environment-lifecycle/utils/mergeInfraResources.d.ts +4 -0
  232. package/dist/features/environment-lifecycle/utils/mergeInfraResources.d.ts.map +1 -0
  233. package/dist/features/environment-lifecycle/utils/mergeInfraResources.js +10 -0
  234. package/dist/features/environment-lifecycle/utils/mergeInfraResources.js.map +1 -0
  235. package/dist/features/environment-lifecycle/utils/normalizeInfraEnvironmentKey.d.ts +3 -0
  236. package/dist/features/environment-lifecycle/utils/normalizeInfraEnvironmentKey.d.ts.map +1 -0
  237. package/dist/features/environment-lifecycle/utils/normalizeInfraEnvironmentKey.js +8 -0
  238. package/dist/features/environment-lifecycle/utils/normalizeInfraEnvironmentKey.js.map +1 -0
  239. package/dist/features/environment-lifecycle/utils/resolveInfraStatePath.d.ts +4 -0
  240. package/dist/features/environment-lifecycle/utils/resolveInfraStatePath.d.ts.map +1 -0
  241. package/dist/features/environment-lifecycle/utils/resolveInfraStatePath.js +11 -0
  242. package/dist/features/environment-lifecycle/utils/resolveInfraStatePath.js.map +1 -0
  243. package/dist/features/environment-lifecycle/utils/resolveProjectFile.d.ts +3 -0
  244. package/dist/features/environment-lifecycle/utils/resolveProjectFile.d.ts.map +1 -0
  245. package/dist/features/environment-lifecycle/utils/resolveProjectFile.js +19 -0
  246. package/dist/features/environment-lifecycle/utils/resolveProjectFile.js.map +1 -0
  247. package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterOutputs.d.ts +4 -0
  248. package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterOutputs.d.ts.map +1 -0
  249. package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterOutputs.js +6 -0
  250. package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterOutputs.js.map +1 -0
  251. package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterResources.d.ts +4 -0
  252. package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterResources.d.ts.map +1 -0
  253. package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterResources.js +6 -0
  254. package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterResources.js.map +1 -0
  255. package/dist/index.d.ts +16 -6
  256. package/dist/index.d.ts.map +1 -1
  257. package/dist/index.js +14 -15
  258. package/dist/index.js.map +1 -1
  259. package/dist/metadata/index.d.ts +1 -1
  260. package/dist/metadata/index.d.ts.map +1 -1
  261. package/dist/metadata/index.js +1 -1
  262. package/dist/metadata/index.js.map +1 -1
  263. package/dist/project/index.d.ts +8 -5
  264. package/dist/project/index.d.ts.map +1 -1
  265. package/dist/project/index.js +7 -5
  266. package/dist/project/index.js.map +1 -1
  267. package/dist/readme-usage.js +17 -26
  268. package/dist/readme-usage.js.map +1 -1
  269. package/dist/testSupport.d.ts +1 -1
  270. package/dist/testSupport.d.ts.map +1 -1
  271. package/dist/testSupport.js +11 -1
  272. package/dist/testSupport.js.map +1 -1
  273. package/dist/types/infraCli.d.ts +91 -0
  274. package/dist/types/infraCli.d.ts.map +1 -0
  275. package/dist/types/infraCli.js +2 -0
  276. package/dist/types/infraCli.js.map +1 -0
  277. package/dist/types/infraOrchestration.d.ts +84 -0
  278. package/dist/types/infraOrchestration.d.ts.map +1 -0
  279. package/dist/types/infraOrchestration.js +2 -0
  280. package/dist/types/infraOrchestration.js.map +1 -0
  281. package/dist/types/infraProject.d.ts +43 -0
  282. package/dist/types/infraProject.d.ts.map +1 -0
  283. package/dist/types/infraProject.js +2 -0
  284. package/dist/types/infraProject.js.map +1 -0
  285. package/package.json +20 -10
  286. package/src/adapterPackages.integration.test.ts +79 -0
  287. package/src/cli/bin.ts +2 -61
  288. package/src/cli/cli.test.ts +35 -126
  289. package/src/cli/commands/destroy.ts +57 -0
  290. package/src/cli/commands/down.ts +28 -0
  291. package/src/cli/commands/generate.ts +34 -0
  292. package/src/cli/commands/outputs.ts +25 -0
  293. package/src/cli/commands/plan.ts +20 -0
  294. package/src/cli/commands/status.ts +20 -0
  295. package/src/cli/commands/up.ts +29 -0
  296. package/src/cli/commands/validate.ts +20 -0
  297. package/src/cli/constants.ts +19 -0
  298. package/src/cli/createDefaultInfraCommandContext.ts +17 -0
  299. package/src/cli/createInfraRuntimeProvider.ts +35 -0
  300. package/src/cli/createProviderCommandDescriptors.ts +8 -0
  301. package/src/cli/findInfraCommand.ts +7 -0
  302. package/src/cli/index.test.ts +12 -20
  303. package/src/cli/index.ts +7 -49
  304. package/src/cli/renderInfraRootHelp.ts +23 -0
  305. package/src/cli/renderUnknownInfraCommand.ts +4 -0
  306. package/src/cli/runInfraCliAsync.ts +51 -0
  307. package/src/cli/runInfraCommandAsync.ts +114 -0
  308. package/src/cli/utils/prepareInfraCommandOperationAsync.ts +64 -0
  309. package/src/cli/utils/requireInfraSuccess.ts +24 -0
  310. package/src/cli/utils/resolveInfraPersistence.ts +22 -0
  311. package/src/cli/utils/writeInfraEnvironmentOutputs.ts +24 -0
  312. package/src/cli/utils/writeInfraStructured.ts +11 -0
  313. package/src/commands.test.ts +198 -196
  314. package/src/{packageMetadata.ts → constants.ts} +5 -2
  315. package/src/environmentLifecycle.test.ts +193 -0
  316. package/src/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraCredentialPort.ts +52 -0
  317. package/src/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraSecretPort.ts +32 -0
  318. package/src/features/environment-lifecycle/adapters/outbound/createNodeInfraAdapterPackageResolver.ts +10 -0
  319. package/src/features/environment-lifecycle/adapters/outbound/readStoredInfraStateAsync.ts +34 -0
  320. package/src/features/environment-lifecycle/adapters/outbound/removeStoredInfraStateAsync.ts +12 -0
  321. package/src/{project.ts → features/environment-lifecycle/adapters/outbound/resolveInfraProjectAsync.ts} +10 -45
  322. package/src/features/environment-lifecycle/adapters/outbound/writeInfraGeneratedArtifactsAsync.ts +34 -0
  323. package/src/features/environment-lifecycle/adapters/outbound/writeStoredInfraStateAsync.ts +21 -0
  324. package/src/features/environment-lifecycle/application/ports/outbound/infraAdapterPackage.ts +10 -0
  325. package/src/features/environment-lifecycle/application/use-cases/collectInfraWorkloadsAsync.ts +25 -0
  326. package/src/features/environment-lifecycle/application/use-cases/destroyInfraEnvironmentAsync.ts +119 -0
  327. package/src/features/environment-lifecycle/application/use-cases/downInfraEnvironmentAsync.ts +65 -0
  328. package/src/features/environment-lifecycle/application/use-cases/generateInfraEnvironmentAsync.ts +51 -0
  329. package/src/features/environment-lifecycle/application/use-cases/getInfraEnvironmentOutputs.ts +41 -0
  330. package/src/features/environment-lifecycle/application/use-cases/planInfraEnvironmentAsync.ts +67 -0
  331. package/src/features/environment-lifecycle/application/use-cases/prepareInfraOperationAsync.ts +137 -0
  332. package/src/features/environment-lifecycle/application/use-cases/resolveInfraAdaptersAsync.ts +257 -0
  333. package/src/features/environment-lifecycle/application/use-cases/statusInfraEnvironmentAsync.ts +80 -0
  334. package/src/features/environment-lifecycle/application/use-cases/upInfraEnvironmentAsync.ts +126 -0
  335. package/src/features/environment-lifecycle/application/use-cases/validateInfraAdaptersAsync.ts +25 -0
  336. package/src/features/environment-lifecycle/application/use-cases/validateInfraEnvironmentAsync.ts +21 -0
  337. package/src/features/environment-lifecycle/composition/createInfraCommandServices.ts +47 -0
  338. package/src/features/environment-lifecycle/composition/createProjectInfraLifecycle.ts +157 -0
  339. package/src/features/environment-lifecycle/domain/orderInfraPlanActions.ts +64 -0
  340. package/src/features/environment-lifecycle/domain/resolveInfraEnvironment.ts +62 -0
  341. package/src/features/environment-lifecycle/utils/appendInfraFailure.ts +9 -0
  342. package/src/features/environment-lifecycle/utils/createInfraExecutionContext.ts +24 -0
  343. package/src/features/environment-lifecycle/utils/createInfraFailure.ts +6 -0
  344. package/src/features/environment-lifecycle/utils/createInfraLedger.ts +30 -0
  345. package/src/features/environment-lifecycle/utils/infraIdentityKey.ts +6 -0
  346. package/src/features/environment-lifecycle/utils/isInfraStoredState.ts +141 -0
  347. package/src/features/environment-lifecycle/utils/mergeInfraOutputs.ts +14 -0
  348. package/src/features/environment-lifecycle/utils/mergeInfraResources.ts +14 -0
  349. package/src/features/environment-lifecycle/utils/normalizeInfraEnvironmentKey.ts +7 -0
  350. package/src/features/environment-lifecycle/utils/resolveInfraStatePath.ts +12 -0
  351. package/src/features/environment-lifecycle/utils/resolveProjectFile.ts +22 -0
  352. package/src/features/environment-lifecycle/utils/retainUnchangedAdapterOutputs.ts +15 -0
  353. package/src/features/environment-lifecycle/utils/retainUnchangedAdapterResources.ts +15 -0
  354. package/src/index.test.ts +22 -315
  355. package/src/index.ts +41 -53
  356. package/src/infraComposition.integration.test.ts +128 -0
  357. package/src/infraOperations.test.ts +386 -0
  358. package/src/infraUp.test.ts +260 -0
  359. package/src/metadata/index.ts +1 -1
  360. package/src/package.test.ts +4 -2
  361. package/src/project/index.test.ts +10 -188
  362. package/src/project/index.ts +15 -22
  363. package/src/project.test.ts +39 -189
  364. package/src/projectContractsParser.test.ts +2 -2
  365. package/src/projectInfrastructure.test.ts +121 -167
  366. package/src/projectLifecycle.test.ts +136 -0
  367. package/src/readme-usage.ts +17 -26
  368. package/src/testSupport.ts +12 -2
  369. package/src/types/infraCli.ts +115 -0
  370. package/src/types/infraOrchestration.ts +126 -0
  371. package/src/types/infraProject.ts +58 -0
  372. package/dist/adapters/minikube/auth/index.d.ts +0 -8
  373. package/dist/adapters/minikube/auth/index.d.ts.map +0 -1
  374. package/dist/adapters/minikube/auth/index.js +0 -29
  375. package/dist/adapters/minikube/auth/index.js.map +0 -1
  376. package/dist/adapters/minikube/auth/oauthRuntime.d.ts +0 -4
  377. package/dist/adapters/minikube/auth/oauthRuntime.d.ts.map +0 -1
  378. package/dist/adapters/minikube/auth/oauthRuntime.js +0 -138
  379. package/dist/adapters/minikube/auth/oauthRuntime.js.map +0 -1
  380. package/dist/adapters/minikube/auth/supabase/index.d.ts +0 -7
  381. package/dist/adapters/minikube/auth/supabase/index.d.ts.map +0 -1
  382. package/dist/adapters/minikube/auth/supabase/index.js +0 -232
  383. package/dist/adapters/minikube/auth/supabase/index.js.map +0 -1
  384. package/dist/adapters/minikube/auth/supabase/profile.d.ts +0 -20
  385. package/dist/adapters/minikube/auth/supabase/profile.d.ts.map +0 -1
  386. package/dist/adapters/minikube/auth/supabase/profile.js +0 -452
  387. package/dist/adapters/minikube/auth/supabase/profile.js.map +0 -1
  388. package/dist/adapters/minikube/auth/targetAwareOAuthRuntime.d.ts +0 -7
  389. package/dist/adapters/minikube/auth/targetAwareOAuthRuntime.d.ts.map +0 -1
  390. package/dist/adapters/minikube/auth/targetAwareOAuthRuntime.js +0 -104
  391. package/dist/adapters/minikube/auth/targetAwareOAuthRuntime.js.map +0 -1
  392. package/dist/adapters/minikube/authz/cerbos/index.d.ts +0 -13
  393. package/dist/adapters/minikube/authz/cerbos/index.d.ts.map +0 -1
  394. package/dist/adapters/minikube/authz/cerbos/index.js +0 -382
  395. package/dist/adapters/minikube/authz/cerbos/index.js.map +0 -1
  396. package/dist/adapters/minikube/authz/index.d.ts +0 -9
  397. package/dist/adapters/minikube/authz/index.d.ts.map +0 -1
  398. package/dist/adapters/minikube/authz/index.js +0 -23
  399. package/dist/adapters/minikube/authz/index.js.map +0 -1
  400. package/dist/adapters/minikube/base/index.d.ts +0 -14
  401. package/dist/adapters/minikube/base/index.d.ts.map +0 -1
  402. package/dist/adapters/minikube/base/index.js +0 -3433
  403. package/dist/adapters/minikube/base/index.js.map +0 -1
  404. package/dist/adapters/minikube/base/supabaseMigrations.d.ts +0 -2
  405. package/dist/adapters/minikube/base/supabaseMigrations.d.ts.map +0 -1
  406. package/dist/adapters/minikube/base/supabaseMigrations.js +0 -6
  407. package/dist/adapters/minikube/base/supabaseMigrations.js.map +0 -1
  408. package/dist/adapters/minikube/contracts.d.ts +0 -34
  409. package/dist/adapters/minikube/contracts.d.ts.map +0 -1
  410. package/dist/adapters/minikube/contracts.js +0 -10
  411. package/dist/adapters/minikube/contracts.js.map +0 -1
  412. package/dist/adapters/minikube/index.d.ts +0 -3
  413. package/dist/adapters/minikube/index.d.ts.map +0 -1
  414. package/dist/adapters/minikube/index.js +0 -136
  415. package/dist/adapters/minikube/index.js.map +0 -1
  416. package/dist/adapters/minikube/secrets/index.d.ts +0 -7
  417. package/dist/adapters/minikube/secrets/index.d.ts.map +0 -1
  418. package/dist/adapters/minikube/secrets/index.js +0 -13
  419. package/dist/adapters/minikube/secrets/index.js.map +0 -1
  420. package/dist/adapters/minikube/secrets/supabase-vault/index.d.ts +0 -8
  421. package/dist/adapters/minikube/secrets/supabase-vault/index.d.ts.map +0 -1
  422. package/dist/adapters/minikube/secrets/supabase-vault/index.js +0 -118
  423. package/dist/adapters/minikube/secrets/supabase-vault/index.js.map +0 -1
  424. package/dist/adapters/minikube/storage/index.d.ts +0 -7
  425. package/dist/adapters/minikube/storage/index.d.ts.map +0 -1
  426. package/dist/adapters/minikube/storage/index.js +0 -77
  427. package/dist/adapters/minikube/storage/index.js.map +0 -1
  428. package/dist/adapters/minikube/storage/supabase/index.d.ts +0 -7
  429. package/dist/adapters/minikube/storage/supabase/index.d.ts.map +0 -1
  430. package/dist/adapters/minikube/storage/supabase/index.js +0 -82
  431. package/dist/adapters/minikube/storage/supabase/index.js.map +0 -1
  432. package/dist/authRedirects.d.ts +0 -19
  433. package/dist/authRedirects.d.ts.map +0 -1
  434. package/dist/authRedirects.js +0 -80
  435. package/dist/authRedirects.js.map +0 -1
  436. package/dist/authTargetRedirects.d.ts +0 -12
  437. package/dist/authTargetRedirects.d.ts.map +0 -1
  438. package/dist/authTargetRedirects.js +0 -32
  439. package/dist/authTargetRedirects.js.map +0 -1
  440. package/dist/commandContext.d.ts +0 -12
  441. package/dist/commandContext.d.ts.map +0 -1
  442. package/dist/commandContext.js.map +0 -1
  443. package/dist/commands.d.ts +0 -95
  444. package/dist/commands.d.ts.map +0 -1
  445. package/dist/commands.js +0 -256
  446. package/dist/commands.js.map +0 -1
  447. package/dist/infraValidation.d.ts +0 -4
  448. package/dist/infraValidation.d.ts.map +0 -1
  449. package/dist/infraValidation.js +0 -63
  450. package/dist/infraValidation.js.map +0 -1
  451. package/dist/packageMetadata.d.ts +0 -10
  452. package/dist/packageMetadata.d.ts.map +0 -1
  453. package/dist/packageMetadata.js.map +0 -1
  454. package/dist/project.d.ts +0 -14
  455. package/dist/project.d.ts.map +0 -1
  456. package/dist/project.js.map +0 -1
  457. package/dist/projectDatabase.d.ts +0 -5
  458. package/dist/projectDatabase.d.ts.map +0 -1
  459. package/dist/projectDatabase.js +0 -22
  460. package/dist/projectDatabase.js.map +0 -1
  461. package/dist/projectEnvironment.d.ts +0 -6
  462. package/dist/projectEnvironment.d.ts.map +0 -1
  463. package/dist/projectEnvironment.js +0 -45
  464. package/dist/projectEnvironment.js.map +0 -1
  465. package/dist/projectInfrastructure.d.ts +0 -38
  466. package/dist/projectInfrastructure.d.ts.map +0 -1
  467. package/dist/projectInfrastructure.js +0 -145
  468. package/dist/projectInfrastructure.js.map +0 -1
  469. package/dist/runtime.d.ts +0 -54
  470. package/dist/runtime.d.ts.map +0 -1
  471. package/dist/runtime.js +0 -151
  472. package/dist/runtime.js.map +0 -1
  473. package/dist/secretStore.d.ts +0 -19
  474. package/dist/secretStore.d.ts.map +0 -1
  475. package/dist/secretStore.js +0 -22
  476. package/dist/secretStore.js.map +0 -1
  477. package/dist/types.d.ts +0 -70
  478. package/dist/types.d.ts.map +0 -1
  479. package/dist/types.js +0 -2
  480. package/dist/types.js.map +0 -1
  481. package/src/adapters/minikube/README.md +0 -115
  482. package/src/adapters/minikube/appRuntimeServing.test.ts +0 -28
  483. package/src/adapters/minikube/auth/index.ts +0 -40
  484. package/src/adapters/minikube/auth/oauthRuntime.ts +0 -163
  485. package/src/adapters/minikube/auth/supabase/index.test.ts +0 -227
  486. package/src/adapters/minikube/auth/supabase/index.ts +0 -293
  487. package/src/adapters/minikube/auth/supabase/oauthRuntime.test.ts +0 -154
  488. package/src/adapters/minikube/auth/supabase/profile.integration.test.ts +0 -1028
  489. package/src/adapters/minikube/auth/supabase/profile.ts +0 -526
  490. package/src/adapters/minikube/auth/supabase/providerAssignments.test.ts +0 -36
  491. package/src/adapters/minikube/auth/targetAwareOAuthRuntime.test.ts +0 -83
  492. package/src/adapters/minikube/auth/targetAwareOAuthRuntime.ts +0 -136
  493. package/src/adapters/minikube/authz/cerbos/index.ts +0 -486
  494. package/src/adapters/minikube/authz/index.ts +0 -32
  495. package/src/adapters/minikube/base/appImageBuild.test.ts +0 -352
  496. package/src/adapters/minikube/base/index.test.ts +0 -693
  497. package/src/adapters/minikube/base/index.ts +0 -3763
  498. package/src/adapters/minikube/base/portForwardRuntime.test.ts +0 -624
  499. package/src/adapters/minikube/base/supabaseMigrations.test.ts +0 -168
  500. package/src/adapters/minikube/base/supabaseMigrations.ts +0 -5
  501. package/src/adapters/minikube/base/twoAppIsolation.integration.test.ts +0 -898
  502. package/src/adapters/minikube/base/upgradeReconciliation.test.ts +0 -135
  503. package/src/adapters/minikube/contracts.ts +0 -46
  504. package/src/adapters/minikube/index.ts +0 -172
  505. package/src/adapters/minikube/secrets/index.test.ts +0 -147
  506. package/src/adapters/minikube/secrets/index.ts +0 -19
  507. package/src/adapters/minikube/secrets/supabase-vault/index.ts +0 -139
  508. package/src/adapters/minikube/storage/index.ts +0 -91
  509. package/src/adapters/minikube/storage/supabase/index.ts +0 -108
  510. package/src/apiInfrastructure.test.ts +0 -69
  511. package/src/authRedirects.test.ts +0 -63
  512. package/src/authRedirects.ts +0 -113
  513. package/src/authTargetRedirects.test.ts +0 -62
  514. package/src/authTargetRedirects.ts +0 -46
  515. package/src/commandContext.ts +0 -27
  516. package/src/commands.ts +0 -404
  517. package/src/generatedApiLedgerCleanup.test.ts +0 -72
  518. package/src/infraApiValidation.test.ts +0 -42
  519. package/src/infraValidation.ts +0 -99
  520. package/src/minikubeImageLifecycle.test.ts +0 -35
  521. package/src/projectDatabase.ts +0 -27
  522. package/src/projectEnvironment.ts +0 -51
  523. package/src/projectInfrastructure.ts +0 -221
  524. package/src/runtime.test.ts +0 -124
  525. package/src/runtime.ts +0 -234
  526. package/src/secretStore.test.ts +0 -76
  527. package/src/secretStore.ts +0 -44
  528. package/src/types.ts +0 -82
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infraCli.js","sourceRoot":"","sources":["../../src/types/infraCli.ts"],"names":[],"mappings":"","sourcesContent":["import type { AnkhCapabilityId } from '@ankhorage/contracts/cli';\nimport type { AppEnvironmentId } from '@ankhorage/contracts/environments';\nimport type { InfraEnvironmentSpec } from '@ankhorage/contracts/infra';\n\nimport type { readStoredInfraStateAsync } from '../features/environment-lifecycle/adapters/outbound/readStoredInfraStateAsync.js';\nimport type { removeStoredInfraStateAsync } from '../features/environment-lifecycle/adapters/outbound/removeStoredInfraStateAsync.js';\nimport type { writeInfraGeneratedArtifactsAsync } from '../features/environment-lifecycle/adapters/outbound/writeInfraGeneratedArtifactsAsync.js';\nimport type { writeStoredInfraStateAsync } from '../features/environment-lifecycle/adapters/outbound/writeStoredInfraStateAsync.js';\nimport type { destroyInfraEnvironmentAsync } from '../features/environment-lifecycle/application/use-cases/destroyInfraEnvironmentAsync.js';\nimport type { downInfraEnvironmentAsync } from '../features/environment-lifecycle/application/use-cases/downInfraEnvironmentAsync.js';\nimport type { generateInfraEnvironmentAsync } from '../features/environment-lifecycle/application/use-cases/generateInfraEnvironmentAsync.js';\nimport type { getInfraEnvironmentOutputs } from '../features/environment-lifecycle/application/use-cases/getInfraEnvironmentOutputs.js';\nimport type { planInfraEnvironmentAsync } from '../features/environment-lifecycle/application/use-cases/planInfraEnvironmentAsync.js';\nimport type { statusInfraEnvironmentAsync } from '../features/environment-lifecycle/application/use-cases/statusInfraEnvironmentAsync.js';\nimport type { upInfraEnvironmentAsync } from '../features/environment-lifecycle/application/use-cases/upInfraEnvironmentAsync.js';\nimport type { validateInfraEnvironmentAsync } from '../features/environment-lifecycle/application/use-cases/validateInfraEnvironmentAsync.js';\nimport type {\n InfraOperationRequest,\n InfraOrchestrationDependencies,\n InfraStoredState,\n} from './infraOrchestration.js';\nimport type { ResolvedInfraProject } from './infraProject.js';\n\ntype InfraCommandName =\n 'validate' | 'plan' | 'generate' | 'up' | 'status' | 'outputs' | 'down' | 'destroy';\n\nexport interface InfraCommandContext {\n readonly cwd: string;\n readonly env: Readonly<Record<string, string | undefined>>;\n readonly version: string;\n writeStdout(text: string): void;\n writeStderr(text: string): void;\n}\n\nexport interface InfraCommandRunResult {\n readonly exitCode: number;\n}\n\nexport interface ParsedInfraArguments {\n readonly projectId?: string;\n readonly environment?: AppEnvironmentId;\n readonly format: 'human' | 'json' | 'env';\n readonly confirmation?: string;\n readonly deleteResources: readonly string[];\n}\n\nexport interface InfraCommandRunRequest {\n readonly context: InfraCommandContext;\n readonly arguments: ParsedInfraArguments;\n}\n\ntype InfraCommandImplementation = (\n request: InfraCommandRunRequest,\n services: InfraCommandServices,\n) => Promise<InfraCommandRunResult>;\n\nexport interface InfraCommandDefinition {\n readonly capability: AnkhCapabilityId;\n readonly path: readonly [InfraCommandName];\n readonly standaloneName: InfraCommandName;\n readonly summary: string;\n readonly run: InfraCommandImplementation;\n}\n\nexport interface InfraCommandInvocation {\n readonly argv: readonly string[];\n readonly command: InfraCommandDefinition;\n readonly context: InfraCommandContext;\n}\n\nexport interface InfraLifecycleOperations {\n readonly validate: typeof validateInfraEnvironmentAsync;\n readonly plan: typeof planInfraEnvironmentAsync;\n readonly generate: typeof generateInfraEnvironmentAsync;\n readonly up: typeof upInfraEnvironmentAsync;\n readonly status: typeof statusInfraEnvironmentAsync;\n readonly outputs: typeof getInfraEnvironmentOutputs;\n readonly down: typeof downInfraEnvironmentAsync;\n readonly destroy: typeof destroyInfraEnvironmentAsync;\n}\n\nexport interface InfraCommandServices {\n readonly resolveProject: (options: {\n readonly cwd: string;\n readonly projectId?: string;\n }) => Promise<ResolvedInfraProject>;\n readonly readState: typeof readStoredInfraStateAsync;\n readonly writeState: typeof writeStoredInfraStateAsync;\n readonly removeState: typeof removeStoredInfraStateAsync;\n readonly writeArtifacts: typeof writeInfraGeneratedArtifactsAsync;\n readonly operations: InfraLifecycleOperations;\n readonly createDependencies: (context: InfraCommandContext) => InfraOrchestrationDependencies;\n}\n\nexport interface RunInfraCommandOptions {\n readonly services?: Partial<InfraCommandServices>;\n}\n\nexport interface CreateInfraRuntimeProviderOptions {\n readonly runCommandImpl?: RunInfraCommandImpl;\n readonly services?: Partial<InfraCommandServices>;\n}\n\nexport type RunInfraCommandImpl = (\n request: InfraCommandInvocation,\n options?: RunInfraCommandOptions,\n) => Promise<InfraCommandRunResult>;\n\nexport interface PreparedInfraCommandOperation {\n readonly project: ResolvedInfraProject;\n readonly state: InfraStoredState | null;\n readonly desired: InfraEnvironmentSpec;\n readonly operation: InfraOperationRequest;\n readonly dependencies: InfraOrchestrationDependencies;\n}\n"]}
@@ -0,0 +1,84 @@
1
+ import type { AppEnvironmentId } from '@ankhorage/contracts/environments';
2
+ import type { InfraComputeAdapter, InfraComputeSnapshot, InfraComputeTarget, InfraDestroyRequest, InfraEnvironmentSpec, InfraExecutionContext, InfraGeneratedArtifact, InfraLedger, InfraManifest, InfraOutput, InfraOwnedResource, InfraPlan, InfraResult, InfraRuntimeAdapter, InfraRuntimeDesiredState, InfraServiceAdapter, InfraStatus } from '@ankhorage/contracts/infra';
3
+ import type { InfraAdapterPackageResolver } from '../features/environment-lifecycle/application/ports/outbound/infraAdapterPackage.js';
4
+ export interface ResolvedInfraEnvironment {
5
+ readonly id: AppEnvironmentId;
6
+ readonly desired: InfraEnvironmentSpec;
7
+ readonly manifest: InfraManifest;
8
+ }
9
+ export interface InfraEnvironmentResolutionRequest {
10
+ readonly environment?: string;
11
+ readonly manifest: InfraManifest;
12
+ readonly operation: 'validate' | 'plan' | 'generate' | 'up' | 'status' | 'outputs' | 'down' | 'destroy';
13
+ }
14
+ export interface ResolvedInfraAdapters {
15
+ readonly compute: InfraComputeAdapter;
16
+ readonly runtime: InfraRuntimeAdapter;
17
+ readonly services: readonly InfraServiceAdapter[];
18
+ }
19
+ export interface InfraStoredState {
20
+ readonly schemaVersion: 1;
21
+ readonly desired: InfraEnvironmentSpec;
22
+ readonly ledger: InfraLedger;
23
+ }
24
+ export interface PreparedInfraOperation {
25
+ readonly environment: ResolvedInfraEnvironment;
26
+ readonly context: InfraExecutionContext;
27
+ readonly adapters: ResolvedInfraAdapters;
28
+ readonly compute: InfraComputeSnapshot;
29
+ readonly runtimeDesired: InfraRuntimeDesiredState;
30
+ }
31
+ export interface InfraOrchestrationDependencies {
32
+ readonly adapterResolver: InfraAdapterPackageResolver;
33
+ readonly credentials: InfraExecutionContext['credentials'];
34
+ readonly secrets: InfraExecutionContext['secrets'];
35
+ }
36
+ export interface InfraOperationRequest {
37
+ readonly projectId: string;
38
+ readonly manifest: InfraManifest;
39
+ readonly environment?: string;
40
+ readonly previous?: InfraLedger;
41
+ readonly previousDesired?: InfraEnvironmentSpec;
42
+ readonly signal?: AbortSignal;
43
+ }
44
+ export interface InfraDestroyOperationRequest extends InfraOperationRequest {
45
+ readonly confirmation: InfraDestroyRequest['confirmation'];
46
+ readonly persistence: InfraDestroyRequest['persistence'];
47
+ }
48
+ export interface InfraValidateResult {
49
+ readonly environment: AppEnvironmentId;
50
+ }
51
+ export type InfraValidateOperationResult = InfraResult<InfraValidateResult>;
52
+ export type InfraUpRequest = InfraOperationRequest;
53
+ export interface InfraUpResult {
54
+ readonly environment: AppEnvironmentId;
55
+ readonly targets: readonly InfraComputeTarget[];
56
+ readonly resources: readonly InfraOwnedResource[];
57
+ readonly outputs: readonly InfraOutput[];
58
+ readonly ledger: InfraLedger;
59
+ }
60
+ export type InfraUpOperationResult = InfraResult<InfraUpResult>;
61
+ export type InfraPlanOperationResult = InfraResult<InfraPlan>;
62
+ export interface InfraGenerateResult {
63
+ readonly environment: AppEnvironmentId;
64
+ readonly artifacts: readonly InfraGeneratedArtifact[];
65
+ readonly ledger: InfraLedger;
66
+ }
67
+ export type InfraGenerateOperationResult = InfraResult<InfraGenerateResult>;
68
+ export type InfraStatusOperationResult = InfraResult<InfraStatus>;
69
+ export interface InfraOutputsResult {
70
+ readonly environment: AppEnvironmentId;
71
+ readonly outputs: readonly InfraOutput[];
72
+ }
73
+ export type InfraOutputsOperationResult = InfraResult<InfraOutputsResult>;
74
+ export interface InfraDownResult {
75
+ readonly environment: AppEnvironmentId;
76
+ readonly ledger: InfraLedger;
77
+ }
78
+ export type InfraDownOperationResult = InfraResult<InfraDownResult>;
79
+ export interface InfraDestroyResult {
80
+ readonly environment: AppEnvironmentId;
81
+ readonly ledger: InfraLedger | null;
82
+ }
83
+ export type InfraDestroyOperationResult = InfraResult<InfraDestroyResult>;
84
+ //# sourceMappingURL=infraOrchestration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infraOrchestration.d.ts","sourceRoot":"","sources":["../../src/types/infraOrchestration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,WAAW,EACX,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qFAAqF,CAAC;AAEvI,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,EAAE,gBAAgB,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,oBAAoB,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;CAClC;AAED,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,SAAS,EAChB,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,IAAI,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;CACvF;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;CACnD;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,oBAAoB,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC9B;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,WAAW,EAAE,wBAAwB,CAAC;IAC/C,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,oBAAoB,CAAC;IACvC,QAAQ,CAAC,cAAc,EAAE,wBAAwB,CAAC;CACnD;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,eAAe,EAAE,2BAA2B,CAAC;IACtD,QAAQ,CAAC,WAAW,EAAE,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC3D,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;IAChC,QAAQ,CAAC,eAAe,CAAC,EAAE,oBAAoB,CAAC;IAChD,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B;AAED,MAAM,WAAW,4BAA6B,SAAQ,qBAAqB;IACzE,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAC,cAAc,CAAC,CAAC;IAC3D,QAAQ,CAAC,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;CAC1D;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC;CACxC;AAED,MAAM,MAAM,4BAA4B,GAAG,WAAW,CAAC,mBAAmB,CAAC,CAAC;AAE5E,MAAM,MAAM,cAAc,GAAG,qBAAqB,CAAC;AAEnD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAChD,QAAQ,CAAC,SAAS,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAClD,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC9B;AAED,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC,aAAa,CAAC,CAAC;AAEhE,MAAM,MAAM,wBAAwB,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAE9D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC;IACvC,QAAQ,CAAC,SAAS,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACtD,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC9B;AAED,MAAM,MAAM,4BAA4B,GAAG,WAAW,CAAC,mBAAmB,CAAC,CAAC;AAE5E,MAAM,MAAM,0BAA0B,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC;AAElE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;CAC1C;AAED,MAAM,MAAM,2BAA2B,GAAG,WAAW,CAAC,kBAAkB,CAAC,CAAC;AAE1E,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC9B;AAED,MAAM,MAAM,wBAAwB,GAAG,WAAW,CAAC,eAAe,CAAC,CAAC;AAEpE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;CACrC;AAED,MAAM,MAAM,2BAA2B,GAAG,WAAW,CAAC,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=infraOrchestration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infraOrchestration.js","sourceRoot":"","sources":["../../src/types/infraOrchestration.ts"],"names":[],"mappings":"","sourcesContent":["import type { AppEnvironmentId } from '@ankhorage/contracts/environments';\nimport type {\n InfraComputeAdapter,\n InfraComputeSnapshot,\n InfraComputeTarget,\n InfraDestroyRequest,\n InfraEnvironmentSpec,\n InfraExecutionContext,\n InfraGeneratedArtifact,\n InfraLedger,\n InfraManifest,\n InfraOutput,\n InfraOwnedResource,\n InfraPlan,\n InfraResult,\n InfraRuntimeAdapter,\n InfraRuntimeDesiredState,\n InfraServiceAdapter,\n InfraStatus,\n} from '@ankhorage/contracts/infra';\n\nimport type { InfraAdapterPackageResolver } from '../features/environment-lifecycle/application/ports/outbound/infraAdapterPackage.js';\n\nexport interface ResolvedInfraEnvironment {\n readonly id: AppEnvironmentId;\n readonly desired: InfraEnvironmentSpec;\n readonly manifest: InfraManifest;\n}\n\nexport interface InfraEnvironmentResolutionRequest {\n readonly environment?: string;\n readonly manifest: InfraManifest;\n readonly operation:\n 'validate' | 'plan' | 'generate' | 'up' | 'status' | 'outputs' | 'down' | 'destroy';\n}\n\nexport interface ResolvedInfraAdapters {\n readonly compute: InfraComputeAdapter;\n readonly runtime: InfraRuntimeAdapter;\n readonly services: readonly InfraServiceAdapter[];\n}\n\nexport interface InfraStoredState {\n readonly schemaVersion: 1;\n readonly desired: InfraEnvironmentSpec;\n readonly ledger: InfraLedger;\n}\n\nexport interface PreparedInfraOperation {\n readonly environment: ResolvedInfraEnvironment;\n readonly context: InfraExecutionContext;\n readonly adapters: ResolvedInfraAdapters;\n readonly compute: InfraComputeSnapshot;\n readonly runtimeDesired: InfraRuntimeDesiredState;\n}\n\nexport interface InfraOrchestrationDependencies {\n readonly adapterResolver: InfraAdapterPackageResolver;\n readonly credentials: InfraExecutionContext['credentials'];\n readonly secrets: InfraExecutionContext['secrets'];\n}\n\nexport interface InfraOperationRequest {\n readonly projectId: string;\n readonly manifest: InfraManifest;\n readonly environment?: string;\n readonly previous?: InfraLedger;\n readonly previousDesired?: InfraEnvironmentSpec;\n readonly signal?: AbortSignal;\n}\n\nexport interface InfraDestroyOperationRequest extends InfraOperationRequest {\n readonly confirmation: InfraDestroyRequest['confirmation'];\n readonly persistence: InfraDestroyRequest['persistence'];\n}\n\nexport interface InfraValidateResult {\n readonly environment: AppEnvironmentId;\n}\n\nexport type InfraValidateOperationResult = InfraResult<InfraValidateResult>;\n\nexport type InfraUpRequest = InfraOperationRequest;\n\nexport interface InfraUpResult {\n readonly environment: AppEnvironmentId;\n readonly targets: readonly InfraComputeTarget[];\n readonly resources: readonly InfraOwnedResource[];\n readonly outputs: readonly InfraOutput[];\n readonly ledger: InfraLedger;\n}\n\nexport type InfraUpOperationResult = InfraResult<InfraUpResult>;\n\nexport type InfraPlanOperationResult = InfraResult<InfraPlan>;\n\nexport interface InfraGenerateResult {\n readonly environment: AppEnvironmentId;\n readonly artifacts: readonly InfraGeneratedArtifact[];\n readonly ledger: InfraLedger;\n}\n\nexport type InfraGenerateOperationResult = InfraResult<InfraGenerateResult>;\n\nexport type InfraStatusOperationResult = InfraResult<InfraStatus>;\n\nexport interface InfraOutputsResult {\n readonly environment: AppEnvironmentId;\n readonly outputs: readonly InfraOutput[];\n}\n\nexport type InfraOutputsOperationResult = InfraResult<InfraOutputsResult>;\n\nexport interface InfraDownResult {\n readonly environment: AppEnvironmentId;\n readonly ledger: InfraLedger;\n}\n\nexport type InfraDownOperationResult = InfraResult<InfraDownResult>;\n\nexport interface InfraDestroyResult {\n readonly environment: AppEnvironmentId;\n readonly ledger: InfraLedger | null;\n}\n\nexport type InfraDestroyOperationResult = InfraResult<InfraDestroyResult>;\n"]}
@@ -0,0 +1,43 @@
1
+ import type { AppManifest } from '@ankhorage/contracts';
2
+ import type { AppEnvironmentId } from '@ankhorage/contracts/environments';
3
+ import type { InfraDestroyRequest, InfraManifest } from '@ankhorage/contracts/infra';
4
+ import type { InfraCommandServices } from './infraCli.js';
5
+ import type { InfraDestroyOperationResult, InfraDownOperationResult, InfraGenerateOperationResult, InfraOutputsOperationResult, InfraPlanOperationResult, InfraStatusOperationResult, InfraUpOperationResult, InfraValidateOperationResult } from './infraOrchestration.js';
6
+ export interface InfraArtifactWriteResult {
7
+ readonly written: number;
8
+ readonly removed: number;
9
+ }
10
+ export interface ResolvedInfraProject {
11
+ readonly appsRoot: string;
12
+ readonly manifest: AppManifest;
13
+ readonly manifestPath: string;
14
+ readonly projectId: string;
15
+ readonly projectPath: string;
16
+ readonly workspaceRoot: string;
17
+ }
18
+ export interface ProjectInfraOperationRequest {
19
+ readonly projectId: string;
20
+ readonly projectPath: string;
21
+ readonly manifest: InfraManifest;
22
+ readonly environment: AppEnvironmentId;
23
+ readonly executionEnvironment?: Readonly<Record<string, string | undefined>>;
24
+ readonly signal?: AbortSignal;
25
+ }
26
+ export interface ProjectInfraDestroyRequest extends ProjectInfraOperationRequest {
27
+ readonly confirmation: InfraDestroyRequest['confirmation'];
28
+ readonly persistence: InfraDestroyRequest['persistence'];
29
+ }
30
+ export interface ProjectInfraLifecycle {
31
+ validateAsync(request: ProjectInfraOperationRequest): Promise<InfraValidateOperationResult>;
32
+ planAsync(request: ProjectInfraOperationRequest): Promise<InfraPlanOperationResult>;
33
+ generateAsync(request: ProjectInfraOperationRequest): Promise<InfraGenerateOperationResult>;
34
+ upAsync(request: ProjectInfraOperationRequest): Promise<InfraUpOperationResult>;
35
+ statusAsync(request: ProjectInfraOperationRequest): Promise<InfraStatusOperationResult>;
36
+ outputsAsync(request: ProjectInfraOperationRequest): Promise<InfraOutputsOperationResult>;
37
+ downAsync(request: ProjectInfraOperationRequest): Promise<InfraDownOperationResult>;
38
+ destroyAsync(request: ProjectInfraDestroyRequest): Promise<InfraDestroyOperationResult>;
39
+ }
40
+ export interface CreateProjectInfraLifecycleOptions {
41
+ readonly services?: Partial<InfraCommandServices>;
42
+ }
43
+ //# sourceMappingURL=infraProject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infraProject.d.ts","sourceRoot":"","sources":["../../src/types/infraProject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAErF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EACV,2BAA2B,EAC3B,wBAAwB,EACxB,4BAA4B,EAC5B,2BAA2B,EAC3B,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,EACtB,4BAA4B,EAC7B,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC;IACvC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IAC7E,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B;AAED,MAAM,WAAW,0BAA2B,SAAQ,4BAA4B;IAC9E,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAC,cAAc,CAAC,CAAC;IAC3D,QAAQ,CAAC,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;CAC1D;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAC5F,SAAS,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACpF,aAAa,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAC5F,OAAO,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAChF,WAAW,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACxF,YAAY,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC1F,SAAS,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACpF,YAAY,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;CACzF;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACnD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=infraProject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infraProject.js","sourceRoot":"","sources":["../../src/types/infraProject.ts"],"names":[],"mappings":"","sourcesContent":["import type { AppManifest } from '@ankhorage/contracts';\nimport type { AppEnvironmentId } from '@ankhorage/contracts/environments';\nimport type { InfraDestroyRequest, InfraManifest } from '@ankhorage/contracts/infra';\n\nimport type { InfraCommandServices } from './infraCli.js';\nimport type {\n InfraDestroyOperationResult,\n InfraDownOperationResult,\n InfraGenerateOperationResult,\n InfraOutputsOperationResult,\n InfraPlanOperationResult,\n InfraStatusOperationResult,\n InfraUpOperationResult,\n InfraValidateOperationResult,\n} from './infraOrchestration.js';\n\nexport interface InfraArtifactWriteResult {\n readonly written: number;\n readonly removed: number;\n}\n\nexport interface ResolvedInfraProject {\n readonly appsRoot: string;\n readonly manifest: AppManifest;\n readonly manifestPath: string;\n readonly projectId: string;\n readonly projectPath: string;\n readonly workspaceRoot: string;\n}\n\nexport interface ProjectInfraOperationRequest {\n readonly projectId: string;\n readonly projectPath: string;\n readonly manifest: InfraManifest;\n readonly environment: AppEnvironmentId;\n readonly executionEnvironment?: Readonly<Record<string, string | undefined>>;\n readonly signal?: AbortSignal;\n}\n\nexport interface ProjectInfraDestroyRequest extends ProjectInfraOperationRequest {\n readonly confirmation: InfraDestroyRequest['confirmation'];\n readonly persistence: InfraDestroyRequest['persistence'];\n}\n\nexport interface ProjectInfraLifecycle {\n validateAsync(request: ProjectInfraOperationRequest): Promise<InfraValidateOperationResult>;\n planAsync(request: ProjectInfraOperationRequest): Promise<InfraPlanOperationResult>;\n generateAsync(request: ProjectInfraOperationRequest): Promise<InfraGenerateOperationResult>;\n upAsync(request: ProjectInfraOperationRequest): Promise<InfraUpOperationResult>;\n statusAsync(request: ProjectInfraOperationRequest): Promise<InfraStatusOperationResult>;\n outputsAsync(request: ProjectInfraOperationRequest): Promise<InfraOutputsOperationResult>;\n downAsync(request: ProjectInfraOperationRequest): Promise<InfraDownOperationResult>;\n destroyAsync(request: ProjectInfraDestroyRequest): Promise<InfraDestroyOperationResult>;\n}\n\nexport interface CreateProjectInfraLifecycleOptions {\n readonly services?: Partial<InfraCommandServices>;\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/infra",
3
3
  "type": "module",
4
- "version": "4.1.12",
4
+ "version": "5.1.0",
5
5
  "description": "Project-aware infrastructure generation library and executable Ankh provider for Ankhorage.",
6
6
  "homepage": "https://github.com/ankhorage/infra#readme",
7
7
  "bugs": {
@@ -35,8 +35,7 @@
35
35
  "openapi"
36
36
  ],
37
37
  "dependencies": {
38
- "@ankhorage/contracts": "^11.1.0",
39
- "@ankhorage/supabase-vault": "^0.2.12"
38
+ "@ankhorage/contracts": "^19.0.0"
40
39
  },
41
40
  "files": [
42
41
  "dist",
@@ -77,11 +76,13 @@
77
76
  "provider": "./dist/cli/index.js",
78
77
  "capabilities": [
79
78
  "infra.validate",
79
+ "infra.plan",
80
80
  "infra.generate",
81
- "infra.status",
82
81
  "infra.up",
82
+ "infra.status",
83
+ "infra.outputs",
83
84
  "infra.down",
84
- "infra.secret-store"
85
+ "infra.destroy"
85
86
  ]
86
87
  },
87
88
  "publishConfig": {
@@ -98,17 +99,26 @@
98
99
  "format:check": "ankhorage-prettier --check .",
99
100
  "prepack": "bun run build",
100
101
  "test": "bun test src",
101
- "test:e2e": "bun run test:e2e:supabase",
102
- "test:e2e:minikube": "ANKH_MINIKUBE_ISOLATION=1 bun test src/adapters/minikube/base/twoAppIsolation.integration.test.ts",
103
- "test:e2e:supabase": "ANKH_MINIKUBE_SUPABASE_ISOLATION=1 bun test src/adapters/minikube/base/twoAppIsolation.integration.test.ts",
102
+ "test:e2e": "ANKH_INFRA_COMPOSITION_E2E=1 bun test src/infraComposition.integration.test.ts",
104
103
  "typecheck": "bun x tsc --noEmit -p tsconfig.json",
104
+ "check-types": "bun run typecheck",
105
105
  "version-packages": "ankhorage-changeset version",
106
- "knip:check": "ankhorage-knip"
106
+ "knip:check": "ankhorage-knip",
107
+ "knip:test": "bun run knip:check"
107
108
  },
108
109
  "devDependencies": {
109
110
  "@ankhorage/ankh": "^0.8.11",
110
- "@ankhorage/devtools": "^1.13.0",
111
+ "@ankhorage/cerbos": "^0.2.0",
112
+ "@ankhorage/devtools": "^1.14.0",
113
+ "@ankhorage/docker-compose": "^0.4.0",
114
+ "@ankhorage/hetzner": "^0.3.0",
115
+ "@ankhorage/k3s": "^0.3.0",
116
+ "@ankhorage/local": "^0.3.0",
117
+ "@ankhorage/minikube": "^0.3.0",
111
118
  "@ankhorage/paradox": "^0.1.24",
119
+ "@ankhorage/r2": "^0.2.0",
120
+ "@ankhorage/supabase": "^0.2.0",
121
+ "@ankhorage/supabase-vault": "^0.3.1",
112
122
  "@types/bun": "^1.4.1",
113
123
  "@types/node": "^25.6.0",
114
124
  "typescript": "^5.9.3"
@@ -0,0 +1,79 @@
1
+ import type { InfraEnvironmentSpec } from '@ankhorage/contracts/infra';
2
+ import { expect, test } from 'bun:test';
3
+
4
+ import { createNodeInfraAdapterPackageResolver } from './features/environment-lifecycle/adapters/outbound/createNodeInfraAdapterPackageResolver.js';
5
+ import { resolveInfraAdaptersAsync } from './features/environment-lifecycle/application/use-cases/resolveInfraAdaptersAsync.js';
6
+
7
+ test('loads every published package in the required provider composition matrix', async () => {
8
+ const environments = [
9
+ environment('local', 'minikube'),
10
+ environment('local', 'k3s'),
11
+ environment('local', 'docker-compose'),
12
+ production(false),
13
+ production(true),
14
+ ];
15
+ const resolved = await Promise.all(
16
+ environments.map((desired) =>
17
+ resolveInfraAdaptersAsync(desired, createNodeInfraAdapterPackageResolver()),
18
+ ),
19
+ );
20
+ expect(resolved.every(({ ok }) => ok)).toBe(true);
21
+ expect(
22
+ new Set(
23
+ resolved.flatMap((result) =>
24
+ result.ok
25
+ ? [
26
+ result.value.compute.descriptor.id,
27
+ result.value.runtime.descriptor.id,
28
+ ...result.value.services.map(({ descriptor }) => descriptor.id),
29
+ ]
30
+ : [],
31
+ ),
32
+ ),
33
+ ).toEqual(
34
+ new Set([
35
+ 'local',
36
+ 'hetzner',
37
+ 'minikube',
38
+ 'k3s',
39
+ 'docker-compose',
40
+ 'supabase',
41
+ 'cerbos',
42
+ 'r2',
43
+ 'supabase-vault',
44
+ ]),
45
+ );
46
+ });
47
+
48
+ function environment(
49
+ compute: 'local',
50
+ runtime: 'minikube' | 'k3s' | 'docker-compose',
51
+ ): InfraEnvironmentSpec {
52
+ if (runtime === 'minikube') {
53
+ return {
54
+ deployment: { compute: { provider: compute }, runtime: { provider: runtime } },
55
+ database: { provider: 'supabase' },
56
+ };
57
+ }
58
+ return {
59
+ deployment: { compute: { provider: compute }, runtime: { provider: runtime } },
60
+ database: { provider: 'supabase' },
61
+ };
62
+ }
63
+
64
+ function production(withOptionalServices: boolean): InfraEnvironmentSpec {
65
+ return {
66
+ deployment: {
67
+ compute: { provider: 'hetzner', location: 'nbg1' },
68
+ runtime: { provider: 'k3s', topology: { servers: 1, agents: 0 } },
69
+ },
70
+ database: { provider: 'supabase' },
71
+ ...(withOptionalServices
72
+ ? {
73
+ objectStorage: { provider: 'r2' as const, buckets: ['media'] },
74
+ authz: { provider: 'cerbos' as const, kind: 'ABAC' as const },
75
+ secretStore: { provider: 'supabase-vault' as const },
76
+ }
77
+ : {}),
78
+ };
79
+ }
package/src/cli/bin.ts CHANGED
@@ -1,67 +1,8 @@
1
1
  #!/usr/bin/env bun
2
2
 
3
- import type { InfraCommandContext, InfraCommandRunResult } from '../commandContext.js';
4
- import { createDefaultCommandContext } from '../commandContext.js';
5
- import {
6
- findInfraCommandByStandaloneName,
7
- type InfraCommandServices,
8
- renderRootHelp,
9
- renderUnknownCommand,
10
- runInfraCommand,
11
- type RunInfraCommandImpl,
12
- } from '../commands.js';
13
-
14
- export interface InfraCliOptions {
15
- readonly context?: InfraCommandContext;
16
- readonly runCommandImpl?: RunInfraCommandImpl;
17
- readonly services?: Partial<InfraCommandServices>;
18
- }
19
-
20
- export async function runCli(
21
- argv: readonly string[],
22
- options: InfraCliOptions = {},
23
- ): Promise<InfraCommandRunResult> {
24
- const context = options.context ?? createDefaultCommandContext();
25
- const runCommand = options.runCommandImpl ?? runInfraCommand;
26
- const [firstToken, ...restTokens] = argv;
27
-
28
- if (firstToken === undefined || isHelpToken(firstToken)) {
29
- context.writeStdout(renderRootHelp(context.version));
30
- return { exitCode: 0 };
31
- }
32
-
33
- if (isVersionToken(firstToken)) {
34
- context.writeStdout(`${context.version}\n`);
35
- return { exitCode: 0 };
36
- }
37
-
38
- const command = findInfraCommandByStandaloneName(firstToken);
39
- if (command === null) {
40
- context.writeStderr(renderUnknownCommand(firstToken));
41
- return { exitCode: 1 };
42
- }
43
-
44
- return runCommand(
45
- {
46
- argv: restTokens,
47
- command,
48
- context,
49
- },
50
- {
51
- services: options.services,
52
- },
53
- );
54
- }
55
-
56
- function isHelpToken(value: string): boolean {
57
- return value === '--help' || value === '-h' || value === 'help';
58
- }
59
-
60
- function isVersionToken(value: string): boolean {
61
- return value === '--version' || value === '-v' || value === 'version';
62
- }
3
+ import { runInfraCliAsync } from './runInfraCliAsync.js';
63
4
 
64
5
  if (import.meta.main) {
65
- const result = await runCli(process.argv.slice(2));
6
+ const result = await runInfraCliAsync(process.argv.slice(2));
66
7
  process.exit(result.exitCode);
67
8
  }
@@ -1,137 +1,46 @@
1
- import type { AnkhDiscoveredPackage, AnkhLoadedProvider } from '@ankhorage/ankh';
2
- import {
3
- createPackageRegistry,
4
- createProviderRegistry,
5
- runCli as runAnkhCli,
6
- } from '@ankhorage/ankh';
7
1
  import { describe, expect, test } from 'bun:test';
8
2
 
9
3
  import { createCapturedCommandContext } from '../testSupport.js';
10
- import { runCli } from './bin.js';
11
- import { createInfraRuntimeProvider } from './index.js';
4
+ import { runInfraCliAsync } from './runInfraCliAsync.js';
12
5
 
13
- describe('standalone cli and provider-backed dispatch', () => {
14
- test('prints help and version for the standalone CLI', async () => {
6
+ describe('standalone Infra CLI', () => {
7
+ test('prints help/version and dispatches all commands through the shared runner', async () => {
15
8
  const help = createCapturedCommandContext('/workspace', '9.9.9');
16
9
  const version = createCapturedCommandContext('/workspace', '9.9.9');
17
-
18
- expect((await runCli([], { context: help.context })).exitCode).toBe(0);
19
- expect(help.stdout.value).toContain('ankhorage-infra <command> [project]');
20
- expect(help.stdout.value).not.toContain('port-forward');
21
-
22
- expect((await runCli(['--version'], { context: version.context })).exitCode).toBe(0);
10
+ expect((await runInfraCliAsync([], { context: help.context })).exitCode).toBe(0);
11
+ expect(help.stdout.value).toContain('ankhorage-infra <command>');
12
+ expect(help.stdout.value).toContain('destroy');
13
+ expect((await runInfraCliAsync(['--version'], { context: version.context })).exitCode).toBe(0);
23
14
  expect(version.stdout.value).toBe('9.9.9\n');
24
- });
25
15
 
26
- test('uses the shared command runner for standalone CLI dispatch', async () => {
27
- const captured = createCapturedCommandContext('/workspace');
28
16
  const calls: string[] = [];
29
-
30
- const result = await runCli(['validate', 'shop'], {
31
- context: captured.context,
32
- runCommandImpl(request) {
33
- calls.push(request.command.standaloneName);
34
- request.context.writeStdout(
35
- `ran:${request.command.standaloneName}:${request.argv.join(',')}\n`,
36
- );
37
- return Promise.resolve({ exitCode: 0 });
38
- },
39
- });
40
-
41
- expect(result.exitCode).toBe(0);
42
- expect(calls).toEqual(['validate']);
43
- expect(captured.stdout.value).toContain('ran:validate:shop');
44
- });
45
-
46
- test('routes provider-backed dispatch through @ankhorage/ankh', async () => {
47
- const captured = createCapturedCommandContext('/workspace');
48
- const calls: string[] = [];
49
- const provider = createInfraRuntimeProvider({
50
- runCommandImpl(request) {
51
- calls.push(request.command.standaloneName);
52
- request.context.writeStdout(`provider:${request.command.standaloneName}\n`);
53
- return Promise.resolve({ exitCode: 0 });
54
- },
55
- });
56
-
57
- const packageRegistry = createPackageRegistry([createDiscoveredPackage()]);
58
- const providerRegistry = createProviderRegistry([createLoadedProvider(provider)]);
59
-
60
- const result = await runAnkhCli(['infra', 'status', 'shop'], {
61
- context: captured.context,
62
- registry: packageRegistry,
63
- providerRegistry,
64
- });
65
-
66
- expect(result.exitCode).toBe(0);
67
- expect(calls).toEqual(['status']);
68
- expect(captured.stdout.value).toContain('provider:status');
69
- });
70
-
71
- test('uses the same injected shared runner from both surfaces', async () => {
72
- const standalone = createCapturedCommandContext('/workspace');
73
- const providerContext = createCapturedCommandContext('/workspace');
74
- const calls: string[] = [];
75
-
76
- const runCommandImpl = (request: {
77
- readonly argv: readonly string[];
78
- readonly command: { readonly standaloneName: string };
79
- readonly context: { writeStdout(text: string): void };
80
- }) => {
81
- calls.push(request.command.standaloneName);
82
- request.context.writeStdout(`shared:${request.command.standaloneName}\n`);
83
- return Promise.resolve({ exitCode: 0 });
84
- };
85
-
86
- await runCli(['generate', 'shop'], {
87
- context: standalone.context,
88
- runCommandImpl,
89
- });
90
-
91
- const provider = createInfraRuntimeProvider({ runCommandImpl });
92
- const packageRegistry = createPackageRegistry([createDiscoveredPackage()]);
93
- const providerRegistry = createProviderRegistry([createLoadedProvider(provider)]);
94
-
95
- await runAnkhCli(['infra', 'generate', 'shop'], {
96
- context: providerContext.context,
97
- registry: packageRegistry,
98
- providerRegistry,
99
- });
100
-
101
- expect(calls).toEqual(['generate', 'generate']);
102
- expect(standalone.stdout.value).toContain('shared:generate');
103
- expect(providerContext.stdout.value).toContain('shared:generate');
17
+ for (const name of [
18
+ 'validate',
19
+ 'plan',
20
+ 'generate',
21
+ 'up',
22
+ 'status',
23
+ 'outputs',
24
+ 'down',
25
+ 'destroy',
26
+ ]) {
27
+ await runInfraCliAsync([name, 'shop'], {
28
+ context: createCapturedCommandContext('/workspace').context,
29
+ runCommandImpl(request) {
30
+ calls.push(request.command.standaloneName);
31
+ return Promise.resolve({ exitCode: 0 });
32
+ },
33
+ });
34
+ }
35
+ expect(calls).toEqual([
36
+ 'validate',
37
+ 'plan',
38
+ 'generate',
39
+ 'up',
40
+ 'status',
41
+ 'outputs',
42
+ 'down',
43
+ 'destroy',
44
+ ]);
104
45
  });
105
46
  });
106
-
107
- function createDiscoveredPackage(): AnkhDiscoveredPackage {
108
- return {
109
- metadata: {
110
- category: 'infra',
111
- provider: './dist/cli/index.js',
112
- capabilities: ['infra.validate', 'infra.generate', 'infra.status', 'infra.up', 'infra.down'],
113
- },
114
- packageJsonPath: '/workspace/package.json',
115
- packageName: '@ankhorage/infra',
116
- packageRoot: '/workspace',
117
- source: 'workspace',
118
- };
119
- }
120
-
121
- function createLoadedProvider(
122
- provider: ReturnType<typeof createInfraRuntimeProvider>,
123
- ): AnkhLoadedProvider {
124
- return {
125
- discoveredPackage: createDiscoveredPackage(),
126
- manifest: {
127
- id: provider.id,
128
- category: provider.category,
129
- version: provider.version,
130
- capabilities: provider.capabilities,
131
- commands: provider.commands,
132
- },
133
- providerModuleDefaultExport: provider,
134
- providerModulePath: '/workspace/dist/cli/index.js',
135
- providerModuleUrl: 'file:///workspace/dist/cli/index.js',
136
- };
137
- }
@@ -0,0 +1,57 @@
1
+ import type { AppEnvironmentId } from '@ankhorage/contracts/environments';
2
+
3
+ import { INFRA_CAPABILITIES } from '../../constants.js';
4
+ import type { InfraCommandDefinition } from '../../types/infraCli.js';
5
+ import type { InfraDestroyOperationRequest } from '../../types/infraOrchestration.js';
6
+ import { prepareInfraCommandOperationAsync } from '../utils/prepareInfraCommandOperationAsync.js';
7
+ import { requireInfraSuccess } from '../utils/requireInfraSuccess.js';
8
+ import { resolveInfraPersistence } from '../utils/resolveInfraPersistence.js';
9
+ import { writeInfraStructured } from '../utils/writeInfraStructured.js';
10
+
11
+ /*** Define exact-scope destruction behind environment and persistent-resource confirmation. */
12
+ export const destroy = {
13
+ standaloneName: 'destroy',
14
+ path: ['destroy'],
15
+ capability: INFRA_CAPABILITIES[7],
16
+ summary: 'Destroy exact owned resources behind explicit confirmation.',
17
+ async run(request, services) {
18
+ const operation = await prepareInfraCommandOperationAsync(request, services, true);
19
+ const environment = requireEnvironment(request.arguments.environment);
20
+ const confirmation = `${operation.project.projectId}:${environment}`;
21
+ if (request.arguments.confirmation !== confirmation) {
22
+ throw new Error(`Infra destroy requires --confirm ${confirmation}.`);
23
+ }
24
+ const destroyRequest: InfraDestroyOperationRequest = {
25
+ ...operation.operation,
26
+ environment,
27
+ confirmation: { projectId: operation.project.projectId, environment },
28
+ persistence: resolveInfraPersistence(
29
+ operation.state?.ledger,
30
+ request.arguments.deleteResources,
31
+ ),
32
+ };
33
+ const result = await services.operations.destroy(destroyRequest, operation.dependencies);
34
+ requireInfraSuccess(result, request.context);
35
+ await services.writeArtifacts(operation.project.projectPath, [], operation.state?.ledger);
36
+ if (result.value.ledger === null) {
37
+ await services.removeState(operation.project.projectPath, environment);
38
+ } else {
39
+ await services.writeState(operation.project.projectPath, {
40
+ schemaVersion: 1,
41
+ desired: operation.desired,
42
+ ledger: result.value.ledger,
43
+ });
44
+ }
45
+ writeInfraStructured(request.context, request.arguments.format, {
46
+ environment: result.value.environment,
47
+ retainedResources: result.value.ledger?.resources.length ?? 0,
48
+ });
49
+ return { exitCode: 0 };
50
+ },
51
+ } as const satisfies InfraCommandDefinition;
52
+
53
+ /*** Require the explicit destroy environment after CLI parsing. */
54
+ function requireEnvironment(value: AppEnvironmentId | undefined): AppEnvironmentId {
55
+ if (value === undefined) throw new Error('Infra destroy requires an explicit environment.');
56
+ return value;
57
+ }