@takeshape/schema 11.40.0 → 11.41.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/cjs/package.json +1 -0
- package/dist/cjs/src/agents.js +58 -0
- package/dist/cjs/src/api-version.js +24 -0
- package/dist/cjs/src/auth-schemas.js +8 -0
- package/dist/cjs/src/builtin-schema.js +616 -0
- package/dist/cjs/src/constants.js +4 -0
- package/dist/cjs/src/content-schema-transform.js +175 -0
- package/dist/cjs/src/create-input-schema.js +67 -0
- package/dist/cjs/src/enum.js +13 -0
- package/dist/cjs/src/flatten-templates.js +27 -0
- package/dist/cjs/src/get-is-leaf.js +60 -0
- package/dist/cjs/src/index.js +60 -0
- package/dist/cjs/src/interfaces.js +97 -0
- package/dist/cjs/src/layers/layers.js +308 -0
- package/dist/cjs/src/layers/refs.js +243 -0
- package/dist/cjs/src/layers/type-utils.js +146 -0
- package/dist/cjs/src/layers/visitor.js +43 -0
- package/dist/cjs/src/migration/index.js +140 -0
- package/dist/cjs/src/migration/to/v3.0.0.js +205 -0
- package/dist/cjs/src/migration/to/v3.1.0.js +197 -0
- package/dist/cjs/src/migration/to/v3.10.0.js +72 -0
- package/dist/cjs/src/migration/to/v3.11.0.js +90 -0
- package/dist/cjs/src/migration/to/v3.12.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.12.1.js +12 -0
- package/dist/cjs/src/migration/to/v3.12.2.js +12 -0
- package/dist/cjs/src/migration/to/v3.12.3.js +92 -0
- package/dist/cjs/src/migration/to/v3.13.0.js +22 -0
- package/dist/cjs/src/migration/to/v3.14.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.15.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.16.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.17.0.js +27 -0
- package/dist/cjs/src/migration/to/v3.17.1.js +12 -0
- package/dist/cjs/src/migration/to/v3.18.0.js +69 -0
- package/dist/cjs/src/migration/to/v3.18.1.js +20 -0
- package/dist/cjs/src/migration/to/v3.18.2.js +24 -0
- package/dist/cjs/src/migration/to/v3.19.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.2.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.20.0.js +26 -0
- package/dist/cjs/src/migration/to/v3.21.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.22.0.js +30 -0
- package/dist/cjs/src/migration/to/v3.23.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.24.0.js +13 -0
- package/dist/cjs/src/migration/to/v3.25.0.js +13 -0
- package/dist/cjs/src/migration/to/v3.26.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.27.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.28.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.29.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.3.0.js +15 -0
- package/dist/cjs/src/migration/to/v3.30.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.31.0.js +43 -0
- package/dist/cjs/src/migration/to/v3.32.0.js +59 -0
- package/dist/cjs/src/migration/to/v3.33.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.34.0.js +127 -0
- package/dist/cjs/src/migration/to/v3.35.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.36.0.js +27 -0
- package/dist/cjs/src/migration/to/v3.37.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.38.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.39.0.js +47 -0
- package/dist/cjs/src/migration/to/v3.4.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.40.0.js +31 -0
- package/dist/cjs/src/migration/to/v3.41.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.42.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.43.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.44.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.45.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.46.0.js +37 -0
- package/dist/cjs/src/migration/to/v3.47.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.48.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.49.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.5.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.5.1.js +12 -0
- package/dist/cjs/src/migration/to/v3.50.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.6.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.7.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.8.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.9.0.js +84 -0
- package/dist/cjs/src/migration/types.js +2 -0
- package/dist/cjs/src/migration/utils.js +11 -0
- package/dist/cjs/src/mocks.js +66 -0
- package/dist/cjs/src/models/project-schema.js +99 -0
- package/dist/cjs/src/models/query.js +35 -0
- package/dist/cjs/src/models/service.js +24 -0
- package/dist/cjs/src/models/shape.js +89 -0
- package/dist/cjs/src/patterns.js +2 -0
- package/dist/cjs/src/project-schema/index.js +154 -0
- package/dist/cjs/src/project-schema/latest.js +8 -0
- package/dist/cjs/src/project-schema/migrate.js +197 -0
- package/dist/cjs/src/project-schema/v1.0.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.0.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.1.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.10.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.11.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.12.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.12.1.js +8 -0
- package/dist/cjs/src/project-schema/v3.12.2.js +8 -0
- package/dist/cjs/src/project-schema/v3.12.3.js +8 -0
- package/dist/cjs/src/project-schema/v3.13.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.13.1.js +8 -0
- package/dist/cjs/src/project-schema/v3.14.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.15.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.16.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.17.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.17.1.js +8 -0
- package/dist/cjs/src/project-schema/v3.18.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.18.1.js +8 -0
- package/dist/cjs/src/project-schema/v3.18.2.js +8 -0
- package/dist/cjs/src/project-schema/v3.19.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.2.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.20.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.21.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.22.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.23.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.24.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.25.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.26.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.27.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.28.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.29.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.3.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.30.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.31.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.32.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.33.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.34.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.35.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.36.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.37.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.38.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.39.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.4.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.40.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.41.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.42.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.43.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.44.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.45.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.46.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.47.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.48.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.49.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.5.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.5.1.js +8 -0
- package/dist/cjs/src/project-schema/v3.50.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.6.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.7.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.8.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.9.0.js +8 -0
- package/dist/cjs/src/project-schema/v4.0.0.js +8 -0
- package/dist/cjs/src/refs.js +662 -0
- package/dist/cjs/src/relationships.js +237 -0
- package/dist/cjs/src/scalars.js +8 -0
- package/dist/cjs/src/schema-transform.js +83 -0
- package/dist/cjs/src/schema-util.js +1133 -0
- package/dist/cjs/src/schemas/index.js +164 -0
- package/dist/cjs/src/services/services.js +156 -0
- package/dist/cjs/src/services/types.js +2 -0
- package/dist/cjs/src/services/util.js +46 -0
- package/dist/cjs/src/taxonomies.js +28 -0
- package/dist/cjs/src/template-shapes/index.js +38 -0
- package/dist/cjs/src/template-shapes/names.js +27 -0
- package/dist/cjs/src/template-shapes/templates.js +325 -0
- package/dist/cjs/src/template-shapes/types.js +10 -0
- package/dist/cjs/src/template-shapes/where.js +403 -0
- package/dist/cjs/src/types/index.js +19 -0
- package/dist/cjs/src/types/transforms.js +2 -0
- package/dist/cjs/src/types/types.js +21 -0
- package/dist/cjs/src/types/utils.js +345 -0
- package/dist/cjs/src/unions.js +90 -0
- package/dist/cjs/src/user-schema.js +8 -0
- package/dist/cjs/src/util/ai-tools.js +11 -0
- package/dist/cjs/src/util/api-indexing.js +62 -0
- package/dist/cjs/src/util/detect-cycles.js +49 -0
- package/dist/cjs/src/util/find-shape-at-path.js +58 -0
- package/dist/cjs/src/util/form-config.js +68 -0
- package/dist/cjs/src/util/get-conflicting-properties.js +59 -0
- package/dist/cjs/src/util/get-return-shape.js +35 -0
- package/dist/cjs/src/util/has-arg.js +18 -0
- package/dist/cjs/src/util/merge.js +261 -0
- package/dist/cjs/src/util/patch-schema.js +50 -0
- package/dist/cjs/src/util/shapes.js +32 -0
- package/dist/cjs/src/validate.js +1087 -0
- package/dist/cjs/src/versions.js +8 -0
- package/dist/cjs/src/workflows.js +76 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/src/agents.js +49 -0
- package/dist/esm/src/api-version.js +17 -0
- package/dist/esm/src/auth-schemas.js +7 -0
- package/dist/esm/src/builtin-schema.js +610 -0
- package/dist/esm/src/constants.js +1 -0
- package/dist/esm/src/content-schema-transform.js +162 -0
- package/dist/esm/src/create-input-schema.js +60 -0
- package/dist/esm/src/enum.js +9 -0
- package/dist/esm/src/flatten-templates.js +20 -0
- package/dist/esm/src/get-is-leaf.js +56 -0
- package/dist/esm/src/index.js +44 -0
- package/dist/esm/src/interfaces.js +83 -0
- package/dist/esm/src/layers/layers.js +295 -0
- package/dist/esm/src/layers/refs.js +220 -0
- package/dist/esm/src/layers/type-utils.js +118 -0
- package/dist/esm/src/layers/visitor.js +38 -0
- package/dist/esm/src/migration/index.js +120 -0
- package/dist/esm/src/migration/to/v3.0.0.js +200 -0
- package/dist/esm/src/migration/to/v3.1.0.js +192 -0
- package/dist/esm/src/migration/to/v3.10.0.js +67 -0
- package/dist/esm/src/migration/to/v3.11.0.js +85 -0
- package/dist/esm/src/migration/to/v3.12.0.js +10 -0
- package/dist/esm/src/migration/to/v3.12.1.js +10 -0
- package/dist/esm/src/migration/to/v3.12.2.js +10 -0
- package/dist/esm/src/migration/to/v3.12.3.js +87 -0
- package/dist/esm/src/migration/to/v3.13.0.js +17 -0
- package/dist/esm/src/migration/to/v3.14.0.js +10 -0
- package/dist/esm/src/migration/to/v3.15.0.js +10 -0
- package/dist/esm/src/migration/to/v3.16.0.js +10 -0
- package/dist/esm/src/migration/to/v3.17.0.js +22 -0
- package/dist/esm/src/migration/to/v3.17.1.js +10 -0
- package/dist/esm/src/migration/to/v3.18.0.js +64 -0
- package/dist/esm/src/migration/to/v3.18.1.js +15 -0
- package/dist/esm/src/migration/to/v3.18.2.js +19 -0
- package/dist/esm/src/migration/to/v3.19.0.js +10 -0
- package/dist/esm/src/migration/to/v3.2.0.js +10 -0
- package/dist/esm/src/migration/to/v3.20.0.js +21 -0
- package/dist/esm/src/migration/to/v3.21.0.js +10 -0
- package/dist/esm/src/migration/to/v3.22.0.js +25 -0
- package/dist/esm/src/migration/to/v3.23.0.js +10 -0
- package/dist/esm/src/migration/to/v3.24.0.js +11 -0
- package/dist/esm/src/migration/to/v3.25.0.js +11 -0
- package/dist/esm/src/migration/to/v3.26.0.js +10 -0
- package/dist/esm/src/migration/to/v3.27.0.js +10 -0
- package/dist/esm/src/migration/to/v3.28.0.js +10 -0
- package/dist/esm/src/migration/to/v3.29.0.js +10 -0
- package/dist/esm/src/migration/to/v3.3.0.js +13 -0
- package/dist/esm/src/migration/to/v3.30.0.js +10 -0
- package/dist/esm/src/migration/to/v3.31.0.js +38 -0
- package/dist/esm/src/migration/to/v3.32.0.js +57 -0
- package/dist/esm/src/migration/to/v3.33.0.js +10 -0
- package/dist/esm/src/migration/to/v3.34.0.js +119 -0
- package/dist/esm/src/migration/to/v3.35.0.js +10 -0
- package/dist/esm/src/migration/to/v3.36.0.js +22 -0
- package/dist/esm/src/migration/to/v3.37.0.js +10 -0
- package/dist/esm/src/migration/to/v3.38.0.js +10 -0
- package/dist/esm/src/migration/to/v3.39.0.js +45 -0
- package/dist/esm/src/migration/to/v3.4.0.js +10 -0
- package/dist/esm/src/migration/to/v3.40.0.js +26 -0
- package/dist/esm/src/migration/to/v3.41.0.js +10 -0
- package/dist/esm/src/migration/to/v3.42.0.js +10 -0
- package/dist/esm/src/migration/to/v3.43.0.js +10 -0
- package/dist/esm/src/migration/to/v3.44.0.js +10 -0
- package/dist/esm/src/migration/to/v3.45.0.js +10 -0
- package/dist/esm/src/migration/to/v3.46.0.js +35 -0
- package/dist/esm/src/migration/to/v3.47.0.js +10 -0
- package/dist/esm/src/migration/to/v3.48.0.js +10 -0
- package/dist/esm/src/migration/to/v3.49.0.js +10 -0
- package/dist/esm/src/migration/to/v3.5.0.js +10 -0
- package/dist/esm/src/migration/to/v3.5.1.js +10 -0
- package/dist/esm/src/migration/to/v3.50.0.js +10 -0
- package/dist/esm/src/migration/to/v3.6.0.js +10 -0
- package/dist/esm/src/migration/to/v3.7.0.js +10 -0
- package/dist/esm/src/migration/to/v3.8.0.js +10 -0
- package/dist/esm/src/migration/to/v3.9.0.js +79 -0
- package/dist/esm/src/migration/types.js +1 -0
- package/dist/esm/src/migration/utils.js +6 -0
- package/dist/esm/src/mocks.js +58 -0
- package/dist/esm/src/models/project-schema.js +92 -0
- package/dist/esm/src/models/query.js +31 -0
- package/dist/esm/src/models/service.js +20 -0
- package/dist/esm/src/models/shape.js +85 -0
- package/dist/esm/src/patterns.js +1 -0
- package/dist/esm/src/project-schema/index.js +136 -0
- package/dist/esm/src/project-schema/latest.js +7 -0
- package/dist/esm/src/project-schema/migrate.js +192 -0
- package/dist/esm/src/project-schema/v1.0.0.js +7 -0
- package/dist/esm/src/project-schema/v3.0.0.js +7 -0
- package/dist/esm/src/project-schema/v3.1.0.js +7 -0
- package/dist/esm/src/project-schema/v3.10.0.js +7 -0
- package/dist/esm/src/project-schema/v3.11.0.js +7 -0
- package/dist/esm/src/project-schema/v3.12.0.js +7 -0
- package/dist/esm/src/project-schema/v3.12.1.js +7 -0
- package/dist/esm/src/project-schema/v3.12.2.js +7 -0
- package/dist/esm/src/project-schema/v3.12.3.js +7 -0
- package/dist/esm/src/project-schema/v3.13.0.js +7 -0
- package/dist/esm/src/project-schema/v3.13.1.js +7 -0
- package/dist/esm/src/project-schema/v3.14.0.js +7 -0
- package/dist/esm/src/project-schema/v3.15.0.js +7 -0
- package/dist/esm/src/project-schema/v3.16.0.js +7 -0
- package/dist/esm/src/project-schema/v3.17.0.js +7 -0
- package/dist/esm/src/project-schema/v3.17.1.js +7 -0
- package/dist/esm/src/project-schema/v3.18.0.js +7 -0
- package/dist/esm/src/project-schema/v3.18.1.js +7 -0
- package/dist/esm/src/project-schema/v3.18.2.js +7 -0
- package/dist/esm/src/project-schema/v3.19.0.js +7 -0
- package/dist/esm/src/project-schema/v3.2.0.js +7 -0
- package/dist/esm/src/project-schema/v3.20.0.js +7 -0
- package/dist/esm/src/project-schema/v3.21.0.js +7 -0
- package/dist/esm/src/project-schema/v3.22.0.js +7 -0
- package/dist/esm/src/project-schema/v3.23.0.js +7 -0
- package/dist/esm/src/project-schema/v3.24.0.js +7 -0
- package/dist/esm/src/project-schema/v3.25.0.js +7 -0
- package/dist/esm/src/project-schema/v3.26.0.js +7 -0
- package/dist/esm/src/project-schema/v3.27.0.js +7 -0
- package/dist/esm/src/project-schema/v3.28.0.js +7 -0
- package/dist/esm/src/project-schema/v3.29.0.js +7 -0
- package/dist/esm/src/project-schema/v3.3.0.js +7 -0
- package/dist/esm/src/project-schema/v3.30.0.js +7 -0
- package/dist/esm/src/project-schema/v3.31.0.js +7 -0
- package/dist/esm/src/project-schema/v3.32.0.js +7 -0
- package/dist/esm/src/project-schema/v3.33.0.js +7 -0
- package/dist/esm/src/project-schema/v3.34.0.js +7 -0
- package/dist/esm/src/project-schema/v3.35.0.js +7 -0
- package/dist/esm/src/project-schema/v3.36.0.js +7 -0
- package/dist/esm/src/project-schema/v3.37.0.js +7 -0
- package/dist/esm/src/project-schema/v3.38.0.js +7 -0
- package/dist/esm/src/project-schema/v3.39.0.js +7 -0
- package/dist/esm/src/project-schema/v3.4.0.js +7 -0
- package/dist/esm/src/project-schema/v3.40.0.js +7 -0
- package/dist/esm/src/project-schema/v3.41.0.js +7 -0
- package/dist/esm/src/project-schema/v3.42.0.js +7 -0
- package/dist/esm/src/project-schema/v3.43.0.js +7 -0
- package/dist/esm/src/project-schema/v3.44.0.js +7 -0
- package/dist/esm/src/project-schema/v3.45.0.js +7 -0
- package/dist/esm/src/project-schema/v3.46.0.js +7 -0
- package/dist/esm/src/project-schema/v3.47.0.js +7 -0
- package/dist/esm/src/project-schema/v3.48.0.js +7 -0
- package/dist/esm/src/project-schema/v3.49.0.js +7 -0
- package/dist/esm/src/project-schema/v3.5.0.js +7 -0
- package/dist/esm/src/project-schema/v3.5.1.js +7 -0
- package/dist/esm/src/project-schema/v3.50.0.js +7 -0
- package/dist/esm/src/project-schema/v3.6.0.js +7 -0
- package/dist/esm/src/project-schema/v3.7.0.js +7 -0
- package/dist/esm/src/project-schema/v3.8.0.js +7 -0
- package/dist/esm/src/project-schema/v3.9.0.js +7 -0
- package/dist/esm/src/project-schema/v4.0.0.js +7 -0
- package/dist/esm/src/refs.js +598 -0
- package/dist/esm/src/relationships.js +222 -0
- package/dist/esm/src/scalars.js +4 -0
- package/dist/esm/src/schema-transform.js +74 -0
- package/dist/esm/src/schema-util.js +1069 -0
- package/dist/esm/src/schemas/index.js +154 -0
- package/dist/esm/src/services/services.js +144 -0
- package/dist/esm/src/services/types.js +1 -0
- package/dist/esm/src/services/util.js +36 -0
- package/dist/esm/src/taxonomies.js +24 -0
- package/dist/esm/src/template-shapes/index.js +33 -0
- package/dist/esm/src/template-shapes/names.js +21 -0
- package/dist/esm/src/template-shapes/templates.js +313 -0
- package/dist/esm/src/template-shapes/types.js +7 -0
- package/dist/esm/src/template-shapes/where.js +391 -0
- package/dist/esm/src/types/index.js +3 -0
- package/dist/esm/src/types/transforms.js +1 -0
- package/dist/esm/src/types/types.js +18 -0
- package/dist/esm/src/types/utils.js +279 -0
- package/dist/esm/src/unions.js +79 -0
- package/dist/esm/src/user-schema.js +7 -0
- package/dist/esm/src/util/ai-tools.js +6 -0
- package/dist/esm/src/util/api-indexing.js +57 -0
- package/dist/esm/src/util/detect-cycles.js +45 -0
- package/dist/esm/src/util/find-shape-at-path.js +53 -0
- package/dist/esm/src/util/form-config.js +63 -0
- package/dist/esm/src/util/get-conflicting-properties.js +55 -0
- package/dist/esm/src/util/get-return-shape.js +30 -0
- package/dist/esm/src/util/has-arg.js +13 -0
- package/dist/esm/src/util/merge.js +247 -0
- package/dist/esm/src/util/patch-schema.js +42 -0
- package/dist/esm/src/util/shapes.js +22 -0
- package/dist/esm/src/validate.js +1073 -0
- package/dist/esm/src/versions.js +4 -0
- package/dist/esm/src/workflows.js +66 -0
- package/dist/types/src/agents.d.ts +11 -0
- package/dist/types/src/api-version.d.ts +5 -0
- package/dist/types/src/auth-schemas.d.ts +104 -0
- package/dist/types/src/builtin-schema.d.ts +8 -0
- package/dist/types/src/constants.d.ts +1 -0
- package/dist/types/src/content-schema-transform.d.ts +35 -0
- package/dist/types/src/create-input-schema.d.ts +9 -0
- package/dist/types/src/enum.d.ts +2 -0
- package/dist/types/src/flatten-templates.d.ts +2 -0
- package/dist/types/src/get-is-leaf.d.ts +3 -0
- package/dist/types/src/index.d.ts +46 -0
- package/dist/types/src/interfaces.d.ts +12 -0
- package/dist/types/src/layers/layers.d.ts +26 -0
- package/dist/types/src/layers/refs.d.ts +103 -0
- package/dist/types/src/layers/type-utils.d.ts +59 -0
- package/dist/types/src/layers/visitor.d.ts +5 -0
- package/dist/types/src/migration/index.d.ts +63 -0
- package/dist/types/src/migration/to/v3.0.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.1.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.10.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.11.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.12.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.12.1.d.ts +4 -0
- package/dist/types/src/migration/to/v3.12.2.d.ts +4 -0
- package/dist/types/src/migration/to/v3.12.3.d.ts +4 -0
- package/dist/types/src/migration/to/v3.13.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.14.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.15.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.16.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.17.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.17.1.d.ts +4 -0
- package/dist/types/src/migration/to/v3.18.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.18.1.d.ts +4 -0
- package/dist/types/src/migration/to/v3.18.2.d.ts +4 -0
- package/dist/types/src/migration/to/v3.19.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.2.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.20.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.21.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.22.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.23.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.24.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.25.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.26.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.27.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.28.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.29.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.3.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.30.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.31.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.32.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.33.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.34.0.d.ts +6 -0
- package/dist/types/src/migration/to/v3.35.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.36.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.37.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.38.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.39.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.4.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.40.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.41.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.42.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.43.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.44.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.45.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.46.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.47.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.48.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.49.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.5.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.5.1.d.ts +4 -0
- package/dist/types/src/migration/to/v3.50.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.6.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.7.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.8.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.9.0.d.ts +4 -0
- package/dist/types/src/migration/types.d.ts +20 -0
- package/dist/types/src/migration/utils.d.ts +2 -0
- package/dist/types/src/mocks.d.ts +13 -0
- package/dist/types/src/models/project-schema.d.ts +35 -0
- package/dist/types/src/models/query.d.ts +17 -0
- package/dist/types/src/models/service.d.ts +12 -0
- package/dist/types/src/models/shape.d.ts +41 -0
- package/dist/types/src/patterns.d.ts +12 -0
- package/dist/types/src/project-schema/index.d.ts +184 -0
- package/dist/types/src/project-schema/latest.d.ts +2032 -0
- package/dist/types/src/project-schema/migrate.d.ts +4 -0
- package/dist/types/src/project-schema/v1.0.0.d.ts +299 -0
- package/dist/types/src/project-schema/v3.0.0.d.ts +478 -0
- package/dist/types/src/project-schema/v3.1.0.d.ts +621 -0
- package/dist/types/src/project-schema/v3.10.0.d.ts +1201 -0
- package/dist/types/src/project-schema/v3.11.0.d.ts +1210 -0
- package/dist/types/src/project-schema/v3.12.0.d.ts +1214 -0
- package/dist/types/src/project-schema/v3.12.1.d.ts +1273 -0
- package/dist/types/src/project-schema/v3.12.2.d.ts +1283 -0
- package/dist/types/src/project-schema/v3.12.3.d.ts +1306 -0
- package/dist/types/src/project-schema/v3.13.0.d.ts +1317 -0
- package/dist/types/src/project-schema/v3.13.1.d.ts +1412 -0
- package/dist/types/src/project-schema/v3.14.0.d.ts +1436 -0
- package/dist/types/src/project-schema/v3.15.0.d.ts +1458 -0
- package/dist/types/src/project-schema/v3.16.0.d.ts +1470 -0
- package/dist/types/src/project-schema/v3.17.0.d.ts +1467 -0
- package/dist/types/src/project-schema/v3.17.1.d.ts +1468 -0
- package/dist/types/src/project-schema/v3.18.0.d.ts +1333 -0
- package/dist/types/src/project-schema/v3.18.1.d.ts +1332 -0
- package/dist/types/src/project-schema/v3.18.2.d.ts +1332 -0
- package/dist/types/src/project-schema/v3.19.0.d.ts +1336 -0
- package/dist/types/src/project-schema/v3.2.0.d.ts +632 -0
- package/dist/types/src/project-schema/v3.20.0.d.ts +1336 -0
- package/dist/types/src/project-schema/v3.21.0.d.ts +1338 -0
- package/dist/types/src/project-schema/v3.22.0.d.ts +1344 -0
- package/dist/types/src/project-schema/v3.23.0.d.ts +1376 -0
- package/dist/types/src/project-schema/v3.24.0.d.ts +1364 -0
- package/dist/types/src/project-schema/v3.25.0.d.ts +1363 -0
- package/dist/types/src/project-schema/v3.26.0.d.ts +1388 -0
- package/dist/types/src/project-schema/v3.27.0.d.ts +1397 -0
- package/dist/types/src/project-schema/v3.28.0.d.ts +1416 -0
- package/dist/types/src/project-schema/v3.29.0.d.ts +1423 -0
- package/dist/types/src/project-schema/v3.3.0.d.ts +632 -0
- package/dist/types/src/project-schema/v3.30.0.d.ts +1416 -0
- package/dist/types/src/project-schema/v3.31.0.d.ts +1448 -0
- package/dist/types/src/project-schema/v3.32.0.d.ts +1439 -0
- package/dist/types/src/project-schema/v3.33.0.d.ts +1445 -0
- package/dist/types/src/project-schema/v3.34.0.d.ts +1445 -0
- package/dist/types/src/project-schema/v3.35.0.d.ts +1464 -0
- package/dist/types/src/project-schema/v3.36.0.d.ts +1470 -0
- package/dist/types/src/project-schema/v3.37.0.d.ts +1522 -0
- package/dist/types/src/project-schema/v3.38.0.d.ts +1522 -0
- package/dist/types/src/project-schema/v3.39.0.d.ts +1529 -0
- package/dist/types/src/project-schema/v3.4.0.d.ts +624 -0
- package/dist/types/src/project-schema/v3.40.0.d.ts +1530 -0
- package/dist/types/src/project-schema/v3.41.0.d.ts +1530 -0
- package/dist/types/src/project-schema/v3.42.0.d.ts +1534 -0
- package/dist/types/src/project-schema/v3.43.0.d.ts +1536 -0
- package/dist/types/src/project-schema/v3.44.0.d.ts +1621 -0
- package/dist/types/src/project-schema/v3.45.0.d.ts +1650 -0
- package/dist/types/src/project-schema/v3.46.0.d.ts +1703 -0
- package/dist/types/src/project-schema/v3.47.0.d.ts +1736 -0
- package/dist/types/src/project-schema/v3.48.0.d.ts +1989 -0
- package/dist/types/src/project-schema/v3.49.0.d.ts +1998 -0
- package/dist/types/src/project-schema/v3.5.0.d.ts +649 -0
- package/dist/types/src/project-schema/v3.5.1.d.ts +649 -0
- package/dist/types/src/project-schema/v3.50.0.d.ts +2032 -0
- package/dist/types/src/project-schema/v3.6.0.d.ts +658 -0
- package/dist/types/src/project-schema/v3.7.0.d.ts +961 -0
- package/dist/types/src/project-schema/v3.8.0.d.ts +979 -0
- package/dist/types/src/project-schema/v3.9.0.d.ts +1178 -0
- package/dist/types/src/project-schema/v4.0.0.d.ts +1328 -0
- package/dist/types/src/refs.d.ts +227 -0
- package/dist/types/src/relationships.d.ts +36 -0
- package/dist/types/src/scalars.d.ts +2 -0
- package/dist/types/src/schema-transform.d.ts +19 -0
- package/dist/types/src/schema-util.d.ts +211 -0
- package/dist/types/src/schemas/index.d.ts +6 -0
- package/dist/types/src/services/services.d.ts +31 -0
- package/dist/types/src/services/types.d.ts +11 -0
- package/dist/types/src/services/util.d.ts +16 -0
- package/dist/types/src/taxonomies.d.ts +15 -0
- package/dist/types/src/template-shapes/index.d.ts +7 -0
- package/dist/types/src/template-shapes/names.d.ts +10 -0
- package/dist/types/src/template-shapes/templates.d.ts +32 -0
- package/dist/types/src/template-shapes/types.d.ts +15 -0
- package/dist/types/src/template-shapes/where.d.ts +37 -0
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/transforms.d.ts +13 -0
- package/dist/types/src/types/types.d.ts +210 -0
- package/dist/types/src/types/utils.d.ts +117 -0
- package/dist/types/src/unions.d.ts +14 -0
- package/dist/types/src/user-schema.d.ts +38 -0
- package/dist/types/src/util/ai-tools.d.ts +3 -0
- package/dist/types/src/util/api-indexing.d.ts +9 -0
- package/dist/types/src/util/detect-cycles.d.ts +7 -0
- package/dist/types/src/util/find-shape-at-path.d.ts +21 -0
- package/dist/types/src/util/form-config.d.ts +11 -0
- package/dist/types/src/util/get-conflicting-properties.d.ts +6 -0
- package/dist/types/src/util/get-return-shape.d.ts +4 -0
- package/dist/types/src/util/has-arg.d.ts +4 -0
- package/dist/types/src/util/merge.d.ts +15 -0
- package/dist/types/src/util/patch-schema.d.ts +8 -0
- package/dist/types/src/util/shapes.d.ts +5 -0
- package/dist/types/src/validate.d.ts +70 -0
- package/dist/types/src/versions.d.ts +4 -0
- package/dist/types/src/workflows.d.ts +14 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -0
- package/package.json +47 -23
- package/dist/agents.d.ts +0 -12
- package/dist/agents.d.ts.map +0 -1
- package/dist/agents.js +0 -61
- package/dist/api-version.d.ts +0 -6
- package/dist/api-version.d.ts.map +0 -1
- package/dist/api-version.js +0 -25
- package/dist/auth-schemas.d.ts +0 -105
- package/dist/auth-schemas.d.ts.map +0 -1
- package/dist/auth-schemas.js +0 -5
- package/dist/builtin-schema.d.ts +0 -9
- package/dist/builtin-schema.d.ts.map +0 -1
- package/dist/builtin-schema.js +0 -681
- package/dist/content-schema-transform.d.ts +0 -48
- package/dist/content-schema-transform.d.ts.map +0 -1
- package/dist/content-schema-transform.js +0 -207
- package/dist/create-input-schema.d.ts +0 -10
- package/dist/create-input-schema.d.ts.map +0 -1
- package/dist/create-input-schema.js +0 -74
- package/dist/enum.d.ts +0 -3
- package/dist/enum.d.ts.map +0 -1
- package/dist/enum.js +0 -15
- package/dist/flatten-templates.d.ts +0 -3
- package/dist/flatten-templates.d.ts.map +0 -1
- package/dist/flatten-templates.js +0 -30
- package/dist/get-is-leaf.d.ts +0 -4
- package/dist/get-is-leaf.d.ts.map +0 -1
- package/dist/get-is-leaf.js +0 -58
- package/dist/index.d.ts +0 -33
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -335
- package/dist/interfaces.d.ts +0 -13
- package/dist/interfaces.d.ts.map +0 -1
- package/dist/interfaces.js +0 -99
- package/dist/layers/layers.d.ts +0 -27
- package/dist/layers/layers.d.ts.map +0 -1
- package/dist/layers/layers.js +0 -324
- package/dist/layers/refs.d.ts +0 -104
- package/dist/layers/refs.d.ts.map +0 -1
- package/dist/layers/refs.js +0 -279
- package/dist/layers/type-utils.d.ts +0 -60
- package/dist/layers/type-utils.d.ts.map +0 -1
- package/dist/layers/type-utils.js +0 -166
- package/dist/layers/visitor.d.ts +0 -6
- package/dist/layers/visitor.d.ts.map +0 -1
- package/dist/layers/visitor.js +0 -42
- package/dist/migration/index.d.ts +0 -64
- package/dist/migration/index.d.ts.map +0 -1
- package/dist/migration/index.js +0 -142
- package/dist/migration/to/utils/v3.34.0-utils.d.ts +0 -1
- package/dist/migration/to/utils/v3.34.0-utils.d.ts.map +0 -1
- package/dist/migration/to/utils/v3.34.0-utils.js +0 -1
- package/dist/migration/to/v3.0.0.d.ts +0 -5
- package/dist/migration/to/v3.0.0.d.ts.map +0 -1
- package/dist/migration/to/v3.0.0.js +0 -263
- package/dist/migration/to/v3.1.0.d.ts +0 -5
- package/dist/migration/to/v3.1.0.d.ts.map +0 -1
- package/dist/migration/to/v3.1.0.js +0 -206
- package/dist/migration/to/v3.10.0.d.ts +0 -5
- package/dist/migration/to/v3.10.0.d.ts.map +0 -1
- package/dist/migration/to/v3.10.0.js +0 -91
- package/dist/migration/to/v3.11.0.d.ts +0 -5
- package/dist/migration/to/v3.11.0.d.ts.map +0 -1
- package/dist/migration/to/v3.11.0.js +0 -97
- package/dist/migration/to/v3.12.0.d.ts +0 -5
- package/dist/migration/to/v3.12.0.d.ts.map +0 -1
- package/dist/migration/to/v3.12.0.js +0 -16
- package/dist/migration/to/v3.12.1.d.ts +0 -5
- package/dist/migration/to/v3.12.1.d.ts.map +0 -1
- package/dist/migration/to/v3.12.1.js +0 -16
- package/dist/migration/to/v3.12.2.d.ts +0 -5
- package/dist/migration/to/v3.12.2.d.ts.map +0 -1
- package/dist/migration/to/v3.12.2.js +0 -16
- package/dist/migration/to/v3.12.3.d.ts +0 -5
- package/dist/migration/to/v3.12.3.d.ts.map +0 -1
- package/dist/migration/to/v3.12.3.js +0 -83
- package/dist/migration/to/v3.13.0.d.ts +0 -5
- package/dist/migration/to/v3.13.0.d.ts.map +0 -1
- package/dist/migration/to/v3.13.0.js +0 -26
- package/dist/migration/to/v3.14.0.d.ts +0 -5
- package/dist/migration/to/v3.14.0.d.ts.map +0 -1
- package/dist/migration/to/v3.14.0.js +0 -16
- package/dist/migration/to/v3.15.0.d.ts +0 -5
- package/dist/migration/to/v3.15.0.d.ts.map +0 -1
- package/dist/migration/to/v3.15.0.js +0 -16
- package/dist/migration/to/v3.16.0.d.ts +0 -5
- package/dist/migration/to/v3.16.0.d.ts.map +0 -1
- package/dist/migration/to/v3.16.0.js +0 -16
- package/dist/migration/to/v3.17.0.d.ts +0 -5
- package/dist/migration/to/v3.17.0.d.ts.map +0 -1
- package/dist/migration/to/v3.17.0.js +0 -34
- package/dist/migration/to/v3.17.1.d.ts +0 -5
- package/dist/migration/to/v3.17.1.d.ts.map +0 -1
- package/dist/migration/to/v3.17.1.js +0 -16
- package/dist/migration/to/v3.18.0.d.ts +0 -5
- package/dist/migration/to/v3.18.0.d.ts.map +0 -1
- package/dist/migration/to/v3.18.0.js +0 -71
- package/dist/migration/to/v3.18.1.d.ts +0 -5
- package/dist/migration/to/v3.18.1.d.ts.map +0 -1
- package/dist/migration/to/v3.18.1.js +0 -22
- package/dist/migration/to/v3.18.2.d.ts +0 -5
- package/dist/migration/to/v3.18.2.d.ts.map +0 -1
- package/dist/migration/to/v3.18.2.js +0 -29
- package/dist/migration/to/v3.19.0.d.ts +0 -5
- package/dist/migration/to/v3.19.0.d.ts.map +0 -1
- package/dist/migration/to/v3.19.0.js +0 -16
- package/dist/migration/to/v3.2.0.d.ts +0 -5
- package/dist/migration/to/v3.2.0.d.ts.map +0 -1
- package/dist/migration/to/v3.2.0.js +0 -16
- package/dist/migration/to/v3.20.0.d.ts +0 -5
- package/dist/migration/to/v3.20.0.d.ts.map +0 -1
- package/dist/migration/to/v3.20.0.js +0 -32
- package/dist/migration/to/v3.21.0.d.ts +0 -5
- package/dist/migration/to/v3.21.0.d.ts.map +0 -1
- package/dist/migration/to/v3.21.0.js +0 -16
- package/dist/migration/to/v3.22.0.d.ts +0 -5
- package/dist/migration/to/v3.22.0.d.ts.map +0 -1
- package/dist/migration/to/v3.22.0.js +0 -38
- package/dist/migration/to/v3.23.0.d.ts +0 -5
- package/dist/migration/to/v3.23.0.d.ts.map +0 -1
- package/dist/migration/to/v3.23.0.js +0 -16
- package/dist/migration/to/v3.24.0.d.ts +0 -5
- package/dist/migration/to/v3.24.0.d.ts.map +0 -1
- package/dist/migration/to/v3.24.0.js +0 -22
- package/dist/migration/to/v3.25.0.d.ts +0 -5
- package/dist/migration/to/v3.25.0.d.ts.map +0 -1
- package/dist/migration/to/v3.25.0.js +0 -20
- package/dist/migration/to/v3.26.0.d.ts +0 -5
- package/dist/migration/to/v3.26.0.d.ts.map +0 -1
- package/dist/migration/to/v3.26.0.js +0 -16
- package/dist/migration/to/v3.27.0.d.ts +0 -5
- package/dist/migration/to/v3.27.0.d.ts.map +0 -1
- package/dist/migration/to/v3.27.0.js +0 -16
- package/dist/migration/to/v3.28.0.d.ts +0 -5
- package/dist/migration/to/v3.28.0.d.ts.map +0 -1
- package/dist/migration/to/v3.28.0.js +0 -16
- package/dist/migration/to/v3.29.0.d.ts +0 -5
- package/dist/migration/to/v3.29.0.d.ts.map +0 -1
- package/dist/migration/to/v3.29.0.js +0 -16
- package/dist/migration/to/v3.3.0.d.ts +0 -5
- package/dist/migration/to/v3.3.0.d.ts.map +0 -1
- package/dist/migration/to/v3.3.0.js +0 -22
- package/dist/migration/to/v3.30.0.d.ts +0 -5
- package/dist/migration/to/v3.30.0.d.ts.map +0 -1
- package/dist/migration/to/v3.30.0.js +0 -16
- package/dist/migration/to/v3.31.0.d.ts +0 -5
- package/dist/migration/to/v3.31.0.d.ts.map +0 -1
- package/dist/migration/to/v3.31.0.js +0 -42
- package/dist/migration/to/v3.32.0.d.ts +0 -5
- package/dist/migration/to/v3.32.0.d.ts.map +0 -1
- package/dist/migration/to/v3.32.0.js +0 -97
- package/dist/migration/to/v3.33.0.d.ts +0 -5
- package/dist/migration/to/v3.33.0.d.ts.map +0 -1
- package/dist/migration/to/v3.33.0.js +0 -16
- package/dist/migration/to/v3.34.0.d.ts +0 -7
- package/dist/migration/to/v3.34.0.d.ts.map +0 -1
- package/dist/migration/to/v3.34.0.js +0 -150
- package/dist/migration/to/v3.35.0.d.ts +0 -5
- package/dist/migration/to/v3.35.0.d.ts.map +0 -1
- package/dist/migration/to/v3.35.0.js +0 -16
- package/dist/migration/to/v3.36.0.d.ts +0 -5
- package/dist/migration/to/v3.36.0.d.ts.map +0 -1
- package/dist/migration/to/v3.36.0.js +0 -29
- package/dist/migration/to/v3.37.0.d.ts +0 -5
- package/dist/migration/to/v3.37.0.d.ts.map +0 -1
- package/dist/migration/to/v3.37.0.js +0 -16
- package/dist/migration/to/v3.38.0.d.ts +0 -5
- package/dist/migration/to/v3.38.0.d.ts.map +0 -1
- package/dist/migration/to/v3.38.0.js +0 -16
- package/dist/migration/to/v3.39.0.d.ts +0 -5
- package/dist/migration/to/v3.39.0.d.ts.map +0 -1
- package/dist/migration/to/v3.39.0.js +0 -54
- package/dist/migration/to/v3.4.0.d.ts +0 -5
- package/dist/migration/to/v3.4.0.d.ts.map +0 -1
- package/dist/migration/to/v3.4.0.js +0 -16
- package/dist/migration/to/v3.40.0.d.ts +0 -5
- package/dist/migration/to/v3.40.0.d.ts.map +0 -1
- package/dist/migration/to/v3.40.0.js +0 -33
- package/dist/migration/to/v3.41.0.d.ts +0 -5
- package/dist/migration/to/v3.41.0.d.ts.map +0 -1
- package/dist/migration/to/v3.41.0.js +0 -16
- package/dist/migration/to/v3.42.0.d.ts +0 -5
- package/dist/migration/to/v3.42.0.d.ts.map +0 -1
- package/dist/migration/to/v3.42.0.js +0 -16
- package/dist/migration/to/v3.43.0.d.ts +0 -5
- package/dist/migration/to/v3.43.0.d.ts.map +0 -1
- package/dist/migration/to/v3.43.0.js +0 -16
- package/dist/migration/to/v3.44.0.d.ts +0 -5
- package/dist/migration/to/v3.44.0.d.ts.map +0 -1
- package/dist/migration/to/v3.44.0.js +0 -16
- package/dist/migration/to/v3.45.0.d.ts +0 -5
- package/dist/migration/to/v3.45.0.d.ts.map +0 -1
- package/dist/migration/to/v3.45.0.js +0 -16
- package/dist/migration/to/v3.46.0.d.ts +0 -5
- package/dist/migration/to/v3.46.0.d.ts.map +0 -1
- package/dist/migration/to/v3.46.0.js +0 -37
- package/dist/migration/to/v3.47.0.d.ts +0 -5
- package/dist/migration/to/v3.47.0.d.ts.map +0 -1
- package/dist/migration/to/v3.47.0.js +0 -16
- package/dist/migration/to/v3.48.0.d.ts +0 -5
- package/dist/migration/to/v3.48.0.d.ts.map +0 -1
- package/dist/migration/to/v3.48.0.js +0 -16
- package/dist/migration/to/v3.49.0.d.ts +0 -5
- package/dist/migration/to/v3.49.0.d.ts.map +0 -1
- package/dist/migration/to/v3.49.0.js +0 -16
- package/dist/migration/to/v3.5.0.d.ts +0 -5
- package/dist/migration/to/v3.5.0.d.ts.map +0 -1
- package/dist/migration/to/v3.5.0.js +0 -16
- package/dist/migration/to/v3.5.1.d.ts +0 -5
- package/dist/migration/to/v3.5.1.d.ts.map +0 -1
- package/dist/migration/to/v3.5.1.js +0 -16
- package/dist/migration/to/v3.50.0.d.ts +0 -5
- package/dist/migration/to/v3.50.0.d.ts.map +0 -1
- package/dist/migration/to/v3.50.0.js +0 -16
- package/dist/migration/to/v3.6.0.d.ts +0 -5
- package/dist/migration/to/v3.6.0.d.ts.map +0 -1
- package/dist/migration/to/v3.6.0.js +0 -16
- package/dist/migration/to/v3.7.0.d.ts +0 -5
- package/dist/migration/to/v3.7.0.d.ts.map +0 -1
- package/dist/migration/to/v3.7.0.js +0 -16
- package/dist/migration/to/v3.8.0.d.ts +0 -5
- package/dist/migration/to/v3.8.0.d.ts.map +0 -1
- package/dist/migration/to/v3.8.0.js +0 -16
- package/dist/migration/to/v3.9.0.d.ts +0 -5
- package/dist/migration/to/v3.9.0.d.ts.map +0 -1
- package/dist/migration/to/v3.9.0.js +0 -84
- package/dist/migration/types.d.ts +0 -21
- package/dist/migration/types.d.ts.map +0 -1
- package/dist/migration/types.js +0 -5
- package/dist/migration/utils.d.ts +0 -3
- package/dist/migration/utils.d.ts.map +0 -1
- package/dist/migration/utils.js +0 -13
- package/dist/mocks.d.ts +0 -14
- package/dist/mocks.d.ts.map +0 -1
- package/dist/mocks.js +0 -71
- package/dist/models/project-schema.d.ts +0 -36
- package/dist/models/project-schema.d.ts.map +0 -1
- package/dist/models/project-schema.js +0 -98
- package/dist/models/query.d.ts +0 -18
- package/dist/models/query.d.ts.map +0 -1
- package/dist/models/query.js +0 -35
- package/dist/models/service.d.ts +0 -13
- package/dist/models/service.d.ts.map +0 -1
- package/dist/models/service.js +0 -25
- package/dist/models/shape.d.ts +0 -42
- package/dist/models/shape.d.ts.map +0 -1
- package/dist/models/shape.js +0 -86
- package/dist/patterns.d.ts +0 -13
- package/dist/patterns.d.ts.map +0 -1
- package/dist/patterns.js +0 -5
- package/dist/project-schema/index.d.ts +0 -185
- package/dist/project-schema/index.d.ts.map +0 -1
- package/dist/project-schema/index.js +0 -879
- package/dist/project-schema/latest.d.ts +0 -2033
- package/dist/project-schema/latest.d.ts.map +0 -1
- package/dist/project-schema/latest.js +0 -5
- package/dist/project-schema/migrate.d.ts +0 -5
- package/dist/project-schema/migrate.d.ts.map +0 -1
- package/dist/project-schema/migrate.js +0 -201
- package/dist/project-schema/v1.0.0.d.ts +0 -300
- package/dist/project-schema/v1.0.0.d.ts.map +0 -1
- package/dist/project-schema/v1.0.0.js +0 -5
- package/dist/project-schema/v3.0.0.d.ts +0 -479
- package/dist/project-schema/v3.0.0.d.ts.map +0 -1
- package/dist/project-schema/v3.0.0.js +0 -5
- package/dist/project-schema/v3.1.0.d.ts +0 -622
- package/dist/project-schema/v3.1.0.d.ts.map +0 -1
- package/dist/project-schema/v3.1.0.js +0 -5
- package/dist/project-schema/v3.10.0.d.ts +0 -1202
- package/dist/project-schema/v3.10.0.d.ts.map +0 -1
- package/dist/project-schema/v3.10.0.js +0 -5
- package/dist/project-schema/v3.11.0.d.ts +0 -1211
- package/dist/project-schema/v3.11.0.d.ts.map +0 -1
- package/dist/project-schema/v3.11.0.js +0 -5
- package/dist/project-schema/v3.12.0.d.ts +0 -1215
- package/dist/project-schema/v3.12.0.d.ts.map +0 -1
- package/dist/project-schema/v3.12.0.js +0 -5
- package/dist/project-schema/v3.12.1.d.ts +0 -1274
- package/dist/project-schema/v3.12.1.d.ts.map +0 -1
- package/dist/project-schema/v3.12.1.js +0 -5
- package/dist/project-schema/v3.12.2.d.ts +0 -1284
- package/dist/project-schema/v3.12.2.d.ts.map +0 -1
- package/dist/project-schema/v3.12.2.js +0 -5
- package/dist/project-schema/v3.12.3.d.ts +0 -1307
- package/dist/project-schema/v3.12.3.d.ts.map +0 -1
- package/dist/project-schema/v3.12.3.js +0 -5
- package/dist/project-schema/v3.13.0.d.ts +0 -1318
- package/dist/project-schema/v3.13.0.d.ts.map +0 -1
- package/dist/project-schema/v3.13.0.js +0 -5
- package/dist/project-schema/v3.13.1.d.ts +0 -1413
- package/dist/project-schema/v3.13.1.d.ts.map +0 -1
- package/dist/project-schema/v3.13.1.js +0 -5
- package/dist/project-schema/v3.14.0.d.ts +0 -1437
- package/dist/project-schema/v3.14.0.d.ts.map +0 -1
- package/dist/project-schema/v3.14.0.js +0 -5
- package/dist/project-schema/v3.15.0.d.ts +0 -1459
- package/dist/project-schema/v3.15.0.d.ts.map +0 -1
- package/dist/project-schema/v3.15.0.js +0 -5
- package/dist/project-schema/v3.16.0.d.ts +0 -1471
- package/dist/project-schema/v3.16.0.d.ts.map +0 -1
- package/dist/project-schema/v3.16.0.js +0 -5
- package/dist/project-schema/v3.17.0.d.ts +0 -1468
- package/dist/project-schema/v3.17.0.d.ts.map +0 -1
- package/dist/project-schema/v3.17.0.js +0 -5
- package/dist/project-schema/v3.17.1.d.ts +0 -1469
- package/dist/project-schema/v3.17.1.d.ts.map +0 -1
- package/dist/project-schema/v3.17.1.js +0 -5
- package/dist/project-schema/v3.18.0.d.ts +0 -1334
- package/dist/project-schema/v3.18.0.d.ts.map +0 -1
- package/dist/project-schema/v3.18.0.js +0 -5
- package/dist/project-schema/v3.18.1.d.ts +0 -1333
- package/dist/project-schema/v3.18.1.d.ts.map +0 -1
- package/dist/project-schema/v3.18.1.js +0 -5
- package/dist/project-schema/v3.18.2.d.ts +0 -1333
- package/dist/project-schema/v3.18.2.d.ts.map +0 -1
- package/dist/project-schema/v3.18.2.js +0 -5
- package/dist/project-schema/v3.19.0.d.ts +0 -1337
- package/dist/project-schema/v3.19.0.d.ts.map +0 -1
- package/dist/project-schema/v3.19.0.js +0 -5
- package/dist/project-schema/v3.2.0.d.ts +0 -633
- package/dist/project-schema/v3.2.0.d.ts.map +0 -1
- package/dist/project-schema/v3.2.0.js +0 -5
- package/dist/project-schema/v3.20.0.d.ts +0 -1337
- package/dist/project-schema/v3.20.0.d.ts.map +0 -1
- package/dist/project-schema/v3.20.0.js +0 -5
- package/dist/project-schema/v3.21.0.d.ts +0 -1339
- package/dist/project-schema/v3.21.0.d.ts.map +0 -1
- package/dist/project-schema/v3.21.0.js +0 -5
- package/dist/project-schema/v3.22.0.d.ts +0 -1345
- package/dist/project-schema/v3.22.0.d.ts.map +0 -1
- package/dist/project-schema/v3.22.0.js +0 -5
- package/dist/project-schema/v3.23.0.d.ts +0 -1377
- package/dist/project-schema/v3.23.0.d.ts.map +0 -1
- package/dist/project-schema/v3.23.0.js +0 -5
- package/dist/project-schema/v3.24.0.d.ts +0 -1365
- package/dist/project-schema/v3.24.0.d.ts.map +0 -1
- package/dist/project-schema/v3.24.0.js +0 -5
- package/dist/project-schema/v3.25.0.d.ts +0 -1364
- package/dist/project-schema/v3.25.0.d.ts.map +0 -1
- package/dist/project-schema/v3.25.0.js +0 -5
- package/dist/project-schema/v3.26.0.d.ts +0 -1389
- package/dist/project-schema/v3.26.0.d.ts.map +0 -1
- package/dist/project-schema/v3.26.0.js +0 -5
- package/dist/project-schema/v3.27.0.d.ts +0 -1398
- package/dist/project-schema/v3.27.0.d.ts.map +0 -1
- package/dist/project-schema/v3.27.0.js +0 -5
- package/dist/project-schema/v3.28.0.d.ts +0 -1417
- package/dist/project-schema/v3.28.0.d.ts.map +0 -1
- package/dist/project-schema/v3.28.0.js +0 -5
- package/dist/project-schema/v3.29.0.d.ts +0 -1424
- package/dist/project-schema/v3.29.0.d.ts.map +0 -1
- package/dist/project-schema/v3.29.0.js +0 -5
- package/dist/project-schema/v3.3.0.d.ts +0 -633
- package/dist/project-schema/v3.3.0.d.ts.map +0 -1
- package/dist/project-schema/v3.3.0.js +0 -5
- package/dist/project-schema/v3.30.0.d.ts +0 -1417
- package/dist/project-schema/v3.30.0.d.ts.map +0 -1
- package/dist/project-schema/v3.30.0.js +0 -5
- package/dist/project-schema/v3.31.0.d.ts +0 -1449
- package/dist/project-schema/v3.31.0.d.ts.map +0 -1
- package/dist/project-schema/v3.31.0.js +0 -5
- package/dist/project-schema/v3.32.0.d.ts +0 -1440
- package/dist/project-schema/v3.32.0.d.ts.map +0 -1
- package/dist/project-schema/v3.32.0.js +0 -5
- package/dist/project-schema/v3.33.0.d.ts +0 -1446
- package/dist/project-schema/v3.33.0.d.ts.map +0 -1
- package/dist/project-schema/v3.33.0.js +0 -5
- package/dist/project-schema/v3.34.0.d.ts +0 -1446
- package/dist/project-schema/v3.34.0.d.ts.map +0 -1
- package/dist/project-schema/v3.34.0.js +0 -5
- package/dist/project-schema/v3.35.0.d.ts +0 -1465
- package/dist/project-schema/v3.35.0.d.ts.map +0 -1
- package/dist/project-schema/v3.35.0.js +0 -5
- package/dist/project-schema/v3.36.0.d.ts +0 -1471
- package/dist/project-schema/v3.36.0.d.ts.map +0 -1
- package/dist/project-schema/v3.36.0.js +0 -5
- package/dist/project-schema/v3.37.0.d.ts +0 -1523
- package/dist/project-schema/v3.37.0.d.ts.map +0 -1
- package/dist/project-schema/v3.37.0.js +0 -5
- package/dist/project-schema/v3.38.0.d.ts +0 -1523
- package/dist/project-schema/v3.38.0.d.ts.map +0 -1
- package/dist/project-schema/v3.38.0.js +0 -5
- package/dist/project-schema/v3.39.0.d.ts +0 -1530
- package/dist/project-schema/v3.39.0.d.ts.map +0 -1
- package/dist/project-schema/v3.39.0.js +0 -5
- package/dist/project-schema/v3.4.0.d.ts +0 -625
- package/dist/project-schema/v3.4.0.d.ts.map +0 -1
- package/dist/project-schema/v3.4.0.js +0 -5
- package/dist/project-schema/v3.40.0.d.ts +0 -1531
- package/dist/project-schema/v3.40.0.d.ts.map +0 -1
- package/dist/project-schema/v3.40.0.js +0 -5
- package/dist/project-schema/v3.41.0.d.ts +0 -1531
- package/dist/project-schema/v3.41.0.d.ts.map +0 -1
- package/dist/project-schema/v3.41.0.js +0 -5
- package/dist/project-schema/v3.42.0.d.ts +0 -1535
- package/dist/project-schema/v3.42.0.d.ts.map +0 -1
- package/dist/project-schema/v3.42.0.js +0 -5
- package/dist/project-schema/v3.43.0.d.ts +0 -1537
- package/dist/project-schema/v3.43.0.d.ts.map +0 -1
- package/dist/project-schema/v3.43.0.js +0 -5
- package/dist/project-schema/v3.44.0.d.ts +0 -1622
- package/dist/project-schema/v3.44.0.d.ts.map +0 -1
- package/dist/project-schema/v3.44.0.js +0 -5
- package/dist/project-schema/v3.45.0.d.ts +0 -1651
- package/dist/project-schema/v3.45.0.d.ts.map +0 -1
- package/dist/project-schema/v3.45.0.js +0 -5
- package/dist/project-schema/v3.46.0.d.ts +0 -1704
- package/dist/project-schema/v3.46.0.d.ts.map +0 -1
- package/dist/project-schema/v3.46.0.js +0 -5
- package/dist/project-schema/v3.47.0.d.ts +0 -1737
- package/dist/project-schema/v3.47.0.d.ts.map +0 -1
- package/dist/project-schema/v3.47.0.js +0 -5
- package/dist/project-schema/v3.48.0.d.ts +0 -1990
- package/dist/project-schema/v3.48.0.d.ts.map +0 -1
- package/dist/project-schema/v3.48.0.js +0 -5
- package/dist/project-schema/v3.49.0.d.ts +0 -1999
- package/dist/project-schema/v3.49.0.d.ts.map +0 -1
- package/dist/project-schema/v3.49.0.js +0 -5
- package/dist/project-schema/v3.5.0.d.ts +0 -650
- package/dist/project-schema/v3.5.0.d.ts.map +0 -1
- package/dist/project-schema/v3.5.0.js +0 -5
- package/dist/project-schema/v3.5.1.d.ts +0 -650
- package/dist/project-schema/v3.5.1.d.ts.map +0 -1
- package/dist/project-schema/v3.5.1.js +0 -5
- package/dist/project-schema/v3.50.0.d.ts +0 -2033
- package/dist/project-schema/v3.50.0.d.ts.map +0 -1
- package/dist/project-schema/v3.50.0.js +0 -5
- package/dist/project-schema/v3.6.0.d.ts +0 -659
- package/dist/project-schema/v3.6.0.d.ts.map +0 -1
- package/dist/project-schema/v3.6.0.js +0 -5
- package/dist/project-schema/v3.7.0.d.ts +0 -962
- package/dist/project-schema/v3.7.0.d.ts.map +0 -1
- package/dist/project-schema/v3.7.0.js +0 -5
- package/dist/project-schema/v3.8.0.d.ts +0 -980
- package/dist/project-schema/v3.8.0.d.ts.map +0 -1
- package/dist/project-schema/v3.8.0.js +0 -5
- package/dist/project-schema/v3.9.0.d.ts +0 -1179
- package/dist/project-schema/v3.9.0.d.ts.map +0 -1
- package/dist/project-schema/v3.9.0.js +0 -5
- package/dist/project-schema/v4.0.0.d.ts +0 -1329
- package/dist/project-schema/v4.0.0.d.ts.map +0 -1
- package/dist/project-schema/v4.0.0.js +0 -5
- package/dist/refs.d.ts +0 -228
- package/dist/refs.d.ts.map +0 -1
- package/dist/refs.js +0 -754
- package/dist/relationships.d.ts +0 -37
- package/dist/relationships.d.ts.map +0 -1
- package/dist/relationships.js +0 -243
- package/dist/scalars.d.ts +0 -3
- package/dist/scalars.d.ts.map +0 -1
- package/dist/scalars.js +0 -11
- package/dist/schema-transform.d.ts +0 -4
- package/dist/schema-transform.d.ts.map +0 -1
- package/dist/schema-transform.js +0 -47
- package/dist/schema-util.d.ts +0 -220
- package/dist/schema-util.d.ts.map +0 -1
- package/dist/schema-util.js +0 -1247
- package/dist/schemas/index.d.ts +0 -5
- package/dist/schemas/index.d.ts.map +0 -1
- package/dist/schemas/index.js +0 -96
- package/dist/schemas/index.ts +0 -152
- package/dist/services.d.ts +0 -55
- package/dist/services.d.ts.map +0 -1
- package/dist/services.js +0 -168
- package/dist/taxonomies.d.ts +0 -16
- package/dist/taxonomies.d.ts.map +0 -1
- package/dist/taxonomies.js +0 -41
- package/dist/template-shapes/index.d.ts +0 -8
- package/dist/template-shapes/index.d.ts.map +0 -1
- package/dist/template-shapes/index.js +0 -43
- package/dist/template-shapes/templates.d.ts +0 -42
- package/dist/template-shapes/templates.d.ts.map +0 -1
- package/dist/template-shapes/templates.js +0 -423
- package/dist/template-shapes/types.d.ts +0 -16
- package/dist/template-shapes/types.d.ts.map +0 -1
- package/dist/template-shapes/types.js +0 -13
- package/dist/template-shapes/where.d.ts +0 -38
- package/dist/template-shapes/where.d.ts.map +0 -1
- package/dist/template-shapes/where.js +0 -472
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -27
- package/dist/types/types.d.ts +0 -211
- package/dist/types/types.d.ts.map +0 -1
- package/dist/types/types.js +0 -60
- package/dist/types/utils.d.ts +0 -116
- package/dist/types/utils.d.ts.map +0 -1
- package/dist/types/utils.js +0 -364
- package/dist/unions.d.ts +0 -28
- package/dist/unions.d.ts.map +0 -1
- package/dist/unions.js +0 -137
- package/dist/user-schema.d.ts +0 -39
- package/dist/user-schema.d.ts.map +0 -1
- package/dist/user-schema.js +0 -5
- package/dist/util/ai-tools.d.ts +0 -4
- package/dist/util/ai-tools.d.ts.map +0 -1
- package/dist/util/ai-tools.js +0 -15
- package/dist/util/api-indexing.d.ts +0 -10
- package/dist/util/api-indexing.d.ts.map +0 -1
- package/dist/util/api-indexing.js +0 -75
- package/dist/util/detect-cycles.d.ts +0 -8
- package/dist/util/detect-cycles.d.ts.map +0 -1
- package/dist/util/detect-cycles.js +0 -54
- package/dist/util/find-shape-at-path.d.ts +0 -22
- package/dist/util/find-shape-at-path.d.ts.map +0 -1
- package/dist/util/find-shape-at-path.js +0 -61
- package/dist/util/form-config.d.ts +0 -12
- package/dist/util/form-config.d.ts.map +0 -1
- package/dist/util/form-config.js +0 -79
- package/dist/util/get-conflicting-properties.d.ts +0 -7
- package/dist/util/get-conflicting-properties.d.ts.map +0 -1
- package/dist/util/get-conflicting-properties.js +0 -59
- package/dist/util/get-return-shape.d.ts +0 -5
- package/dist/util/get-return-shape.d.ts.map +0 -1
- package/dist/util/get-return-shape.js +0 -38
- package/dist/util/has-arg.d.ts +0 -5
- package/dist/util/has-arg.d.ts.map +0 -1
- package/dist/util/has-arg.js +0 -20
- package/dist/util/index.d.ts +0 -11
- package/dist/util/index.d.ts.map +0 -1
- package/dist/util/index.js +0 -115
- package/dist/util/merge.d.ts +0 -16
- package/dist/util/merge.d.ts.map +0 -1
- package/dist/util/merge.js +0 -307
- package/dist/util/patch-schema.d.ts +0 -9
- package/dist/util/patch-schema.d.ts.map +0 -1
- package/dist/util/patch-schema.js +0 -52
- package/dist/validate.d.ts +0 -71
- package/dist/validate.d.ts.map +0 -1
- package/dist/validate.js +0 -1117
- package/dist/versions.d.ts +0 -5
- package/dist/versions.d.ts.map +0 -1
- package/dist/versions.js +0 -17
- package/dist/workflows.d.ts +0 -15
- package/dist/workflows.d.ts.map +0 -1
- package/dist/workflows.js +0 -81
- package/es/agents.js +0 -51
- package/es/api-version.js +0 -17
- package/es/auth-schemas.js +0 -1
- package/es/builtin-schema.js +0 -671
- package/es/content-schema-transform.js +0 -192
- package/es/create-input-schema.js +0 -67
- package/es/enum.js +0 -9
- package/es/flatten-templates.js +0 -23
- package/es/get-is-leaf.js +0 -52
- package/es/index.js +0 -33
- package/es/interfaces.js +0 -85
- package/es/layers/layers.js +0 -311
- package/es/layers/refs.js +0 -256
- package/es/layers/type-utils.js +0 -138
- package/es/layers/visitor.js +0 -35
- package/es/migration/index.js +0 -120
- package/es/migration/to/utils/v3.34.0-utils.js +0 -0
- package/es/migration/to/v3.0.0.js +0 -256
- package/es/migration/to/v3.1.0.js +0 -200
- package/es/migration/to/v3.10.0.js +0 -84
- package/es/migration/to/v3.11.0.js +0 -90
- package/es/migration/to/v3.12.0.js +0 -10
- package/es/migration/to/v3.12.1.js +0 -10
- package/es/migration/to/v3.12.2.js +0 -10
- package/es/migration/to/v3.12.3.js +0 -76
- package/es/migration/to/v3.13.0.js +0 -19
- package/es/migration/to/v3.14.0.js +0 -10
- package/es/migration/to/v3.15.0.js +0 -10
- package/es/migration/to/v3.16.0.js +0 -10
- package/es/migration/to/v3.17.0.js +0 -27
- package/es/migration/to/v3.17.1.js +0 -10
- package/es/migration/to/v3.18.0.js +0 -64
- package/es/migration/to/v3.18.1.js +0 -15
- package/es/migration/to/v3.18.2.js +0 -22
- package/es/migration/to/v3.19.0.js +0 -10
- package/es/migration/to/v3.2.0.js +0 -10
- package/es/migration/to/v3.20.0.js +0 -25
- package/es/migration/to/v3.21.0.js +0 -10
- package/es/migration/to/v3.22.0.js +0 -31
- package/es/migration/to/v3.23.0.js +0 -10
- package/es/migration/to/v3.24.0.js +0 -16
- package/es/migration/to/v3.25.0.js +0 -14
- package/es/migration/to/v3.26.0.js +0 -10
- package/es/migration/to/v3.27.0.js +0 -10
- package/es/migration/to/v3.28.0.js +0 -10
- package/es/migration/to/v3.29.0.js +0 -10
- package/es/migration/to/v3.3.0.js +0 -16
- package/es/migration/to/v3.30.0.js +0 -10
- package/es/migration/to/v3.31.0.js +0 -35
- package/es/migration/to/v3.32.0.js +0 -91
- package/es/migration/to/v3.33.0.js +0 -10
- package/es/migration/to/v3.34.0.js +0 -142
- package/es/migration/to/v3.35.0.js +0 -10
- package/es/migration/to/v3.36.0.js +0 -22
- package/es/migration/to/v3.37.0.js +0 -10
- package/es/migration/to/v3.38.0.js +0 -10
- package/es/migration/to/v3.39.0.js +0 -48
- package/es/migration/to/v3.4.0.js +0 -10
- package/es/migration/to/v3.40.0.js +0 -26
- package/es/migration/to/v3.41.0.js +0 -10
- package/es/migration/to/v3.42.0.js +0 -10
- package/es/migration/to/v3.43.0.js +0 -10
- package/es/migration/to/v3.44.0.js +0 -10
- package/es/migration/to/v3.45.0.js +0 -10
- package/es/migration/to/v3.46.0.js +0 -31
- package/es/migration/to/v3.47.0.js +0 -10
- package/es/migration/to/v3.48.0.js +0 -10
- package/es/migration/to/v3.49.0.js +0 -10
- package/es/migration/to/v3.5.0.js +0 -10
- package/es/migration/to/v3.5.1.js +0 -10
- package/es/migration/to/v3.50.0.js +0 -10
- package/es/migration/to/v3.6.0.js +0 -10
- package/es/migration/to/v3.7.0.js +0 -10
- package/es/migration/to/v3.8.0.js +0 -10
- package/es/migration/to/v3.9.0.js +0 -77
- package/es/migration/types.js +0 -1
- package/es/migration/utils.js +0 -6
- package/es/mocks.js +0 -62
- package/es/models/project-schema.js +0 -90
- package/es/models/query.js +0 -28
- package/es/models/service.js +0 -18
- package/es/models/shape.js +0 -79
- package/es/patterns.js +0 -1
- package/es/project-schema/index.js +0 -138
- package/es/project-schema/latest.js +0 -1
- package/es/project-schema/migrate.js +0 -195
- package/es/project-schema/v1.0.0.js +0 -1
- package/es/project-schema/v3.0.0.js +0 -1
- package/es/project-schema/v3.1.0.js +0 -1
- package/es/project-schema/v3.10.0.js +0 -1
- package/es/project-schema/v3.11.0.js +0 -1
- package/es/project-schema/v3.12.0.js +0 -1
- package/es/project-schema/v3.12.1.js +0 -1
- package/es/project-schema/v3.12.2.js +0 -1
- package/es/project-schema/v3.12.3.js +0 -1
- package/es/project-schema/v3.13.0.js +0 -1
- package/es/project-schema/v3.13.1.js +0 -1
- package/es/project-schema/v3.14.0.js +0 -1
- package/es/project-schema/v3.15.0.js +0 -1
- package/es/project-schema/v3.16.0.js +0 -1
- package/es/project-schema/v3.17.0.js +0 -1
- package/es/project-schema/v3.17.1.js +0 -1
- package/es/project-schema/v3.18.0.js +0 -1
- package/es/project-schema/v3.18.1.js +0 -1
- package/es/project-schema/v3.18.2.js +0 -1
- package/es/project-schema/v3.19.0.js +0 -1
- package/es/project-schema/v3.2.0.js +0 -1
- package/es/project-schema/v3.20.0.js +0 -1
- package/es/project-schema/v3.21.0.js +0 -1
- package/es/project-schema/v3.22.0.js +0 -1
- package/es/project-schema/v3.23.0.js +0 -1
- package/es/project-schema/v3.24.0.js +0 -1
- package/es/project-schema/v3.25.0.js +0 -1
- package/es/project-schema/v3.26.0.js +0 -1
- package/es/project-schema/v3.27.0.js +0 -1
- package/es/project-schema/v3.28.0.js +0 -1
- package/es/project-schema/v3.29.0.js +0 -1
- package/es/project-schema/v3.3.0.js +0 -1
- package/es/project-schema/v3.30.0.js +0 -1
- package/es/project-schema/v3.31.0.js +0 -1
- package/es/project-schema/v3.32.0.js +0 -1
- package/es/project-schema/v3.33.0.js +0 -1
- package/es/project-schema/v3.34.0.js +0 -1
- package/es/project-schema/v3.35.0.js +0 -1
- package/es/project-schema/v3.36.0.js +0 -1
- package/es/project-schema/v3.37.0.js +0 -1
- package/es/project-schema/v3.38.0.js +0 -1
- package/es/project-schema/v3.39.0.js +0 -1
- package/es/project-schema/v3.4.0.js +0 -1
- package/es/project-schema/v3.40.0.js +0 -1
- package/es/project-schema/v3.41.0.js +0 -1
- package/es/project-schema/v3.42.0.js +0 -1
- package/es/project-schema/v3.43.0.js +0 -1
- package/es/project-schema/v3.44.0.js +0 -1
- package/es/project-schema/v3.45.0.js +0 -1
- package/es/project-schema/v3.46.0.js +0 -1
- package/es/project-schema/v3.47.0.js +0 -1
- package/es/project-schema/v3.48.0.js +0 -1
- package/es/project-schema/v3.49.0.js +0 -1
- package/es/project-schema/v3.5.0.js +0 -1
- package/es/project-schema/v3.5.1.js +0 -1
- package/es/project-schema/v3.50.0.js +0 -1
- package/es/project-schema/v3.6.0.js +0 -1
- package/es/project-schema/v3.7.0.js +0 -1
- package/es/project-schema/v3.8.0.js +0 -1
- package/es/project-schema/v3.9.0.js +0 -1
- package/es/project-schema/v4.0.0.js +0 -1
- package/es/refs.js +0 -690
- package/es/relationships.js +0 -229
- package/es/scalars.js +0 -4
- package/es/schema-transform.js +0 -40
- package/es/schema-util.js +0 -1166
- package/es/schemas/index.js +0 -78
- package/es/schemas/index.ts +0 -152
- package/es/services.js +0 -154
- package/es/taxonomies.js +0 -34
- package/es/template-shapes/index.js +0 -36
- package/es/template-shapes/templates.js +0 -406
- package/es/template-shapes/types.js +0 -7
- package/es/template-shapes/where.js +0 -459
- package/es/types/index.js +0 -2
- package/es/types/types.js +0 -62
- package/es/types/utils.js +0 -298
- package/es/unions.js +0 -123
- package/es/user-schema.js +0 -1
- package/es/util/ai-tools.js +0 -8
- package/es/util/api-indexing.js +0 -66
- package/es/util/detect-cycles.js +0 -48
- package/es/util/find-shape-at-path.js +0 -55
- package/es/util/form-config.js +0 -73
- package/es/util/get-conflicting-properties.js +0 -54
- package/es/util/get-return-shape.js +0 -31
- package/es/util/has-arg.js +0 -13
- package/es/util/index.js +0 -10
- package/es/util/merge.js +0 -293
- package/es/util/patch-schema.js +0 -44
- package/es/validate.js +0 -1102
- package/es/versions.js +0 -4
- package/es/workflows.js +0 -68
- /package/dist/{schemas → cjs/src/schemas}/auth-schemas.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/experimental.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/latest.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v1.0.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.0.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.1.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.2.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.3.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.4.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.5.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.5.1.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.6.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.7.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.8.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.9.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v1.0.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.0.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.1.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.10.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.11.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.12.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.12.1.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.12.2.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.12.3.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.13.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.14.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.15.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.16.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.17.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.17.1.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.18.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.18.1.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.18.2.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.19.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.2.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.20.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.21.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.22.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.23.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.24.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.25.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.26.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.27.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.28.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.29.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.3.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.30.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.31.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.32.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.33.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.34.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.35.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.36.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.37.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.38.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.39.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.4.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.40.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.41.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.42.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.43.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.44.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.45.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.46.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.47.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.48.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.49.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.5.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.5.1.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.50.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.6.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.7.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.8.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.9.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v4.0.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/user-schema.json +0 -0
- /package/{es → dist/esm/src}/schemas/auth-schemas.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/experimental.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/latest.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v1.0.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.0.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.1.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.2.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.3.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.4.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.5.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.5.1.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.6.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.7.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.8.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.9.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v1.0.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.0.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.1.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.10.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.11.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.12.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.12.1.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.12.2.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.12.3.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.13.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.14.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.15.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.16.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.17.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.17.1.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.18.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.18.1.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.18.2.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.19.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.2.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.20.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.21.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.22.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.23.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.24.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.25.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.26.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.27.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.28.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.29.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.3.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.30.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.31.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.32.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.33.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.34.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.35.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.36.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.37.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.38.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.39.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.4.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.40.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.41.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.42.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.43.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.44.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.45.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.46.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.47.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.48.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.49.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.5.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.5.1.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.50.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.6.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.7.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.8.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.9.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v4.0.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema.json +0 -0
- /package/{es → dist/esm/src}/schemas/user-schema.json +0 -0
package/dist/validate.js
DELETED
|
@@ -1,1117 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.builtInShapeNames = void 0;
|
|
7
|
-
exports.ensureValidLatestSchemaSyntax = ensureValidLatestSchemaSyntax;
|
|
8
|
-
exports.ensureValidProjectSchemaImport = ensureValidProjectSchemaImport;
|
|
9
|
-
exports.ensureValidRoleImport = ensureValidRoleImport;
|
|
10
|
-
exports.formatError = formatError;
|
|
11
|
-
exports.validateProjectSchemaImport = validateProjectSchemaImport;
|
|
12
|
-
exports.validateRoleInput = validateRoleInput;
|
|
13
|
-
exports.validateSchema = validateSchema;
|
|
14
|
-
exports.validateSchemaSyntax = validateSchemaSyntax;
|
|
15
|
-
var _jsonpathPlus = require("jsonpath-plus");
|
|
16
|
-
var _jsonSchema = require("@takeshape/json-schema");
|
|
17
|
-
var _errors = require("@takeshape/errors");
|
|
18
|
-
var _coerce = _interopRequireDefault(require("semver/functions/coerce"));
|
|
19
|
-
var _neq = _interopRequireDefault(require("semver/functions/neq"));
|
|
20
|
-
var _lt = _interopRequireDefault(require("semver/functions/lt"));
|
|
21
|
-
var _gte = _interopRequireDefault(require("semver/functions/gte"));
|
|
22
|
-
var _isUndefined = _interopRequireDefault(require("lodash/isUndefined"));
|
|
23
|
-
var _util = require("@takeshape/util");
|
|
24
|
-
var _uniqBy = _interopRequireDefault(require("lodash/uniqBy"));
|
|
25
|
-
var _initial = _interopRequireDefault(require("lodash/initial"));
|
|
26
|
-
var _last = _interopRequireDefault(require("lodash/last"));
|
|
27
|
-
var _get = _interopRequireDefault(require("lodash/get"));
|
|
28
|
-
var _size = _interopRequireDefault(require("lodash/size"));
|
|
29
|
-
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
30
|
-
var _pick = _interopRequireDefault(require("lodash/pick"));
|
|
31
|
-
var _pMap = _interopRequireDefault(require("p-map"));
|
|
32
|
-
var _lodash = require("lodash");
|
|
33
|
-
var _versions = require("./versions");
|
|
34
|
-
var _workflows = require("./workflows");
|
|
35
|
-
var _schemas = require("./schemas");
|
|
36
|
-
var _authSchemas = _interopRequireDefault(require("./schemas/auth-schemas.json"));
|
|
37
|
-
var _schemaUtil = require("./schema-util");
|
|
38
|
-
var _builtinSchema = require("./builtin-schema");
|
|
39
|
-
var _templateShapes = require("./template-shapes");
|
|
40
|
-
var _utils = require("./types/utils");
|
|
41
|
-
var _refs = require("./refs");
|
|
42
|
-
var _scalars = require("./scalars");
|
|
43
|
-
var _unions = require("./unions");
|
|
44
|
-
var _enum = require("./enum");
|
|
45
|
-
var _relationships = require("./relationships");
|
|
46
|
-
var _types = require("./types/types");
|
|
47
|
-
var _projectSchema = require("./project-schema");
|
|
48
|
-
var _util2 = require("./util");
|
|
49
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
50
|
-
const builtInShapeNames = exports.builtInShapeNames = new Set([...Object.keys(_builtinSchema.builtInShapes), ..._scalars.scalars, 'object']);
|
|
51
|
-
function findDuplicates(items) {
|
|
52
|
-
const seen = {};
|
|
53
|
-
for (const item of items) {
|
|
54
|
-
if (seen[item.value]) {
|
|
55
|
-
seen[item.value].push(item.path);
|
|
56
|
-
} else {
|
|
57
|
-
seen[item.value] = [item.path];
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return Object.entries(seen).filter(entry => entry[1].length > 1).flatMap(entry => ({
|
|
61
|
-
value: entry[0],
|
|
62
|
-
paths: entry[1]
|
|
63
|
-
}));
|
|
64
|
-
}
|
|
65
|
-
function checkShapeIds(shapes) {
|
|
66
|
-
const items = Object.entries(shapes).map(entry => ({
|
|
67
|
-
path: ['shapes', entry[0], 'id'],
|
|
68
|
-
value: entry[1].id
|
|
69
|
-
}));
|
|
70
|
-
return findDuplicates(items).flatMap(dupe => dupe.paths.map(path => ({
|
|
71
|
-
path,
|
|
72
|
-
type: 'conflict',
|
|
73
|
-
message: `Shapes must have unique ids. "${dupe.value}" is not unique.`
|
|
74
|
-
})));
|
|
75
|
-
}
|
|
76
|
-
function checkShapeNames(shapes) {
|
|
77
|
-
Object.entries(shapes).map(entry => ({
|
|
78
|
-
path: ['shapes', entry[0], 'id'],
|
|
79
|
-
value: entry[1].id
|
|
80
|
-
}));
|
|
81
|
-
return Object.entries(shapes).filter(([name, shape]) => name !== shape.name).map(([name, shape]) => ({
|
|
82
|
-
path: ['shapes', name, 'name'],
|
|
83
|
-
type: 'conflict',
|
|
84
|
-
message: `Shape.name "${shape.name}" must match key "${name}".`
|
|
85
|
-
}));
|
|
86
|
-
}
|
|
87
|
-
function checkWorkflowStepNames(workflows) {
|
|
88
|
-
return Object.entries(workflows).flatMap(([name, workflow]) => {
|
|
89
|
-
const items = workflow.steps.map((step, i) => ({
|
|
90
|
-
path: ['workflows', name, 'steps', i, 'name'],
|
|
91
|
-
value: step.name.toLowerCase()
|
|
92
|
-
}));
|
|
93
|
-
return findDuplicates(items).flatMap(dupe => dupe.paths.map(path => ({
|
|
94
|
-
path,
|
|
95
|
-
type: 'conflict',
|
|
96
|
-
message: `Workflow steps must have unique names. "${dupe.value}" is not unique in workflow "${workflow.name}."`
|
|
97
|
-
})));
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
function checkWorkflowStepKeys(workflows) {
|
|
101
|
-
const items = Object.entries(workflows).flatMap(([name, workflow]) => workflow.steps.map((step, i) => ({
|
|
102
|
-
path: ['workflows', name, 'steps', i, 'key'],
|
|
103
|
-
value: step.key
|
|
104
|
-
})));
|
|
105
|
-
return findDuplicates(items).flatMap(dupe => dupe.paths.map(path => ({
|
|
106
|
-
path,
|
|
107
|
-
type: 'conflict',
|
|
108
|
-
message: `Workflow keys must be unique at the schema level. Key "${dupe.value}" is not unique.`
|
|
109
|
-
})));
|
|
110
|
-
}
|
|
111
|
-
function validateWorkflowVersion(projectSchema) {
|
|
112
|
-
const errors = [];
|
|
113
|
-
if (projectSchema.apiVersion === _versions.LEGACY_API_VERSION && Object.keys(projectSchema.workflows).length) {
|
|
114
|
-
errors.push({
|
|
115
|
-
path: ['workflows'],
|
|
116
|
-
type: 'invalidVersion',
|
|
117
|
-
message: `apiVersion ${projectSchema.apiVersion} does not support workflows`
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
return errors;
|
|
121
|
-
}
|
|
122
|
-
function validateWorkflows(projectSchema) {
|
|
123
|
-
const errors = validateWorkflowVersion(projectSchema);
|
|
124
|
-
for (const name of Object.keys(projectSchema.shapes)) {
|
|
125
|
-
const shape = projectSchema.shapes[name];
|
|
126
|
-
if (shape.workflow && shape.workflow !== _workflows.defaultWorkflow.name && !projectSchema.workflows[shape.workflow]) {
|
|
127
|
-
errors.push({
|
|
128
|
-
type: 'notFound',
|
|
129
|
-
path: ['shapes', name, 'workflow'],
|
|
130
|
-
message: `Invalid Workflow "${shape.workflow}" for shape "${shape.name}"`
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
return errors;
|
|
135
|
-
}
|
|
136
|
-
function getSemver(schemaVersion) {
|
|
137
|
-
return (0, _coerce.default)(schemaVersion) ?? _versions.LEGACY_SCHEMA_VERSION;
|
|
138
|
-
}
|
|
139
|
-
function pushErrors(errors, error) {
|
|
140
|
-
if (error) {
|
|
141
|
-
errors.push(error);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
function enumerateBasicResolvers(resolver, path) {
|
|
145
|
-
const results = [];
|
|
146
|
-
const visit = (resolver, path) => {
|
|
147
|
-
if ((0, _utils.isComposeResolver)(resolver)) {
|
|
148
|
-
resolver.compose.forEach((resolver, i) => {
|
|
149
|
-
visit(resolver, [...path, 'compose', i]);
|
|
150
|
-
});
|
|
151
|
-
} else {
|
|
152
|
-
results.push([resolver, path]);
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
visit(resolver, path);
|
|
156
|
-
return results;
|
|
157
|
-
}
|
|
158
|
-
const validateAIToolConfig = (projectSchema, getNamespace, tool, basePath) => {
|
|
159
|
-
const toolRef = (0, _util2.getToolRef)(tool);
|
|
160
|
-
const path = typeof tool === 'string' ? basePath : basePath.concat('ref');
|
|
161
|
-
const parsed = (0, _refs.parsePropertyRef)(toolRef);
|
|
162
|
-
if (!parsed) {
|
|
163
|
-
return {
|
|
164
|
-
type: 'conflict',
|
|
165
|
-
path,
|
|
166
|
-
message: `Unable to parse property ref "${toolRef}"`
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
if (parsed.serviceId !== 'local') {
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
const propertyPath = (0, _refs.propertyRefItemToPath)(getNamespace, parsed);
|
|
173
|
-
if (propertyPath[0] !== 'queries' && propertyPath[0] !== 'mutations') {
|
|
174
|
-
return {
|
|
175
|
-
type: 'conflict',
|
|
176
|
-
path,
|
|
177
|
-
message: `Tools must be a query or mutation`
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
const property = (0, _get.default)(projectSchema, propertyPath);
|
|
181
|
-
if (!property) {
|
|
182
|
-
return {
|
|
183
|
-
type: 'notFound',
|
|
184
|
-
path,
|
|
185
|
-
message: `Missing tool ${propertyPath[0] === 'queries' ? 'query' : 'mutation'} "${toolRef}"`
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
function validateResolver(projectSchema, basePath, baseResolver) {
|
|
190
|
-
const errors = [];
|
|
191
|
-
const isValidShapeName = shapeName => {
|
|
192
|
-
if (!shapeName) {
|
|
193
|
-
return false;
|
|
194
|
-
}
|
|
195
|
-
const shape = (0, _schemaUtil.getShape)(projectSchema, shapeName) ?? (0, _schemaUtil.getShape)({
|
|
196
|
-
shapes: _builtinSchema.builtInShapes
|
|
197
|
-
}, shapeName);
|
|
198
|
-
if (shape?.model) {
|
|
199
|
-
return true;
|
|
200
|
-
}
|
|
201
|
-
return Boolean(shape?.cache?.enabled && shape.loaders);
|
|
202
|
-
};
|
|
203
|
-
const validateDeletgateResolver = (resolver, path) => {
|
|
204
|
-
const parsed = (0, _refs.parsePropertyRef)(resolver.to);
|
|
205
|
-
if (!parsed) {
|
|
206
|
-
return {
|
|
207
|
-
type: 'conflict',
|
|
208
|
-
path: path.concat('to'),
|
|
209
|
-
message: `Unable to parse property ref "${resolver.to}"`
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
if (parsed.serviceId !== 'local') {
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
const targetResolver = (0, _get.default)(projectSchema, (0, _refs.propertyRefItemToResolverPath)(getNamespace, parsed));
|
|
216
|
-
if (!(0, _utils.isBasicResolver)(targetResolver) && !(0, _utils.isComposeResolver)(targetResolver)) {
|
|
217
|
-
return {
|
|
218
|
-
type: 'notFound',
|
|
219
|
-
path: basePath.concat('to'),
|
|
220
|
-
message: `Missing resolver config at property ref "${resolver.to}"`
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
const validateAITGuardrail = (guardrail, basePath) => {
|
|
225
|
-
if (guardrail.name === 'similarity') {
|
|
226
|
-
if (!isValidShapeName(guardrail.shape)) {
|
|
227
|
-
return {
|
|
228
|
-
type: 'notFound',
|
|
229
|
-
path: basePath.concat('shape'),
|
|
230
|
-
message: `Invalid shape "${guardrail.shape}" for ${guardrail.shape}, must use an indexed shape`
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
const validateAIGenerateTextResolver = (resolver, path) => {
|
|
236
|
-
if (resolver.tools) {
|
|
237
|
-
for (let i = 0, n = resolver.tools.length; i < n; i++) {
|
|
238
|
-
pushErrors(errors, validateAIToolConfig(projectSchema, getNamespace, resolver.tools[i], path.concat(['tools', i])));
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
if (resolver.guardrails) {
|
|
242
|
-
for (let i = 0, n = resolver.guardrails.length; i < n; i++) {
|
|
243
|
-
pushErrors(errors, validateAITGuardrail(resolver.guardrails[i], path.concat(['guardrails', i])));
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
const {
|
|
247
|
-
toolChoice
|
|
248
|
-
} = resolver.options ?? {};
|
|
249
|
-
if (toolChoice === 'required') {
|
|
250
|
-
if (!resolver.tools?.length) {
|
|
251
|
-
errors.push({
|
|
252
|
-
type: 'notFound',
|
|
253
|
-
path: path.concat(['options', 'toolChoice']),
|
|
254
|
-
message: `Must have at least one tool configured to specify "required"`
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
} else if (toolChoice && toolChoice !== 'auto' && toolChoice !== 'none') {
|
|
258
|
-
const parsed = (0, _refs.parsePropertyRef)(toolChoice);
|
|
259
|
-
if (parsed) {
|
|
260
|
-
const matchingTool = resolver.tools?.find(tool => (0, _isEqual.default)(parsed, (0, _refs.parsePropertyRef)((0, _util2.getToolRef)(tool))));
|
|
261
|
-
if (!matchingTool) {
|
|
262
|
-
errors.push({
|
|
263
|
-
type: 'notFound',
|
|
264
|
-
path: path.concat(['options', 'toolChoice']),
|
|
265
|
-
message: `Missing tool "${toolChoice}" must be specified in "tools" array`
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
} else {
|
|
269
|
-
errors.push({
|
|
270
|
-
type: 'conflict',
|
|
271
|
-
path: path.concat(['options', 'toolChoice']),
|
|
272
|
-
message: `Unable to parse property ref "${toolChoice}"`
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
const getNamespace = (0, _refs.createGetNamespace)(projectSchema);
|
|
278
|
-
for (const [resolver, path] of enumerateBasicResolvers(baseResolver, basePath)) {
|
|
279
|
-
if ((0, _utils.isBasicResolver)(resolver)) {
|
|
280
|
-
if ('service' in resolver && resolver.service !== 'shapedb' && resolver.service !== 'takeshape' && !projectSchema.services?.[resolver.service]) {
|
|
281
|
-
errors.push({
|
|
282
|
-
type: 'notFound',
|
|
283
|
-
path: path.concat(['service']),
|
|
284
|
-
message: `Invalid service "${resolver.service}"`
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
if (resolver.shapeName) {
|
|
288
|
-
const {
|
|
289
|
-
shapeName
|
|
290
|
-
} = resolver;
|
|
291
|
-
if (!isValidShapeName(shapeName)) {
|
|
292
|
-
errors.push({
|
|
293
|
-
type: 'notFound',
|
|
294
|
-
path: path.concat(['shapeName']),
|
|
295
|
-
message: `Invalid Model Shape "${shapeName ?? ''}"`
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
if (resolver.name === 'delegate') {
|
|
300
|
-
pushErrors(errors, validateDeletgateResolver(resolver, path));
|
|
301
|
-
} else if ((0, _utils.isAIResolver)(resolver)) {
|
|
302
|
-
validateAIGenerateTextResolver(resolver, path);
|
|
303
|
-
}
|
|
304
|
-
} else {
|
|
305
|
-
errors.push({
|
|
306
|
-
type: 'notFound',
|
|
307
|
-
path,
|
|
308
|
-
message: `Invalid resolver`
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
return errors;
|
|
313
|
-
}
|
|
314
|
-
function validateLocalQueryConfig(projectSchema, query, operation, name) {
|
|
315
|
-
const location = operation === 'query' ? 'queries' : 'mutations';
|
|
316
|
-
return validateResolver(projectSchema, [location, name, 'resolver'], query.resolver);
|
|
317
|
-
}
|
|
318
|
-
const operationProps = [['query', 'queries'], ['mutation', 'mutations']];
|
|
319
|
-
function validateLocalQueryConfigs(projectSchema) {
|
|
320
|
-
const errors = [];
|
|
321
|
-
for (const [operation, prop] of operationProps) {
|
|
322
|
-
for (const name of Object.keys(projectSchema[prop])) {
|
|
323
|
-
errors.push(...validateLocalQueryConfig(projectSchema, projectSchema[prop][name], operation, name));
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
return errors;
|
|
327
|
-
}
|
|
328
|
-
function allowDisconnected(context, status) {
|
|
329
|
-
return Boolean(context.allowDisconnectedLayers) && status !== 'notAvailable';
|
|
330
|
-
}
|
|
331
|
-
function isValidShapeReference(context, layerState, shapeName) {
|
|
332
|
-
if (layerState.status !== 'ok') {
|
|
333
|
-
return allowDisconnected(context, layerState.status);
|
|
334
|
-
}
|
|
335
|
-
return Boolean(layerState.schema.shapes[shapeName]);
|
|
336
|
-
}
|
|
337
|
-
async function validateResolverReferences(context, projectSchema, basePath, baseResolver) {
|
|
338
|
-
const errors = [];
|
|
339
|
-
const isInvalidPropertyRef = async refStr => {
|
|
340
|
-
const ref = (0, _refs.parsePropertyRef)(refStr);
|
|
341
|
-
// ref string format and local refs are validated in validateResolver()
|
|
342
|
-
if (!ref || ref.serviceId === 'local') {
|
|
343
|
-
return false;
|
|
344
|
-
}
|
|
345
|
-
const layerState = await context.resolveLayer(ref.serviceId);
|
|
346
|
-
return layerState.status === 'ok' ? !(0, _get.default)(layerState.schema, (0, _refs.propertyRefItemToPath)((0, _util.value)(''), ref)) : !allowDisconnected(context, layerState.status);
|
|
347
|
-
};
|
|
348
|
-
await (0, _pMap.default)(enumerateBasicResolvers(baseResolver, basePath), async ([resolver, path]) => {
|
|
349
|
-
if (resolver.name === 'graphql:query' || resolver.name === 'graphql:mutation') {
|
|
350
|
-
const {
|
|
351
|
-
service,
|
|
352
|
-
fieldName
|
|
353
|
-
} = resolver;
|
|
354
|
-
const prop = resolver.name === 'graphql:query' ? 'queries' : 'mutations';
|
|
355
|
-
const layerState = await context.resolveLayer(service);
|
|
356
|
-
const valid = layerState.status === 'ok' ? Boolean(layerState.schema[prop][fieldName]) : allowDisconnected(context, layerState.status);
|
|
357
|
-
if (!valid) {
|
|
358
|
-
const operation = resolver.name === 'graphql:query' ? 'query' : 'mutation';
|
|
359
|
-
errors.push({
|
|
360
|
-
type: 'notFound',
|
|
361
|
-
path: path.concat('fieldName'),
|
|
362
|
-
message: `Missing ${operation} "${resolver.fieldName}" in service layer "${service}"`
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
|
-
} else if (resolver.name === 'delegate') {
|
|
366
|
-
if (await isInvalidPropertyRef(resolver.to)) {
|
|
367
|
-
errors.push({
|
|
368
|
-
type: 'notFound',
|
|
369
|
-
path: path.concat('to'),
|
|
370
|
-
message: `Missing resolver config at property ref "${resolver.to}"`
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
} else if ((0, _utils.isAIResolver)(resolver)) {
|
|
374
|
-
if (resolver.tools) {
|
|
375
|
-
await (0, _pMap.default)(resolver.tools, async (tool, i) => {
|
|
376
|
-
const toolRef = (0, _util2.getToolRef)(tool);
|
|
377
|
-
if (await isInvalidPropertyRef(toolRef)) {
|
|
378
|
-
errors.push({
|
|
379
|
-
type: 'notFound',
|
|
380
|
-
path: path.concat(typeof tool === 'string' ? ['tools', i] : ['tools', i, 'ref']),
|
|
381
|
-
message: `Invalid ref "${toolRef}"`
|
|
382
|
-
});
|
|
383
|
-
}
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
return errors;
|
|
389
|
-
}
|
|
390
|
-
async function validateQueryConfig(context, projectSchema, {
|
|
391
|
-
query,
|
|
392
|
-
name,
|
|
393
|
-
operation
|
|
394
|
-
}) {
|
|
395
|
-
const location = operation === 'query' ? 'queries' : 'mutations';
|
|
396
|
-
return validateResolverReferences(context, projectSchema, [location, name, 'resolver'], query.resolver);
|
|
397
|
-
}
|
|
398
|
-
async function validateQueryConfigs(context, projectSchema) {
|
|
399
|
-
const isLessThanV3_9_0 = (0, _lt.default)(getSemver(projectSchema.schemaVersion), '3.9.0');
|
|
400
|
-
if (isLessThanV3_9_0) {
|
|
401
|
-
return [];
|
|
402
|
-
}
|
|
403
|
-
const promises = [];
|
|
404
|
-
for (const [operation, prop] of operationProps) {
|
|
405
|
-
for (const name of Object.keys(projectSchema[prop])) {
|
|
406
|
-
promises.push(validateQueryConfig(context, projectSchema, {
|
|
407
|
-
query: projectSchema[prop][name],
|
|
408
|
-
operation,
|
|
409
|
-
name
|
|
410
|
-
}));
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
return (0, _lodash.flatten)(await Promise.all(promises));
|
|
414
|
-
}
|
|
415
|
-
function listShapeJoins(projectSchema) {
|
|
416
|
-
const joins = [];
|
|
417
|
-
for (const shapeKey of Object.keys(projectSchema.shapes)) {
|
|
418
|
-
const shape = projectSchema.shapes[shapeKey];
|
|
419
|
-
if (shape.joins) {
|
|
420
|
-
for (const joinRef of Object.keys(shape.joins)) {
|
|
421
|
-
const join = shape.joins[joinRef];
|
|
422
|
-
joins.push({
|
|
423
|
-
ref: joinRef,
|
|
424
|
-
path: ['shapes', shapeKey, 'joins', joinRef],
|
|
425
|
-
join
|
|
426
|
-
});
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
return joins;
|
|
431
|
-
}
|
|
432
|
-
function validateLocalShapeJoinRef(projectSchema, item) {
|
|
433
|
-
const refItem = (0, _refs.atRefToRefItem)(projectSchema, item.ref);
|
|
434
|
-
if (refItem.serviceKey === 'local') {
|
|
435
|
-
const shape = (0, _refs.refItemToShape)(projectSchema, refItem);
|
|
436
|
-
if (!shape) {
|
|
437
|
-
return [{
|
|
438
|
-
type: 'notFound',
|
|
439
|
-
path: item.path,
|
|
440
|
-
message: `Invalid join "${item.ref}" not found`
|
|
441
|
-
}];
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
return [];
|
|
445
|
-
}
|
|
446
|
-
function validateLocalShapeJoins(projectSchema) {
|
|
447
|
-
return listShapeJoins(projectSchema).flatMap(item => validateLocalShapeJoinRef(projectSchema, item).concat(validateResolver(projectSchema, item.path.concat('resolver'), item.join.resolver)));
|
|
448
|
-
}
|
|
449
|
-
async function validateShapeJoinRef(context, projectSchema, item) {
|
|
450
|
-
const refItem = (0, _refs.atRefToRefItem)(projectSchema, item.ref);
|
|
451
|
-
if (refItem) {
|
|
452
|
-
const layer = await context.resolveLayer(refItem.serviceKey);
|
|
453
|
-
const valid = isValidRef(context, projectSchema, layer, refItem);
|
|
454
|
-
if (!valid) {
|
|
455
|
-
return [{
|
|
456
|
-
type: 'notFound',
|
|
457
|
-
path: item.path,
|
|
458
|
-
message: `Invalid join "${item.ref}" not found`
|
|
459
|
-
}];
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
return [];
|
|
463
|
-
}
|
|
464
|
-
async function validateShapeJoins(context, projectSchema) {
|
|
465
|
-
const promises = [];
|
|
466
|
-
for (const item of listShapeJoins(projectSchema)) {
|
|
467
|
-
promises.push(validateShapeJoinRef(context, projectSchema, item), validateResolverReferences(context, projectSchema, item.path, item.join.resolver));
|
|
468
|
-
}
|
|
469
|
-
return (0, _lodash.flatten)(await Promise.all(promises));
|
|
470
|
-
}
|
|
471
|
-
function validateShapeLoaders(context, projectSchema, shape) {
|
|
472
|
-
const errors = [];
|
|
473
|
-
if (shape.loaders) {
|
|
474
|
-
const getNamespace = (0, _refs.createGetNamespace)(projectSchema);
|
|
475
|
-
const listLoader = shape.loaders.list;
|
|
476
|
-
if (listLoader) {
|
|
477
|
-
(0, _util.ensureArray)(listLoader).forEach((config, i) => {
|
|
478
|
-
const ref = (0, _refs.parsePropertyRef)(config.query);
|
|
479
|
-
const query = ref && (0, _get.default)(projectSchema, (0, _refs.propertyRefItemToPath)(getNamespace, ref));
|
|
480
|
-
if (!query) {
|
|
481
|
-
errors.push({
|
|
482
|
-
path: Array.isArray(listLoader) ? ['shapes', shape.name, 'loaders', 'list', i, 'query'] : ['shapes', shape.name, 'loaders', 'list', 'query'],
|
|
483
|
-
type: 'notFound',
|
|
484
|
-
message: `Invalid query "${config.query}"`
|
|
485
|
-
});
|
|
486
|
-
}
|
|
487
|
-
});
|
|
488
|
-
}
|
|
489
|
-
const getLoader = shape.loaders.get;
|
|
490
|
-
if (getLoader) {
|
|
491
|
-
const ref = (0, _refs.parsePropertyRef)(getLoader.query);
|
|
492
|
-
const query = ref && (0, _get.default)(projectSchema, (0, _refs.propertyRefItemToPath)(getNamespace, ref));
|
|
493
|
-
if (!query) {
|
|
494
|
-
errors.push({
|
|
495
|
-
path: ['shapes', shape.name, 'loaders', 'get', 'query'],
|
|
496
|
-
type: 'notFound',
|
|
497
|
-
message: `Invalid query "${getLoader.query}"`
|
|
498
|
-
});
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
if (shape.cache?.triggers) {
|
|
503
|
-
const min = context.entitlements?.minScheduleTriggerInterval ?? _util.DEFAULT_MIN_SCHEDULE_TRIGGER_INTERVAL;
|
|
504
|
-
for (let i = 0; i < shape.cache.triggers.length; i++) {
|
|
505
|
-
const trigger = shape.cache.triggers[i];
|
|
506
|
-
if (trigger.type === 'schedule' && trigger.interval < min) {
|
|
507
|
-
errors.push({
|
|
508
|
-
path: ['shapes', shape.name, 'cache', 'triggers', i, 'interval'],
|
|
509
|
-
type: 'entitlement',
|
|
510
|
-
message: `Trigger interval ${trigger.interval} is below minimum ${min}`
|
|
511
|
-
});
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
return errors;
|
|
516
|
-
}
|
|
517
|
-
function visitProperties(projectSchema, callback) {
|
|
518
|
-
(0, _jsonpathPlus.JSONPath)('$..properties.*', projectSchema, (property, _type, {
|
|
519
|
-
path: propertyPath
|
|
520
|
-
}) => {
|
|
521
|
-
callback(property, propertyPath.slice(3, -2).split(`']['`));
|
|
522
|
-
}, undefined);
|
|
523
|
-
}
|
|
524
|
-
function validateIndexedShapes(context, projectSchema) {
|
|
525
|
-
const errors = [];
|
|
526
|
-
const {
|
|
527
|
-
shapes
|
|
528
|
-
} = projectSchema;
|
|
529
|
-
for (const shape of Object.values(shapes)) {
|
|
530
|
-
const newErrors = validateShapeLoaders(context, projectSchema, shape);
|
|
531
|
-
if (newErrors.length) {
|
|
532
|
-
errors.push(...newErrors);
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
let nestedCount = 0;
|
|
536
|
-
visitProperties(projectSchema, (property, propertyPath) => {
|
|
537
|
-
const indexed = property['@indexed'];
|
|
538
|
-
if ((0, _util.isRecord)(indexed) && indexed.nested) {
|
|
539
|
-
nestedCount += 1;
|
|
540
|
-
if (property.type !== 'array') {
|
|
541
|
-
errors.push({
|
|
542
|
-
path: propertyPath,
|
|
543
|
-
type: 'location',
|
|
544
|
-
message: 'Nested indexes may only appear next to fields of type: "array"'
|
|
545
|
-
});
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
});
|
|
549
|
-
if (nestedCount > 50) {
|
|
550
|
-
errors.push({
|
|
551
|
-
path: ['shapes'],
|
|
552
|
-
type: 'tooMany',
|
|
553
|
-
message: `${nestedCount} nested indexes found`
|
|
554
|
-
});
|
|
555
|
-
}
|
|
556
|
-
return errors;
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
/**
|
|
560
|
-
* Verify the path has an allOf schema and not just prop named "allOf"
|
|
561
|
-
*/
|
|
562
|
-
function isAllOfPath(path) {
|
|
563
|
-
const index = path.indexOf('allOf');
|
|
564
|
-
return index !== -1 && (0, _util.isIntegerLike)(path[index + 1]);
|
|
565
|
-
}
|
|
566
|
-
function validateLocalRefs(projectSchema) {
|
|
567
|
-
const errors = [];
|
|
568
|
-
const shapeNames = new Set([...builtInShapeNames, ...Object.keys(projectSchema.shapes)]);
|
|
569
|
-
const refs = (0, _schemaUtil.getAllRefs)(projectSchema).filter(item => !item.isForeign);
|
|
570
|
-
for (const item of refs) {
|
|
571
|
-
if (item.template && !(0, _templateShapes.isValidTemplate)(item.template)) {
|
|
572
|
-
errors.push({
|
|
573
|
-
type: 'notFound',
|
|
574
|
-
path: item.path,
|
|
575
|
-
message: `Invalid template "${item.template}"`
|
|
576
|
-
});
|
|
577
|
-
}
|
|
578
|
-
const shapeName = (0, _refs.refItemToNamespacedShapeName)(item);
|
|
579
|
-
if (!shapeNames.has(shapeName)) {
|
|
580
|
-
const invalidRef = (0, _get.default)(projectSchema, item.path);
|
|
581
|
-
const path = invalidRef.items ? [...item.path, 'items', '@ref'] : item.path;
|
|
582
|
-
const ref = (0, _get.default)(projectSchema, path);
|
|
583
|
-
errors.push({
|
|
584
|
-
type: 'notFound',
|
|
585
|
-
path,
|
|
586
|
-
message: `Invalid ref "${ref}"`
|
|
587
|
-
});
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
// Make sure refs inside allOf don't refer to their own Shape
|
|
591
|
-
if (item.path[1] === shapeName && isAllOfPath(item.path)) {
|
|
592
|
-
errors.push({
|
|
593
|
-
type: 'conflict',
|
|
594
|
-
path: item.path,
|
|
595
|
-
message: `allOf cannot be self-referential`
|
|
596
|
-
});
|
|
597
|
-
}
|
|
598
|
-
const parentPath = (0, _initial.default)(item.path);
|
|
599
|
-
const parentSchema = (0, _get.default)(projectSchema, parentPath);
|
|
600
|
-
const propName = (0, _last.default)(item.path);
|
|
601
|
-
if (propName === '@ref' && parentSchema.$ref) {
|
|
602
|
-
errors.push({
|
|
603
|
-
type: 'conflict',
|
|
604
|
-
path: parentPath,
|
|
605
|
-
message: `Ref cannot have both @ref and $ref`
|
|
606
|
-
});
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
return errors;
|
|
610
|
-
}
|
|
611
|
-
function isValidRef(context, projectSchema, layer, item) {
|
|
612
|
-
const {
|
|
613
|
-
serviceKey: layerId
|
|
614
|
-
} = item;
|
|
615
|
-
const shapeName = (0, _refs.refItemToNamespacedShapeName)(item);
|
|
616
|
-
const localShapeExists = Boolean(projectSchema.shapes[shapeName]) || builtInShapeNames.has(shapeName);
|
|
617
|
-
return item.isValidService && (layerId === 'local' ? localShapeExists : localShapeExists || isValidShapeReference(context, layer, shapeName));
|
|
618
|
-
}
|
|
619
|
-
function mustBeInterface({
|
|
620
|
-
path
|
|
621
|
-
}) {
|
|
622
|
-
return path[0] === 'shapes' && path[2] === 'interfaces';
|
|
623
|
-
}
|
|
624
|
-
async function validateRefs(context, projectSchema) {
|
|
625
|
-
const {
|
|
626
|
-
resolveLayer
|
|
627
|
-
} = context;
|
|
628
|
-
const errors = [];
|
|
629
|
-
const refs = (0, _schemaUtil.getAllRefs)(projectSchema);
|
|
630
|
-
const layerIds = new Set();
|
|
631
|
-
for (const item of refs) {
|
|
632
|
-
if (item.serviceKey !== 'local') {
|
|
633
|
-
layerIds.add(item.serviceKey);
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
const layersById = Object.fromEntries(await (0, _pMap.default)(layerIds, async layerId => [layerId, await resolveLayer(layerId)]));
|
|
637
|
-
for (const item of refs) {
|
|
638
|
-
if (item.template && !(0, _templateShapes.isValidTemplate)(item.template)) {
|
|
639
|
-
errors.push({
|
|
640
|
-
type: 'notFound',
|
|
641
|
-
path: item.path,
|
|
642
|
-
message: `Invalid template "${item.path}"`
|
|
643
|
-
});
|
|
644
|
-
}
|
|
645
|
-
const {
|
|
646
|
-
serviceKey: layerId
|
|
647
|
-
} = item;
|
|
648
|
-
const layer = layersById[layerId];
|
|
649
|
-
const valid = isValidRef(context, projectSchema, layer, item);
|
|
650
|
-
if (!valid) {
|
|
651
|
-
errors.push({
|
|
652
|
-
type: 'notFound',
|
|
653
|
-
path: item.path,
|
|
654
|
-
message: `Invalid ref "${(0, _get.default)(projectSchema, item.path)}"`
|
|
655
|
-
});
|
|
656
|
-
} else if (mustBeInterface(item) && (layerId === 'local' || layer?.status === 'ok')) {
|
|
657
|
-
// only validate interfaces with connected layers isValidRef above handles when allowDisconnectedLayers false
|
|
658
|
-
const context = layer?.schema ?? projectSchema;
|
|
659
|
-
const shape = (0, _get.default)(context, item.path.slice(0, 2));
|
|
660
|
-
errors.push(...validateShapeImplementsInterface(context, shape, item, item.path));
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
return errors;
|
|
664
|
-
}
|
|
665
|
-
function visitShapePropertiesJson(projectSchema, callback) {
|
|
666
|
-
(0, _jsonpathPlus.JSONPath)('shapes.*.schema.properties.*', projectSchema, (property, _type, {
|
|
667
|
-
path: propertyPath
|
|
668
|
-
}) => {
|
|
669
|
-
callback(property, propertyPath.slice(3, -2).split(`']['`));
|
|
670
|
-
}, undefined);
|
|
671
|
-
}
|
|
672
|
-
function validateDirectives(projectSchema) {
|
|
673
|
-
const errors = [];
|
|
674
|
-
visitShapePropertiesJson(projectSchema, (property, propertyPath) => {
|
|
675
|
-
const resolver = property['@resolver'];
|
|
676
|
-
if (resolver) {
|
|
677
|
-
const propPath = propertyPath.concat('@resolver');
|
|
678
|
-
const resolverErrors = validateResolver(projectSchema, propPath, resolver);
|
|
679
|
-
if (resolverErrors) {
|
|
680
|
-
errors.push(...resolverErrors);
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
});
|
|
684
|
-
return errors;
|
|
685
|
-
}
|
|
686
|
-
function validateOneOfs(projectSchema) {
|
|
687
|
-
const errors = [];
|
|
688
|
-
visitShapePropertiesJson(projectSchema, (property, propertyPath) => {
|
|
689
|
-
const oneOfPath = property.items ? ['items', 'oneOf'] : ['oneOf'];
|
|
690
|
-
const relationship = (0, _relationships.getRelationship)(property);
|
|
691
|
-
const schema = property.items ? property.items : property;
|
|
692
|
-
const isUnion = (0, _unions.isUnionSchema)(schema);
|
|
693
|
-
if (schema.oneOf && !relationship && !isUnion && !(0, _enum.isEnumLikeSchema)(schema)) {
|
|
694
|
-
errors.push({
|
|
695
|
-
type: 'conflict',
|
|
696
|
-
path: propertyPath.concat(oneOfPath),
|
|
697
|
-
message: `Invalid oneOf must contain only @ref or title + enum/const schemas`
|
|
698
|
-
});
|
|
699
|
-
}
|
|
700
|
-
if (isUnion && schema.oneOf.length !== (0, _uniqBy.default)(schema.oneOf, refSchema => (0, _refs.getRefShapeName)(projectSchema, refSchema)).length) {
|
|
701
|
-
errors.push({
|
|
702
|
-
type: 'conflict',
|
|
703
|
-
path: propertyPath.concat(oneOfPath),
|
|
704
|
-
message: `Invalid oneOf must not contain duplicate references`
|
|
705
|
-
});
|
|
706
|
-
}
|
|
707
|
-
});
|
|
708
|
-
return errors;
|
|
709
|
-
}
|
|
710
|
-
function validateLocales(projectSchema) {
|
|
711
|
-
const {
|
|
712
|
-
locales,
|
|
713
|
-
defaultLocale
|
|
714
|
-
} = projectSchema;
|
|
715
|
-
const errors = [];
|
|
716
|
-
if (locales && !locales.includes(defaultLocale)) {
|
|
717
|
-
errors.push({
|
|
718
|
-
type: 'notFound',
|
|
719
|
-
path: ['locales'],
|
|
720
|
-
message: `Default locale "${defaultLocale}" missing from locales`
|
|
721
|
-
});
|
|
722
|
-
}
|
|
723
|
-
return errors;
|
|
724
|
-
}
|
|
725
|
-
const importantFields = ['type', '@ref', 'allOf', 'oneOf', 'anyOf', 'extends', 'items', '@tag'];
|
|
726
|
-
function isSchemaEqual(a, b) {
|
|
727
|
-
return (0, _isEqual.default)((0, _pick.default)(a, importantFields), (0, _pick.default)(b, importantFields));
|
|
728
|
-
}
|
|
729
|
-
function matchesInterface(shape, interfaceShape, path) {
|
|
730
|
-
const errors = [];
|
|
731
|
-
const {
|
|
732
|
-
schema
|
|
733
|
-
} = shape;
|
|
734
|
-
const interfaceSchema = interfaceShape.schema;
|
|
735
|
-
for (const name of Object.keys(interfaceSchema.properties)) {
|
|
736
|
-
const propSchema = schema.properties[name];
|
|
737
|
-
const interfacePropSchema = interfaceSchema.properties[name];
|
|
738
|
-
if (!propSchema) {
|
|
739
|
-
errors.push({
|
|
740
|
-
type: 'notFound',
|
|
741
|
-
path,
|
|
742
|
-
message: `"${shape.name}" is missing property "${name}" required by interface "${interfaceShape.name}"`
|
|
743
|
-
});
|
|
744
|
-
} else if (!isSchemaEqual(propSchema, interfacePropSchema)) {
|
|
745
|
-
errors.push({
|
|
746
|
-
type: 'conflict',
|
|
747
|
-
path: [...path, name],
|
|
748
|
-
message: `"${shape.name}.${name}" must match "${interfaceShape.name}.${name}"`
|
|
749
|
-
});
|
|
750
|
-
} else {
|
|
751
|
-
const propRequired = Boolean(schema.required?.includes(name));
|
|
752
|
-
const interfacePropRequired = Boolean(interfaceSchema.required?.includes(name));
|
|
753
|
-
if (interfacePropRequired !== propRequired) {
|
|
754
|
-
errors.push({
|
|
755
|
-
type: 'conflict',
|
|
756
|
-
path: [...path, name],
|
|
757
|
-
message: `"${shape.name}.${name}" must ${interfacePropRequired ? '' : 'not '}be required to match "${interfaceShape.name}.${name}"`
|
|
758
|
-
});
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
return errors;
|
|
763
|
-
}
|
|
764
|
-
function validateShapeImplementsInterface(projectSchema, shape, interfaceRefItem, path) {
|
|
765
|
-
const errors = [];
|
|
766
|
-
const interfaceShape = (0, _refs.refItemToShape)(projectSchema, interfaceRefItem);
|
|
767
|
-
if (!interfaceShape) {
|
|
768
|
-
errors.push({
|
|
769
|
-
type: 'notFound',
|
|
770
|
-
path,
|
|
771
|
-
message: `Invalid interface "${(0, _refs.refItemToAtRef)(interfaceRefItem)}" not found`
|
|
772
|
-
});
|
|
773
|
-
} else if (interfaceShape.type !== 'interface') {
|
|
774
|
-
errors.push({
|
|
775
|
-
type: 'conflict',
|
|
776
|
-
path,
|
|
777
|
-
message: `"${shape.name}" cannot implement non-interface "${interfaceShape.name}"`
|
|
778
|
-
});
|
|
779
|
-
} else if ((0, _utils.isExtendsSchema)(shape.schema)) {
|
|
780
|
-
// TODO stricter extends validation needs https://app.shortcut.com/takeshape/story/9783/use-service-schemas-during-schema-validation
|
|
781
|
-
} else if ((0, _utils.isObjectSchema)(shape.schema) && (0, _utils.isObjectSchema)(interfaceShape.schema)) {
|
|
782
|
-
const matchErrors = matchesInterface(shape, interfaceShape, ['shapes', shape.name, 'schema', 'properties']);
|
|
783
|
-
if (matchErrors.length) {
|
|
784
|
-
errors.push(...matchErrors);
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
return errors;
|
|
788
|
-
}
|
|
789
|
-
function validateInterfaceImplementations(projectSchema) {
|
|
790
|
-
const errors = [];
|
|
791
|
-
for (const shape of Object.values(projectSchema.shapes)) {
|
|
792
|
-
if (shape.interfaces?.length) {
|
|
793
|
-
if (!(0, _utils.isObjectSchema)(shape.schema) && !(0, _utils.isExtendsSchema)(shape.schema)) {
|
|
794
|
-
return [{
|
|
795
|
-
path: ['shapes', shape.name, 'schema'],
|
|
796
|
-
type: 'conflict',
|
|
797
|
-
message: `"${shape.name}" must have an object or extends schema to implement interfaces`
|
|
798
|
-
}];
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
return errors;
|
|
803
|
-
}
|
|
804
|
-
function validateAgents(projectSchema) {
|
|
805
|
-
const getNamespace = (0, _refs.createGetNamespace)(projectSchema);
|
|
806
|
-
const errors = [];
|
|
807
|
-
const agents = projectSchema['ai-experimental']?.agents;
|
|
808
|
-
if (!agents) {
|
|
809
|
-
return errors;
|
|
810
|
-
}
|
|
811
|
-
for (const [agentName, agent] of Object.entries(agents)) {
|
|
812
|
-
const stateNames = new Set();
|
|
813
|
-
for (const [stateId, state] of Object.entries(agent.states)) {
|
|
814
|
-
const statePath = ['ai-experimental', 'agents', agentName, 'states', stateId];
|
|
815
|
-
if (stateNames.has(state.name)) {
|
|
816
|
-
errors.push({
|
|
817
|
-
path: [...statePath, 'name'],
|
|
818
|
-
type: 'conflict',
|
|
819
|
-
message: `Duplicate state name "${state.name}"`
|
|
820
|
-
});
|
|
821
|
-
} else {
|
|
822
|
-
stateNames.add(state.name);
|
|
823
|
-
}
|
|
824
|
-
if (state.execution.type === 'generate' || state.execution.type === 'chat') {
|
|
825
|
-
if (!state.execution.tools) {
|
|
826
|
-
continue;
|
|
827
|
-
}
|
|
828
|
-
state.execution.tools.forEach((tool, toolIndex) => {
|
|
829
|
-
pushErrors(errors, validateAIToolConfig(projectSchema, getNamespace, tool, [...statePath, 'execution', 'tools', toolIndex, 'ref']));
|
|
830
|
-
});
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
return errors;
|
|
835
|
-
}
|
|
836
|
-
function validateInterfaces(projectSchema) {
|
|
837
|
-
const errors = [];
|
|
838
|
-
// Validate interface shapes must be an object schema with at least one property
|
|
839
|
-
for (const shape of Object.values(projectSchema.shapes)) {
|
|
840
|
-
if (shape.type === 'interface') {
|
|
841
|
-
if (shape.model) {
|
|
842
|
-
errors.push({
|
|
843
|
-
path: ['shapes', shape.name, 'model'],
|
|
844
|
-
type: 'conflict',
|
|
845
|
-
message: `"${shape.name}" may not be both an interface and model. Create a separate model shape which implements this interface.`
|
|
846
|
-
});
|
|
847
|
-
} else if ((0, _utils.isObjectSchema)(shape.schema)) {
|
|
848
|
-
if ((0, _size.default)(shape.schema.properties) === 0) {
|
|
849
|
-
errors.push({
|
|
850
|
-
path: ['shapes', shape.name, 'schema', 'properties'],
|
|
851
|
-
type: 'conflict',
|
|
852
|
-
message: `Interface "${shape.name}" must define at least one property`
|
|
853
|
-
});
|
|
854
|
-
}
|
|
855
|
-
} else {
|
|
856
|
-
errors.push({
|
|
857
|
-
path: ['shapes', shape.name, 'schema'],
|
|
858
|
-
type: 'conflict',
|
|
859
|
-
message: `Interface "${shape.name}" must define an object schema`
|
|
860
|
-
});
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
return errors;
|
|
865
|
-
}
|
|
866
|
-
function formatError(error) {
|
|
867
|
-
let pathStr = error.instancePath;
|
|
868
|
-
let message = error.message ?? '';
|
|
869
|
-
if ('missingProperty' in error.params) {
|
|
870
|
-
pathStr = `${pathStr}.${error.params.missingProperty}`;
|
|
871
|
-
}
|
|
872
|
-
if ('additionalProperty' in error.params) {
|
|
873
|
-
pathStr = `${pathStr}.${error.params.additionalProperty}`;
|
|
874
|
-
message = `${message} "${error.params.additionalProperty}"`;
|
|
875
|
-
}
|
|
876
|
-
if ('allowedValues' in error.params) {
|
|
877
|
-
message = `${message} "${error.params.allowedValues.join('", "')}"`;
|
|
878
|
-
}
|
|
879
|
-
const path = pathStr === '' ? [] : pathStr.substr(1).split(/\.|\/|\['|']\./);
|
|
880
|
-
return {
|
|
881
|
-
type: 'json',
|
|
882
|
-
message,
|
|
883
|
-
path
|
|
884
|
-
};
|
|
885
|
-
}
|
|
886
|
-
function isValidateReferencesContext(context) {
|
|
887
|
-
return Boolean(context.resolveLayer);
|
|
888
|
-
}
|
|
889
|
-
const ajv = (0, _jsonSchema.createAjv)();
|
|
890
|
-
function validateStructure(schemaVersion, context, schema, ref) {
|
|
891
|
-
const coerced = (0, _coerce.default)(schemaVersion);
|
|
892
|
-
const versionStr = coerced?.format();
|
|
893
|
-
const hasExperimental = Boolean(coerced && (0, _gte.default)(coerced, '3.48.0'));
|
|
894
|
-
const relevantSchemas = _schemas.allProjectSchemas.filter(metaSchema => hasExperimental && metaSchema.$id.endsWith('experimental#') || metaSchema.$id.endsWith(`v${versionStr}#`));
|
|
895
|
-
for (const relevantSchema of relevantSchemas) {
|
|
896
|
-
if (!ajv.getSchema(relevantSchema.$id)) {
|
|
897
|
-
ajv.addSchema(relevantSchema);
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
ajv.validate(`https://schema.takeshape.io/project-schema/v${versionStr}#${ref ?? ''}`, schema);
|
|
901
|
-
let errors = ajv.errors?.map(formatError) ?? [];
|
|
902
|
-
const {
|
|
903
|
-
suppressErrorPaths
|
|
904
|
-
} = context;
|
|
905
|
-
if (errors.length && suppressErrorPaths) {
|
|
906
|
-
errors = errors.filter(error => {
|
|
907
|
-
return !suppressErrorPaths.includes(error.path.join('.'));
|
|
908
|
-
});
|
|
909
|
-
}
|
|
910
|
-
if (errors.length) {
|
|
911
|
-
return {
|
|
912
|
-
valid: false,
|
|
913
|
-
schema: undefined,
|
|
914
|
-
errors
|
|
915
|
-
};
|
|
916
|
-
}
|
|
917
|
-
return {
|
|
918
|
-
valid: true,
|
|
919
|
-
schema: schema,
|
|
920
|
-
errors: undefined
|
|
921
|
-
};
|
|
922
|
-
}
|
|
923
|
-
function formatValidationResult(context, errors, schema) {
|
|
924
|
-
const {
|
|
925
|
-
suppressErrorPaths
|
|
926
|
-
} = context;
|
|
927
|
-
if (suppressErrorPaths) {
|
|
928
|
-
errors = errors.filter(error => {
|
|
929
|
-
return !suppressErrorPaths.includes(error.path.join('.'));
|
|
930
|
-
});
|
|
931
|
-
}
|
|
932
|
-
return errors.length ? {
|
|
933
|
-
valid: false,
|
|
934
|
-
schema: undefined,
|
|
935
|
-
errors
|
|
936
|
-
} : {
|
|
937
|
-
valid: true,
|
|
938
|
-
schema,
|
|
939
|
-
errors: undefined
|
|
940
|
-
};
|
|
941
|
-
}
|
|
942
|
-
function validateSyntax(context, schema) {
|
|
943
|
-
let errors = [];
|
|
944
|
-
errors = errors.concat(checkShapeNames(schema.shapes)).concat(checkShapeIds(schema.shapes)).concat(validateWorkflows(schema)).concat(validateLocalQueryConfigs(schema)).concat(validateLocalRefs(schema)).concat(validateLocalShapeJoins(schema)).concat(validateDirectives(schema)).concat(validateLocales(schema)).concat(checkWorkflowStepNames(schema.workflows)).concat(checkWorkflowStepKeys(schema.workflows)).concat(validateOneOfs(schema)).concat(validateIndexedShapes(context, schema)).concat(validateInterfaces(schema)).concat(validateInterfaceImplementations(schema)).concat(validateAgents(schema));
|
|
945
|
-
return formatValidationResult(context, errors, schema);
|
|
946
|
-
}
|
|
947
|
-
async function validateReferences(context, schema) {
|
|
948
|
-
const errors = (0, _lodash.flatten)(await Promise.all([validateRefs(context, schema), validateQueryConfigs(context, schema), validateShapeJoins(context, schema)]));
|
|
949
|
-
return formatValidationResult(context, errors, schema);
|
|
950
|
-
}
|
|
951
|
-
const schemaUndefinedResult = {
|
|
952
|
-
valid: false,
|
|
953
|
-
schema: undefined,
|
|
954
|
-
errors: [{
|
|
955
|
-
path: [],
|
|
956
|
-
type: 'undefined',
|
|
957
|
-
message: 'Schema is undefined'
|
|
958
|
-
}]
|
|
959
|
-
};
|
|
960
|
-
const invalidVersionResult = {
|
|
961
|
-
valid: false,
|
|
962
|
-
schema: undefined,
|
|
963
|
-
errors: [{
|
|
964
|
-
path: [],
|
|
965
|
-
type: 'invalidVersion',
|
|
966
|
-
message: 'Unknown schema version'
|
|
967
|
-
}]
|
|
968
|
-
};
|
|
969
|
-
function normalizeSchemaVersion(obj) {
|
|
970
|
-
if ((0, _util.isRecord)(obj)) {
|
|
971
|
-
return typeof obj.schemaVersion === 'string' ? obj.schemaVersion : '1';
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
function validateSchemaSyntax(obj, options = {}) {
|
|
975
|
-
if ((0, _isUndefined.default)(obj)) {
|
|
976
|
-
return schemaUndefinedResult;
|
|
977
|
-
}
|
|
978
|
-
const schemaVersion = normalizeSchemaVersion(obj);
|
|
979
|
-
if (!schemaVersion) {
|
|
980
|
-
return invalidVersionResult;
|
|
981
|
-
}
|
|
982
|
-
return validateStructure(schemaVersion, options, obj);
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
/**
|
|
986
|
-
* Validates a schema using a matching validation based on the `schemaVersion` property.
|
|
987
|
-
*/
|
|
988
|
-
async function validateSchema(context, obj) {
|
|
989
|
-
if ((0, _isUndefined.default)(obj)) {
|
|
990
|
-
return schemaUndefinedResult;
|
|
991
|
-
}
|
|
992
|
-
const contextWithDefaults = {
|
|
993
|
-
allowDisconnectedLayers: true,
|
|
994
|
-
...context
|
|
995
|
-
};
|
|
996
|
-
const schemaVersion = normalizeSchemaVersion(obj);
|
|
997
|
-
if (!schemaVersion) {
|
|
998
|
-
return invalidVersionResult;
|
|
999
|
-
}
|
|
1000
|
-
const structuralValidation = validateStructure(schemaVersion, contextWithDefaults, obj);
|
|
1001
|
-
if (!structuralValidation.valid) {
|
|
1002
|
-
return structuralValidation;
|
|
1003
|
-
}
|
|
1004
|
-
const {
|
|
1005
|
-
schema
|
|
1006
|
-
} = structuralValidation;
|
|
1007
|
-
if (!(0, _projectSchema.isLatestProjectSchemaJSON)(schema)) {
|
|
1008
|
-
return invalidVersionResult;
|
|
1009
|
-
}
|
|
1010
|
-
const syntaxValidation = validateSyntax(contextWithDefaults, schema);
|
|
1011
|
-
if (!syntaxValidation.valid || !isValidateReferencesContext(contextWithDefaults)) {
|
|
1012
|
-
return syntaxValidation;
|
|
1013
|
-
}
|
|
1014
|
-
return validateReferences(contextWithDefaults, schema);
|
|
1015
|
-
}
|
|
1016
|
-
function ensureValidLatestSchemaSyntax(obj) {
|
|
1017
|
-
const {
|
|
1018
|
-
valid,
|
|
1019
|
-
schema,
|
|
1020
|
-
errors
|
|
1021
|
-
} = validateSchemaSyntax(obj);
|
|
1022
|
-
if (!valid && errors) {
|
|
1023
|
-
throw new Error(`Invalid Schema "${errors[0].path.join(',')}": "${errors[0].message}"`);
|
|
1024
|
-
}
|
|
1025
|
-
if ((0, _isUndefined.default)(schema)) {
|
|
1026
|
-
throw new Error(`Invalid schema: schema is undefined`);
|
|
1027
|
-
}
|
|
1028
|
-
if ((0, _neq.default)(_versions.CURRENT_SCHEMA_VERSION, (0, _coerce.default)(schema.schemaVersion) ?? _versions.LEGACY_SCHEMA_VERSION)) {
|
|
1029
|
-
throw new Error(`Expected schemaVersion: "${_versions.CURRENT_SCHEMA_VERSION}", got "${schema.schemaVersion}"`);
|
|
1030
|
-
}
|
|
1031
|
-
return schema;
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
/**
|
|
1035
|
-
* The roles import validator ensures required properties, and strips several
|
|
1036
|
-
* which might exist in an export but wouldn't apply to an import operation.
|
|
1037
|
-
*/
|
|
1038
|
-
function createRoleInputValidator() {
|
|
1039
|
-
const validator = (0, _jsonSchema.createAjv)({
|
|
1040
|
-
useDefaults: true,
|
|
1041
|
-
removeAdditional: true
|
|
1042
|
-
});
|
|
1043
|
-
const {
|
|
1044
|
-
RoleInput,
|
|
1045
|
-
...definitions
|
|
1046
|
-
} = _authSchemas.default.definitions;
|
|
1047
|
-
return validator.compile({
|
|
1048
|
-
$id: 'RoleInput',
|
|
1049
|
-
definitions,
|
|
1050
|
-
...RoleInput
|
|
1051
|
-
});
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
/**
|
|
1055
|
-
* Validates and returns a `RoleInput`, which is a subset of the `Role`
|
|
1056
|
-
* type's properties suitable for importing.
|
|
1057
|
-
*/
|
|
1058
|
-
function validateRoleInput(maybeRoleInput) {
|
|
1059
|
-
const validate = createRoleInputValidator();
|
|
1060
|
-
if (validate(maybeRoleInput)) {
|
|
1061
|
-
return maybeRoleInput;
|
|
1062
|
-
}
|
|
1063
|
-
throw new _errors.SchemaValidationError('RoleInput was invalid', validate.errors?.map(formatError));
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
|
-
/**
|
|
1067
|
-
* The roles import validator ensures required properties, and strips several
|
|
1068
|
-
* which might exist in an export but wouldn't apply to an import operation.
|
|
1069
|
-
*/
|
|
1070
|
-
function createRoleImportValidator() {
|
|
1071
|
-
const validator = (0, _jsonSchema.createAjv)({
|
|
1072
|
-
useDefaults: true,
|
|
1073
|
-
removeAdditional: true
|
|
1074
|
-
});
|
|
1075
|
-
const {
|
|
1076
|
-
RoleImport,
|
|
1077
|
-
...definitions
|
|
1078
|
-
} = _authSchemas.default.definitions;
|
|
1079
|
-
return validator.compile({
|
|
1080
|
-
$id: 'RoleImport',
|
|
1081
|
-
definitions,
|
|
1082
|
-
...RoleImport
|
|
1083
|
-
});
|
|
1084
|
-
}
|
|
1085
|
-
|
|
1086
|
-
/**
|
|
1087
|
-
* Validates and returns a `RoleImport` array, which is a collection of `RoleInput`s.
|
|
1088
|
-
*/
|
|
1089
|
-
function ensureValidRoleImport(maybeRoles) {
|
|
1090
|
-
const validate = createRoleImportValidator();
|
|
1091
|
-
if (validate(maybeRoles)) {
|
|
1092
|
-
return maybeRoles;
|
|
1093
|
-
}
|
|
1094
|
-
throw new _errors.SchemaValidationError('Roles were invalid', validate.errors?.map(formatError));
|
|
1095
|
-
}
|
|
1096
|
-
/**
|
|
1097
|
-
* Only use when validating an imported schema! ignore fields optional when importing
|
|
1098
|
-
*/
|
|
1099
|
-
function validateProjectSchemaImport(maybeSchema) {
|
|
1100
|
-
return validateSchemaSyntax(maybeSchema, {
|
|
1101
|
-
suppressErrorPaths: [..._types.projectSchemaImportOptionalProps, ..._types.legacyProjectSchemaImportOptionalProps]
|
|
1102
|
-
});
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
|
-
/**
|
|
1106
|
-
* Only use when validating an imported schema!
|
|
1107
|
-
*
|
|
1108
|
-
* New style validation for parity with the `validateRoleImport` fn. Returns
|
|
1109
|
-
* a valid, clean `ImportProjectSchema` or throws a `SchemaValidationError`.
|
|
1110
|
-
*/
|
|
1111
|
-
function ensureValidProjectSchemaImport(maybeSchema) {
|
|
1112
|
-
const validateResult = validateProjectSchemaImport(maybeSchema);
|
|
1113
|
-
if (validateResult.valid) {
|
|
1114
|
-
return validateResult.schema;
|
|
1115
|
-
}
|
|
1116
|
-
throw new _errors.SchemaValidationError('ProjectSchema could not be validated', validateResult.errors);
|
|
1117
|
-
}
|