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