@takeshape/schema 11.40.0 → 11.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/src/agents.js +58 -0
- package/dist/cjs/src/api-version.js +24 -0
- package/dist/cjs/src/auth-schemas.js +8 -0
- package/dist/cjs/src/builtin-schema.js +616 -0
- package/dist/cjs/src/constants.js +4 -0
- package/dist/cjs/src/content-schema-transform.js +175 -0
- package/dist/cjs/src/create-input-schema.js +67 -0
- package/dist/cjs/src/enum.js +13 -0
- package/dist/cjs/src/flatten-templates.js +27 -0
- package/dist/cjs/src/get-is-leaf.js +60 -0
- package/dist/cjs/src/index.js +60 -0
- package/dist/cjs/src/interfaces.js +97 -0
- package/dist/cjs/src/layers/layers.js +308 -0
- package/dist/cjs/src/layers/refs.js +243 -0
- package/dist/cjs/src/layers/type-utils.js +146 -0
- package/dist/cjs/src/layers/visitor.js +43 -0
- package/dist/cjs/src/migration/index.js +140 -0
- package/dist/cjs/src/migration/to/v3.0.0.js +205 -0
- package/dist/cjs/src/migration/to/v3.1.0.js +197 -0
- package/dist/cjs/src/migration/to/v3.10.0.js +72 -0
- package/dist/cjs/src/migration/to/v3.11.0.js +90 -0
- package/dist/cjs/src/migration/to/v3.12.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.12.1.js +12 -0
- package/dist/cjs/src/migration/to/v3.12.2.js +12 -0
- package/dist/cjs/src/migration/to/v3.12.3.js +92 -0
- package/dist/cjs/src/migration/to/v3.13.0.js +22 -0
- package/dist/cjs/src/migration/to/v3.14.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.15.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.16.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.17.0.js +27 -0
- package/dist/cjs/src/migration/to/v3.17.1.js +12 -0
- package/dist/cjs/src/migration/to/v3.18.0.js +69 -0
- package/dist/cjs/src/migration/to/v3.18.1.js +20 -0
- package/dist/cjs/src/migration/to/v3.18.2.js +24 -0
- package/dist/cjs/src/migration/to/v3.19.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.2.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.20.0.js +26 -0
- package/dist/cjs/src/migration/to/v3.21.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.22.0.js +30 -0
- package/dist/cjs/src/migration/to/v3.23.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.24.0.js +13 -0
- package/dist/cjs/src/migration/to/v3.25.0.js +13 -0
- package/dist/cjs/src/migration/to/v3.26.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.27.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.28.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.29.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.3.0.js +15 -0
- package/dist/cjs/src/migration/to/v3.30.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.31.0.js +43 -0
- package/dist/cjs/src/migration/to/v3.32.0.js +59 -0
- package/dist/cjs/src/migration/to/v3.33.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.34.0.js +127 -0
- package/dist/cjs/src/migration/to/v3.35.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.36.0.js +27 -0
- package/dist/cjs/src/migration/to/v3.37.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.38.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.39.0.js +47 -0
- package/dist/cjs/src/migration/to/v3.4.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.40.0.js +31 -0
- package/dist/cjs/src/migration/to/v3.41.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.42.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.43.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.44.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.45.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.46.0.js +37 -0
- package/dist/cjs/src/migration/to/v3.47.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.48.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.49.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.5.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.5.1.js +12 -0
- package/dist/cjs/src/migration/to/v3.50.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.6.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.7.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.8.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.9.0.js +84 -0
- package/dist/cjs/src/migration/types.js +2 -0
- package/dist/cjs/src/migration/utils.js +11 -0
- package/dist/cjs/src/mocks.js +66 -0
- package/dist/cjs/src/models/project-schema.js +99 -0
- package/dist/cjs/src/models/query.js +35 -0
- package/dist/cjs/src/models/service.js +24 -0
- package/dist/cjs/src/models/shape.js +89 -0
- package/dist/cjs/src/patterns.js +2 -0
- package/dist/cjs/src/project-schema/index.js +154 -0
- package/dist/cjs/src/project-schema/latest.js +8 -0
- package/dist/cjs/src/project-schema/migrate.js +197 -0
- package/dist/cjs/src/project-schema/v1.0.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.0.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.1.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.10.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.11.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.12.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.12.1.js +8 -0
- package/dist/cjs/src/project-schema/v3.12.2.js +8 -0
- package/dist/cjs/src/project-schema/v3.12.3.js +8 -0
- package/dist/cjs/src/project-schema/v3.13.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.13.1.js +8 -0
- package/dist/cjs/src/project-schema/v3.14.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.15.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.16.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.17.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.17.1.js +8 -0
- package/dist/cjs/src/project-schema/v3.18.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.18.1.js +8 -0
- package/dist/cjs/src/project-schema/v3.18.2.js +8 -0
- package/dist/cjs/src/project-schema/v3.19.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.2.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.20.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.21.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.22.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.23.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.24.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.25.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.26.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.27.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.28.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.29.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.3.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.30.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.31.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.32.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.33.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.34.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.35.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.36.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.37.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.38.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.39.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.4.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.40.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.41.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.42.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.43.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.44.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.45.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.46.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.47.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.48.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.49.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.5.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.5.1.js +8 -0
- package/dist/cjs/src/project-schema/v3.50.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.6.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.7.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.8.0.js +8 -0
- package/dist/cjs/src/project-schema/v3.9.0.js +8 -0
- package/dist/cjs/src/project-schema/v4.0.0.js +8 -0
- package/dist/cjs/src/refs.js +662 -0
- package/dist/cjs/src/relationships.js +237 -0
- package/dist/cjs/src/scalars.js +8 -0
- package/dist/cjs/src/schema-transform.js +83 -0
- package/dist/cjs/src/schema-util.js +1133 -0
- package/dist/cjs/src/schemas/index.js +164 -0
- package/dist/cjs/src/services/services.js +156 -0
- package/dist/cjs/src/services/types.js +2 -0
- package/dist/cjs/src/services/util.js +46 -0
- package/dist/cjs/src/taxonomies.js +28 -0
- package/dist/cjs/src/template-shapes/index.js +38 -0
- package/dist/cjs/src/template-shapes/names.js +27 -0
- package/dist/cjs/src/template-shapes/templates.js +325 -0
- package/dist/cjs/src/template-shapes/types.js +10 -0
- package/dist/cjs/src/template-shapes/where.js +403 -0
- package/dist/cjs/src/types/index.js +19 -0
- package/dist/cjs/src/types/transforms.js +2 -0
- package/dist/cjs/src/types/types.js +21 -0
- package/dist/cjs/src/types/utils.js +345 -0
- package/dist/cjs/src/unions.js +90 -0
- package/dist/cjs/src/user-schema.js +8 -0
- package/dist/cjs/src/util/ai-tools.js +11 -0
- package/dist/cjs/src/util/api-indexing.js +62 -0
- package/dist/cjs/src/util/detect-cycles.js +49 -0
- package/dist/cjs/src/util/find-shape-at-path.js +58 -0
- package/dist/cjs/src/util/form-config.js +68 -0
- package/dist/cjs/src/util/get-conflicting-properties.js +59 -0
- package/dist/cjs/src/util/get-return-shape.js +35 -0
- package/dist/cjs/src/util/has-arg.js +18 -0
- package/dist/cjs/src/util/merge.js +261 -0
- package/dist/cjs/src/util/patch-schema.js +50 -0
- package/dist/cjs/src/util/shapes.js +32 -0
- package/dist/cjs/src/validate.js +1087 -0
- package/dist/cjs/src/versions.js +8 -0
- package/dist/cjs/src/workflows.js +76 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/src/agents.js +49 -0
- package/dist/esm/src/api-version.js +17 -0
- package/dist/esm/src/auth-schemas.js +7 -0
- package/dist/esm/src/builtin-schema.js +610 -0
- package/dist/esm/src/constants.js +1 -0
- package/dist/esm/src/content-schema-transform.js +162 -0
- package/dist/esm/src/create-input-schema.js +60 -0
- package/dist/esm/src/enum.js +9 -0
- package/dist/esm/src/flatten-templates.js +20 -0
- package/dist/esm/src/get-is-leaf.js +56 -0
- package/dist/esm/src/index.js +44 -0
- package/dist/esm/src/interfaces.js +83 -0
- package/dist/esm/src/layers/layers.js +295 -0
- package/dist/esm/src/layers/refs.js +220 -0
- package/dist/esm/src/layers/type-utils.js +118 -0
- package/dist/esm/src/layers/visitor.js +38 -0
- package/dist/esm/src/migration/index.js +120 -0
- package/dist/esm/src/migration/to/v3.0.0.js +200 -0
- package/dist/esm/src/migration/to/v3.1.0.js +192 -0
- package/dist/esm/src/migration/to/v3.10.0.js +67 -0
- package/dist/esm/src/migration/to/v3.11.0.js +85 -0
- package/dist/esm/src/migration/to/v3.12.0.js +10 -0
- package/dist/esm/src/migration/to/v3.12.1.js +10 -0
- package/dist/esm/src/migration/to/v3.12.2.js +10 -0
- package/dist/esm/src/migration/to/v3.12.3.js +87 -0
- package/dist/esm/src/migration/to/v3.13.0.js +17 -0
- package/dist/esm/src/migration/to/v3.14.0.js +10 -0
- package/dist/esm/src/migration/to/v3.15.0.js +10 -0
- package/dist/esm/src/migration/to/v3.16.0.js +10 -0
- package/dist/esm/src/migration/to/v3.17.0.js +22 -0
- package/dist/esm/src/migration/to/v3.17.1.js +10 -0
- package/dist/esm/src/migration/to/v3.18.0.js +64 -0
- package/dist/esm/src/migration/to/v3.18.1.js +15 -0
- package/dist/esm/src/migration/to/v3.18.2.js +19 -0
- package/dist/esm/src/migration/to/v3.19.0.js +10 -0
- package/dist/esm/src/migration/to/v3.2.0.js +10 -0
- package/dist/esm/src/migration/to/v3.20.0.js +21 -0
- package/dist/esm/src/migration/to/v3.21.0.js +10 -0
- package/dist/esm/src/migration/to/v3.22.0.js +25 -0
- package/dist/esm/src/migration/to/v3.23.0.js +10 -0
- package/dist/esm/src/migration/to/v3.24.0.js +11 -0
- package/dist/esm/src/migration/to/v3.25.0.js +11 -0
- package/dist/esm/src/migration/to/v3.26.0.js +10 -0
- package/dist/esm/src/migration/to/v3.27.0.js +10 -0
- package/dist/esm/src/migration/to/v3.28.0.js +10 -0
- package/dist/esm/src/migration/to/v3.29.0.js +10 -0
- package/dist/esm/src/migration/to/v3.3.0.js +13 -0
- package/dist/esm/src/migration/to/v3.30.0.js +10 -0
- package/dist/esm/src/migration/to/v3.31.0.js +38 -0
- package/dist/esm/src/migration/to/v3.32.0.js +57 -0
- package/dist/esm/src/migration/to/v3.33.0.js +10 -0
- package/dist/esm/src/migration/to/v3.34.0.js +119 -0
- package/dist/esm/src/migration/to/v3.35.0.js +10 -0
- package/dist/esm/src/migration/to/v3.36.0.js +22 -0
- package/dist/esm/src/migration/to/v3.37.0.js +10 -0
- package/dist/esm/src/migration/to/v3.38.0.js +10 -0
- package/dist/esm/src/migration/to/v3.39.0.js +45 -0
- package/dist/esm/src/migration/to/v3.4.0.js +10 -0
- package/dist/esm/src/migration/to/v3.40.0.js +26 -0
- package/dist/esm/src/migration/to/v3.41.0.js +10 -0
- package/dist/esm/src/migration/to/v3.42.0.js +10 -0
- package/dist/esm/src/migration/to/v3.43.0.js +10 -0
- package/dist/esm/src/migration/to/v3.44.0.js +10 -0
- package/dist/esm/src/migration/to/v3.45.0.js +10 -0
- package/dist/esm/src/migration/to/v3.46.0.js +35 -0
- package/dist/esm/src/migration/to/v3.47.0.js +10 -0
- package/dist/esm/src/migration/to/v3.48.0.js +10 -0
- package/dist/esm/src/migration/to/v3.49.0.js +10 -0
- package/dist/esm/src/migration/to/v3.5.0.js +10 -0
- package/dist/esm/src/migration/to/v3.5.1.js +10 -0
- package/dist/esm/src/migration/to/v3.50.0.js +10 -0
- package/dist/esm/src/migration/to/v3.6.0.js +10 -0
- package/dist/esm/src/migration/to/v3.7.0.js +10 -0
- package/dist/esm/src/migration/to/v3.8.0.js +10 -0
- package/dist/esm/src/migration/to/v3.9.0.js +79 -0
- package/dist/esm/src/migration/types.js +1 -0
- package/dist/esm/src/migration/utils.js +6 -0
- package/dist/esm/src/mocks.js +58 -0
- package/dist/esm/src/models/project-schema.js +92 -0
- package/dist/esm/src/models/query.js +31 -0
- package/dist/esm/src/models/service.js +20 -0
- package/dist/esm/src/models/shape.js +85 -0
- package/dist/esm/src/patterns.js +1 -0
- package/dist/esm/src/project-schema/index.js +136 -0
- package/dist/esm/src/project-schema/latest.js +7 -0
- package/dist/esm/src/project-schema/migrate.js +192 -0
- package/dist/esm/src/project-schema/v1.0.0.js +7 -0
- package/dist/esm/src/project-schema/v3.0.0.js +7 -0
- package/dist/esm/src/project-schema/v3.1.0.js +7 -0
- package/dist/esm/src/project-schema/v3.10.0.js +7 -0
- package/dist/esm/src/project-schema/v3.11.0.js +7 -0
- package/dist/esm/src/project-schema/v3.12.0.js +7 -0
- package/dist/esm/src/project-schema/v3.12.1.js +7 -0
- package/dist/esm/src/project-schema/v3.12.2.js +7 -0
- package/dist/esm/src/project-schema/v3.12.3.js +7 -0
- package/dist/esm/src/project-schema/v3.13.0.js +7 -0
- package/dist/esm/src/project-schema/v3.13.1.js +7 -0
- package/dist/esm/src/project-schema/v3.14.0.js +7 -0
- package/dist/esm/src/project-schema/v3.15.0.js +7 -0
- package/dist/esm/src/project-schema/v3.16.0.js +7 -0
- package/dist/esm/src/project-schema/v3.17.0.js +7 -0
- package/dist/esm/src/project-schema/v3.17.1.js +7 -0
- package/dist/esm/src/project-schema/v3.18.0.js +7 -0
- package/dist/esm/src/project-schema/v3.18.1.js +7 -0
- package/dist/esm/src/project-schema/v3.18.2.js +7 -0
- package/dist/esm/src/project-schema/v3.19.0.js +7 -0
- package/dist/esm/src/project-schema/v3.2.0.js +7 -0
- package/dist/esm/src/project-schema/v3.20.0.js +7 -0
- package/dist/esm/src/project-schema/v3.21.0.js +7 -0
- package/dist/esm/src/project-schema/v3.22.0.js +7 -0
- package/dist/esm/src/project-schema/v3.23.0.js +7 -0
- package/dist/esm/src/project-schema/v3.24.0.js +7 -0
- package/dist/esm/src/project-schema/v3.25.0.js +7 -0
- package/dist/esm/src/project-schema/v3.26.0.js +7 -0
- package/dist/esm/src/project-schema/v3.27.0.js +7 -0
- package/dist/esm/src/project-schema/v3.28.0.js +7 -0
- package/dist/esm/src/project-schema/v3.29.0.js +7 -0
- package/dist/esm/src/project-schema/v3.3.0.js +7 -0
- package/dist/esm/src/project-schema/v3.30.0.js +7 -0
- package/dist/esm/src/project-schema/v3.31.0.js +7 -0
- package/dist/esm/src/project-schema/v3.32.0.js +7 -0
- package/dist/esm/src/project-schema/v3.33.0.js +7 -0
- package/dist/esm/src/project-schema/v3.34.0.js +7 -0
- package/dist/esm/src/project-schema/v3.35.0.js +7 -0
- package/dist/esm/src/project-schema/v3.36.0.js +7 -0
- package/dist/esm/src/project-schema/v3.37.0.js +7 -0
- package/dist/esm/src/project-schema/v3.38.0.js +7 -0
- package/dist/esm/src/project-schema/v3.39.0.js +7 -0
- package/dist/esm/src/project-schema/v3.4.0.js +7 -0
- package/dist/esm/src/project-schema/v3.40.0.js +7 -0
- package/dist/esm/src/project-schema/v3.41.0.js +7 -0
- package/dist/esm/src/project-schema/v3.42.0.js +7 -0
- package/dist/esm/src/project-schema/v3.43.0.js +7 -0
- package/dist/esm/src/project-schema/v3.44.0.js +7 -0
- package/dist/esm/src/project-schema/v3.45.0.js +7 -0
- package/dist/esm/src/project-schema/v3.46.0.js +7 -0
- package/dist/esm/src/project-schema/v3.47.0.js +7 -0
- package/dist/esm/src/project-schema/v3.48.0.js +7 -0
- package/dist/esm/src/project-schema/v3.49.0.js +7 -0
- package/dist/esm/src/project-schema/v3.5.0.js +7 -0
- package/dist/esm/src/project-schema/v3.5.1.js +7 -0
- package/dist/esm/src/project-schema/v3.50.0.js +7 -0
- package/dist/esm/src/project-schema/v3.6.0.js +7 -0
- package/dist/esm/src/project-schema/v3.7.0.js +7 -0
- package/dist/esm/src/project-schema/v3.8.0.js +7 -0
- package/dist/esm/src/project-schema/v3.9.0.js +7 -0
- package/dist/esm/src/project-schema/v4.0.0.js +7 -0
- package/dist/esm/src/refs.js +598 -0
- package/dist/esm/src/relationships.js +222 -0
- package/dist/esm/src/scalars.js +4 -0
- package/dist/esm/src/schema-transform.js +74 -0
- package/dist/esm/src/schema-util.js +1069 -0
- package/dist/esm/src/schemas/index.js +154 -0
- package/dist/esm/src/services/services.js +144 -0
- package/dist/esm/src/services/types.js +1 -0
- package/dist/esm/src/services/util.js +36 -0
- package/dist/esm/src/taxonomies.js +24 -0
- package/dist/esm/src/template-shapes/index.js +33 -0
- package/dist/esm/src/template-shapes/names.js +21 -0
- package/dist/esm/src/template-shapes/templates.js +313 -0
- package/dist/esm/src/template-shapes/types.js +7 -0
- package/dist/esm/src/template-shapes/where.js +391 -0
- package/dist/esm/src/types/index.js +3 -0
- package/dist/esm/src/types/transforms.js +1 -0
- package/dist/esm/src/types/types.js +18 -0
- package/dist/esm/src/types/utils.js +279 -0
- package/dist/esm/src/unions.js +79 -0
- package/dist/esm/src/user-schema.js +7 -0
- package/dist/esm/src/util/ai-tools.js +6 -0
- package/dist/esm/src/util/api-indexing.js +57 -0
- package/dist/esm/src/util/detect-cycles.js +45 -0
- package/dist/esm/src/util/find-shape-at-path.js +53 -0
- package/dist/esm/src/util/form-config.js +63 -0
- package/dist/esm/src/util/get-conflicting-properties.js +55 -0
- package/dist/esm/src/util/get-return-shape.js +30 -0
- package/dist/esm/src/util/has-arg.js +13 -0
- package/dist/esm/src/util/merge.js +247 -0
- package/dist/esm/src/util/patch-schema.js +42 -0
- package/dist/esm/src/util/shapes.js +22 -0
- package/dist/esm/src/validate.js +1073 -0
- package/dist/esm/src/versions.js +4 -0
- package/dist/esm/src/workflows.js +66 -0
- package/dist/types/src/agents.d.ts +11 -0
- package/dist/types/src/api-version.d.ts +5 -0
- package/dist/types/src/auth-schemas.d.ts +104 -0
- package/dist/types/src/builtin-schema.d.ts +8 -0
- package/dist/types/src/constants.d.ts +1 -0
- package/dist/types/src/content-schema-transform.d.ts +35 -0
- package/dist/types/src/create-input-schema.d.ts +9 -0
- package/dist/types/src/enum.d.ts +2 -0
- package/dist/types/src/flatten-templates.d.ts +2 -0
- package/dist/types/src/get-is-leaf.d.ts +3 -0
- package/dist/types/src/index.d.ts +46 -0
- package/dist/types/src/interfaces.d.ts +12 -0
- package/dist/types/src/layers/layers.d.ts +26 -0
- package/dist/types/src/layers/refs.d.ts +103 -0
- package/dist/types/src/layers/type-utils.d.ts +59 -0
- package/dist/types/src/layers/visitor.d.ts +5 -0
- package/dist/types/src/migration/index.d.ts +63 -0
- package/dist/types/src/migration/to/v3.0.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.1.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.10.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.11.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.12.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.12.1.d.ts +4 -0
- package/dist/types/src/migration/to/v3.12.2.d.ts +4 -0
- package/dist/types/src/migration/to/v3.12.3.d.ts +4 -0
- package/dist/types/src/migration/to/v3.13.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.14.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.15.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.16.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.17.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.17.1.d.ts +4 -0
- package/dist/types/src/migration/to/v3.18.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.18.1.d.ts +4 -0
- package/dist/types/src/migration/to/v3.18.2.d.ts +4 -0
- package/dist/types/src/migration/to/v3.19.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.2.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.20.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.21.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.22.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.23.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.24.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.25.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.26.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.27.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.28.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.29.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.3.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.30.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.31.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.32.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.33.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.34.0.d.ts +6 -0
- package/dist/types/src/migration/to/v3.35.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.36.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.37.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.38.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.39.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.4.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.40.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.41.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.42.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.43.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.44.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.45.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.46.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.47.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.48.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.49.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.5.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.5.1.d.ts +4 -0
- package/dist/types/src/migration/to/v3.50.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.6.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.7.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.8.0.d.ts +4 -0
- package/dist/types/src/migration/to/v3.9.0.d.ts +4 -0
- package/dist/types/src/migration/types.d.ts +20 -0
- package/dist/types/src/migration/utils.d.ts +2 -0
- package/dist/types/src/mocks.d.ts +13 -0
- package/dist/types/src/models/project-schema.d.ts +35 -0
- package/dist/types/src/models/query.d.ts +17 -0
- package/dist/types/src/models/service.d.ts +12 -0
- package/dist/types/src/models/shape.d.ts +41 -0
- package/dist/types/src/patterns.d.ts +12 -0
- package/dist/types/src/project-schema/index.d.ts +184 -0
- package/dist/types/src/project-schema/latest.d.ts +2032 -0
- package/dist/types/src/project-schema/migrate.d.ts +4 -0
- package/dist/types/src/project-schema/v1.0.0.d.ts +299 -0
- package/dist/types/src/project-schema/v3.0.0.d.ts +478 -0
- package/dist/types/src/project-schema/v3.1.0.d.ts +621 -0
- package/dist/types/src/project-schema/v3.10.0.d.ts +1201 -0
- package/dist/types/src/project-schema/v3.11.0.d.ts +1210 -0
- package/dist/types/src/project-schema/v3.12.0.d.ts +1214 -0
- package/dist/types/src/project-schema/v3.12.1.d.ts +1273 -0
- package/dist/types/src/project-schema/v3.12.2.d.ts +1283 -0
- package/dist/types/src/project-schema/v3.12.3.d.ts +1306 -0
- package/dist/types/src/project-schema/v3.13.0.d.ts +1317 -0
- package/dist/types/src/project-schema/v3.13.1.d.ts +1412 -0
- package/dist/types/src/project-schema/v3.14.0.d.ts +1436 -0
- package/dist/types/src/project-schema/v3.15.0.d.ts +1458 -0
- package/dist/types/src/project-schema/v3.16.0.d.ts +1470 -0
- package/dist/types/src/project-schema/v3.17.0.d.ts +1467 -0
- package/dist/types/src/project-schema/v3.17.1.d.ts +1468 -0
- package/dist/types/src/project-schema/v3.18.0.d.ts +1333 -0
- package/dist/types/src/project-schema/v3.18.1.d.ts +1332 -0
- package/dist/types/src/project-schema/v3.18.2.d.ts +1332 -0
- package/dist/types/src/project-schema/v3.19.0.d.ts +1336 -0
- package/dist/types/src/project-schema/v3.2.0.d.ts +632 -0
- package/dist/types/src/project-schema/v3.20.0.d.ts +1336 -0
- package/dist/types/src/project-schema/v3.21.0.d.ts +1338 -0
- package/dist/types/src/project-schema/v3.22.0.d.ts +1344 -0
- package/dist/types/src/project-schema/v3.23.0.d.ts +1376 -0
- package/dist/types/src/project-schema/v3.24.0.d.ts +1364 -0
- package/dist/types/src/project-schema/v3.25.0.d.ts +1363 -0
- package/dist/types/src/project-schema/v3.26.0.d.ts +1388 -0
- package/dist/types/src/project-schema/v3.27.0.d.ts +1397 -0
- package/dist/types/src/project-schema/v3.28.0.d.ts +1416 -0
- package/dist/types/src/project-schema/v3.29.0.d.ts +1423 -0
- package/dist/types/src/project-schema/v3.3.0.d.ts +632 -0
- package/dist/types/src/project-schema/v3.30.0.d.ts +1416 -0
- package/dist/types/src/project-schema/v3.31.0.d.ts +1448 -0
- package/dist/types/src/project-schema/v3.32.0.d.ts +1439 -0
- package/dist/types/src/project-schema/v3.33.0.d.ts +1445 -0
- package/dist/types/src/project-schema/v3.34.0.d.ts +1445 -0
- package/dist/types/src/project-schema/v3.35.0.d.ts +1464 -0
- package/dist/types/src/project-schema/v3.36.0.d.ts +1470 -0
- package/dist/types/src/project-schema/v3.37.0.d.ts +1522 -0
- package/dist/types/src/project-schema/v3.38.0.d.ts +1522 -0
- package/dist/types/src/project-schema/v3.39.0.d.ts +1529 -0
- package/dist/types/src/project-schema/v3.4.0.d.ts +624 -0
- package/dist/types/src/project-schema/v3.40.0.d.ts +1530 -0
- package/dist/types/src/project-schema/v3.41.0.d.ts +1530 -0
- package/dist/types/src/project-schema/v3.42.0.d.ts +1534 -0
- package/dist/types/src/project-schema/v3.43.0.d.ts +1536 -0
- package/dist/types/src/project-schema/v3.44.0.d.ts +1621 -0
- package/dist/types/src/project-schema/v3.45.0.d.ts +1650 -0
- package/dist/types/src/project-schema/v3.46.0.d.ts +1703 -0
- package/dist/types/src/project-schema/v3.47.0.d.ts +1736 -0
- package/dist/types/src/project-schema/v3.48.0.d.ts +1989 -0
- package/dist/types/src/project-schema/v3.49.0.d.ts +1998 -0
- package/dist/types/src/project-schema/v3.5.0.d.ts +649 -0
- package/dist/types/src/project-schema/v3.5.1.d.ts +649 -0
- package/dist/types/src/project-schema/v3.50.0.d.ts +2032 -0
- package/dist/types/src/project-schema/v3.6.0.d.ts +658 -0
- package/dist/types/src/project-schema/v3.7.0.d.ts +961 -0
- package/dist/types/src/project-schema/v3.8.0.d.ts +979 -0
- package/dist/types/src/project-schema/v3.9.0.d.ts +1178 -0
- package/dist/types/src/project-schema/v4.0.0.d.ts +1328 -0
- package/dist/types/src/refs.d.ts +227 -0
- package/dist/types/src/relationships.d.ts +36 -0
- package/dist/types/src/scalars.d.ts +2 -0
- package/dist/types/src/schema-transform.d.ts +19 -0
- package/dist/types/src/schema-util.d.ts +211 -0
- package/dist/types/src/schemas/index.d.ts +6 -0
- package/dist/types/src/services/services.d.ts +31 -0
- package/dist/types/src/services/types.d.ts +11 -0
- package/dist/types/src/services/util.d.ts +16 -0
- package/dist/types/src/taxonomies.d.ts +15 -0
- package/dist/types/src/template-shapes/index.d.ts +7 -0
- package/dist/types/src/template-shapes/names.d.ts +10 -0
- package/dist/types/src/template-shapes/templates.d.ts +32 -0
- package/dist/types/src/template-shapes/types.d.ts +15 -0
- package/dist/types/src/template-shapes/where.d.ts +37 -0
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/transforms.d.ts +13 -0
- package/dist/types/src/types/types.d.ts +210 -0
- package/dist/types/src/types/utils.d.ts +117 -0
- package/dist/types/src/unions.d.ts +14 -0
- package/dist/types/src/user-schema.d.ts +38 -0
- package/dist/types/src/util/ai-tools.d.ts +3 -0
- package/dist/types/src/util/api-indexing.d.ts +9 -0
- package/dist/types/src/util/detect-cycles.d.ts +7 -0
- package/dist/types/src/util/find-shape-at-path.d.ts +21 -0
- package/dist/types/src/util/form-config.d.ts +11 -0
- package/dist/types/src/util/get-conflicting-properties.d.ts +6 -0
- package/dist/types/src/util/get-return-shape.d.ts +4 -0
- package/dist/types/src/util/has-arg.d.ts +4 -0
- package/dist/types/src/util/merge.d.ts +15 -0
- package/dist/types/src/util/patch-schema.d.ts +8 -0
- package/dist/types/src/util/shapes.d.ts +5 -0
- package/dist/types/src/validate.d.ts +70 -0
- package/dist/types/src/versions.d.ts +4 -0
- package/dist/types/src/workflows.d.ts +14 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -0
- package/package.json +47 -23
- package/dist/agents.d.ts +0 -12
- package/dist/agents.d.ts.map +0 -1
- package/dist/agents.js +0 -61
- package/dist/api-version.d.ts +0 -6
- package/dist/api-version.d.ts.map +0 -1
- package/dist/api-version.js +0 -25
- package/dist/auth-schemas.d.ts +0 -105
- package/dist/auth-schemas.d.ts.map +0 -1
- package/dist/auth-schemas.js +0 -5
- package/dist/builtin-schema.d.ts +0 -9
- package/dist/builtin-schema.d.ts.map +0 -1
- package/dist/builtin-schema.js +0 -681
- package/dist/content-schema-transform.d.ts +0 -48
- package/dist/content-schema-transform.d.ts.map +0 -1
- package/dist/content-schema-transform.js +0 -207
- package/dist/create-input-schema.d.ts +0 -10
- package/dist/create-input-schema.d.ts.map +0 -1
- package/dist/create-input-schema.js +0 -74
- package/dist/enum.d.ts +0 -3
- package/dist/enum.d.ts.map +0 -1
- package/dist/enum.js +0 -15
- package/dist/flatten-templates.d.ts +0 -3
- package/dist/flatten-templates.d.ts.map +0 -1
- package/dist/flatten-templates.js +0 -30
- package/dist/get-is-leaf.d.ts +0 -4
- package/dist/get-is-leaf.d.ts.map +0 -1
- package/dist/get-is-leaf.js +0 -58
- package/dist/index.d.ts +0 -33
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -335
- package/dist/interfaces.d.ts +0 -13
- package/dist/interfaces.d.ts.map +0 -1
- package/dist/interfaces.js +0 -99
- package/dist/layers/layers.d.ts +0 -27
- package/dist/layers/layers.d.ts.map +0 -1
- package/dist/layers/layers.js +0 -324
- package/dist/layers/refs.d.ts +0 -104
- package/dist/layers/refs.d.ts.map +0 -1
- package/dist/layers/refs.js +0 -279
- package/dist/layers/type-utils.d.ts +0 -60
- package/dist/layers/type-utils.d.ts.map +0 -1
- package/dist/layers/type-utils.js +0 -166
- package/dist/layers/visitor.d.ts +0 -6
- package/dist/layers/visitor.d.ts.map +0 -1
- package/dist/layers/visitor.js +0 -42
- package/dist/migration/index.d.ts +0 -64
- package/dist/migration/index.d.ts.map +0 -1
- package/dist/migration/index.js +0 -142
- package/dist/migration/to/utils/v3.34.0-utils.d.ts +0 -1
- package/dist/migration/to/utils/v3.34.0-utils.d.ts.map +0 -1
- package/dist/migration/to/utils/v3.34.0-utils.js +0 -1
- package/dist/migration/to/v3.0.0.d.ts +0 -5
- package/dist/migration/to/v3.0.0.d.ts.map +0 -1
- package/dist/migration/to/v3.0.0.js +0 -263
- package/dist/migration/to/v3.1.0.d.ts +0 -5
- package/dist/migration/to/v3.1.0.d.ts.map +0 -1
- package/dist/migration/to/v3.1.0.js +0 -206
- package/dist/migration/to/v3.10.0.d.ts +0 -5
- package/dist/migration/to/v3.10.0.d.ts.map +0 -1
- package/dist/migration/to/v3.10.0.js +0 -91
- package/dist/migration/to/v3.11.0.d.ts +0 -5
- package/dist/migration/to/v3.11.0.d.ts.map +0 -1
- package/dist/migration/to/v3.11.0.js +0 -97
- package/dist/migration/to/v3.12.0.d.ts +0 -5
- package/dist/migration/to/v3.12.0.d.ts.map +0 -1
- package/dist/migration/to/v3.12.0.js +0 -16
- package/dist/migration/to/v3.12.1.d.ts +0 -5
- package/dist/migration/to/v3.12.1.d.ts.map +0 -1
- package/dist/migration/to/v3.12.1.js +0 -16
- package/dist/migration/to/v3.12.2.d.ts +0 -5
- package/dist/migration/to/v3.12.2.d.ts.map +0 -1
- package/dist/migration/to/v3.12.2.js +0 -16
- package/dist/migration/to/v3.12.3.d.ts +0 -5
- package/dist/migration/to/v3.12.3.d.ts.map +0 -1
- package/dist/migration/to/v3.12.3.js +0 -83
- package/dist/migration/to/v3.13.0.d.ts +0 -5
- package/dist/migration/to/v3.13.0.d.ts.map +0 -1
- package/dist/migration/to/v3.13.0.js +0 -26
- package/dist/migration/to/v3.14.0.d.ts +0 -5
- package/dist/migration/to/v3.14.0.d.ts.map +0 -1
- package/dist/migration/to/v3.14.0.js +0 -16
- package/dist/migration/to/v3.15.0.d.ts +0 -5
- package/dist/migration/to/v3.15.0.d.ts.map +0 -1
- package/dist/migration/to/v3.15.0.js +0 -16
- package/dist/migration/to/v3.16.0.d.ts +0 -5
- package/dist/migration/to/v3.16.0.d.ts.map +0 -1
- package/dist/migration/to/v3.16.0.js +0 -16
- package/dist/migration/to/v3.17.0.d.ts +0 -5
- package/dist/migration/to/v3.17.0.d.ts.map +0 -1
- package/dist/migration/to/v3.17.0.js +0 -34
- package/dist/migration/to/v3.17.1.d.ts +0 -5
- package/dist/migration/to/v3.17.1.d.ts.map +0 -1
- package/dist/migration/to/v3.17.1.js +0 -16
- package/dist/migration/to/v3.18.0.d.ts +0 -5
- package/dist/migration/to/v3.18.0.d.ts.map +0 -1
- package/dist/migration/to/v3.18.0.js +0 -71
- package/dist/migration/to/v3.18.1.d.ts +0 -5
- package/dist/migration/to/v3.18.1.d.ts.map +0 -1
- package/dist/migration/to/v3.18.1.js +0 -22
- package/dist/migration/to/v3.18.2.d.ts +0 -5
- package/dist/migration/to/v3.18.2.d.ts.map +0 -1
- package/dist/migration/to/v3.18.2.js +0 -29
- package/dist/migration/to/v3.19.0.d.ts +0 -5
- package/dist/migration/to/v3.19.0.d.ts.map +0 -1
- package/dist/migration/to/v3.19.0.js +0 -16
- package/dist/migration/to/v3.2.0.d.ts +0 -5
- package/dist/migration/to/v3.2.0.d.ts.map +0 -1
- package/dist/migration/to/v3.2.0.js +0 -16
- package/dist/migration/to/v3.20.0.d.ts +0 -5
- package/dist/migration/to/v3.20.0.d.ts.map +0 -1
- package/dist/migration/to/v3.20.0.js +0 -32
- package/dist/migration/to/v3.21.0.d.ts +0 -5
- package/dist/migration/to/v3.21.0.d.ts.map +0 -1
- package/dist/migration/to/v3.21.0.js +0 -16
- package/dist/migration/to/v3.22.0.d.ts +0 -5
- package/dist/migration/to/v3.22.0.d.ts.map +0 -1
- package/dist/migration/to/v3.22.0.js +0 -38
- package/dist/migration/to/v3.23.0.d.ts +0 -5
- package/dist/migration/to/v3.23.0.d.ts.map +0 -1
- package/dist/migration/to/v3.23.0.js +0 -16
- package/dist/migration/to/v3.24.0.d.ts +0 -5
- package/dist/migration/to/v3.24.0.d.ts.map +0 -1
- package/dist/migration/to/v3.24.0.js +0 -22
- package/dist/migration/to/v3.25.0.d.ts +0 -5
- package/dist/migration/to/v3.25.0.d.ts.map +0 -1
- package/dist/migration/to/v3.25.0.js +0 -20
- package/dist/migration/to/v3.26.0.d.ts +0 -5
- package/dist/migration/to/v3.26.0.d.ts.map +0 -1
- package/dist/migration/to/v3.26.0.js +0 -16
- package/dist/migration/to/v3.27.0.d.ts +0 -5
- package/dist/migration/to/v3.27.0.d.ts.map +0 -1
- package/dist/migration/to/v3.27.0.js +0 -16
- package/dist/migration/to/v3.28.0.d.ts +0 -5
- package/dist/migration/to/v3.28.0.d.ts.map +0 -1
- package/dist/migration/to/v3.28.0.js +0 -16
- package/dist/migration/to/v3.29.0.d.ts +0 -5
- package/dist/migration/to/v3.29.0.d.ts.map +0 -1
- package/dist/migration/to/v3.29.0.js +0 -16
- package/dist/migration/to/v3.3.0.d.ts +0 -5
- package/dist/migration/to/v3.3.0.d.ts.map +0 -1
- package/dist/migration/to/v3.3.0.js +0 -22
- package/dist/migration/to/v3.30.0.d.ts +0 -5
- package/dist/migration/to/v3.30.0.d.ts.map +0 -1
- package/dist/migration/to/v3.30.0.js +0 -16
- package/dist/migration/to/v3.31.0.d.ts +0 -5
- package/dist/migration/to/v3.31.0.d.ts.map +0 -1
- package/dist/migration/to/v3.31.0.js +0 -42
- package/dist/migration/to/v3.32.0.d.ts +0 -5
- package/dist/migration/to/v3.32.0.d.ts.map +0 -1
- package/dist/migration/to/v3.32.0.js +0 -97
- package/dist/migration/to/v3.33.0.d.ts +0 -5
- package/dist/migration/to/v3.33.0.d.ts.map +0 -1
- package/dist/migration/to/v3.33.0.js +0 -16
- package/dist/migration/to/v3.34.0.d.ts +0 -7
- package/dist/migration/to/v3.34.0.d.ts.map +0 -1
- package/dist/migration/to/v3.34.0.js +0 -150
- package/dist/migration/to/v3.35.0.d.ts +0 -5
- package/dist/migration/to/v3.35.0.d.ts.map +0 -1
- package/dist/migration/to/v3.35.0.js +0 -16
- package/dist/migration/to/v3.36.0.d.ts +0 -5
- package/dist/migration/to/v3.36.0.d.ts.map +0 -1
- package/dist/migration/to/v3.36.0.js +0 -29
- package/dist/migration/to/v3.37.0.d.ts +0 -5
- package/dist/migration/to/v3.37.0.d.ts.map +0 -1
- package/dist/migration/to/v3.37.0.js +0 -16
- package/dist/migration/to/v3.38.0.d.ts +0 -5
- package/dist/migration/to/v3.38.0.d.ts.map +0 -1
- package/dist/migration/to/v3.38.0.js +0 -16
- package/dist/migration/to/v3.39.0.d.ts +0 -5
- package/dist/migration/to/v3.39.0.d.ts.map +0 -1
- package/dist/migration/to/v3.39.0.js +0 -54
- package/dist/migration/to/v3.4.0.d.ts +0 -5
- package/dist/migration/to/v3.4.0.d.ts.map +0 -1
- package/dist/migration/to/v3.4.0.js +0 -16
- package/dist/migration/to/v3.40.0.d.ts +0 -5
- package/dist/migration/to/v3.40.0.d.ts.map +0 -1
- package/dist/migration/to/v3.40.0.js +0 -33
- package/dist/migration/to/v3.41.0.d.ts +0 -5
- package/dist/migration/to/v3.41.0.d.ts.map +0 -1
- package/dist/migration/to/v3.41.0.js +0 -16
- package/dist/migration/to/v3.42.0.d.ts +0 -5
- package/dist/migration/to/v3.42.0.d.ts.map +0 -1
- package/dist/migration/to/v3.42.0.js +0 -16
- package/dist/migration/to/v3.43.0.d.ts +0 -5
- package/dist/migration/to/v3.43.0.d.ts.map +0 -1
- package/dist/migration/to/v3.43.0.js +0 -16
- package/dist/migration/to/v3.44.0.d.ts +0 -5
- package/dist/migration/to/v3.44.0.d.ts.map +0 -1
- package/dist/migration/to/v3.44.0.js +0 -16
- package/dist/migration/to/v3.45.0.d.ts +0 -5
- package/dist/migration/to/v3.45.0.d.ts.map +0 -1
- package/dist/migration/to/v3.45.0.js +0 -16
- package/dist/migration/to/v3.46.0.d.ts +0 -5
- package/dist/migration/to/v3.46.0.d.ts.map +0 -1
- package/dist/migration/to/v3.46.0.js +0 -37
- package/dist/migration/to/v3.47.0.d.ts +0 -5
- package/dist/migration/to/v3.47.0.d.ts.map +0 -1
- package/dist/migration/to/v3.47.0.js +0 -16
- package/dist/migration/to/v3.48.0.d.ts +0 -5
- package/dist/migration/to/v3.48.0.d.ts.map +0 -1
- package/dist/migration/to/v3.48.0.js +0 -16
- package/dist/migration/to/v3.49.0.d.ts +0 -5
- package/dist/migration/to/v3.49.0.d.ts.map +0 -1
- package/dist/migration/to/v3.49.0.js +0 -16
- package/dist/migration/to/v3.5.0.d.ts +0 -5
- package/dist/migration/to/v3.5.0.d.ts.map +0 -1
- package/dist/migration/to/v3.5.0.js +0 -16
- package/dist/migration/to/v3.5.1.d.ts +0 -5
- package/dist/migration/to/v3.5.1.d.ts.map +0 -1
- package/dist/migration/to/v3.5.1.js +0 -16
- package/dist/migration/to/v3.50.0.d.ts +0 -5
- package/dist/migration/to/v3.50.0.d.ts.map +0 -1
- package/dist/migration/to/v3.50.0.js +0 -16
- package/dist/migration/to/v3.6.0.d.ts +0 -5
- package/dist/migration/to/v3.6.0.d.ts.map +0 -1
- package/dist/migration/to/v3.6.0.js +0 -16
- package/dist/migration/to/v3.7.0.d.ts +0 -5
- package/dist/migration/to/v3.7.0.d.ts.map +0 -1
- package/dist/migration/to/v3.7.0.js +0 -16
- package/dist/migration/to/v3.8.0.d.ts +0 -5
- package/dist/migration/to/v3.8.0.d.ts.map +0 -1
- package/dist/migration/to/v3.8.0.js +0 -16
- package/dist/migration/to/v3.9.0.d.ts +0 -5
- package/dist/migration/to/v3.9.0.d.ts.map +0 -1
- package/dist/migration/to/v3.9.0.js +0 -84
- package/dist/migration/types.d.ts +0 -21
- package/dist/migration/types.d.ts.map +0 -1
- package/dist/migration/types.js +0 -5
- package/dist/migration/utils.d.ts +0 -3
- package/dist/migration/utils.d.ts.map +0 -1
- package/dist/migration/utils.js +0 -13
- package/dist/mocks.d.ts +0 -14
- package/dist/mocks.d.ts.map +0 -1
- package/dist/mocks.js +0 -71
- package/dist/models/project-schema.d.ts +0 -36
- package/dist/models/project-schema.d.ts.map +0 -1
- package/dist/models/project-schema.js +0 -98
- package/dist/models/query.d.ts +0 -18
- package/dist/models/query.d.ts.map +0 -1
- package/dist/models/query.js +0 -35
- package/dist/models/service.d.ts +0 -13
- package/dist/models/service.d.ts.map +0 -1
- package/dist/models/service.js +0 -25
- package/dist/models/shape.d.ts +0 -42
- package/dist/models/shape.d.ts.map +0 -1
- package/dist/models/shape.js +0 -86
- package/dist/patterns.d.ts +0 -13
- package/dist/patterns.d.ts.map +0 -1
- package/dist/patterns.js +0 -5
- package/dist/project-schema/index.d.ts +0 -185
- package/dist/project-schema/index.d.ts.map +0 -1
- package/dist/project-schema/index.js +0 -879
- package/dist/project-schema/latest.d.ts +0 -2033
- package/dist/project-schema/latest.d.ts.map +0 -1
- package/dist/project-schema/latest.js +0 -5
- package/dist/project-schema/migrate.d.ts +0 -5
- package/dist/project-schema/migrate.d.ts.map +0 -1
- package/dist/project-schema/migrate.js +0 -201
- package/dist/project-schema/v1.0.0.d.ts +0 -300
- package/dist/project-schema/v1.0.0.d.ts.map +0 -1
- package/dist/project-schema/v1.0.0.js +0 -5
- package/dist/project-schema/v3.0.0.d.ts +0 -479
- package/dist/project-schema/v3.0.0.d.ts.map +0 -1
- package/dist/project-schema/v3.0.0.js +0 -5
- package/dist/project-schema/v3.1.0.d.ts +0 -622
- package/dist/project-schema/v3.1.0.d.ts.map +0 -1
- package/dist/project-schema/v3.1.0.js +0 -5
- package/dist/project-schema/v3.10.0.d.ts +0 -1202
- package/dist/project-schema/v3.10.0.d.ts.map +0 -1
- package/dist/project-schema/v3.10.0.js +0 -5
- package/dist/project-schema/v3.11.0.d.ts +0 -1211
- package/dist/project-schema/v3.11.0.d.ts.map +0 -1
- package/dist/project-schema/v3.11.0.js +0 -5
- package/dist/project-schema/v3.12.0.d.ts +0 -1215
- package/dist/project-schema/v3.12.0.d.ts.map +0 -1
- package/dist/project-schema/v3.12.0.js +0 -5
- package/dist/project-schema/v3.12.1.d.ts +0 -1274
- package/dist/project-schema/v3.12.1.d.ts.map +0 -1
- package/dist/project-schema/v3.12.1.js +0 -5
- package/dist/project-schema/v3.12.2.d.ts +0 -1284
- package/dist/project-schema/v3.12.2.d.ts.map +0 -1
- package/dist/project-schema/v3.12.2.js +0 -5
- package/dist/project-schema/v3.12.3.d.ts +0 -1307
- package/dist/project-schema/v3.12.3.d.ts.map +0 -1
- package/dist/project-schema/v3.12.3.js +0 -5
- package/dist/project-schema/v3.13.0.d.ts +0 -1318
- package/dist/project-schema/v3.13.0.d.ts.map +0 -1
- package/dist/project-schema/v3.13.0.js +0 -5
- package/dist/project-schema/v3.13.1.d.ts +0 -1413
- package/dist/project-schema/v3.13.1.d.ts.map +0 -1
- package/dist/project-schema/v3.13.1.js +0 -5
- package/dist/project-schema/v3.14.0.d.ts +0 -1437
- package/dist/project-schema/v3.14.0.d.ts.map +0 -1
- package/dist/project-schema/v3.14.0.js +0 -5
- package/dist/project-schema/v3.15.0.d.ts +0 -1459
- package/dist/project-schema/v3.15.0.d.ts.map +0 -1
- package/dist/project-schema/v3.15.0.js +0 -5
- package/dist/project-schema/v3.16.0.d.ts +0 -1471
- package/dist/project-schema/v3.16.0.d.ts.map +0 -1
- package/dist/project-schema/v3.16.0.js +0 -5
- package/dist/project-schema/v3.17.0.d.ts +0 -1468
- package/dist/project-schema/v3.17.0.d.ts.map +0 -1
- package/dist/project-schema/v3.17.0.js +0 -5
- package/dist/project-schema/v3.17.1.d.ts +0 -1469
- package/dist/project-schema/v3.17.1.d.ts.map +0 -1
- package/dist/project-schema/v3.17.1.js +0 -5
- package/dist/project-schema/v3.18.0.d.ts +0 -1334
- package/dist/project-schema/v3.18.0.d.ts.map +0 -1
- package/dist/project-schema/v3.18.0.js +0 -5
- package/dist/project-schema/v3.18.1.d.ts +0 -1333
- package/dist/project-schema/v3.18.1.d.ts.map +0 -1
- package/dist/project-schema/v3.18.1.js +0 -5
- package/dist/project-schema/v3.18.2.d.ts +0 -1333
- package/dist/project-schema/v3.18.2.d.ts.map +0 -1
- package/dist/project-schema/v3.18.2.js +0 -5
- package/dist/project-schema/v3.19.0.d.ts +0 -1337
- package/dist/project-schema/v3.19.0.d.ts.map +0 -1
- package/dist/project-schema/v3.19.0.js +0 -5
- package/dist/project-schema/v3.2.0.d.ts +0 -633
- package/dist/project-schema/v3.2.0.d.ts.map +0 -1
- package/dist/project-schema/v3.2.0.js +0 -5
- package/dist/project-schema/v3.20.0.d.ts +0 -1337
- package/dist/project-schema/v3.20.0.d.ts.map +0 -1
- package/dist/project-schema/v3.20.0.js +0 -5
- package/dist/project-schema/v3.21.0.d.ts +0 -1339
- package/dist/project-schema/v3.21.0.d.ts.map +0 -1
- package/dist/project-schema/v3.21.0.js +0 -5
- package/dist/project-schema/v3.22.0.d.ts +0 -1345
- package/dist/project-schema/v3.22.0.d.ts.map +0 -1
- package/dist/project-schema/v3.22.0.js +0 -5
- package/dist/project-schema/v3.23.0.d.ts +0 -1377
- package/dist/project-schema/v3.23.0.d.ts.map +0 -1
- package/dist/project-schema/v3.23.0.js +0 -5
- package/dist/project-schema/v3.24.0.d.ts +0 -1365
- package/dist/project-schema/v3.24.0.d.ts.map +0 -1
- package/dist/project-schema/v3.24.0.js +0 -5
- package/dist/project-schema/v3.25.0.d.ts +0 -1364
- package/dist/project-schema/v3.25.0.d.ts.map +0 -1
- package/dist/project-schema/v3.25.0.js +0 -5
- package/dist/project-schema/v3.26.0.d.ts +0 -1389
- package/dist/project-schema/v3.26.0.d.ts.map +0 -1
- package/dist/project-schema/v3.26.0.js +0 -5
- package/dist/project-schema/v3.27.0.d.ts +0 -1398
- package/dist/project-schema/v3.27.0.d.ts.map +0 -1
- package/dist/project-schema/v3.27.0.js +0 -5
- package/dist/project-schema/v3.28.0.d.ts +0 -1417
- package/dist/project-schema/v3.28.0.d.ts.map +0 -1
- package/dist/project-schema/v3.28.0.js +0 -5
- package/dist/project-schema/v3.29.0.d.ts +0 -1424
- package/dist/project-schema/v3.29.0.d.ts.map +0 -1
- package/dist/project-schema/v3.29.0.js +0 -5
- package/dist/project-schema/v3.3.0.d.ts +0 -633
- package/dist/project-schema/v3.3.0.d.ts.map +0 -1
- package/dist/project-schema/v3.3.0.js +0 -5
- package/dist/project-schema/v3.30.0.d.ts +0 -1417
- package/dist/project-schema/v3.30.0.d.ts.map +0 -1
- package/dist/project-schema/v3.30.0.js +0 -5
- package/dist/project-schema/v3.31.0.d.ts +0 -1449
- package/dist/project-schema/v3.31.0.d.ts.map +0 -1
- package/dist/project-schema/v3.31.0.js +0 -5
- package/dist/project-schema/v3.32.0.d.ts +0 -1440
- package/dist/project-schema/v3.32.0.d.ts.map +0 -1
- package/dist/project-schema/v3.32.0.js +0 -5
- package/dist/project-schema/v3.33.0.d.ts +0 -1446
- package/dist/project-schema/v3.33.0.d.ts.map +0 -1
- package/dist/project-schema/v3.33.0.js +0 -5
- package/dist/project-schema/v3.34.0.d.ts +0 -1446
- package/dist/project-schema/v3.34.0.d.ts.map +0 -1
- package/dist/project-schema/v3.34.0.js +0 -5
- package/dist/project-schema/v3.35.0.d.ts +0 -1465
- package/dist/project-schema/v3.35.0.d.ts.map +0 -1
- package/dist/project-schema/v3.35.0.js +0 -5
- package/dist/project-schema/v3.36.0.d.ts +0 -1471
- package/dist/project-schema/v3.36.0.d.ts.map +0 -1
- package/dist/project-schema/v3.36.0.js +0 -5
- package/dist/project-schema/v3.37.0.d.ts +0 -1523
- package/dist/project-schema/v3.37.0.d.ts.map +0 -1
- package/dist/project-schema/v3.37.0.js +0 -5
- package/dist/project-schema/v3.38.0.d.ts +0 -1523
- package/dist/project-schema/v3.38.0.d.ts.map +0 -1
- package/dist/project-schema/v3.38.0.js +0 -5
- package/dist/project-schema/v3.39.0.d.ts +0 -1530
- package/dist/project-schema/v3.39.0.d.ts.map +0 -1
- package/dist/project-schema/v3.39.0.js +0 -5
- package/dist/project-schema/v3.4.0.d.ts +0 -625
- package/dist/project-schema/v3.4.0.d.ts.map +0 -1
- package/dist/project-schema/v3.4.0.js +0 -5
- package/dist/project-schema/v3.40.0.d.ts +0 -1531
- package/dist/project-schema/v3.40.0.d.ts.map +0 -1
- package/dist/project-schema/v3.40.0.js +0 -5
- package/dist/project-schema/v3.41.0.d.ts +0 -1531
- package/dist/project-schema/v3.41.0.d.ts.map +0 -1
- package/dist/project-schema/v3.41.0.js +0 -5
- package/dist/project-schema/v3.42.0.d.ts +0 -1535
- package/dist/project-schema/v3.42.0.d.ts.map +0 -1
- package/dist/project-schema/v3.42.0.js +0 -5
- package/dist/project-schema/v3.43.0.d.ts +0 -1537
- package/dist/project-schema/v3.43.0.d.ts.map +0 -1
- package/dist/project-schema/v3.43.0.js +0 -5
- package/dist/project-schema/v3.44.0.d.ts +0 -1622
- package/dist/project-schema/v3.44.0.d.ts.map +0 -1
- package/dist/project-schema/v3.44.0.js +0 -5
- package/dist/project-schema/v3.45.0.d.ts +0 -1651
- package/dist/project-schema/v3.45.0.d.ts.map +0 -1
- package/dist/project-schema/v3.45.0.js +0 -5
- package/dist/project-schema/v3.46.0.d.ts +0 -1704
- package/dist/project-schema/v3.46.0.d.ts.map +0 -1
- package/dist/project-schema/v3.46.0.js +0 -5
- package/dist/project-schema/v3.47.0.d.ts +0 -1737
- package/dist/project-schema/v3.47.0.d.ts.map +0 -1
- package/dist/project-schema/v3.47.0.js +0 -5
- package/dist/project-schema/v3.48.0.d.ts +0 -1990
- package/dist/project-schema/v3.48.0.d.ts.map +0 -1
- package/dist/project-schema/v3.48.0.js +0 -5
- package/dist/project-schema/v3.49.0.d.ts +0 -1999
- package/dist/project-schema/v3.49.0.d.ts.map +0 -1
- package/dist/project-schema/v3.49.0.js +0 -5
- package/dist/project-schema/v3.5.0.d.ts +0 -650
- package/dist/project-schema/v3.5.0.d.ts.map +0 -1
- package/dist/project-schema/v3.5.0.js +0 -5
- package/dist/project-schema/v3.5.1.d.ts +0 -650
- package/dist/project-schema/v3.5.1.d.ts.map +0 -1
- package/dist/project-schema/v3.5.1.js +0 -5
- package/dist/project-schema/v3.50.0.d.ts +0 -2033
- package/dist/project-schema/v3.50.0.d.ts.map +0 -1
- package/dist/project-schema/v3.50.0.js +0 -5
- package/dist/project-schema/v3.6.0.d.ts +0 -659
- package/dist/project-schema/v3.6.0.d.ts.map +0 -1
- package/dist/project-schema/v3.6.0.js +0 -5
- package/dist/project-schema/v3.7.0.d.ts +0 -962
- package/dist/project-schema/v3.7.0.d.ts.map +0 -1
- package/dist/project-schema/v3.7.0.js +0 -5
- package/dist/project-schema/v3.8.0.d.ts +0 -980
- package/dist/project-schema/v3.8.0.d.ts.map +0 -1
- package/dist/project-schema/v3.8.0.js +0 -5
- package/dist/project-schema/v3.9.0.d.ts +0 -1179
- package/dist/project-schema/v3.9.0.d.ts.map +0 -1
- package/dist/project-schema/v3.9.0.js +0 -5
- package/dist/project-schema/v4.0.0.d.ts +0 -1329
- package/dist/project-schema/v4.0.0.d.ts.map +0 -1
- package/dist/project-schema/v4.0.0.js +0 -5
- package/dist/refs.d.ts +0 -228
- package/dist/refs.d.ts.map +0 -1
- package/dist/refs.js +0 -754
- package/dist/relationships.d.ts +0 -37
- package/dist/relationships.d.ts.map +0 -1
- package/dist/relationships.js +0 -243
- package/dist/scalars.d.ts +0 -3
- package/dist/scalars.d.ts.map +0 -1
- package/dist/scalars.js +0 -11
- package/dist/schema-transform.d.ts +0 -4
- package/dist/schema-transform.d.ts.map +0 -1
- package/dist/schema-transform.js +0 -47
- package/dist/schema-util.d.ts +0 -220
- package/dist/schema-util.d.ts.map +0 -1
- package/dist/schema-util.js +0 -1247
- package/dist/schemas/index.d.ts +0 -5
- package/dist/schemas/index.d.ts.map +0 -1
- package/dist/schemas/index.js +0 -96
- package/dist/schemas/index.ts +0 -152
- package/dist/services.d.ts +0 -55
- package/dist/services.d.ts.map +0 -1
- package/dist/services.js +0 -168
- package/dist/taxonomies.d.ts +0 -16
- package/dist/taxonomies.d.ts.map +0 -1
- package/dist/taxonomies.js +0 -41
- package/dist/template-shapes/index.d.ts +0 -8
- package/dist/template-shapes/index.d.ts.map +0 -1
- package/dist/template-shapes/index.js +0 -43
- package/dist/template-shapes/templates.d.ts +0 -42
- package/dist/template-shapes/templates.d.ts.map +0 -1
- package/dist/template-shapes/templates.js +0 -423
- package/dist/template-shapes/types.d.ts +0 -16
- package/dist/template-shapes/types.d.ts.map +0 -1
- package/dist/template-shapes/types.js +0 -13
- package/dist/template-shapes/where.d.ts +0 -38
- package/dist/template-shapes/where.d.ts.map +0 -1
- package/dist/template-shapes/where.js +0 -472
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -27
- package/dist/types/types.d.ts +0 -211
- package/dist/types/types.d.ts.map +0 -1
- package/dist/types/types.js +0 -60
- package/dist/types/utils.d.ts +0 -116
- package/dist/types/utils.d.ts.map +0 -1
- package/dist/types/utils.js +0 -364
- package/dist/unions.d.ts +0 -28
- package/dist/unions.d.ts.map +0 -1
- package/dist/unions.js +0 -137
- package/dist/user-schema.d.ts +0 -39
- package/dist/user-schema.d.ts.map +0 -1
- package/dist/user-schema.js +0 -5
- package/dist/util/ai-tools.d.ts +0 -4
- package/dist/util/ai-tools.d.ts.map +0 -1
- package/dist/util/ai-tools.js +0 -15
- package/dist/util/api-indexing.d.ts +0 -10
- package/dist/util/api-indexing.d.ts.map +0 -1
- package/dist/util/api-indexing.js +0 -75
- package/dist/util/detect-cycles.d.ts +0 -8
- package/dist/util/detect-cycles.d.ts.map +0 -1
- package/dist/util/detect-cycles.js +0 -54
- package/dist/util/find-shape-at-path.d.ts +0 -22
- package/dist/util/find-shape-at-path.d.ts.map +0 -1
- package/dist/util/find-shape-at-path.js +0 -61
- package/dist/util/form-config.d.ts +0 -12
- package/dist/util/form-config.d.ts.map +0 -1
- package/dist/util/form-config.js +0 -79
- package/dist/util/get-conflicting-properties.d.ts +0 -7
- package/dist/util/get-conflicting-properties.d.ts.map +0 -1
- package/dist/util/get-conflicting-properties.js +0 -59
- package/dist/util/get-return-shape.d.ts +0 -5
- package/dist/util/get-return-shape.d.ts.map +0 -1
- package/dist/util/get-return-shape.js +0 -38
- package/dist/util/has-arg.d.ts +0 -5
- package/dist/util/has-arg.d.ts.map +0 -1
- package/dist/util/has-arg.js +0 -20
- package/dist/util/index.d.ts +0 -11
- package/dist/util/index.d.ts.map +0 -1
- package/dist/util/index.js +0 -115
- package/dist/util/merge.d.ts +0 -16
- package/dist/util/merge.d.ts.map +0 -1
- package/dist/util/merge.js +0 -307
- package/dist/util/patch-schema.d.ts +0 -9
- package/dist/util/patch-schema.d.ts.map +0 -1
- package/dist/util/patch-schema.js +0 -52
- package/dist/validate.d.ts +0 -71
- package/dist/validate.d.ts.map +0 -1
- package/dist/validate.js +0 -1117
- package/dist/versions.d.ts +0 -5
- package/dist/versions.d.ts.map +0 -1
- package/dist/versions.js +0 -17
- package/dist/workflows.d.ts +0 -15
- package/dist/workflows.d.ts.map +0 -1
- package/dist/workflows.js +0 -81
- package/es/agents.js +0 -51
- package/es/api-version.js +0 -17
- package/es/auth-schemas.js +0 -1
- package/es/builtin-schema.js +0 -671
- package/es/content-schema-transform.js +0 -192
- package/es/create-input-schema.js +0 -67
- package/es/enum.js +0 -9
- package/es/flatten-templates.js +0 -23
- package/es/get-is-leaf.js +0 -52
- package/es/index.js +0 -33
- package/es/interfaces.js +0 -85
- package/es/layers/layers.js +0 -311
- package/es/layers/refs.js +0 -256
- package/es/layers/type-utils.js +0 -138
- package/es/layers/visitor.js +0 -35
- package/es/migration/index.js +0 -120
- package/es/migration/to/utils/v3.34.0-utils.js +0 -0
- package/es/migration/to/v3.0.0.js +0 -256
- package/es/migration/to/v3.1.0.js +0 -200
- package/es/migration/to/v3.10.0.js +0 -84
- package/es/migration/to/v3.11.0.js +0 -90
- package/es/migration/to/v3.12.0.js +0 -10
- package/es/migration/to/v3.12.1.js +0 -10
- package/es/migration/to/v3.12.2.js +0 -10
- package/es/migration/to/v3.12.3.js +0 -76
- package/es/migration/to/v3.13.0.js +0 -19
- package/es/migration/to/v3.14.0.js +0 -10
- package/es/migration/to/v3.15.0.js +0 -10
- package/es/migration/to/v3.16.0.js +0 -10
- package/es/migration/to/v3.17.0.js +0 -27
- package/es/migration/to/v3.17.1.js +0 -10
- package/es/migration/to/v3.18.0.js +0 -64
- package/es/migration/to/v3.18.1.js +0 -15
- package/es/migration/to/v3.18.2.js +0 -22
- package/es/migration/to/v3.19.0.js +0 -10
- package/es/migration/to/v3.2.0.js +0 -10
- package/es/migration/to/v3.20.0.js +0 -25
- package/es/migration/to/v3.21.0.js +0 -10
- package/es/migration/to/v3.22.0.js +0 -31
- package/es/migration/to/v3.23.0.js +0 -10
- package/es/migration/to/v3.24.0.js +0 -16
- package/es/migration/to/v3.25.0.js +0 -14
- package/es/migration/to/v3.26.0.js +0 -10
- package/es/migration/to/v3.27.0.js +0 -10
- package/es/migration/to/v3.28.0.js +0 -10
- package/es/migration/to/v3.29.0.js +0 -10
- package/es/migration/to/v3.3.0.js +0 -16
- package/es/migration/to/v3.30.0.js +0 -10
- package/es/migration/to/v3.31.0.js +0 -35
- package/es/migration/to/v3.32.0.js +0 -91
- package/es/migration/to/v3.33.0.js +0 -10
- package/es/migration/to/v3.34.0.js +0 -142
- package/es/migration/to/v3.35.0.js +0 -10
- package/es/migration/to/v3.36.0.js +0 -22
- package/es/migration/to/v3.37.0.js +0 -10
- package/es/migration/to/v3.38.0.js +0 -10
- package/es/migration/to/v3.39.0.js +0 -48
- package/es/migration/to/v3.4.0.js +0 -10
- package/es/migration/to/v3.40.0.js +0 -26
- package/es/migration/to/v3.41.0.js +0 -10
- package/es/migration/to/v3.42.0.js +0 -10
- package/es/migration/to/v3.43.0.js +0 -10
- package/es/migration/to/v3.44.0.js +0 -10
- package/es/migration/to/v3.45.0.js +0 -10
- package/es/migration/to/v3.46.0.js +0 -31
- package/es/migration/to/v3.47.0.js +0 -10
- package/es/migration/to/v3.48.0.js +0 -10
- package/es/migration/to/v3.49.0.js +0 -10
- package/es/migration/to/v3.5.0.js +0 -10
- package/es/migration/to/v3.5.1.js +0 -10
- package/es/migration/to/v3.50.0.js +0 -10
- package/es/migration/to/v3.6.0.js +0 -10
- package/es/migration/to/v3.7.0.js +0 -10
- package/es/migration/to/v3.8.0.js +0 -10
- package/es/migration/to/v3.9.0.js +0 -77
- package/es/migration/types.js +0 -1
- package/es/migration/utils.js +0 -6
- package/es/mocks.js +0 -62
- package/es/models/project-schema.js +0 -90
- package/es/models/query.js +0 -28
- package/es/models/service.js +0 -18
- package/es/models/shape.js +0 -79
- package/es/patterns.js +0 -1
- package/es/project-schema/index.js +0 -138
- package/es/project-schema/latest.js +0 -1
- package/es/project-schema/migrate.js +0 -195
- package/es/project-schema/v1.0.0.js +0 -1
- package/es/project-schema/v3.0.0.js +0 -1
- package/es/project-schema/v3.1.0.js +0 -1
- package/es/project-schema/v3.10.0.js +0 -1
- package/es/project-schema/v3.11.0.js +0 -1
- package/es/project-schema/v3.12.0.js +0 -1
- package/es/project-schema/v3.12.1.js +0 -1
- package/es/project-schema/v3.12.2.js +0 -1
- package/es/project-schema/v3.12.3.js +0 -1
- package/es/project-schema/v3.13.0.js +0 -1
- package/es/project-schema/v3.13.1.js +0 -1
- package/es/project-schema/v3.14.0.js +0 -1
- package/es/project-schema/v3.15.0.js +0 -1
- package/es/project-schema/v3.16.0.js +0 -1
- package/es/project-schema/v3.17.0.js +0 -1
- package/es/project-schema/v3.17.1.js +0 -1
- package/es/project-schema/v3.18.0.js +0 -1
- package/es/project-schema/v3.18.1.js +0 -1
- package/es/project-schema/v3.18.2.js +0 -1
- package/es/project-schema/v3.19.0.js +0 -1
- package/es/project-schema/v3.2.0.js +0 -1
- package/es/project-schema/v3.20.0.js +0 -1
- package/es/project-schema/v3.21.0.js +0 -1
- package/es/project-schema/v3.22.0.js +0 -1
- package/es/project-schema/v3.23.0.js +0 -1
- package/es/project-schema/v3.24.0.js +0 -1
- package/es/project-schema/v3.25.0.js +0 -1
- package/es/project-schema/v3.26.0.js +0 -1
- package/es/project-schema/v3.27.0.js +0 -1
- package/es/project-schema/v3.28.0.js +0 -1
- package/es/project-schema/v3.29.0.js +0 -1
- package/es/project-schema/v3.3.0.js +0 -1
- package/es/project-schema/v3.30.0.js +0 -1
- package/es/project-schema/v3.31.0.js +0 -1
- package/es/project-schema/v3.32.0.js +0 -1
- package/es/project-schema/v3.33.0.js +0 -1
- package/es/project-schema/v3.34.0.js +0 -1
- package/es/project-schema/v3.35.0.js +0 -1
- package/es/project-schema/v3.36.0.js +0 -1
- package/es/project-schema/v3.37.0.js +0 -1
- package/es/project-schema/v3.38.0.js +0 -1
- package/es/project-schema/v3.39.0.js +0 -1
- package/es/project-schema/v3.4.0.js +0 -1
- package/es/project-schema/v3.40.0.js +0 -1
- package/es/project-schema/v3.41.0.js +0 -1
- package/es/project-schema/v3.42.0.js +0 -1
- package/es/project-schema/v3.43.0.js +0 -1
- package/es/project-schema/v3.44.0.js +0 -1
- package/es/project-schema/v3.45.0.js +0 -1
- package/es/project-schema/v3.46.0.js +0 -1
- package/es/project-schema/v3.47.0.js +0 -1
- package/es/project-schema/v3.48.0.js +0 -1
- package/es/project-schema/v3.49.0.js +0 -1
- package/es/project-schema/v3.5.0.js +0 -1
- package/es/project-schema/v3.5.1.js +0 -1
- package/es/project-schema/v3.50.0.js +0 -1
- package/es/project-schema/v3.6.0.js +0 -1
- package/es/project-schema/v3.7.0.js +0 -1
- package/es/project-schema/v3.8.0.js +0 -1
- package/es/project-schema/v3.9.0.js +0 -1
- package/es/project-schema/v4.0.0.js +0 -1
- package/es/refs.js +0 -690
- package/es/relationships.js +0 -229
- package/es/scalars.js +0 -4
- package/es/schema-transform.js +0 -40
- package/es/schema-util.js +0 -1166
- package/es/schemas/index.js +0 -78
- package/es/schemas/index.ts +0 -152
- package/es/services.js +0 -154
- package/es/taxonomies.js +0 -34
- package/es/template-shapes/index.js +0 -36
- package/es/template-shapes/templates.js +0 -406
- package/es/template-shapes/types.js +0 -7
- package/es/template-shapes/where.js +0 -459
- package/es/types/index.js +0 -2
- package/es/types/types.js +0 -62
- package/es/types/utils.js +0 -298
- package/es/unions.js +0 -123
- package/es/user-schema.js +0 -1
- package/es/util/ai-tools.js +0 -8
- package/es/util/api-indexing.js +0 -66
- package/es/util/detect-cycles.js +0 -48
- package/es/util/find-shape-at-path.js +0 -55
- package/es/util/form-config.js +0 -73
- package/es/util/get-conflicting-properties.js +0 -54
- package/es/util/get-return-shape.js +0 -31
- package/es/util/has-arg.js +0 -13
- package/es/util/index.js +0 -10
- package/es/util/merge.js +0 -293
- package/es/util/patch-schema.js +0 -44
- package/es/validate.js +0 -1102
- package/es/versions.js +0 -4
- package/es/workflows.js +0 -68
- /package/dist/{schemas → cjs/src/schemas}/auth-schemas.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/experimental.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/latest.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v1.0.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.0.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.1.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.2.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.3.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.4.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.5.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.5.1.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.6.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.7.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.8.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/meta-schema-v3.9.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v1.0.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.0.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.1.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.10.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.11.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.12.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.12.1.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.12.2.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.12.3.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.13.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.14.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.15.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.16.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.17.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.17.1.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.18.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.18.1.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.18.2.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.19.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.2.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.20.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.21.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.22.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.23.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.24.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.25.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.26.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.27.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.28.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.29.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.3.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.30.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.31.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.32.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.33.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.34.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.35.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.36.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.37.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.38.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.39.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.4.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.40.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.41.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.42.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.43.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.44.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.45.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.46.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.47.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.48.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.49.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.5.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.5.1.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.50.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.6.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.7.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.8.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v3.9.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema/v4.0.0.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/project-schema.json +0 -0
- /package/dist/{schemas → cjs/src/schemas}/user-schema.json +0 -0
- /package/{es → dist/esm/src}/schemas/auth-schemas.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/experimental.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/latest.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v1.0.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.0.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.1.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.2.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.3.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.4.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.5.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.5.1.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.6.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.7.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.8.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/meta-schema-v3.9.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v1.0.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.0.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.1.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.10.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.11.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.12.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.12.1.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.12.2.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.12.3.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.13.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.14.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.15.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.16.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.17.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.17.1.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.18.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.18.1.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.18.2.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.19.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.2.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.20.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.21.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.22.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.23.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.24.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.25.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.26.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.27.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.28.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.29.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.3.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.30.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.31.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.32.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.33.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.34.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.35.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.36.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.37.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.38.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.39.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.4.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.40.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.41.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.42.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.43.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.44.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.45.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.46.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.47.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.48.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.49.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.5.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.5.1.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.50.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.6.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.7.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.8.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v3.9.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema/v4.0.0.json +0 -0
- /package/{es → dist/esm/src}/schemas/project-schema.json +0 -0
- /package/{es → dist/esm/src}/schemas/user-schema.json +0 -0
package/es/schema-util.js
DELETED
|
@@ -1,1166 +0,0 @@
|
|
|
1
|
-
import find from 'lodash/find';
|
|
2
|
-
import mapValues from 'lodash/mapValues';
|
|
3
|
-
import keyBy from 'lodash/keyBy';
|
|
4
|
-
import curry from 'lodash/fp/curry';
|
|
5
|
-
import orderBy from 'lodash/fp/orderBy';
|
|
6
|
-
import uniq from 'lodash/uniq';
|
|
7
|
-
import { deepClone, visit, pascalCase, ensureArray } from '@takeshape/util';
|
|
8
|
-
import isEqual from 'lodash/isEqual';
|
|
9
|
-
import isString from 'lodash/isString';
|
|
10
|
-
import { NotFoundError } from '@takeshape/errors';
|
|
11
|
-
import isArray from 'lodash/isArray';
|
|
12
|
-
import some from 'lodash/some';
|
|
13
|
-
import { defaultWorkflow, getStatusField } from './workflows';
|
|
14
|
-
import { CURRENT_API_VERSION, CURRENT_SCHEMA_VERSION } from './versions';
|
|
15
|
-
import { workflowsEnabled } from './api-version';
|
|
16
|
-
import { builtInShapes, builtInForms } from './builtin-schema';
|
|
17
|
-
import { getArgsType, isObjectSchema, isAllOfSchema, isOneOfSchema, isExtendsSchema, isArraySchema, isServiceResolver, isGraphqlResolver, isRefSchema } from './types/utils';
|
|
18
|
-
import { getStoredServiceConfig } from './services';
|
|
19
|
-
import { createTemplateShapeName, dereferenceObjectSchema, dereferenceSchema, getRef, getRefOrItemsRef, getRefShapeName, parseReturnShape, refExpressionToRefItem, refItemToShape, refItemToNamespacedShapeName, refItemToShapeSchema, atRefToRefItem, refToRefItem, parseTemplateShape, returnShapeToSchema, serializePropertyRef } from './refs';
|
|
20
|
-
import { isUnionSchema } from './unions';
|
|
21
|
-
import { mergeFormProperties, mergeSchemaProperties, getArgs } from './util';
|
|
22
|
-
export const SERVICE_OBJECT_PATTERN_NAME = 'pattern:service-object';
|
|
23
|
-
export function isBuiltinShape(shapeName) {
|
|
24
|
-
return Boolean(builtInShapes[shapeName]);
|
|
25
|
-
}
|
|
26
|
-
const builtInQueriesAndMutations = getShapeQueriesAndMutations(Object.values(builtInShapes));
|
|
27
|
-
export function isBuiltinQuery(name) {
|
|
28
|
-
return builtInQueriesAndMutations.queries[name] !== undefined;
|
|
29
|
-
}
|
|
30
|
-
export function isBuiltinMutation(name) {
|
|
31
|
-
return builtInQueriesAndMutations.mutations[name] !== undefined;
|
|
32
|
-
}
|
|
33
|
-
export function isBuiltinType(projectSchema, refSchema) {
|
|
34
|
-
const shapeName = getRefShapeName(projectSchema, refSchema);
|
|
35
|
-
return shapeName !== undefined && isBuiltinShape(shapeName);
|
|
36
|
-
}
|
|
37
|
-
export const schemaMetadataKeys = ['$comment', 'title', 'description', '@l10n', '@deprecationReason', '@tag', '@tags', '@syncLocaleStructure', '@sensitive'];
|
|
38
|
-
export const commonSchemaKeys = ['type', 'default', 'readOnly', ...schemaMetadataKeys];
|
|
39
|
-
export const scalarSchemaKeys = [...commonSchemaKeys, 'format', 'oneOf', 'multipleOf', 'maximum', 'exclusiveMaximum', 'minimum', 'exclusiveMinimum', 'maxLength', 'minLength', 'pattern'];
|
|
40
|
-
export const objectSchemaKeys = [...commonSchemaKeys, 'properties', 'required'];
|
|
41
|
-
export const arraySchemaKeys = [...commonSchemaKeys, 'items', 'additionalItems', 'maxItems', 'minItems', 'uniqueItems'];
|
|
42
|
-
export const multipleRelationshipSchemaKeys = [...schemaMetadataKeys, 'maxItems', 'minItems'];
|
|
43
|
-
|
|
44
|
-
// All properties except properties, items, additionalItems
|
|
45
|
-
export const nonStructuralSchemaKeys = [...scalarSchemaKeys, '@resolver', '@input', '@output', '@backreference', '@args', 'required', 'maxItems', 'minItems', 'uniqueItems'];
|
|
46
|
-
export function getServiceIdFieldName(serviceFieldName) {
|
|
47
|
-
return `${serviceFieldName}Id`;
|
|
48
|
-
}
|
|
49
|
-
const generatorVersions = {
|
|
50
|
-
[SERVICE_OBJECT_PATTERN_NAME]: '1'
|
|
51
|
-
};
|
|
52
|
-
export function getGeneratorVersion(generator) {
|
|
53
|
-
return generatorVersions[generator];
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Returns info for all services found in shape, keyed by provider
|
|
57
|
-
export function getServiceInfo(projectSchema, shape) {
|
|
58
|
-
const result = {};
|
|
59
|
-
|
|
60
|
-
// Get inline dependencies by not following refs with @resolver
|
|
61
|
-
const inlineDepShapes = getShapeDependencies(projectSchema, shape, prop => !prop['@resolver']).map(name => projectSchema.shapes[name]);
|
|
62
|
-
const shapesToCheck = [shape, ...inlineDepShapes];
|
|
63
|
-
shapesToCheck.forEach(thisShape => {
|
|
64
|
-
createSchemaPropertyList(projectSchema, thisShape).forEach(([key, value]) => {
|
|
65
|
-
const resolver = value['@resolver'];
|
|
66
|
-
if (!isServiceResolver(resolver)) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
const serviceConfig = getStoredServiceConfig(projectSchema, resolver.service);
|
|
70
|
-
if (!serviceConfig) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
const {
|
|
74
|
-
provider
|
|
75
|
-
} = serviceConfig;
|
|
76
|
-
const generators = {};
|
|
77
|
-
const tag = value['@tag'];
|
|
78
|
-
if (tag?.startsWith(SERVICE_OBJECT_PATTERN_NAME)) {
|
|
79
|
-
const idFieldName = getServiceIdFieldName(key);
|
|
80
|
-
const version = tag.substr(tag.lastIndexOf(':') + 1);
|
|
81
|
-
generators[SERVICE_OBJECT_PATTERN_NAME] = {
|
|
82
|
-
version,
|
|
83
|
-
currentVersion: getGeneratorVersion(SERVICE_OBJECT_PATTERN_NAME),
|
|
84
|
-
idFieldName,
|
|
85
|
-
serviceObjectType: resolver.fieldName
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
const serviceInfo = {
|
|
89
|
-
service: resolver.service,
|
|
90
|
-
fieldName: key,
|
|
91
|
-
path: pathBetween(shape, thisShape, projectSchema),
|
|
92
|
-
generators
|
|
93
|
-
};
|
|
94
|
-
if (Array.isArray(result[provider])) {
|
|
95
|
-
// Dedupe service info
|
|
96
|
-
if (!result[provider].find(existingServiceInfo => isEqual(existingServiceInfo, serviceInfo))) {
|
|
97
|
-
result[provider].push(serviceInfo);
|
|
98
|
-
}
|
|
99
|
-
} else {
|
|
100
|
-
result[provider] = [serviceInfo];
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
return result;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Follow refs to find the path between two shapes in a schema
|
|
108
|
-
export function pathBetween(fromShape, toShape, projectSchema, depthLimit = 4) {
|
|
109
|
-
if (fromShape.name === toShape.name) {
|
|
110
|
-
return [];
|
|
111
|
-
}
|
|
112
|
-
const toShapeName = toShape.name;
|
|
113
|
-
let shortestPath;
|
|
114
|
-
let shortestPathLength = Number.MAX_SAFE_INTEGER;
|
|
115
|
-
const pathBetweenHelper = (schema, pathSoFar, seen, depth) => {
|
|
116
|
-
if (depth > depthLimit) {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
if (schema.items) {
|
|
120
|
-
pathBetweenHelper(schema.items, pathSoFar, seen, depth);
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
const refItem = getRef(projectSchema, schema);
|
|
124
|
-
if (refItem) {
|
|
125
|
-
const referenced = refItemToShape(projectSchema, refItem);
|
|
126
|
-
if (referenced) {
|
|
127
|
-
if (referenced.name === toShapeName && pathSoFar.length < shortestPathLength) {
|
|
128
|
-
shortestPath = pathSoFar;
|
|
129
|
-
shortestPathLength = pathSoFar.length;
|
|
130
|
-
} else if (!seen.has(referenced.name)) {
|
|
131
|
-
pathBetweenHelper(referenced.schema, pathSoFar, new Set([...seen, referenced.name]), depth);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
} else if (pathSoFar.length + 1 < shortestPathLength && (schema.oneOf ?? schema.allOf ?? schema.properties)) {
|
|
135
|
-
if (schema.oneOf) {
|
|
136
|
-
for (const itemSchema of schema.oneOf) {
|
|
137
|
-
pathBetweenHelper(itemSchema, pathSoFar, seen, depth);
|
|
138
|
-
}
|
|
139
|
-
} else {
|
|
140
|
-
for (const [propName, propSchema] of createSchemaPropertyList(projectSchema, schema).getNodes()) {
|
|
141
|
-
pathBetweenHelper(propSchema, pathSoFar.concat(String(propName)), seen, depth + 1);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
pathBetweenHelper(fromShape.schema, [], new Set([fromShape.name]), 0);
|
|
147
|
-
if (!shortestPath) {
|
|
148
|
-
throw new Error(`No path between ${fromShape.name} and ${toShape.name}`);
|
|
149
|
-
}
|
|
150
|
-
return shortestPath;
|
|
151
|
-
}
|
|
152
|
-
export function getShapeQueriesAndMutations(shapes) {
|
|
153
|
-
const queries = {};
|
|
154
|
-
const mutations = {};
|
|
155
|
-
for (const shape of ensureArray(shapes)) {
|
|
156
|
-
const {
|
|
157
|
-
name,
|
|
158
|
-
model
|
|
159
|
-
} = shape;
|
|
160
|
-
const service = 'shapedb';
|
|
161
|
-
if (model) {
|
|
162
|
-
const isSingleton = model.type === 'single';
|
|
163
|
-
queries[`get${name}`] = {
|
|
164
|
-
shape: name,
|
|
165
|
-
resolver: {
|
|
166
|
-
name: 'shapedb:get',
|
|
167
|
-
service,
|
|
168
|
-
shapeName: name
|
|
169
|
-
},
|
|
170
|
-
description: `Get a ${name} by ID`,
|
|
171
|
-
args: isSingleton ? createTemplateShapeName('TSGetSingletonArgs', name) : createTemplateShapeName('TSGetArgs', name)
|
|
172
|
-
};
|
|
173
|
-
mutations[`update${name}`] = {
|
|
174
|
-
shape: createTemplateShapeName('UpdateResult', name),
|
|
175
|
-
resolver: {
|
|
176
|
-
name: 'shapedb:update',
|
|
177
|
-
service,
|
|
178
|
-
shapeName: name
|
|
179
|
-
},
|
|
180
|
-
description: `Update ${name}`,
|
|
181
|
-
args: createTemplateShapeName('UpdateArgs', name)
|
|
182
|
-
};
|
|
183
|
-
if (!isSingleton) {
|
|
184
|
-
queries[`get${name}List`] = {
|
|
185
|
-
shape: createTemplateShapeName('PaginatedList', name),
|
|
186
|
-
resolver: {
|
|
187
|
-
name: 'shapedb:list',
|
|
188
|
-
service,
|
|
189
|
-
shapeName: name
|
|
190
|
-
},
|
|
191
|
-
description: `Returns a list ${name} in natural order.`,
|
|
192
|
-
args: createTemplateShapeName('TSListArgs', name)
|
|
193
|
-
};
|
|
194
|
-
mutations[`create${name}`] = {
|
|
195
|
-
shape: createTemplateShapeName('CreateResult', name),
|
|
196
|
-
resolver: {
|
|
197
|
-
name: 'shapedb:create',
|
|
198
|
-
service,
|
|
199
|
-
shapeName: name
|
|
200
|
-
},
|
|
201
|
-
description: `Create ${name}`,
|
|
202
|
-
args: createTemplateShapeName('CreateArgs', name)
|
|
203
|
-
};
|
|
204
|
-
mutations[`duplicate${name}`] = {
|
|
205
|
-
shape: createTemplateShapeName('DuplicateResult', name),
|
|
206
|
-
resolver: {
|
|
207
|
-
name: 'shapedb:duplicate',
|
|
208
|
-
service,
|
|
209
|
-
shapeName: name
|
|
210
|
-
},
|
|
211
|
-
description: `Duplicate ${name}`,
|
|
212
|
-
args: createTemplateShapeName('DuplicateArgs', name)
|
|
213
|
-
};
|
|
214
|
-
mutations[`delete${name}`] = {
|
|
215
|
-
shape: createTemplateShapeName('DeleteResult', name),
|
|
216
|
-
resolver: {
|
|
217
|
-
name: 'shapedb:delete',
|
|
218
|
-
service,
|
|
219
|
-
shapeName: name
|
|
220
|
-
},
|
|
221
|
-
description: `Delete ${name}`,
|
|
222
|
-
args: createTemplateShapeName('DeleteArgs', name)
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
return {
|
|
228
|
-
queries,
|
|
229
|
-
mutations
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
export function getCommonBuiltInProperties(shape) {
|
|
233
|
-
return {
|
|
234
|
-
_id: {
|
|
235
|
-
title: 'Id',
|
|
236
|
-
type: 'string'
|
|
237
|
-
},
|
|
238
|
-
_shapeId: {
|
|
239
|
-
type: 'string',
|
|
240
|
-
title: 'Shape Id',
|
|
241
|
-
enum: [shape.id]
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
export const DEFAULT_ID_FIELD = 'id';
|
|
246
|
-
export function getIdField(obj) {
|
|
247
|
-
return obj?.idField ?? DEFAULT_ID_FIELD;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* Get properties necessary for cached / remote data to work with the TSSearchable interface.
|
|
252
|
-
*/
|
|
253
|
-
function getCachedBuiltInProperties(projectSchema, shape, properties) {
|
|
254
|
-
const idField = getIdField(shape.cache);
|
|
255
|
-
|
|
256
|
-
// TODO Implement `searchSummary` and `_shapeId` here, and remove `getRemoteShapeTSSearchableFields`
|
|
257
|
-
return {
|
|
258
|
-
_id: {
|
|
259
|
-
title: 'Id',
|
|
260
|
-
type: 'string',
|
|
261
|
-
...properties._id,
|
|
262
|
-
...(properties[idField]?.['@mapping'] ? {
|
|
263
|
-
'@mapping': properties[idField]['@mapping']
|
|
264
|
-
} : {})
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
export function getModelBuiltInProperties(projectSchema, shape) {
|
|
269
|
-
const apiVersion = projectSchema.apiVersion ?? CURRENT_API_VERSION;
|
|
270
|
-
const showDeprecationReason = apiVersion !== '1';
|
|
271
|
-
const properties = {
|
|
272
|
-
_version: {
|
|
273
|
-
title: 'Version',
|
|
274
|
-
type: 'integer'
|
|
275
|
-
},
|
|
276
|
-
_shapeName: {
|
|
277
|
-
title: 'Shape Name',
|
|
278
|
-
type: 'string'
|
|
279
|
-
},
|
|
280
|
-
_createdAt: {
|
|
281
|
-
title: 'Created',
|
|
282
|
-
type: 'string',
|
|
283
|
-
format: 'date-time'
|
|
284
|
-
},
|
|
285
|
-
_createdBy: {
|
|
286
|
-
title: 'Created By',
|
|
287
|
-
'@ref': 'local:TSUser',
|
|
288
|
-
'@input': {
|
|
289
|
-
type: 'string'
|
|
290
|
-
},
|
|
291
|
-
'@resolver': {
|
|
292
|
-
name: 'takeshape:getUser',
|
|
293
|
-
service: 'takeshape'
|
|
294
|
-
}
|
|
295
|
-
},
|
|
296
|
-
_updatedAt: {
|
|
297
|
-
title: 'Updated',
|
|
298
|
-
type: 'string',
|
|
299
|
-
format: 'date-time'
|
|
300
|
-
},
|
|
301
|
-
_updatedBy: {
|
|
302
|
-
title: 'Updated By',
|
|
303
|
-
'@ref': 'local:TSUser',
|
|
304
|
-
'@input': {
|
|
305
|
-
type: 'string'
|
|
306
|
-
},
|
|
307
|
-
'@resolver': {
|
|
308
|
-
name: 'takeshape:getUser',
|
|
309
|
-
service: 'takeshape'
|
|
310
|
-
}
|
|
311
|
-
},
|
|
312
|
-
_schemaVersion: {
|
|
313
|
-
title: 'Schema Version',
|
|
314
|
-
type: 'number'
|
|
315
|
-
},
|
|
316
|
-
_enabled: {
|
|
317
|
-
title: 'Enabled',
|
|
318
|
-
type: 'boolean',
|
|
319
|
-
...(showDeprecationReason ? {
|
|
320
|
-
'@deprecationReason': 'Use _status instead'
|
|
321
|
-
} : {})
|
|
322
|
-
},
|
|
323
|
-
_enabledAt: {
|
|
324
|
-
title: 'Enabled Date',
|
|
325
|
-
type: 'string',
|
|
326
|
-
format: 'date-time',
|
|
327
|
-
...(showDeprecationReason ? {
|
|
328
|
-
'@deprecationReason': 'Use a custom date field instead'
|
|
329
|
-
} : {})
|
|
330
|
-
}
|
|
331
|
-
};
|
|
332
|
-
if (workflowsEnabled(apiVersion)) {
|
|
333
|
-
return {
|
|
334
|
-
...properties,
|
|
335
|
-
_status: {
|
|
336
|
-
...(projectSchema.workflows && getStatusField(projectSchema.workflows, shape))
|
|
337
|
-
}
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
return properties;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* Return all the built in property names,
|
|
345
|
-
*/
|
|
346
|
-
export function getBuiltInPropertyNames(profile = BuiltInPropertiesProfile.Model) {
|
|
347
|
-
const fakeShape = {
|
|
348
|
-
id: 'shape-id'
|
|
349
|
-
};
|
|
350
|
-
let keys = [...Object.keys(getCommonBuiltInProperties(fakeShape))];
|
|
351
|
-
if (profile === BuiltInPropertiesProfile.Model) {
|
|
352
|
-
keys = [...keys, ...Object.keys(getModelBuiltInProperties({}, fakeShape))];
|
|
353
|
-
}
|
|
354
|
-
return new Set(keys);
|
|
355
|
-
}
|
|
356
|
-
export let BuiltInPropertiesProfile = /*#__PURE__*/function (BuiltInPropertiesProfile) {
|
|
357
|
-
BuiltInPropertiesProfile[BuiltInPropertiesProfile["Model"] = 0] = "Model";
|
|
358
|
-
BuiltInPropertiesProfile[BuiltInPropertiesProfile["Cached"] = 1] = "Cached";
|
|
359
|
-
BuiltInPropertiesProfile[BuiltInPropertiesProfile["None"] = 2] = "None";
|
|
360
|
-
return BuiltInPropertiesProfile;
|
|
361
|
-
}({});
|
|
362
|
-
const BUILT_IN_PROPERTY_NAMES = {
|
|
363
|
-
[BuiltInPropertiesProfile.Model]: getBuiltInPropertyNames(BuiltInPropertiesProfile.Model),
|
|
364
|
-
[BuiltInPropertiesProfile.Cached]: getBuiltInPropertyNames(BuiltInPropertiesProfile.Cached),
|
|
365
|
-
[BuiltInPropertiesProfile.None]: getBuiltInPropertyNames(BuiltInPropertiesProfile.None)
|
|
366
|
-
};
|
|
367
|
-
export const isBuiltInPropertyName = (name, profile = BuiltInPropertiesProfile.Model) => {
|
|
368
|
-
return BUILT_IN_PROPERTY_NAMES[profile].has(name);
|
|
369
|
-
};
|
|
370
|
-
|
|
371
|
-
/**
|
|
372
|
-
* Get the profile to use for loading built-in properties
|
|
373
|
-
*/
|
|
374
|
-
function getBuiltInPropertiesProfile(shape) {
|
|
375
|
-
if (isModelShape(shape)) {
|
|
376
|
-
return BuiltInPropertiesProfile.Model;
|
|
377
|
-
}
|
|
378
|
-
if (isCachedShape(shape)) {
|
|
379
|
-
return BuiltInPropertiesProfile.Cached;
|
|
380
|
-
}
|
|
381
|
-
return BuiltInPropertiesProfile.None;
|
|
382
|
-
}
|
|
383
|
-
export function applyBuiltinPropertiesToShape(projectSchema, shape) {
|
|
384
|
-
const profile = getBuiltInPropertiesProfile(shape);
|
|
385
|
-
if (profile === BuiltInPropertiesProfile.None) {
|
|
386
|
-
return shape;
|
|
387
|
-
}
|
|
388
|
-
const shapeObjectSchema = dereferenceObjectSchema(projectSchema, shape.schema, ['shapes', shape.name]);
|
|
389
|
-
const {
|
|
390
|
-
properties
|
|
391
|
-
} = shapeObjectSchema;
|
|
392
|
-
const commonProperties = getCommonBuiltInProperties(shape);
|
|
393
|
-
const modelProperties = profile === BuiltInPropertiesProfile.Model ? getModelBuiltInProperties(projectSchema, shape) : undefined;
|
|
394
|
-
const cachedProperties = profile === BuiltInPropertiesProfile.Cached ? getCachedBuiltInProperties(projectSchema, shape, properties) : undefined;
|
|
395
|
-
return {
|
|
396
|
-
...shape,
|
|
397
|
-
schema: {
|
|
398
|
-
...shapeObjectSchema,
|
|
399
|
-
properties: {
|
|
400
|
-
...properties,
|
|
401
|
-
...commonProperties,
|
|
402
|
-
...modelProperties,
|
|
403
|
-
...cachedProperties
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
};
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
// Dependencies of these built-in shapes are automatically added by getBuiltinsUsed
|
|
410
|
-
const requiredBuiltinShapes = ['Asset', 'TSRelationship', 'TSStaticSite', 'TSUser'];
|
|
411
|
-
|
|
412
|
-
/**
|
|
413
|
-
* Get all built-in shapes that are depended on by the given project schema.
|
|
414
|
-
* Required built-in shapes are always included.
|
|
415
|
-
*/
|
|
416
|
-
export function getBuiltinsUsed(projectSchema) {
|
|
417
|
-
const builtinsUsed = {};
|
|
418
|
-
const shapeNames = uniq(requiredBuiltinShapes.concat(getAllRefs(projectSchema, refItem => refItem.serviceKey === 'local' && isBuiltinShape(refItem.typeName)).map(refItemToNamespacedShapeName)));
|
|
419
|
-
const schemaWithAllBuiltins = {
|
|
420
|
-
...emptySchema('project-id'),
|
|
421
|
-
shapes: builtInShapes
|
|
422
|
-
};
|
|
423
|
-
shapeNames.forEach(builtinShapeName => {
|
|
424
|
-
builtinsUsed[builtinShapeName] = builtInShapes[builtinShapeName];
|
|
425
|
-
getShapeDependencies(schemaWithAllBuiltins, builtInShapes[builtinShapeName]).forEach(depShapeName => {
|
|
426
|
-
builtinsUsed[depShapeName] = builtInShapes[depShapeName];
|
|
427
|
-
});
|
|
428
|
-
});
|
|
429
|
-
return builtinsUsed;
|
|
430
|
-
}
|
|
431
|
-
export function applyDefaultsToSchema(projectSchema) {
|
|
432
|
-
const builtinsUsed = getBuiltinsUsed(projectSchema);
|
|
433
|
-
return {
|
|
434
|
-
...projectSchema,
|
|
435
|
-
workflows: {
|
|
436
|
-
...projectSchema.workflows,
|
|
437
|
-
...(workflowsEnabled(projectSchema.apiVersion) && {
|
|
438
|
-
default: defaultWorkflow
|
|
439
|
-
})
|
|
440
|
-
},
|
|
441
|
-
queries: {
|
|
442
|
-
...builtInQueriesAndMutations.queries,
|
|
443
|
-
...projectSchema.queries
|
|
444
|
-
},
|
|
445
|
-
mutations: {
|
|
446
|
-
...builtInQueriesAndMutations.mutations,
|
|
447
|
-
...projectSchema.mutations
|
|
448
|
-
},
|
|
449
|
-
shapes: mapValues({
|
|
450
|
-
...builtinsUsed,
|
|
451
|
-
...projectSchema.shapes
|
|
452
|
-
}, shape => {
|
|
453
|
-
const builtInShape = builtinsUsed[shape.name];
|
|
454
|
-
if (builtInShape && builtInShape !== shape) {
|
|
455
|
-
shape = {
|
|
456
|
-
...shape,
|
|
457
|
-
schema: mergeSchemaProperties(dereferenceObjectSchema(projectSchema, shape.schema), dereferenceObjectSchema(projectSchema, builtInShape.schema))
|
|
458
|
-
};
|
|
459
|
-
}
|
|
460
|
-
return applyBuiltinPropertiesToShape(projectSchema, shape);
|
|
461
|
-
}),
|
|
462
|
-
forms: mapValues({
|
|
463
|
-
...builtInForms,
|
|
464
|
-
...projectSchema.forms
|
|
465
|
-
}, (formsConfig, shapeName) => {
|
|
466
|
-
const builtInFormsConfig = builtInForms[shapeName];
|
|
467
|
-
if (builtInFormsConfig && builtInFormsConfig !== formsConfig) {
|
|
468
|
-
formsConfig = {
|
|
469
|
-
...formsConfig,
|
|
470
|
-
default: mergeFormProperties(formsConfig.default, builtInFormsConfig.default)
|
|
471
|
-
};
|
|
472
|
-
}
|
|
473
|
-
return formsConfig;
|
|
474
|
-
})
|
|
475
|
-
};
|
|
476
|
-
}
|
|
477
|
-
export function getShapeById(projectSchema, shapeId) {
|
|
478
|
-
return find(projectSchema.shapes, shape => shape.id === shapeId);
|
|
479
|
-
}
|
|
480
|
-
export function getShapeByRef(projectSchema, shapeRef) {
|
|
481
|
-
return refItemToShape(projectSchema, atRefToRefItem(projectSchema, shapeRef));
|
|
482
|
-
}
|
|
483
|
-
export function ensureShapeById(projectSchema, shapeId) {
|
|
484
|
-
const shape = getShapeById(projectSchema, shapeId);
|
|
485
|
-
if (!shape) {
|
|
486
|
-
throw new NotFoundError(`Shape with id "${shapeId}" Not found`);
|
|
487
|
-
}
|
|
488
|
-
return shape;
|
|
489
|
-
}
|
|
490
|
-
export function getShape(context, name) {
|
|
491
|
-
return context.shapes[name];
|
|
492
|
-
}
|
|
493
|
-
export function ensureShape(projectSchema, name) {
|
|
494
|
-
const shape = getShape(projectSchema, name);
|
|
495
|
-
if (!shape) {
|
|
496
|
-
throw new NotFoundError(`Shape "${name}" Not found`);
|
|
497
|
-
}
|
|
498
|
-
return shape;
|
|
499
|
-
}
|
|
500
|
-
export function isModelShape(shape) {
|
|
501
|
-
return Boolean(shape.model);
|
|
502
|
-
}
|
|
503
|
-
export function isCachedShape(shape) {
|
|
504
|
-
return shape.cache?.enabled === true && shape.loaders !== undefined;
|
|
505
|
-
}
|
|
506
|
-
export function getArgsReference(projectSchema, argsSchema) {
|
|
507
|
-
const args = getArgs(argsSchema);
|
|
508
|
-
if (args && typeof args === 'string') {
|
|
509
|
-
// @args: ShapeName OR Namespace_TypeName
|
|
510
|
-
return refExpressionToRefItem(projectSchema, args);
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
export function getArgsReferenceWithPath(context, argsSchema, schemaPath = []) {
|
|
514
|
-
const refItem = getArgsReference(context, argsSchema);
|
|
515
|
-
if (refItem) {
|
|
516
|
-
const argsType = getArgsType(argsSchema);
|
|
517
|
-
return {
|
|
518
|
-
...refItem,
|
|
519
|
-
path: schemaPath.concat([argsType])
|
|
520
|
-
};
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
export function getArgsShapeSchema(context, argsSchema) {
|
|
524
|
-
const args = getArgs(argsSchema);
|
|
525
|
-
if (args) {
|
|
526
|
-
if (typeof args === 'string') {
|
|
527
|
-
const refItem = getArgsReference(context, argsSchema);
|
|
528
|
-
if (refItem) {
|
|
529
|
-
return refItemToShapeSchema(context, refItem);
|
|
530
|
-
}
|
|
531
|
-
} else {
|
|
532
|
-
return args;
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
const createShapeToPropertySchema = (projectSchema, definitions, definitionNames, {
|
|
537
|
-
useShapeIdDiscriminator
|
|
538
|
-
}) => {
|
|
539
|
-
const rewriteRefs = shape => {
|
|
540
|
-
const handleSchema = propSchema => {
|
|
541
|
-
// Unwrap array schema
|
|
542
|
-
propSchema = propSchema.items ?? propSchema;
|
|
543
|
-
if (isOneOfSchema(propSchema)) {
|
|
544
|
-
const isUnion = isUnionSchema(propSchema);
|
|
545
|
-
if (useShapeIdDiscriminator && isUnion) {
|
|
546
|
-
propSchema.discriminator = {
|
|
547
|
-
propertyName: '_shapeId'
|
|
548
|
-
};
|
|
549
|
-
propSchema.required = ['_shapeId'];
|
|
550
|
-
}
|
|
551
|
-
propSchema.oneOf.forEach(schema => {
|
|
552
|
-
handleSchema(schema);
|
|
553
|
-
});
|
|
554
|
-
return;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
// Add workflow validation
|
|
558
|
-
if (propSchema['@workflow']) {
|
|
559
|
-
const workflowName = propSchema['@workflow'];
|
|
560
|
-
const workflow = projectSchema.workflows[workflowName] || defaultWorkflow;
|
|
561
|
-
propSchema.oneOf = workflow.steps.map(step => ({
|
|
562
|
-
enum: [step.key, step.name],
|
|
563
|
-
title: step.title
|
|
564
|
-
}));
|
|
565
|
-
}
|
|
566
|
-
const refItem = getRef(projectSchema, propSchema);
|
|
567
|
-
if (refItem) {
|
|
568
|
-
const shapeName = refItemToNamespacedShapeName(refItem);
|
|
569
|
-
const shape = refItemToShape(projectSchema, refItem);
|
|
570
|
-
if (shape) {
|
|
571
|
-
delete propSchema['@ref'];
|
|
572
|
-
propSchema.$ref = `#/definitions/${shapeName}`;
|
|
573
|
-
if (!definitionNames.has(shapeName)) {
|
|
574
|
-
definitionNames.add(shapeName);
|
|
575
|
-
const rewritten = rewriteRefs(shape);
|
|
576
|
-
if (useShapeIdDiscriminator && isObjectSchema(rewritten)) {
|
|
577
|
-
rewritten.properties._shapeId = {
|
|
578
|
-
type: 'string',
|
|
579
|
-
enum: [shape.id]
|
|
580
|
-
};
|
|
581
|
-
}
|
|
582
|
-
definitions[shapeName] = rewritten;
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
};
|
|
587
|
-
const shapeSchema = deepClone(shape.schema);
|
|
588
|
-
if (isOneOfSchema(shapeSchema)) {
|
|
589
|
-
handleSchema(shapeSchema);
|
|
590
|
-
return shapeSchema;
|
|
591
|
-
}
|
|
592
|
-
if (shapeSchema.enum) {
|
|
593
|
-
return shapeSchema;
|
|
594
|
-
}
|
|
595
|
-
const shapeSchemaCopy = dereferenceObjectSchema(projectSchema, shapeSchema);
|
|
596
|
-
if (shape.title) {
|
|
597
|
-
shapeSchemaCopy.title = shape.title;
|
|
598
|
-
}
|
|
599
|
-
Object.values(shapeSchemaCopy.properties).forEach(schema => {
|
|
600
|
-
handleSchema(schema);
|
|
601
|
-
});
|
|
602
|
-
return shapeSchemaCopy;
|
|
603
|
-
};
|
|
604
|
-
return rewriteRefs;
|
|
605
|
-
};
|
|
606
|
-
export function shapeToPropertySchema(projectSchema, shape) {
|
|
607
|
-
const definitions = {};
|
|
608
|
-
const definitionNames = new Set();
|
|
609
|
-
const convert = createShapeToPropertySchema(projectSchema, definitions, definitionNames, {
|
|
610
|
-
useShapeIdDiscriminator: true
|
|
611
|
-
});
|
|
612
|
-
return {
|
|
613
|
-
...convert(shape),
|
|
614
|
-
definitions
|
|
615
|
-
};
|
|
616
|
-
}
|
|
617
|
-
export function projectSchemaToJSONSchema(projectSchema) {
|
|
618
|
-
const definitions = {};
|
|
619
|
-
const definitionNames = new Set();
|
|
620
|
-
const convert = createShapeToPropertySchema(projectSchema, definitions, definitionNames, {
|
|
621
|
-
useShapeIdDiscriminator: false
|
|
622
|
-
});
|
|
623
|
-
for (const shape of Object.values(projectSchema.shapes)) {
|
|
624
|
-
definitions[shape.name] = convert(shape);
|
|
625
|
-
definitionNames.add(shape.name);
|
|
626
|
-
}
|
|
627
|
-
return {
|
|
628
|
-
definitions
|
|
629
|
-
};
|
|
630
|
-
}
|
|
631
|
-
export function getShapeDependencies(projectSchema, shape, predicate) {
|
|
632
|
-
const shapeNames = new Set();
|
|
633
|
-
const findDependencies = schema => {
|
|
634
|
-
const shouldFollow = Boolean(!predicate || predicate(schema));
|
|
635
|
-
if (shouldFollow) {
|
|
636
|
-
schema = schema.items ?? schema;
|
|
637
|
-
const refItem = getRef(projectSchema, schema);
|
|
638
|
-
if (refItem) {
|
|
639
|
-
const refShape = refItemToShape(projectSchema, refItem);
|
|
640
|
-
if (refShape && !shapeNames.has(refShape.name)) {
|
|
641
|
-
shapeNames.add(refShape.name);
|
|
642
|
-
findDependencies(dereferenceSchema(projectSchema, refShape.schema, ['shapes', refShape.name]));
|
|
643
|
-
}
|
|
644
|
-
} else if (isObjectSchema(schema) || isAllOfSchema(schema) || isOneOfSchema(schema)) {
|
|
645
|
-
visitSchemaProperties(schema, [], findDependencies);
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
return shouldFollow;
|
|
649
|
-
};
|
|
650
|
-
findDependencies(shape.schema);
|
|
651
|
-
return [...shapeNames];
|
|
652
|
-
}
|
|
653
|
-
export function getRelevantShapes(projectSchema, params) {
|
|
654
|
-
const {
|
|
655
|
-
shapeIds,
|
|
656
|
-
shapeNames,
|
|
657
|
-
byId = false,
|
|
658
|
-
includeDependencies = true
|
|
659
|
-
} = params;
|
|
660
|
-
if (Boolean(shapeNames?.length) || Boolean(shapeIds?.length)) {
|
|
661
|
-
const ids = new Set(shapeIds);
|
|
662
|
-
const names = new Set(shapeNames);
|
|
663
|
-
const shapes = {};
|
|
664
|
-
for (const shape of Object.values(projectSchema.shapes)) {
|
|
665
|
-
if (ids.has(shape.id) || names.has(shape.name)) {
|
|
666
|
-
const shapeNames = includeDependencies ? [shape.name].concat(getShapeDependencies(projectSchema, shape)) : [shape.name];
|
|
667
|
-
for (const shapeName of shapeNames) {
|
|
668
|
-
const dependentShape = projectSchema.shapes[shapeName];
|
|
669
|
-
shapes[byId ? dependentShape.id : dependentShape.name] = dependentShape;
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
return shapes;
|
|
674
|
-
}
|
|
675
|
-
return {};
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
/**
|
|
679
|
-
* Visitor callback return false to stop iterating
|
|
680
|
-
*/
|
|
681
|
-
|
|
682
|
-
export function visitSchemaProperties(root, path, callback) {
|
|
683
|
-
const visitEach = (entries, path) => {
|
|
684
|
-
for (const [name, propSchema] of entries) {
|
|
685
|
-
const newPath = [...path, name];
|
|
686
|
-
visit(propSchema, newPath);
|
|
687
|
-
}
|
|
688
|
-
};
|
|
689
|
-
const visit = (schema, path) => {
|
|
690
|
-
if (schema !== root && callback(schema, path) === false) {
|
|
691
|
-
return;
|
|
692
|
-
}
|
|
693
|
-
if (isArraySchema(schema)) {
|
|
694
|
-
visit(schema.items, [...path, 'items']);
|
|
695
|
-
} else if (isObjectSchema(schema)) {
|
|
696
|
-
visitEach(Object.entries(schema.properties), [...path, 'properties']);
|
|
697
|
-
} else if (isExtendsSchema(schema)) {
|
|
698
|
-
visitEach(Object.entries(schema.extends), [...path, 'extends']);
|
|
699
|
-
} else if (isAllOfSchema(schema)) {
|
|
700
|
-
visitEach(Object.entries(schema.allOf), [...path, 'allOf']);
|
|
701
|
-
} else if (isOneOfSchema(schema)) {
|
|
702
|
-
visitEach(Object.entries(schema.oneOf), [...path, 'oneOf']);
|
|
703
|
-
}
|
|
704
|
-
};
|
|
705
|
-
visit(root, path);
|
|
706
|
-
}
|
|
707
|
-
export function visitShapeProperties(shapes, callback) {
|
|
708
|
-
for (const [shapeName, shape] of Object.entries(shapes)) {
|
|
709
|
-
visitSchemaProperties(shape.schema, ['shapes', shapeName, 'schema'], callback);
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
function addRef(refs, ref, predicate) {
|
|
713
|
-
if (ref && (!predicate || predicate(ref))) {
|
|
714
|
-
refs.push(ref);
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
/**
|
|
719
|
-
* Walk through a `ProjectSchemaJSON` and collect all the `ref`s.
|
|
720
|
-
*/
|
|
721
|
-
export function getAllRefsInShapes(projectSchema, predicate) {
|
|
722
|
-
const items = [];
|
|
723
|
-
const refPropNames = ['$ref', '@ref', '@args', 'args', 'interfaces'];
|
|
724
|
-
visit(projectSchema.shapes, refPropNames, (interfaces, refPath) => {
|
|
725
|
-
const propName = refPath[refPath.length - 1];
|
|
726
|
-
const path = ['shapes', ...refPath];
|
|
727
|
-
if (propName === 'interfaces' && isArray(interfaces)) {
|
|
728
|
-
interfaces.forEach((interfaceRefExpression, index) => {
|
|
729
|
-
addRef(items, {
|
|
730
|
-
...refExpressionToRefItem(projectSchema, interfaceRefExpression),
|
|
731
|
-
path: [...path, index]
|
|
732
|
-
}, predicate);
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
// The client sometimes generates invalid schemas, like refs that are
|
|
737
|
-
// undefined. Treat ref as unknown and toss those out.
|
|
738
|
-
// See the `useShapeEditor > can deal with renames test`
|
|
739
|
-
if (!isString(interfaces)) {
|
|
740
|
-
return;
|
|
741
|
-
}
|
|
742
|
-
if (propName === '@ref') {
|
|
743
|
-
const {
|
|
744
|
-
shapeName,
|
|
745
|
-
template
|
|
746
|
-
} = parseTemplateShape(interfaces);
|
|
747
|
-
addRef(items, {
|
|
748
|
-
...atRefToRefItem(projectSchema, shapeName, template),
|
|
749
|
-
path
|
|
750
|
-
}, predicate);
|
|
751
|
-
} else if (propName === '$ref') {
|
|
752
|
-
addRef(items, {
|
|
753
|
-
...refToRefItem(projectSchema, interfaces),
|
|
754
|
-
path
|
|
755
|
-
}, predicate);
|
|
756
|
-
} else if (propName === '@args' || propName === 'args') {
|
|
757
|
-
addRef(items, {
|
|
758
|
-
...refExpressionToRefItem(projectSchema, interfaces),
|
|
759
|
-
path
|
|
760
|
-
}, predicate);
|
|
761
|
-
}
|
|
762
|
-
});
|
|
763
|
-
return items;
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
/**
|
|
767
|
-
* Get all refs
|
|
768
|
-
*/
|
|
769
|
-
export function getAllRefsInQuery(projectSchema, queryPath, query, predicate) {
|
|
770
|
-
const refItems = [];
|
|
771
|
-
const propertyVisitor = (propSchema, propSchemaPath) => {
|
|
772
|
-
addRef(refItems, getRefOrItemsRef(projectSchema, propSchema, propSchemaPath), predicate);
|
|
773
|
-
};
|
|
774
|
-
if (query.args && typeof query.args === 'string') {
|
|
775
|
-
addRef(refItems, getArgsReferenceWithPath(projectSchema, query, queryPath), predicate);
|
|
776
|
-
}
|
|
777
|
-
if (query.args && typeof query.args === 'object') {
|
|
778
|
-
visitSchemaProperties(dereferenceObjectSchema(projectSchema, query.args), [...queryPath, 'args'], propertyVisitor);
|
|
779
|
-
}
|
|
780
|
-
if (query.shape) {
|
|
781
|
-
const {
|
|
782
|
-
isArray,
|
|
783
|
-
ref
|
|
784
|
-
} = parseReturnShape(projectSchema, query.shape);
|
|
785
|
-
if (ref) {
|
|
786
|
-
addRef(refItems, {
|
|
787
|
-
...ref,
|
|
788
|
-
path: queryPath.concat(isArray ? ['shape', 'items', '@ref'] : ['shape'])
|
|
789
|
-
}, predicate);
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
return refItems;
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
/**
|
|
796
|
-
* Collect refs from `queries` or `mutations`.
|
|
797
|
-
*/
|
|
798
|
-
export function getAllRefsInQueries(projectSchema, rootPropertyName, predicate) {
|
|
799
|
-
const refItems = [];
|
|
800
|
-
const rootPath = [rootPropertyName];
|
|
801
|
-
for (const [queryName, query] of Object.entries(projectSchema[rootPropertyName])) {
|
|
802
|
-
const queryPath = rootPath.concat([queryName]);
|
|
803
|
-
const queryRefs = getAllRefsInQuery(projectSchema, queryPath, query, predicate);
|
|
804
|
-
if (queryRefs.length) {
|
|
805
|
-
refItems.push(...queryRefs);
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
return refItems;
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
/**
|
|
812
|
-
* Get all refs in a ProjectSchemaJSON
|
|
813
|
-
* @param predicate return true to include the ref in
|
|
814
|
-
*/
|
|
815
|
-
export function getAllRefs(projectSchema, predicate) {
|
|
816
|
-
return [...getAllRefsInShapes(projectSchema, predicate), ...getAllRefsInQueries(projectSchema, 'queries', predicate), ...getAllRefsInQueries(projectSchema, 'mutations', predicate)];
|
|
817
|
-
}
|
|
818
|
-
export function isValidRefItem(refItem) {
|
|
819
|
-
return refItem.isValidService;
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
/**
|
|
823
|
-
* Get all valid refs in a ProjectSchemaJSON
|
|
824
|
-
* @param predicate return true to include the ref in
|
|
825
|
-
*/
|
|
826
|
-
export function getAllValidRefs(projectSchema, predicate) {
|
|
827
|
-
return getAllRefs(projectSchema, predicate).filter(isValidRefItem);
|
|
828
|
-
}
|
|
829
|
-
export function parseMapping(mapping) {
|
|
830
|
-
const [providerId, serviceId, coordinate] = mapping.split(':');
|
|
831
|
-
const [shapeName, key] = coordinate.split('.');
|
|
832
|
-
return {
|
|
833
|
-
providerId,
|
|
834
|
-
serviceId,
|
|
835
|
-
shapeName,
|
|
836
|
-
key
|
|
837
|
-
};
|
|
838
|
-
}
|
|
839
|
-
export function splitMapping(mapping) {
|
|
840
|
-
const parts = mapping.split('.');
|
|
841
|
-
return [parts[0], parts.slice(1).join('.')];
|
|
842
|
-
}
|
|
843
|
-
export function findMapping(schema, predicate) {
|
|
844
|
-
const mapping = schema['@mapping'];
|
|
845
|
-
if (Array.isArray(mapping)) {
|
|
846
|
-
return mapping.find(predicate);
|
|
847
|
-
}
|
|
848
|
-
return mapping && predicate(mapping) ? mapping : undefined;
|
|
849
|
-
}
|
|
850
|
-
export function getFirstMapping(schema) {
|
|
851
|
-
return Array.isArray(schema['@mapping']) ? schema['@mapping'][0] : schema['@mapping'];
|
|
852
|
-
}
|
|
853
|
-
export function getFullyQualifiedShapeName(schema) {
|
|
854
|
-
const first = getFirstMapping(schema);
|
|
855
|
-
return first ? splitMapping(first)[0] : undefined;
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
/**
|
|
859
|
-
* Find key for use storing data in ShapeDB or API Indexing this allows renaming of properties without db migration
|
|
860
|
-
* Mapping must be using the shapedb service id
|
|
861
|
-
* @param schema
|
|
862
|
-
*/
|
|
863
|
-
export function getStorageKey(schema) {
|
|
864
|
-
const first = findMapping(schema, mapping => mapping.startsWith('shapedb:'));
|
|
865
|
-
return first ? splitMapping(first)[1] : undefined;
|
|
866
|
-
}
|
|
867
|
-
export function getPropertyService(schema) {
|
|
868
|
-
const first = getFirstMapping(schema);
|
|
869
|
-
const split = first?.split(':');
|
|
870
|
-
return split ? `${split[0]}:${split[1]}` : undefined;
|
|
871
|
-
}
|
|
872
|
-
export function emptySchema(projectId) {
|
|
873
|
-
return {
|
|
874
|
-
projectId,
|
|
875
|
-
defaultLocale: 'en-us',
|
|
876
|
-
locales: ['en-us'],
|
|
877
|
-
apiVersion: '2',
|
|
878
|
-
schemaVersion: CURRENT_SCHEMA_VERSION,
|
|
879
|
-
queries: {},
|
|
880
|
-
mutations: {},
|
|
881
|
-
shapes: {},
|
|
882
|
-
workflows: {},
|
|
883
|
-
forms: {}
|
|
884
|
-
};
|
|
885
|
-
}
|
|
886
|
-
export function createLayerSchema(partialSchema) {
|
|
887
|
-
return {
|
|
888
|
-
schemaVersion: CURRENT_SCHEMA_VERSION,
|
|
889
|
-
queries: {},
|
|
890
|
-
mutations: {},
|
|
891
|
-
shapes: {},
|
|
892
|
-
...partialSchema
|
|
893
|
-
};
|
|
894
|
-
}
|
|
895
|
-
export function getShapesById(projectSchema) {
|
|
896
|
-
return keyBy(Object.values(projectSchema.shapes), 'id');
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
/**
|
|
900
|
-
* Walk through the project schema and return an array of all
|
|
901
|
-
* referenced shape names that are in a service namespace.
|
|
902
|
-
*
|
|
903
|
-
* @param projectSchema A V3 project schema.
|
|
904
|
-
*
|
|
905
|
-
* @returns A `string` array with all the shapes that are in namespaces.
|
|
906
|
-
*/
|
|
907
|
-
export function getAllNamespaceShapes(projectSchema) {
|
|
908
|
-
const isServiceRef = refItem => Boolean(refItem.serviceNamespace);
|
|
909
|
-
return uniq(getAllValidRefs(projectSchema, isServiceRef).map(refItemToNamespacedShapeName));
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
/**
|
|
913
|
-
* Returns a list of all shape names in a service namespace, excluding any
|
|
914
|
-
* that have been set directly in the project schema
|
|
915
|
-
*
|
|
916
|
-
* @todo It's unsound to discard dependencies in this way, should avoid
|
|
917
|
-
* collisions with aliases or similar any remote shape that collides,
|
|
918
|
-
* e.g., Shopify_Product -> Shopify_Product_2
|
|
919
|
-
*
|
|
920
|
-
* @param projectSchema A V3 project schema with remote service configs.
|
|
921
|
-
*
|
|
922
|
-
* @returns A `Set` of shape names.
|
|
923
|
-
*/
|
|
924
|
-
export function getNamespacedShapeNameList(projectSchema) {
|
|
925
|
-
const requiredShapeNames = new Set();
|
|
926
|
-
|
|
927
|
-
// All the shape names
|
|
928
|
-
const existingShapeNames = new Set(Object.keys(projectSchema.shapes));
|
|
929
|
-
|
|
930
|
-
// All the referenced shape names with namespaces that belong to a service
|
|
931
|
-
const namespacedShapeNames = new Set(getAllNamespaceShapes(projectSchema));
|
|
932
|
-
|
|
933
|
-
// Add all namespaced shapes to the schema if they are not already present,
|
|
934
|
-
// e.g. Shopify_Product
|
|
935
|
-
namespacedShapeNames.forEach(name => {
|
|
936
|
-
if (!existingShapeNames.has(name)) {
|
|
937
|
-
requiredShapeNames.add(name);
|
|
938
|
-
}
|
|
939
|
-
});
|
|
940
|
-
return requiredShapeNames;
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
/**
|
|
944
|
-
* Filter the service map to return only services passing the GraphQL Service
|
|
945
|
-
* typeguard.
|
|
946
|
-
*
|
|
947
|
-
* @param serviceMap A service map.
|
|
948
|
-
*
|
|
949
|
-
* @returns A new map with the filtered list of services
|
|
950
|
-
*/
|
|
951
|
-
export function filterGraphQLServiceMap(serviceMap) {
|
|
952
|
-
const filtered = new Map();
|
|
953
|
-
for (const [serviceKey, serviceConfig] of serviceMap) {
|
|
954
|
-
if (serviceConfig.serviceType === 'graphql') {
|
|
955
|
-
filtered.set(serviceKey, serviceConfig);
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
return filtered;
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
/**
|
|
962
|
-
* Creates a schema property list chainable fn, allowing you to manipulate and
|
|
963
|
-
* iterate the properties in a schema.
|
|
964
|
-
*/
|
|
965
|
-
export const createSchemaPropertyList = curry((context, shapeOrSchema) => {
|
|
966
|
-
const propSchema = isShape(shapeOrSchema) ? shapeOrSchema.schema : shapeOrSchema;
|
|
967
|
-
const schema = dereferenceSchema(context, propSchema, isShape(shapeOrSchema) ? ['shapes', shapeOrSchema.name] : undefined);
|
|
968
|
-
const propertyIterator = new Map(isObjectSchema(schema) ? Object.entries(schema.properties) : undefined);
|
|
969
|
-
const defaultOrderByIteratees = [n => n[0]];
|
|
970
|
-
const defaultOrderByOrders = ['asc'];
|
|
971
|
-
const _orderBy = (iteratees = defaultOrderByIteratees, orders = defaultOrderByOrders) => {
|
|
972
|
-
self._propertyIterator = new Map(orderBy(iteratees, orders, Array.from(self._propertyIterator)));
|
|
973
|
-
return self;
|
|
974
|
-
};
|
|
975
|
-
const _sortWith = comparator => {
|
|
976
|
-
self._propertyIterator = new Map(Array.from(self._propertyIterator).sort(comparator));
|
|
977
|
-
return self;
|
|
978
|
-
};
|
|
979
|
-
const _sortByNamesWithList = comparatorArray => {
|
|
980
|
-
// If no array is provided, the original sort is preserved
|
|
981
|
-
if (comparatorArray) {
|
|
982
|
-
self._propertyIterator = new Map(Array.from(self._propertyIterator).filter(([name]) => comparatorArray.includes(name)).sort(([nameA], [nameB]) => {
|
|
983
|
-
const indexA = comparatorArray.indexOf(nameA);
|
|
984
|
-
const indexB = comparatorArray.indexOf(nameB);
|
|
985
|
-
return (indexA > -1 ? indexA : Infinity) - (indexB > -1 ? indexB : Infinity);
|
|
986
|
-
}));
|
|
987
|
-
}
|
|
988
|
-
return self;
|
|
989
|
-
};
|
|
990
|
-
const _filterBy = predicate => {
|
|
991
|
-
self._propertyIterator = new Map(Array.from(self._propertyIterator).filter(predicate));
|
|
992
|
-
return self;
|
|
993
|
-
};
|
|
994
|
-
const _forEach = iteratee => {
|
|
995
|
-
Array.from(self._propertyIterator).forEach(iteratee);
|
|
996
|
-
return self;
|
|
997
|
-
};
|
|
998
|
-
const _getNodes = () => {
|
|
999
|
-
return Array.from(self._propertyIterator);
|
|
1000
|
-
};
|
|
1001
|
-
const _getObject = () => {
|
|
1002
|
-
return Array.from(self._propertyIterator).reduce((curr, node) => Object.assign(curr, {
|
|
1003
|
-
[node[0]]: node[1]
|
|
1004
|
-
}), {});
|
|
1005
|
-
};
|
|
1006
|
-
const _getNames = () => {
|
|
1007
|
-
return Array.from(self._propertyIterator, ([name]) => name);
|
|
1008
|
-
};
|
|
1009
|
-
const _getValues = () => {
|
|
1010
|
-
return Array.from(self._propertyIterator, ([, value]) => value);
|
|
1011
|
-
};
|
|
1012
|
-
const self = {
|
|
1013
|
-
_propertyIterator: propertyIterator,
|
|
1014
|
-
orderBy: _orderBy,
|
|
1015
|
-
sortWith: _sortWith,
|
|
1016
|
-
sortByNamesWithList: _sortByNamesWithList,
|
|
1017
|
-
filterBy: _filterBy,
|
|
1018
|
-
forEach: _forEach,
|
|
1019
|
-
getNodes: _getNodes,
|
|
1020
|
-
getObject: _getObject,
|
|
1021
|
-
getNames: _getNames,
|
|
1022
|
-
getValues: _getValues
|
|
1023
|
-
};
|
|
1024
|
-
return self;
|
|
1025
|
-
});
|
|
1026
|
-
function isShape(shapeOrSchema) {
|
|
1027
|
-
return 'schema' in shapeOrSchema;
|
|
1028
|
-
}
|
|
1029
|
-
class SchemaPropertyAccessor {
|
|
1030
|
-
constructor(context, shapeOrSchema) {
|
|
1031
|
-
const propSchema = isShape(shapeOrSchema) ? shapeOrSchema.schema : shapeOrSchema;
|
|
1032
|
-
this.schema = dereferenceSchema(context, propSchema, isShape(shapeOrSchema) ? ['shapes', shapeOrSchema.name] : undefined);
|
|
1033
|
-
this.entries = isObjectSchema(this.schema) ? Object.entries(this.schema.properties) : [];
|
|
1034
|
-
this.properties = new Map(this.entries);
|
|
1035
|
-
}
|
|
1036
|
-
getValue(propertyName) {
|
|
1037
|
-
return this.properties.get(propertyName);
|
|
1038
|
-
}
|
|
1039
|
-
findValue(predicate) {
|
|
1040
|
-
return this.entries.find(predicate)?.[1];
|
|
1041
|
-
}
|
|
1042
|
-
findName(predicate) {
|
|
1043
|
-
return this.entries.find(predicate)?.[0];
|
|
1044
|
-
}
|
|
1045
|
-
getKey(propertyName) {
|
|
1046
|
-
const value = this.properties.get(propertyName);
|
|
1047
|
-
if (value) {
|
|
1048
|
-
return getStorageKey(value);
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
/**
|
|
1053
|
-
* Creates a schema property accessor, allowing you to safely access schema
|
|
1054
|
-
* properties.
|
|
1055
|
-
*/
|
|
1056
|
-
export const createSchemaPropertyAccessor = curry((context, shapeOrSchema) => {
|
|
1057
|
-
return new SchemaPropertyAccessor(context, shapeOrSchema);
|
|
1058
|
-
});
|
|
1059
|
-
function findQueryHelper(slice, shapeName, resolver, type) {
|
|
1060
|
-
const schemaPath = type === 'query' ? 'queries' : 'mutations';
|
|
1061
|
-
return Object.keys(slice[schemaPath]).find(queryName => {
|
|
1062
|
-
const queryOrMutation = slice[schemaPath][queryName];
|
|
1063
|
-
return queryOrMutation.resolver.name === resolver && queryOrMutation.resolver.shapeName === shapeName;
|
|
1064
|
-
});
|
|
1065
|
-
}
|
|
1066
|
-
function ensureQueryHelper(slice, shapeName, resolver, type) {
|
|
1067
|
-
const foundQuery = findQueryHelper(slice, shapeName, resolver, type);
|
|
1068
|
-
if (!foundQuery) {
|
|
1069
|
-
throw new Error(`Failed to find a "${resolver}" ${type} for shape "${shapeName}"`);
|
|
1070
|
-
}
|
|
1071
|
-
return foundQuery;
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
/**
|
|
1075
|
-
* Find the query in the schema that corresponds to the given shape and resolver.
|
|
1076
|
-
*/
|
|
1077
|
-
export const findQueryByShape = (projectSchema, shapeName, resolver) => findQueryHelper(projectSchema, shapeName, resolver, 'query');
|
|
1078
|
-
/**
|
|
1079
|
-
* Find the query in the schema that corresponds to the given shape and resolver.
|
|
1080
|
-
*/
|
|
1081
|
-
export const findMutationByShape = (projectSchema, shapeName, resolver) => findQueryHelper(projectSchema, shapeName, resolver, 'mutation');
|
|
1082
|
-
|
|
1083
|
-
/**
|
|
1084
|
-
* Find the query in the schema that corresponds to the given shape and resolver.
|
|
1085
|
-
* Throw an error if that query does not exist
|
|
1086
|
-
*/
|
|
1087
|
-
export const ensureQueryByShape = (projectSchema, shapeName, resolver) => ensureQueryHelper(projectSchema, shapeName, resolver, 'query');
|
|
1088
|
-
/**
|
|
1089
|
-
* Find the mutation in the schema that corresponds to the given shape and resolver.
|
|
1090
|
-
* Throw an error if that mutation does not exist
|
|
1091
|
-
*/
|
|
1092
|
-
export const ensureMutationByShape = (projectSchema, shapeName, resolver) => ensureQueryHelper(projectSchema, shapeName, resolver, 'mutation');
|
|
1093
|
-
/**
|
|
1094
|
-
* Find the query in the schema that corresponds to the given shape and resolver.
|
|
1095
|
-
*/
|
|
1096
|
-
export const getDefaultMutationName = (shapeName, resolver) => {
|
|
1097
|
-
const action = resolver.substring(resolver.indexOf(':') + 1);
|
|
1098
|
-
return `${action}${shapeName}`;
|
|
1099
|
-
};
|
|
1100
|
-
export function createShape(name, schema, rest) {
|
|
1101
|
-
return {
|
|
1102
|
-
name,
|
|
1103
|
-
id: name,
|
|
1104
|
-
title: name,
|
|
1105
|
-
schema,
|
|
1106
|
-
...rest
|
|
1107
|
-
};
|
|
1108
|
-
}
|
|
1109
|
-
export function queryToPropertySchema(projectSchema, query) {
|
|
1110
|
-
let mapping;
|
|
1111
|
-
if (isGraphqlResolver(query.resolver)) {
|
|
1112
|
-
mapping = serializePropertyRef({
|
|
1113
|
-
serviceId: query.resolver.service,
|
|
1114
|
-
shapeName: 'Query',
|
|
1115
|
-
propertyName: query.resolver.fieldName
|
|
1116
|
-
});
|
|
1117
|
-
}
|
|
1118
|
-
return {
|
|
1119
|
-
...returnShapeToSchema(projectSchema, query.shape),
|
|
1120
|
-
...(mapping ? {
|
|
1121
|
-
'@mapping': mapping
|
|
1122
|
-
} : {}),
|
|
1123
|
-
'@resolver': query.resolver,
|
|
1124
|
-
'@args': query.args
|
|
1125
|
-
};
|
|
1126
|
-
}
|
|
1127
|
-
export function getQueriesShape(projectSchema, operation) {
|
|
1128
|
-
return createShape(pascalCase(operation), {
|
|
1129
|
-
type: 'object',
|
|
1130
|
-
properties: mapValues(projectSchema[operation === 'query' ? 'queries' : 'mutations'], query => queryToPropertySchema(projectSchema, query))
|
|
1131
|
-
});
|
|
1132
|
-
}
|
|
1133
|
-
export function fieldMappingContainsKey(fieldMapping, key) {
|
|
1134
|
-
if (isArray(fieldMapping)) {
|
|
1135
|
-
return some(fieldMapping, mapping => parseMapping(mapping).key === key);
|
|
1136
|
-
}
|
|
1137
|
-
return parseMapping(fieldMapping).key === key;
|
|
1138
|
-
}
|
|
1139
|
-
|
|
1140
|
-
/**
|
|
1141
|
-
* Return true if `schemaWithRef` is a ref to a shape named `shapeName`
|
|
1142
|
-
*/
|
|
1143
|
-
export function schemaMatchesShapeName(workingCopy, propertySchema, shapeName) {
|
|
1144
|
-
const arrayOfShapeRef = getRef(workingCopy, propertySchema);
|
|
1145
|
-
return Boolean(arrayOfShapeRef && refItemToNamespacedShapeName(arrayOfShapeRef) === shapeName);
|
|
1146
|
-
}
|
|
1147
|
-
|
|
1148
|
-
/**
|
|
1149
|
-
* Return true if `shape` has a property that is an array of refs to `shapeName`
|
|
1150
|
-
*/
|
|
1151
|
-
export const shapeHasArrayPropOfShape = (projectSchema, shape, shapeName) => {
|
|
1152
|
-
if (shape && isObjectSchema(shape.schema)) {
|
|
1153
|
-
for (const propName in shape.schema.properties) {
|
|
1154
|
-
if (Object.hasOwn(shape.schema.properties, propName)) {
|
|
1155
|
-
const propSchema = shape.schema.properties[propName];
|
|
1156
|
-
if (propSchema.items && isRefSchema(propSchema.items) && schemaMatchesShapeName(projectSchema, propSchema.items, shapeName)) {
|
|
1157
|
-
return true;
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
}
|
|
1161
|
-
}
|
|
1162
|
-
return false;
|
|
1163
|
-
};
|
|
1164
|
-
export const getQueryMapName = type => {
|
|
1165
|
-
return type === 'query' ? 'queries' : 'mutations';
|
|
1166
|
-
};
|