@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
package/dist/infraValidation.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { AUTH_PROVIDERS, AUTH_SCOPES, AUTHZ_ENGINES, DATABASE_PROVIDERS, DEPLOYMENT_TARGETS, } from '@ankhorage/contracts';
|
|
2
|
-
export function validateInfraSupport(manifest) {
|
|
3
|
-
const warnings = [...validateInfraApiSupport(manifest)];
|
|
4
|
-
const deploymentTarget = manifest.deployment?.target;
|
|
5
|
-
if (deploymentTarget !== undefined && !isSupported(deploymentTarget, DEPLOYMENT_TARGETS)) {
|
|
6
|
-
warnings.push(warningForUnsupportedValue({
|
|
7
|
-
path: 'infra.deployment.target',
|
|
8
|
-
value: deploymentTarget,
|
|
9
|
-
supported: DEPLOYMENT_TARGETS,
|
|
10
|
-
}));
|
|
11
|
-
}
|
|
12
|
-
const databaseProvider = manifest.database?.provider;
|
|
13
|
-
if (databaseProvider !== undefined && !isSupported(databaseProvider, DATABASE_PROVIDERS)) {
|
|
14
|
-
warnings.push(warningForUnsupportedValue({
|
|
15
|
-
path: 'infra.database.provider',
|
|
16
|
-
value: databaseProvider,
|
|
17
|
-
supported: DATABASE_PROVIDERS,
|
|
18
|
-
}));
|
|
19
|
-
}
|
|
20
|
-
const authProvider = manifest.auth?.provider;
|
|
21
|
-
if (authProvider !== undefined && !isSupported(authProvider, AUTH_PROVIDERS)) {
|
|
22
|
-
warnings.push(warningForUnsupportedValue({
|
|
23
|
-
path: 'infra.auth.provider',
|
|
24
|
-
value: authProvider,
|
|
25
|
-
supported: AUTH_PROVIDERS,
|
|
26
|
-
}));
|
|
27
|
-
}
|
|
28
|
-
const authScope = manifest.auth?.scope;
|
|
29
|
-
if (authScope !== undefined && !isSupported(authScope, AUTH_SCOPES)) {
|
|
30
|
-
warnings.push(warningForUnsupportedValue({
|
|
31
|
-
path: 'infra.auth.scope',
|
|
32
|
-
value: authScope,
|
|
33
|
-
supported: AUTH_SCOPES,
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
const authzEngine = manifest.auth?.authorization?.engine;
|
|
37
|
-
if (authzEngine !== undefined && !isSupported(authzEngine, AUTHZ_ENGINES)) {
|
|
38
|
-
warnings.push(warningForUnsupportedValue({
|
|
39
|
-
path: 'infra.auth.authorization.engine',
|
|
40
|
-
value: authzEngine,
|
|
41
|
-
supported: AUTHZ_ENGINES,
|
|
42
|
-
}));
|
|
43
|
-
}
|
|
44
|
-
return warnings;
|
|
45
|
-
}
|
|
46
|
-
export function validateInfraApiSupport(manifest) {
|
|
47
|
-
return (manifest.apis ?? [])
|
|
48
|
-
.filter((api) => api.origin === 'internal')
|
|
49
|
-
.map((api) => `infra.apis.${api.id} has origin "internal", but internal API provisioning is not supported in Phase 1; no API infrastructure will be generated.`);
|
|
50
|
-
}
|
|
51
|
-
function warningForUnsupportedValue(args) {
|
|
52
|
-
return `${args.path} "${args.value}" is not currently supported by implemented generators. Supported values: ${formatSupportedValues(args.supported)}.`;
|
|
53
|
-
}
|
|
54
|
-
function formatSupportedValues(values) {
|
|
55
|
-
if (values.length === 0) {
|
|
56
|
-
return '(none)';
|
|
57
|
-
}
|
|
58
|
-
return values.join(', ');
|
|
59
|
-
}
|
|
60
|
-
function isSupported(value, supported) {
|
|
61
|
-
return supported.includes(value);
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=infraValidation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"infraValidation.js","sourceRoot":"","sources":["../src/infraValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAI9B,MAAM,UAAU,oBAAoB,CAAC,QAA4B;IAC/D,MAAM,QAAQ,GAAa,CAAC,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAElE,MAAM,gBAAgB,GAAG,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IACrD,IAAI,gBAAgB,KAAK,SAAS,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,EAAE,CAAC;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EAAE,aAAa,CAAC,EAAE,CAAC;QAC1E,QAAQ,CAAC,IAAI,CACX,0BAA0B,CAAC;YACzB,IAAI,EAAE,iCAAiC;YACvC,KAAK,EAAE,WAAW;YAClB,SAAS,EAAE,aAAa;SACzB,CAAC,CACH,CAAC;IACJ,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,QAA4B;IAClE,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC;SACzB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,KAAK,UAAU,CAAC;SAC1C,GAAG,CACF,CAAC,GAAG,EAAE,EAAE,CACN,cAAc,GAAG,CAAC,EAAE,6HAA6H,CACpJ,CAAC;AACN,CAAC;AAED,SAAS,0BAA0B,CAAC,IAInC;IACC,OAAO,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,6EAA6E,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;AAC1J,CAAC;AAED,SAAS,qBAAqB,CAAC,MAAyB;IACtD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,SAAS,WAAW,CAAC,KAAa,EAAE,SAA4B;IAC9D,OAAO,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import {\n AUTH_PROVIDERS,\n AUTH_SCOPES,\n AUTHZ_ENGINES,\n DATABASE_PROVIDERS,\n DEPLOYMENT_TARGETS,\n} from '@ankhorage/contracts';\n\nimport type { InfraManifestInput } from './types.js';\n\nexport function validateInfraSupport(manifest: InfraManifestInput): readonly string[] {\n const warnings: string[] = [...validateInfraApiSupport(manifest)];\n\n const deploymentTarget = manifest.deployment?.target;\n if (deploymentTarget !== undefined && !isSupported(deploymentTarget, DEPLOYMENT_TARGETS)) {\n warnings.push(\n warningForUnsupportedValue({\n path: 'infra.deployment.target',\n value: deploymentTarget,\n supported: DEPLOYMENT_TARGETS,\n }),\n );\n }\n\n const databaseProvider = manifest.database?.provider;\n if (databaseProvider !== undefined && !isSupported(databaseProvider, DATABASE_PROVIDERS)) {\n warnings.push(\n warningForUnsupportedValue({\n path: 'infra.database.provider',\n value: databaseProvider,\n supported: DATABASE_PROVIDERS,\n }),\n );\n }\n\n const authProvider = manifest.auth?.provider;\n if (authProvider !== undefined && !isSupported(authProvider, AUTH_PROVIDERS)) {\n warnings.push(\n warningForUnsupportedValue({\n path: 'infra.auth.provider',\n value: authProvider,\n supported: AUTH_PROVIDERS,\n }),\n );\n }\n\n const authScope = manifest.auth?.scope;\n if (authScope !== undefined && !isSupported(authScope, AUTH_SCOPES)) {\n warnings.push(\n warningForUnsupportedValue({\n path: 'infra.auth.scope',\n value: authScope,\n supported: AUTH_SCOPES,\n }),\n );\n }\n\n const authzEngine = manifest.auth?.authorization?.engine;\n if (authzEngine !== undefined && !isSupported(authzEngine, AUTHZ_ENGINES)) {\n warnings.push(\n warningForUnsupportedValue({\n path: 'infra.auth.authorization.engine',\n value: authzEngine,\n supported: AUTHZ_ENGINES,\n }),\n );\n }\n\n return warnings;\n}\n\nexport function validateInfraApiSupport(manifest: InfraManifestInput): readonly string[] {\n return (manifest.apis ?? [])\n .filter((api) => api.origin === 'internal')\n .map(\n (api) =>\n `infra.apis.${api.id} has origin \"internal\", but internal API provisioning is not supported in Phase 1; no API infrastructure will be generated.`,\n );\n}\n\nfunction warningForUnsupportedValue(args: {\n readonly path: string;\n readonly value: string;\n readonly supported: readonly string[];\n}): string {\n return `${args.path} \"${args.value}\" is not currently supported by implemented generators. Supported values: ${formatSupportedValues(args.supported)}.`;\n}\n\nfunction formatSupportedValues(values: readonly string[]): string {\n if (values.length === 0) {\n return '(none)';\n }\n\n return values.join(', ');\n}\n\nfunction isSupported(value: string, supported: readonly string[]): boolean {\n return supported.includes(value);\n}\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const INFRA_PACKAGE_NAME: string;
|
|
2
|
-
export declare const INFRA_PACKAGE_VERSION: string;
|
|
3
|
-
export declare const INFRA_COMMAND_CATEGORY: "infra";
|
|
4
|
-
export declare const INFRA_CAPABILITIES: readonly ["infra.validate", "infra.generate", "infra.status", "infra.up", "infra.down"];
|
|
5
|
-
export declare const INFRA_PACKAGE_METADATA: {
|
|
6
|
-
readonly category: "infra";
|
|
7
|
-
readonly provider: "./dist/ankh.provider.js";
|
|
8
|
-
readonly capabilities: readonly ["infra.validate", "infra.generate", "infra.status", "infra.up", "infra.down"];
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=packageMetadata.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"packageMetadata.d.ts","sourceRoot":"","sources":["../src/packageMetadata.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,kBAAkB,QAAmB,CAAC;AACnD,eAAO,MAAM,qBAAqB,QAAsB,CAAC;AACzD,eAAO,MAAM,sBAAsB,SAAiD,CAAC;AACrF,eAAO,MAAM,kBAAkB,yFAMiB,CAAC;AAEjD,eAAO,MAAM,sBAAsB;;;;CAIK,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"packageMetadata.js","sourceRoot":"","sources":["../src/packageMetadata.ts"],"names":[],"mappings":"AAMA,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAE1C,MAAM,CAAC,MAAM,kBAAkB,GAAG,WAAW,CAAC,IAAI,CAAC;AACnD,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC,OAAO,CAAC;AACzD,MAAM,CAAC,MAAM,sBAAsB,GAAG,OAA8C,CAAC;AACrF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,gBAAgB;IAChB,gBAAgB;IAChB,cAAc;IACd,UAAU;IACV,YAAY;CACkC,CAAC;AAEjD,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,QAAQ,EAAE,sBAAsB;IAChC,QAAQ,EAAE,yBAAyB;IACnC,YAAY,EAAE,kBAAkB;CACM,CAAC","sourcesContent":["import type {\n AnkhCapabilityId,\n AnkhCommandCategory,\n AnkhPackageMetadata,\n} from '@ankhorage/contracts/cli';\n\nimport packageJson from '../package.json';\n\nexport const INFRA_PACKAGE_NAME = packageJson.name;\nexport const INFRA_PACKAGE_VERSION = packageJson.version;\nexport const INFRA_COMMAND_CATEGORY = 'infra' as const satisfies AnkhCommandCategory;\nexport const INFRA_CAPABILITIES = [\n 'infra.validate',\n 'infra.generate',\n 'infra.status',\n 'infra.up',\n 'infra.down',\n] as const satisfies readonly AnkhCapabilityId[];\n\nexport const INFRA_PACKAGE_METADATA = {\n category: INFRA_COMMAND_CATEGORY,\n provider: './dist/ankh.provider.js',\n capabilities: INFRA_CAPABILITIES,\n} as const satisfies AnkhPackageMetadata;\n"]}
|
package/dist/project.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type AppManifest } from '@ankhorage/contracts';
|
|
2
|
-
export interface ResolvedInfraProject {
|
|
3
|
-
readonly appsRoot: string;
|
|
4
|
-
readonly manifest: AppManifest;
|
|
5
|
-
readonly manifestPath: string;
|
|
6
|
-
readonly projectId: string;
|
|
7
|
-
readonly projectPath: string;
|
|
8
|
-
readonly workspaceRoot: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function resolveInfraProject(options: {
|
|
11
|
-
readonly cwd: string;
|
|
12
|
-
readonly projectId?: string;
|
|
13
|
-
}): Promise<ResolvedInfraProject>;
|
|
14
|
-
//# sourceMappingURL=project.d.ts.map
|
package/dist/project.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAiB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,QAAQ,CAAC,GAAG,CAAC;QACvB,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,EACxB,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,uBAAuB,SAAS,2CAA2C,CAAC,CAAC;IAC/F,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,KAAK,UAAU,WAAW,CAAC,QAAgB;IACzC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrC,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,QAAgB;IACxC,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,KAAc;IACrC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC","sourcesContent":["import { type AppManifest, isAppManifest } from '@ankhorage/contracts';\nimport { promises as fs } from 'fs';\nimport path from 'path';\n\nexport interface ResolvedInfraProject {\n readonly appsRoot: string;\n readonly manifest: AppManifest;\n readonly manifestPath: string;\n readonly projectId: string;\n readonly projectPath: string;\n readonly workspaceRoot: string;\n}\n\nexport async function resolveInfraProject(options: {\n readonly cwd: string;\n readonly projectId?: string;\n}): Promise<ResolvedInfraProject> {\n const workspaceRoot = await findWorkspaceRoot(options.cwd);\n if (workspaceRoot === null) {\n throw new Error(`Could not find an Ankh workspace root from cwd: ${options.cwd}`);\n }\n\n const appsRoot = path.join(workspaceRoot, 'apps');\n const projectId =\n options.projectId === undefined\n ? inferProjectId(options.cwd, appsRoot)\n : validateExplicitProjectId(options.projectId);\n if (projectId === null) {\n throw new Error(\n 'Could not infer a project from cwd. Pass a project id or run the command inside apps/<project>.',\n );\n }\n\n const projectPath = resolveProjectPath(appsRoot, projectId);\n if (!(await pathExists(projectPath))) {\n throw new Error(`Project '${projectId}' not found.`);\n }\n\n const manifestPath = path.join(projectPath, 'ankh.config.json');\n const manifest = await readProjectManifest({ manifestPath, projectId });\n\n return {\n appsRoot,\n manifest,\n manifestPath,\n projectId,\n projectPath,\n workspaceRoot,\n };\n}\n\nfunction resolveProjectPath(appsRoot: string, projectId: string): string {\n const projectPath = path.resolve(appsRoot, projectId);\n const appsRootPath = `${path.resolve(appsRoot)}${path.sep}`;\n\n if (!projectPath.startsWith(appsRootPath)) {\n throw new Error('Security check failed while resolving the project path.');\n }\n\n return projectPath;\n}\n\nfunction createFallbackManifest(projectId: string): AppManifest {\n return {\n metadata: {\n name: projectId,\n slug: projectId,\n version: '0.0.0',\n category: 'developer_tools',\n themeId: 'default',\n },\n themes: [],\n activeThemeId: 'default',\n infra: { modules: [] },\n navigator: {\n type: 'stack',\n routes: [{ name: 'index', screenId: 'index' }],\n },\n screens: {},\n settings: {\n localization: {\n defaultLocale: 'en',\n locales: ['en'],\n },\n },\n };\n}\n\nasync function readProjectManifest(args: {\n readonly manifestPath: string;\n readonly projectId: string;\n}): Promise<AppManifest> {\n if (!(await pathExists(args.manifestPath))) {\n return createFallbackManifest(args.projectId);\n }\n\n const rawManifest = await fs.readFile(args.manifestPath, 'utf8');\n let parsed: unknown;\n\n try {\n parsed = JSON.parse(rawManifest);\n } catch (error) {\n throw new Error(\n `Project manifest is not valid JSON: ${args.manifestPath}: ${getErrorMessage(error)}`,\n { cause: error },\n );\n }\n\n if (!isAppManifest(parsed)) {\n throw new Error(`Project manifest has an invalid shape: ${args.manifestPath}`);\n }\n\n return parsed;\n}\n\nasync function findWorkspaceRoot(startPath: string): Promise<string | null> {\n let currentPath = path.resolve(startPath);\n\n for (;;) {\n const appsRoot = path.join(currentPath, 'apps');\n if (await isDirectory(appsRoot)) return currentPath;\n\n const parentPath = path.dirname(currentPath);\n if (parentPath === currentPath) return null;\n currentPath = parentPath;\n }\n}\n\nfunction inferProjectId(cwd: string, appsRoot: string): string | null {\n const relativePath = path.relative(path.resolve(appsRoot), path.resolve(cwd));\n if (relativePath === '' || relativePath.startsWith('..') || path.isAbsolute(relativePath)) {\n return null;\n }\n\n const [projectId] = relativePath.split(path.sep);\n return projectId === undefined || projectId.length === 0 ? null : path.basename(projectId);\n}\n\nfunction validateExplicitProjectId(projectId: string): string {\n if (projectId.trim().length === 0) {\n throw new Error('Invalid project id: expected a single safe project segment.');\n }\n\n if (\n projectId === '.' ||\n projectId === '..' ||\n path.isAbsolute(projectId) ||\n projectId.includes('/') ||\n projectId.includes('\\\\')\n ) {\n throw new Error(`Invalid project id: ${projectId}. Expected a single safe project segment.`);\n }\n\n return projectId;\n}\n\nasync function isDirectory(filePath: string): Promise<boolean> {\n try {\n const stat = await fs.stat(filePath);\n return stat.isDirectory();\n } catch {\n return false;\n }\n}\n\nasync function pathExists(filePath: string): Promise<boolean> {\n try {\n await fs.access(filePath);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction getErrorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"projectDatabase.d.ts","sourceRoot":"","sources":["../src/projectDatabase.ts"],"names":[],"mappings":"AAUA,wBAAsB,uCAAuC,CAAC,IAAI,EAAE;IAClE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAazB"}
|
package/dist/projectDatabase.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { readProjectInfrastructureEnvironment } from './projectEnvironment.js';
|
|
2
|
-
const DATABASE_URL_KEYS = [
|
|
3
|
-
'ANKH_SECRET_STORE_DATABASE_URL',
|
|
4
|
-
'SUPABASE_DB_URL',
|
|
5
|
-
'POSTGRES_URL',
|
|
6
|
-
'DB_URL',
|
|
7
|
-
'DATABASE_URL',
|
|
8
|
-
];
|
|
9
|
-
export async function resolveProjectInfrastructureDatabaseUrl(args) {
|
|
10
|
-
const environment = await readProjectInfrastructureEnvironment({
|
|
11
|
-
keys: DATABASE_URL_KEYS,
|
|
12
|
-
projectPath: args.projectPath,
|
|
13
|
-
target: args.target,
|
|
14
|
-
});
|
|
15
|
-
for (const key of DATABASE_URL_KEYS) {
|
|
16
|
-
const value = environment[key]?.trim();
|
|
17
|
-
if (value)
|
|
18
|
-
return value;
|
|
19
|
-
}
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=projectDatabase.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"projectDatabase.js","sourceRoot":"","sources":["../src/projectDatabase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,yBAAyB,CAAC;AAE/E,MAAM,iBAAiB,GAAG;IACxB,gCAAgC;IAChC,iBAAiB;IACjB,cAAc;IACd,QAAQ;IACR,cAAc;CACN,CAAC;AAEX,MAAM,CAAC,KAAK,UAAU,uCAAuC,CAAC,IAG7D;IACC,MAAM,WAAW,GAAG,MAAM,oCAAoC,CAAC;QAC7D,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,MAAM,EAAE,IAAI,CAAC,MAAM;KACpB,CAAC,CAAC;IAEH,KAAK,MAAM,GAAG,IAAI,iBAAiB,EAAE,CAAC;QACpC,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC;QACvC,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC;IAC1B,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { readProjectInfrastructureEnvironment } from './projectEnvironment.js';\n\nconst DATABASE_URL_KEYS = [\n 'ANKH_SECRET_STORE_DATABASE_URL',\n 'SUPABASE_DB_URL',\n 'POSTGRES_URL',\n 'DB_URL',\n 'DATABASE_URL',\n] as const;\n\nexport async function resolveProjectInfrastructureDatabaseUrl(args: {\n readonly projectPath: string;\n readonly target: string;\n}): Promise<string | null> {\n const environment = await readProjectInfrastructureEnvironment({\n keys: DATABASE_URL_KEYS,\n projectPath: args.projectPath,\n target: args.target,\n });\n\n for (const key of DATABASE_URL_KEYS) {\n const value = environment[key]?.trim();\n if (value) return value;\n }\n\n return null;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"projectEnvironment.d.ts","sourceRoot":"","sources":["../src/projectEnvironment.ts"],"names":[],"mappings":"AAGA,wBAAsB,oCAAoC,CAAC,IAAI,EAAE;IAC/D,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,GAAG,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAc5C"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { promises as fs } from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
export async function readProjectInfrastructureEnvironment(args) {
|
|
4
|
-
const infraRoot = path.join(args.projectPath, 'infra', args.target);
|
|
5
|
-
const envPath = path.join(infraRoot, '.env');
|
|
6
|
-
const fallbackPath = path.join(infraRoot, '.env.example');
|
|
7
|
-
const sourcePath = (await pathExists(envPath)) ? envPath : fallbackPath;
|
|
8
|
-
const environment = await readEnvironmentFile(sourcePath);
|
|
9
|
-
const selected = {};
|
|
10
|
-
for (const key of new Set(args.keys)) {
|
|
11
|
-
const value = environment.get(key);
|
|
12
|
-
if (value !== undefined)
|
|
13
|
-
selected[key] = value;
|
|
14
|
-
}
|
|
15
|
-
return selected;
|
|
16
|
-
}
|
|
17
|
-
async function readEnvironmentFile(filePath) {
|
|
18
|
-
const out = new Map();
|
|
19
|
-
const content = await fs.readFile(filePath, 'utf8');
|
|
20
|
-
for (const line of content.split(/\r?\n/u)) {
|
|
21
|
-
const trimmed = line.trim();
|
|
22
|
-
if (!trimmed || trimmed.startsWith('#'))
|
|
23
|
-
continue;
|
|
24
|
-
const separator = trimmed.indexOf('=');
|
|
25
|
-
if (separator <= 0)
|
|
26
|
-
continue;
|
|
27
|
-
const key = trimmed.slice(0, separator).trim();
|
|
28
|
-
const value = trimmed
|
|
29
|
-
.slice(separator + 1)
|
|
30
|
-
.trim()
|
|
31
|
-
.replace(/^['"]|['"]$/g, '');
|
|
32
|
-
out.set(key, value);
|
|
33
|
-
}
|
|
34
|
-
return out;
|
|
35
|
-
}
|
|
36
|
-
async function pathExists(filePath) {
|
|
37
|
-
try {
|
|
38
|
-
await fs.access(filePath);
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=projectEnvironment.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"projectEnvironment.js","sourceRoot":"","sources":["../src/projectEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,CAAC,KAAK,UAAU,oCAAoC,CAAC,IAI1D;IACC,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACpE,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC7C,MAAM,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CAAC;aACpB,IAAI,EAAE;aACN,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;QAC/B,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACtB,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,QAAgB;IACxC,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["import { promises as fs } from 'fs';\nimport path from 'path';\n\nexport async function readProjectInfrastructureEnvironment(args: {\n readonly keys: readonly string[];\n readonly projectPath: string;\n readonly target: string;\n}): Promise<Readonly<Record<string, string>>> {\n const infraRoot = path.join(args.projectPath, 'infra', args.target);\n const envPath = path.join(infraRoot, '.env');\n const fallbackPath = path.join(infraRoot, '.env.example');\n const sourcePath = (await pathExists(envPath)) ? envPath : fallbackPath;\n const environment = await readEnvironmentFile(sourcePath);\n const selected: Record<string, string> = {};\n\n for (const key of new Set(args.keys)) {\n const value = environment.get(key);\n if (value !== undefined) selected[key] = value;\n }\n\n return selected;\n}\n\nasync function readEnvironmentFile(filePath: string): Promise<Map<string, string>> {\n const out = new Map<string, string>();\n const content = await fs.readFile(filePath, 'utf8');\n\n for (const line of content.split(/\\r?\\n/u)) {\n const trimmed = line.trim();\n if (!trimmed || trimmed.startsWith('#')) continue;\n const separator = trimmed.indexOf('=');\n if (separator <= 0) continue;\n const key = trimmed.slice(0, separator).trim();\n const value = trimmed\n .slice(separator + 1)\n .trim()\n .replace(/^['\"]|['\"]$/g, '');\n out.set(key, value);\n }\n\n return out;\n}\n\nasync function pathExists(filePath: string): Promise<boolean> {\n try {\n await fs.access(filePath);\n return true;\n } catch {\n return false;\n }\n}\n"]}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { AppManifest } from '@ankhorage/contracts';
|
|
2
|
-
import { generateInfrastructure } from './index.js';
|
|
3
|
-
export interface InfraSyncResult {
|
|
4
|
-
readonly generated: number;
|
|
5
|
-
readonly removed: number;
|
|
6
|
-
readonly warnings: readonly string[];
|
|
7
|
-
readonly skipped?: {
|
|
8
|
-
readonly reason: string;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export interface InfraProjectInspection {
|
|
12
|
-
readonly generated: boolean;
|
|
13
|
-
readonly generatedAt: string | null;
|
|
14
|
-
readonly hasDeployment: boolean;
|
|
15
|
-
readonly target: string | null;
|
|
16
|
-
readonly trackedFiles: number;
|
|
17
|
-
readonly warnings: readonly string[];
|
|
18
|
-
readonly skipped?: {
|
|
19
|
-
readonly reason: string;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export declare function syncProjectInfrastructure(args: {
|
|
23
|
-
readonly generateInfrastructureImpl?: typeof generateInfrastructure;
|
|
24
|
-
readonly manifest: AppManifest;
|
|
25
|
-
readonly projectId: string;
|
|
26
|
-
readonly projectPath: string;
|
|
27
|
-
}): Promise<InfraSyncResult>;
|
|
28
|
-
export declare function inspectProjectInfrastructure(args: {
|
|
29
|
-
readonly manifest: AppManifest;
|
|
30
|
-
readonly projectId: string;
|
|
31
|
-
readonly projectPath: string;
|
|
32
|
-
}): Promise<InfraProjectInspection>;
|
|
33
|
-
export declare function resolveProjectInfrastructureTarget(args: {
|
|
34
|
-
readonly manifest: AppManifest;
|
|
35
|
-
readonly projectPath: string;
|
|
36
|
-
}): Promise<string | null>;
|
|
37
|
-
export declare function resolveProjectFile(projectPath: string, filePath: string): string;
|
|
38
|
-
//# sourceMappingURL=projectInfrastructure.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"projectInfrastructure.d.ts","sourceRoot":"","sources":["../src/projectInfrastructure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIx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A0BlC;AAED,wBAAsB,kCAAkC,CAAC,IAAI,EAAE;IAC7D,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQzB;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAUhF"}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { promises as fs } from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { generateInfrastructure } from './index.js';
|
|
4
|
-
import { validateInfraSupport } from './infraValidation.js';
|
|
5
|
-
const INFRA_LEDGER_RELATIVE_PATH = '.ankh/infra-ledger.json';
|
|
6
|
-
const STUDIO_PROJECT_ID = 'studio';
|
|
7
|
-
export async function syncProjectInfrastructure(args) {
|
|
8
|
-
const supportWarnings = validateInfraSupport(args.manifest.infra);
|
|
9
|
-
if (args.projectId === STUDIO_PROJECT_ID) {
|
|
10
|
-
return {
|
|
11
|
-
generated: 0,
|
|
12
|
-
removed: 0,
|
|
13
|
-
warnings: supportWarnings,
|
|
14
|
-
skipped: {
|
|
15
|
-
reason: 'apps/studio is the dashboard and is not a generated app target.',
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
const previousLedger = await readInfraLedger(args.projectPath);
|
|
20
|
-
const previousFiles = new Set(previousLedger?.files ?? []);
|
|
21
|
-
if (args.manifest.infra.deployment === undefined) {
|
|
22
|
-
const removed = await removeFiles(args.projectPath, previousFiles);
|
|
23
|
-
await removeInfraLedger(args.projectPath);
|
|
24
|
-
return {
|
|
25
|
-
generated: 0,
|
|
26
|
-
removed,
|
|
27
|
-
warnings: supportWarnings,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
const generated = (args.generateInfrastructureImpl ?? generateInfrastructure)(args.manifest.infra, {
|
|
31
|
-
namespaceHint: args.projectId,
|
|
32
|
-
appManifest: args.manifest,
|
|
33
|
-
});
|
|
34
|
-
const combinedWarnings = uniqueStrings([...supportWarnings, ...generated.warnings]);
|
|
35
|
-
const nextFiles = new Set();
|
|
36
|
-
for (const file of generated.files) {
|
|
37
|
-
const outputPath = resolveProjectFile(args.projectPath, file.path);
|
|
38
|
-
await fs.mkdir(path.dirname(outputPath), { recursive: true });
|
|
39
|
-
await fs.writeFile(outputPath, file.content, 'utf8');
|
|
40
|
-
if (file.executable === true) {
|
|
41
|
-
await fs.chmod(outputPath, 0o755);
|
|
42
|
-
}
|
|
43
|
-
nextFiles.add(file.path);
|
|
44
|
-
}
|
|
45
|
-
const staleFiles = new Set([...previousFiles].filter((filePath) => !nextFiles.has(filePath)));
|
|
46
|
-
const removed = await removeFiles(args.projectPath, staleFiles);
|
|
47
|
-
await writeInfraLedger(args.projectPath, {
|
|
48
|
-
schemaVersion: 1,
|
|
49
|
-
generatedAt: new Date().toISOString(),
|
|
50
|
-
target: generated.meta.target,
|
|
51
|
-
files: [...nextFiles].sort(),
|
|
52
|
-
warnings: combinedWarnings,
|
|
53
|
-
});
|
|
54
|
-
return {
|
|
55
|
-
generated: generated.files.length,
|
|
56
|
-
removed,
|
|
57
|
-
warnings: combinedWarnings,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
export async function inspectProjectInfrastructure(args) {
|
|
61
|
-
const supportWarnings = validateInfraSupport(args.manifest.infra);
|
|
62
|
-
if (args.projectId === STUDIO_PROJECT_ID) {
|
|
63
|
-
return {
|
|
64
|
-
generated: false,
|
|
65
|
-
generatedAt: null,
|
|
66
|
-
hasDeployment: false,
|
|
67
|
-
target: null,
|
|
68
|
-
trackedFiles: 0,
|
|
69
|
-
warnings: supportWarnings,
|
|
70
|
-
skipped: {
|
|
71
|
-
reason: 'apps/studio is the dashboard and is not a generated app target.',
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
const ledger = await readInfraLedger(args.projectPath);
|
|
76
|
-
return {
|
|
77
|
-
generated: ledger !== null,
|
|
78
|
-
generatedAt: ledger?.generatedAt ?? null,
|
|
79
|
-
hasDeployment: args.manifest.infra.deployment !== undefined,
|
|
80
|
-
target: args.manifest.infra.deployment?.target ?? ledger?.target ?? null,
|
|
81
|
-
trackedFiles: ledger?.files.length ?? 0,
|
|
82
|
-
warnings: uniqueStrings([...supportWarnings, ...(ledger?.warnings ?? [])]),
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
export async function resolveProjectInfrastructureTarget(args) {
|
|
86
|
-
const manifestTarget = args.manifest.infra.deployment?.target;
|
|
87
|
-
if (manifestTarget !== undefined) {
|
|
88
|
-
return manifestTarget;
|
|
89
|
-
}
|
|
90
|
-
const ledger = await readInfraLedger(args.projectPath);
|
|
91
|
-
return ledger?.target ?? null;
|
|
92
|
-
}
|
|
93
|
-
export function resolveProjectFile(projectPath, filePath) {
|
|
94
|
-
const rootPath = path.resolve(projectPath);
|
|
95
|
-
const resolvedPath = path.resolve(rootPath, filePath);
|
|
96
|
-
const relativePath = path.relative(rootPath, resolvedPath);
|
|
97
|
-
if (relativePath.startsWith('..') || path.isAbsolute(relativePath)) {
|
|
98
|
-
throw new Error(`Invalid infra output path outside project root: ${filePath}`);
|
|
99
|
-
}
|
|
100
|
-
return resolvedPath;
|
|
101
|
-
}
|
|
102
|
-
async function readInfraLedger(projectPath) {
|
|
103
|
-
const ledgerPath = path.join(projectPath, INFRA_LEDGER_RELATIVE_PATH);
|
|
104
|
-
try {
|
|
105
|
-
const rawLedger = await fs.readFile(ledgerPath, 'utf8');
|
|
106
|
-
const parsedLedger = JSON.parse(rawLedger);
|
|
107
|
-
return isInfraLedger(parsedLedger) ? parsedLedger : null;
|
|
108
|
-
}
|
|
109
|
-
catch {
|
|
110
|
-
return null;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
async function writeInfraLedger(projectPath, ledger) {
|
|
114
|
-
const ledgerPath = path.join(projectPath, INFRA_LEDGER_RELATIVE_PATH);
|
|
115
|
-
await fs.mkdir(path.dirname(ledgerPath), { recursive: true });
|
|
116
|
-
await fs.writeFile(ledgerPath, `${JSON.stringify(ledger, null, 2)}\n`, 'utf8');
|
|
117
|
-
}
|
|
118
|
-
async function removeInfraLedger(projectPath) {
|
|
119
|
-
await fs.rm(path.join(projectPath, INFRA_LEDGER_RELATIVE_PATH), { force: true });
|
|
120
|
-
}
|
|
121
|
-
async function removeFiles(projectPath, files) {
|
|
122
|
-
let removedFiles = 0;
|
|
123
|
-
for (const filePath of files) {
|
|
124
|
-
await fs.rm(resolveProjectFile(projectPath, filePath), { force: true });
|
|
125
|
-
removedFiles += 1;
|
|
126
|
-
}
|
|
127
|
-
return removedFiles;
|
|
128
|
-
}
|
|
129
|
-
function isInfraLedger(value) {
|
|
130
|
-
return (isRecord(value) &&
|
|
131
|
-
value.schemaVersion === 1 &&
|
|
132
|
-
typeof value.generatedAt === 'string' &&
|
|
133
|
-
typeof value.target === 'string' &&
|
|
134
|
-
Array.isArray(value.files) &&
|
|
135
|
-
value.files.every((filePath) => typeof filePath === 'string') &&
|
|
136
|
-
Array.isArray(value.warnings) &&
|
|
137
|
-
value.warnings.every((warning) => typeof warning === 'string'));
|
|
138
|
-
}
|
|
139
|
-
function isRecord(value) {
|
|
140
|
-
return typeof value === 'object' && value !== null;
|
|
141
|
-
}
|
|
142
|
-
function uniqueStrings(values) {
|
|
143
|
-
return [...new Set(values)];
|
|
144
|
-
}
|
|
145
|
-
//# sourceMappingURL=projectInfrastructure.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"projectInfrastructure.js","sourceRoot":"","sources":["../src/projectInfrastructure.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,oB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,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,OAAO,KAAK,QAAQ,CAAC,CAC/D,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC;AAED,SAAS,aAAa,CAAC,MAAyB;IAC9C,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import type { AppManifest } from '@ankhorage/contracts';\nimport { promises as fs } from 'fs';\nimport path from 'path';\n\nimport { generateInfrastructure } from './index.js';\nimport { validateInfraSupport } from './infraValidation.js';\n\nconst INFRA_LEDGER_RELATIVE_PATH = '.ankh/infra-ledger.json';\nconst STUDIO_PROJECT_ID = 'studio';\n\ninterface InfraLedger {\n readonly schemaVersion: 1;\n readonly generatedAt: string;\n readonly target: string;\n readonly files: readonly string[];\n readonly warnings: readonly string[];\n}\n\nexport interface InfraSyncResult {\n readonly generated: number;\n readonly removed: number;\n readonly warnings: readonly string[];\n readonly skipped?: {\n readonly reason: string;\n };\n}\n\nexport interface InfraProjectInspection {\n readonly generated: boolean;\n readonly generatedAt: string | null;\n readonly hasDeployment: boolean;\n readonly target: string | null;\n readonly trackedFiles: number;\n readonly warnings: readonly string[];\n readonly skipped?: {\n readonly reason: string;\n };\n}\n\nexport async function syncProjectInfrastructure(args: {\n readonly generateInfrastructureImpl?: typeof generateInfrastructure;\n readonly manifest: AppManifest;\n readonly projectId: string;\n readonly projectPath: string;\n}): Promise<InfraSyncResult> {\n const supportWarnings = validateInfraSupport(args.manifest.infra);\n\n if (args.projectId === STUDIO_PROJECT_ID) {\n return {\n generated: 0,\n removed: 0,\n warnings: supportWarnings,\n skipped: {\n reason: 'apps/studio is the dashboard and is not a generated app target.',\n },\n };\n }\n\n const previousLedger = await readInfraLedger(args.projectPath);\n const previousFiles = new Set(previousLedger?.files ?? []);\n\n if (args.manifest.infra.deployment === undefined) {\n const removed = await removeFiles(args.projectPath, previousFiles);\n await removeInfraLedger(args.projectPath);\n return {\n generated: 0,\n removed,\n warnings: supportWarnings,\n };\n }\n\n const generated = (args.generateInfrastructureImpl ?? generateInfrastructure)(\n args.manifest.infra,\n {\n namespaceHint: args.projectId,\n appManifest: args.manifest,\n },\n );\n const combinedWarnings = uniqueStrings([...supportWarnings, ...generated.warnings]);\n const nextFiles = new Set<string>();\n\n for (const file of generated.files) {\n const outputPath = resolveProjectFile(args.projectPath, file.path);\n await fs.mkdir(path.dirname(outputPath), { recursive: true });\n await fs.writeFile(outputPath, file.content, 'utf8');\n\n if (file.executable === true) {\n await fs.chmod(outputPath, 0o755);\n }\n\n nextFiles.add(file.path);\n }\n\n const staleFiles = new Set([...previousFiles].filter((filePath) => !nextFiles.has(filePath)));\n const removed = await removeFiles(args.projectPath, staleFiles);\n\n await writeInfraLedger(args.projectPath, {\n schemaVersion: 1,\n generatedAt: new Date().toISOString(),\n target: generated.meta.target,\n files: [...nextFiles].sort(),\n warnings: combinedWarnings,\n });\n\n return {\n generated: generated.files.length,\n removed,\n warnings: combinedWarnings,\n };\n}\n\nexport async function inspectProjectInfrastructure(args: {\n readonly manifest: AppManifest;\n readonly projectId: string;\n readonly projectPath: string;\n}): Promise<InfraProjectInspection> {\n const supportWarnings = validateInfraSupport(args.manifest.infra);\n\n if (args.projectId === STUDIO_PROJECT_ID) {\n return {\n generated: false,\n generatedAt: null,\n hasDeployment: false,\n target: null,\n trackedFiles: 0,\n warnings: supportWarnings,\n skipped: {\n reason: 'apps/studio is the dashboard and is not a generated app target.',\n },\n };\n }\n\n const ledger = await readInfraLedger(args.projectPath);\n return {\n generated: ledger !== null,\n generatedAt: ledger?.generatedAt ?? null,\n hasDeployment: args.manifest.infra.deployment !== undefined,\n target: args.manifest.infra.deployment?.target ?? ledger?.target ?? null,\n trackedFiles: ledger?.files.length ?? 0,\n warnings: uniqueStrings([...supportWarnings, ...(ledger?.warnings ?? [])]),\n };\n}\n\nexport async function resolveProjectInfrastructureTarget(args: {\n readonly manifest: AppManifest;\n readonly projectPath: string;\n}): Promise<string | null> {\n const manifestTarget = args.manifest.infra.deployment?.target;\n if (manifestTarget !== undefined) {\n return manifestTarget;\n }\n\n const ledger = await readInfraLedger(args.projectPath);\n return ledger?.target ?? null;\n}\n\nexport function resolveProjectFile(projectPath: string, filePath: string): string {\n const rootPath = path.resolve(projectPath);\n const resolvedPath = path.resolve(rootPath, filePath);\n const relativePath = path.relative(rootPath, resolvedPath);\n\n if (relativePath.startsWith('..') || path.isAbsolute(relativePath)) {\n throw new Error(`Invalid infra output path outside project root: ${filePath}`);\n }\n\n return resolvedPath;\n}\n\nasync function readInfraLedger(projectPath: string): Promise<InfraLedger | null> {\n const ledgerPath = path.join(projectPath, INFRA_LEDGER_RELATIVE_PATH);\n\n try {\n const rawLedger = await fs.readFile(ledgerPath, 'utf8');\n const parsedLedger: unknown = JSON.parse(rawLedger);\n return isInfraLedger(parsedLedger) ? parsedLedger : null;\n } catch {\n return null;\n }\n}\n\nasync function writeInfraLedger(projectPath: string, ledger: InfraLedger): Promise<void> {\n const ledgerPath = path.join(projectPath, INFRA_LEDGER_RELATIVE_PATH);\n await fs.mkdir(path.dirname(ledgerPath), { recursive: true });\n await fs.writeFile(ledgerPath, `${JSON.stringify(ledger, null, 2)}\\n`, 'utf8');\n}\n\nasync function removeInfraLedger(projectPath: string): Promise<void> {\n await fs.rm(path.join(projectPath, INFRA_LEDGER_RELATIVE_PATH), { force: true });\n}\n\nasync function removeFiles(projectPath: string, files: ReadonlySet<string>): Promise<number> {\n let removedFiles = 0;\n\n for (const filePath of files) {\n await fs.rm(resolveProjectFile(projectPath, filePath), { force: true });\n removedFiles += 1;\n }\n\n return removedFiles;\n}\n\nfunction isInfraLedger(value: unknown): value is InfraLedger {\n return (\n isRecord(value) &&\n value.schemaVersion === 1 &&\n typeof value.generatedAt === 'string' &&\n typeof value.target === 'string' &&\n Array.isArray(value.files) &&\n value.files.every((filePath) => typeof filePath === 'string') &&\n Array.isArray(value.warnings) &&\n value.warnings.every((warning) => typeof warning === 'string')\n );\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\nfunction uniqueStrings(values: readonly string[]): readonly string[] {\n return [...new Set(values)];\n}\n"]}
|
package/dist/runtime.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { InfraCommandContext } from './commandContext.js';
|
|
2
|
-
export type InfraLifecycleScript = 'destroy' | 'down' | 'port-forward' | 'reset' | 'status' | 'up';
|
|
3
|
-
export interface InfraScriptOutput {
|
|
4
|
-
readonly stderr: string;
|
|
5
|
-
readonly stdout: string;
|
|
6
|
-
}
|
|
7
|
-
export interface InfraPortForwardInfo {
|
|
8
|
-
readonly localPort: number;
|
|
9
|
-
readonly url: string;
|
|
10
|
-
}
|
|
11
|
-
export declare class InfraScriptExecutionError extends Error {
|
|
12
|
-
readonly exitCode: number | null;
|
|
13
|
-
readonly stderr: string;
|
|
14
|
-
readonly stdout: string;
|
|
15
|
-
constructor(args: {
|
|
16
|
-
readonly exitCode: number | null;
|
|
17
|
-
readonly message: string;
|
|
18
|
-
readonly stderr: string;
|
|
19
|
-
readonly stdout: string;
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
export declare function runProjectInfrastructureLifecycle(args: {
|
|
23
|
-
readonly args?: readonly string[];
|
|
24
|
-
readonly env?: Readonly<Record<string, string | undefined>>;
|
|
25
|
-
readonly onStderr?: (chunk: string) => void;
|
|
26
|
-
readonly onStdout?: (chunk: string) => void;
|
|
27
|
-
readonly projectId: string;
|
|
28
|
-
readonly projectPath: string;
|
|
29
|
-
readonly script: InfraLifecycleScript;
|
|
30
|
-
readonly target: string;
|
|
31
|
-
}): Promise<InfraScriptOutput>;
|
|
32
|
-
export declare function resolveProjectInfrastructurePortForward(args: {
|
|
33
|
-
readonly projectPath: string;
|
|
34
|
-
readonly target: string;
|
|
35
|
-
}): Promise<InfraPortForwardInfo>;
|
|
36
|
-
/** Ensures the generated host forwards required by a running application are active. */
|
|
37
|
-
export declare function ensureProjectInfrastructureRuntime(args: {
|
|
38
|
-
readonly projectId: string;
|
|
39
|
-
readonly projectPath: string;
|
|
40
|
-
readonly target: string;
|
|
41
|
-
}): Promise<InfraScriptOutput>;
|
|
42
|
-
export declare function runProjectInfraScript(args: {
|
|
43
|
-
readonly context: InfraCommandContext;
|
|
44
|
-
readonly projectId: string;
|
|
45
|
-
readonly projectPath: string;
|
|
46
|
-
readonly script: InfraLifecycleScript;
|
|
47
|
-
readonly target: string;
|
|
48
|
-
}): Promise<void>;
|
|
49
|
-
export declare function resolveProjectInfraScriptPath(args: {
|
|
50
|
-
readonly projectPath: string;
|
|
51
|
-
readonly script: InfraLifecycleScript;
|
|
52
|
-
readonly target: string;
|
|
53
|
-
}): string;
|
|
54
|
-
//# sourceMappingURL=runtime.d.ts.map
|
package/dist/runtime.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG/D,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,MAAM,GAAG,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC;AAEnG,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC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