@takeshape/schema 11.40.0 → 11.40.3
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,79 @@
|
|
|
1
|
+
import { camelCase, isRecord } from "@takeshape/util";
|
|
2
|
+
import omit from "lodash/omit.js";
|
|
3
|
+
import { BadDataError } from "@takeshape/errors";
|
|
4
|
+
import { getRef, refItemToNamespacedShapeName } from "./refs.js";
|
|
5
|
+
import { isRefSchema } from "./types/utils.js";
|
|
6
|
+
import { getShapeById } from "./util/shapes.js";
|
|
7
|
+
import { getOutputShapeName } from "./template-shapes/names.js";
|
|
8
|
+
export function enumerateOneOfKeys(projectSchema, oneOf) {
|
|
9
|
+
const result = [];
|
|
10
|
+
for (const child of oneOf) {
|
|
11
|
+
const refItem = getRef(projectSchema, child);
|
|
12
|
+
if (refItem) {
|
|
13
|
+
const shapeName = refItemToNamespacedShapeName(refItem);
|
|
14
|
+
if (projectSchema.shapes[shapeName]) {
|
|
15
|
+
const shapeId = projectSchema.shapes[shapeName].id;
|
|
16
|
+
result.push({
|
|
17
|
+
propName: getOutputShapeName(camelCase(refItem.typeName)),
|
|
18
|
+
propSchema: child,
|
|
19
|
+
shapeName,
|
|
20
|
+
shapeId
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
function getOneOf(schema) {
|
|
28
|
+
if (!schema.oneOf) {
|
|
29
|
+
throw new Error(`Expected ${JSON.stringify(schema)} to be a oneOf schema`);
|
|
30
|
+
}
|
|
31
|
+
return schema.oneOf;
|
|
32
|
+
}
|
|
33
|
+
export function isUnionSchema(schema) {
|
|
34
|
+
return Boolean(schema.oneOf?.every(isRefSchema));
|
|
35
|
+
}
|
|
36
|
+
export function oneOfToObject(projectSchema, schema) {
|
|
37
|
+
const properties = {};
|
|
38
|
+
for (const { propName, propSchema: child } of enumerateOneOfKeys(projectSchema, getOneOf(schema))) {
|
|
39
|
+
properties[propName] = child;
|
|
40
|
+
}
|
|
41
|
+
return { ...omit(schema, "oneOf"), type: "object", properties };
|
|
42
|
+
}
|
|
43
|
+
function formatKeys(keys) {
|
|
44
|
+
return keys.map(k => `"${k}"`).join(", ");
|
|
45
|
+
}
|
|
46
|
+
// eslint-disable-next-line max-params
|
|
47
|
+
export const createUnwrapTransform = projectSchema => (obj, schema, name, shape, next) => {
|
|
48
|
+
if (isRecord(obj)) {
|
|
49
|
+
const oneOfKeys = enumerateOneOfKeys(projectSchema, getOneOf(schema));
|
|
50
|
+
const objectKeys = Object.keys(obj);
|
|
51
|
+
if (objectKeys.length !== 1) {
|
|
52
|
+
const propNames = oneOfKeys.map(k => k.propName);
|
|
53
|
+
throw new BadDataError(`Object should only specify one of the following keys: ${formatKeys(propNames)}, but found keys: ${formatKeys(objectKeys)}`);
|
|
54
|
+
}
|
|
55
|
+
for (const { propName, shapeId, propSchema } of oneOfKeys) {
|
|
56
|
+
const propValue = obj[propName];
|
|
57
|
+
if (isRecord(propValue)) {
|
|
58
|
+
const transformedPropValue = next(propValue, propSchema, name);
|
|
59
|
+
if (isRecord(transformedPropValue)) {
|
|
60
|
+
return {
|
|
61
|
+
...transformedPropValue,
|
|
62
|
+
_shapeId: shapeId
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
// eslint-disable-next-line max-params
|
|
70
|
+
export const createWrapTransform = projectSchema => (obj, schema, name, shape, next) => {
|
|
71
|
+
if (isRecord(obj) && typeof obj._shapeId === "string") {
|
|
72
|
+
const shape = getShapeById(projectSchema, obj._shapeId);
|
|
73
|
+
if (shape) {
|
|
74
|
+
return {
|
|
75
|
+
[camelCase(shape.name)]: next(omit(obj, "_shapeId"), shape.schema, name)
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ensureArray } from "@takeshape/util";
|
|
2
|
+
import { isServiceResolver, isCachedShape } from "../types/index.js";
|
|
3
|
+
import { getResolverServices } from "../services/util.js";
|
|
4
|
+
import { getIdField } from "../schema-util.js";
|
|
5
|
+
import { getQuery } from "../refs.js";
|
|
6
|
+
export function serviceHasIndexedShapes(schema, serviceId) {
|
|
7
|
+
for (const shape of Object.values(schema.shapes ?? {})) {
|
|
8
|
+
const indexingEnabled = isCachedShape(shape);
|
|
9
|
+
const listConfigs = shape.loaders?.list;
|
|
10
|
+
if (indexingEnabled && listConfigs) {
|
|
11
|
+
for (const { query: queryRef } of ensureArray(listConfigs)) {
|
|
12
|
+
const resolved = getQuery(schema, queryRef);
|
|
13
|
+
if (resolved && isServiceResolver(resolved.query.resolver) && resolved.query.resolver.service === serviceId) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
export function getIndexedServices(projectSchema, configs) {
|
|
22
|
+
return ensureArray(configs).reduce((services, queryConfig) => {
|
|
23
|
+
const resolved = queryConfig?.query ? getQuery(projectSchema, queryConfig.query) : undefined;
|
|
24
|
+
return resolved?.query ? [...services, ...getResolverServices(resolved.query.resolver)] : services;
|
|
25
|
+
}, []);
|
|
26
|
+
}
|
|
27
|
+
function flattenListQueryConfigs(base, queryConfig, maybeConfigArray) {
|
|
28
|
+
return (maybeConfigArray &&
|
|
29
|
+
ensureArray(maybeConfigArray).flatMap(config => ensureArray(config.args).map(args => ({
|
|
30
|
+
...base,
|
|
31
|
+
...queryConfig,
|
|
32
|
+
...config,
|
|
33
|
+
args
|
|
34
|
+
}))));
|
|
35
|
+
}
|
|
36
|
+
function getQueryIndexConfigHelper(op) {
|
|
37
|
+
return ({ shapes }, shapeName) => {
|
|
38
|
+
const { cache, loaders } = shapes[shapeName] ?? {};
|
|
39
|
+
if (cache && loaders) {
|
|
40
|
+
const idField = getIdField(cache);
|
|
41
|
+
if (op === "list") {
|
|
42
|
+
return flattenListQueryConfigs({ shapeName, idField }, cache.fragment, loaders.list);
|
|
43
|
+
}
|
|
44
|
+
const queryConfig = loaders.get;
|
|
45
|
+
if (queryConfig) {
|
|
46
|
+
return {
|
|
47
|
+
idField,
|
|
48
|
+
shapeName,
|
|
49
|
+
...cache.fragment,
|
|
50
|
+
...queryConfig
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export const getListQueryIndexConfigs = getQueryIndexConfigHelper("list");
|
|
57
|
+
export const getGetQueryIndexConfig = getQueryIndexConfigHelper("get");
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { value } from "@takeshape/util";
|
|
2
|
+
import { getRef, refItemToShape } from "../refs.js";
|
|
3
|
+
function immutableSetAdd(set, str) {
|
|
4
|
+
const result = new Set(set);
|
|
5
|
+
result.add(str);
|
|
6
|
+
return result;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Use a basic depth-first search to determine whether a schema contains a cycle
|
|
10
|
+
*/
|
|
11
|
+
export function hasCycle(projectSchema, schema, predicate = value(true)) {
|
|
12
|
+
const hasCycleHelper = (schema, shapesSeen = new Set(), shapeName, propName) => {
|
|
13
|
+
if (!predicate(projectSchema, schema, shapeName, propName)) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
const refItem = getRef(projectSchema, schema);
|
|
17
|
+
if (refItem) {
|
|
18
|
+
const refShape = refItemToShape(projectSchema, refItem);
|
|
19
|
+
// If we have a refItem, but no shape, this is a dangling ref and has no cycles
|
|
20
|
+
if (!refShape) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
if (shapesSeen.has(refShape.name)) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
return hasCycleHelper(refShape.schema, immutableSetAdd(shapesSeen, refShape.name), refShape.name);
|
|
27
|
+
}
|
|
28
|
+
const combo = schema.oneOf ?? schema.allOf ?? schema.extends;
|
|
29
|
+
if (combo) {
|
|
30
|
+
return combo.some(childSchema => hasCycleHelper(childSchema, shapesSeen, shapeName, propName));
|
|
31
|
+
}
|
|
32
|
+
if (schema.items) {
|
|
33
|
+
return hasCycleHelper(schema.items, shapesSeen, shapeName, propName);
|
|
34
|
+
}
|
|
35
|
+
const { properties } = schema;
|
|
36
|
+
if (properties) {
|
|
37
|
+
return Object.keys(properties).some(name => {
|
|
38
|
+
const propSchema = properties[name];
|
|
39
|
+
return hasCycleHelper(propSchema, shapesSeen, shapeName, name);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return false;
|
|
43
|
+
};
|
|
44
|
+
return hasCycleHelper(schema);
|
|
45
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { isArraySchema, isObjectSchema, isRefSchema } from "../types/index.js";
|
|
2
|
+
import { getRef, refItemToShape, refItemToShapeSchema } from "../refs.js";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param projectSchema
|
|
6
|
+
* @param schema
|
|
7
|
+
* @param queryPath
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* findShapeAtPath(projectSchema, projectSchema.shapes.Shopify_ProductConnection.shape, ['edges', 'node']) // finds {'@ref': Shopify_Product}
|
|
11
|
+
*/
|
|
12
|
+
export function findSchemaAtPath(projectSchema, schema, queryPath) {
|
|
13
|
+
if (queryPath.length === 0) {
|
|
14
|
+
return schema;
|
|
15
|
+
}
|
|
16
|
+
const [prop, ...rest] = queryPath;
|
|
17
|
+
if (isRefSchema(schema)) {
|
|
18
|
+
const ref = getRef(projectSchema, schema);
|
|
19
|
+
if (ref) {
|
|
20
|
+
const shapeSchema = refItemToShapeSchema(projectSchema, ref);
|
|
21
|
+
if (shapeSchema) {
|
|
22
|
+
return findSchemaAtPath(projectSchema, shapeSchema, queryPath);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
if (isArraySchema(schema)) {
|
|
28
|
+
return findSchemaAtPath(projectSchema, schema.items, queryPath);
|
|
29
|
+
}
|
|
30
|
+
if (isObjectSchema(schema)) {
|
|
31
|
+
const propSchema = schema.properties[prop];
|
|
32
|
+
if (propSchema) {
|
|
33
|
+
return findSchemaAtPath(projectSchema, propSchema, rest);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @param projectSchema
|
|
41
|
+
* @param propSchema
|
|
42
|
+
* @param queryPath
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* findShapeAtPath(projectSchema, projectSchema.shapes.Shopify_ProductConnection.shape, ['edges', 'node']) // finds Shopify_Product
|
|
46
|
+
*/
|
|
47
|
+
export function findShapeAtPath(projectSchema, propSchema, queryPath) {
|
|
48
|
+
const result = findSchemaAtPath(projectSchema, propSchema, queryPath);
|
|
49
|
+
if (result) {
|
|
50
|
+
const refItem = getRef(projectSchema, result.items ?? result);
|
|
51
|
+
return refItem && refItemToShape(projectSchema, refItem);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { deepClone } from "@takeshape/util";
|
|
2
|
+
import { getRefOrItemsRef, refItemToNamespacedShapeName } from "../refs.js";
|
|
3
|
+
import { createSchemaPropertyAccessor } from "../schema-util.js";
|
|
4
|
+
/**
|
|
5
|
+
* If there any non-normal (nested) forms in the schema, create forms for referenced shapes.
|
|
6
|
+
* The original forms are left intact.
|
|
7
|
+
*/
|
|
8
|
+
export function normalizeForms(projectSchema) {
|
|
9
|
+
const normalizedForms = {};
|
|
10
|
+
const { forms = {} } = projectSchema;
|
|
11
|
+
const storeSourceForm = (shapeName, formConfig, propName) => {
|
|
12
|
+
// Leave original forms intact for backwards compatibility
|
|
13
|
+
if (!forms[shapeName]) {
|
|
14
|
+
normalizedForms[shapeName] ||= { default: deepClone(formConfig) };
|
|
15
|
+
// Remove prop now that it has been normalized
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
17
|
+
delete normalizedForms[shapeName].default.properties[propName];
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const normalizeNested = (shapeName, formConfig) => {
|
|
21
|
+
const shape = projectSchema.shapes[shapeName];
|
|
22
|
+
if (!shape || !formConfig.properties) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const propertyAccessor = createSchemaPropertyAccessor(projectSchema, shape);
|
|
26
|
+
for (const propName of Object.keys(formConfig.properties)) {
|
|
27
|
+
const propConfig = formConfig.properties[propName];
|
|
28
|
+
const propSchema = propertyAccessor.getValue(propName);
|
|
29
|
+
if (propSchema) {
|
|
30
|
+
const ref = getRefOrItemsRef(projectSchema, propSchema);
|
|
31
|
+
if (ref && propConfig.properties) {
|
|
32
|
+
const nestedShapeName = refItemToNamespacedShapeName(ref);
|
|
33
|
+
normalizedForms[nestedShapeName] = { default: deepClone(propConfig) };
|
|
34
|
+
storeSourceForm(shapeName, formConfig, propName);
|
|
35
|
+
normalizeNested(nestedShapeName, propConfig);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
if (forms) {
|
|
41
|
+
for (const shapeName of Object.keys(forms)) {
|
|
42
|
+
normalizeNested(shapeName, forms[shapeName].default);
|
|
43
|
+
// copy forms with no changes
|
|
44
|
+
normalizedForms[shapeName] ||= forms[shapeName];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return normalizedForms;
|
|
48
|
+
}
|
|
49
|
+
const cache = new WeakMap();
|
|
50
|
+
/**
|
|
51
|
+
* Find the form config for a given shape name and the form key.
|
|
52
|
+
*/
|
|
53
|
+
export function findShapeFormConfig(projectSchema, shapeName, formName) {
|
|
54
|
+
if (!projectSchema.forms) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
let normalizedForms = cache.get(projectSchema);
|
|
58
|
+
if (!normalizedForms) {
|
|
59
|
+
normalizedForms = normalizeForms(projectSchema);
|
|
60
|
+
cache.set(projectSchema, normalizedForms);
|
|
61
|
+
}
|
|
62
|
+
return normalizedForms[shapeName]?.[formName];
|
|
63
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { isDefined, setIsEqual } from "@takeshape/util";
|
|
2
|
+
import { dereferenceSchema, getRef, refItemToAtRef } from "../refs.js";
|
|
3
|
+
import { isObjectSchema } from "../types/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* Normalize ref, oneOf and array schemas and get a list of @ref expressions
|
|
6
|
+
*/
|
|
7
|
+
function getRefStrings(context, propertySchema) {
|
|
8
|
+
const schema = propertySchema.items ?? propertySchema;
|
|
9
|
+
const schemas = schema.oneOf ? schema.oneOf : [schema];
|
|
10
|
+
return schemas
|
|
11
|
+
.map(propertySchema => {
|
|
12
|
+
const ref = getRef(context, propertySchema);
|
|
13
|
+
return ref ? refItemToAtRef(ref) : undefined;
|
|
14
|
+
})
|
|
15
|
+
.filter(isDefined);
|
|
16
|
+
}
|
|
17
|
+
function isRefEqual(context, a, b) {
|
|
18
|
+
return setIsEqual(getRefStrings(context, a), getRefStrings(context, b));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Given a list of shapes find the conflicting props
|
|
22
|
+
*/
|
|
23
|
+
export function getConflictingProperties(context, shapes) {
|
|
24
|
+
const conflicts = new Set();
|
|
25
|
+
const allProps = {};
|
|
26
|
+
for (const shape of Object.values(shapes)) {
|
|
27
|
+
const schema = dereferenceSchema(context, shape.schema, ["shapes", shape.name]);
|
|
28
|
+
if (!isObjectSchema(schema)) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
const required = new Set(schema.required ?? []);
|
|
32
|
+
for (const [name, prop] of Object.entries(schema.properties)) {
|
|
33
|
+
// skip props that we know already have conflict
|
|
34
|
+
if (conflicts.has(name)) {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
const isRequired = required.has(name);
|
|
38
|
+
if (allProps[name]) {
|
|
39
|
+
if (
|
|
40
|
+
// same type
|
|
41
|
+
allProps[name][0].type !== prop.type ||
|
|
42
|
+
// same refs
|
|
43
|
+
!isRefEqual(context, allProps[name][0], prop) ||
|
|
44
|
+
// same nullability
|
|
45
|
+
isRequired !== allProps[name][1]) {
|
|
46
|
+
conflicts.add(name);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
allProps[name] = [prop, isRequired];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return conflicts;
|
|
55
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { getRef, parseReturnShape, refItemToShape } from "../refs.js";
|
|
2
|
+
function isQuery(propOrQuery) {
|
|
3
|
+
return "shape" in propOrQuery && "resolver" in propOrQuery;
|
|
4
|
+
}
|
|
5
|
+
function getReturnShapeHelper(projectSchema, propOrQuery) {
|
|
6
|
+
let shape;
|
|
7
|
+
if (isQuery(propOrQuery)) {
|
|
8
|
+
const { shapeName } = parseReturnShape(projectSchema, propOrQuery.shape);
|
|
9
|
+
shape = projectSchema.shapes[shapeName];
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
const ref = getRef(projectSchema, propOrQuery);
|
|
13
|
+
if (ref) {
|
|
14
|
+
shape = refItemToShape(projectSchema, ref);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return shape;
|
|
18
|
+
}
|
|
19
|
+
export function getReturnShapeRef(context, propOrQuery) {
|
|
20
|
+
return isQuery(propOrQuery) ? parseReturnShape(context, propOrQuery.shape).ref : getRef(context, propOrQuery);
|
|
21
|
+
}
|
|
22
|
+
const cache = new WeakMap();
|
|
23
|
+
export function getReturnShape(projectSchema, propOrQuery) {
|
|
24
|
+
let result = cache.get(propOrQuery);
|
|
25
|
+
if (result === undefined) {
|
|
26
|
+
result = getReturnShapeHelper(projectSchema, propOrQuery);
|
|
27
|
+
cache.set(propOrQuery, result ?? null);
|
|
28
|
+
}
|
|
29
|
+
return result ?? undefined;
|
|
30
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { findSchemaAtPath } from "./find-shape-at-path.js";
|
|
2
|
+
export function getArgs(prop) {
|
|
3
|
+
return "@args" in prop ? prop["@args"] : "args" in prop ? prop.args : undefined;
|
|
4
|
+
}
|
|
5
|
+
export function hasArg(projectSchema, prop, argPath) {
|
|
6
|
+
const args = getArgs(prop);
|
|
7
|
+
if (!args) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
const schema = typeof args === "string" ? projectSchema.shapes[args]?.schema : args;
|
|
11
|
+
const pathArray = Array.isArray(argPath) ? argPath : argPath.split(".");
|
|
12
|
+
return Boolean(findSchemaAtPath(projectSchema, schema, pathArray));
|
|
13
|
+
}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { deepClone, isDefined, rebaseArray, rebaseObject, assert } from "@takeshape/util";
|
|
2
|
+
import union from "lodash/union.js";
|
|
3
|
+
import difference from "lodash/difference.js";
|
|
4
|
+
import isEqual from "lodash/isEqual.js";
|
|
5
|
+
import unset from "lodash/unset.js";
|
|
6
|
+
import set from "lodash/set.js";
|
|
7
|
+
import last from "lodash/last.js";
|
|
8
|
+
import omit from "lodash/omit.js";
|
|
9
|
+
import pickBy from "lodash/pickBy.js";
|
|
10
|
+
import { assignWith } from "lodash";
|
|
11
|
+
import { isExtendsSchema, isObjectSchema, isRefSchema } from "../types/index.js";
|
|
12
|
+
export function mergeObjectSchemas(...args) {
|
|
13
|
+
return args
|
|
14
|
+
.filter(isDefined)
|
|
15
|
+
.reduce((parent, schemas) => mergeSchemaProperties(parent, schemas), { type: "object", properties: {} });
|
|
16
|
+
}
|
|
17
|
+
export function mergeDeepObjectSchemas(...args) {
|
|
18
|
+
return args
|
|
19
|
+
.filter(isDefined)
|
|
20
|
+
.reduce((parent, schemas) => mergeSchemaProperties(parent, schemas, true), { type: "object", properties: {} });
|
|
21
|
+
}
|
|
22
|
+
export function mergeSchemaProperties(parent, overrides, deep = false) {
|
|
23
|
+
const result = {
|
|
24
|
+
...parent,
|
|
25
|
+
properties: deep
|
|
26
|
+
? assignWith({}, parent.properties, overrides.properties, (objValue, srcValue) => {
|
|
27
|
+
// merge objects if possible
|
|
28
|
+
if (objValue !== undefined && srcValue !== undefined) {
|
|
29
|
+
if (isObjectSchema(objValue) && isObjectSchema(srcValue)) {
|
|
30
|
+
return mergeObjectSchemas(objValue, srcValue);
|
|
31
|
+
}
|
|
32
|
+
if ((isObjectSchema(objValue) || isRefSchema(objValue)) &&
|
|
33
|
+
(isObjectSchema(srcValue) || isRefSchema(srcValue))) {
|
|
34
|
+
return { allOf: [objValue, srcValue] };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
: { ...parent.properties, ...overrides.properties }
|
|
39
|
+
};
|
|
40
|
+
const required = union(parent.required, overrides.required);
|
|
41
|
+
if (required.length) {
|
|
42
|
+
result.required = required;
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
export function rebaseSchemaProperties(base, parent, head) {
|
|
47
|
+
const { properties: toProperties, required: toRequired, ...toOther } = base;
|
|
48
|
+
const { properties: baseProperties, required: baseRequired, ...baseOther } = parent;
|
|
49
|
+
const { properties: fromProperties, required: fromRequired, ...fromOther } = head;
|
|
50
|
+
const newSchema = {
|
|
51
|
+
...rebaseObject(toOther, baseOther, fromOther),
|
|
52
|
+
type: "object",
|
|
53
|
+
properties: rebaseObject(toProperties, baseProperties, fromProperties)
|
|
54
|
+
};
|
|
55
|
+
const required = rebaseArray(toRequired ?? [], baseRequired ?? [], fromRequired ?? []);
|
|
56
|
+
if (required.length) {
|
|
57
|
+
newSchema.required = required;
|
|
58
|
+
}
|
|
59
|
+
return newSchema;
|
|
60
|
+
}
|
|
61
|
+
export function mergeFormProperties(parent, overrides) {
|
|
62
|
+
const result = {
|
|
63
|
+
...parent,
|
|
64
|
+
properties: {
|
|
65
|
+
...parent.properties,
|
|
66
|
+
...overrides.properties
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const order = union(parent.order, overrides.order);
|
|
70
|
+
if (order.length) {
|
|
71
|
+
result.order = order;
|
|
72
|
+
}
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
75
|
+
export function rebaseFormProperties(base, parent, head) {
|
|
76
|
+
const { properties: toProperties, order: toOrder, ...toOther } = base;
|
|
77
|
+
const { properties: baseProperties, order: baseOrder, ...baseOther } = parent;
|
|
78
|
+
const { properties: fromProperties, order: fromOrder, ...fromOther } = head;
|
|
79
|
+
const newForm = {
|
|
80
|
+
...rebaseObject(toOther, baseOther, fromOther),
|
|
81
|
+
properties: rebaseObject(toProperties, baseProperties, fromProperties)
|
|
82
|
+
};
|
|
83
|
+
const order = rebaseArray(toOrder ?? [], baseOrder ?? [], fromOrder ?? []);
|
|
84
|
+
if (order.length) {
|
|
85
|
+
newForm.order = order;
|
|
86
|
+
}
|
|
87
|
+
return newForm;
|
|
88
|
+
}
|
|
89
|
+
export function mergeFormConfigs(...configs) {
|
|
90
|
+
return configs.reduce(mergeFormProperties, { properties: {}, order: [] });
|
|
91
|
+
}
|
|
92
|
+
const mergeableSections = ["shapes", "mutations", "queries", "forms", "services"];
|
|
93
|
+
const isMergeableSection = (str) => {
|
|
94
|
+
return mergeableSections.includes(str);
|
|
95
|
+
};
|
|
96
|
+
const pickUnmergeable = (projectSchema) => {
|
|
97
|
+
return pickBy(projectSchema, (_value, key) => !isMergeableSection(key));
|
|
98
|
+
};
|
|
99
|
+
function compareSection(section, original, updated) {
|
|
100
|
+
const changes = [];
|
|
101
|
+
const originalKeys = Object.keys(original);
|
|
102
|
+
const updatedKeys = Object.keys(updated);
|
|
103
|
+
for (const removedKey of difference(originalKeys, updatedKeys)) {
|
|
104
|
+
changes.push({ path: [section, removedKey], section, op: "remove" });
|
|
105
|
+
}
|
|
106
|
+
for (const [key, value] of Object.entries(updated)) {
|
|
107
|
+
if (!original[key]) {
|
|
108
|
+
changes.push({ path: [section, key], section, op: "add", value });
|
|
109
|
+
}
|
|
110
|
+
else if (!isEqual(original[key], updated[key])) {
|
|
111
|
+
changes.push({ path: [section, key], section, op: "update", value });
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return changes;
|
|
115
|
+
}
|
|
116
|
+
function compareSections(parent, branch) {
|
|
117
|
+
return mergeableSections.flatMap(section => parent[section] ?? branch[section] ? compareSection(section, parent[section] ?? {}, branch[section] ?? {}) : []);
|
|
118
|
+
}
|
|
119
|
+
function findChangedShape(schema, change) {
|
|
120
|
+
return schema.shapes[change.path[1]];
|
|
121
|
+
}
|
|
122
|
+
function getChangedShape(schema, change) {
|
|
123
|
+
const shape = findChangedShape(schema, change);
|
|
124
|
+
assert(shape, "Expected shape not found");
|
|
125
|
+
return shape;
|
|
126
|
+
}
|
|
127
|
+
function rebaseShapeProperties(toShape, fromShape, baseShape) {
|
|
128
|
+
return baseShape
|
|
129
|
+
? rebaseObject(omit(toShape, "schema"), omit(baseShape, "schema"), omit(fromShape, "schema"))
|
|
130
|
+
: { ...toShape, ...fromShape };
|
|
131
|
+
}
|
|
132
|
+
// eslint-disable-next-line complexity
|
|
133
|
+
function attemptToMerge(base, parent, head, change) {
|
|
134
|
+
const toShape = getChangedShape(base, change);
|
|
135
|
+
const fromShape = getChangedShape(head, change);
|
|
136
|
+
const toSchema = toShape.schema;
|
|
137
|
+
const fromSchema = fromShape.schema;
|
|
138
|
+
if (isEqual(toSchema, fromSchema)) {
|
|
139
|
+
const baseShape = findChangedShape(parent, change);
|
|
140
|
+
return {
|
|
141
|
+
...rebaseShapeProperties(toShape, fromShape, baseShape),
|
|
142
|
+
schema: toSchema
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
if (isObjectSchema(toSchema) && isObjectSchema(fromSchema)) {
|
|
146
|
+
const baseShape = findChangedShape(parent, change);
|
|
147
|
+
const baseSchema = baseShape?.schema;
|
|
148
|
+
return {
|
|
149
|
+
...rebaseShapeProperties(toShape, fromShape, baseShape),
|
|
150
|
+
schema: change.op === "update" && baseSchema && isObjectSchema(baseSchema)
|
|
151
|
+
? rebaseSchemaProperties(toSchema, baseSchema, fromSchema)
|
|
152
|
+
: mergeSchemaProperties(toSchema, fromSchema)
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
if (isExtendsSchema(toSchema) &&
|
|
156
|
+
isExtendsSchema(fromSchema) &&
|
|
157
|
+
toSchema.extends.length === fromSchema.extends.length) {
|
|
158
|
+
const fromExtends = fromSchema.extends;
|
|
159
|
+
const toObj = last(toSchema.extends);
|
|
160
|
+
const fromObj = last(fromSchema.extends);
|
|
161
|
+
if (toObj &&
|
|
162
|
+
isObjectSchema(toObj) &&
|
|
163
|
+
fromObj &&
|
|
164
|
+
isObjectSchema(fromObj) &&
|
|
165
|
+
toSchema.extends.slice(0, toSchema.extends.length - 1).every((item, i) => isEqual(item, fromExtends[i]))) {
|
|
166
|
+
let mergedObjSchema;
|
|
167
|
+
const baseShape = findChangedShape(parent, change);
|
|
168
|
+
const baseSchema = baseShape?.schema;
|
|
169
|
+
if (change.op === "update" && baseSchema && isExtendsSchema(baseSchema)) {
|
|
170
|
+
const baseObj = last(baseSchema.extends);
|
|
171
|
+
if (baseObj && isObjectSchema(baseObj)) {
|
|
172
|
+
mergedObjSchema = rebaseSchemaProperties(toObj, baseObj, fromObj);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
mergedObjSchema ||= mergeSchemaProperties(toObj, fromObj);
|
|
176
|
+
return {
|
|
177
|
+
...rebaseShapeProperties(toShape, fromShape, baseShape),
|
|
178
|
+
schema: {
|
|
179
|
+
extends: [...toSchema.extends.slice(0, toSchema.extends.length - 1), mergedObjSchema]
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
function applyChange(base, parent, head, change) {
|
|
186
|
+
if (change.op === "remove") {
|
|
187
|
+
unset(base, change.path);
|
|
188
|
+
}
|
|
189
|
+
else if (change.op === "add") {
|
|
190
|
+
set(base, change.path, change.value);
|
|
191
|
+
}
|
|
192
|
+
else if (change.op === "update") {
|
|
193
|
+
if (change.section === "shapes") {
|
|
194
|
+
const mergedShape = attemptToMerge(base, parent, head, change);
|
|
195
|
+
if (mergedShape) {
|
|
196
|
+
set(base, change.path, mergedShape);
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
else if (change.section === "forms") {
|
|
201
|
+
const shapeName = change.path[1];
|
|
202
|
+
const toForm = base.forms?.[shapeName]?.default;
|
|
203
|
+
const fromForm = head.forms?.[shapeName]?.default;
|
|
204
|
+
if (toForm && fromForm) {
|
|
205
|
+
const baseForm = parent.forms?.[shapeName]?.default;
|
|
206
|
+
set(base, change.path, {
|
|
207
|
+
default: baseForm ? rebaseFormProperties(toForm, baseForm, fromForm) : mergeFormConfigs(toForm, fromForm)
|
|
208
|
+
});
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
set(base, change.path, change.value);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
export function mergeProjectSchemas(base, parent, head) {
|
|
216
|
+
const changesTo = compareSections(parent, base);
|
|
217
|
+
const changesFrom = compareSections(parent, head);
|
|
218
|
+
const mergedSchema = deepClone(base);
|
|
219
|
+
for (let change of changesFrom) {
|
|
220
|
+
const potentialConflict = changesTo.find(changeTo => isEqual(changeTo.path, change.path));
|
|
221
|
+
if (potentialConflict) {
|
|
222
|
+
if (potentialConflict.op === "remove" && change.op !== "remove") {
|
|
223
|
+
return {
|
|
224
|
+
error: `Attempting to ${change.op} ${change.path.join(".")} which has already been removed`,
|
|
225
|
+
mergedSchema: undefined
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
if ((potentialConflict.op === "add" && change.op === "add") ||
|
|
229
|
+
(potentialConflict.op === "update" && change.op === "update")) {
|
|
230
|
+
if (change.section === "shapes") {
|
|
231
|
+
const mergedValue = attemptToMerge(base, parent, head, change);
|
|
232
|
+
// eslint-disable-next-line max-depth
|
|
233
|
+
if (!mergedValue) {
|
|
234
|
+
return { error: `Unable to merge ${change.path.join(".")} schemas conflict`, mergedSchema: undefined };
|
|
235
|
+
}
|
|
236
|
+
change = { ...change, op: "add", value: mergedValue };
|
|
237
|
+
}
|
|
238
|
+
else if (change.section === "forms") {
|
|
239
|
+
change = { ...change, op: "update" };
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
applyChange(mergedSchema, parent, head, change);
|
|
244
|
+
}
|
|
245
|
+
Object.assign(mergedSchema, rebaseObject(pickUnmergeable(base), pickUnmergeable(parent), pickUnmergeable(head)));
|
|
246
|
+
return { error: undefined, mergedSchema };
|
|
247
|
+
}
|