typekro 0.28.1 → 0.29.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/dist/.tsbuildinfo +1 -1
- package/dist/advanced/index.d.ts +5 -1
- package/dist/advanced/index.d.ts.map +1 -1
- package/dist/advanced/index.js +2 -3
- package/dist/advanced/index.js.map +1 -1
- package/dist/alchemy/deployers.d.ts +6 -4
- package/dist/alchemy/deployers.d.ts.map +1 -1
- package/dist/alchemy/deployers.js +46 -9
- package/dist/alchemy/deployers.js.map +1 -1
- package/dist/alchemy/index.d.ts +2 -3
- package/dist/alchemy/index.d.ts.map +1 -1
- package/dist/alchemy/index.js +1 -1
- package/dist/alchemy/index.js.map +1 -1
- package/dist/alchemy/kro-delete.d.ts +6 -5
- package/dist/alchemy/kro-delete.d.ts.map +1 -1
- package/dist/alchemy/kro-delete.js +169 -22
- package/dist/alchemy/kro-delete.js.map +1 -1
- package/dist/alchemy/resource-registration.d.ts +24 -31
- package/dist/alchemy/resource-registration.d.ts.map +1 -1
- package/dist/alchemy/resource-registration.js +439 -75
- package/dist/alchemy/resource-registration.js.map +1 -1
- package/dist/alchemy/types.d.ts +56 -14
- package/dist/alchemy/types.d.ts.map +1 -1
- package/dist/alchemy/utilities.d.ts +2 -2
- package/dist/alchemy/utilities.d.ts.map +1 -1
- package/dist/compositions/typekro-runtime/typekro-runtime.d.ts.map +1 -1
- package/dist/compositions/typekro-runtime/typekro-runtime.js +31 -28
- package/dist/compositions/typekro-runtime/typekro-runtime.js.map +1 -1
- package/dist/compositions/typekro-runtime/types.d.ts +12 -0
- package/dist/compositions/typekro-runtime/types.d.ts.map +1 -1
- package/dist/core/composition/analysis-metadata.d.ts +15 -0
- package/dist/core/composition/analysis-metadata.d.ts.map +1 -0
- package/dist/core/composition/analysis-metadata.js +20 -0
- package/dist/core/composition/analysis-metadata.js.map +1 -0
- package/dist/core/composition/imperative.d.ts.map +1 -1
- package/dist/core/composition/imperative.js +38 -9
- package/dist/core/composition/imperative.js.map +1 -1
- package/dist/core/composition/nested-status-cel.js +3 -3
- package/dist/core/composition/nested-status-cel.js.map +1 -1
- package/dist/core/constants/brands.d.ts +1 -1
- package/dist/core/constants/brands.d.ts.map +1 -1
- package/dist/core/constants/brands.js +1 -1
- package/dist/core/constants/brands.js.map +1 -1
- package/dist/core/dependencies/resolver.d.ts +3 -1
- package/dist/core/dependencies/resolver.d.ts.map +1 -1
- package/dist/core/dependencies/resolver.js +29 -13
- package/dist/core/dependencies/resolver.js.map +1 -1
- package/dist/core/deployment/deletion-result.d.ts +22 -0
- package/dist/core/deployment/deletion-result.d.ts.map +1 -0
- package/dist/core/deployment/deletion-result.js +108 -0
- package/dist/core/deployment/deletion-result.js.map +1 -0
- package/dist/core/deployment/deployment-state-discovery.d.ts +1 -0
- package/dist/core/deployment/deployment-state-discovery.d.ts.map +1 -1
- package/dist/core/deployment/deployment-state-discovery.js +89 -9
- package/dist/core/deployment/deployment-state-discovery.js.map +1 -1
- package/dist/core/deployment/direct-factory.d.ts +46 -25
- package/dist/core/deployment/direct-factory.d.ts.map +1 -1
- package/dist/core/deployment/direct-factory.js +536 -126
- package/dist/core/deployment/direct-factory.js.map +1 -1
- package/dist/core/deployment/engine.d.ts +4 -1
- package/dist/core/deployment/engine.d.ts.map +1 -1
- package/dist/core/deployment/engine.js +105 -34
- package/dist/core/deployment/engine.js.map +1 -1
- package/dist/core/deployment/errors.d.ts +20 -1
- package/dist/core/deployment/errors.d.ts.map +1 -1
- package/dist/core/deployment/errors.js +55 -0
- package/dist/core/deployment/errors.js.map +1 -1
- package/dist/core/deployment/event-monitor.d.ts +4 -3
- package/dist/core/deployment/event-monitor.d.ts.map +1 -1
- package/dist/core/deployment/event-monitor.js +17 -5
- package/dist/core/deployment/event-monitor.js.map +1 -1
- package/dist/core/deployment/index.d.ts +1 -1
- package/dist/core/deployment/index.d.ts.map +1 -1
- package/dist/core/deployment/index.js +1 -1
- package/dist/core/deployment/index.js.map +1 -1
- package/dist/core/deployment/k8s-helpers.d.ts +1 -1
- package/dist/core/deployment/k8s-helpers.d.ts.map +1 -1
- package/dist/core/deployment/k8s-helpers.js +11 -5
- package/dist/core/deployment/k8s-helpers.js.map +1 -1
- package/dist/core/deployment/kro-factory.d.ts +54 -30
- package/dist/core/deployment/kro-factory.d.ts.map +1 -1
- package/dist/core/deployment/kro-factory.js +2002 -259
- package/dist/core/deployment/kro-factory.js.map +1 -1
- package/dist/core/deployment/kro-instance-admission.d.ts +17 -0
- package/dist/core/deployment/kro-instance-admission.d.ts.map +1 -0
- package/dist/core/deployment/kro-instance-admission.js +73 -0
- package/dist/core/deployment/kro-instance-admission.js.map +1 -0
- package/dist/core/deployment/kro-instance-safety.d.ts +0 -3
- package/dist/core/deployment/kro-instance-safety.d.ts.map +1 -1
- package/dist/core/deployment/kro-instance-safety.js +0 -11
- package/dist/core/deployment/kro-instance-safety.js.map +1 -1
- package/dist/core/deployment/kro-namespace-teardown.d.ts +63 -5
- package/dist/core/deployment/kro-namespace-teardown.d.ts.map +1 -1
- package/dist/core/deployment/kro-namespace-teardown.js +124 -12
- package/dist/core/deployment/kro-namespace-teardown.js.map +1 -1
- package/dist/core/deployment/kro-readiness.d.ts +2 -0
- package/dist/core/deployment/kro-readiness.d.ts.map +1 -1
- package/dist/core/deployment/kro-readiness.js +23 -6
- package/dist/core/deployment/kro-readiness.js.map +1 -1
- package/dist/core/deployment/poll-timeout.d.ts +1 -1
- package/dist/core/deployment/poll-timeout.d.ts.map +1 -1
- package/dist/core/deployment/poll-timeout.js +12 -1
- package/dist/core/deployment/poll-timeout.js.map +1 -1
- package/dist/core/deployment/resource-applier.d.ts +19 -3
- package/dist/core/deployment/resource-applier.d.ts.map +1 -1
- package/dist/core/deployment/resource-applier.js +263 -44
- package/dist/core/deployment/resource-applier.js.map +1 -1
- package/dist/core/deployment/rollback-manager.d.ts +6 -1
- package/dist/core/deployment/rollback-manager.d.ts.map +1 -1
- package/dist/core/deployment/rollback-manager.js +38 -12
- package/dist/core/deployment/rollback-manager.js.map +1 -1
- package/dist/core/deployment/schema-cel-evaluator.d.ts.map +1 -1
- package/dist/core/deployment/schema-cel-evaluator.js +63 -0
- package/dist/core/deployment/schema-cel-evaluator.js.map +1 -1
- package/dist/core/deployment/shared-utilities.d.ts +11 -6
- package/dist/core/deployment/shared-utilities.d.ts.map +1 -1
- package/dist/core/deployment/shared-utilities.js +169 -14
- package/dist/core/deployment/shared-utilities.js.map +1 -1
- package/dist/core/deployment/singleton-gitops.d.ts.map +1 -1
- package/dist/core/deployment/singleton-gitops.js +0 -2
- package/dist/core/deployment/singleton-gitops.js.map +1 -1
- package/dist/core/deployment/singleton-owner-drift.d.ts +11 -2
- package/dist/core/deployment/singleton-owner-drift.d.ts.map +1 -1
- package/dist/core/deployment/singleton-owner-drift.js +30 -13
- package/dist/core/deployment/singleton-owner-drift.js.map +1 -1
- package/dist/core/deployment/strategies/base-strategy.d.ts +2 -0
- package/dist/core/deployment/strategies/base-strategy.d.ts.map +1 -1
- package/dist/core/deployment/strategies/base-strategy.js +19 -2
- package/dist/core/deployment/strategies/base-strategy.js.map +1 -1
- package/dist/core/deployment/strategies/direct-strategy.d.ts +3 -0
- package/dist/core/deployment/strategies/direct-strategy.d.ts.map +1 -1
- package/dist/core/deployment/strategies/direct-strategy.js +31 -8
- package/dist/core/deployment/strategies/direct-strategy.js.map +1 -1
- package/dist/core/deployment/strategies/index.d.ts +1 -1
- package/dist/core/deployment/strategies/index.d.ts.map +1 -1
- package/dist/core/deployment/strategies/index.js +1 -1
- package/dist/core/deployment/strategies/index.js.map +1 -1
- package/dist/core/errors.d.ts +2 -2
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js.map +1 -1
- package/dist/core/expressions/analysis/cel-emitter.d.ts.map +1 -1
- package/dist/core/expressions/analysis/cel-emitter.js +17 -13
- package/dist/core/expressions/analysis/cel-emitter.js.map +1 -1
- package/dist/core/expressions/analysis/expression-metadata.d.ts +15 -0
- package/dist/core/expressions/analysis/expression-metadata.d.ts.map +1 -0
- package/dist/core/expressions/analysis/expression-metadata.js +10 -0
- package/dist/core/expressions/analysis/expression-metadata.js.map +1 -0
- package/dist/core/expressions/analysis/ready-when.d.ts +3 -0
- package/dist/core/expressions/analysis/ready-when.d.ts.map +1 -0
- package/dist/core/expressions/analysis/ready-when.js +127 -0
- package/dist/core/expressions/analysis/ready-when.js.map +1 -0
- package/dist/core/expressions/composition/composition-analyzer-helpers.d.ts +3 -2
- package/dist/core/expressions/composition/composition-analyzer-helpers.d.ts.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer-helpers.js +6 -4
- package/dist/core/expressions/composition/composition-analyzer-helpers.js.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer-ternary.d.ts +3 -2
- package/dist/core/expressions/composition/composition-analyzer-ternary.d.ts.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer-ternary.js +12 -12
- package/dist/core/expressions/composition/composition-analyzer-ternary.js.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer-traversal.d.ts.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer-traversal.js +68 -4
- package/dist/core/expressions/composition/composition-analyzer-traversal.js.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer-types.d.ts +2 -0
- package/dist/core/expressions/composition/composition-analyzer-types.d.ts.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer.d.ts.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer.js +2 -0
- package/dist/core/expressions/composition/composition-analyzer.js.map +1 -1
- package/dist/core/expressions/factory/status-builder-analyzer.d.ts.map +1 -1
- package/dist/core/expressions/factory/status-builder-analyzer.js +14 -1
- package/dist/core/expressions/factory/status-builder-analyzer.js.map +1 -1
- package/dist/core/kubernetes/api.d.ts.map +1 -1
- package/dist/core/kubernetes/api.js +2 -3
- package/dist/core/kubernetes/api.js.map +1 -1
- package/dist/core/kubernetes/bun-api-client.d.ts +1 -1
- package/dist/core/kubernetes/bun-api-client.d.ts.map +1 -1
- package/dist/core/kubernetes/bun-api-client.js +17 -17
- package/dist/core/kubernetes/bun-api-client.js.map +1 -1
- package/dist/core/kubernetes/bun-http-library.d.ts +16 -0
- package/dist/core/kubernetes/bun-http-library.d.ts.map +1 -1
- package/dist/core/kubernetes/bun-http-library.js +7 -1
- package/dist/core/kubernetes/bun-http-library.js.map +1 -1
- package/dist/core/kubernetes/bun-watch.d.ts +30 -0
- package/dist/core/kubernetes/bun-watch.d.ts.map +1 -0
- package/dist/core/kubernetes/bun-watch.js +144 -0
- package/dist/core/kubernetes/bun-watch.js.map +1 -0
- package/dist/core/kubernetes/client-node-runtime.d.ts +10 -0
- package/dist/core/kubernetes/client-node-runtime.d.ts.map +1 -0
- package/dist/core/kubernetes/client-node-runtime.js +15 -0
- package/dist/core/kubernetes/client-node-runtime.js.map +1 -0
- package/dist/core/kubernetes/client-provider.d.ts +21 -1
- package/dist/core/kubernetes/client-provider.d.ts.map +1 -1
- package/dist/core/kubernetes/client-provider.js +10 -10
- package/dist/core/kubernetes/client-provider.js.map +1 -1
- package/dist/core/kubernetes/index.d.ts +1 -1
- package/dist/core/kubernetes/index.d.ts.map +1 -1
- package/dist/core/kubernetes/index.js.map +1 -1
- package/dist/core/metadata/resource-metadata.d.ts +24 -1
- package/dist/core/metadata/resource-metadata.d.ts.map +1 -1
- package/dist/core/metadata/resource-metadata.js +8 -4
- package/dist/core/metadata/resource-metadata.js.map +1 -1
- package/dist/core/planning/artifact-codec.d.ts +14 -0
- package/dist/core/planning/artifact-codec.d.ts.map +1 -0
- package/dist/core/planning/artifact-codec.js +329 -0
- package/dist/core/planning/artifact-codec.js.map +1 -0
- package/dist/core/planning/artifacts.d.ts +212 -0
- package/dist/core/planning/artifacts.d.ts.map +1 -0
- package/dist/core/planning/artifacts.js +5 -0
- package/dist/core/planning/artifacts.js.map +1 -0
- package/dist/core/planning/aspects.d.ts +11 -0
- package/dist/core/planning/aspects.d.ts.map +1 -0
- package/dist/core/planning/aspects.js +77 -0
- package/dist/core/planning/aspects.js.map +1 -0
- package/dist/core/planning/canonical.d.ts +10 -0
- package/dist/core/planning/canonical.d.ts.map +1 -0
- package/dist/core/planning/canonical.js +54 -0
- package/dist/core/planning/canonical.js.map +1 -0
- package/dist/core/planning/capabilities.d.ts +16 -0
- package/dist/core/planning/capabilities.d.ts.map +1 -0
- package/dist/core/planning/capabilities.js +90 -0
- package/dist/core/planning/capabilities.js.map +1 -0
- package/dist/core/planning/capture.d.ts +29 -0
- package/dist/core/planning/capture.d.ts.map +1 -0
- package/dist/core/planning/capture.js +18 -0
- package/dist/core/planning/capture.js.map +1 -0
- package/dist/core/planning/compiler.d.ts +12 -0
- package/dist/core/planning/compiler.d.ts.map +1 -0
- package/dist/core/planning/compiler.js +631 -0
- package/dist/core/planning/compiler.js.map +1 -0
- package/dist/core/planning/direct-runtime-adapter.d.ts +39 -0
- package/dist/core/planning/direct-runtime-adapter.d.ts.map +1 -0
- package/dist/core/planning/direct-runtime-adapter.js +238 -0
- package/dist/core/planning/direct-runtime-adapter.js.map +1 -0
- package/dist/core/planning/execution-record.d.ts +21 -0
- package/dist/core/planning/execution-record.d.ts.map +1 -0
- package/dist/core/planning/execution-record.js +304 -0
- package/dist/core/planning/execution-record.js.map +1 -0
- package/dist/core/planning/index.d.ts +20 -0
- package/dist/core/planning/index.d.ts.map +1 -0
- package/dist/core/planning/index.js +18 -0
- package/dist/core/planning/index.js.map +1 -0
- package/dist/core/planning/kro-bundle.d.ts +24 -0
- package/dist/core/planning/kro-bundle.d.ts.map +1 -0
- package/dist/core/planning/kro-bundle.js +314 -0
- package/dist/core/planning/kro-bundle.js.map +1 -0
- package/dist/core/planning/kro-runtime-adapter.d.ts +28 -0
- package/dist/core/planning/kro-runtime-adapter.d.ts.map +1 -0
- package/dist/core/planning/kro-runtime-adapter.js +211 -0
- package/dist/core/planning/kro-runtime-adapter.js.map +1 -0
- package/dist/core/planning/materialization.d.ts +54 -0
- package/dist/core/planning/materialization.d.ts.map +1 -0
- package/dist/core/planning/materialization.js +489 -0
- package/dist/core/planning/materialization.js.map +1 -0
- package/dist/core/planning/plan-codec.d.ts +11 -0
- package/dist/core/planning/plan-codec.d.ts.map +1 -0
- package/dist/core/planning/plan-codec.js +555 -0
- package/dist/core/planning/plan-codec.js.map +1 -0
- package/dist/core/planning/planner.d.ts +21 -0
- package/dist/core/planning/planner.d.ts.map +1 -0
- package/dist/core/planning/planner.js +1518 -0
- package/dist/core/planning/planner.js.map +1 -0
- package/dist/core/planning/schema.d.ts +10 -0
- package/dist/core/planning/schema.d.ts.map +1 -0
- package/dist/core/planning/schema.js +159 -0
- package/dist/core/planning/schema.js.map +1 -0
- package/dist/core/planning/types.d.ts +441 -0
- package/dist/core/planning/types.d.ts.map +1 -0
- package/dist/core/planning/types.js +3 -0
- package/dist/core/planning/types.js.map +1 -0
- package/dist/core/planning/values.d.ts +76 -0
- package/dist/core/planning/values.d.ts.map +1 -0
- package/dist/core/planning/values.js +852 -0
- package/dist/core/planning/values.js.map +1 -0
- package/dist/core/proxy/create-resource.d.ts +12 -0
- package/dist/core/proxy/create-resource.d.ts.map +1 -1
- package/dist/core/proxy/create-resource.js +39 -9
- package/dist/core/proxy/create-resource.js.map +1 -1
- package/dist/core/readiness/evaluator-factories.d.ts +3 -1
- package/dist/core/readiness/evaluator-factories.d.ts.map +1 -1
- package/dist/core/readiness/evaluator-factories.js +130 -5
- package/dist/core/readiness/evaluator-factories.js.map +1 -1
- package/dist/core/readiness/index.d.ts +2 -1
- package/dist/core/readiness/index.d.ts.map +1 -1
- package/dist/core/readiness/index.js +2 -1
- package/dist/core/readiness/index.js.map +1 -1
- package/dist/core/readiness/portable-strategies.d.ts +28 -0
- package/dist/core/readiness/portable-strategies.d.ts.map +1 -0
- package/dist/core/readiness/portable-strategies.js +55 -0
- package/dist/core/readiness/portable-strategies.js.map +1 -0
- package/dist/core/readiness/strategy-configuration.d.ts +12 -0
- package/dist/core/readiness/strategy-configuration.d.ts.map +1 -0
- package/dist/core/readiness/strategy-configuration.js +51 -0
- package/dist/core/readiness/strategy-configuration.js.map +1 -0
- package/dist/core/references/cel-evaluator.d.ts +5 -0
- package/dist/core/references/cel-evaluator.d.ts.map +1 -1
- package/dist/core/references/cel-evaluator.js +33 -2
- package/dist/core/references/cel-evaluator.js.map +1 -1
- package/dist/core/references/external-refs.d.ts +2 -0
- package/dist/core/references/external-refs.d.ts.map +1 -1
- package/dist/core/references/external-refs.js +3 -1
- package/dist/core/references/external-refs.js.map +1 -1
- package/dist/core/references/resolver.d.ts +7 -1
- package/dist/core/references/resolver.d.ts.map +1 -1
- package/dist/core/references/resolver.js +91 -9
- package/dist/core/references/resolver.js.map +1 -1
- package/dist/core/references/schema-proxy.d.ts.map +1 -1
- package/dist/core/references/schema-proxy.js +35 -21
- package/dist/core/references/schema-proxy.js.map +1 -1
- package/dist/core/resources/factory-registry.d.ts +64 -2
- package/dist/core/resources/factory-registry.d.ts.map +1 -1
- package/dist/core/resources/factory-registry.js +74 -3
- package/dist/core/resources/factory-registry.js.map +1 -1
- package/dist/core/resources/index.d.ts +3 -2
- package/dist/core/resources/index.d.ts.map +1 -1
- package/dist/core/resources/index.js +2 -1
- package/dist/core/resources/index.js.map +1 -1
- package/dist/core/resources/live-comparison.d.ts +58 -0
- package/dist/core/resources/live-comparison.d.ts.map +1 -0
- package/dist/core/resources/live-comparison.js +293 -0
- package/dist/core/resources/live-comparison.js.map +1 -0
- package/dist/core/runtime/standalone-operation.d.ts +12 -0
- package/dist/core/runtime/standalone-operation.d.ts.map +1 -0
- package/dist/core/runtime/standalone-operation.js +62 -0
- package/dist/core/runtime/standalone-operation.js.map +1 -0
- package/dist/core/serialization/cel-references.d.ts.map +1 -1
- package/dist/core/serialization/cel-references.js +11 -1
- package/dist/core/serialization/cel-references.js.map +1 -1
- package/dist/core/serialization/core.d.ts.map +1 -1
- package/dist/core/serialization/core.js +277 -182
- package/dist/core/serialization/core.js.map +1 -1
- package/dist/core/serialization/schema.d.ts.map +1 -1
- package/dist/core/serialization/schema.js +3 -3
- package/dist/core/serialization/schema.js.map +1 -1
- package/dist/core/serialization/status-analysis-pipeline.d.ts +1 -1
- package/dist/core/serialization/status-analysis-pipeline.d.ts.map +1 -1
- package/dist/core/serialization/status-analysis-pipeline.js +14 -11
- package/dist/core/serialization/status-analysis-pipeline.js.map +1 -1
- package/dist/core/serialization/yaml.d.ts +5 -1
- package/dist/core/serialization/yaml.d.ts.map +1 -1
- package/dist/core/serialization/yaml.js +35 -182
- package/dist/core/serialization/yaml.js.map +1 -1
- package/dist/core/types/deployment.d.ts +135 -14
- package/dist/core/types/deployment.d.ts.map +1 -1
- package/dist/core/types/kubernetes.d.ts +3 -0
- package/dist/core/types/kubernetes.d.ts.map +1 -1
- package/dist/core/types/resource-graph.d.ts +7 -1
- package/dist/core/types/resource-graph.d.ts.map +1 -1
- package/dist/core/types/serialization.d.ts +8 -1
- package/dist/core/types/serialization.d.ts.map +1 -1
- package/dist/core/validation/cel-validator.d.ts.map +1 -1
- package/dist/core/validation/cel-validator.js +25 -16
- package/dist/core/validation/cel-validator.js.map +1 -1
- package/dist/experimental-planning.d.ts +13 -0
- package/dist/experimental-planning.d.ts.map +1 -0
- package/dist/experimental-planning.js +12 -0
- package/dist/experimental-planning.js.map +1 -0
- package/dist/factories/apisix/compositions/apisix-bootstrap.d.ts.map +1 -1
- package/dist/factories/apisix/compositions/apisix-bootstrap.js +27 -22
- package/dist/factories/apisix/compositions/apisix-bootstrap.js.map +1 -1
- package/dist/factories/apisix/compositions/apisix-helm-repository.d.ts +15 -0
- package/dist/factories/apisix/compositions/apisix-helm-repository.d.ts.map +1 -0
- package/dist/factories/apisix/compositions/apisix-helm-repository.js +28 -0
- package/dist/factories/apisix/compositions/apisix-helm-repository.js.map +1 -0
- package/dist/factories/apisix/compositions/index.d.ts +1 -0
- package/dist/factories/apisix/compositions/index.d.ts.map +1 -1
- package/dist/factories/apisix/compositions/index.js +1 -0
- package/dist/factories/apisix/compositions/index.js.map +1 -1
- package/dist/factories/apisix/types.d.ts +22 -0
- package/dist/factories/apisix/types.d.ts.map +1 -1
- package/dist/factories/apisix/types.js +16 -0
- package/dist/factories/apisix/types.js.map +1 -1
- package/dist/factories/apisix/utils/admin-credentials.d.ts +1 -0
- package/dist/factories/apisix/utils/admin-credentials.d.ts.map +1 -1
- package/dist/factories/apisix/utils/admin-credentials.js +5 -4
- package/dist/factories/apisix/utils/admin-credentials.js.map +1 -1
- package/dist/factories/caddy/compositions/caddy-ingress.d.ts.map +1 -1
- package/dist/factories/caddy/compositions/caddy-ingress.js +9 -2
- package/dist/factories/caddy/compositions/caddy-ingress.js.map +1 -1
- package/dist/factories/cert-manager/compositions/cert-manager-bootstrap.d.ts.map +1 -1
- package/dist/factories/cert-manager/compositions/cert-manager-bootstrap.js +11 -25
- package/dist/factories/cert-manager/compositions/cert-manager-bootstrap.js.map +1 -1
- package/dist/factories/cert-manager/resources/certificates.d.ts.map +1 -1
- package/dist/factories/cert-manager/resources/certificates.js +2 -1
- package/dist/factories/cert-manager/resources/certificates.js.map +1 -1
- package/dist/factories/cert-manager/resources/challenges.d.ts.map +1 -1
- package/dist/factories/cert-manager/resources/challenges.js +3 -0
- package/dist/factories/cert-manager/resources/challenges.js.map +1 -1
- package/dist/factories/cilium/compositions/cilium-bootstrap.d.ts +4 -4
- package/dist/factories/cilium/resources/gateway.d.ts.map +1 -1
- package/dist/factories/cilium/resources/gateway.js +13 -12
- package/dist/factories/cilium/resources/gateway.js.map +1 -1
- package/dist/factories/cilium/resources/networking.d.ts.map +1 -1
- package/dist/factories/cilium/resources/networking.js +9 -0
- package/dist/factories/cilium/resources/networking.js.map +1 -1
- package/dist/factories/clickhouse/compositions/clickhouse-operator-bootstrap.d.ts +2 -1
- package/dist/factories/clickhouse/compositions/clickhouse-operator-bootstrap.d.ts.map +1 -1
- package/dist/factories/clickhouse/compositions/clickhouse-operator-bootstrap.js +2 -6
- package/dist/factories/clickhouse/compositions/clickhouse-operator-bootstrap.js.map +1 -1
- package/dist/factories/clickhouse/resources/installation.d.ts.map +1 -1
- package/dist/factories/clickhouse/resources/installation.js +2 -0
- package/dist/factories/clickhouse/resources/installation.js.map +1 -1
- package/dist/factories/clickhouse/resources/keeper.d.ts.map +1 -1
- package/dist/factories/clickhouse/resources/keeper.js +2 -0
- package/dist/factories/clickhouse/resources/keeper.js.map +1 -1
- package/dist/factories/clickhouse/types.d.ts +5 -2
- package/dist/factories/clickhouse/types.d.ts.map +1 -1
- package/dist/factories/clickhouse/types.js +2 -1
- package/dist/factories/clickhouse/types.js.map +1 -1
- package/dist/factories/clickstack/compositions/k8s-telemetry.d.ts +4 -2
- package/dist/factories/clickstack/compositions/k8s-telemetry.d.ts.map +1 -1
- package/dist/factories/clickstack/compositions/k8s-telemetry.js +2 -5
- package/dist/factories/clickstack/compositions/k8s-telemetry.js.map +1 -1
- package/dist/factories/clickstack/types.d.ts +2 -1
- package/dist/factories/clickstack/types.d.ts.map +1 -1
- package/dist/factories/clickstack/types.js +3 -1
- package/dist/factories/clickstack/types.js.map +1 -1
- package/dist/factories/cnpg/compositions/cnpg-bootstrap.d.ts +2 -1
- package/dist/factories/cnpg/compositions/cnpg-bootstrap.d.ts.map +1 -1
- package/dist/factories/cnpg/compositions/cnpg-bootstrap.js +3 -8
- package/dist/factories/cnpg/compositions/cnpg-bootstrap.js.map +1 -1
- package/dist/factories/cnpg/resources/backup.d.ts.map +1 -1
- package/dist/factories/cnpg/resources/backup.js +2 -0
- package/dist/factories/cnpg/resources/backup.js.map +1 -1
- package/dist/factories/cnpg/resources/cluster.d.ts.map +1 -1
- package/dist/factories/cnpg/resources/cluster.js +2 -1
- package/dist/factories/cnpg/resources/cluster.js.map +1 -1
- package/dist/factories/cnpg/resources/pooler.d.ts.map +1 -1
- package/dist/factories/cnpg/resources/pooler.js +2 -0
- package/dist/factories/cnpg/resources/pooler.js.map +1 -1
- package/dist/factories/cnpg/resources/scheduled-backup.d.ts.map +1 -1
- package/dist/factories/cnpg/resources/scheduled-backup.js +2 -1
- package/dist/factories/cnpg/resources/scheduled-backup.js.map +1 -1
- package/dist/factories/cnpg/types.d.ts +6 -3
- package/dist/factories/cnpg/types.d.ts.map +1 -1
- package/dist/factories/cnpg/types.js +2 -1
- package/dist/factories/cnpg/types.js.map +1 -1
- package/dist/factories/dagster/compositions/dagster-bootstrap.d.ts +2 -0
- package/dist/factories/dagster/compositions/dagster-bootstrap.d.ts.map +1 -1
- package/dist/factories/dagster/types.d.ts +5 -0
- package/dist/factories/dagster/types.d.ts.map +1 -1
- package/dist/factories/dagster/types.js +1 -0
- package/dist/factories/dagster/types.js.map +1 -1
- package/dist/factories/dagster/utils/helm-values-mapper.js +3 -0
- package/dist/factories/dagster/utils/helm-values-mapper.js.map +1 -1
- package/dist/factories/external-dns/compositions/external-dns-bootstrap.d.ts.map +1 -1
- package/dist/factories/external-dns/compositions/external-dns-bootstrap.js +7 -4
- package/dist/factories/external-dns/compositions/external-dns-bootstrap.js.map +1 -1
- package/dist/factories/external-dns/resources/dns-endpoint.d.ts.map +1 -1
- package/dist/factories/external-dns/resources/dns-endpoint.js +20 -18
- package/dist/factories/external-dns/resources/dns-endpoint.js.map +1 -1
- package/dist/factories/flux/git-repository.d.ts.map +1 -1
- package/dist/factories/flux/git-repository.js +41 -34
- package/dist/factories/flux/git-repository.js.map +1 -1
- package/dist/factories/flux/kustomize/readiness-evaluators.d.ts +0 -6
- package/dist/factories/flux/kustomize/readiness-evaluators.d.ts.map +1 -1
- package/dist/factories/flux/kustomize/readiness-evaluators.js +12 -2
- package/dist/factories/flux/kustomize/readiness-evaluators.js.map +1 -1
- package/dist/factories/harbor/compositions/harbor-installation.d.ts +46 -38
- package/dist/factories/harbor/compositions/harbor-installation.d.ts.map +1 -1
- package/dist/factories/harbor/compositions/harbor-installation.js +4 -2
- package/dist/factories/harbor/compositions/harbor-installation.js.map +1 -1
- package/dist/factories/harbor/types.d.ts +13 -11
- package/dist/factories/harbor/types.d.ts.map +1 -1
- package/dist/factories/harbor/types.js +11 -9
- package/dist/factories/harbor/types.js.map +1 -1
- package/dist/factories/helm/helm-repository.d.ts.map +1 -1
- package/dist/factories/helm/helm-repository.js +14 -1
- package/dist/factories/helm/helm-repository.js.map +1 -1
- package/dist/factories/helm/index.d.ts +2 -0
- package/dist/factories/helm/index.d.ts.map +1 -1
- package/dist/factories/helm/index.js +1 -0
- package/dist/factories/helm/index.js.map +1 -1
- package/dist/factories/helm/readiness-evaluators.d.ts.map +1 -1
- package/dist/factories/helm/readiness-evaluators.js +46 -7
- package/dist/factories/helm/readiness-evaluators.js.map +1 -1
- package/dist/factories/helm/status.d.ts +18 -0
- package/dist/factories/helm/status.d.ts.map +1 -0
- package/dist/factories/helm/status.js +38 -0
- package/dist/factories/helm/status.js.map +1 -0
- package/dist/factories/index.d.ts +2 -2
- package/dist/factories/index.d.ts.map +1 -1
- package/dist/factories/index.js +4 -4
- package/dist/factories/index.js.map +1 -1
- package/dist/factories/inngest/compositions/inngest-bootstrap.d.ts +1 -1
- package/dist/factories/inngest/compositions/inngest-bootstrap.d.ts.map +1 -1
- package/dist/factories/inngest/compositions/inngest-bootstrap.js +2 -4
- package/dist/factories/inngest/compositions/inngest-bootstrap.js.map +1 -1
- package/dist/factories/inngest/resources/helm.d.ts.map +1 -1
- package/dist/factories/inngest/resources/helm.js +12 -3
- package/dist/factories/inngest/resources/helm.js.map +1 -1
- package/dist/factories/inngest/types.d.ts +3 -7
- package/dist/factories/inngest/types.d.ts.map +1 -1
- package/dist/factories/inngest/types.js +1 -1
- package/dist/factories/inngest/types.js.map +1 -1
- package/dist/factories/kro/kro-crd.d.ts.map +1 -1
- package/dist/factories/kro/kro-crd.js +32 -33
- package/dist/factories/kro/kro-crd.js.map +1 -1
- package/dist/factories/kro/kro-custom-resource.d.ts.map +1 -1
- package/dist/factories/kro/kro-custom-resource.js +91 -85
- package/dist/factories/kro/kro-custom-resource.js.map +1 -1
- package/dist/factories/kro/resource-graph-definition.d.ts.map +1 -1
- package/dist/factories/kro/resource-graph-definition.js +127 -117
- package/dist/factories/kro/resource-graph-definition.js.map +1 -1
- package/dist/factories/kubernetes/autoscaling/horizontal-pod-autoscaler-v1.d.ts.map +1 -1
- package/dist/factories/kubernetes/autoscaling/horizontal-pod-autoscaler-v1.js +27 -26
- package/dist/factories/kubernetes/autoscaling/horizontal-pod-autoscaler-v1.js.map +1 -1
- package/dist/factories/kubernetes/autoscaling/horizontal-pod-autoscaler.d.ts.map +1 -1
- package/dist/factories/kubernetes/autoscaling/horizontal-pod-autoscaler.js +22 -22
- package/dist/factories/kubernetes/autoscaling/horizontal-pod-autoscaler.js.map +1 -1
- package/dist/factories/kubernetes/certificates/certificate-signing-request.d.ts.map +1 -1
- package/dist/factories/kubernetes/certificates/certificate-signing-request.js +41 -39
- package/dist/factories/kubernetes/certificates/certificate-signing-request.js.map +1 -1
- package/dist/factories/kubernetes/core/component-status.d.ts.map +1 -1
- package/dist/factories/kubernetes/core/component-status.js +14 -16
- package/dist/factories/kubernetes/core/component-status.js.map +1 -1
- package/dist/factories/kubernetes/core/namespace.d.ts.map +1 -1
- package/dist/factories/kubernetes/core/namespace.js +31 -38
- package/dist/factories/kubernetes/core/namespace.js.map +1 -1
- package/dist/factories/kubernetes/core/node.d.ts.map +1 -1
- package/dist/factories/kubernetes/core/node.js +17 -25
- package/dist/factories/kubernetes/core/node.js.map +1 -1
- package/dist/factories/kubernetes/core/pod.d.ts.map +1 -1
- package/dist/factories/kubernetes/core/pod.js +31 -35
- package/dist/factories/kubernetes/core/pod.js.map +1 -1
- package/dist/factories/kubernetes/extensions/custom-resource-definition.d.ts.map +1 -1
- package/dist/factories/kubernetes/extensions/custom-resource-definition.js +34 -36
- package/dist/factories/kubernetes/extensions/custom-resource-definition.js.map +1 -1
- package/dist/factories/kubernetes/extensions/custom-resource.d.ts.map +1 -1
- package/dist/factories/kubernetes/extensions/custom-resource.js +2 -4
- package/dist/factories/kubernetes/extensions/custom-resource.js.map +1 -1
- package/dist/factories/kubernetes/networking/endpoints.d.ts.map +1 -1
- package/dist/factories/kubernetes/networking/endpoints.js +29 -30
- package/dist/factories/kubernetes/networking/endpoints.js.map +1 -1
- package/dist/factories/kubernetes/networking/ingress.d.ts.map +1 -1
- package/dist/factories/kubernetes/networking/ingress.js +46 -57
- package/dist/factories/kubernetes/networking/ingress.js.map +1 -1
- package/dist/factories/kubernetes/networking/network-policy.d.ts +9 -0
- package/dist/factories/kubernetes/networking/network-policy.d.ts.map +1 -1
- package/dist/factories/kubernetes/networking/network-policy.js +51 -1
- package/dist/factories/kubernetes/networking/network-policy.js.map +1 -1
- package/dist/factories/kubernetes/networking/service.d.ts.map +1 -1
- package/dist/factories/kubernetes/networking/service.js +48 -40
- package/dist/factories/kubernetes/networking/service.js.map +1 -1
- package/dist/factories/kubernetes/policy/pod-disruption-budget.d.ts.map +1 -1
- package/dist/factories/kubernetes/policy/pod-disruption-budget.js +40 -46
- package/dist/factories/kubernetes/policy/pod-disruption-budget.js.map +1 -1
- package/dist/factories/kubernetes/policy/resource-quota.d.ts.map +1 -1
- package/dist/factories/kubernetes/policy/resource-quota.js +30 -34
- package/dist/factories/kubernetes/policy/resource-quota.js.map +1 -1
- package/dist/factories/kubernetes/storage/persistent-volume-claim.d.ts.map +1 -1
- package/dist/factories/kubernetes/storage/persistent-volume-claim.js +22 -21
- package/dist/factories/kubernetes/storage/persistent-volume-claim.js.map +1 -1
- package/dist/factories/kubernetes/storage/persistent-volume.d.ts.map +1 -1
- package/dist/factories/kubernetes/storage/persistent-volume.js +32 -38
- package/dist/factories/kubernetes/storage/persistent-volume.js.map +1 -1
- package/dist/factories/kubernetes/storage/volume-attachment.d.ts.map +1 -1
- package/dist/factories/kubernetes/storage/volume-attachment.js +12 -11
- package/dist/factories/kubernetes/storage/volume-attachment.js.map +1 -1
- package/dist/factories/kubernetes/workloads/cron-job.d.ts.map +1 -1
- package/dist/factories/kubernetes/workloads/cron-job.js +39 -34
- package/dist/factories/kubernetes/workloads/cron-job.js.map +1 -1
- package/dist/factories/kubernetes/workloads/daemon-set.d.ts.map +1 -1
- package/dist/factories/kubernetes/workloads/daemon-set.js +24 -23
- package/dist/factories/kubernetes/workloads/daemon-set.js.map +1 -1
- package/dist/factories/kubernetes/workloads/deployment.d.ts.map +1 -1
- package/dist/factories/kubernetes/workloads/deployment.js +45 -35
- package/dist/factories/kubernetes/workloads/deployment.js.map +1 -1
- package/dist/factories/kubernetes/workloads/job.d.ts.map +1 -1
- package/dist/factories/kubernetes/workloads/job.js +87 -77
- package/dist/factories/kubernetes/workloads/job.js.map +1 -1
- package/dist/factories/kubernetes/workloads/replica-set.d.ts.map +1 -1
- package/dist/factories/kubernetes/workloads/replica-set.js +24 -24
- package/dist/factories/kubernetes/workloads/replica-set.js.map +1 -1
- package/dist/factories/kubernetes/workloads/replication-controller.d.ts.map +1 -1
- package/dist/factories/kubernetes/workloads/replication-controller.js +37 -26
- package/dist/factories/kubernetes/workloads/replication-controller.js.map +1 -1
- package/dist/factories/kubernetes/workloads/stateful-set.d.ts.map +1 -1
- package/dist/factories/kubernetes/workloads/stateful-set.js +69 -55
- package/dist/factories/kubernetes/workloads/stateful-set.js.map +1 -1
- package/dist/factories/kubernetes/yaml/yaml-artifact-applier.d.ts +15 -0
- package/dist/factories/kubernetes/yaml/yaml-artifact-applier.d.ts.map +1 -0
- package/dist/factories/kubernetes/yaml/yaml-artifact-applier.js +69 -0
- package/dist/factories/kubernetes/yaml/yaml-artifact-applier.js.map +1 -0
- package/dist/factories/kubernetes/yaml/yaml-directory.d.ts +2 -1
- package/dist/factories/kubernetes/yaml/yaml-directory.d.ts.map +1 -1
- package/dist/factories/kubernetes/yaml/yaml-directory.js +3 -34
- package/dist/factories/kubernetes/yaml/yaml-directory.js.map +1 -1
- package/dist/factories/kubernetes/yaml/yaml-file.d.ts +13 -91
- package/dist/factories/kubernetes/yaml/yaml-file.d.ts.map +1 -1
- package/dist/factories/kubernetes/yaml/yaml-file.js +21 -311
- package/dist/factories/kubernetes/yaml/yaml-file.js.map +1 -1
- package/dist/factories/nats/compositions/nats-bootstrap.d.ts +2 -2
- package/dist/factories/nats/compositions/nats-bootstrap.d.ts.map +1 -1
- package/dist/factories/nats/compositions/nats-bootstrap.js +2 -3
- package/dist/factories/nats/compositions/nats-bootstrap.js.map +1 -1
- package/dist/factories/nats/resources/jetstream.d.ts.map +1 -1
- package/dist/factories/nats/resources/jetstream.js +2 -0
- package/dist/factories/nats/resources/jetstream.js.map +1 -1
- package/dist/factories/nats/types.d.ts +3 -3
- package/dist/factories/nats/types.js +1 -1
- package/dist/factories/nats/types.js.map +1 -1
- package/dist/factories/ory/compositions/ory-platform-stack.d.ts.map +1 -1
- package/dist/factories/ory/compositions/ory-platform-stack.js +35 -9
- package/dist/factories/ory/compositions/ory-platform-stack.js.map +1 -1
- package/dist/factories/ory/resources/oathkeeper-rule.d.ts.map +1 -1
- package/dist/factories/ory/resources/oathkeeper-rule.js +11 -8
- package/dist/factories/ory/resources/oathkeeper-rule.js.map +1 -1
- package/dist/factories/ory/resources/oauth2-client.d.ts.map +1 -1
- package/dist/factories/ory/resources/oauth2-client.js +12 -9
- package/dist/factories/ory/resources/oauth2-client.js.map +1 -1
- package/dist/factories/ory/types.d.ts +3 -0
- package/dist/factories/ory/types.d.ts.map +1 -1
- package/dist/factories/ory/types.js +1 -0
- package/dist/factories/ory/types.js.map +1 -1
- package/dist/factories/rook/compositions/rook-ceph-operator-installation.d.ts +2 -2
- package/dist/factories/rook/compositions/rook-ceph-operator-installation.d.ts.map +1 -1
- package/dist/factories/rook/compositions/rook-ceph-operator-installation.js +2 -3
- package/dist/factories/rook/compositions/rook-ceph-operator-installation.js.map +1 -1
- package/dist/factories/rook/resources/ceph-object-store-user.d.ts.map +1 -1
- package/dist/factories/rook/resources/ceph-object-store-user.js +2 -0
- package/dist/factories/rook/resources/ceph-object-store-user.js.map +1 -1
- package/dist/factories/rook/resources/ceph-object-store.d.ts.map +1 -1
- package/dist/factories/rook/resources/ceph-object-store.js +2 -0
- package/dist/factories/rook/resources/ceph-object-store.js.map +1 -1
- package/dist/factories/rook/resources/object-bucket-claim.d.ts.map +1 -1
- package/dist/factories/rook/resources/object-bucket-claim.js +2 -0
- package/dist/factories/rook/resources/object-bucket-claim.js.map +1 -1
- package/dist/factories/rook/types.d.ts +1 -1
- package/dist/factories/rook/types.js +1 -1
- package/dist/factories/rook/types.js.map +1 -1
- package/dist/factories/searxng/compositions/searxng-bootstrap.d.ts.map +1 -1
- package/dist/factories/searxng/compositions/searxng-bootstrap.js +2 -2
- package/dist/factories/searxng/compositions/searxng-bootstrap.js.map +1 -1
- package/dist/factories/searxng/resources/searxng.d.ts.map +1 -1
- package/dist/factories/searxng/resources/searxng.js +2 -0
- package/dist/factories/searxng/resources/searxng.js.map +1 -1
- package/dist/factories/valkey/compositions/valkey-bootstrap.d.ts +2 -2
- package/dist/factories/valkey/compositions/valkey-bootstrap.d.ts.map +1 -1
- package/dist/factories/valkey/compositions/valkey-bootstrap.js +4 -9
- package/dist/factories/valkey/compositions/valkey-bootstrap.js.map +1 -1
- package/dist/factories/valkey/resources/valkey.d.ts.map +1 -1
- package/dist/factories/valkey/resources/valkey.js +2 -1
- package/dist/factories/valkey/resources/valkey.js.map +1 -1
- package/dist/factories/valkey/types.d.ts +3 -7
- package/dist/factories/valkey/types.d.ts.map +1 -1
- package/dist/factories/valkey/types.js +1 -1
- package/dist/factories/valkey/types.js.map +1 -1
- package/dist/factories/webapp/compositions/web-app-with-processing.d.ts +3 -2
- package/dist/factories/webapp/compositions/web-app-with-processing.d.ts.map +1 -1
- package/dist/factories/webapp/compositions/web-app-with-processing.js +7 -6
- package/dist/factories/webapp/compositions/web-app-with-processing.js.map +1 -1
- package/dist/factories/webapp/types.d.ts +1 -0
- package/dist/factories/webapp/types.d.ts.map +1 -1
- package/dist/factories/webapp/types.js +2 -0
- package/dist/factories/webapp/types.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/shared/brands.d.ts +7 -0
- package/dist/shared/brands.d.ts.map +1 -1
- package/dist/shared/brands.js +7 -0
- package/dist/shared/brands.js.map +1 -1
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +3 -3
- package/dist/utils/index.js.map +1 -1
- package/package.json +20 -5
- package/dist/factories/kubernetes/yaml/conflict-handler.d.ts +0 -23
- package/dist/factories/kubernetes/yaml/conflict-handler.d.ts.map +0 -1
- package/dist/factories/kubernetes/yaml/conflict-handler.js +0 -83
- package/dist/factories/kubernetes/yaml/conflict-handler.js.map +0 -1
|
@@ -7,25 +7,25 @@
|
|
|
7
7
|
import { CEL_EXPRESSION_BRAND, KUBERNETES_REF_MARKER_SOURCE } from '../../shared/brands.js';
|
|
8
8
|
import { isValuesMergeExpression } from '../aspects/values-merge.js';
|
|
9
9
|
import { createCompositionContext, getCurrentCompositionContext, runInStatusBuilderContext, runWithCompositionContext, } from '../composition/context.js';
|
|
10
|
+
import { copyCompositionAnalysisMetadata, getCompositionAnalysisMetadata, } from '../composition/analysis-metadata.js';
|
|
10
11
|
import { createDirectResourceFactory } from '../deployment/direct-factory.js';
|
|
11
12
|
import { createKroResourceFactory } from '../deployment/kro-factory.js';
|
|
12
|
-
import {
|
|
13
|
+
import { singletonOwnerInstanceManifests } from '../deployment/singleton-gitops.js';
|
|
13
14
|
import { ensureError, ValidationError } from '../errors.js';
|
|
14
15
|
import { analyzeCompositionBody, applyAnalysisToResources, } from '../expressions/composition/composition-analyzer.js';
|
|
15
16
|
import { remapResourceStatusReferences } from '../expressions/composition/composition-analyzer-helpers.js';
|
|
16
17
|
import { StatusBuilderAnalyzer } from '../expressions/factory/status-builder-analyzer.js';
|
|
17
18
|
import { getComponentLogger } from '../logging/index.js';
|
|
18
19
|
import { getMetadataField, setResourceId } from '../metadata/index.js';
|
|
20
|
+
import { inspectCapturedComposition, lowerPlanValue, planCapturedComposition, planCapturedTemplate, planMaterializedComposition, setCompositionCapture, } from '../planning/index.js';
|
|
21
|
+
import { containsExplicitPlanValue } from '../planning/values.js';
|
|
19
22
|
import { createExternalRefWithoutRegistration, createSchemaProxy } from '../references/index.js';
|
|
20
23
|
import { getKindInfo, getSemanticCandidateKinds } from '../resources/factory-registry.js';
|
|
21
24
|
import { validateResourceGraphDefinition } from '../validation/cel-validator.js';
|
|
25
|
+
import { validateSpec } from '../deployment/shared-utilities.js';
|
|
22
26
|
import { optimizeStatusMappings } from './cel-optimizer.js';
|
|
23
|
-
import { finalizeCelForKro,
|
|
24
|
-
import { applyTernaryConditionalsToResources } from './kro-post-processing.js';
|
|
25
|
-
import { generateKroSchemaFromArktype } from './schema.js';
|
|
27
|
+
import { finalizeCelForKro, processResourceReferences } from './cel-references.js';
|
|
26
28
|
import { runStatusAnalysisPipeline } from './status-analysis-pipeline.js';
|
|
27
|
-
import { assertNoHoistWeakenedStatusFields, findDanglingHoistedReference, rewriteHoistedNamespaceReferences, rewriteHoistedNamespaceRefsInValue, selectHoistedNamespaces, } from '../deployment/kro-instance-safety.js';
|
|
28
|
-
import { serializeResourceGraphToYaml } from './yaml.js';
|
|
29
29
|
function isToYamlOptions(value) {
|
|
30
30
|
if (typeof value !== 'object' || value === null || !Object.hasOwn(value, 'aspects')) {
|
|
31
31
|
return false;
|
|
@@ -41,6 +41,18 @@ function isToYamlOptions(value) {
|
|
|
41
41
|
return Object.keys(value).length === 1;
|
|
42
42
|
return aspects.every((entry) => typeof entry === 'object' && entry !== null && entry.kind === 'aspect');
|
|
43
43
|
}
|
|
44
|
+
function normalizePublicFactoryOptions(options) {
|
|
45
|
+
if (!options)
|
|
46
|
+
return undefined;
|
|
47
|
+
const aspects = options.plan?.aspects ?? options.aspects;
|
|
48
|
+
return {
|
|
49
|
+
...options,
|
|
50
|
+
...(aspects !== undefined ? { aspects } : {}),
|
|
51
|
+
...(options.plan !== undefined
|
|
52
|
+
? { plan: { ...options.plan, ...(aspects !== undefined ? { aspects } : {}) } }
|
|
53
|
+
: {}),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
44
56
|
function assertDeploymentModeSupported(options, mode, graphName) {
|
|
45
57
|
if (!options?.supportedModes || options.supportedModes.includes(mode))
|
|
46
58
|
return;
|
|
@@ -267,8 +279,7 @@ function analyzeAndConvertStatusMappings(definition, statusBuilder, schema, reso
|
|
|
267
279
|
function processCompositionBodyAnalysis(statusMappings, resourcesWithKeys, analyzedStatusMappings, serializationLogger, schemaDefinition) {
|
|
268
280
|
let compositionAnalysis = null;
|
|
269
281
|
const analysisState = { appliedToResources: false, ternaryAndOmitApplied: false };
|
|
270
|
-
const originalCompositionFnForAnalysis = statusMappings
|
|
271
|
-
?.__originalCompositionFn;
|
|
282
|
+
const originalCompositionFnForAnalysis = getCompositionAnalysisMetadata(statusMappings)?.originalCompositionFn;
|
|
272
283
|
if (originalCompositionFnForAnalysis) {
|
|
273
284
|
try {
|
|
274
285
|
const resourceIds = new Set(Object.keys(resourcesWithKeys));
|
|
@@ -430,6 +441,19 @@ function processCompositionBodyAnalysis(statusMappings, resourcesWithKeys, analy
|
|
|
430
441
|
// required a different condition to be truthy).
|
|
431
442
|
for (const unregistered of compositionAnalysis.unregisteredFactories) {
|
|
432
443
|
if (!resourceIds.has(unregistered.resourceId)) {
|
|
444
|
+
const controlFlow = compositionAnalysis.resources.get(unregistered.resourceId);
|
|
445
|
+
const captured = schemaDefinition && controlFlow
|
|
446
|
+
? captureAnalyzedBranchResource(originalCompositionFnForAnalysis, schemaDefinition, unregistered.resourceId, controlFlow.includeWhen)
|
|
447
|
+
: undefined;
|
|
448
|
+
if (captured) {
|
|
449
|
+
resourcesWithKeys[unregistered.resourceId] = captured;
|
|
450
|
+
resourceIds.add(unregistered.resourceId);
|
|
451
|
+
serializationLogger.debug('Captured resource from analyzed branch constraints', {
|
|
452
|
+
resourceId: unregistered.resourceId,
|
|
453
|
+
conditions: controlFlow?.includeWhen.map((condition) => condition.expression),
|
|
454
|
+
});
|
|
455
|
+
continue;
|
|
456
|
+
}
|
|
433
457
|
const stub = createStubResource(unregistered.factoryName, unregistered.resourceId);
|
|
434
458
|
if (stub) {
|
|
435
459
|
resourcesWithKeys[unregistered.resourceId] = stub;
|
|
@@ -632,6 +656,100 @@ function createHybridSpecProxy(target, overriddenFields, overrideValues, pathPre
|
|
|
632
656
|
},
|
|
633
657
|
});
|
|
634
658
|
}
|
|
659
|
+
function parseBranchConstraintLiteral(source) {
|
|
660
|
+
if (source === 'true')
|
|
661
|
+
return true;
|
|
662
|
+
if (source === 'false')
|
|
663
|
+
return false;
|
|
664
|
+
if (source === 'null')
|
|
665
|
+
return null;
|
|
666
|
+
if (source.startsWith("'") && source.endsWith("'")) {
|
|
667
|
+
return source.slice(1, -1).replaceAll("\\'", "'").replaceAll('\\\\', '\\');
|
|
668
|
+
}
|
|
669
|
+
if (source.startsWith('"')) {
|
|
670
|
+
try {
|
|
671
|
+
return JSON.parse(source);
|
|
672
|
+
}
|
|
673
|
+
catch {
|
|
674
|
+
return source.slice(1, -1);
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
const numeric = Number(source);
|
|
678
|
+
return Number.isNaN(numeric) ? source : numeric;
|
|
679
|
+
}
|
|
680
|
+
function invertBranchConstraintLiteral(value) {
|
|
681
|
+
if (typeof value === 'boolean')
|
|
682
|
+
return !value;
|
|
683
|
+
if (typeof value === 'number')
|
|
684
|
+
return value + 1;
|
|
685
|
+
if (typeof value === 'string')
|
|
686
|
+
return `${value}-typekro-alternate`;
|
|
687
|
+
return value === null;
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* Derive the concrete values needed to enter a branch while every unrelated
|
|
691
|
+
* field remains a schema proxy. This deliberately supports the common,
|
|
692
|
+
* deterministic subset emitted by `conditionToCel`: truthiness, negation,
|
|
693
|
+
* equality, inequality, and scalar ordering. If the constrained run still
|
|
694
|
+
* does not create the resource, callers retain the established stub fallback
|
|
695
|
+
* rather than pretending the branch was captured losslessly.
|
|
696
|
+
*/
|
|
697
|
+
function analyzedBranchOverrides(conditions) {
|
|
698
|
+
const overrides = new Map();
|
|
699
|
+
const referencePattern = /schema\.spec\.([a-zA-Z0-9_]+(?:\.[a-zA-Z0-9_]+)*)(?:\s*(==|!=|>=|<=|>|<)\s*("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|true|false|null|-?\d+(?:\.\d+)?))?/g;
|
|
700
|
+
for (const condition of conditions) {
|
|
701
|
+
const expression = condition.expression.replace(/^\$\{/, '').replace(/\}$/, '');
|
|
702
|
+
for (const match of expression.matchAll(referencePattern)) {
|
|
703
|
+
const path = match[1];
|
|
704
|
+
if (!path || overrides.has(path))
|
|
705
|
+
continue;
|
|
706
|
+
const operator = match[2];
|
|
707
|
+
const literalSource = match[3];
|
|
708
|
+
if (operator && literalSource !== undefined) {
|
|
709
|
+
const literal = parseBranchConstraintLiteral(literalSource);
|
|
710
|
+
switch (operator) {
|
|
711
|
+
case '==':
|
|
712
|
+
overrides.set(path, literal);
|
|
713
|
+
break;
|
|
714
|
+
case '!=':
|
|
715
|
+
overrides.set(path, invertBranchConstraintLiteral(literal));
|
|
716
|
+
break;
|
|
717
|
+
case '>':
|
|
718
|
+
overrides.set(path, typeof literal === 'number' ? literal + 1 : literal);
|
|
719
|
+
break;
|
|
720
|
+
case '>=':
|
|
721
|
+
overrides.set(path, literal);
|
|
722
|
+
break;
|
|
723
|
+
case '<':
|
|
724
|
+
overrides.set(path, typeof literal === 'number' ? literal - 1 : literal);
|
|
725
|
+
break;
|
|
726
|
+
case '<=':
|
|
727
|
+
overrides.set(path, literal);
|
|
728
|
+
break;
|
|
729
|
+
}
|
|
730
|
+
continue;
|
|
731
|
+
}
|
|
732
|
+
const prefix = expression.slice(Math.max(0, (match.index ?? 0) - 8), match.index ?? 0);
|
|
733
|
+
overrides.set(path, !/!\s*(?:has\s*\()?\s*$/.test(prefix));
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
return overrides;
|
|
737
|
+
}
|
|
738
|
+
function captureAnalyzedBranchResource(compositionFn, schemaDefinition, resourceId, conditions) {
|
|
739
|
+
const overrides = analyzedBranchOverrides(conditions);
|
|
740
|
+
if (overrides.size === 0)
|
|
741
|
+
return undefined;
|
|
742
|
+
try {
|
|
743
|
+
const realSchema = createSchemaProxy(schemaDefinition.spec.json, schemaDefinition.status?.json);
|
|
744
|
+
const constrainedSpec = createHybridSpecProxy(realSchema.spec, new Set(overrides.keys()), overrides);
|
|
745
|
+
const context = createCompositionContext(`analyzed-branch:${resourceId}`);
|
|
746
|
+
runWithCompositionContext(context, () => compositionFn(constrainedSpec));
|
|
747
|
+
return context.resources[resourceId];
|
|
748
|
+
}
|
|
749
|
+
catch {
|
|
750
|
+
return undefined;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
635
753
|
function cloneResourceTree(value) {
|
|
636
754
|
if (Array.isArray(value)) {
|
|
637
755
|
return value.map((item) => cloneResourceTree(item));
|
|
@@ -1428,8 +1546,33 @@ function createTypedResourceGraph(definition, resourceBuilder, statusBuilder, op
|
|
|
1428
1546
|
const { resources: resourcesWithKeys, closures } = separateResourcesAndClosures(builderResult);
|
|
1429
1547
|
// 3. Analyze status builder and convert JS expressions to CEL
|
|
1430
1548
|
const { statusMappings, analyzedStatusMappings, mappingAnalysis, phaseBStatusMappings } = analyzeAndConvertStatusMappings(definition, statusBuilder, schema, resourcesWithKeys, serializationLogger);
|
|
1549
|
+
copyCompositionAnalysisMetadata(statusMappings, analyzedStatusMappings);
|
|
1550
|
+
for (const metadataKey of [
|
|
1551
|
+
'__nestedCompositionFns',
|
|
1552
|
+
'__nestedCompositionDefinitions',
|
|
1553
|
+
'__nestedCompositionResources',
|
|
1554
|
+
'__nestedCompositionSpecMappings',
|
|
1555
|
+
'__nestedStatusCel',
|
|
1556
|
+
]) {
|
|
1557
|
+
const descriptor = Object.getOwnPropertyDescriptor(statusMappings, metadataKey);
|
|
1558
|
+
if (descriptor && !Object.getOwnPropertyDescriptor(analyzedStatusMappings, metadataKey)) {
|
|
1559
|
+
Object.defineProperty(analyzedStatusMappings, metadataKey, descriptor);
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
if (phaseBStatusMappings) {
|
|
1563
|
+
copyCompositionAnalysisMetadata(statusMappings, phaseBStatusMappings);
|
|
1564
|
+
}
|
|
1431
1565
|
// 4. Analyze composition body for control flow patterns (must run before validation)
|
|
1432
1566
|
const { compositionAnalysis, analysisState } = processCompositionBodyAnalysis(statusMappings, resourcesWithKeys, analyzedStatusMappings, serializationLogger, schemaDefinition);
|
|
1567
|
+
// Control-flow analysis is accepted authoring semantics, so attach it before
|
|
1568
|
+
// semantic capture rather than waiting for the legacy KRO serializer. The
|
|
1569
|
+
// metadata store is non-enumerable and the merge is idempotent, which keeps
|
|
1570
|
+
// the compatibility serializer safe while allowing both target compilers to
|
|
1571
|
+
// consume the same analyzed iteration, activation, and template overrides.
|
|
1572
|
+
if (compositionAnalysis) {
|
|
1573
|
+
applyAnalysisToResources(resourcesWithKeys, compositionAnalysis);
|
|
1574
|
+
analysisState.appliedToResources = true;
|
|
1575
|
+
}
|
|
1433
1576
|
// 5. Validate resource IDs and CEL expressions
|
|
1434
1577
|
const validation = validateResourceGraphDefinition(resourcesWithKeys, analyzedStatusMappings);
|
|
1435
1578
|
if (!validation.isValid) {
|
|
@@ -1437,7 +1580,7 @@ function createTypedResourceGraph(definition, resourceBuilder, statusBuilder, op
|
|
|
1437
1580
|
throw new ValidationError(`ResourceGraphDefinition validation failed:\n${errorMessages}`, 'ResourceGraphDefinition', definition.name, undefined, ['Fix the validation errors listed above']);
|
|
1438
1581
|
}
|
|
1439
1582
|
if (validation.warnings.length > 0) {
|
|
1440
|
-
serializationLogger.
|
|
1583
|
+
serializationLogger.debug('ResourceGraphDefinition validation warnings', {
|
|
1441
1584
|
warnings: validation.warnings.map((w) => ({
|
|
1442
1585
|
field: w.field,
|
|
1443
1586
|
error: w.error,
|
|
@@ -1448,12 +1591,13 @@ function createTypedResourceGraph(definition, resourceBuilder, statusBuilder, op
|
|
|
1448
1591
|
// Evaluate and optimize CEL expressions
|
|
1449
1592
|
const evaluationContext = { resources: resourcesWithKeys, schema };
|
|
1450
1593
|
const { mappings: optimizedStatusMappings, optimizations } = optimizeStatusMappings(analyzedStatusMappings, evaluationContext);
|
|
1594
|
+
copyCompositionAnalysisMetadata(statusMappings, optimizedStatusMappings);
|
|
1451
1595
|
for (const metadataKey of [
|
|
1452
|
-
'__originalCompositionFn',
|
|
1453
1596
|
'__nestedCompositionFns',
|
|
1454
1597
|
'__nestedCompositionDefinitions',
|
|
1455
1598
|
'__nestedCompositionResources',
|
|
1456
1599
|
'__nestedCompositionSpecMappings',
|
|
1600
|
+
'__nestedStatusCel',
|
|
1457
1601
|
]) {
|
|
1458
1602
|
const descriptor = Object.getOwnPropertyDescriptor(statusMappings, metadataKey);
|
|
1459
1603
|
if (descriptor) {
|
|
@@ -1461,7 +1605,7 @@ function createTypedResourceGraph(definition, resourceBuilder, statusBuilder, op
|
|
|
1461
1605
|
}
|
|
1462
1606
|
}
|
|
1463
1607
|
if (optimizations.length > 0) {
|
|
1464
|
-
serializationLogger.
|
|
1608
|
+
serializationLogger.debug('CEL expression optimizations applied', { optimizations });
|
|
1465
1609
|
}
|
|
1466
1610
|
// 6. Build the composition re-execution function for direct factory
|
|
1467
1611
|
const declarativeCompositionFn = (spec) => {
|
|
@@ -1487,10 +1631,12 @@ function createTypedResourceGraph(definition, resourceBuilder, statusBuilder, op
|
|
|
1487
1631
|
},
|
|
1488
1632
|
factory(mode, factoryOptions) {
|
|
1489
1633
|
assertDeploymentModeSupported(options, mode, definition.name);
|
|
1634
|
+
const normalizedFactoryOptions = normalizePublicFactoryOptions(factoryOptions);
|
|
1490
1635
|
if (mode === 'direct') {
|
|
1491
1636
|
const directStatusMappings = reanalyzeStatusForDirectFactory(this._analysisResults, analyzedStatusMappings, resourcesWithKeys, schema, serializationLogger);
|
|
1492
1637
|
return createDirectResourceFactory(definition.name, resourcesWithKeys, schemaDefinition, statusBuilder, {
|
|
1493
|
-
...
|
|
1638
|
+
...normalizedFactoryOptions,
|
|
1639
|
+
semanticCapture: capture,
|
|
1494
1640
|
closures,
|
|
1495
1641
|
statusMappings: directStatusMappings,
|
|
1496
1642
|
compositionFn: declarativeCompositionFn,
|
|
@@ -1505,7 +1651,8 @@ function createTypedResourceGraph(definition, resourceBuilder, statusBuilder, op
|
|
|
1505
1651
|
}
|
|
1506
1652
|
else if (mode === 'kro') {
|
|
1507
1653
|
return createKroResourceFactory(definition.name, resourcesWithKeys, schemaDefinition, analyzedStatusMappings, {
|
|
1508
|
-
...
|
|
1654
|
+
...normalizedFactoryOptions,
|
|
1655
|
+
semanticCapture: capture,
|
|
1509
1656
|
closures,
|
|
1510
1657
|
factoryType: 'kro',
|
|
1511
1658
|
compositionFn: declarativeCompositionFn,
|
|
@@ -1522,7 +1669,7 @@ function createTypedResourceGraph(definition, resourceBuilder, statusBuilder, op
|
|
|
1522
1669
|
throw new ValidationError(`Unsupported factory mode: ${mode}`, 'ResourceGraphDefinition', definition.name, 'mode', ['Use "kro" or "direct" as the factory mode']);
|
|
1523
1670
|
}
|
|
1524
1671
|
},
|
|
1525
|
-
toYaml(specOrOptions) {
|
|
1672
|
+
toYaml(specOrOptions, materializationOptions) {
|
|
1526
1673
|
// Graph-level YAML is always KRO declarative output: with no argument
|
|
1527
1674
|
// it emits an RGD, and with a spec it emits a custom-resource instance.
|
|
1528
1675
|
assertDeploymentModeSupported(options, 'kro', definition.name);
|
|
@@ -1531,177 +1678,125 @@ function createTypedResourceGraph(definition, resourceBuilder, statusBuilder, op
|
|
|
1531
1678
|
const factory = this.factory('kro', specOrOptions);
|
|
1532
1679
|
return factory.toYaml();
|
|
1533
1680
|
}
|
|
1534
|
-
return this.factory('kro').toYaml(specOrOptions);
|
|
1535
|
-
}
|
|
1536
|
-
// Apply composition body analysis results (guard: only once)
|
|
1537
|
-
if (compositionAnalysis && !analysisState.appliedToResources) {
|
|
1538
|
-
analysisState.appliedToResources = true;
|
|
1539
|
-
if (compositionAnalysis.resources.size > 0 ||
|
|
1540
|
-
compositionAnalysis.templateOverrides.size > 0) {
|
|
1541
|
-
applyAnalysisToResources(resourcesWithKeys, compositionAnalysis);
|
|
1542
|
-
serializationLogger.debug('Applied composition body analysis', {
|
|
1543
|
-
analyzedResources: compositionAnalysis.resources.size,
|
|
1544
|
-
templateOverrides: compositionAnalysis.templateOverrides.size,
|
|
1545
|
-
errors: compositionAnalysis.errors.length,
|
|
1546
|
-
});
|
|
1547
|
-
}
|
|
1548
|
-
}
|
|
1549
|
-
// Collect nested composition status CEL mappings from the composition context.
|
|
1550
|
-
// These enable inlining the inner composition's real CEL expressions instead
|
|
1551
|
-
// of referencing virtual nested composition IDs.
|
|
1552
|
-
// Extract nested composition status CEL mappings attached by
|
|
1553
|
-
// executeCompositionCore via Reflect.set. Must use
|
|
1554
|
-
// Object.getOwnPropertyDescriptor to bypass the Enhanced proxy's
|
|
1555
|
-
// get handler which would return a KubernetesRef instead of the
|
|
1556
|
-
// actual Record<string, string>.
|
|
1557
|
-
const nestedStatusDescriptor = Object.getOwnPropertyDescriptor(statusMappings, '__nestedStatusCel');
|
|
1558
|
-
const nestedStatusCel = nestedStatusDescriptor?.value ?? {};
|
|
1559
|
-
serializationLogger.debug('Nested status CEL extraction', {
|
|
1560
|
-
hasNestedStatusCel: Object.keys(nestedStatusCel).length > 0,
|
|
1561
|
-
keys: Object.keys(nestedStatusCel),
|
|
1562
|
-
statusMappingsHasField: '__nestedStatusCel' in statusMappings,
|
|
1563
|
-
});
|
|
1564
|
-
// HOIST EVERY owned Namespace OUT of the shared RGD graph (the unconditional
|
|
1565
|
-
// model — typekro NEVER emits a Namespace into RGD YAML). Selection is trivially
|
|
1566
|
-
// `kind === 'Namespace'` (see {@link selectHoistedNamespaces}). Leaving a
|
|
1567
|
-
// Namespace a graph CHILD would let deleting the instance garbage-collect the
|
|
1568
|
-
// namespace holding its own finalizer; the factory emits it as a sibling created
|
|
1569
|
-
// deps-first (and torn down after the RGD) instead. This keeps the graph-level
|
|
1570
|
-
// RGD (`graph.toYaml()`) consistent with the factory's RGD
|
|
1571
|
-
// (`factory('kro').toYaml()`), both of which drop it. Any remaining reference to
|
|
1572
|
-
// a hoisted Namespace's `metadata.name` is rewritten to that Namespace's own
|
|
1573
|
-
// concrete name expression (finding #3) so the RGD carries no dangling ref.
|
|
1574
|
-
const hoistedNamespaces = selectHoistedNamespaces(resourcesWithKeys);
|
|
1575
|
-
const hoistedNamespaceIds = new Set(hoistedNamespaces.keys());
|
|
1576
|
-
const graphResources = hoistedNamespaces.size === 0
|
|
1577
|
-
? resourcesWithKeys
|
|
1578
|
-
: rewriteHoistedNamespaceReferences(Object.fromEntries(Object.entries(resourcesWithKeys).filter(([id]) => !hoistedNamespaceIds.has(id))), hoistedNamespaces);
|
|
1579
|
-
// BLOCKER #2 — apply the SAME status-reference rewriting the FACTORY path
|
|
1580
|
-
// already does (kro-factory.ts `buildRgdYaml`) to this graph/composition path.
|
|
1581
|
-
// Removing a hoisted Namespace from `graphResources` is not enough: the status
|
|
1582
|
-
// mappings, nested-composition CEL, and status overrides can ALSO reference it
|
|
1583
|
-
// (e.g. `status.nsName: ${ownedNamespace.metadata.name}`), which would emit an
|
|
1584
|
-
// RGD with `resources:[]` for that id and a dangling `${...}` KRO rejects.
|
|
1585
|
-
// Rewrite every such reference to the Namespace's own name expression (finding
|
|
1586
|
-
// #3), preserving the non-enumerable composition metadata on optimizedStatusMappings.
|
|
1587
|
-
let graphStatusMappings = optimizedStatusMappings;
|
|
1588
|
-
if (hoistedNamespaces.size > 0) {
|
|
1589
|
-
const rewritten = rewriteHoistedNamespaceRefsInValue(optimizedStatusMappings, hoistedNamespaces);
|
|
1590
|
-
if (rewritten !== optimizedStatusMappings) {
|
|
1591
|
-
// The rewrite clones via Object.entries, dropping non-enumerable
|
|
1592
|
-
// composition metadata — re-attach it from the original statusMappings.
|
|
1593
|
-
for (const metadataKey of [
|
|
1594
|
-
'__originalCompositionFn',
|
|
1595
|
-
'__nestedCompositionFns',
|
|
1596
|
-
'__nestedCompositionDefinitions',
|
|
1597
|
-
'__nestedCompositionResources',
|
|
1598
|
-
'__nestedCompositionSpecMappings',
|
|
1599
|
-
'__nestedStatusCel',
|
|
1600
|
-
]) {
|
|
1601
|
-
const descriptor = Object.getOwnPropertyDescriptor(statusMappings, metadataKey);
|
|
1602
|
-
if (descriptor)
|
|
1603
|
-
Object.defineProperty(rewritten, metadataKey, descriptor);
|
|
1604
|
-
}
|
|
1605
|
-
}
|
|
1606
|
-
graphStatusMappings = rewritten;
|
|
1607
|
-
// #6 — REJECT (throw) HONESTLY, never silently drop: status fields that resolve
|
|
1608
|
-
// ONLY to a hoisted Namespace become a schema-only expression
|
|
1609
|
-
// (`schema.spec.namespace`), which KRO status CEL cannot evaluate, so they
|
|
1610
|
-
// cannot be represented in the KRO status schema. Fail loudly naming the
|
|
1611
|
-
// field(s) rather than ship a weakened status API. Resource-derived sibling
|
|
1612
|
-
// fields are unaffected.
|
|
1613
|
-
assertNoHoistWeakenedStatusFields(optimizedStatusMappings, hoistedNamespaces, definition.name);
|
|
1614
|
-
}
|
|
1615
|
-
const graphNestedStatusCel = hoistedNamespaces.size === 0
|
|
1616
|
-
? nestedStatusCel
|
|
1617
|
-
: rewriteHoistedNamespaceRefsInValue(nestedStatusCel, hoistedNamespaces);
|
|
1618
|
-
const kroSchema = generateKroSchemaFromArktype(definition.name, schemaDefinition, graphResources, graphStatusMappings, Object.keys(graphNestedStatusCel).length > 0 ? graphNestedStatusCel : undefined, options?.schemaFieldValidations);
|
|
1619
|
-
if (definition.group) {
|
|
1620
|
-
kroSchema.group = definition.group;
|
|
1621
|
-
}
|
|
1622
|
-
// Attach nested status CEL mappings to the schema as a non-enumerable
|
|
1623
|
-
// property (same pattern as __ternaryConditionals, __omitFields).
|
|
1624
|
-
// Non-enumerable so it doesn't appear in the YAML output, but
|
|
1625
|
-
// accessible via KroSimpleSchemaWithMetadata for the YAML serializer
|
|
1626
|
-
// to resolve virtual composition IDs in resource templates.
|
|
1627
|
-
if (Object.keys(graphNestedStatusCel).length > 0) {
|
|
1628
|
-
Object.defineProperty(kroSchema, '__nestedStatusCel', {
|
|
1629
|
-
value: graphNestedStatusCel,
|
|
1630
|
-
enumerable: false,
|
|
1631
|
-
});
|
|
1681
|
+
return this.factory('kro').toYaml(specOrOptions, materializationOptions);
|
|
1632
1682
|
}
|
|
1633
|
-
//
|
|
1634
|
-
|
|
1635
|
-
//
|
|
1636
|
-
// KRO status CEL can only reference resource fields — it has no `schema`
|
|
1637
|
-
// identifier in the status environment (even a bare `${schema.spec.x}`
|
|
1638
|
-
// is rejected with "references unknown identifiers: [schema]"). So a
|
|
1639
|
-
// status override that references ONLY schema.spec (no resource) must be
|
|
1640
|
-
// left out of the KRO schema and instead hydrated client-side by the
|
|
1641
|
-
// factory's inline-CEL evaluator (see `evaluateStaticFieldValue`).
|
|
1642
|
-
const statusOverrides = compositionAnalysis?.statusOverrides ?? [];
|
|
1643
|
-
if (statusOverrides.length > 0) {
|
|
1644
|
-
// Classify against the HOISTED graph's resource ids (the hoisted Namespace
|
|
1645
|
-
// is no longer a graph resource) so an override that referenced only it is
|
|
1646
|
-
// treated correctly after rewriting.
|
|
1647
|
-
const resourceIdList = Object.keys(graphResources);
|
|
1648
|
-
const nestedCelForClassification = Object.keys(graphNestedStatusCel).length > 0 ? graphNestedStatusCel : undefined;
|
|
1649
|
-
for (const override of statusOverrides) {
|
|
1650
|
-
// BLOCKER #2 — rewrite any reference to a hoisted Namespace in the override
|
|
1651
|
-
// expression too (finding #6), so a status override never dangles at the
|
|
1652
|
-
// removed id (mirrors the factory path).
|
|
1653
|
-
const celExpression = rewriteHoistedNamespaceRefsInValue(override.celExpression, hoistedNamespaces);
|
|
1654
|
-
// Schema-only overrides (no resource refs) are hydrated client-side by
|
|
1655
|
-
// the static-field path, like any other static status field — KRO
|
|
1656
|
-
// status CEL cannot reference `schema.spec.*`. Only inject the
|
|
1657
|
-
// resource-referencing (dynamic) overrides into the KRO schema.
|
|
1658
|
-
if (isStaticExpression(celExpression, nestedCelForClassification, resourceIdList))
|
|
1659
|
-
continue;
|
|
1660
|
-
if (!kroSchema.status) {
|
|
1661
|
-
kroSchema.status = {};
|
|
1662
|
-
}
|
|
1663
|
-
const yamlSafe = celExpression.replace(/"([^"\\]*)"/g, "'$1'");
|
|
1664
|
-
kroSchema.status[override.propertyPath] = yamlSafe;
|
|
1665
|
-
}
|
|
1666
|
-
}
|
|
1667
|
-
// Apply ternary conditionals (once only — guard prevents
|
|
1668
|
-
// double-processing if toYaml() is called multiple times).
|
|
1669
|
-
// Note: omit() wrapping for optional fields is no longer a
|
|
1670
|
-
// post-processing step — it's applied inline during ref-to-CEL
|
|
1671
|
-
// conversion via `SerializationContext.omitFields`, which reads
|
|
1672
|
-
// from `kroSchema.__omitFields` inside `serializeResourceGraphToYaml`.
|
|
1673
|
-
if (!analysisState.ternaryAndOmitApplied) {
|
|
1674
|
-
analysisState.ternaryAndOmitApplied = true;
|
|
1675
|
-
if (kroSchema.__ternaryConditionals?.length) {
|
|
1676
|
-
applyTernaryConditionalsToResources(resourcesWithKeys, kroSchema.__ternaryConditionals, kroSchema.__nestedStatusCel);
|
|
1677
|
-
}
|
|
1678
|
-
}
|
|
1679
|
-
const rgdYaml = serializeResourceGraphToYaml(definition.name, graphResources, options, kroSchema);
|
|
1680
|
-
// BLOCKER #2 — the SAME post-serialization dangling-reference assertion the
|
|
1681
|
-
// factory path runs (kro-factory.ts `assertNoDanglingHoistedReferences`). After
|
|
1682
|
-
// hoisting an owned Namespace out of the graph, NO reference to it may remain
|
|
1683
|
-
// anywhere in the emitted RGD (resource templates, status CEL, nested CEL,
|
|
1684
|
-
// overrides). If one slipped through a form the rewrite didn't structurally
|
|
1685
|
-
// cover, fail LOUDLY here instead of shipping an RGD KRO rejects at runtime.
|
|
1686
|
-
const dangling = findDanglingHoistedReference(rgdYaml, hoistedNamespaceIds);
|
|
1687
|
-
if (dangling !== undefined) {
|
|
1688
|
-
throw new ValidationError(`Hoisting the owned Namespace left a dangling reference to removed resource "${dangling}" ` +
|
|
1689
|
-
`in the emitted RGD for composition "${definition.name}". This would make KRO reject the ` +
|
|
1690
|
-
`graph. Report this as a typekro bug (the reference form was not structurally rewritten).`, 'ResourceGraphDefinition', definition.name, `status/${dangling}`);
|
|
1691
|
-
}
|
|
1692
|
-
// Singleton owners are deployed once outside any consuming instance's
|
|
1693
|
-
// ApplySet (see `singleton(...)`). The factory's `deploy()` creates them
|
|
1694
|
-
// imperatively; for the GitOps `toYaml()` path we must emit their RGDs too,
|
|
1695
|
-
// deps-first, or the consuming RGD's externalRef dangles. No-op when the
|
|
1696
|
-
// composition uses no singletons.
|
|
1697
|
-
const singletonDefs = this._singletonDefinitions ??
|
|
1698
|
-
[];
|
|
1699
|
-
if (singletonDefs.length === 0)
|
|
1700
|
-
return rgdYaml;
|
|
1701
|
-
return joinYamlDocuments(singletonRgdYamls(singletonDefs), rgdYaml);
|
|
1683
|
+
// The graph facade and explicit factory share one artifact-compiled RGD path.
|
|
1684
|
+
return this.factory('kro').toYaml();
|
|
1702
1685
|
},
|
|
1703
1686
|
};
|
|
1704
1687
|
// 8. Wrap with cross-composition magic proxy
|
|
1705
|
-
|
|
1688
|
+
const graph = wrapWithResourceGraphProxy(baseResourceGraph, resourcesWithKeys, serializationLogger);
|
|
1689
|
+
// 9. Capture composition semantics once for inspection and planning. The
|
|
1690
|
+
// executable callbacks remain in a WeakMap-backed internal record and never
|
|
1691
|
+
// enter public DTOs or YAML/JSON serialization.
|
|
1692
|
+
const potentialCapabilities = [
|
|
1693
|
+
...(Object.keys(closures).length > 0
|
|
1694
|
+
? [
|
|
1695
|
+
{
|
|
1696
|
+
id: 'typekro.runtime-closure',
|
|
1697
|
+
version: 1,
|
|
1698
|
+
host: 'standalone',
|
|
1699
|
+
output: 'live',
|
|
1700
|
+
},
|
|
1701
|
+
]
|
|
1702
|
+
: []),
|
|
1703
|
+
];
|
|
1704
|
+
const rawStatusMappingsByKey = new Map(Object.entries(statusMappings));
|
|
1705
|
+
const nestedStatusMappings = Object.getOwnPropertyDescriptor(statusMappings, '__nestedStatusCel')?.value ?? {};
|
|
1706
|
+
const capture = {
|
|
1707
|
+
ir: {
|
|
1708
|
+
version: 1,
|
|
1709
|
+
definition: {
|
|
1710
|
+
name: definition.name,
|
|
1711
|
+
apiVersion: definition.apiVersion ?? 'v1alpha1',
|
|
1712
|
+
kind: definition.kind,
|
|
1713
|
+
...(definition.group !== undefined ? { group: definition.group } : {}),
|
|
1714
|
+
...(definition.revision !== undefined ? { revision: definition.revision } : {}),
|
|
1715
|
+
specSchema: definition.spec,
|
|
1716
|
+
statusSchema: definition.status,
|
|
1717
|
+
},
|
|
1718
|
+
resources: resourcesWithKeys,
|
|
1719
|
+
statusMappings: Object.fromEntries(Object.keys(optimizedStatusMappings).map((key) => [
|
|
1720
|
+
key,
|
|
1721
|
+
containsExplicitPlanValue(rawStatusMappingsByKey.get(key))
|
|
1722
|
+
? rawStatusMappingsByKey.get(key)
|
|
1723
|
+
: optimizedStatusMappings[key],
|
|
1724
|
+
])),
|
|
1725
|
+
nestedStatusMappings,
|
|
1726
|
+
compatibilityClosures: Object.keys(closures).sort(),
|
|
1727
|
+
potentialCapabilities,
|
|
1728
|
+
canonicalizers: [],
|
|
1729
|
+
},
|
|
1730
|
+
diagnosticSource: getCompositionAnalysisMetadata(optimizedStatusMappings)?.originalCompositionFn?.toString() ??
|
|
1731
|
+
`${resourceBuilder.toString()}\n${statusBuilder.toString()}`,
|
|
1732
|
+
validate: (spec) => validateSpec(spec, schemaDefinition, { kind: definition.kind, name: definition.name }),
|
|
1733
|
+
materialize: (spec, planOptions) => {
|
|
1734
|
+
const factory = graph.factory('direct', { plan: planOptions });
|
|
1735
|
+
return factory.createLegacyResourceGraphForInstance(spec);
|
|
1736
|
+
},
|
|
1737
|
+
representationRequirements: () => {
|
|
1738
|
+
const definitions = graph._singletonDefinitions ??
|
|
1739
|
+
[];
|
|
1740
|
+
const uniqueDefinitions = [
|
|
1741
|
+
...new Map(definitions.map((singleton) => [singleton.key, singleton])).values(),
|
|
1742
|
+
].sort((left, right) => left.key.localeCompare(right.key));
|
|
1743
|
+
const diagnostics = [];
|
|
1744
|
+
const requirements = uniqueDefinitions.flatMap((singleton) => {
|
|
1745
|
+
const owner = singletonOwnerInstanceManifests([singleton])[0];
|
|
1746
|
+
const lowered = lowerPlanValue({
|
|
1747
|
+
singletonKey: singleton.key,
|
|
1748
|
+
owner,
|
|
1749
|
+
lifecycle: {
|
|
1750
|
+
creation: 'create',
|
|
1751
|
+
management: 'authoritative',
|
|
1752
|
+
deletion: 'delete-when-unused',
|
|
1753
|
+
instancing: { kind: 'per-cluster' },
|
|
1754
|
+
sharing: 'shareable',
|
|
1755
|
+
unusedEvidence: {
|
|
1756
|
+
provider: 'typekro.singleton-consumer-registry',
|
|
1757
|
+
version: 1,
|
|
1758
|
+
inputs: {
|
|
1759
|
+
singletonKey: singleton.key,
|
|
1760
|
+
registryNamespace: singleton.registryNamespace,
|
|
1761
|
+
},
|
|
1762
|
+
},
|
|
1763
|
+
},
|
|
1764
|
+
});
|
|
1765
|
+
diagnostics.push(...lowered.diagnostics.map((diagnostic) => ({
|
|
1766
|
+
...diagnostic,
|
|
1767
|
+
path: `$.representationRequirements.singleton.${singleton.id}${diagnostic.path?.slice(1) ?? ''}`,
|
|
1768
|
+
})));
|
|
1769
|
+
return ['direct', 'kro'].map((target) => ({
|
|
1770
|
+
target,
|
|
1771
|
+
kind: 'singleton-owner',
|
|
1772
|
+
extension: 'typekro.singleton-owner',
|
|
1773
|
+
version: 1,
|
|
1774
|
+
inputs: lowered.value,
|
|
1775
|
+
}));
|
|
1776
|
+
});
|
|
1777
|
+
return { requirements, diagnostics };
|
|
1778
|
+
},
|
|
1779
|
+
inspect: () => inspectCapturedComposition(capture),
|
|
1780
|
+
plan: (spec, planOptions = {}) => planCapturedComposition(capture, spec, planOptions),
|
|
1781
|
+
planTemplate: (planOptions = {}) => planCapturedTemplate(capture, schema.spec, planOptions),
|
|
1782
|
+
planSymbolic: (spec, planOptions = {}) => planCapturedTemplate(capture, spec, planOptions),
|
|
1783
|
+
planMaterialized: (spec, materializedGraph, planOptions = {}) => planMaterializedComposition(capture, spec, materializedGraph, planOptions),
|
|
1784
|
+
};
|
|
1785
|
+
Object.defineProperties(graph, {
|
|
1786
|
+
inspect: {
|
|
1787
|
+
configurable: false,
|
|
1788
|
+
enumerable: false,
|
|
1789
|
+
value: capture.inspect,
|
|
1790
|
+
writable: false,
|
|
1791
|
+
},
|
|
1792
|
+
plan: {
|
|
1793
|
+
configurable: false,
|
|
1794
|
+
enumerable: false,
|
|
1795
|
+
value: capture.plan,
|
|
1796
|
+
writable: false,
|
|
1797
|
+
},
|
|
1798
|
+
});
|
|
1799
|
+
setCompositionCapture(graph, capture);
|
|
1800
|
+
return graph;
|
|
1706
1801
|
}
|
|
1707
1802
|
//# sourceMappingURL=core.js.map
|