@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.
- package/CHANGELOG.md +16 -0
- package/README.md +21 -32
- package/dist/cli/bin.d.ts +1 -8
- package/dist/cli/bin.d.ts.map +1 -1
- package/dist/cli/bin.js +2 -34
- package/dist/cli/bin.js.map +1 -1
- package/dist/cli/commands/destroy.d.ts +11 -0
- package/dist/cli/commands/destroy.d.ts.map +1 -0
- package/dist/cli/commands/destroy.js +51 -0
- package/dist/cli/commands/destroy.js.map +1 -0
- package/dist/cli/commands/down.d.ts +11 -0
- package/dist/cli/commands/down.d.ts.map +1 -0
- package/dist/cli/commands/down.js +27 -0
- package/dist/cli/commands/down.js.map +1 -0
- package/dist/cli/commands/generate.d.ts +11 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/generate.js +29 -0
- package/dist/cli/commands/generate.js.map +1 -0
- package/dist/cli/commands/outputs.d.ts +11 -0
- package/dist/cli/commands/outputs.d.ts.map +1 -0
- package/dist/cli/commands/outputs.js +25 -0
- package/dist/cli/commands/outputs.js.map +1 -0
- package/dist/cli/commands/plan.d.ts +11 -0
- package/dist/cli/commands/plan.d.ts.map +1 -0
- package/dist/cli/commands/plan.js +19 -0
- package/dist/cli/commands/plan.js.map +1 -0
- package/dist/cli/commands/status.d.ts +11 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +19 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/up.d.ts +11 -0
- package/dist/cli/commands/up.d.ts.map +1 -0
- package/dist/cli/commands/up.js +28 -0
- package/dist/cli/commands/up.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +11 -0
- package/dist/cli/commands/validate.d.ts.map +1 -0
- package/dist/cli/commands/validate.js +19 -0
- package/dist/cli/commands/validate.js.map +1 -0
- package/dist/cli/constants.d.ts +66 -0
- package/dist/cli/constants.d.ts.map +1 -0
- package/dist/cli/constants.js +19 -0
- package/dist/cli/constants.js.map +1 -0
- package/dist/cli/createDefaultInfraCommandContext.d.ts +4 -0
- package/dist/cli/createDefaultInfraCommandContext.d.ts.map +1 -0
- package/dist/{commandContext.js → cli/createDefaultInfraCommandContext.js} +4 -3
- package/dist/cli/createDefaultInfraCommandContext.js.map +1 -0
- package/dist/cli/createInfraRuntimeProvider.d.ts +5 -0
- package/dist/cli/createInfraRuntimeProvider.d.ts.map +1 -0
- package/dist/cli/createInfraRuntimeProvider.js +22 -0
- package/dist/cli/createInfraRuntimeProvider.js.map +1 -0
- package/dist/cli/createProviderCommandDescriptors.d.ts +4 -0
- package/dist/cli/createProviderCommandDescriptors.d.ts.map +1 -0
- package/dist/cli/createProviderCommandDescriptors.js +6 -0
- package/dist/cli/createProviderCommandDescriptors.js.map +1 -0
- package/dist/cli/findInfraCommand.d.ts +4 -0
- package/dist/cli/findInfraCommand.d.ts.map +1 -0
- package/dist/cli/findInfraCommand.js +6 -0
- package/dist/cli/findInfraCommand.js.map +1 -0
- package/dist/cli/index.d.ts +3 -8
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2 -24
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/renderInfraRootHelp.d.ts +3 -0
- package/dist/cli/renderInfraRootHelp.d.ts.map +1 -0
- package/dist/cli/renderInfraRootHelp.js +21 -0
- package/dist/cli/renderInfraRootHelp.js.map +1 -0
- package/dist/cli/renderUnknownInfraCommand.d.ts +3 -0
- package/dist/cli/renderUnknownInfraCommand.d.ts.map +1 -0
- package/dist/cli/renderUnknownInfraCommand.js +5 -0
- package/dist/cli/renderUnknownInfraCommand.js.map +1 -0
- package/dist/cli/runInfraCliAsync.d.ts +10 -0
- package/dist/cli/runInfraCliAsync.d.ts.map +1 -0
- package/dist/cli/runInfraCliAsync.js +34 -0
- package/dist/cli/runInfraCliAsync.js.map +1 -0
- package/dist/cli/runInfraCommandAsync.d.ts +4 -0
- package/dist/cli/runInfraCommandAsync.d.ts.map +1 -0
- package/dist/cli/runInfraCommandAsync.js +100 -0
- package/dist/cli/runInfraCommandAsync.js.map +1 -0
- package/dist/cli/utils/prepareInfraCommandOperationAsync.d.ts +4 -0
- package/dist/cli/utils/prepareInfraCommandOperationAsync.d.ts.map +1 -0
- package/dist/cli/utils/prepareInfraCommandOperationAsync.js +45 -0
- package/dist/cli/utils/prepareInfraCommandOperationAsync.js.map +1 -0
- package/dist/cli/utils/requireInfraSuccess.d.ts +7 -0
- package/dist/cli/utils/requireInfraSuccess.d.ts.map +1 -0
- package/dist/cli/utils/requireInfraSuccess.js +17 -0
- package/dist/cli/utils/requireInfraSuccess.js.map +1 -0
- package/dist/cli/utils/resolveInfraPersistence.d.ts +4 -0
- package/dist/cli/utils/resolveInfraPersistence.d.ts.map +1 -0
- package/dist/cli/utils/resolveInfraPersistence.js +17 -0
- package/dist/cli/utils/resolveInfraPersistence.js.map +1 -0
- package/dist/cli/utils/writeInfraEnvironmentOutputs.d.ts +5 -0
- package/dist/cli/utils/writeInfraEnvironmentOutputs.d.ts.map +1 -0
- package/dist/cli/utils/writeInfraEnvironmentOutputs.js +16 -0
- package/dist/cli/utils/writeInfraEnvironmentOutputs.js.map +1 -0
- package/dist/cli/utils/writeInfraStructured.d.ts +4 -0
- package/dist/cli/utils/writeInfraStructured.d.ts.map +1 -0
- package/dist/cli/utils/writeInfraStructured.js +8 -0
- package/dist/cli/utils/writeInfraStructured.js.map +1 -0
- package/dist/constants.d.ts +10 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/{packageMetadata.js → constants.js} +6 -3
- package/dist/constants.js.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraCredentialPort.d.ts +4 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraCredentialPort.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraCredentialPort.js +35 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraCredentialPort.js.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraSecretPort.d.ts +4 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraSecretPort.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraSecretPort.js +23 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraSecretPort.js.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createNodeInfraAdapterPackageResolver.d.ts +4 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createNodeInfraAdapterPackageResolver.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createNodeInfraAdapterPackageResolver.js +9 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createNodeInfraAdapterPackageResolver.js.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/readStoredInfraStateAsync.d.ts +5 -0
- package/dist/features/environment-lifecycle/adapters/outbound/readStoredInfraStateAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/readStoredInfraStateAsync.js +28 -0
- package/dist/features/environment-lifecycle/adapters/outbound/readStoredInfraStateAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/removeStoredInfraStateAsync.d.ts +4 -0
- package/dist/features/environment-lifecycle/adapters/outbound/removeStoredInfraStateAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/removeStoredInfraStateAsync.js +7 -0
- package/dist/features/environment-lifecycle/adapters/outbound/removeStoredInfraStateAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/resolveInfraProjectAsync.d.ts +7 -0
- package/dist/features/environment-lifecycle/adapters/outbound/resolveInfraProjectAsync.d.ts.map +1 -0
- package/dist/{project.js → features/environment-lifecycle/adapters/outbound/resolveInfraProjectAsync.js} +10 -34
- package/dist/features/environment-lifecycle/adapters/outbound/resolveInfraProjectAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/writeInfraGeneratedArtifactsAsync.d.ts +5 -0
- package/dist/features/environment-lifecycle/adapters/outbound/writeInfraGeneratedArtifactsAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/writeInfraGeneratedArtifactsAsync.js +28 -0
- package/dist/features/environment-lifecycle/adapters/outbound/writeInfraGeneratedArtifactsAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/writeStoredInfraStateAsync.d.ts +4 -0
- package/dist/features/environment-lifecycle/adapters/outbound/writeStoredInfraStateAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/writeStoredInfraStateAsync.js +16 -0
- package/dist/features/environment-lifecycle/adapters/outbound/writeStoredInfraStateAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/ports/outbound/infraAdapterPackage.d.ts +9 -0
- package/dist/features/environment-lifecycle/application/ports/outbound/infraAdapterPackage.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/ports/outbound/infraAdapterPackage.js +2 -0
- package/dist/features/environment-lifecycle/application/ports/outbound/infraAdapterPackage.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/collectInfraWorkloadsAsync.d.ts +4 -0
- package/dist/features/environment-lifecycle/application/use-cases/collectInfraWorkloadsAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/collectInfraWorkloadsAsync.js +15 -0
- package/dist/features/environment-lifecycle/application/use-cases/collectInfraWorkloadsAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/destroyInfraEnvironmentAsync.d.ts +4 -0
- package/dist/features/environment-lifecycle/application/use-cases/destroyInfraEnvironmentAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/destroyInfraEnvironmentAsync.js +84 -0
- package/dist/features/environment-lifecycle/application/use-cases/destroyInfraEnvironmentAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/downInfraEnvironmentAsync.d.ts +4 -0
- package/dist/features/environment-lifecycle/application/use-cases/downInfraEnvironmentAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/downInfraEnvironmentAsync.js +55 -0
- package/dist/features/environment-lifecycle/application/use-cases/downInfraEnvironmentAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/generateInfraEnvironmentAsync.d.ts +4 -0
- package/dist/features/environment-lifecycle/application/use-cases/generateInfraEnvironmentAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/generateInfraEnvironmentAsync.js +38 -0
- package/dist/features/environment-lifecycle/application/use-cases/generateInfraEnvironmentAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/getInfraEnvironmentOutputs.d.ts +4 -0
- package/dist/features/environment-lifecycle/application/use-cases/getInfraEnvironmentOutputs.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/getInfraEnvironmentOutputs.js +34 -0
- package/dist/features/environment-lifecycle/application/use-cases/getInfraEnvironmentOutputs.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/planInfraEnvironmentAsync.d.ts +4 -0
- package/dist/features/environment-lifecycle/application/use-cases/planInfraEnvironmentAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/planInfraEnvironmentAsync.js +57 -0
- package/dist/features/environment-lifecycle/application/use-cases/planInfraEnvironmentAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/prepareInfraOperationAsync.d.ts +5 -0
- package/dist/features/environment-lifecycle/application/use-cases/prepareInfraOperationAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/prepareInfraOperationAsync.js +109 -0
- package/dist/features/environment-lifecycle/application/use-cases/prepareInfraOperationAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/resolveInfraAdaptersAsync.d.ts +6 -0
- package/dist/features/environment-lifecycle/application/use-cases/resolveInfraAdaptersAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/resolveInfraAdaptersAsync.js +181 -0
- package/dist/features/environment-lifecycle/application/use-cases/resolveInfraAdaptersAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/statusInfraEnvironmentAsync.d.ts +4 -0
- package/dist/features/environment-lifecycle/application/use-cases/statusInfraEnvironmentAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/statusInfraEnvironmentAsync.js +68 -0
- package/dist/features/environment-lifecycle/application/use-cases/statusInfraEnvironmentAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/upInfraEnvironmentAsync.d.ts +4 -0
- package/dist/features/environment-lifecycle/application/use-cases/upInfraEnvironmentAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/upInfraEnvironmentAsync.js +98 -0
- package/dist/features/environment-lifecycle/application/use-cases/upInfraEnvironmentAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/validateInfraAdaptersAsync.d.ts +5 -0
- package/dist/features/environment-lifecycle/application/use-cases/validateInfraAdaptersAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/validateInfraAdaptersAsync.js +17 -0
- package/dist/features/environment-lifecycle/application/use-cases/validateInfraAdaptersAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/validateInfraEnvironmentAsync.d.ts +4 -0
- package/dist/features/environment-lifecycle/application/use-cases/validateInfraEnvironmentAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/validateInfraEnvironmentAsync.js +13 -0
- package/dist/features/environment-lifecycle/application/use-cases/validateInfraEnvironmentAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/composition/createInfraCommandServices.d.ts +4 -0
- package/dist/features/environment-lifecycle/composition/createInfraCommandServices.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/composition/createInfraCommandServices.js +43 -0
- package/dist/features/environment-lifecycle/composition/createInfraCommandServices.js.map +1 -0
- package/dist/features/environment-lifecycle/composition/createProjectInfraLifecycle.d.ts +4 -0
- package/dist/features/environment-lifecycle/composition/createProjectInfraLifecycle.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/composition/createProjectInfraLifecycle.js +123 -0
- package/dist/features/environment-lifecycle/composition/createProjectInfraLifecycle.js.map +1 -0
- package/dist/features/environment-lifecycle/domain/orderInfraPlanActions.d.ts +4 -0
- package/dist/features/environment-lifecycle/domain/orderInfraPlanActions.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/domain/orderInfraPlanActions.js +54 -0
- package/dist/features/environment-lifecycle/domain/orderInfraPlanActions.js.map +1 -0
- package/dist/features/environment-lifecycle/domain/resolveInfraEnvironment.d.ts +5 -0
- package/dist/features/environment-lifecycle/domain/resolveInfraEnvironment.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/domain/resolveInfraEnvironment.js +39 -0
- package/dist/features/environment-lifecycle/domain/resolveInfraEnvironment.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/appendInfraFailure.d.ts +7 -0
- package/dist/features/environment-lifecycle/utils/appendInfraFailure.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/appendInfraFailure.js +5 -0
- package/dist/features/environment-lifecycle/utils/appendInfraFailure.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/createInfraExecutionContext.d.ts +5 -0
- package/dist/features/environment-lifecycle/utils/createInfraExecutionContext.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/createInfraExecutionContext.js +13 -0
- package/dist/features/environment-lifecycle/utils/createInfraExecutionContext.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/createInfraFailure.d.ts +4 -0
- package/dist/features/environment-lifecycle/utils/createInfraFailure.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/createInfraFailure.js +5 -0
- package/dist/features/environment-lifecycle/utils/createInfraFailure.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/createInfraLedger.d.ts +12 -0
- package/dist/features/environment-lifecycle/utils/createInfraLedger.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/createInfraLedger.js +14 -0
- package/dist/features/environment-lifecycle/utils/createInfraLedger.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/infraIdentityKey.d.ts +4 -0
- package/dist/features/environment-lifecycle/utils/infraIdentityKey.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/infraIdentityKey.js +5 -0
- package/dist/features/environment-lifecycle/utils/infraIdentityKey.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/isInfraStoredState.d.ts +4 -0
- package/dist/features/environment-lifecycle/utils/isInfraStoredState.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/isInfraStoredState.js +103 -0
- package/dist/features/environment-lifecycle/utils/isInfraStoredState.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/mergeInfraOutputs.d.ts +4 -0
- package/dist/features/environment-lifecycle/utils/mergeInfraOutputs.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/mergeInfraOutputs.js +10 -0
- package/dist/features/environment-lifecycle/utils/mergeInfraOutputs.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/mergeInfraResources.d.ts +4 -0
- package/dist/features/environment-lifecycle/utils/mergeInfraResources.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/mergeInfraResources.js +10 -0
- package/dist/features/environment-lifecycle/utils/mergeInfraResources.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/normalizeInfraEnvironmentKey.d.ts +3 -0
- package/dist/features/environment-lifecycle/utils/normalizeInfraEnvironmentKey.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/normalizeInfraEnvironmentKey.js +8 -0
- package/dist/features/environment-lifecycle/utils/normalizeInfraEnvironmentKey.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/resolveInfraStatePath.d.ts +4 -0
- package/dist/features/environment-lifecycle/utils/resolveInfraStatePath.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/resolveInfraStatePath.js +11 -0
- package/dist/features/environment-lifecycle/utils/resolveInfraStatePath.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/resolveProjectFile.d.ts +3 -0
- package/dist/features/environment-lifecycle/utils/resolveProjectFile.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/resolveProjectFile.js +19 -0
- package/dist/features/environment-lifecycle/utils/resolveProjectFile.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterOutputs.d.ts +4 -0
- package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterOutputs.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterOutputs.js +6 -0
- package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterOutputs.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterResources.d.ts +4 -0
- package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterResources.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterResources.js +6 -0
- package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterResources.js.map +1 -0
- package/dist/index.d.ts +16 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -15
- package/dist/index.js.map +1 -1
- package/dist/metadata/index.d.ts +1 -1
- package/dist/metadata/index.d.ts.map +1 -1
- package/dist/metadata/index.js +1 -1
- package/dist/metadata/index.js.map +1 -1
- package/dist/project/index.d.ts +8 -5
- package/dist/project/index.d.ts.map +1 -1
- package/dist/project/index.js +7 -5
- package/dist/project/index.js.map +1 -1
- package/dist/readme-usage.js +17 -26
- package/dist/readme-usage.js.map +1 -1
- package/dist/testSupport.d.ts +1 -1
- package/dist/testSupport.d.ts.map +1 -1
- package/dist/testSupport.js +11 -1
- package/dist/testSupport.js.map +1 -1
- package/dist/types/infraCli.d.ts +91 -0
- package/dist/types/infraCli.d.ts.map +1 -0
- package/dist/types/infraCli.js +2 -0
- package/dist/types/infraCli.js.map +1 -0
- package/dist/types/infraOrchestration.d.ts +84 -0
- package/dist/types/infraOrchestration.d.ts.map +1 -0
- package/dist/types/infraOrchestration.js +2 -0
- package/dist/types/infraOrchestration.js.map +1 -0
- package/dist/types/infraProject.d.ts +43 -0
- package/dist/types/infraProject.d.ts.map +1 -0
- package/dist/types/infraProject.js +2 -0
- package/dist/types/infraProject.js.map +1 -0
- package/package.json +20 -10
- package/src/adapterPackages.integration.test.ts +79 -0
- package/src/cli/bin.ts +2 -61
- package/src/cli/cli.test.ts +35 -126
- package/src/cli/commands/destroy.ts +57 -0
- package/src/cli/commands/down.ts +28 -0
- package/src/cli/commands/generate.ts +34 -0
- package/src/cli/commands/outputs.ts +25 -0
- package/src/cli/commands/plan.ts +20 -0
- package/src/cli/commands/status.ts +20 -0
- package/src/cli/commands/up.ts +29 -0
- package/src/cli/commands/validate.ts +20 -0
- package/src/cli/constants.ts +19 -0
- package/src/cli/createDefaultInfraCommandContext.ts +17 -0
- package/src/cli/createInfraRuntimeProvider.ts +35 -0
- package/src/cli/createProviderCommandDescriptors.ts +8 -0
- package/src/cli/findInfraCommand.ts +7 -0
- package/src/cli/index.test.ts +12 -20
- package/src/cli/index.ts +7 -49
- package/src/cli/renderInfraRootHelp.ts +23 -0
- package/src/cli/renderUnknownInfraCommand.ts +4 -0
- package/src/cli/runInfraCliAsync.ts +51 -0
- package/src/cli/runInfraCommandAsync.ts +114 -0
- package/src/cli/utils/prepareInfraCommandOperationAsync.ts +64 -0
- package/src/cli/utils/requireInfraSuccess.ts +24 -0
- package/src/cli/utils/resolveInfraPersistence.ts +22 -0
- package/src/cli/utils/writeInfraEnvironmentOutputs.ts +24 -0
- package/src/cli/utils/writeInfraStructured.ts +11 -0
- package/src/commands.test.ts +198 -196
- package/src/{packageMetadata.ts → constants.ts} +5 -2
- package/src/environmentLifecycle.test.ts +193 -0
- package/src/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraCredentialPort.ts +52 -0
- package/src/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraSecretPort.ts +32 -0
- package/src/features/environment-lifecycle/adapters/outbound/createNodeInfraAdapterPackageResolver.ts +10 -0
- package/src/features/environment-lifecycle/adapters/outbound/readStoredInfraStateAsync.ts +34 -0
- package/src/features/environment-lifecycle/adapters/outbound/removeStoredInfraStateAsync.ts +12 -0
- package/src/{project.ts → features/environment-lifecycle/adapters/outbound/resolveInfraProjectAsync.ts} +10 -45
- package/src/features/environment-lifecycle/adapters/outbound/writeInfraGeneratedArtifactsAsync.ts +34 -0
- package/src/features/environment-lifecycle/adapters/outbound/writeStoredInfraStateAsync.ts +21 -0
- package/src/features/environment-lifecycle/application/ports/outbound/infraAdapterPackage.ts +10 -0
- package/src/features/environment-lifecycle/application/use-cases/collectInfraWorkloadsAsync.ts +25 -0
- package/src/features/environment-lifecycle/application/use-cases/destroyInfraEnvironmentAsync.ts +119 -0
- package/src/features/environment-lifecycle/application/use-cases/downInfraEnvironmentAsync.ts +65 -0
- package/src/features/environment-lifecycle/application/use-cases/generateInfraEnvironmentAsync.ts +51 -0
- package/src/features/environment-lifecycle/application/use-cases/getInfraEnvironmentOutputs.ts +41 -0
- package/src/features/environment-lifecycle/application/use-cases/planInfraEnvironmentAsync.ts +67 -0
- package/src/features/environment-lifecycle/application/use-cases/prepareInfraOperationAsync.ts +137 -0
- package/src/features/environment-lifecycle/application/use-cases/resolveInfraAdaptersAsync.ts +257 -0
- package/src/features/environment-lifecycle/application/use-cases/statusInfraEnvironmentAsync.ts +80 -0
- package/src/features/environment-lifecycle/application/use-cases/upInfraEnvironmentAsync.ts +126 -0
- package/src/features/environment-lifecycle/application/use-cases/validateInfraAdaptersAsync.ts +25 -0
- package/src/features/environment-lifecycle/application/use-cases/validateInfraEnvironmentAsync.ts +21 -0
- package/src/features/environment-lifecycle/composition/createInfraCommandServices.ts +47 -0
- package/src/features/environment-lifecycle/composition/createProjectInfraLifecycle.ts +157 -0
- package/src/features/environment-lifecycle/domain/orderInfraPlanActions.ts +64 -0
- package/src/features/environment-lifecycle/domain/resolveInfraEnvironment.ts +62 -0
- package/src/features/environment-lifecycle/utils/appendInfraFailure.ts +9 -0
- package/src/features/environment-lifecycle/utils/createInfraExecutionContext.ts +24 -0
- package/src/features/environment-lifecycle/utils/createInfraFailure.ts +6 -0
- package/src/features/environment-lifecycle/utils/createInfraLedger.ts +30 -0
- package/src/features/environment-lifecycle/utils/infraIdentityKey.ts +6 -0
- package/src/features/environment-lifecycle/utils/isInfraStoredState.ts +141 -0
- package/src/features/environment-lifecycle/utils/mergeInfraOutputs.ts +14 -0
- package/src/features/environment-lifecycle/utils/mergeInfraResources.ts +14 -0
- package/src/features/environment-lifecycle/utils/normalizeInfraEnvironmentKey.ts +7 -0
- package/src/features/environment-lifecycle/utils/resolveInfraStatePath.ts +12 -0
- package/src/features/environment-lifecycle/utils/resolveProjectFile.ts +22 -0
- package/src/features/environment-lifecycle/utils/retainUnchangedAdapterOutputs.ts +15 -0
- package/src/features/environment-lifecycle/utils/retainUnchangedAdapterResources.ts +15 -0
- package/src/index.test.ts +22 -315
- package/src/index.ts +41 -53
- package/src/infraComposition.integration.test.ts +128 -0
- package/src/infraOperations.test.ts +386 -0
- package/src/infraUp.test.ts +260 -0
- package/src/metadata/index.ts +1 -1
- package/src/package.test.ts +4 -2
- package/src/project/index.test.ts +10 -188
- package/src/project/index.ts +15 -22
- package/src/project.test.ts +39 -189
- package/src/projectContractsParser.test.ts +2 -2
- package/src/projectInfrastructure.test.ts +121 -167
- package/src/projectLifecycle.test.ts +136 -0
- package/src/readme-usage.ts +17 -26
- package/src/testSupport.ts +12 -2
- package/src/types/infraCli.ts +115 -0
- package/src/types/infraOrchestration.ts +126 -0
- package/src/types/infraProject.ts +58 -0
- package/dist/adapters/minikube/auth/index.d.ts +0 -8
- package/dist/adapters/minikube/auth/index.d.ts.map +0 -1
- package/dist/adapters/minikube/auth/index.js +0 -29
- package/dist/adapters/minikube/auth/index.js.map +0 -1
- package/dist/adapters/minikube/auth/oauthRuntime.d.ts +0 -4
- package/dist/adapters/minikube/auth/oauthRuntime.d.ts.map +0 -1
- package/dist/adapters/minikube/auth/oauthRuntime.js +0 -138
- package/dist/adapters/minikube/auth/oauthRuntime.js.map +0 -1
- package/dist/adapters/minikube/auth/supabase/index.d.ts +0 -7
- package/dist/adapters/minikube/auth/supabase/index.d.ts.map +0 -1
- package/dist/adapters/minikube/auth/supabase/index.js +0 -232
- package/dist/adapters/minikube/auth/supabase/index.js.map +0 -1
- package/dist/adapters/minikube/auth/supabase/profile.d.ts +0 -20
- package/dist/adapters/minikube/auth/supabase/profile.d.ts.map +0 -1
- package/dist/adapters/minikube/auth/supabase/profile.js +0 -452
- package/dist/adapters/minikube/auth/supabase/profile.js.map +0 -1
- package/dist/adapters/minikube/auth/targetAwareOAuthRuntime.d.ts +0 -7
- package/dist/adapters/minikube/auth/targetAwareOAuthRuntime.d.ts.map +0 -1
- package/dist/adapters/minikube/auth/targetAwareOAuthRuntime.js +0 -104
- package/dist/adapters/minikube/auth/targetAwareOAuthRuntime.js.map +0 -1
- package/dist/adapters/minikube/authz/cerbos/index.d.ts +0 -13
- package/dist/adapters/minikube/authz/cerbos/index.d.ts.map +0 -1
- package/dist/adapters/minikube/authz/cerbos/index.js +0 -382
- package/dist/adapters/minikube/authz/cerbos/index.js.map +0 -1
- package/dist/adapters/minikube/authz/index.d.ts +0 -9
- package/dist/adapters/minikube/authz/index.d.ts.map +0 -1
- package/dist/adapters/minikube/authz/index.js +0 -23
- package/dist/adapters/minikube/authz/index.js.map +0 -1
- package/dist/adapters/minikube/base/index.d.ts +0 -14
- package/dist/adapters/minikube/base/index.d.ts.map +0 -1
- package/dist/adapters/minikube/base/index.js +0 -3433
- package/dist/adapters/minikube/base/index.js.map +0 -1
- package/dist/adapters/minikube/base/supabaseMigrations.d.ts +0 -2
- package/dist/adapters/minikube/base/supabaseMigrations.d.ts.map +0 -1
- package/dist/adapters/minikube/base/supabaseMigrations.js +0 -6
- package/dist/adapters/minikube/base/supabaseMigrations.js.map +0 -1
- package/dist/adapters/minikube/contracts.d.ts +0 -34
- package/dist/adapters/minikube/contracts.d.ts.map +0 -1
- package/dist/adapters/minikube/contracts.js +0 -10
- package/dist/adapters/minikube/contracts.js.map +0 -1
- package/dist/adapters/minikube/index.d.ts +0 -3
- package/dist/adapters/minikube/index.d.ts.map +0 -1
- package/dist/adapters/minikube/index.js +0 -136
- package/dist/adapters/minikube/index.js.map +0 -1
- package/dist/adapters/minikube/secrets/index.d.ts +0 -7
- package/dist/adapters/minikube/secrets/index.d.ts.map +0 -1
- package/dist/adapters/minikube/secrets/index.js +0 -13
- package/dist/adapters/minikube/secrets/index.js.map +0 -1
- package/dist/adapters/minikube/secrets/supabase-vault/index.d.ts +0 -8
- package/dist/adapters/minikube/secrets/supabase-vault/index.d.ts.map +0 -1
- package/dist/adapters/minikube/secrets/supabase-vault/index.js +0 -118
- package/dist/adapters/minikube/secrets/supabase-vault/index.js.map +0 -1
- package/dist/adapters/minikube/storage/index.d.ts +0 -7
- package/dist/adapters/minikube/storage/index.d.ts.map +0 -1
- package/dist/adapters/minikube/storage/index.js +0 -77
- package/dist/adapters/minikube/storage/index.js.map +0 -1
- package/dist/adapters/minikube/storage/supabase/index.d.ts +0 -7
- package/dist/adapters/minikube/storage/supabase/index.d.ts.map +0 -1
- package/dist/adapters/minikube/storage/supabase/index.js +0 -82
- package/dist/adapters/minikube/storage/supabase/index.js.map +0 -1
- package/dist/authRedirects.d.ts +0 -19
- package/dist/authRedirects.d.ts.map +0 -1
- package/dist/authRedirects.js +0 -80
- package/dist/authRedirects.js.map +0 -1
- package/dist/authTargetRedirects.d.ts +0 -12
- package/dist/authTargetRedirects.d.ts.map +0 -1
- package/dist/authTargetRedirects.js +0 -32
- package/dist/authTargetRedirects.js.map +0 -1
- package/dist/commandContext.d.ts +0 -12
- package/dist/commandContext.d.ts.map +0 -1
- package/dist/commandContext.js.map +0 -1
- package/dist/commands.d.ts +0 -95
- package/dist/commands.d.ts.map +0 -1
- package/dist/commands.js +0 -256
- package/dist/commands.js.map +0 -1
- package/dist/infraValidation.d.ts +0 -4
- package/dist/infraValidation.d.ts.map +0 -1
- package/dist/infraValidation.js +0 -63
- package/dist/infraValidation.js.map +0 -1
- package/dist/packageMetadata.d.ts +0 -10
- package/dist/packageMetadata.d.ts.map +0 -1
- package/dist/packageMetadata.js.map +0 -1
- package/dist/project.d.ts +0 -14
- package/dist/project.d.ts.map +0 -1
- package/dist/project.js.map +0 -1
- package/dist/projectDatabase.d.ts +0 -5
- package/dist/projectDatabase.d.ts.map +0 -1
- package/dist/projectDatabase.js +0 -22
- package/dist/projectDatabase.js.map +0 -1
- package/dist/projectEnvironment.d.ts +0 -6
- package/dist/projectEnvironment.d.ts.map +0 -1
- package/dist/projectEnvironment.js +0 -45
- package/dist/projectEnvironment.js.map +0 -1
- package/dist/projectInfrastructure.d.ts +0 -38
- package/dist/projectInfrastructure.d.ts.map +0 -1
- package/dist/projectInfrastructure.js +0 -145
- package/dist/projectInfrastructure.js.map +0 -1
- package/dist/runtime.d.ts +0 -54
- package/dist/runtime.d.ts.map +0 -1
- package/dist/runtime.js +0 -151
- package/dist/runtime.js.map +0 -1
- package/dist/secretStore.d.ts +0 -19
- package/dist/secretStore.d.ts.map +0 -1
- package/dist/secretStore.js +0 -22
- package/dist/secretStore.js.map +0 -1
- package/dist/types.d.ts +0 -70
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/src/adapters/minikube/README.md +0 -115
- package/src/adapters/minikube/appRuntimeServing.test.ts +0 -28
- package/src/adapters/minikube/auth/index.ts +0 -40
- package/src/adapters/minikube/auth/oauthRuntime.ts +0 -163
- package/src/adapters/minikube/auth/supabase/index.test.ts +0 -227
- package/src/adapters/minikube/auth/supabase/index.ts +0 -293
- package/src/adapters/minikube/auth/supabase/oauthRuntime.test.ts +0 -154
- package/src/adapters/minikube/auth/supabase/profile.integration.test.ts +0 -1028
- package/src/adapters/minikube/auth/supabase/profile.ts +0 -526
- package/src/adapters/minikube/auth/supabase/providerAssignments.test.ts +0 -36
- package/src/adapters/minikube/auth/targetAwareOAuthRuntime.test.ts +0 -83
- package/src/adapters/minikube/auth/targetAwareOAuthRuntime.ts +0 -136
- package/src/adapters/minikube/authz/cerbos/index.ts +0 -486
- package/src/adapters/minikube/authz/index.ts +0 -32
- package/src/adapters/minikube/base/appImageBuild.test.ts +0 -352
- package/src/adapters/minikube/base/index.test.ts +0 -693
- package/src/adapters/minikube/base/index.ts +0 -3763
- package/src/adapters/minikube/base/portForwardRuntime.test.ts +0 -624
- package/src/adapters/minikube/base/supabaseMigrations.test.ts +0 -168
- package/src/adapters/minikube/base/supabaseMigrations.ts +0 -5
- package/src/adapters/minikube/base/twoAppIsolation.integration.test.ts +0 -898
- package/src/adapters/minikube/base/upgradeReconciliation.test.ts +0 -135
- package/src/adapters/minikube/contracts.ts +0 -46
- package/src/adapters/minikube/index.ts +0 -172
- package/src/adapters/minikube/secrets/index.test.ts +0 -147
- package/src/adapters/minikube/secrets/index.ts +0 -19
- package/src/adapters/minikube/secrets/supabase-vault/index.ts +0 -139
- package/src/adapters/minikube/storage/index.ts +0 -91
- package/src/adapters/minikube/storage/supabase/index.ts +0 -108
- package/src/apiInfrastructure.test.ts +0 -69
- package/src/authRedirects.test.ts +0 -63
- package/src/authRedirects.ts +0 -113
- package/src/authTargetRedirects.test.ts +0 -62
- package/src/authTargetRedirects.ts +0 -46
- package/src/commandContext.ts +0 -27
- package/src/commands.ts +0 -404
- package/src/generatedApiLedgerCleanup.test.ts +0 -72
- package/src/infraApiValidation.test.ts +0 -42
- package/src/infraValidation.ts +0 -99
- package/src/minikubeImageLifecycle.test.ts +0 -35
- package/src/projectDatabase.ts +0 -27
- package/src/projectEnvironment.ts +0 -51
- package/src/projectInfrastructure.ts +0 -221
- package/src/runtime.test.ts +0 -124
- package/src/runtime.ts +0 -234
- package/src/secretStore.test.ts +0 -76
- package/src/secretStore.ts +0 -44
- package/src/types.ts +0 -82
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { promises as fs } from 'node:fs';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
|
|
5
|
+
import type { InfraEnvironmentSpec, InfraLedger, InfraResult } from '@ankhorage/contracts/infra';
|
|
6
|
+
import { afterEach, expect, test } from 'bun:test';
|
|
7
|
+
|
|
8
|
+
import { createProjectInfraLifecycle, readStoredInfraStateAsync } from './project/index.js';
|
|
9
|
+
import type { InfraLifecycleOperations } from './types/infraCli.js';
|
|
10
|
+
import type { InfraDestroyOperationRequest } from './types/infraOrchestration.js';
|
|
11
|
+
|
|
12
|
+
const temporaryPaths = new Set<string>();
|
|
13
|
+
|
|
14
|
+
afterEach(async () => {
|
|
15
|
+
await Promise.all(
|
|
16
|
+
[...temporaryPaths].map((entry) => fs.rm(entry, { force: true, recursive: true })),
|
|
17
|
+
);
|
|
18
|
+
temporaryPaths.clear();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
test('runs typed project lifecycle operations with canonical state and artifact ownership', async () => {
|
|
22
|
+
const projectPath = await fs.mkdtemp(path.join(os.tmpdir(), 'infra-project-lifecycle-'));
|
|
23
|
+
temporaryPaths.add(projectPath);
|
|
24
|
+
const destroyRequests: InfraDestroyOperationRequest[] = [];
|
|
25
|
+
const lifecycle = createProjectInfraLifecycle({
|
|
26
|
+
services: {
|
|
27
|
+
createDependencies: () => ({
|
|
28
|
+
adapterResolver: { loadAsync: () => Promise.resolve({}) },
|
|
29
|
+
credentials: { resolveAsync: () => Promise.resolve(success({})) },
|
|
30
|
+
secrets: { resolveAsync: () => Promise.resolve(success('secret')) },
|
|
31
|
+
}),
|
|
32
|
+
operations: createOperations(destroyRequests),
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
const request = {
|
|
36
|
+
projectId: 'sample',
|
|
37
|
+
projectPath,
|
|
38
|
+
manifest: { environments: { local: desired }, modules: [] },
|
|
39
|
+
environment: 'local' as const,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const generated = await lifecycle.generateAsync(request);
|
|
43
|
+
expect(generated.ok).toBe(true);
|
|
44
|
+
expect(await fs.readFile(path.join(projectPath, 'infra/example.txt'), 'utf8')).toBe('generated');
|
|
45
|
+
expect((await readStoredInfraStateAsync(projectPath, 'local'))?.ledger).toEqual(ledger);
|
|
46
|
+
|
|
47
|
+
const outputs = await lifecycle.outputsAsync(request);
|
|
48
|
+
expect(outputs.ok && outputs.value.outputs).toEqual(ledger.outputs);
|
|
49
|
+
|
|
50
|
+
const destroyed = await lifecycle.destroyAsync({
|
|
51
|
+
...request,
|
|
52
|
+
confirmation: { projectId: 'sample', environment: 'local' },
|
|
53
|
+
persistence: { policy: 'retain' },
|
|
54
|
+
});
|
|
55
|
+
expect(destroyed.ok).toBe(true);
|
|
56
|
+
expect(destroyRequests[0]?.confirmation).toEqual({ projectId: 'sample', environment: 'local' });
|
|
57
|
+
expect(await readStoredInfraStateAsync(projectPath, 'local')).toBeNull();
|
|
58
|
+
expect(await fileExists(path.join(projectPath, 'infra/example.txt'))).toBe(false);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const desired = {
|
|
62
|
+
deployment: {
|
|
63
|
+
compute: { provider: 'local' },
|
|
64
|
+
runtime: { provider: 'docker-compose' },
|
|
65
|
+
},
|
|
66
|
+
} as const satisfies InfraEnvironmentSpec;
|
|
67
|
+
|
|
68
|
+
const owner = {
|
|
69
|
+
projectId: 'sample',
|
|
70
|
+
environment: 'local',
|
|
71
|
+
adapter: 'docker-compose',
|
|
72
|
+
resourceId: 'runtime',
|
|
73
|
+
} as const;
|
|
74
|
+
|
|
75
|
+
const ledger = {
|
|
76
|
+
schemaVersion: 1,
|
|
77
|
+
projectId: 'sample',
|
|
78
|
+
environment: 'local',
|
|
79
|
+
targets: [],
|
|
80
|
+
resources: [],
|
|
81
|
+
outputs: [{ owner, name: 'url', visibility: 'public', value: 'https://example.test' }],
|
|
82
|
+
artifacts: [{ owner, path: 'infra/example.txt' }],
|
|
83
|
+
} as const satisfies InfraLedger;
|
|
84
|
+
|
|
85
|
+
/*** Create deterministic operation fakes while recording destructive authorization. */
|
|
86
|
+
function createOperations(
|
|
87
|
+
destroyRequests: InfraDestroyOperationRequest[],
|
|
88
|
+
): InfraLifecycleOperations {
|
|
89
|
+
return {
|
|
90
|
+
validate: () => Promise.resolve(success({ environment: 'local' })),
|
|
91
|
+
plan: (request) =>
|
|
92
|
+
Promise.resolve(success({ projectId: request.projectId, environment: 'local', actions: [] })),
|
|
93
|
+
generate: () =>
|
|
94
|
+
Promise.resolve(
|
|
95
|
+
success({
|
|
96
|
+
environment: 'local',
|
|
97
|
+
artifacts: [{ owner, path: 'infra/example.txt', content: 'generated' }],
|
|
98
|
+
ledger,
|
|
99
|
+
}),
|
|
100
|
+
),
|
|
101
|
+
up: () =>
|
|
102
|
+
Promise.resolve(
|
|
103
|
+
success({ environment: 'local', targets: [], resources: [], outputs: [], ledger }),
|
|
104
|
+
),
|
|
105
|
+
status: (request) =>
|
|
106
|
+
Promise.resolve(
|
|
107
|
+
success({
|
|
108
|
+
projectId: request.projectId,
|
|
109
|
+
environment: 'local',
|
|
110
|
+
state: 'ready',
|
|
111
|
+
resources: [],
|
|
112
|
+
}),
|
|
113
|
+
),
|
|
114
|
+
outputs: () => success({ environment: 'local', outputs: ledger.outputs }),
|
|
115
|
+
down: () => Promise.resolve(success({ environment: 'local', ledger })),
|
|
116
|
+
destroy: (request) => {
|
|
117
|
+
destroyRequests.push(request);
|
|
118
|
+
return Promise.resolve(success({ environment: 'local', ledger: null }));
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/*** Create one successful Infra result for operation fakes. */
|
|
124
|
+
function success<T>(value: T): InfraResult<T> {
|
|
125
|
+
return { ok: true, value, diagnostics: [] };
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/*** Report whether a generated artifact still exists. */
|
|
129
|
+
async function fileExists(filePath: string): Promise<boolean> {
|
|
130
|
+
try {
|
|
131
|
+
await fs.access(filePath);
|
|
132
|
+
return true;
|
|
133
|
+
} catch {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
}
|
package/src/readme-usage.ts
CHANGED
|
@@ -1,39 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { runInfraCliAsync } from './cli/runInfraCliAsync.js';
|
|
2
2
|
|
|
3
3
|
/***
|
|
4
|
-
* Provider
|
|
4
|
+
* Provider-neutral infrastructure lifecycle
|
|
5
5
|
*
|
|
6
|
-
* `@ankhorage/infra`
|
|
7
|
-
*
|
|
6
|
+
* `@ankhorage/infra` resolves only the compute, runtime, and service adapter packages selected by
|
|
7
|
+
* an environment-aware Infra manifest. Its typed use cases own orchestration, dependency ordering,
|
|
8
|
+
* safe outputs, deterministic artifacts, and environment-scoped ownership state. Provider packages
|
|
9
|
+
* own all technology-specific implementation.
|
|
8
10
|
*
|
|
9
|
-
* The
|
|
10
|
-
* `@ankhorage/infra/project` application-service boundary. Trusted hosts such
|
|
11
|
-
* as Studio should call that subpath instead of reproducing ledger, generated
|
|
12
|
-
* file, lifecycle-script, or port-forward configuration semantics.
|
|
13
|
-
*
|
|
14
|
-
* CLI entrypoints:
|
|
15
|
-
*
|
|
16
|
-
* - `ankh infra ...`
|
|
17
|
-
* - `bunx @ankhorage/infra ...`
|
|
18
|
-
*
|
|
19
|
-
* Current command surface:
|
|
11
|
+
* The standalone CLI and `ankh infra` expose the same lifecycle:
|
|
20
12
|
*
|
|
21
13
|
* - `validate`
|
|
14
|
+
* - `plan`
|
|
22
15
|
* - `generate`
|
|
23
|
-
* - `status`
|
|
24
16
|
* - `up`
|
|
17
|
+
* - `status`
|
|
18
|
+
* - `outputs`
|
|
25
19
|
* - `down`
|
|
20
|
+
* - `destroy`
|
|
26
21
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* Running applications can repair their provider-aware host endpoints through
|
|
33
|
-
* `ensureProjectInfrastructureRuntime()` from `@ankhorage/infra/project`. This
|
|
34
|
-
* operation only ensures the generated runtime port-forward group; it does not
|
|
35
|
-
* deploy, bootstrap, or reconcile infrastructure.
|
|
22
|
+
* `local` is the only default environment. Destruction always requires an explicit environment and
|
|
23
|
+
* exact `<project>:<environment>` confirmation. Persistent resources remain retained unless each
|
|
24
|
+
* exact owned resource is separately authorized with `--delete-resource <adapter>:<resourceId>`.
|
|
25
|
+
* Environment-style outputs print only explicitly public values with an environment-variable name;
|
|
26
|
+
* secret outputs remain references.
|
|
36
27
|
*
|
|
37
28
|
* @usage
|
|
38
29
|
*/
|
|
39
|
-
await
|
|
30
|
+
await runInfraCliAsync(['--help']);
|
package/src/testSupport.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { promises as fs } from 'fs';
|
|
|
3
3
|
import os from 'os';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
|
|
6
|
-
import type { InfraCommandContext } from './
|
|
6
|
+
import type { InfraCommandContext } from './types/infraCli.js';
|
|
7
7
|
|
|
8
8
|
export interface CapturedCommandContext {
|
|
9
9
|
readonly context: InfraCommandContext;
|
|
@@ -79,7 +79,17 @@ export async function createWorkspaceFixture(
|
|
|
79
79
|
|
|
80
80
|
export function createAppManifest(
|
|
81
81
|
projectId: string,
|
|
82
|
-
infra: AppManifest['infra'] = {
|
|
82
|
+
infra: AppManifest['infra'] = {
|
|
83
|
+
environments: {
|
|
84
|
+
local: {
|
|
85
|
+
deployment: {
|
|
86
|
+
compute: { provider: 'local' },
|
|
87
|
+
runtime: { provider: 'docker-compose' },
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
modules: [],
|
|
92
|
+
},
|
|
83
93
|
): AppManifest {
|
|
84
94
|
return {
|
|
85
95
|
metadata: {
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { AnkhCapabilityId } from '@ankhorage/contracts/cli';
|
|
2
|
+
import type { AppEnvironmentId } from '@ankhorage/contracts/environments';
|
|
3
|
+
import type { InfraEnvironmentSpec } from '@ankhorage/contracts/infra';
|
|
4
|
+
|
|
5
|
+
import type { readStoredInfraStateAsync } from '../features/environment-lifecycle/adapters/outbound/readStoredInfraStateAsync.js';
|
|
6
|
+
import type { removeStoredInfraStateAsync } from '../features/environment-lifecycle/adapters/outbound/removeStoredInfraStateAsync.js';
|
|
7
|
+
import type { writeInfraGeneratedArtifactsAsync } from '../features/environment-lifecycle/adapters/outbound/writeInfraGeneratedArtifactsAsync.js';
|
|
8
|
+
import type { writeStoredInfraStateAsync } from '../features/environment-lifecycle/adapters/outbound/writeStoredInfraStateAsync.js';
|
|
9
|
+
import type { destroyInfraEnvironmentAsync } from '../features/environment-lifecycle/application/use-cases/destroyInfraEnvironmentAsync.js';
|
|
10
|
+
import type { downInfraEnvironmentAsync } from '../features/environment-lifecycle/application/use-cases/downInfraEnvironmentAsync.js';
|
|
11
|
+
import type { generateInfraEnvironmentAsync } from '../features/environment-lifecycle/application/use-cases/generateInfraEnvironmentAsync.js';
|
|
12
|
+
import type { getInfraEnvironmentOutputs } from '../features/environment-lifecycle/application/use-cases/getInfraEnvironmentOutputs.js';
|
|
13
|
+
import type { planInfraEnvironmentAsync } from '../features/environment-lifecycle/application/use-cases/planInfraEnvironmentAsync.js';
|
|
14
|
+
import type { statusInfraEnvironmentAsync } from '../features/environment-lifecycle/application/use-cases/statusInfraEnvironmentAsync.js';
|
|
15
|
+
import type { upInfraEnvironmentAsync } from '../features/environment-lifecycle/application/use-cases/upInfraEnvironmentAsync.js';
|
|
16
|
+
import type { validateInfraEnvironmentAsync } from '../features/environment-lifecycle/application/use-cases/validateInfraEnvironmentAsync.js';
|
|
17
|
+
import type {
|
|
18
|
+
InfraOperationRequest,
|
|
19
|
+
InfraOrchestrationDependencies,
|
|
20
|
+
InfraStoredState,
|
|
21
|
+
} from './infraOrchestration.js';
|
|
22
|
+
import type { ResolvedInfraProject } from './infraProject.js';
|
|
23
|
+
|
|
24
|
+
type InfraCommandName =
|
|
25
|
+
'validate' | 'plan' | 'generate' | 'up' | 'status' | 'outputs' | 'down' | 'destroy';
|
|
26
|
+
|
|
27
|
+
export interface InfraCommandContext {
|
|
28
|
+
readonly cwd: string;
|
|
29
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
30
|
+
readonly version: string;
|
|
31
|
+
writeStdout(text: string): void;
|
|
32
|
+
writeStderr(text: string): void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface InfraCommandRunResult {
|
|
36
|
+
readonly exitCode: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface ParsedInfraArguments {
|
|
40
|
+
readonly projectId?: string;
|
|
41
|
+
readonly environment?: AppEnvironmentId;
|
|
42
|
+
readonly format: 'human' | 'json' | 'env';
|
|
43
|
+
readonly confirmation?: string;
|
|
44
|
+
readonly deleteResources: readonly string[];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface InfraCommandRunRequest {
|
|
48
|
+
readonly context: InfraCommandContext;
|
|
49
|
+
readonly arguments: ParsedInfraArguments;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
type InfraCommandImplementation = (
|
|
53
|
+
request: InfraCommandRunRequest,
|
|
54
|
+
services: InfraCommandServices,
|
|
55
|
+
) => Promise<InfraCommandRunResult>;
|
|
56
|
+
|
|
57
|
+
export interface InfraCommandDefinition {
|
|
58
|
+
readonly capability: AnkhCapabilityId;
|
|
59
|
+
readonly path: readonly [InfraCommandName];
|
|
60
|
+
readonly standaloneName: InfraCommandName;
|
|
61
|
+
readonly summary: string;
|
|
62
|
+
readonly run: InfraCommandImplementation;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface InfraCommandInvocation {
|
|
66
|
+
readonly argv: readonly string[];
|
|
67
|
+
readonly command: InfraCommandDefinition;
|
|
68
|
+
readonly context: InfraCommandContext;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface InfraLifecycleOperations {
|
|
72
|
+
readonly validate: typeof validateInfraEnvironmentAsync;
|
|
73
|
+
readonly plan: typeof planInfraEnvironmentAsync;
|
|
74
|
+
readonly generate: typeof generateInfraEnvironmentAsync;
|
|
75
|
+
readonly up: typeof upInfraEnvironmentAsync;
|
|
76
|
+
readonly status: typeof statusInfraEnvironmentAsync;
|
|
77
|
+
readonly outputs: typeof getInfraEnvironmentOutputs;
|
|
78
|
+
readonly down: typeof downInfraEnvironmentAsync;
|
|
79
|
+
readonly destroy: typeof destroyInfraEnvironmentAsync;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface InfraCommandServices {
|
|
83
|
+
readonly resolveProject: (options: {
|
|
84
|
+
readonly cwd: string;
|
|
85
|
+
readonly projectId?: string;
|
|
86
|
+
}) => Promise<ResolvedInfraProject>;
|
|
87
|
+
readonly readState: typeof readStoredInfraStateAsync;
|
|
88
|
+
readonly writeState: typeof writeStoredInfraStateAsync;
|
|
89
|
+
readonly removeState: typeof removeStoredInfraStateAsync;
|
|
90
|
+
readonly writeArtifacts: typeof writeInfraGeneratedArtifactsAsync;
|
|
91
|
+
readonly operations: InfraLifecycleOperations;
|
|
92
|
+
readonly createDependencies: (context: InfraCommandContext) => InfraOrchestrationDependencies;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface RunInfraCommandOptions {
|
|
96
|
+
readonly services?: Partial<InfraCommandServices>;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface CreateInfraRuntimeProviderOptions {
|
|
100
|
+
readonly runCommandImpl?: RunInfraCommandImpl;
|
|
101
|
+
readonly services?: Partial<InfraCommandServices>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export type RunInfraCommandImpl = (
|
|
105
|
+
request: InfraCommandInvocation,
|
|
106
|
+
options?: RunInfraCommandOptions,
|
|
107
|
+
) => Promise<InfraCommandRunResult>;
|
|
108
|
+
|
|
109
|
+
export interface PreparedInfraCommandOperation {
|
|
110
|
+
readonly project: ResolvedInfraProject;
|
|
111
|
+
readonly state: InfraStoredState | null;
|
|
112
|
+
readonly desired: InfraEnvironmentSpec;
|
|
113
|
+
readonly operation: InfraOperationRequest;
|
|
114
|
+
readonly dependencies: InfraOrchestrationDependencies;
|
|
115
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { AppEnvironmentId } from '@ankhorage/contracts/environments';
|
|
2
|
+
import type {
|
|
3
|
+
InfraComputeAdapter,
|
|
4
|
+
InfraComputeSnapshot,
|
|
5
|
+
InfraComputeTarget,
|
|
6
|
+
InfraDestroyRequest,
|
|
7
|
+
InfraEnvironmentSpec,
|
|
8
|
+
InfraExecutionContext,
|
|
9
|
+
InfraGeneratedArtifact,
|
|
10
|
+
InfraLedger,
|
|
11
|
+
InfraManifest,
|
|
12
|
+
InfraOutput,
|
|
13
|
+
InfraOwnedResource,
|
|
14
|
+
InfraPlan,
|
|
15
|
+
InfraResult,
|
|
16
|
+
InfraRuntimeAdapter,
|
|
17
|
+
InfraRuntimeDesiredState,
|
|
18
|
+
InfraServiceAdapter,
|
|
19
|
+
InfraStatus,
|
|
20
|
+
} from '@ankhorage/contracts/infra';
|
|
21
|
+
|
|
22
|
+
import type { InfraAdapterPackageResolver } from '../features/environment-lifecycle/application/ports/outbound/infraAdapterPackage.js';
|
|
23
|
+
|
|
24
|
+
export interface ResolvedInfraEnvironment {
|
|
25
|
+
readonly id: AppEnvironmentId;
|
|
26
|
+
readonly desired: InfraEnvironmentSpec;
|
|
27
|
+
readonly manifest: InfraManifest;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface InfraEnvironmentResolutionRequest {
|
|
31
|
+
readonly environment?: string;
|
|
32
|
+
readonly manifest: InfraManifest;
|
|
33
|
+
readonly operation:
|
|
34
|
+
'validate' | 'plan' | 'generate' | 'up' | 'status' | 'outputs' | 'down' | 'destroy';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface ResolvedInfraAdapters {
|
|
38
|
+
readonly compute: InfraComputeAdapter;
|
|
39
|
+
readonly runtime: InfraRuntimeAdapter;
|
|
40
|
+
readonly services: readonly InfraServiceAdapter[];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface InfraStoredState {
|
|
44
|
+
readonly schemaVersion: 1;
|
|
45
|
+
readonly desired: InfraEnvironmentSpec;
|
|
46
|
+
readonly ledger: InfraLedger;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface PreparedInfraOperation {
|
|
50
|
+
readonly environment: ResolvedInfraEnvironment;
|
|
51
|
+
readonly context: InfraExecutionContext;
|
|
52
|
+
readonly adapters: ResolvedInfraAdapters;
|
|
53
|
+
readonly compute: InfraComputeSnapshot;
|
|
54
|
+
readonly runtimeDesired: InfraRuntimeDesiredState;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface InfraOrchestrationDependencies {
|
|
58
|
+
readonly adapterResolver: InfraAdapterPackageResolver;
|
|
59
|
+
readonly credentials: InfraExecutionContext['credentials'];
|
|
60
|
+
readonly secrets: InfraExecutionContext['secrets'];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface InfraOperationRequest {
|
|
64
|
+
readonly projectId: string;
|
|
65
|
+
readonly manifest: InfraManifest;
|
|
66
|
+
readonly environment?: string;
|
|
67
|
+
readonly previous?: InfraLedger;
|
|
68
|
+
readonly previousDesired?: InfraEnvironmentSpec;
|
|
69
|
+
readonly signal?: AbortSignal;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface InfraDestroyOperationRequest extends InfraOperationRequest {
|
|
73
|
+
readonly confirmation: InfraDestroyRequest['confirmation'];
|
|
74
|
+
readonly persistence: InfraDestroyRequest['persistence'];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface InfraValidateResult {
|
|
78
|
+
readonly environment: AppEnvironmentId;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type InfraValidateOperationResult = InfraResult<InfraValidateResult>;
|
|
82
|
+
|
|
83
|
+
export type InfraUpRequest = InfraOperationRequest;
|
|
84
|
+
|
|
85
|
+
export interface InfraUpResult {
|
|
86
|
+
readonly environment: AppEnvironmentId;
|
|
87
|
+
readonly targets: readonly InfraComputeTarget[];
|
|
88
|
+
readonly resources: readonly InfraOwnedResource[];
|
|
89
|
+
readonly outputs: readonly InfraOutput[];
|
|
90
|
+
readonly ledger: InfraLedger;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export type InfraUpOperationResult = InfraResult<InfraUpResult>;
|
|
94
|
+
|
|
95
|
+
export type InfraPlanOperationResult = InfraResult<InfraPlan>;
|
|
96
|
+
|
|
97
|
+
export interface InfraGenerateResult {
|
|
98
|
+
readonly environment: AppEnvironmentId;
|
|
99
|
+
readonly artifacts: readonly InfraGeneratedArtifact[];
|
|
100
|
+
readonly ledger: InfraLedger;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export type InfraGenerateOperationResult = InfraResult<InfraGenerateResult>;
|
|
104
|
+
|
|
105
|
+
export type InfraStatusOperationResult = InfraResult<InfraStatus>;
|
|
106
|
+
|
|
107
|
+
export interface InfraOutputsResult {
|
|
108
|
+
readonly environment: AppEnvironmentId;
|
|
109
|
+
readonly outputs: readonly InfraOutput[];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export type InfraOutputsOperationResult = InfraResult<InfraOutputsResult>;
|
|
113
|
+
|
|
114
|
+
export interface InfraDownResult {
|
|
115
|
+
readonly environment: AppEnvironmentId;
|
|
116
|
+
readonly ledger: InfraLedger;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export type InfraDownOperationResult = InfraResult<InfraDownResult>;
|
|
120
|
+
|
|
121
|
+
export interface InfraDestroyResult {
|
|
122
|
+
readonly environment: AppEnvironmentId;
|
|
123
|
+
readonly ledger: InfraLedger | null;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export type InfraDestroyOperationResult = InfraResult<InfraDestroyResult>;
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
|
|
5
|
+
import type { InfraCommandServices } from './infraCli.js';
|
|
6
|
+
import type {
|
|
7
|
+
InfraDestroyOperationResult,
|
|
8
|
+
InfraDownOperationResult,
|
|
9
|
+
InfraGenerateOperationResult,
|
|
10
|
+
InfraOutputsOperationResult,
|
|
11
|
+
InfraPlanOperationResult,
|
|
12
|
+
InfraStatusOperationResult,
|
|
13
|
+
InfraUpOperationResult,
|
|
14
|
+
InfraValidateOperationResult,
|
|
15
|
+
} from './infraOrchestration.js';
|
|
16
|
+
|
|
17
|
+
export interface InfraArtifactWriteResult {
|
|
18
|
+
readonly written: number;
|
|
19
|
+
readonly removed: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ResolvedInfraProject {
|
|
23
|
+
readonly appsRoot: string;
|
|
24
|
+
readonly manifest: AppManifest;
|
|
25
|
+
readonly manifestPath: string;
|
|
26
|
+
readonly projectId: string;
|
|
27
|
+
readonly projectPath: string;
|
|
28
|
+
readonly workspaceRoot: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ProjectInfraOperationRequest {
|
|
32
|
+
readonly projectId: string;
|
|
33
|
+
readonly projectPath: string;
|
|
34
|
+
readonly manifest: InfraManifest;
|
|
35
|
+
readonly environment: AppEnvironmentId;
|
|
36
|
+
readonly executionEnvironment?: Readonly<Record<string, string | undefined>>;
|
|
37
|
+
readonly signal?: AbortSignal;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface ProjectInfraDestroyRequest extends ProjectInfraOperationRequest {
|
|
41
|
+
readonly confirmation: InfraDestroyRequest['confirmation'];
|
|
42
|
+
readonly persistence: InfraDestroyRequest['persistence'];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface ProjectInfraLifecycle {
|
|
46
|
+
validateAsync(request: ProjectInfraOperationRequest): Promise<InfraValidateOperationResult>;
|
|
47
|
+
planAsync(request: ProjectInfraOperationRequest): Promise<InfraPlanOperationResult>;
|
|
48
|
+
generateAsync(request: ProjectInfraOperationRequest): Promise<InfraGenerateOperationResult>;
|
|
49
|
+
upAsync(request: ProjectInfraOperationRequest): Promise<InfraUpOperationResult>;
|
|
50
|
+
statusAsync(request: ProjectInfraOperationRequest): Promise<InfraStatusOperationResult>;
|
|
51
|
+
outputsAsync(request: ProjectInfraOperationRequest): Promise<InfraOutputsOperationResult>;
|
|
52
|
+
downAsync(request: ProjectInfraOperationRequest): Promise<InfraDownOperationResult>;
|
|
53
|
+
destroyAsync(request: ProjectInfraDestroyRequest): Promise<InfraDestroyOperationResult>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface CreateProjectInfraLifecycleOptions {
|
|
57
|
+
readonly services?: Partial<InfraCommandServices>;
|
|
58
|
+
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { InfraManifestInput, InfrastructureGenerationOptions } from '../../../types';
|
|
2
|
-
import { type MinikubeAdapterArtifacts } from '../contracts';
|
|
3
|
-
export declare function generateAuthProviderArtifacts(args: {
|
|
4
|
-
appManifest: InfrastructureGenerationOptions['appManifest'];
|
|
5
|
-
manifest: InfraManifestInput;
|
|
6
|
-
namespace: string;
|
|
7
|
-
}): MinikubeAdapterArtifacts;
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapters/minikube/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AAC1F,OAAO,EAA0B,KAAK,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAIrF,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAClD,WAAW,EAAE,+BAA+B,CAAC,aAAa,CAAC,CAAC;IAC5D,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,wBAAwB,CA8B3B"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { emptyMinikubeArtifacts } from '../contracts';
|
|
2
|
-
import { generateSupabaseAuthArtifacts } from './supabase';
|
|
3
|
-
import { generateTargetAwareSupabaseOAuthRuntimeArtifacts } from './targetAwareOAuthRuntime';
|
|
4
|
-
export function generateAuthProviderArtifacts(args) {
|
|
5
|
-
const { appManifest, manifest, namespace } = args;
|
|
6
|
-
const { auth } = manifest;
|
|
7
|
-
if (!auth) {
|
|
8
|
-
return emptyMinikubeArtifacts();
|
|
9
|
-
}
|
|
10
|
-
if (auth.provider !== 'supabase') {
|
|
11
|
-
throw new Error(`Unsupported auth provider for minikube adapter: "${auth.provider}". Only "supabase" is currently supported.`);
|
|
12
|
-
}
|
|
13
|
-
const providerArtifacts = generateSupabaseAuthArtifacts({ manifest, namespace });
|
|
14
|
-
const oauthArtifacts = generateTargetAwareSupabaseOAuthRuntimeArtifacts({
|
|
15
|
-
appManifest,
|
|
16
|
-
manifest,
|
|
17
|
-
});
|
|
18
|
-
return {
|
|
19
|
-
files: [...providerArtifacts.files, ...oauthArtifacts.files],
|
|
20
|
-
resources: [...providerArtifacts.resources, ...oauthArtifacts.resources],
|
|
21
|
-
providerLifecycle: [
|
|
22
|
-
...providerArtifacts.providerLifecycle,
|
|
23
|
-
...oauthArtifacts.providerLifecycle,
|
|
24
|
-
],
|
|
25
|
-
envEntries: [...providerArtifacts.envEntries, ...oauthArtifacts.envEntries],
|
|
26
|
-
warnings: [...providerArtifacts.warnings, ...oauthArtifacts.warnings],
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/adapters/minikube/auth/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAiC,MAAM,cAAc,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,gDAAgD,EAAE,MAAM,2BAA2B,CAAC;AAE7F,MAAM,UAAU,6BAA6B,CAAC,IAI7C;IACC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IAClD,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;IAE1B,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,sBAAsB,EAAE,CAAC;IAClC,CAAC;IAED,IAAI,IAAI,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CACb,oDAAoD,IAAI,CAAC,QAAQ,4CAA4C,CAC9G,CAAC;IACJ,CAAC;IAED,MAAM,iBAAiB,GAAG,6BAA6B,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;IACjF,MAAM,cAAc,GAAG,gDAAgD,CAAC;QACtE,WAAW;QACX,QAAQ;KACT,CAAC,CAAC;IAEH,OAAO;QACL,KAAK,EAAE,CAAC,GAAG,iBAAiB,CAAC,KAAK,EAAE,GAAG,cAAc,CAAC,KAAK,CAAC;QAC5D,SAAS,EAAE,CAAC,GAAG,iBAAiB,CAAC,SAAS,EAAE,GAAG,cAAc,CAAC,SAAS,CAAC;QACxE,iBAAiB,EAAE;YACjB,GAAG,iBAAiB,CAAC,iBAAiB;YACtC,GAAG,cAAc,CAAC,iBAAiB;SACpC;QACD,UAAU,EAAE,CAAC,GAAG,iBAAiB,CAAC,UAAU,EAAE,GAAG,cAAc,CAAC,UAAU,CAAC;QAC3E,QAAQ,EAAE,CAAC,GAAG,iBAAiB,CAAC,QAAQ,EAAE,GAAG,cAAc,CAAC,QAAQ,CAAC;KACtE,CAAC;AACJ,CAAC","sourcesContent":["import type { InfraManifestInput, InfrastructureGenerationOptions } from '../../../types';\nimport { emptyMinikubeArtifacts, type MinikubeAdapterArtifacts } from '../contracts';\nimport { generateSupabaseAuthArtifacts } from './supabase';\nimport { generateTargetAwareSupabaseOAuthRuntimeArtifacts } from './targetAwareOAuthRuntime';\n\nexport function generateAuthProviderArtifacts(args: {\n appManifest: InfrastructureGenerationOptions['appManifest'];\n manifest: InfraManifestInput;\n namespace: string;\n}): MinikubeAdapterArtifacts {\n const { appManifest, manifest, namespace } = args;\n const { auth } = manifest;\n\n if (!auth) {\n return emptyMinikubeArtifacts();\n }\n\n if (auth.provider !== 'supabase') {\n throw new Error(\n `Unsupported auth provider for minikube adapter: \"${auth.provider}\". Only \"supabase\" is currently supported.`,\n );\n }\n\n const providerArtifacts = generateSupabaseAuthArtifacts({ manifest, namespace });\n const oauthArtifacts = generateTargetAwareSupabaseOAuthRuntimeArtifacts({\n appManifest,\n manifest,\n });\n\n return {\n files: [...providerArtifacts.files, ...oauthArtifacts.files],\n resources: [...providerArtifacts.resources, ...oauthArtifacts.resources],\n providerLifecycle: [\n ...providerArtifacts.providerLifecycle,\n ...oauthArtifacts.providerLifecycle,\n ],\n envEntries: [...providerArtifacts.envEntries, ...oauthArtifacts.envEntries],\n warnings: [...providerArtifacts.warnings, ...oauthArtifacts.warnings],\n };\n}\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { InfraManifestInput } from '../../../types';
|
|
2
|
-
import type { MinikubeAdapterArtifacts } from '../contracts';
|
|
3
|
-
export declare function generateSupabaseOAuthRuntimeArtifacts(manifest: InfraManifestInput): MinikubeAdapterArtifacts;
|
|
4
|
-
//# sourceMappingURL=oauthRuntime.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oauthRuntime.d.ts","sourceRoot":"","sources":["../../../../src/adapters/minikube/auth/oauthRuntime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,wBAAwB,EAA6B,MAAM,cAAc,CAAC;AAQxF,wBAAgB,qCAAqC,CACnD,QAAQ,EAAE,kBAAkB,GAC3B,wBAAwB,CAwB1B"}
|