@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,308 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.flattenSchema = exports.collectReferencedShapeNames = exports.getAllRefs = exports.getAllRefsInQueries = exports.getAllRefsInQuery = exports.getAllRefsInShapes = exports.isObjectSchemaV4_0_0 = void 0;
|
|
7
|
+
const minimatch_1 = __importDefault(require("minimatch"));
|
|
8
|
+
const util_1 = require("@takeshape/util");
|
|
9
|
+
const uniq_js_1 = __importDefault(require("lodash/uniq.js"));
|
|
10
|
+
const set_js_1 = __importDefault(require("lodash/set.js"));
|
|
11
|
+
const refs_1 = require("../refs");
|
|
12
|
+
const refs_2 = require("./refs");
|
|
13
|
+
const type_utils_1 = require("./type-utils");
|
|
14
|
+
const visitor_1 = require("./visitor");
|
|
15
|
+
const layerDefaults = {
|
|
16
|
+
namespace: '',
|
|
17
|
+
visibility: []
|
|
18
|
+
};
|
|
19
|
+
function filterMap(prefix, fields, filters) {
|
|
20
|
+
const result = {};
|
|
21
|
+
for (const [name, value] of Object.entries(fields)) {
|
|
22
|
+
for (const filter of filters) {
|
|
23
|
+
if ((0, minimatch_1.default)(`${prefix}.${name}`, filter)) {
|
|
24
|
+
result[name] = value;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
function filterLayer(layerSchema, filters) {
|
|
31
|
+
return {
|
|
32
|
+
...layerSchema,
|
|
33
|
+
queries: filterMap('queries', layerSchema.queries ?? {}, filters),
|
|
34
|
+
mutations: filterMap('mutations', layerSchema.mutations ?? {}, filters),
|
|
35
|
+
shapes: filterMap('shapes', layerSchema.shapes ?? {}, filters),
|
|
36
|
+
workflows: filterMap('workflows', layerSchema.workflows ?? {}, filters)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
// TODO use non-versioned util eventually
|
|
40
|
+
function isObjectSchemaV4_0_0(maybeObjectSchema) {
|
|
41
|
+
return maybeObjectSchema.type === 'object' && (0, util_1.isRecord)(maybeObjectSchema.properties);
|
|
42
|
+
}
|
|
43
|
+
exports.isObjectSchemaV4_0_0 = isObjectSchemaV4_0_0;
|
|
44
|
+
function mergeShape(a, b) {
|
|
45
|
+
if (b.override === 'extend') {
|
|
46
|
+
if (isObjectSchemaV4_0_0(a.schema) && isObjectSchemaV4_0_0(b.schema)) {
|
|
47
|
+
const combinedRequired = (0, uniq_js_1.default)((a.schema.required ?? []).concat(b.schema.required ?? []));
|
|
48
|
+
const combinedSchema = {
|
|
49
|
+
type: 'object',
|
|
50
|
+
properties: {
|
|
51
|
+
...a.schema.properties,
|
|
52
|
+
...b.schema.properties
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
if (combinedRequired.length) {
|
|
56
|
+
combinedSchema.required = combinedRequired;
|
|
57
|
+
}
|
|
58
|
+
return { ...a, ...b, schema: combinedSchema };
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return b;
|
|
62
|
+
}
|
|
63
|
+
function assignShapes(flattenedShapes, layerShapes) {
|
|
64
|
+
for (const [shapeName, shape] of Object.entries(layerShapes)) {
|
|
65
|
+
flattenedShapes[shapeName] = flattenedShapes[shapeName] ? mergeShape(flattenedShapes[shapeName], shape) : shape;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function addRef(refs, ref, predicate) {
|
|
69
|
+
if (ref && (!predicate || predicate(ref))) {
|
|
70
|
+
refs.push(ref);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Walk through a `ProjectSchema` and collect all the `ref`s.
|
|
75
|
+
*/
|
|
76
|
+
function getAllRefsInShapes(shapes, predicate) {
|
|
77
|
+
const items = [];
|
|
78
|
+
const shapeVisitor = (schema, schemaPath) => {
|
|
79
|
+
if (schema['@args'] && typeof schema['@args'] === 'object') {
|
|
80
|
+
(0, visitor_1.visitSchemaProperties)(schema['@args'], schemaPath.concat(['@args']), (argSchema, argPath) => {
|
|
81
|
+
addRef(items, (0, refs_2.getRefOrItemsRef)(argSchema, argPath), predicate);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
addRef(items, (0, refs_2.getArgsReferenceWithPath)(schema, schemaPath), predicate);
|
|
85
|
+
const newPath = schema.items ? schemaPath.concat('items') : schemaPath;
|
|
86
|
+
const newSchema = schema.items ?? schema;
|
|
87
|
+
if ((0, type_utils_1.isRefSchema)(newSchema)) {
|
|
88
|
+
addRef(items, (0, refs_2.getRefOrItemsRef)(newSchema, newPath), predicate);
|
|
89
|
+
}
|
|
90
|
+
else if ((0, type_utils_1.isObjectSchema)(newSchema) || (0, type_utils_1.isAllOfSchema)(newSchema) || (0, type_utils_1.isOneOfSchema)(newSchema)) {
|
|
91
|
+
(0, visitor_1.visitSchemaProperties)(newSchema, newPath, shapeVisitor);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
for (const [shapeName, shape] of Object.entries(shapes)) {
|
|
95
|
+
(0, visitor_1.visitSchemaProperties)(shape.schema, ['shapes', shapeName, 'schema'], shapeVisitor);
|
|
96
|
+
}
|
|
97
|
+
return items;
|
|
98
|
+
}
|
|
99
|
+
exports.getAllRefsInShapes = getAllRefsInShapes;
|
|
100
|
+
/**
|
|
101
|
+
* Get all refs
|
|
102
|
+
*/
|
|
103
|
+
function getAllRefsInQuery(shapes, queryPath, query, predicate) {
|
|
104
|
+
const refItems = [];
|
|
105
|
+
const propertyVisitor = (propSchema, propSchemaPath) => {
|
|
106
|
+
addRef(refItems, (0, refs_2.getRefOrItemsRef)(propSchema, propSchemaPath), predicate);
|
|
107
|
+
};
|
|
108
|
+
if (query.args && typeof query.args === 'string') {
|
|
109
|
+
addRef(refItems, (0, refs_2.getArgsReferenceWithPath)(query, queryPath), predicate);
|
|
110
|
+
}
|
|
111
|
+
if (query.args && typeof query.args === 'object') {
|
|
112
|
+
(0, visitor_1.visitSchemaProperties)((0, refs_2.dereferenceSchema)(shapes, query.args), queryPath, propertyVisitor);
|
|
113
|
+
}
|
|
114
|
+
if (query.shape) {
|
|
115
|
+
const refItem = (0, refs_2.parseReturnShape)(query.shape).ref;
|
|
116
|
+
if (refItem) {
|
|
117
|
+
addRef(refItems, {
|
|
118
|
+
...refItem,
|
|
119
|
+
path: queryPath.concat(['shape'])
|
|
120
|
+
}, predicate);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return refItems;
|
|
124
|
+
}
|
|
125
|
+
exports.getAllRefsInQuery = getAllRefsInQuery;
|
|
126
|
+
/**
|
|
127
|
+
* Collect refs from `queries` or `mutations`.
|
|
128
|
+
*/
|
|
129
|
+
function getAllRefsInQueries(context, rootPropertyName, predicate) {
|
|
130
|
+
const refItems = [];
|
|
131
|
+
const rootPath = [rootPropertyName];
|
|
132
|
+
for (const [queryName, query] of Object.entries(context[rootPropertyName])) {
|
|
133
|
+
const queryPath = rootPath.concat([queryName]);
|
|
134
|
+
const queryRefs = getAllRefsInQuery(context.shapes, queryPath, query, predicate);
|
|
135
|
+
if (queryRefs.length) {
|
|
136
|
+
refItems.push(...queryRefs);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return refItems;
|
|
140
|
+
}
|
|
141
|
+
exports.getAllRefsInQueries = getAllRefsInQueries;
|
|
142
|
+
/**
|
|
143
|
+
* Get all refs in a ProjectSchema
|
|
144
|
+
* @param predicate return true to include the ref in
|
|
145
|
+
*/
|
|
146
|
+
function getAllRefs(projectSchema, predicate) {
|
|
147
|
+
return [
|
|
148
|
+
...getAllRefsInShapes(projectSchema.shapes, predicate),
|
|
149
|
+
...getAllRefsInQueries(projectSchema, 'queries', predicate),
|
|
150
|
+
...getAllRefsInQueries(projectSchema, 'mutations', predicate)
|
|
151
|
+
];
|
|
152
|
+
}
|
|
153
|
+
exports.getAllRefs = getAllRefs;
|
|
154
|
+
function collectReferencedShapeNames(layerId, refSet) {
|
|
155
|
+
const addLayerId = (ref) => ({ ...ref, layerId });
|
|
156
|
+
const collect = (schema) => {
|
|
157
|
+
const args = schema['@args'];
|
|
158
|
+
if (args && typeof args === 'object') {
|
|
159
|
+
Object.values(args.properties).forEach(collect);
|
|
160
|
+
}
|
|
161
|
+
const argsRefItem = (0, refs_2.getArgsReferenceWithPath)(schema);
|
|
162
|
+
if (argsRefItem) {
|
|
163
|
+
refSet.add((0, refs_2.refItemToString)(addLayerId(argsRefItem)));
|
|
164
|
+
}
|
|
165
|
+
const refItem = (0, refs_2.getRefOrItemsRef)(schema);
|
|
166
|
+
if (refItem) {
|
|
167
|
+
refSet.add((0, refs_2.refItemToString)(addLayerId(refItem)));
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
return collect;
|
|
171
|
+
}
|
|
172
|
+
exports.collectReferencedShapeNames = collectReferencedShapeNames;
|
|
173
|
+
function collectServiceRefs(flattenedSchema, getLayer) {
|
|
174
|
+
const refs = new Set(getAllRefs(flattenedSchema, refItem => refItem.layerId !== 'local').map(refs_2.refItemToString));
|
|
175
|
+
if (refs.size) {
|
|
176
|
+
for (const ref of refs) {
|
|
177
|
+
const [layerId, shapeName] = (0, refs_2.splitAtRef)(ref);
|
|
178
|
+
if (layerId !== 'local') {
|
|
179
|
+
const layer = getLayer(layerId);
|
|
180
|
+
const shape = layer?.shapes?.[shapeName];
|
|
181
|
+
if (shape) {
|
|
182
|
+
(0, visitor_1.visitSchemaProperties)(shape.schema, ['schema'], collectReferencedShapeNames(layerId, refs));
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return refs;
|
|
188
|
+
}
|
|
189
|
+
function ensureServiceLayer(flattenedSchema, layerId) {
|
|
190
|
+
flattenedSchema.serviceLayers ||= {};
|
|
191
|
+
let serviceLayer = flattenedSchema.serviceLayers[layerId];
|
|
192
|
+
if (!serviceLayer) {
|
|
193
|
+
serviceLayer = { layerId, schemaVersion: '4.0.0', shapes: {}, queries: {}, mutations: {} };
|
|
194
|
+
flattenedSchema.serviceLayers[layerId] = serviceLayer;
|
|
195
|
+
}
|
|
196
|
+
return serviceLayer;
|
|
197
|
+
}
|
|
198
|
+
function rewriteLayerId(localShapes, layerId, query) {
|
|
199
|
+
const newQuery = (0, util_1.deepClone)(query);
|
|
200
|
+
const propertyVisitor = (propSchema, propSchemaPath) => {
|
|
201
|
+
const ref = (propSchema.items ?? propSchema)['@ref'];
|
|
202
|
+
if (ref) {
|
|
203
|
+
const [argsLayerId, shapeName] = (0, refs_2.splitAtRef)(ref);
|
|
204
|
+
if (argsLayerId === 'local' && !localShapes[shapeName]) {
|
|
205
|
+
const path = propSchemaPath.concat(propSchema.items ? ['items', '@ref'] : ['@ref']);
|
|
206
|
+
(0, set_js_1.default)(newQuery, path, `${layerId}:${shapeName}`);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
if (query.args) {
|
|
211
|
+
if (typeof query.args === 'string') {
|
|
212
|
+
const [argsLayerId, shapeName] = (0, refs_2.splitAtRef)((0, refs_1.parseTemplateShape)(query.args).shapeName);
|
|
213
|
+
if (argsLayerId === 'local' && !localShapes[shapeName]) {
|
|
214
|
+
newQuery.args = `${layerId}:${shapeName}`;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
(0, visitor_1.visitSchemaProperties)(query.args, ['args'], propertyVisitor);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
if (typeof query.shape === 'string') {
|
|
222
|
+
const [argsLayerId, shapeName] = (0, refs_2.splitAtRef)((0, refs_1.parseTemplateShape)(query.shape).shapeName);
|
|
223
|
+
if (argsLayerId === 'local' && !localShapes[shapeName]) {
|
|
224
|
+
newQuery.shape = `${layerId}:${shapeName}`;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
const ref = query.shape.items['@ref'];
|
|
229
|
+
if (ref) {
|
|
230
|
+
const [argsLayerId, shapeName] = (0, refs_2.splitAtRef)(ref);
|
|
231
|
+
if (argsLayerId === 'local' && !localShapes[shapeName]) {
|
|
232
|
+
(0, set_js_1.default)(newQuery, ['shape', 'items', '@ref'], `${layerId}:${shapeName}`);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return newQuery;
|
|
237
|
+
}
|
|
238
|
+
function assignQueries(localShapes, queries, layerId, layerQueries) {
|
|
239
|
+
for (const [queryName, query] of Object.entries(layerQueries)) {
|
|
240
|
+
queries[queryName] = rewriteLayerId(localShapes, layerId, query);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
function flattenSchema(projectSchema, getLayer) {
|
|
244
|
+
const { layers, ...rest } = projectSchema;
|
|
245
|
+
const flattenedSchema = {
|
|
246
|
+
...rest,
|
|
247
|
+
shapes: {},
|
|
248
|
+
queries: {},
|
|
249
|
+
mutations: {},
|
|
250
|
+
workflows: {},
|
|
251
|
+
forms: {}
|
|
252
|
+
};
|
|
253
|
+
const filteredLayers = layers
|
|
254
|
+
.reverse()
|
|
255
|
+
.map(layer => {
|
|
256
|
+
const config = typeof layer === 'string' ? { ...layerDefaults, id: layer } : layer;
|
|
257
|
+
const layerSchema = getLayer(config.id);
|
|
258
|
+
if (!layerSchema) {
|
|
259
|
+
throw new Error(`Unable to flatten schema for project ${projectSchema.projectId}. Cannot get layer ${config.id}`);
|
|
260
|
+
}
|
|
261
|
+
return config.visibility?.length ? filterLayer(layerSchema, config.visibility) : undefined;
|
|
262
|
+
})
|
|
263
|
+
.filter(util_1.isDefined);
|
|
264
|
+
for (const filteredLayer of filteredLayers) {
|
|
265
|
+
const { layerId } = filteredLayer;
|
|
266
|
+
// Preserve original queries
|
|
267
|
+
if (projectSchema.services?.[layerId]) {
|
|
268
|
+
const serviceLayer = ensureServiceLayer(flattenedSchema, layerId);
|
|
269
|
+
if (serviceLayer.queries && filteredLayer.queries) {
|
|
270
|
+
Object.assign(serviceLayer.queries, filteredLayer.queries);
|
|
271
|
+
}
|
|
272
|
+
if (serviceLayer.mutations && filteredLayer.mutations) {
|
|
273
|
+
Object.assign(serviceLayer.mutations, filteredLayer.mutations);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
if (filteredLayer.workflows) {
|
|
277
|
+
Object.assign(flattenedSchema.workflows, filteredLayer.workflows);
|
|
278
|
+
}
|
|
279
|
+
if (flattenedSchema.forms && filteredLayer.forms) {
|
|
280
|
+
Object.assign(flattenedSchema.forms, filteredLayer.forms);
|
|
281
|
+
}
|
|
282
|
+
if (filteredLayer.shapes) {
|
|
283
|
+
assignShapes(flattenedSchema.shapes, filteredLayer.shapes);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
for (const filteredLayer of filteredLayers) {
|
|
287
|
+
if (filteredLayer.queries) {
|
|
288
|
+
assignQueries(flattenedSchema.shapes, flattenedSchema.queries, filteredLayer.layerId, filteredLayer.queries);
|
|
289
|
+
}
|
|
290
|
+
if (filteredLayer.mutations) {
|
|
291
|
+
assignQueries(flattenedSchema.shapes, flattenedSchema.mutations, filteredLayer.layerId, filteredLayer.mutations);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
// Preserve original service schema shapes
|
|
295
|
+
for (const refStr of collectServiceRefs(flattenedSchema, getLayer)) {
|
|
296
|
+
const [layerId, shapeName] = (0, refs_2.splitAtRef)(refStr);
|
|
297
|
+
if (layerId !== 'local') {
|
|
298
|
+
const shape = getLayer(layerId)?.shapes?.[shapeName];
|
|
299
|
+
if (shape) {
|
|
300
|
+
const serviceLayer = ensureServiceLayer(flattenedSchema, layerId);
|
|
301
|
+
serviceLayer.shapes ||= {};
|
|
302
|
+
serviceLayer.shapes[shapeName] = shape;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return flattenedSchema;
|
|
307
|
+
}
|
|
308
|
+
exports.flattenSchema = flattenSchema;
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.parseReturnShape = exports.dereferenceSchema = exports.getArgsReferenceWithPath = exports.hasResolvableRef = exports.hasRef = exports.followRef = exports.omitRefAndExtend = exports.refItemToShape = exports.refItemToString = exports.getRefOrItemsRef = exports.hasRefProperty = exports.getRefWithPath = exports.getRef = exports.atRefToRefItem = exports.splitAtRef = exports.refExpressionToShape = exports.refExpressionToRefItem = void 0;
|
|
7
|
+
const assign_js_1 = __importDefault(require("lodash/fp/assign.js"));
|
|
8
|
+
const omit_js_1 = __importDefault(require("lodash/fp/omit.js"));
|
|
9
|
+
const util_1 = require("@takeshape/util");
|
|
10
|
+
const isEmpty_js_1 = __importDefault(require("lodash/isEmpty.js"));
|
|
11
|
+
const refs_1 = require("../refs");
|
|
12
|
+
const type_utils_1 = require("./type-utils");
|
|
13
|
+
/**
|
|
14
|
+
* Safely turn a "template" shape reference (`@args`, `args`, `shape`) into a `RefItem`
|
|
15
|
+
*
|
|
16
|
+
* @param context A partial project schema
|
|
17
|
+
* @param refExpression
|
|
18
|
+
* A ref expression might include "template" name and refer to a local or remote
|
|
19
|
+
* shape, `Foo` or `CreateArgs<Foo>` or `CreateArgs<remote:Foo>`.*
|
|
20
|
+
*/
|
|
21
|
+
function refExpressionToRefItem(refExpression) {
|
|
22
|
+
const { shapeName, template } = (0, refs_1.parseTemplateShape)(refExpression);
|
|
23
|
+
return atRefToRefItem(shapeName, template);
|
|
24
|
+
}
|
|
25
|
+
exports.refExpressionToRefItem = refExpressionToRefItem;
|
|
26
|
+
/**
|
|
27
|
+
* Sugar for converting a `refExpression` directly into a shape, without the
|
|
28
|
+
* intermediate `refItem`.
|
|
29
|
+
*
|
|
30
|
+
* @param context A partial project schema
|
|
31
|
+
* @param refExpression
|
|
32
|
+
* A ref expression might include "template" name and refer to a local or remote
|
|
33
|
+
* shape, `Foo` or `CreateArgs<Foo>` or `CreateArgs<remote:Foo>`.
|
|
34
|
+
*/
|
|
35
|
+
function refExpressionToShape(shapes, refExpression) {
|
|
36
|
+
return refItemToShape(shapes, refExpressionToRefItem(refExpression));
|
|
37
|
+
}
|
|
38
|
+
exports.refExpressionToShape = refExpressionToShape;
|
|
39
|
+
/**
|
|
40
|
+
* Provided a service name and a referenced type. Supports 2 or 3 part
|
|
41
|
+
* references, e.g., `shopify:my-store:ProductInput` or `my-store:ProductInput`.
|
|
42
|
+
*
|
|
43
|
+
* @returns
|
|
44
|
+
* A 2 member array, where 0 is the service name, 1 is the referenced type.
|
|
45
|
+
*/
|
|
46
|
+
function splitAtRef(atRef) {
|
|
47
|
+
const refParts = atRef.split(':');
|
|
48
|
+
if (refParts.length === 1) {
|
|
49
|
+
return ['local', atRef];
|
|
50
|
+
}
|
|
51
|
+
if (refParts.length === 2) {
|
|
52
|
+
return [refParts[0], refParts[1]];
|
|
53
|
+
}
|
|
54
|
+
throw new Error(`Invalid ref string ${atRef}`);
|
|
55
|
+
}
|
|
56
|
+
exports.splitAtRef = splitAtRef;
|
|
57
|
+
/**
|
|
58
|
+
* Parses and returns a typeName, serviceKey, and potentially a namespace for
|
|
59
|
+
* the type.
|
|
60
|
+
*/
|
|
61
|
+
function atRefToRefItem(atRef, template) {
|
|
62
|
+
const [serviceKey, typeName] = splitAtRef(atRef);
|
|
63
|
+
return {
|
|
64
|
+
typeName,
|
|
65
|
+
layerId: serviceKey,
|
|
66
|
+
template
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
exports.atRefToRefItem = atRefToRefItem;
|
|
70
|
+
/**
|
|
71
|
+
* Given a content schema and project schema, finds a `@ref` or `$ref` and
|
|
72
|
+
* returns a `RefItem` suitable for loading a referenced schema...
|
|
73
|
+
*/
|
|
74
|
+
function getRef(refSchema) {
|
|
75
|
+
if (refSchema['@ref']) {
|
|
76
|
+
// @ref: my-service:ShapeName
|
|
77
|
+
return atRefToRefItem(refSchema['@ref']);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.getRef = getRef;
|
|
81
|
+
function getRefWithPath(refSchema, schemaPath = []) {
|
|
82
|
+
const refItem = getRef(refSchema);
|
|
83
|
+
if (refItem) {
|
|
84
|
+
return {
|
|
85
|
+
...refItem,
|
|
86
|
+
path: schemaPath.concat(['@ref'])
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.getRefWithPath = getRefWithPath;
|
|
91
|
+
/**
|
|
92
|
+
* Tests for a `@ref` or `$ref` property directly on the passed schema.
|
|
93
|
+
*
|
|
94
|
+
* @param schema Any schema that might could have a ref property.
|
|
95
|
+
*/
|
|
96
|
+
function hasRefProperty(schema) {
|
|
97
|
+
return Boolean(schema['@ref'] ?? schema.$ref);
|
|
98
|
+
}
|
|
99
|
+
exports.hasRefProperty = hasRefProperty;
|
|
100
|
+
/**
|
|
101
|
+
* From a schema with a ref, will return the top-level ref, and potentially
|
|
102
|
+
* a ref item from a nested `items` property.
|
|
103
|
+
*/
|
|
104
|
+
function getRefOrItemsRef(refSchema, schemaPath = []) {
|
|
105
|
+
const refItem = getRefWithPath(refSchema, schemaPath);
|
|
106
|
+
if (refItem) {
|
|
107
|
+
return refItem;
|
|
108
|
+
}
|
|
109
|
+
if (refSchema.items) {
|
|
110
|
+
return getRefOrItemsRef(refSchema.items, schemaPath.concat(['items']));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
exports.getRefOrItemsRef = getRefOrItemsRef;
|
|
114
|
+
/**
|
|
115
|
+
* Turns a `RefItem` into an `@ref`.
|
|
116
|
+
*/
|
|
117
|
+
function refItemToString(refItem) {
|
|
118
|
+
return `${refItem.layerId}:${refItem.typeName}`;
|
|
119
|
+
}
|
|
120
|
+
exports.refItemToString = refItemToString;
|
|
121
|
+
/**
|
|
122
|
+
* Get a Shape referenced by a `RefItem`.
|
|
123
|
+
*/
|
|
124
|
+
function refItemToShape(shapes, refItem) {
|
|
125
|
+
return shapes[refItemToString(refItem)];
|
|
126
|
+
}
|
|
127
|
+
exports.refItemToShape = refItemToShape;
|
|
128
|
+
/**
|
|
129
|
+
* Helper fn to omit `ref` props from the target schema, and then extend it with the source schema.
|
|
130
|
+
*/
|
|
131
|
+
const omitRefAndExtend = (targetSchema, sourceSchema) => (0, assign_js_1.default)((0, omit_js_1.default)(['@ref', '$ref'], targetSchema), sourceSchema);
|
|
132
|
+
exports.omitRefAndExtend = omitRefAndExtend;
|
|
133
|
+
/**
|
|
134
|
+
* If there is a $ref, this will insert a content schema from the top level
|
|
135
|
+
* in place of the reference.
|
|
136
|
+
*/
|
|
137
|
+
function followRef(shapes, contentSchema) {
|
|
138
|
+
const refItem = getRef(contentSchema);
|
|
139
|
+
if (refItem) {
|
|
140
|
+
const referencedSchema = refItemToShape(shapes, refItem)?.schema;
|
|
141
|
+
if (referencedSchema) {
|
|
142
|
+
return (0, exports.omitRefAndExtend)(contentSchema, referencedSchema);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return contentSchema;
|
|
146
|
+
}
|
|
147
|
+
exports.followRef = followRef;
|
|
148
|
+
/**
|
|
149
|
+
* Returns whether a schema has refs.
|
|
150
|
+
*/
|
|
151
|
+
function hasRef(contentSchema) {
|
|
152
|
+
if ((0, type_utils_1.isRefSchema)(contentSchema)) {
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
if ((0, type_utils_1.isAllOfSchema)(contentSchema)) {
|
|
156
|
+
return Boolean(contentSchema.allOf.find(hasRef));
|
|
157
|
+
}
|
|
158
|
+
if ((0, type_utils_1.isOneOfSchema)(contentSchema)) {
|
|
159
|
+
return Boolean(contentSchema.oneOf.find(hasRef));
|
|
160
|
+
}
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
exports.hasRef = hasRef;
|
|
164
|
+
/**
|
|
165
|
+
* Returns whether a schema has refs which can be followed.
|
|
166
|
+
*/
|
|
167
|
+
function hasResolvableRef(shapes, contentSchema) {
|
|
168
|
+
if ((0, type_utils_1.isRefSchema)(contentSchema)) {
|
|
169
|
+
return Boolean(refItemToShape(shapes, getRef(contentSchema)));
|
|
170
|
+
}
|
|
171
|
+
if ((0, type_utils_1.isAllOfSchema)(contentSchema)) {
|
|
172
|
+
return Boolean(contentSchema.allOf.find(s => hasResolvableRef(shapes, s)));
|
|
173
|
+
}
|
|
174
|
+
if ((0, type_utils_1.isOneOfSchema)(contentSchema)) {
|
|
175
|
+
return Boolean(contentSchema.oneOf.find(s => hasResolvableRef(shapes, s)));
|
|
176
|
+
}
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
exports.hasResolvableRef = hasResolvableRef;
|
|
180
|
+
function getArgsReferenceWithPath(argsSchema, schemaPath = []) {
|
|
181
|
+
const isQuery = 'args' in argsSchema;
|
|
182
|
+
const args = isQuery ? argsSchema.args : argsSchema['@args'];
|
|
183
|
+
const refItem = typeof args === 'string' ? refExpressionToRefItem(args) : undefined;
|
|
184
|
+
if (refItem) {
|
|
185
|
+
return {
|
|
186
|
+
...refItem,
|
|
187
|
+
path: schemaPath.concat([isQuery ? 'args' : '@args'])
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
exports.getArgsReferenceWithPath = getArgsReferenceWithPath;
|
|
192
|
+
/*
|
|
193
|
+
* Helper fn to omit `allOf` props from the target schema, and then extend it with the source schema.
|
|
194
|
+
*/
|
|
195
|
+
const omitAllOfAndExtend = (targetSchema, sourceSchema) => (0, assign_js_1.default)((0, omit_js_1.default)(['allOf'], targetSchema), sourceSchema);
|
|
196
|
+
function dereferenceSchema(shapes, shapeOrFieldSchema, schemaPath = []) {
|
|
197
|
+
const resolveAll = (resolveSchema, resolvePath) => {
|
|
198
|
+
try {
|
|
199
|
+
if ((0, type_utils_1.isAllOfSchema)(resolveSchema)) {
|
|
200
|
+
const allOfSchema = resolveSchema.allOf
|
|
201
|
+
.map((stub, index) => resolveAll(stub, [...resolvePath, 'allOf', index]))
|
|
202
|
+
.reduce((prev, curr) => (0, util_1.mergeWithArrayConcat)(prev, curr), {});
|
|
203
|
+
return (0, isEmpty_js_1.default)(allOfSchema) ? undefined : omitAllOfAndExtend(resolveSchema, allOfSchema);
|
|
204
|
+
}
|
|
205
|
+
if ((0, type_utils_1.isRefSchema)(resolveSchema)) {
|
|
206
|
+
const refItem = getRefWithPath(resolveSchema);
|
|
207
|
+
if (!refItem) {
|
|
208
|
+
throw new Error('ref could not be parsed');
|
|
209
|
+
}
|
|
210
|
+
const refSchema = refItemToShape(shapes, refItem);
|
|
211
|
+
if (refSchema) {
|
|
212
|
+
return resolveAll((0, exports.omitRefAndExtend)(resolveSchema, refSchema), refItem.path);
|
|
213
|
+
}
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
return resolveSchema;
|
|
217
|
+
}
|
|
218
|
+
catch (err) {
|
|
219
|
+
throw new Error(`error at '${resolvePath.join('.')}', ${err.message}`);
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
return resolveAll(shapeOrFieldSchema, schemaPath) ?? shapeOrFieldSchema;
|
|
223
|
+
}
|
|
224
|
+
exports.dereferenceSchema = dereferenceSchema;
|
|
225
|
+
function parseReturnShape(shape) {
|
|
226
|
+
if (typeof shape === 'object') {
|
|
227
|
+
if ((0, type_utils_1.isRefSchema)(shape.items)) {
|
|
228
|
+
const ref = getRef(shape.items);
|
|
229
|
+
if (!ref) {
|
|
230
|
+
throw new Error(`Could not parse ${JSON.stringify(shape.items)}: invalid ref`);
|
|
231
|
+
}
|
|
232
|
+
return { isArray: true, ref, shapeName: refItemToString(ref) };
|
|
233
|
+
}
|
|
234
|
+
if (typeof shape.items.type !== 'string') {
|
|
235
|
+
throw new Error(`Could not parse ${JSON.stringify(shape.items)}: invalid type`);
|
|
236
|
+
}
|
|
237
|
+
return { isArray: true, shapeName: shape.items.type };
|
|
238
|
+
}
|
|
239
|
+
const ref = refExpressionToRefItem(shape);
|
|
240
|
+
const shapeName = refItemToString(ref);
|
|
241
|
+
return { isArray: false, shapeName, ref, template: ref.template };
|
|
242
|
+
}
|
|
243
|
+
exports.parseReturnShape = parseReturnShape;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isObjectSchema = exports.isArraySchema = exports.isOneOfSchema = exports.isAllOfSchema = exports.isRefSchema = exports.isParameterSerializeStyleOptions = exports.isParameterOpOp = exports.isParameterOpValue = exports.isParameterOpMapping = exports.isParameterOpNested = exports.isParameterOp = exports.isParameterSerializeContentOptions = exports.isDirectiveConfig = exports.isDirectiveMappingArray = exports.isDirectiveMappingMap = exports.isUtilResolver = exports.isAwsLambdaResolver = exports.isRestResolver = exports.isGraphqlResolver = exports.isTakeshapeResolver = exports.isComposeResolver = exports.isBasicResolver = void 0;
|
|
7
|
+
const util_1 = require("@takeshape/util");
|
|
8
|
+
const isPlainObject_js_1 = __importDefault(require("lodash/isPlainObject.js"));
|
|
9
|
+
const isString_js_1 = __importDefault(require("lodash/isString.js"));
|
|
10
|
+
const isArray_js_1 = __importDefault(require("lodash/isArray.js"));
|
|
11
|
+
const schemas_1 = require("../schemas");
|
|
12
|
+
/** Resolver Type Utils **/
|
|
13
|
+
/**
|
|
14
|
+
* Only tests that the shape is right, not that the name is correct. That's a job for the validator.
|
|
15
|
+
*/
|
|
16
|
+
function isBasicResolver(resolver) {
|
|
17
|
+
return (0, isString_js_1.default)(resolver?.name) && (0, isString_js_1.default)(resolver.service);
|
|
18
|
+
}
|
|
19
|
+
exports.isBasicResolver = isBasicResolver;
|
|
20
|
+
function isComposeResolver(resolver) {
|
|
21
|
+
return Boolean((0, isArray_js_1.default)(resolver?.compose) &&
|
|
22
|
+
resolver.compose.length &&
|
|
23
|
+
resolver.compose.every(isBasicResolver));
|
|
24
|
+
}
|
|
25
|
+
exports.isComposeResolver = isComposeResolver;
|
|
26
|
+
const { definitions: { takeshapeResolver, utilResolver, graphqlResolver, restResolver, awsLambdaResolver } } = schemas_1.latestSchemaJson;
|
|
27
|
+
function isTakeshapeResolver(resolver) {
|
|
28
|
+
return takeshapeResolver.properties.name.enum.includes(resolver.name);
|
|
29
|
+
}
|
|
30
|
+
exports.isTakeshapeResolver = isTakeshapeResolver;
|
|
31
|
+
function isGraphqlResolver(resolver) {
|
|
32
|
+
return graphqlResolver.properties.name.enum.includes(resolver.name);
|
|
33
|
+
}
|
|
34
|
+
exports.isGraphqlResolver = isGraphqlResolver;
|
|
35
|
+
function isRestResolver(resolver) {
|
|
36
|
+
return restResolver.properties.name.enum.includes(resolver.name);
|
|
37
|
+
}
|
|
38
|
+
exports.isRestResolver = isRestResolver;
|
|
39
|
+
function isAwsLambdaResolver(resolver) {
|
|
40
|
+
return awsLambdaResolver.properties.name.enum.includes(resolver.name);
|
|
41
|
+
}
|
|
42
|
+
exports.isAwsLambdaResolver = isAwsLambdaResolver;
|
|
43
|
+
function isUtilResolver(resolver) {
|
|
44
|
+
return utilResolver.properties.name.enum.includes(resolver.name);
|
|
45
|
+
}
|
|
46
|
+
exports.isUtilResolver = isUtilResolver;
|
|
47
|
+
/** Directive Mapping Utils **/
|
|
48
|
+
/**
|
|
49
|
+
* Determine whether the ambiguous Directive structure is a DirectiveMappingMap
|
|
50
|
+
*/
|
|
51
|
+
function isDirectiveMappingMap(maybeMap) {
|
|
52
|
+
return (0, isPlainObject_js_1.default)(maybeMap) && Object.keys(maybeMap).length > 0;
|
|
53
|
+
}
|
|
54
|
+
exports.isDirectiveMappingMap = isDirectiveMappingMap;
|
|
55
|
+
/**
|
|
56
|
+
* Determine whether the ambiguous Directive structure is a DirectiveMappingArray
|
|
57
|
+
*/
|
|
58
|
+
function isDirectiveMappingArray(maybeArray) {
|
|
59
|
+
return (0, isArray_js_1.default)(maybeArray) && (0, isArray_js_1.default)(maybeArray[0]) && (0, isString_js_1.default)(maybeArray[0][0]) && (0, isArray_js_1.default)(maybeArray[0][1]);
|
|
60
|
+
}
|
|
61
|
+
exports.isDirectiveMappingArray = isDirectiveMappingArray;
|
|
62
|
+
/**
|
|
63
|
+
* Determine whether the ambiguous Directive structure is a DirectiveConfig array
|
|
64
|
+
*/
|
|
65
|
+
function isDirectiveConfig(maybeConfig) {
|
|
66
|
+
return (0, isArray_js_1.default)(maybeConfig) && (0, isArray_js_1.default)(maybeConfig[0]) && (0, isString_js_1.default)(maybeConfig[0][0]) && (0, util_1.isRecord)(maybeConfig[0][1]);
|
|
67
|
+
}
|
|
68
|
+
exports.isDirectiveConfig = isDirectiveConfig;
|
|
69
|
+
/**
|
|
70
|
+
* Determine whether a ParameterSerializeOption is a content type serializer
|
|
71
|
+
*/
|
|
72
|
+
function isParameterSerializeContentOptions(maybeContent) {
|
|
73
|
+
return Boolean('contentType' in maybeContent && maybeContent.contentType);
|
|
74
|
+
}
|
|
75
|
+
exports.isParameterSerializeContentOptions = isParameterSerializeContentOptions;
|
|
76
|
+
/**
|
|
77
|
+
* Determine whether an unknown variable is a `ParameterOp`
|
|
78
|
+
*/
|
|
79
|
+
function isParameterOp(maybeOp) {
|
|
80
|
+
const op = maybeOp;
|
|
81
|
+
if (!op.path) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
return isParameterOpNested(op) || isParameterOpMapping(op) || isParameterOpValue(op) || isParameterOpOp(op);
|
|
85
|
+
}
|
|
86
|
+
exports.isParameterOp = isParameterOp;
|
|
87
|
+
/**
|
|
88
|
+
* Determine whether a `ParameterOp` is a `ParameterOpNested`
|
|
89
|
+
*/
|
|
90
|
+
function isParameterOpNested(maybeOp) {
|
|
91
|
+
return Boolean('ops' in maybeOp && maybeOp.ops);
|
|
92
|
+
}
|
|
93
|
+
exports.isParameterOpNested = isParameterOpNested;
|
|
94
|
+
/**
|
|
95
|
+
* Determine whether a `ParameterOp` is a `ParameterOpMapping`
|
|
96
|
+
*/
|
|
97
|
+
function isParameterOpMapping(maybeOp) {
|
|
98
|
+
return Boolean('mapping' in maybeOp && maybeOp.mapping);
|
|
99
|
+
}
|
|
100
|
+
exports.isParameterOpMapping = isParameterOpMapping;
|
|
101
|
+
/**
|
|
102
|
+
* Determine whether a `ParameterOp` is a `ParameterOpMapping`
|
|
103
|
+
*/
|
|
104
|
+
function isParameterOpValue(maybeOp) {
|
|
105
|
+
return Boolean('value' in maybeOp && maybeOp.value);
|
|
106
|
+
}
|
|
107
|
+
exports.isParameterOpValue = isParameterOpValue;
|
|
108
|
+
/**
|
|
109
|
+
* Determine whether a `ParameterOp` is a `ParameterOpOp`
|
|
110
|
+
*/
|
|
111
|
+
function isParameterOpOp(maybeOp) {
|
|
112
|
+
const op = maybeOp;
|
|
113
|
+
if (!op.op) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
return !(isParameterOpNested(op) || isParameterOpMapping(op) || isParameterOpValue(op));
|
|
117
|
+
}
|
|
118
|
+
exports.isParameterOpOp = isParameterOpOp;
|
|
119
|
+
/**
|
|
120
|
+
* Determine whether a ParameterSerializeOption is a style serializer
|
|
121
|
+
*/
|
|
122
|
+
function isParameterSerializeStyleOptions(maybeStyle) {
|
|
123
|
+
return Boolean('style' in maybeStyle && maybeStyle.style);
|
|
124
|
+
}
|
|
125
|
+
exports.isParameterSerializeStyleOptions = isParameterSerializeStyleOptions;
|
|
126
|
+
/** Typeguards for different types of shape schemas **/
|
|
127
|
+
function isRefSchema(maybeRefSchema) {
|
|
128
|
+
return (0, isString_js_1.default)(maybeRefSchema['@ref']) || (0, isString_js_1.default)(maybeRefSchema.$ref);
|
|
129
|
+
}
|
|
130
|
+
exports.isRefSchema = isRefSchema;
|
|
131
|
+
function isAllOfSchema(schema) {
|
|
132
|
+
return (0, isArray_js_1.default)(schema.allOf);
|
|
133
|
+
}
|
|
134
|
+
exports.isAllOfSchema = isAllOfSchema;
|
|
135
|
+
function isOneOfSchema(schema) {
|
|
136
|
+
return (0, isArray_js_1.default)(schema.oneOf);
|
|
137
|
+
}
|
|
138
|
+
exports.isOneOfSchema = isOneOfSchema;
|
|
139
|
+
function isArraySchema(schema) {
|
|
140
|
+
return schema.type === 'array' && (0, util_1.isRecord)(schema.items);
|
|
141
|
+
}
|
|
142
|
+
exports.isArraySchema = isArraySchema;
|
|
143
|
+
function isObjectSchema(schema) {
|
|
144
|
+
return schema.type === 'object' && (0, util_1.isRecord)(schema.properties);
|
|
145
|
+
}
|
|
146
|
+
exports.isObjectSchema = isObjectSchema;
|