@ankhorage/infra 4.1.12 → 5.0.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 +10 -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/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 +7 -5
- package/dist/project/index.d.ts.map +1 -1
- package/dist/project/index.js +6 -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/{project.d.ts → types/infraProject.d.ts} +6 -6
- 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/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 +8 -188
- package/src/project/index.ts +7 -22
- package/src/project.test.ts +39 -189
- package/src/projectContractsParser.test.ts +2 -2
- package/src/projectInfrastructure.test.ts +121 -167
- 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 +15 -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.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
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type { InfraManifestInput } from '../../../types';
|
|
2
|
-
import { emptyMinikubeArtifacts, type MinikubeAdapterArtifacts } from '../contracts';
|
|
3
|
-
import { generateSupabaseStorageArtifacts } from './supabase';
|
|
4
|
-
|
|
5
|
-
export function generateStorageArtifacts(args: {
|
|
6
|
-
manifest: InfraManifestInput;
|
|
7
|
-
namespace: string;
|
|
8
|
-
}): MinikubeAdapterArtifacts {
|
|
9
|
-
const { manifest, namespace } = args;
|
|
10
|
-
const spec = manifest.storage;
|
|
11
|
-
|
|
12
|
-
if (!spec) {
|
|
13
|
-
return emptyMinikubeArtifacts();
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const buckets = normalizeBuckets(spec.buckets);
|
|
17
|
-
const { provider } = spec;
|
|
18
|
-
const includeSupabaseConnectionEnvEntries = manifest.auth?.provider !== 'supabase';
|
|
19
|
-
const emptyBucketsWarning =
|
|
20
|
-
'Storage buckets are empty after normalization; no storage artifacts generated.';
|
|
21
|
-
|
|
22
|
-
switch (provider) {
|
|
23
|
-
case 'auto': {
|
|
24
|
-
const shouldResolveToSupabase =
|
|
25
|
-
manifest.database?.provider === 'supabase' || manifest.auth?.provider === 'supabase';
|
|
26
|
-
|
|
27
|
-
if (!shouldResolveToSupabase) {
|
|
28
|
-
return {
|
|
29
|
-
...emptyMinikubeArtifacts(),
|
|
30
|
-
warnings: [
|
|
31
|
-
'Storage provider "auto" could not be resolved for minikube; no storage artifacts generated.',
|
|
32
|
-
],
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (buckets.length === 0) {
|
|
37
|
-
return {
|
|
38
|
-
...emptyMinikubeArtifacts(),
|
|
39
|
-
warnings: [emptyBucketsWarning],
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return generateSupabaseStorageArtifacts({
|
|
44
|
-
namespace,
|
|
45
|
-
buckets,
|
|
46
|
-
includeSupabaseConnectionEnvEntries,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
case 'supabase': {
|
|
50
|
-
if (buckets.length === 0) {
|
|
51
|
-
return {
|
|
52
|
-
...emptyMinikubeArtifacts(),
|
|
53
|
-
warnings: [emptyBucketsWarning],
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return generateSupabaseStorageArtifacts({
|
|
58
|
-
namespace,
|
|
59
|
-
buckets,
|
|
60
|
-
includeSupabaseConnectionEnvEntries,
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
case 's3':
|
|
64
|
-
case 'r2':
|
|
65
|
-
return {
|
|
66
|
-
...emptyMinikubeArtifacts(),
|
|
67
|
-
warnings: [
|
|
68
|
-
`Storage provider "${provider}" is not implemented for minikube yet; no storage artifacts generated.`,
|
|
69
|
-
],
|
|
70
|
-
};
|
|
71
|
-
default: {
|
|
72
|
-
const exhaustiveCheck: never = provider;
|
|
73
|
-
return exhaustiveCheck;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function normalizeBuckets(rawBuckets: readonly string[]): string[] {
|
|
79
|
-
const normalized: string[] = [];
|
|
80
|
-
const seen = new Set<string>();
|
|
81
|
-
|
|
82
|
-
for (const raw of rawBuckets) {
|
|
83
|
-
const bucket = raw.trim();
|
|
84
|
-
if (!bucket) continue;
|
|
85
|
-
if (seen.has(bucket)) continue;
|
|
86
|
-
seen.add(bucket);
|
|
87
|
-
normalized.push(bucket);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return normalized;
|
|
91
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import type { MinikubeAdapterArtifacts } from '../../contracts';
|
|
2
|
-
|
|
3
|
-
export function generateSupabaseStorageArtifacts(args: {
|
|
4
|
-
namespace: string;
|
|
5
|
-
buckets: string[];
|
|
6
|
-
includeSupabaseConnectionEnvEntries: boolean;
|
|
7
|
-
}): MinikubeAdapterArtifacts {
|
|
8
|
-
const { namespace, buckets, includeSupabaseConnectionEnvEntries } = args;
|
|
9
|
-
const root = 'infra/minikube/k8s/storage/supabase';
|
|
10
|
-
const resourceRoot = 'storage/supabase';
|
|
11
|
-
const bucketsCsv = buckets.join(',');
|
|
12
|
-
const defaultBucket = buckets[0] ?? '';
|
|
13
|
-
|
|
14
|
-
const envEntries = [
|
|
15
|
-
'STORAGE_PROVIDER=supabase',
|
|
16
|
-
'STORAGE_RUNTIME_MODE=local',
|
|
17
|
-
`STORAGE_BUCKETS=${bucketsCsv}`,
|
|
18
|
-
`STORAGE_DEFAULT_BUCKET=${defaultBucket}`,
|
|
19
|
-
'EXPO_PUBLIC_STORAGE_PROVIDER=supabase',
|
|
20
|
-
`EXPO_PUBLIC_STORAGE_BUCKETS=${bucketsCsv}`,
|
|
21
|
-
`EXPO_PUBLIC_STORAGE_DEFAULT_BUCKET=${defaultBucket}`,
|
|
22
|
-
];
|
|
23
|
-
|
|
24
|
-
if (includeSupabaseConnectionEnvEntries) {
|
|
25
|
-
envEntries.push(
|
|
26
|
-
'',
|
|
27
|
-
'# Supabase provider connection details',
|
|
28
|
-
'EXPO_PUBLIC_SUPABASE_URL=',
|
|
29
|
-
'EXPO_PUBLIC_SUPABASE_ANON_KEY=',
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return {
|
|
34
|
-
files: [
|
|
35
|
-
{
|
|
36
|
-
path: `${root}/supabase-storage.configmap.yaml`,
|
|
37
|
-
content: getSupabaseStorageConfigMap({
|
|
38
|
-
namespace,
|
|
39
|
-
bucketsCsv,
|
|
40
|
-
defaultBucket,
|
|
41
|
-
}),
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
path: `${root}/app-runtime-storage.env.configmap.yaml`,
|
|
45
|
-
content: getRuntimeStorageEnvConfigMap({
|
|
46
|
-
namespace,
|
|
47
|
-
bucketsCsv,
|
|
48
|
-
defaultBucket,
|
|
49
|
-
}),
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
resources: [
|
|
53
|
-
`${resourceRoot}/supabase-storage.configmap.yaml`,
|
|
54
|
-
`${resourceRoot}/app-runtime-storage.env.configmap.yaml`,
|
|
55
|
-
],
|
|
56
|
-
providerLifecycle: [],
|
|
57
|
-
envEntries,
|
|
58
|
-
warnings: [
|
|
59
|
-
`Storage buckets are configured but not created automatically yet. Ensure buckets exist in Supabase Storage: ${bucketsCsv}.`,
|
|
60
|
-
],
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function getSupabaseStorageConfigMap(args: {
|
|
65
|
-
namespace: string;
|
|
66
|
-
bucketsCsv: string;
|
|
67
|
-
defaultBucket: string;
|
|
68
|
-
}) {
|
|
69
|
-
const { namespace, bucketsCsv, defaultBucket } = args;
|
|
70
|
-
|
|
71
|
-
return `apiVersion: v1
|
|
72
|
-
kind: ConfigMap
|
|
73
|
-
metadata:
|
|
74
|
-
name: supabase-storage-config
|
|
75
|
-
namespace: ${namespace}
|
|
76
|
-
data:
|
|
77
|
-
STORAGE_PROVIDER: "supabase"
|
|
78
|
-
STORAGE_BUCKETS: "${escapeYamlDoubleQuoted(bucketsCsv)}"
|
|
79
|
-
STORAGE_DEFAULT_BUCKET: "${escapeYamlDoubleQuoted(defaultBucket)}"
|
|
80
|
-
`;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function getRuntimeStorageEnvConfigMap(args: {
|
|
84
|
-
namespace: string;
|
|
85
|
-
bucketsCsv: string;
|
|
86
|
-
defaultBucket: string;
|
|
87
|
-
}) {
|
|
88
|
-
const { namespace, bucketsCsv, defaultBucket } = args;
|
|
89
|
-
|
|
90
|
-
return `apiVersion: v1
|
|
91
|
-
kind: ConfigMap
|
|
92
|
-
metadata:
|
|
93
|
-
name: app-runtime-storage-env
|
|
94
|
-
namespace: ${namespace}
|
|
95
|
-
data:
|
|
96
|
-
STORAGE_PROVIDER: "supabase"
|
|
97
|
-
STORAGE_RUNTIME_MODE: "local"
|
|
98
|
-
STORAGE_BUCKETS: "${escapeYamlDoubleQuoted(bucketsCsv)}"
|
|
99
|
-
STORAGE_DEFAULT_BUCKET: "${escapeYamlDoubleQuoted(defaultBucket)}"
|
|
100
|
-
EXPO_PUBLIC_STORAGE_PROVIDER: "supabase"
|
|
101
|
-
EXPO_PUBLIC_STORAGE_BUCKETS: "${escapeYamlDoubleQuoted(bucketsCsv)}"
|
|
102
|
-
EXPO_PUBLIC_STORAGE_DEFAULT_BUCKET: "${escapeYamlDoubleQuoted(defaultBucket)}"
|
|
103
|
-
`;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function escapeYamlDoubleQuoted(value: string): string {
|
|
107
|
-
return value.replaceAll('\\', '\\\\').replaceAll('"', '\\"');
|
|
108
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from 'bun:test';
|
|
2
|
-
|
|
3
|
-
import { generateInfrastructure } from './index';
|
|
4
|
-
import { createAppManifest } from './testSupport';
|
|
5
|
-
import type { InfraManifestInput } from './types';
|
|
6
|
-
|
|
7
|
-
const DEPLOYMENT = { target: 'minikube', monitoring: false } as const;
|
|
8
|
-
|
|
9
|
-
describe('canonical API infrastructure', () => {
|
|
10
|
-
test('treats external APIs as infrastructure no-ops', () => {
|
|
11
|
-
const manifest: InfraManifestInput = {
|
|
12
|
-
deployment: DEPLOYMENT,
|
|
13
|
-
modules: [],
|
|
14
|
-
apis: [
|
|
15
|
-
{
|
|
16
|
-
id: 'nutrition',
|
|
17
|
-
origin: 'external',
|
|
18
|
-
protocol: 'rest',
|
|
19
|
-
baseUrl: 'https://api.ankhorage.com/v1/nutrition',
|
|
20
|
-
endpoints: {},
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const result = generateInfrastructure(manifest, {
|
|
26
|
-
appManifest: createAppManifest('nutrition', manifest),
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
expect(result.warnings).not.toContainEqual(expect.stringContaining('infra.apis.nutrition'));
|
|
30
|
-
expect(listApiArtifactPaths(result.files)).toEqual([]);
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
test('warns for internal APIs without generating partial API infrastructure', () => {
|
|
34
|
-
const manifest: InfraManifestInput = {
|
|
35
|
-
deployment: DEPLOYMENT,
|
|
36
|
-
modules: [],
|
|
37
|
-
apis: [
|
|
38
|
-
{
|
|
39
|
-
id: 'orders',
|
|
40
|
-
origin: 'internal',
|
|
41
|
-
protocol: 'rest',
|
|
42
|
-
basePath: '/api/orders',
|
|
43
|
-
endpoints: {},
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const result = generateInfrastructure(manifest, {
|
|
49
|
-
appManifest: createAppManifest('orders', manifest),
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
expect(result.warnings).toContain(
|
|
53
|
-
'infra.apis.orders has origin "internal", but internal API provisioning is not supported in Phase 1; no API infrastructure will be generated.',
|
|
54
|
-
);
|
|
55
|
-
expect(listApiArtifactPaths(result.files)).toEqual([]);
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
function listApiArtifactPaths(files: readonly { readonly path: string }[]): readonly string[] {
|
|
60
|
-
return files
|
|
61
|
-
.map((file) => file.path)
|
|
62
|
-
.filter(
|
|
63
|
-
(path) =>
|
|
64
|
-
path.includes('generated-api') ||
|
|
65
|
-
path.includes('generated_api') ||
|
|
66
|
-
path.includes('/api/deployment') ||
|
|
67
|
-
path.includes('/api/service'),
|
|
68
|
-
);
|
|
69
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from 'bun:test';
|
|
2
|
-
|
|
3
|
-
import { getLocalAuthRedirectPatterns, resolveAuthRedirectConfiguration } from './authRedirects';
|
|
4
|
-
|
|
5
|
-
describe('resolveAuthRedirectConfiguration', () => {
|
|
6
|
-
test('derives an exact provider callback and local browser callback policy', () => {
|
|
7
|
-
const config = resolveAuthRedirectConfiguration({
|
|
8
|
-
environment: 'local',
|
|
9
|
-
gatewayOrigin: 'http://127.0.0.1:18081/',
|
|
10
|
-
siteOrigin: 'http://127.0.0.1:18080/',
|
|
11
|
-
callbackRoute: 'auth/callback',
|
|
12
|
-
webOrigins: ['http://localhost:8081'],
|
|
13
|
-
nativeRedirectUris: ['ankh-demo://auth/callback'],
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
expect(config.providerCallbackUrl).toBe('http://127.0.0.1:18081/auth/v1/callback');
|
|
17
|
-
expect(config.siteUrl).toBe('http://127.0.0.1:18080');
|
|
18
|
-
expect(config.redirectAllowList).toEqual([
|
|
19
|
-
'http://127.0.0.1:18080',
|
|
20
|
-
'http://localhost:8081',
|
|
21
|
-
'http://127.0.0.1:18080/auth/callback',
|
|
22
|
-
'http://localhost:8081/auth/callback',
|
|
23
|
-
'http://127.0.0.1:*/auth/callback',
|
|
24
|
-
'http://localhost:*/auth/callback',
|
|
25
|
-
'ankh-demo://auth/callback',
|
|
26
|
-
]);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
test('never leaks local wildcard policy into preview or production', () => {
|
|
30
|
-
for (const environment of ['preview', 'production'] as const) {
|
|
31
|
-
const config = resolveAuthRedirectConfiguration({
|
|
32
|
-
environment,
|
|
33
|
-
gatewayOrigin: 'https://api.example.test',
|
|
34
|
-
siteOrigin: 'https://app.example.test',
|
|
35
|
-
callbackRoute: '/auth/callback',
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
expect(config.redirectAllowList).toEqual([
|
|
39
|
-
'https://app.example.test',
|
|
40
|
-
'https://app.example.test/auth/callback',
|
|
41
|
-
]);
|
|
42
|
-
expect(config.serializedRedirectAllowList).not.toContain('localhost');
|
|
43
|
-
expect(config.serializedRedirectAllowList).not.toContain('127.0.0.1');
|
|
44
|
-
expect(config.serializedRedirectAllowList).not.toContain('*');
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
test('normalizes callback routes and rejects unsafe origins', () => {
|
|
49
|
-
expect(getLocalAuthRedirectPatterns('//auth//callback')).toEqual([
|
|
50
|
-
'http://127.0.0.1:*/auth/callback',
|
|
51
|
-
'http://localhost:*/auth/callback',
|
|
52
|
-
]);
|
|
53
|
-
|
|
54
|
-
expect(() =>
|
|
55
|
-
resolveAuthRedirectConfiguration({
|
|
56
|
-
environment: 'production',
|
|
57
|
-
gatewayOrigin: 'https://user:secret@example.test',
|
|
58
|
-
siteOrigin: 'https://app.example.test',
|
|
59
|
-
callbackRoute: '/auth/callback',
|
|
60
|
-
}),
|
|
61
|
-
).toThrow('gatewayOrigin must be a canonical origin');
|
|
62
|
-
});
|
|
63
|
-
});
|
package/src/authRedirects.ts
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
export type AuthRedirectEnvironment = 'local' | 'preview' | 'production';
|
|
2
|
-
|
|
3
|
-
export interface ResolveAuthRedirectConfigurationInput {
|
|
4
|
-
environment: AuthRedirectEnvironment;
|
|
5
|
-
gatewayOrigin: string;
|
|
6
|
-
siteOrigin: string;
|
|
7
|
-
callbackRoute: string;
|
|
8
|
-
webOrigins?: readonly string[];
|
|
9
|
-
nativeRedirectUris?: readonly string[];
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface AuthRedirectConfiguration {
|
|
13
|
-
providerCallbackUrl: string;
|
|
14
|
-
siteUrl: string;
|
|
15
|
-
redirectAllowList: readonly string[];
|
|
16
|
-
serializedRedirectAllowList: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function resolveAuthRedirectConfiguration(
|
|
20
|
-
input: ResolveAuthRedirectConfigurationInput,
|
|
21
|
-
): AuthRedirectConfiguration {
|
|
22
|
-
const gatewayOrigin = normalizeWebOrigin(input.gatewayOrigin, 'gatewayOrigin');
|
|
23
|
-
const siteUrl = normalizeWebOrigin(input.siteOrigin, 'siteOrigin');
|
|
24
|
-
const callbackRoute = normalizeCallbackRoute(input.callbackRoute);
|
|
25
|
-
const webOrigins = unique([
|
|
26
|
-
siteUrl,
|
|
27
|
-
...(input.webOrigins ?? []).map((origin) => normalizeWebOrigin(origin, 'webOrigins')),
|
|
28
|
-
]);
|
|
29
|
-
const nativeRedirectUris = unique(
|
|
30
|
-
(input.nativeRedirectUris ?? []).map((uri) => normalizeNativeRedirectUri(uri)),
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
const redirectAllowList = unique([
|
|
34
|
-
...webOrigins,
|
|
35
|
-
...webOrigins.map((origin) => `${origin}${callbackRoute}`),
|
|
36
|
-
...(input.environment === 'local' ? getLocalAuthRedirectPatterns(callbackRoute) : []),
|
|
37
|
-
...nativeRedirectUris,
|
|
38
|
-
]);
|
|
39
|
-
|
|
40
|
-
return {
|
|
41
|
-
providerCallbackUrl: `${gatewayOrigin}/auth/v1/callback`,
|
|
42
|
-
siteUrl,
|
|
43
|
-
redirectAllowList,
|
|
44
|
-
serializedRedirectAllowList: redirectAllowList.join(','),
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function getLocalAuthRedirectPatterns(callbackRoute: string): readonly string[] {
|
|
49
|
-
const normalizedRoute = normalizeCallbackRoute(callbackRoute);
|
|
50
|
-
return [`http://127.0.0.1:*${normalizedRoute}`, `http://localhost:*${normalizedRoute}`];
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export function normalizeAuthCallbackRoute(callbackRoute: string): string {
|
|
54
|
-
return normalizeCallbackRoute(callbackRoute);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function normalizeCallbackRoute(callbackRoute: string): string {
|
|
58
|
-
const trimmed = callbackRoute.trim();
|
|
59
|
-
if (!trimmed) {
|
|
60
|
-
throw new Error('Auth callback route must not be empty.');
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const withLeadingSlash = trimmed.startsWith('/') ? trimmed : `/${trimmed}`;
|
|
64
|
-
const normalized = withLeadingSlash.replace(/\/{2,}/gu, '/');
|
|
65
|
-
if (normalized.includes('?') || normalized.includes('#')) {
|
|
66
|
-
throw new Error('Auth callback route must not include a query string or fragment.');
|
|
67
|
-
}
|
|
68
|
-
return normalized;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function normalizeWebOrigin(value: string, field: string): string {
|
|
72
|
-
const parsed = parseUrl(value, field);
|
|
73
|
-
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
|
|
74
|
-
throw new Error(`${field} must use http or https.`);
|
|
75
|
-
}
|
|
76
|
-
if (parsed.username || parsed.password || parsed.search || parsed.hash) {
|
|
77
|
-
throw new Error(`${field} must be a canonical origin without credentials, query, or fragment.`);
|
|
78
|
-
}
|
|
79
|
-
if (parsed.pathname !== '/' && parsed.pathname !== '') {
|
|
80
|
-
throw new Error(`${field} must not include a path.`);
|
|
81
|
-
}
|
|
82
|
-
return parsed.origin;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function normalizeNativeRedirectUri(value: string): string {
|
|
86
|
-
const parsed = parseUrl(value, 'nativeRedirectUris');
|
|
87
|
-
if (parsed.protocol === 'http:' || parsed.protocol === 'https:') {
|
|
88
|
-
throw new Error('nativeRedirectUris must use a non-HTTP application scheme.');
|
|
89
|
-
}
|
|
90
|
-
if (parsed.username || parsed.password || parsed.search || parsed.hash) {
|
|
91
|
-
throw new Error(
|
|
92
|
-
'nativeRedirectUris must not include credentials, query strings, or fragments.',
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
return parsed.toString();
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function parseUrl(value: string, field: string): URL {
|
|
99
|
-
const trimmed = value.trim();
|
|
100
|
-
if (!trimmed) {
|
|
101
|
-
throw new Error(`${field} must not contain empty values.`);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
try {
|
|
105
|
-
return new URL(trimmed);
|
|
106
|
-
} catch {
|
|
107
|
-
throw new Error(`${field} contains an invalid URL.`);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function unique(values: readonly string[]): string[] {
|
|
112
|
-
return [...new Set(values)];
|
|
113
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { AppDeployTargets } from '@ankhorage/contracts/deploy';
|
|
2
|
-
import { describe, expect, test } from 'bun:test';
|
|
3
|
-
|
|
4
|
-
import { resolveAuthTargetRedirectModel } from './authTargetRedirects';
|
|
5
|
-
|
|
6
|
-
describe('resolveAuthTargetRedirectModel', () => {
|
|
7
|
-
test('derives enabled native callbacks and deduplicates shared schemes', () => {
|
|
8
|
-
const targets: AppDeployTargets = {
|
|
9
|
-
web: { enabled: true },
|
|
10
|
-
android: {
|
|
11
|
-
enabled: true,
|
|
12
|
-
package: 'com.ankh.demo',
|
|
13
|
-
scheme: 'ankh-demo',
|
|
14
|
-
},
|
|
15
|
-
ios: {
|
|
16
|
-
enabled: true,
|
|
17
|
-
bundleIdentifier: 'com.ankh.demo',
|
|
18
|
-
scheme: 'ankh-demo',
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
expect(resolveAuthTargetRedirectModel({ callbackRoute: '/auth/callback', targets })).toEqual({
|
|
23
|
-
nativeRedirectUris: ['ankh-demo://auth/callback'],
|
|
24
|
-
warnings: [],
|
|
25
|
-
webEnabled: true,
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
test('omits disabled targets and warns instead of guessing missing native schemes', () => {
|
|
30
|
-
const targets: AppDeployTargets = {
|
|
31
|
-
web: { enabled: false },
|
|
32
|
-
android: {
|
|
33
|
-
enabled: false,
|
|
34
|
-
package: 'com.ankh.demo',
|
|
35
|
-
},
|
|
36
|
-
ios: {
|
|
37
|
-
enabled: true,
|
|
38
|
-
bundleIdentifier: 'com.ankh.demo',
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const result = resolveAuthTargetRedirectModel({ callbackRoute: '/auth/callback', targets });
|
|
43
|
-
|
|
44
|
-
expect(result.nativeRedirectUris).toEqual([]);
|
|
45
|
-
expect(result.webEnabled).toBe(false);
|
|
46
|
-
expect(result.warnings).toEqual([
|
|
47
|
-
'OAuth ios target is enabled but deploy.targets.ios.scheme is missing; native callback omitted.',
|
|
48
|
-
]);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
test('keeps the pre-target manifest path Web-only and explicit', () => {
|
|
52
|
-
expect(
|
|
53
|
-
resolveAuthTargetRedirectModel({ callbackRoute: '/auth/callback', targets: undefined }),
|
|
54
|
-
).toEqual({
|
|
55
|
-
nativeRedirectUris: [],
|
|
56
|
-
warnings: [
|
|
57
|
-
'OAuth deploy.targets is missing; Infra keeps Web-local redirects only until canonical targets are persisted.',
|
|
58
|
-
],
|
|
59
|
-
webEnabled: true,
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { AppDeployTargets } from '@ankhorage/contracts/deploy';
|
|
2
|
-
|
|
3
|
-
interface AuthTargetRedirectModel {
|
|
4
|
-
readonly nativeRedirectUris: readonly string[];
|
|
5
|
-
readonly warnings: readonly string[];
|
|
6
|
-
readonly webEnabled: boolean;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function resolveAuthTargetRedirectModel(args: {
|
|
10
|
-
readonly callbackRoute: string;
|
|
11
|
-
readonly targets: AppDeployTargets | undefined;
|
|
12
|
-
}): AuthTargetRedirectModel {
|
|
13
|
-
if (args.targets === undefined) {
|
|
14
|
-
return {
|
|
15
|
-
nativeRedirectUris: [],
|
|
16
|
-
warnings: [
|
|
17
|
-
'OAuth deploy.targets is missing; Infra keeps Web-local redirects only until canonical targets are persisted.',
|
|
18
|
-
],
|
|
19
|
-
webEnabled: true,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const callbackPath = args.callbackRoute.replace(/^\/+/u, '');
|
|
24
|
-
const nativeRedirectUris: string[] = [];
|
|
25
|
-
const warnings: string[] = [];
|
|
26
|
-
|
|
27
|
-
for (const [targetId, target] of [
|
|
28
|
-
['android', args.targets.android],
|
|
29
|
-
['ios', args.targets.ios],
|
|
30
|
-
] as const) {
|
|
31
|
-
if (target?.enabled !== true) continue;
|
|
32
|
-
if (target.scheme === undefined) {
|
|
33
|
-
warnings.push(
|
|
34
|
-
`OAuth ${targetId} target is enabled but deploy.targets.${targetId}.scheme is missing; native callback omitted.`,
|
|
35
|
-
);
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
nativeRedirectUris.push(`${target.scheme}://${callbackPath}`);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return {
|
|
42
|
-
nativeRedirectUris: [...new Set(nativeRedirectUris)],
|
|
43
|
-
warnings,
|
|
44
|
-
webEnabled: args.targets.web?.enabled === true,
|
|
45
|
-
};
|
|
46
|
-
}
|
package/src/commandContext.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { INFRA_PACKAGE_VERSION } from './packageMetadata.js';
|
|
2
|
-
|
|
3
|
-
export interface InfraCommandContext {
|
|
4
|
-
readonly cwd: string;
|
|
5
|
-
readonly env: Readonly<Record<string, string | undefined>>;
|
|
6
|
-
readonly version: string;
|
|
7
|
-
writeStdout(text: string): void;
|
|
8
|
-
writeStderr(text: string): void;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface InfraCommandRunResult {
|
|
12
|
-
readonly exitCode: number;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function createDefaultCommandContext(): InfraCommandContext {
|
|
16
|
-
return {
|
|
17
|
-
cwd: process.cwd(),
|
|
18
|
-
env: process.env,
|
|
19
|
-
version: INFRA_PACKAGE_VERSION,
|
|
20
|
-
writeStdout(text: string) {
|
|
21
|
-
process.stdout.write(text);
|
|
22
|
-
},
|
|
23
|
-
writeStderr(text: string) {
|
|
24
|
-
process.stderr.write(text);
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
}
|