typekro 0.5.0 → 0.8.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/compositions/typekro-runtime/typekro-runtime.d.ts +1 -1
- package/dist/compositions/typekro-runtime/typekro-runtime.d.ts.map +1 -1
- package/dist/compositions/typekro-runtime/typekro-runtime.js +16 -2
- package/dist/compositions/typekro-runtime/typekro-runtime.js.map +1 -1
- package/dist/core/composition/context.d.ts +14 -0
- package/dist/core/composition/context.d.ts.map +1 -1
- package/dist/core/composition/context.js.map +1 -1
- package/dist/core/composition/imperative.d.ts.map +1 -1
- package/dist/core/composition/imperative.js +59 -30
- package/dist/core/composition/imperative.js.map +1 -1
- package/dist/core/composition/nested-status-cel.d.ts +50 -0
- package/dist/core/composition/nested-status-cel.d.ts.map +1 -0
- package/dist/core/composition/nested-status-cel.js +169 -0
- package/dist/core/composition/nested-status-cel.js.map +1 -0
- 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/containers/build.d.ts +50 -0
- package/dist/core/containers/build.d.ts.map +1 -0
- package/dist/core/containers/build.js +146 -0
- package/dist/core/containers/build.js.map +1 -0
- package/dist/core/containers/errors.d.ts +14 -0
- package/dist/core/containers/errors.d.ts.map +1 -0
- package/dist/core/containers/errors.js +48 -0
- package/dist/core/containers/errors.js.map +1 -0
- package/dist/core/containers/exec.d.ts +36 -0
- package/dist/core/containers/exec.d.ts.map +1 -0
- package/dist/core/containers/exec.js +110 -0
- package/dist/core/containers/exec.js.map +1 -0
- package/dist/core/containers/index.d.ts +21 -0
- package/dist/core/containers/index.d.ts.map +1 -0
- package/dist/core/containers/index.js +20 -0
- package/dist/core/containers/index.js.map +1 -0
- package/dist/core/containers/registries/ecr.d.ts +22 -0
- package/dist/core/containers/registries/ecr.d.ts.map +1 -0
- package/dist/core/containers/registries/ecr.js +118 -0
- package/dist/core/containers/registries/ecr.js.map +1 -0
- package/dist/core/containers/registries/index.d.ts +9 -0
- package/dist/core/containers/registries/index.d.ts.map +1 -0
- package/dist/core/containers/registries/index.js +23 -0
- package/dist/core/containers/registries/index.js.map +1 -0
- package/dist/core/containers/registries/orbstack.d.ts +14 -0
- package/dist/core/containers/registries/orbstack.d.ts.map +1 -0
- package/dist/core/containers/registries/orbstack.js +24 -0
- package/dist/core/containers/registries/orbstack.js.map +1 -0
- package/dist/core/containers/registries/types.d.ts +94 -0
- package/dist/core/containers/registries/types.d.ts.map +1 -0
- package/dist/core/containers/registries/types.js +11 -0
- package/dist/core/containers/registries/types.js.map +1 -0
- package/dist/core/dependencies/graph.d.ts +4 -0
- package/dist/core/dependencies/graph.d.ts.map +1 -1
- package/dist/core/dependencies/graph.js +6 -0
- package/dist/core/dependencies/graph.js.map +1 -1
- package/dist/core/dependencies/resolver.d.ts +28 -0
- package/dist/core/dependencies/resolver.d.ts.map +1 -1
- package/dist/core/dependencies/resolver.js +138 -5
- package/dist/core/dependencies/resolver.js.map +1 -1
- package/dist/core/deployment/direct-factory.d.ts +13 -0
- package/dist/core/deployment/direct-factory.d.ts.map +1 -1
- package/dist/core/deployment/direct-factory.js +99 -0
- package/dist/core/deployment/direct-factory.js.map +1 -1
- package/dist/core/deployment/engine.d.ts.map +1 -1
- package/dist/core/deployment/engine.js +45 -2
- package/dist/core/deployment/engine.js.map +1 -1
- package/dist/core/deployment/kro-factory.d.ts +28 -0
- package/dist/core/deployment/kro-factory.d.ts.map +1 -1
- package/dist/core/deployment/kro-factory.js +243 -13
- package/dist/core/deployment/kro-factory.js.map +1 -1
- package/dist/core/deployment/kro-readiness.d.ts.map +1 -1
- package/dist/core/deployment/kro-readiness.js +10 -1
- package/dist/core/deployment/kro-readiness.js.map +1 -1
- package/dist/core/deployment/nested-composition-status.d.ts +33 -0
- package/dist/core/deployment/nested-composition-status.d.ts.map +1 -0
- package/dist/core/deployment/nested-composition-status.js +101 -0
- package/dist/core/deployment/nested-composition-status.js.map +1 -0
- package/dist/core/deployment/readiness-waiter.d.ts.map +1 -1
- package/dist/core/deployment/readiness-waiter.js +23 -6
- package/dist/core/deployment/readiness-waiter.js.map +1 -1
- package/dist/core/deployment/rollback-manager.d.ts.map +1 -1
- package/dist/core/deployment/rollback-manager.js +19 -0
- package/dist/core/deployment/rollback-manager.js.map +1 -1
- package/dist/core/deployment/strategies/direct-strategy.d.ts +6 -0
- package/dist/core/deployment/strategies/direct-strategy.d.ts.map +1 -1
- package/dist/core/deployment/strategies/direct-strategy.js +133 -35
- package/dist/core/deployment/strategies/direct-strategy.js.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer-helpers.d.ts +8 -2
- package/dist/core/expressions/composition/composition-analyzer-helpers.d.ts.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer-helpers.js +34 -2
- package/dist/core/expressions/composition/composition-analyzer-helpers.js.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer-ternary.d.ts.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer-ternary.js +52 -28
- 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 +11 -4
- package/dist/core/expressions/composition/composition-analyzer-traversal.js.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer-types.d.ts +8 -0
- package/dist/core/expressions/composition/composition-analyzer-types.d.ts.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer.d.ts +1 -1
- package/dist/core/expressions/composition/composition-analyzer.d.ts.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer.js +8 -2
- package/dist/core/expressions/composition/composition-analyzer.js.map +1 -1
- package/dist/core/expressions/composition/imperative-analyzer.d.ts +8 -0
- package/dist/core/expressions/composition/imperative-analyzer.d.ts.map +1 -1
- package/dist/core/expressions/composition/imperative-analyzer.js +111 -16
- package/dist/core/expressions/composition/imperative-analyzer.js.map +1 -1
- package/dist/core/metadata/resource-metadata.d.ts +4 -0
- package/dist/core/metadata/resource-metadata.d.ts.map +1 -1
- package/dist/core/metadata/resource-metadata.js.map +1 -1
- package/dist/core/proxy/create-resource.d.ts.map +1 -1
- package/dist/core/proxy/create-resource.js +63 -21
- package/dist/core/proxy/create-resource.js.map +1 -1
- package/dist/core/references/cel.d.ts +48 -0
- package/dist/core/references/cel.d.ts.map +1 -1
- package/dist/core/references/cel.js +82 -0
- package/dist/core/references/cel.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 -0
- package/dist/core/references/external-refs.js.map +1 -1
- package/dist/core/references/resolver.d.ts +12 -4
- package/dist/core/references/resolver.d.ts.map +1 -1
- package/dist/core/references/resolver.js +152 -69
- 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 +5 -4
- package/dist/core/references/schema-proxy.js.map +1 -1
- package/dist/core/serialization/cel-references.d.ts +1 -1
- package/dist/core/serialization/cel-references.d.ts.map +1 -1
- package/dist/core/serialization/cel-references.js +191 -24
- package/dist/core/serialization/cel-references.js.map +1 -1
- package/dist/core/serialization/core.d.ts +8 -1
- package/dist/core/serialization/core.d.ts.map +1 -1
- package/dist/core/serialization/core.js +434 -7
- package/dist/core/serialization/core.js.map +1 -1
- package/dist/core/serialization/kro-post-processing.d.ts +46 -0
- package/dist/core/serialization/kro-post-processing.d.ts.map +1 -0
- package/dist/core/serialization/kro-post-processing.js +103 -0
- package/dist/core/serialization/kro-post-processing.js.map +1 -0
- package/dist/core/serialization/schema.d.ts +61 -3
- package/dist/core/serialization/schema.d.ts.map +1 -1
- package/dist/core/serialization/schema.js +520 -18
- package/dist/core/serialization/schema.js.map +1 -1
- package/dist/core/serialization/status-analysis-pipeline.d.ts +4 -0
- package/dist/core/serialization/status-analysis-pipeline.d.ts.map +1 -1
- package/dist/core/serialization/status-analysis-pipeline.js +127 -10
- package/dist/core/serialization/status-analysis-pipeline.js.map +1 -1
- package/dist/core/serialization/yaml.d.ts.map +1 -1
- package/dist/core/serialization/yaml.js +27 -4
- package/dist/core/serialization/yaml.js.map +1 -1
- package/dist/core/types/composable.d.ts +62 -0
- package/dist/core/types/composable.d.ts.map +1 -0
- package/dist/core/types/composable.js +51 -0
- package/dist/core/types/composable.js.map +1 -0
- package/dist/core/types/deployment.d.ts +2 -1
- package/dist/core/types/deployment.d.ts.map +1 -1
- package/dist/core/types/index.d.ts +1 -0
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/core/types/index.js +1 -0
- package/dist/core/types/index.js.map +1 -1
- package/dist/core/types/serialization.d.ts +40 -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 +55 -31
- package/dist/core/validation/cel-validator.js.map +1 -1
- package/dist/factories/cnpg/compositions/cnpg-bootstrap.d.ts +55 -0
- package/dist/factories/cnpg/compositions/cnpg-bootstrap.d.ts.map +1 -0
- package/dist/factories/cnpg/compositions/cnpg-bootstrap.js +92 -0
- package/dist/factories/cnpg/compositions/cnpg-bootstrap.js.map +1 -0
- package/dist/factories/cnpg/compositions/index.d.ts +2 -0
- package/dist/factories/cnpg/compositions/index.d.ts.map +1 -0
- package/dist/factories/cnpg/compositions/index.js +2 -0
- package/dist/factories/cnpg/compositions/index.js.map +1 -0
- package/dist/factories/cnpg/index.d.ts +42 -0
- package/dist/factories/cnpg/index.d.ts.map +1 -0
- package/dist/factories/cnpg/index.js +42 -0
- package/dist/factories/cnpg/index.js.map +1 -0
- package/dist/factories/cnpg/resources/backup.d.ts +34 -0
- package/dist/factories/cnpg/resources/backup.d.ts.map +1 -0
- package/dist/factories/cnpg/resources/backup.js +87 -0
- package/dist/factories/cnpg/resources/backup.js.map +1 -0
- package/dist/factories/cnpg/resources/cluster.d.ts +55 -0
- package/dist/factories/cnpg/resources/cluster.d.ts.map +1 -0
- package/dist/factories/cnpg/resources/cluster.js +123 -0
- package/dist/factories/cnpg/resources/cluster.js.map +1 -0
- package/dist/factories/cnpg/resources/helm.d.ts +45 -0
- package/dist/factories/cnpg/resources/helm.d.ts.map +1 -0
- package/dist/factories/cnpg/resources/helm.js +78 -0
- package/dist/factories/cnpg/resources/helm.js.map +1 -0
- package/dist/factories/cnpg/resources/index.d.ts +6 -0
- package/dist/factories/cnpg/resources/index.d.ts.map +1 -0
- package/dist/factories/cnpg/resources/index.js +6 -0
- package/dist/factories/cnpg/resources/index.js.map +1 -0
- package/dist/factories/cnpg/resources/pooler.d.ts +38 -0
- package/dist/factories/cnpg/resources/pooler.d.ts.map +1 -0
- package/dist/factories/cnpg/resources/pooler.js +97 -0
- package/dist/factories/cnpg/resources/pooler.js.map +1 -0
- package/dist/factories/cnpg/resources/scheduled-backup.d.ts +35 -0
- package/dist/factories/cnpg/resources/scheduled-backup.d.ts.map +1 -0
- package/dist/factories/cnpg/resources/scheduled-backup.js +68 -0
- package/dist/factories/cnpg/resources/scheduled-backup.js.map +1 -0
- package/dist/factories/cnpg/types.d.ts +507 -0
- package/dist/factories/cnpg/types.d.ts.map +1 -0
- package/dist/factories/cnpg/types.js +398 -0
- package/dist/factories/cnpg/types.js.map +1 -0
- package/dist/factories/cnpg/utils/helm-values-mapper.d.ts +70 -0
- package/dist/factories/cnpg/utils/helm-values-mapper.d.ts.map +1 -0
- package/dist/factories/cnpg/utils/helm-values-mapper.js +79 -0
- package/dist/factories/cnpg/utils/helm-values-mapper.js.map +1 -0
- package/dist/factories/cnpg/utils/index.d.ts +2 -0
- package/dist/factories/cnpg/utils/index.d.ts.map +1 -0
- package/dist/factories/cnpg/utils/index.js +2 -0
- package/dist/factories/cnpg/utils/index.js.map +1 -0
- package/dist/factories/helm/helm-release.d.ts.map +1 -1
- package/dist/factories/helm/helm-release.js +4 -0
- package/dist/factories/helm/helm-release.js.map +1 -1
- package/dist/factories/helm/types.d.ts +2 -0
- package/dist/factories/helm/types.d.ts.map +1 -1
- package/dist/factories/inngest/compositions/index.d.ts +2 -0
- package/dist/factories/inngest/compositions/index.d.ts.map +1 -0
- package/dist/factories/inngest/compositions/index.js +2 -0
- package/dist/factories/inngest/compositions/index.js.map +1 -0
- package/dist/factories/inngest/compositions/inngest-bootstrap.d.ts +150 -0
- package/dist/factories/inngest/compositions/inngest-bootstrap.d.ts.map +1 -0
- package/dist/factories/inngest/compositions/inngest-bootstrap.js +90 -0
- package/dist/factories/inngest/compositions/inngest-bootstrap.js.map +1 -0
- package/dist/factories/inngest/index.d.ts +45 -0
- package/dist/factories/inngest/index.d.ts.map +1 -0
- package/dist/factories/inngest/index.js +45 -0
- package/dist/factories/inngest/index.js.map +1 -0
- package/dist/factories/inngest/resources/helm.d.ts +53 -0
- package/dist/factories/inngest/resources/helm.d.ts.map +1 -0
- package/dist/factories/inngest/resources/helm.js +88 -0
- package/dist/factories/inngest/resources/helm.js.map +1 -0
- package/dist/factories/inngest/resources/index.d.ts +2 -0
- package/dist/factories/inngest/resources/index.d.ts.map +1 -0
- package/dist/factories/inngest/resources/index.js +2 -0
- package/dist/factories/inngest/resources/index.js.map +1 -0
- package/dist/factories/inngest/types.d.ts +177 -0
- package/dist/factories/inngest/types.d.ts.map +1 -0
- package/dist/factories/inngest/types.js +189 -0
- package/dist/factories/inngest/types.js.map +1 -0
- package/dist/factories/inngest/utils/helm-values-mapper.d.ts +127 -0
- package/dist/factories/inngest/utils/helm-values-mapper.d.ts.map +1 -0
- package/dist/factories/inngest/utils/helm-values-mapper.js +116 -0
- package/dist/factories/inngest/utils/helm-values-mapper.js.map +1 -0
- package/dist/factories/inngest/utils/index.d.ts +2 -0
- package/dist/factories/inngest/utils/index.d.ts.map +1 -0
- package/dist/factories/inngest/utils/index.js +2 -0
- package/dist/factories/inngest/utils/index.js.map +1 -0
- package/dist/factories/kubernetes/config/secret.d.ts.map +1 -1
- package/dist/factories/kubernetes/config/secret.js +11 -1
- package/dist/factories/kubernetes/config/secret.js.map +1 -1
- package/dist/factories/kubernetes/core/namespace.d.ts.map +1 -1
- package/dist/factories/kubernetes/core/namespace.js +1 -1
- package/dist/factories/kubernetes/core/namespace.js.map +1 -1
- package/dist/factories/searxng/compositions/index.d.ts +2 -0
- package/dist/factories/searxng/compositions/index.d.ts.map +1 -0
- package/dist/factories/searxng/compositions/index.js +2 -0
- package/dist/factories/searxng/compositions/index.js.map +1 -0
- package/dist/factories/searxng/compositions/searxng-bootstrap.d.ts +65 -0
- package/dist/factories/searxng/compositions/searxng-bootstrap.d.ts.map +1 -0
- package/dist/factories/searxng/compositions/searxng-bootstrap.js +237 -0
- package/dist/factories/searxng/compositions/searxng-bootstrap.js.map +1 -0
- package/dist/factories/searxng/index.d.ts +29 -0
- package/dist/factories/searxng/index.d.ts.map +1 -0
- package/dist/factories/searxng/index.js +27 -0
- package/dist/factories/searxng/index.js.map +1 -0
- package/dist/factories/searxng/resources/index.d.ts +2 -0
- package/dist/factories/searxng/resources/index.d.ts.map +1 -0
- package/dist/factories/searxng/resources/index.js +2 -0
- package/dist/factories/searxng/resources/index.js.map +1 -0
- package/dist/factories/searxng/resources/searxng.d.ts +65 -0
- package/dist/factories/searxng/resources/searxng.d.ts.map +1 -0
- package/dist/factories/searxng/resources/searxng.js +188 -0
- package/dist/factories/searxng/resources/searxng.js.map +1 -0
- package/dist/factories/searxng/types.d.ts +126 -0
- package/dist/factories/searxng/types.d.ts.map +1 -0
- package/dist/factories/searxng/types.js +176 -0
- package/dist/factories/searxng/types.js.map +1 -0
- package/dist/factories/searxng/utils/settings-builder.d.ts +46 -0
- package/dist/factories/searxng/utils/settings-builder.d.ts.map +1 -0
- package/dist/factories/searxng/utils/settings-builder.js +52 -0
- package/dist/factories/searxng/utils/settings-builder.js.map +1 -0
- package/dist/factories/simple/config/secret.d.ts.map +1 -1
- package/dist/factories/simple/config/secret.js +28 -0
- package/dist/factories/simple/config/secret.js.map +1 -1
- package/dist/factories/valkey/compositions/index.d.ts +2 -0
- package/dist/factories/valkey/compositions/index.d.ts.map +1 -0
- package/dist/factories/valkey/compositions/index.js +2 -0
- package/dist/factories/valkey/compositions/index.js.map +1 -0
- package/dist/factories/valkey/compositions/valkey-bootstrap.d.ts +41 -0
- package/dist/factories/valkey/compositions/valkey-bootstrap.d.ts.map +1 -0
- package/dist/factories/valkey/compositions/valkey-bootstrap.js +105 -0
- package/dist/factories/valkey/compositions/valkey-bootstrap.js.map +1 -0
- package/dist/factories/valkey/index.d.ts +50 -0
- package/dist/factories/valkey/index.d.ts.map +1 -0
- package/dist/factories/valkey/index.js +50 -0
- package/dist/factories/valkey/index.js.map +1 -0
- package/dist/factories/valkey/resources/helm.d.ts +53 -0
- package/dist/factories/valkey/resources/helm.d.ts.map +1 -0
- package/dist/factories/valkey/resources/helm.js +82 -0
- package/dist/factories/valkey/resources/helm.js.map +1 -0
- package/dist/factories/valkey/resources/index.d.ts +3 -0
- package/dist/factories/valkey/resources/index.d.ts.map +1 -0
- package/dist/factories/valkey/resources/index.js +3 -0
- package/dist/factories/valkey/resources/index.js.map +1 -0
- package/dist/factories/valkey/resources/valkey.d.ts +46 -0
- package/dist/factories/valkey/resources/valkey.d.ts.map +1 -0
- package/dist/factories/valkey/resources/valkey.js +123 -0
- package/dist/factories/valkey/resources/valkey.js.map +1 -0
- package/dist/factories/valkey/types.d.ts +185 -0
- package/dist/factories/valkey/types.d.ts.map +1 -0
- package/dist/factories/valkey/types.js +204 -0
- package/dist/factories/valkey/types.js.map +1 -0
- package/dist/factories/valkey/utils/helm-values-mapper.d.ts +32 -0
- package/dist/factories/valkey/utils/helm-values-mapper.d.ts.map +1 -0
- package/dist/factories/valkey/utils/helm-values-mapper.js +58 -0
- package/dist/factories/valkey/utils/helm-values-mapper.js.map +1 -0
- package/dist/factories/valkey/utils/index.d.ts +2 -0
- package/dist/factories/valkey/utils/index.d.ts.map +1 -0
- package/dist/factories/valkey/utils/index.js +2 -0
- package/dist/factories/valkey/utils/index.js.map +1 -0
- package/dist/factories/webapp/compositions/index.d.ts +2 -0
- package/dist/factories/webapp/compositions/index.d.ts.map +1 -0
- package/dist/factories/webapp/compositions/index.js +2 -0
- package/dist/factories/webapp/compositions/index.js.map +1 -0
- package/dist/factories/webapp/compositions/web-app-with-processing.d.ts +97 -0
- package/dist/factories/webapp/compositions/web-app-with-processing.d.ts.map +1 -0
- package/dist/factories/webapp/compositions/web-app-with-processing.js +220 -0
- package/dist/factories/webapp/compositions/web-app-with-processing.js.map +1 -0
- package/dist/factories/webapp/index.d.ts +53 -0
- package/dist/factories/webapp/index.d.ts.map +1 -0
- package/dist/factories/webapp/index.js +53 -0
- package/dist/factories/webapp/index.js.map +1 -0
- package/dist/factories/webapp/types.d.ts +69 -0
- package/dist/factories/webapp/types.d.ts.map +1 -0
- package/dist/factories/webapp/types.js +92 -0
- package/dist/factories/webapp/types.js.map +1 -0
- package/dist/shared/brands.d.ts +16 -0
- package/dist/shared/brands.d.ts.map +1 -1
- package/dist/shared/brands.js +16 -0
- package/dist/shared/brands.js.map +1 -1
- package/package.json +29 -1
|
@@ -5,9 +5,12 @@
|
|
|
5
5
|
* simple schemas, and provides utility functions for generating schemas
|
|
6
6
|
* from resource maps.
|
|
7
7
|
*/
|
|
8
|
+
import { createCompositionContext, runWithCompositionContext } from '../composition/context.js';
|
|
9
|
+
import { getComponentLogger } from '../logging/index.js';
|
|
8
10
|
import { pascalCase } from '../../utils/string.js';
|
|
9
11
|
import { separateStatusFields } from '../validation/cel-validator.js';
|
|
10
12
|
import { serializeStatusMappingsToCel } from './cel-references.js';
|
|
13
|
+
const logger = getComponentLogger('schema-defaults');
|
|
11
14
|
// ---------------------------------------------------------------------------
|
|
12
15
|
// Arktype JSON AST → Kro type helpers (private)
|
|
13
16
|
// ---------------------------------------------------------------------------
|
|
@@ -61,10 +64,15 @@ function getKroTypeFromJson(node) {
|
|
|
61
64
|
return 'string';
|
|
62
65
|
}
|
|
63
66
|
/**
|
|
64
|
-
* Recursively
|
|
67
|
+
* Recursively convert an Arktype JSON AST into a nested KRO SimpleSchema object.
|
|
68
|
+
*
|
|
69
|
+
* KRO v0.8+ supports nested objects in SimpleSchema — child fields are defined
|
|
70
|
+
* by indentation under a parent key. CEL expressions use dot notation to access
|
|
71
|
+
* them (e.g., `schema.spec.cache.shards`). This preserves the nesting so the
|
|
72
|
+
* schema matches the CEL paths generated by the schema proxy.
|
|
65
73
|
*/
|
|
66
|
-
function arktypeJsonToKroFields(node
|
|
67
|
-
|
|
74
|
+
function arktypeJsonToKroFields(node) {
|
|
75
|
+
const fields = {};
|
|
68
76
|
if (!node || typeof node !== 'object') {
|
|
69
77
|
return fields;
|
|
70
78
|
}
|
|
@@ -76,23 +84,452 @@ function arktypeJsonToKroFields(node, prefix = '') {
|
|
|
76
84
|
const optional = Array.isArray(nodeObj.optional) ? nodeObj.optional : [];
|
|
77
85
|
const props = [...required, ...optional];
|
|
78
86
|
for (const prop of props) {
|
|
79
|
-
const newKey = prefix
|
|
80
|
-
? `${prefix}${prop.key.charAt(0).toUpperCase() + prop.key.slice(1)}`
|
|
81
|
-
: prop.key;
|
|
82
87
|
const childNode = prop.value;
|
|
83
88
|
if (typeof childNode === 'object' &&
|
|
84
89
|
childNode !== null &&
|
|
85
90
|
(childNode.required || childNode.optional)) {
|
|
86
|
-
|
|
87
|
-
fields = { ...fields, ...nestedFields };
|
|
91
|
+
fields[prop.key] = arktypeJsonToKroFields(childNode);
|
|
88
92
|
}
|
|
89
93
|
else {
|
|
90
|
-
fields[
|
|
94
|
+
fields[prop.key] = getKroTypeFromJson(childNode);
|
|
91
95
|
}
|
|
92
96
|
}
|
|
93
97
|
return fields;
|
|
94
98
|
}
|
|
95
99
|
// ---------------------------------------------------------------------------
|
|
100
|
+
// Nullish coalescing default extraction
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
/**
|
|
103
|
+
* Extract literal default values from `spec.field ?? literalValue` patterns
|
|
104
|
+
* in a composition function's source code.
|
|
105
|
+
*
|
|
106
|
+
* **FAST PATH — NOT AUTHORITATIVE.** This regex-based extraction runs first
|
|
107
|
+
* to catch the common case where a composition uses `spec.X ?? 'literal'`
|
|
108
|
+
* with a literal right-hand side. It is intentionally conservative:
|
|
109
|
+
*
|
|
110
|
+
* - Both `??` and the literal must be on the same source line.
|
|
111
|
+
* - The literal must be a string, number, boolean, or minified !0/!1 form.
|
|
112
|
+
* - The right-hand side cannot be a constant, variable, template literal,
|
|
113
|
+
* function call, or expression involving other spec fields.
|
|
114
|
+
*
|
|
115
|
+
* Anything this regex misses is caught by {@link resolveDefaultsByReExecution}
|
|
116
|
+
* (Phase 2), which actually executes the composition function with optional
|
|
117
|
+
* fields set to `undefined` and observes the concrete resolved values. Phase 2
|
|
118
|
+
* is the authoritative source; this function only exists to short-circuit
|
|
119
|
+
* the common case so the heavy re-execution doesn't need to compare every
|
|
120
|
+
* field for every composition.
|
|
121
|
+
*
|
|
122
|
+
* In KRO mode, `??` doesn't trigger for proxy objects (they're truthy).
|
|
123
|
+
* Instead, we detect these patterns via fn.toString() and add
|
|
124
|
+
* `| default=<value>` annotations to the KRO SimpleSchema so that KRO
|
|
125
|
+
* uses the intended default when the field isn't provided in the CR.
|
|
126
|
+
*
|
|
127
|
+
* NOTE: `.orValue()` is NOT supported in KRO resource templates (only in
|
|
128
|
+
* status CEL). Schema `| default=` is the correct mechanism for resource
|
|
129
|
+
* template defaults.
|
|
130
|
+
*
|
|
131
|
+
* Handles:
|
|
132
|
+
* - `spec.field ?? 'string'` or `spec.field ?? "string"`
|
|
133
|
+
* - `spec.field ?? 123` (numbers)
|
|
134
|
+
* - `spec.field ?? true/false` (booleans, including minified !0/!1)
|
|
135
|
+
* - `spec.parent?.child ?? value` (optional chaining)
|
|
136
|
+
*/
|
|
137
|
+
export function extractNullishDefaults(fnSource) {
|
|
138
|
+
const defaults = {};
|
|
139
|
+
const pattern = /spec\.([\w]+(?:\??\.\w+)*)\s*\?\?\s*(?:(['"])([^'"]*)\2|(-?\d+(?:\.\d+)?)|true|false|!0|!1)(?=\s*[;,)}\n])/g;
|
|
140
|
+
let match = pattern.exec(fnSource);
|
|
141
|
+
while (match !== null) {
|
|
142
|
+
const fieldPath = match[1].replace(/\?\./g, '.');
|
|
143
|
+
const stringValue = match[3];
|
|
144
|
+
const numericValue = match[4];
|
|
145
|
+
if (stringValue !== undefined) {
|
|
146
|
+
defaults[fieldPath] = stringValue;
|
|
147
|
+
}
|
|
148
|
+
else if (numericValue !== undefined) {
|
|
149
|
+
defaults[fieldPath] = Number(numericValue);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
const fullMatch = match[0];
|
|
153
|
+
if (fullMatch.endsWith('true') || fullMatch.endsWith('!0'))
|
|
154
|
+
defaults[fieldPath] = true;
|
|
155
|
+
else if (fullMatch.endsWith('false') || fullMatch.endsWith('!1'))
|
|
156
|
+
defaults[fieldPath] = false;
|
|
157
|
+
}
|
|
158
|
+
match = pattern.exec(fnSource);
|
|
159
|
+
}
|
|
160
|
+
return defaults;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Placeholder value passed in place of required spec fields during the
|
|
164
|
+
* defaults-extraction re-execution. Any captured leaf value that IS this
|
|
165
|
+
* string, CONTAINS this string as a substring (from template-literal
|
|
166
|
+
* interpolation), or is NaN (from arithmetic coercion of the string) is
|
|
167
|
+
* filtered out by the sentinel-detection logic in `extractDefaultsByComparison`
|
|
168
|
+
* so it never gets recorded as a real schema default.
|
|
169
|
+
*
|
|
170
|
+
* The choice of a string (rather than a Symbol or object) is deliberate:
|
|
171
|
+
* - String concatenation preserves the token so template-literal usage
|
|
172
|
+
* produces a clearly-identifiable captured value (e.g. `"__typekro_default__-cfg"`).
|
|
173
|
+
* - Truthiness matches the real proxy behavior (proxies are truthy), so
|
|
174
|
+
* `if (spec.requiredField)` takes the same branch in both runs.
|
|
175
|
+
* - Numeric contexts coerce to NaN in both runs (proxies also coerce to
|
|
176
|
+
* NaN because functions have no numeric value), so arithmetic-derived
|
|
177
|
+
* NaN values are symmetric across runs and don't produce spurious defaults.
|
|
178
|
+
*
|
|
179
|
+
* If the propagation ever drifts out of this sentinel's shape (e.g. someone
|
|
180
|
+
* introduces a Symbol-based sentinel), update `isSentinelDerivedValue` below
|
|
181
|
+
* to match.
|
|
182
|
+
*/
|
|
183
|
+
export const REQUIRED_FIELD_SENTINEL = '__typekro_default__';
|
|
184
|
+
/**
|
|
185
|
+
* Check whether a captured value is derived from the required-field sentinel
|
|
186
|
+
* and therefore should NOT be recorded as a real schema default. Handles:
|
|
187
|
+
* - Direct sentinel or substring (template-literal propagation)
|
|
188
|
+
* - NaN (numeric-coercion propagation — both runs produce NaN symmetrically,
|
|
189
|
+
* but the defaults run's NaN must be filtered out of the defaults map)
|
|
190
|
+
*/
|
|
191
|
+
function isSentinelDerivedValue(v) {
|
|
192
|
+
if (typeof v === 'string')
|
|
193
|
+
return v.includes(REQUIRED_FIELD_SENTINEL);
|
|
194
|
+
if (typeof v === 'number')
|
|
195
|
+
return Number.isNaN(v);
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Resolve ?? defaults by re-executing the composition function with undefined
|
|
200
|
+
* for optional spec fields. This triggers ?? fallbacks naturally, resolving
|
|
201
|
+
* imported constants from the closure (e.g., DEFAULT_SEARXNG_IMAGE).
|
|
202
|
+
*
|
|
203
|
+
* Also detects ternary conditional sections (spec.field ? section : '') by
|
|
204
|
+
* comparing resource strings between proxy-run and defaults-run.
|
|
205
|
+
*
|
|
206
|
+
* Runs in a temporary, isolated composition context. Resource registrations
|
|
207
|
+
* are contained within the temp context. However, composition functions with
|
|
208
|
+
* external side effects (API calls, logging, metrics) will fire during this
|
|
209
|
+
* re-execution. Composition functions should be side-effect-free beyond
|
|
210
|
+
* resource creation for this mechanism to work safely.
|
|
211
|
+
*/
|
|
212
|
+
function resolveDefaultsByReExecution(compositionFn, specType, proxyResources) {
|
|
213
|
+
try {
|
|
214
|
+
const specJson = specType.json;
|
|
215
|
+
if (!specJson)
|
|
216
|
+
return undefined;
|
|
217
|
+
const defaultsSpec = {};
|
|
218
|
+
for (const p of specJson.required ?? [])
|
|
219
|
+
defaultsSpec[p.key] = REQUIRED_FIELD_SENTINEL;
|
|
220
|
+
for (const p of specJson.optional ?? [])
|
|
221
|
+
defaultsSpec[p.key] = undefined;
|
|
222
|
+
// Build the set of optional top-level field names. Only optional fields
|
|
223
|
+
// can be ternary-controlled (required fields always have a value).
|
|
224
|
+
const optionalFieldNames = new Set((specJson.optional ?? []).map(p => p.key));
|
|
225
|
+
const tempCtx = createCompositionContext('defaults-extraction');
|
|
226
|
+
runWithCompositionContext(tempCtx, () => {
|
|
227
|
+
compositionFn(defaultsSpec);
|
|
228
|
+
});
|
|
229
|
+
const defaults = {};
|
|
230
|
+
const ternaryConditionals = [];
|
|
231
|
+
// Match resources by RESOURCE ID rather than by insertion order. Compositions
|
|
232
|
+
// that use `if (!spec.optional) { createResource(...) }` produce different
|
|
233
|
+
// resource counts between runs — positional matching silently pairs
|
|
234
|
+
// unrelated resources (e.g., the defaults run's auto-Secret against the
|
|
235
|
+
// proxy run's Deployment) and corrupts both default extraction and
|
|
236
|
+
// ternary detection. Key-based matching is robust against conditional
|
|
237
|
+
// resource creation: resources present in only one run are simply skipped
|
|
238
|
+
// for comparison.
|
|
239
|
+
const proxyEntries = Object.entries(proxyResources);
|
|
240
|
+
const defaultsEntries = Object.entries(tempCtx.resources);
|
|
241
|
+
const defaultsMap = new Map(defaultsEntries);
|
|
242
|
+
if (proxyEntries.length !== defaultsEntries.length) {
|
|
243
|
+
// Different resource counts between runs are expected when the
|
|
244
|
+
// composition uses conditional `createResource` patterns — the
|
|
245
|
+
// defaults run takes different branches than the proxy run.
|
|
246
|
+
// Key-based matching handles this correctly, so downgrade to debug.
|
|
247
|
+
logger.debug('Re-execution produced a different number of resources than the proxy run — matching by resource ID', {
|
|
248
|
+
proxyResourceCount: proxyEntries.length,
|
|
249
|
+
defaultsResourceCount: defaultsEntries.length,
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
for (const [id, proxyRes] of proxyEntries) {
|
|
253
|
+
const defaultsRes = defaultsMap.get(id);
|
|
254
|
+
if (!defaultsRes)
|
|
255
|
+
continue; // resource only in proxy run — skip
|
|
256
|
+
extractDefaultsByComparison(proxyRes, defaultsRes, defaults);
|
|
257
|
+
extractTernaryConditionals(proxyRes, defaultsRes, ternaryConditionals, optionalFieldNames);
|
|
258
|
+
}
|
|
259
|
+
const hasResults = Object.keys(defaults).length > 0 || ternaryConditionals.length > 0;
|
|
260
|
+
return hasResults ? { defaults, ternaryConditionals } : undefined;
|
|
261
|
+
}
|
|
262
|
+
catch (err) {
|
|
263
|
+
// Best-effort: composition functions with undefined spec fields may throw
|
|
264
|
+
// (e.g., accessing spec.nested.field without optional chaining). Log at
|
|
265
|
+
// debug level for troubleshooting but don't fail schema generation.
|
|
266
|
+
logger.debug('Defaults re-execution failed', {
|
|
267
|
+
error: err instanceof Error ? err.message : String(err),
|
|
268
|
+
});
|
|
269
|
+
return undefined;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Recursively compare proxy-run resource values (with __KUBERNETES_REF__ markers)
|
|
274
|
+
* against defaults-run values (with resolved constants) to find field defaults.
|
|
275
|
+
*
|
|
276
|
+
* When a proxy value is `__KUBERNETES_REF___schema___spec.FIELD__` and the
|
|
277
|
+
* corresponding defaults value is a concrete scalar, we record FIELD → value.
|
|
278
|
+
*/
|
|
279
|
+
function extractDefaultsByComparison(proxyVal, defaultsVal, result) {
|
|
280
|
+
// KubernetesRef proxies are functions whose toString() returns a marker string.
|
|
281
|
+
// Coerce to string to check for __KUBERNETES_REF__ markers.
|
|
282
|
+
const proxyStr = typeof proxyVal === 'function' || typeof proxyVal === 'string'
|
|
283
|
+
? String(proxyVal) : null;
|
|
284
|
+
// Only match when the proxy value IS the marker (exact, single reference).
|
|
285
|
+
// If the marker is embedded inside a larger string (template literal), the
|
|
286
|
+
// value is a transformation, not a default — e.g., `\`has-${spec.extra}\``
|
|
287
|
+
// produces `"has-<marker>"` which is NOT a default for `extra`.
|
|
288
|
+
const exactMarkerMatch = proxyStr?.match(/^__KUBERNETES_REF___schema___spec\.(\w+(?:\.\w+)*)__$/);
|
|
289
|
+
if (exactMarkerMatch) {
|
|
290
|
+
if (typeof defaultsVal === 'string' ||
|
|
291
|
+
typeof defaultsVal === 'number' ||
|
|
292
|
+
typeof defaultsVal === 'boolean') {
|
|
293
|
+
// Skip values derived from the required-field sentinel — these aren't
|
|
294
|
+
// real defaults. Covers: string containing the sentinel token
|
|
295
|
+
// (template-literal propagation), NaN (arithmetic-coercion
|
|
296
|
+
// propagation), and the sentinel itself.
|
|
297
|
+
if (isSentinelDerivedValue(defaultsVal))
|
|
298
|
+
return;
|
|
299
|
+
result[exactMarkerMatch[1]] = defaultsVal;
|
|
300
|
+
}
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
// If the proxy is a string but contains the marker as part of larger content,
|
|
304
|
+
// skip the defaults check (recursion into arrays/objects still applies below).
|
|
305
|
+
if (proxyStr?.includes('__KUBERNETES_REF___schema___')) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
if (Array.isArray(proxyVal) && Array.isArray(defaultsVal)) {
|
|
309
|
+
for (let i = 0; i < Math.min(proxyVal.length, defaultsVal.length); i++) {
|
|
310
|
+
extractDefaultsByComparison(proxyVal[i], defaultsVal[i], result);
|
|
311
|
+
}
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
if (proxyVal && typeof proxyVal === 'object' && defaultsVal && typeof defaultsVal === 'object') {
|
|
315
|
+
for (const key of Object.keys(proxyVal)) {
|
|
316
|
+
extractDefaultsByComparison(proxyVal[key], defaultsVal[key], result);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Detect ternary conditional sections by finding markers in the proxy-run
|
|
322
|
+
* string that are completely ABSENT from the defaults-run string.
|
|
323
|
+
*
|
|
324
|
+
* When `spec.redisUrl ? \`redis: ...\` : ''` is evaluated:
|
|
325
|
+
* - Proxy run (truthy): the redis section with markers is included
|
|
326
|
+
* - Defaults run (falsy): the redis section is empty — the marker is absent
|
|
327
|
+
*
|
|
328
|
+
* For each such "orphan" marker, we extract the surrounding section
|
|
329
|
+
* (from the previous newline-at-start-of-key to the marker's end) as a
|
|
330
|
+
* ternary-controlled conditional.
|
|
331
|
+
*
|
|
332
|
+
* KNOWN LIMITATION — tested field must equal referenced field
|
|
333
|
+
* ---------------------------------------------------------
|
|
334
|
+
* The emitted `conditionField` is taken from the `__KUBERNETES_REF__`
|
|
335
|
+
* marker inside the truthy branch — i.e., the field that the branch
|
|
336
|
+
* REFERENCES. Under the hood, this function has no direct access to the
|
|
337
|
+
* JavaScript ternary's TEST field because JS ternaries evaluate eagerly
|
|
338
|
+
* and neither branch leaves a runtime trace of "which field was
|
|
339
|
+
* tested". This works correctly for the overwhelmingly common case
|
|
340
|
+
* where the tested field and the referenced field are the same:
|
|
341
|
+
*
|
|
342
|
+
* spec.redisUrl ? `redis:\n url: ${spec.redisUrl}` : ''
|
|
343
|
+
*
|
|
344
|
+
* but produces semantically wrong CEL for patterns like:
|
|
345
|
+
*
|
|
346
|
+
* spec.enableRedis ? `redis:\n url: ${spec.connectionString}` : ''
|
|
347
|
+
*
|
|
348
|
+
* ...where we would emit `has(schema.spec.connectionString)` instead of
|
|
349
|
+
* `has(schema.spec.enableRedis)`. Compositions that need decoupled
|
|
350
|
+
* test/reference fields should use an explicit `Cel.expr()` with the
|
|
351
|
+
* correct `has()` expression until AST-based detection lands (tracked
|
|
352
|
+
* in https://github.com/yehudacohen/typekro/issues/57).
|
|
353
|
+
*
|
|
354
|
+
* FRAGILE: this walks line-by-line through the proxy string and backs
|
|
355
|
+
* through parent YAML keys by regex-matching `^\s*\w+:\s*$` and comparing
|
|
356
|
+
* against a set of lines from the defaults string. It assumes the
|
|
357
|
+
* composition constructs YAML-ish content directly (typically via template
|
|
358
|
+
* literal) with 2-space indentation, canonical key: value syntax, and no
|
|
359
|
+
* block scalars (`|`, `>`). Compositions that emit flow-style YAML, that
|
|
360
|
+
* use tab indentation, that quote keys, or that assemble the string
|
|
361
|
+
* through multiple splice operations will not match cleanly. The
|
|
362
|
+
* extracted `proxySection` is later consumed by
|
|
363
|
+
* `applyTernaryConditionalsToResources` via exact substring match — keep
|
|
364
|
+
* both functions' assumptions in sync when updating either side.
|
|
365
|
+
*
|
|
366
|
+
* Tracked for replacement with AST-based detection in
|
|
367
|
+
* https://github.com/yehudacohen/typekro/issues/57
|
|
368
|
+
*/
|
|
369
|
+
function extractTernaryConditionals(proxyVal, defaultsVal, result, optionalFieldNames) {
|
|
370
|
+
const proxyStr = typeof proxyVal === 'string' ? proxyVal : null;
|
|
371
|
+
const defaultsStr = typeof defaultsVal === 'string' ? defaultsVal : null;
|
|
372
|
+
if (proxyStr && defaultsStr && proxyStr !== defaultsStr && proxyStr.length > defaultsStr.length) {
|
|
373
|
+
// Find all __KUBERNETES_REF__ markers in the proxy string
|
|
374
|
+
const markerPattern = /__KUBERNETES_REF___schema___spec\.(\w+(?:\.\w+)*)__/g;
|
|
375
|
+
let match = markerPattern.exec(proxyStr);
|
|
376
|
+
while (match !== null) {
|
|
377
|
+
const field = match[1];
|
|
378
|
+
const marker = match[0];
|
|
379
|
+
// Only optional fields can be ternary-controlled. Required fields always
|
|
380
|
+
// have a value (the sentinel in the defaults run), so their markers are
|
|
381
|
+
// always "absent" from the defaults string but they're substitutions,
|
|
382
|
+
// not conditionals.
|
|
383
|
+
const topLevelField = field.split('.')[0];
|
|
384
|
+
if (!optionalFieldNames.has(topLevelField)) {
|
|
385
|
+
match = markerPattern.exec(proxyStr);
|
|
386
|
+
continue;
|
|
387
|
+
}
|
|
388
|
+
// Check if this marker is a TERNARY conditional (section absent from defaults)
|
|
389
|
+
// vs a ?? fallback (same key exists with a different value in defaults).
|
|
390
|
+
// Find the YAML key before the marker (e.g., `url: ` before the redisUrl marker).
|
|
391
|
+
const lineStart = proxyStr.lastIndexOf('\n', match.index) + 1;
|
|
392
|
+
const line = proxyStr.slice(lineStart, match.index + marker.length);
|
|
393
|
+
const keyMatch = line.match(/(\w+):\s*$/)?.[1] || line.match(/^\s*(\w+):/)?.[1];
|
|
394
|
+
const keyExistsInDefaults = keyMatch
|
|
395
|
+
? new RegExp(`\\b${keyMatch}\\s*:`).test(defaultsStr)
|
|
396
|
+
: false;
|
|
397
|
+
// If the key exists in defaults, this is a ?? fallback (handled elsewhere).
|
|
398
|
+
// If the key is absent, this is a ternary conditional (section not present).
|
|
399
|
+
if (!keyExistsInDefaults && !defaultsStr.includes(marker)) {
|
|
400
|
+
// Extract the section containing this marker.
|
|
401
|
+
// Walk backward from the marker to find the start of the conditional
|
|
402
|
+
// section. Include parent YAML keys at ALL nesting levels (not just one)
|
|
403
|
+
// so that `redis:\n connection:\n url: ${ref}` captures all three lines.
|
|
404
|
+
let sectionStart = match.index;
|
|
405
|
+
while (sectionStart > 0 && proxyStr[sectionStart - 1] !== '\n') {
|
|
406
|
+
sectionStart--;
|
|
407
|
+
}
|
|
408
|
+
// Walk back through preceding blank lines
|
|
409
|
+
while (sectionStart > 0 && proxyStr[sectionStart - 1] === '\n') {
|
|
410
|
+
sectionStart--;
|
|
411
|
+
}
|
|
412
|
+
// Walk back through parent YAML keys (lines with `key:` and no value).
|
|
413
|
+
// Keep walking as long as the previous line is a key-only line that
|
|
414
|
+
// doesn't exist as a complete line in the defaults. Set membership
|
|
415
|
+
// (not substring match) avoids false stops on coincidental substrings.
|
|
416
|
+
const defaultsLines = new Set(defaultsStr.split('\n'));
|
|
417
|
+
const allLines = proxyStr.slice(0, sectionStart).split('\n');
|
|
418
|
+
while (allLines.length > 0) {
|
|
419
|
+
const prevLine = allLines[allLines.length - 1];
|
|
420
|
+
const isKeyOnlyLine = /^\s*\w+:\s*$/.test(prevLine);
|
|
421
|
+
const lineExistsInDefaults = defaultsLines.has(prevLine);
|
|
422
|
+
if (isKeyOnlyLine && !lineExistsInDefaults) {
|
|
423
|
+
sectionStart -= prevLine.length + 1; // +1 for the \n
|
|
424
|
+
allLines.pop();
|
|
425
|
+
}
|
|
426
|
+
else {
|
|
427
|
+
break;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
// Section ends after the marker
|
|
431
|
+
const sectionEnd = match.index + marker.length;
|
|
432
|
+
const proxySection = proxyStr.slice(sectionStart, sectionEnd);
|
|
433
|
+
// Verify the section, when removed from proxy string, makes it closer to defaults
|
|
434
|
+
if (proxySection.includes(marker)) {
|
|
435
|
+
result.push({
|
|
436
|
+
proxySection,
|
|
437
|
+
falsyValue: '',
|
|
438
|
+
conditionField: field,
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
match = markerPattern.exec(proxyStr);
|
|
443
|
+
}
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
// Recurse into arrays and objects
|
|
447
|
+
if (Array.isArray(proxyVal) && Array.isArray(defaultsVal)) {
|
|
448
|
+
for (let i = 0; i < Math.min(proxyVal.length, defaultsVal.length); i++) {
|
|
449
|
+
extractTernaryConditionals(proxyVal[i], defaultsVal[i], result, optionalFieldNames);
|
|
450
|
+
}
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
if (proxyVal && typeof proxyVal === 'object' && defaultsVal && typeof defaultsVal === 'object') {
|
|
454
|
+
for (const key of Object.keys(proxyVal)) {
|
|
455
|
+
extractTernaryConditionals(proxyVal[key], defaultsVal[key], result, optionalFieldNames);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Apply extracted nullish defaults to a KRO SimpleSchema spec fields object.
|
|
461
|
+
* Appends `| default=<value>` to the field's type string.
|
|
462
|
+
*
|
|
463
|
+
* The two-phase default extraction uses this function twice:
|
|
464
|
+
* - Phase 1 (regex, `extractNullishDefaults`) — fast but may misfire on
|
|
465
|
+
* edge cases (multi-line expressions, nested parens). Called with
|
|
466
|
+
* `overwrite: false` so it doesn't clobber existing annotations.
|
|
467
|
+
* - Phase 2 (re-execution, `resolveDefaultsByReExecution`) — slower but
|
|
468
|
+
* authoritative. Called with `overwrite: true` so it REPLACES any
|
|
469
|
+
* Phase 1 annotation for the same field, ensuring a wrong Phase 1
|
|
470
|
+
* result doesn't survive when Phase 2 produces a corrected value.
|
|
471
|
+
*/
|
|
472
|
+
function applyNullishDefaults(specFields, defaults, overwrite = false) {
|
|
473
|
+
for (const [path, value] of Object.entries(defaults)) {
|
|
474
|
+
const parts = path.split('.');
|
|
475
|
+
let current = specFields;
|
|
476
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
477
|
+
const part = parts[i];
|
|
478
|
+
if (current[part] && typeof current[part] === 'object') {
|
|
479
|
+
current = current[part];
|
|
480
|
+
}
|
|
481
|
+
else {
|
|
482
|
+
current = undefined;
|
|
483
|
+
break;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
if (!current)
|
|
487
|
+
continue;
|
|
488
|
+
const fieldName = parts[parts.length - 1];
|
|
489
|
+
const existingType = current[fieldName];
|
|
490
|
+
if (typeof existingType !== 'string')
|
|
491
|
+
continue;
|
|
492
|
+
const defaultStr = typeof value === 'string' ? `"${value}"` : String(value);
|
|
493
|
+
const hasDefault = existingType.includes('default=');
|
|
494
|
+
if (!hasDefault) {
|
|
495
|
+
current[fieldName] = `${existingType} | default=${defaultStr}`;
|
|
496
|
+
}
|
|
497
|
+
else if (overwrite) {
|
|
498
|
+
// Strip any existing `| default=...` segment and replace with the
|
|
499
|
+
// authoritative Phase 2 value. The segment may appear as `| default="x"`,
|
|
500
|
+
// `| default=123`, or `| default=true` — match to the end of the value
|
|
501
|
+
// or to the next `|` (for additional annotations chained after it).
|
|
502
|
+
const withoutDefault = existingType.replace(/\s*\|\s*default=(?:"[^"]*"|[^|]*)/, '');
|
|
503
|
+
current[fieldName] = `${withoutDefault} | default=${defaultStr}`;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Collect optional spec fields that don't have | default= annotations.
|
|
509
|
+
* These fields need omit() wrapping in resource templates (KRO 0.9+)
|
|
510
|
+
* so they're removed from the K8s resource when not provided, rather
|
|
511
|
+
* than failing with an invalid zero value.
|
|
512
|
+
*
|
|
513
|
+
* Returns field paths (e.g., ['baseUrl', 'resources', 'env']).
|
|
514
|
+
*/
|
|
515
|
+
function collectOmitFields(specFields, specType) {
|
|
516
|
+
const specJson = specType.json;
|
|
517
|
+
const optionalKeys = (specJson?.optional ?? []).map((p) => p.key);
|
|
518
|
+
const omitFields = [];
|
|
519
|
+
for (const fieldName of optionalKeys) {
|
|
520
|
+
const existingType = specFields[fieldName];
|
|
521
|
+
// Scalar without default → needs omit()
|
|
522
|
+
if (typeof existingType === 'string' && !existingType.includes('default=')) {
|
|
523
|
+
omitFields.push(fieldName);
|
|
524
|
+
}
|
|
525
|
+
// Object without defaults on children → needs omit()
|
|
526
|
+
if (typeof existingType === 'object' && existingType !== null) {
|
|
527
|
+
omitFields.push(fieldName);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
return omitFields;
|
|
531
|
+
}
|
|
532
|
+
// ---------------------------------------------------------------------------
|
|
96
533
|
// Public API
|
|
97
534
|
// ---------------------------------------------------------------------------
|
|
98
535
|
/**
|
|
@@ -104,22 +541,71 @@ function arktypeJsonToKroFields(node, prefix = '') {
|
|
|
104
541
|
* Status fields use user-defined mappings from the StatusBuilder function
|
|
105
542
|
* instead of auto-generated CEL expressions.
|
|
106
543
|
*/
|
|
107
|
-
export function arktypeToKroSchema(name, schemaDefinition,
|
|
544
|
+
export function arktypeToKroSchema(name, schemaDefinition, resources, statusMappings, nestedStatusCel) {
|
|
108
545
|
const specFields = arktypeJsonToKroFields(schemaDefinition.spec.json);
|
|
109
546
|
if (!specFields.name) {
|
|
110
547
|
specFields.name = `string | default="${name}"`;
|
|
111
548
|
}
|
|
112
|
-
//
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
549
|
+
// Extract ?? defaults and add | default= annotations to the schema.
|
|
550
|
+
// KRO uses these when a field isn't provided in the CR instance.
|
|
551
|
+
//
|
|
552
|
+
// Phase 1: fn.toString() regex — extracts literal ?? fallbacks quickly.
|
|
553
|
+
// Phase 2: Defaults resolution run — calls the composition function with
|
|
554
|
+
// undefined for optional fields, triggering ?? and resolving imported
|
|
555
|
+
// constants from the closure. Compares resolved resources with the
|
|
556
|
+
// proxy-run resources (markers) to extract field → default mappings.
|
|
557
|
+
const statusMeta = statusMappings;
|
|
558
|
+
const compositionFn = statusMeta?.__originalCompositionFn;
|
|
559
|
+
// Phase 1: regex extraction for literals
|
|
560
|
+
if (typeof compositionFn === 'function') {
|
|
561
|
+
const regexDefaults = extractNullishDefaults(compositionFn.toString());
|
|
562
|
+
applyNullishDefaults(specFields, regexDefaults);
|
|
563
|
+
}
|
|
564
|
+
// Phase 2: resolve imported constants + detect ternary conditionals.
|
|
565
|
+
// Phase 2 is AUTHORITATIVE — if it produces a value for a field that
|
|
566
|
+
// Phase 1 also annotated, Phase 2 wins. This corrects Phase 1 misfires
|
|
567
|
+
// on edge cases (multi-line expressions, nested parens) without breaking
|
|
568
|
+
// the common case where both phases agree.
|
|
569
|
+
let ternaryConditionals = [];
|
|
570
|
+
if (typeof compositionFn === 'function' && resources) {
|
|
571
|
+
const reExecutionResult = resolveDefaultsByReExecution(compositionFn, schemaDefinition.spec, resources);
|
|
572
|
+
if (reExecutionResult) {
|
|
573
|
+
applyNullishDefaults(specFields, reExecutionResult.defaults, true);
|
|
574
|
+
ternaryConditionals = reExecutionResult.ternaryConditionals;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
// Collect optional fields that DON'T have | default= after ?? extraction
|
|
578
|
+
// AND aren't already handled by ternary conditionals.
|
|
579
|
+
// These need omit() wrapping in resource templates (KRO 0.9+).
|
|
580
|
+
const ternaryFieldNames = new Set(ternaryConditionals.map(t => t.conditionField));
|
|
581
|
+
const omitFields = collectOmitFields(specFields, schemaDefinition.spec)
|
|
582
|
+
.filter(f => !ternaryFieldNames.has(f));
|
|
583
|
+
// Filter internal fields (prefixed with __) before classification.
|
|
584
|
+
// These are TypeKro metadata (e.g., __nestedStatusCel, __originalCompositionFn)
|
|
585
|
+
// that should never appear in the KRO schema.
|
|
586
|
+
const userStatusMappings = {};
|
|
587
|
+
if (statusMappings) {
|
|
588
|
+
for (const [key, value] of Object.entries(statusMappings)) {
|
|
589
|
+
if (!key.startsWith('__')) {
|
|
590
|
+
userStatusMappings[key] = value;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
// Separate static and dynamic status fields.
|
|
595
|
+
// Dynamic = references non-schema resource fields (status, metadata, spec) → KRO CEL
|
|
596
|
+
// Static = references only schema.spec.* or literal values → TypeKro runtime hydration
|
|
597
|
+
const { dynamicFields } = separateStatusFields(userStatusMappings);
|
|
116
598
|
// Only serialize dynamic fields that need Kro resolution
|
|
117
|
-
|
|
599
|
+
// Build the set of known resource IDs for schema.spec → resource.spec mapping
|
|
600
|
+
const resourceIds = resources ? new Set(Object.keys(resources)) : undefined;
|
|
601
|
+
const statusCelExpressions = Object.keys(dynamicFields).length > 0
|
|
602
|
+
? serializeStatusMappingsToCel(dynamicFields, nestedStatusCel, resourceIds)
|
|
603
|
+
: {};
|
|
118
604
|
// Extract just the version part for the schema (Kro expects v1alpha1, not kro.run/v1alpha1)
|
|
119
605
|
const schemaApiVersion = schemaDefinition.apiVersion.includes('/')
|
|
120
606
|
? schemaDefinition.apiVersion.split('/')[1] || schemaDefinition.apiVersion
|
|
121
607
|
: schemaDefinition.apiVersion;
|
|
122
|
-
|
|
608
|
+
const schema = {
|
|
123
609
|
apiVersion: schemaApiVersion,
|
|
124
610
|
kind: schemaDefinition.kind,
|
|
125
611
|
spec: specFields,
|
|
@@ -127,6 +613,22 @@ export function arktypeToKroSchema(name, schemaDefinition, _resources, statusMap
|
|
|
127
613
|
...statusCelExpressions,
|
|
128
614
|
},
|
|
129
615
|
};
|
|
616
|
+
// Attach metadata as non-enumerable properties — they're typed on
|
|
617
|
+
// KroSimpleSchemaWithMetadata so consumers can read them without casts,
|
|
618
|
+
// but non-enumerable so they don't appear in the schema YAML.
|
|
619
|
+
if (ternaryConditionals.length > 0) {
|
|
620
|
+
Object.defineProperty(schema, '__ternaryConditionals', {
|
|
621
|
+
value: ternaryConditionals,
|
|
622
|
+
enumerable: false,
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
if (omitFields.length > 0) {
|
|
626
|
+
Object.defineProperty(schema, '__omitFields', {
|
|
627
|
+
value: omitFields,
|
|
628
|
+
enumerable: false,
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
return schema;
|
|
130
632
|
}
|
|
131
633
|
/**
|
|
132
634
|
* Generate a minimal Kro schema from a resource map (no Arktype).
|
|
@@ -157,7 +659,7 @@ export function generateKroSchema(name, _resources) {
|
|
|
157
659
|
* @see {@link arktypeToKroSchema} for the low-level variant.
|
|
158
660
|
* @see {@link generateKroSchema} for a simple variant without Arktype.
|
|
159
661
|
*/
|
|
160
|
-
export function generateKroSchemaFromArktype(name, schemaDefinition, resources, statusMappings) {
|
|
161
|
-
return arktypeToKroSchema(name, schemaDefinition, resources, statusMappings);
|
|
662
|
+
export function generateKroSchemaFromArktype(name, schemaDefinition, resources, statusMappings, nestedStatusCel) {
|
|
663
|
+
return arktypeToKroSchema(name, schemaDefinition, resources, statusMappings, nestedStatusCel);
|
|
162
664
|
}
|
|
163
665
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/core/serialization/schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,oBAAo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,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE;YAC5C,KAAK,EAAE,UAAU;YACjB,UAAU,EAAE,KAAK;SAClB,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAAY,EACZ,UAA8C;IAE9C,MAAM,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAEpC,MAAM,IAAI,GAA2B;QACnC,IAAI,EAAE,qBAAqB,IAAI,GAAG;KACnC,CAAC;IAEF,OAAO;QACL,UAAU,EAAE,UAAU;QACtB,IAAI,EAAE,UAAU;QAChB,IAAI;QACJ,MAAM,EAAE,EAAE;KACX,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,4BAA4B,CAI1C,IAAY,EACZ,gBAAkD,EAClD,SAA8C,EAC9C,cAAwC,EACxC,eAAwC;IAExC,OAAO,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC;AAChG,CAAC"}
|
|
@@ -50,6 +50,10 @@ export interface StatusAnalysisPipelineResult {
|
|
|
50
50
|
analyzedStatusMappings: Record<string, unknown>;
|
|
51
51
|
mappingAnalysis: ReturnType<typeof analyzeStatusMappingTypes>;
|
|
52
52
|
imperativeAnalysisSucceeded: boolean;
|
|
53
|
+
/** Raw Phase B fn.toString results (before merge filtering). Available when
|
|
54
|
+
* Phase B ran for an imperative composition. Used by nested composition
|
|
55
|
+
* status extraction to recover CEL from garbled fn.toString output. */
|
|
56
|
+
phaseBStatusMappings?: Record<string, unknown> | undefined;
|
|
53
57
|
}
|
|
54
58
|
/**
|
|
55
59
|
* Run the full status analysis pipeline.
|