@takeshape/schema 11.52.0 → 11.56.1
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/__tests__/_examples.test.js +77 -0
- package/dist/__tests__/agents.test.js +163 -0
- package/dist/__tests__/api-version.test.js +24 -0
- package/dist/__tests__/builtin-schema.test.js +18 -0
- package/dist/__tests__/content-schema-transform.test.d.ts +1 -0
- package/dist/__tests__/content-schema-transform.test.js +522 -0
- package/dist/__tests__/create-input-schema.test.d.ts +1 -0
- package/dist/__tests__/create-input-schema.test.js +184 -0
- package/dist/__tests__/enum.test.d.ts +1 -0
- package/dist/__tests__/enum.test.js +36 -0
- package/dist/__tests__/flatten-templates.test.d.ts +1 -0
- package/dist/__tests__/flatten-templates.test.js +40 -0
- package/dist/__tests__/get-is-leaf.test.d.ts +1 -0
- package/dist/__tests__/get-is-leaf.test.js +50 -0
- package/dist/__tests__/interfaces.test.d.ts +1 -0
- package/dist/__tests__/interfaces.test.js +219 -0
- package/dist/__tests__/migration.test.d.ts +1 -0
- package/dist/__tests__/migration.test.js +34 -0
- package/dist/__tests__/mocks.test.d.ts +1 -0
- package/dist/__tests__/mocks.test.js +24 -0
- package/dist/__tests__/refs.test.d.ts +1 -0
- package/dist/__tests__/refs.test.js +752 -0
- package/dist/__tests__/relationships.test.d.ts +1 -0
- package/dist/__tests__/relationships.test.js +638 -0
- package/dist/__tests__/schema-transform.test.d.ts +1 -0
- package/dist/__tests__/schema-transform.test.js +205 -0
- package/dist/__tests__/schema-util.test.d.ts +1 -0
- package/dist/__tests__/schema-util.test.js +1731 -0
- package/dist/__tests__/service-dependencies.test.d.ts +1 -0
- package/dist/__tests__/service-dependencies.test.js +360 -0
- package/dist/__tests__/unions.test.d.ts +1 -0
- package/dist/__tests__/unions.test.js +44 -0
- package/dist/__tests__/validate.test.d.ts +1 -0
- package/dist/__tests__/validate.test.js +1926 -0
- package/dist/__tests__/workflows.test.d.ts +3 -0
- package/dist/__tests__/workflows.test.js +149 -0
- package/dist/agents.d.ts +14 -0
- package/dist/auth-schemas.d.ts +125 -0
- package/dist/builtin-schema.d.ts +8 -0
- package/dist/content-schema-transform.d.ts +35 -0
- package/dist/content-schema-transform.js +162 -0
- package/dist/create-input-schema.d.ts +9 -0
- package/dist/enum.d.ts +2 -0
- package/dist/flatten-templates.d.ts +2 -0
- package/dist/flatten-templates.js +20 -0
- package/dist/get-is-leaf.d.ts +3 -0
- package/dist/get-is-leaf.js +56 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.js +46 -0
- package/dist/interfaces.d.ts +12 -0
- package/dist/interfaces.js +85 -0
- package/dist/layers/__tests__/layers.test.d.ts +1 -0
- package/dist/layers/__tests__/layers.test.js +38 -0
- package/dist/layers/layers.d.ts +26 -0
- package/dist/layers/layers.js +301 -0
- package/dist/layers/refs.d.ts +102 -0
- package/dist/layers/refs.js +220 -0
- package/dist/layers/type-utils.d.ts +59 -0
- package/dist/layers/type-utils.js +118 -0
- package/dist/layers/visitor.d.ts +5 -0
- package/dist/layers/visitor.js +38 -0
- package/dist/migration/index.d.ts +64 -0
- package/dist/migration/index.js +122 -0
- package/dist/migration/to/__tests__/v3.10.0.test.d.ts +1 -0
- package/dist/migration/to/__tests__/v3.10.0.test.js +90 -0
- package/dist/migration/to/__tests__/v3.12.3.test.d.ts +1 -0
- package/dist/migration/to/__tests__/v3.12.3.test.js +103 -0
- package/dist/migration/to/__tests__/v3.17.test.d.ts +1 -0
- package/dist/migration/to/__tests__/v3.17.test.js +71 -0
- package/dist/migration/to/__tests__/v3.34.0.test.d.ts +1 -0
- package/dist/migration/to/__tests__/v3.34.0.test.js +240 -0
- package/dist/migration/to/__tests__/v3.39.0.test.d.ts +1 -0
- package/dist/migration/to/__tests__/v3.39.0.test.js +116 -0
- package/dist/migration/to/__tests__/v3.46.0.test.d.ts +1 -0
- package/dist/migration/to/__tests__/v3.46.0.test.js +59 -0
- package/dist/migration/to/v3.0.0.d.ts +4 -0
- package/dist/migration/to/v3.0.0.js +212 -0
- package/dist/migration/to/v3.1.0.d.ts +4 -0
- package/dist/migration/to/v3.1.0.js +194 -0
- package/dist/migration/to/v3.10.0.d.ts +4 -0
- package/dist/migration/to/v3.11.0.d.ts +4 -0
- package/dist/migration/to/v3.12.0.d.ts +4 -0
- package/dist/migration/to/v3.12.1.d.ts +4 -0
- package/dist/migration/to/v3.12.2.d.ts +4 -0
- package/dist/migration/to/v3.12.3.d.ts +4 -0
- package/dist/migration/to/v3.13.0.d.ts +4 -0
- package/dist/migration/to/v3.14.0.d.ts +4 -0
- package/dist/migration/to/v3.15.0.d.ts +4 -0
- package/dist/migration/to/v3.16.0.d.ts +4 -0
- package/dist/migration/to/v3.17.0.d.ts +4 -0
- package/dist/migration/to/v3.17.1.d.ts +4 -0
- package/dist/migration/to/v3.18.0.d.ts +4 -0
- package/dist/migration/to/v3.18.1.d.ts +4 -0
- package/dist/migration/to/v3.18.2.d.ts +4 -0
- package/dist/migration/to/v3.19.0.d.ts +4 -0
- package/dist/migration/to/v3.2.0.d.ts +4 -0
- package/dist/migration/to/v3.20.0.d.ts +4 -0
- package/dist/migration/to/v3.21.0.d.ts +4 -0
- package/dist/migration/to/v3.22.0.d.ts +4 -0
- package/dist/migration/to/v3.23.0.d.ts +4 -0
- package/dist/migration/to/v3.24.0.d.ts +4 -0
- package/dist/migration/to/v3.25.0.d.ts +4 -0
- package/dist/migration/to/v3.26.0.d.ts +4 -0
- package/dist/migration/to/v3.27.0.d.ts +4 -0
- package/dist/migration/to/v3.28.0.d.ts +4 -0
- package/dist/migration/to/v3.29.0.d.ts +4 -0
- package/dist/migration/to/v3.3.0.d.ts +4 -0
- package/dist/migration/to/v3.30.0.d.ts +4 -0
- package/dist/migration/to/v3.31.0.d.ts +4 -0
- package/dist/migration/to/v3.32.0.d.ts +4 -0
- package/dist/migration/to/v3.32.0.js +59 -0
- package/dist/migration/to/v3.33.0.d.ts +4 -0
- package/dist/migration/to/v3.34.0.d.ts +6 -0
- package/dist/migration/to/v3.34.0.js +116 -0
- package/dist/migration/to/v3.35.0.d.ts +4 -0
- package/dist/migration/to/v3.36.0.d.ts +4 -0
- package/dist/migration/to/v3.37.0.d.ts +4 -0
- package/dist/migration/to/v3.38.0.d.ts +4 -0
- package/dist/migration/to/v3.39.0.d.ts +4 -0
- package/dist/migration/to/v3.39.0.js +45 -0
- package/dist/migration/to/v3.4.0.d.ts +4 -0
- package/dist/migration/to/v3.40.0.d.ts +4 -0
- package/dist/migration/to/v3.41.0.d.ts +4 -0
- package/dist/migration/to/v3.42.0.d.ts +4 -0
- package/dist/migration/to/v3.43.0.d.ts +4 -0
- package/dist/migration/to/v3.44.0.d.ts +4 -0
- package/dist/migration/to/v3.45.0.d.ts +4 -0
- package/dist/migration/to/v3.46.0.d.ts +4 -0
- package/dist/migration/to/v3.47.0.d.ts +4 -0
- package/dist/migration/to/v3.48.0.d.ts +4 -0
- package/dist/migration/to/v3.49.0.d.ts +4 -0
- package/dist/migration/to/v3.5.0.d.ts +4 -0
- package/dist/migration/to/v3.5.1.d.ts +4 -0
- package/dist/migration/to/v3.50.0.d.ts +4 -0
- package/dist/migration/to/v3.51.0.d.ts +4 -0
- package/dist/migration/to/v3.6.0.d.ts +4 -0
- package/dist/migration/to/v3.7.0.d.ts +4 -0
- package/dist/migration/to/v3.8.0.d.ts +4 -0
- package/dist/migration/to/v3.9.0.d.ts +4 -0
- package/dist/migration/types.d.ts +19 -0
- package/dist/migration/types.js +1 -0
- package/dist/mocks.d.ts +13 -0
- package/dist/mocks.js +58 -0
- package/dist/models/__tests__/project-schema.test.d.ts +1 -0
- package/dist/models/__tests__/project-schema.test.js +67 -0
- package/dist/models/__tests__/query.test.d.ts +1 -0
- package/dist/models/__tests__/query.test.js +27 -0
- package/dist/models/__tests__/service.test.d.ts +1 -0
- package/dist/models/__tests__/service.test.js +17 -0
- package/dist/models/__tests__/shape.test.d.ts +1 -0
- package/dist/models/__tests__/shape.test.js +61 -0
- package/dist/models/project-schema.d.ts +35 -0
- package/dist/models/project-schema.js +92 -0
- package/dist/models/query.d.ts +17 -0
- package/dist/models/service.d.ts +12 -0
- package/dist/models/shape.d.ts +41 -0
- package/dist/models/shape.js +85 -0
- package/dist/patterns.js +1 -0
- package/dist/project-schema/index.d.ts +187 -0
- package/dist/project-schema/index.js +75 -0
- package/dist/project-schema/latest.d.ts +2222 -0
- package/dist/project-schema/migrate.d.ts +4 -0
- package/dist/project-schema/migrate.js +194 -0
- package/dist/project-schema/v3.48.0.d.ts +2161 -0
- package/dist/project-schema/v3.49.0.d.ts +2170 -0
- package/dist/project-schema/v3.50.0.d.ts +2222 -0
- package/dist/project-schema/v3.51.0.d.ts +2222 -0
- package/dist/refs.d.ts +226 -0
- package/dist/refs.js +608 -0
- package/dist/relationships.d.ts +40 -0
- package/dist/relationships.js +311 -0
- package/dist/runtime-schema.d.ts +5 -0
- package/dist/runtime-schema.js +80 -0
- package/dist/schema-transform.d.ts +19 -0
- package/dist/schema-transform.js +74 -0
- package/dist/schema-util.d.ts +210 -0
- package/dist/schema-util.js +1077 -0
- package/dist/schemas/auth-schemas.json +365 -0
- package/dist/schemas/index.js +154 -0
- package/dist/schemas/project-schema/experimental.json +1104 -0
- package/dist/service-dependencies.d.ts +13 -0
- package/dist/service-dependencies.js +165 -0
- package/dist/services/__tests__/services.test.d.ts +1 -0
- package/dist/services/__tests__/services.test.js +113 -0
- package/dist/services/services.d.ts +31 -0
- package/dist/services/services.js +145 -0
- package/dist/services/types.js +1 -0
- package/dist/services/util.d.ts +16 -0
- package/dist/taxonomies.d.ts +15 -0
- package/dist/taxonomies.js +24 -0
- package/dist/template-shapes/__tests__/index.test.d.ts +1 -0
- package/dist/template-shapes/__tests__/index.test.js +40 -0
- package/dist/template-shapes/__tests__/names.test.d.ts +1 -0
- package/dist/template-shapes/__tests__/names.test.js +19 -0
- package/dist/template-shapes/__tests__/templates.test.d.ts +1 -0
- package/dist/template-shapes/__tests__/templates.test.js +80 -0
- package/dist/template-shapes/__tests__/where.test.d.ts +1 -0
- package/dist/template-shapes/__tests__/where.test.js +218 -0
- package/dist/template-shapes/index.d.ts +7 -0
- package/dist/template-shapes/names.d.ts +10 -0
- package/dist/template-shapes/templates.d.ts +32 -0
- package/dist/template-shapes/templates.js +319 -0
- package/dist/template-shapes/types.d.ts +15 -0
- package/dist/template-shapes/where.d.ts +37 -0
- package/dist/template-shapes/where.js +402 -0
- package/dist/types/__tests__/utils.test.d.ts +1 -0
- package/dist/types/__tests__/utils.test.js +159 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +2 -0
- package/dist/types/transforms.d.ts +13 -0
- package/dist/types/transforms.js +1 -0
- package/dist/types/types.d.ts +211 -0
- package/dist/types/utils.d.ts +117 -0
- package/dist/types/utils.js +279 -0
- package/dist/unions.d.ts +14 -0
- package/dist/unions.js +77 -0
- package/dist/util/__tests__/api-indexing.test.d.ts +1 -0
- package/dist/util/__tests__/api-indexing.test.js +129 -0
- package/dist/util/__tests__/detect-cycles.test.d.ts +1 -0
- package/dist/util/__tests__/detect-cycles.test.js +193 -0
- package/dist/util/__tests__/find-shape-at-path.test.d.ts +1 -0
- package/dist/util/__tests__/find-shape-at-path.test.js +41 -0
- package/dist/util/__tests__/form-config.test.d.ts +1 -0
- package/dist/util/__tests__/form-config.test.js +196 -0
- package/dist/util/__tests__/get-return-shape.test.d.ts +1 -0
- package/dist/util/__tests__/get-return-shape.test.js +27 -0
- package/dist/util/__tests__/has-args.test.d.ts +1 -0
- package/dist/util/__tests__/has-args.test.js +46 -0
- package/dist/util/__tests__/merge.test.d.ts +1 -0
- package/dist/util/__tests__/merge.test.js +1074 -0
- package/dist/util/__tests__/patch-schema.test.d.ts +1 -0
- package/dist/util/__tests__/patch-schema.test.js +82 -0
- package/dist/util/__tests__/shapes.test.d.ts +1 -0
- package/dist/util/__tests__/shapes.test.js +30 -0
- package/dist/util/ai-tools.d.ts +3 -0
- package/dist/util/api-indexing.d.ts +9 -0
- package/dist/util/api-indexing.js +57 -0
- package/dist/util/detect-cycles.d.ts +7 -0
- package/dist/util/detect-cycles.js +45 -0
- package/dist/util/find-shape-at-path.d.ts +21 -0
- package/dist/util/form-config.d.ts +11 -0
- package/dist/util/form-config.js +62 -0
- package/dist/util/get-conflicting-properties.d.ts +6 -0
- package/dist/util/get-conflicting-properties.js +55 -0
- package/dist/util/get-return-shape.d.ts +4 -0
- package/dist/util/get-return-shape.js +30 -0
- package/dist/util/has-arg.d.ts +4 -0
- package/dist/util/has-arg.js +13 -0
- package/dist/util/merge.d.ts +15 -0
- package/dist/util/merge.js +256 -0
- package/dist/util/patch-schema.d.ts +8 -0
- package/dist/util/shapes.d.ts +5 -0
- package/dist/validate/errors.d.ts +3 -0
- package/dist/validate/errors.js +20 -0
- package/dist/validate/validate.d.ts +73 -0
- package/dist/validate/validate.js +1107 -0
- package/dist/versions.d.ts +4 -0
- package/dist/versions.js +4 -0
- package/dist/workflows.d.ts +14 -0
- package/dist/workflows.js +66 -0
- package/examples/latest/agent-schema.json +12 -4
- package/examples/latest/all-fields-shapes-inline.json +52 -18
- package/examples/latest/all-fields-shapes.json +76 -26
- package/examples/latest/betzino.json +3139 -902
- package/examples/latest/blog-schema.json +28 -8
- package/examples/latest/brewery-schema.json +25 -7
- package/examples/latest/clear-cache-schema.json +7 -3
- package/examples/latest/complex-project-schema.json +359 -98
- package/examples/latest/complex-schema.json +1754 -487
- package/examples/latest/edit-schema.json +11 -4
- package/examples/latest/fabric-ecommerce.json +838 -187
- package/examples/latest/frank-and-fred-schema.json +1753 -486
- package/examples/latest/klirr-schema.json +2411 -682
- package/examples/latest/layers/rick-and-morty-layer.json +32 -11
- package/examples/latest/layers/shopify-layer-2023-01.json +8637 -2206
- package/examples/latest/layers/shopify-storefront-2023-04.json +1714 -404
- package/examples/latest/layers/wordpress-2024-01.json +2746 -691
- package/examples/latest/massive-schema.json +584 -131
- package/examples/latest/mill-components-schema.json +125 -29
- package/examples/latest/nested-shape-arrays.json +19 -7
- package/examples/latest/one-earth.json +1113 -236
- package/examples/latest/pet-oneof-array.json +22 -7
- package/examples/latest/post-schema.json +20 -6
- package/examples/latest/pruned-shopify-product-schema.json +830 -185
- package/examples/latest/rag-example.json +15 -5
- package/examples/latest/real-world-schema.json +56 -14
- package/examples/latest/recursive-repeater-schema.json +11 -4
- package/examples/latest/recursive-schema.json +11 -4
- package/examples/latest/rick-and-morty-ast.json +174 -45
- package/examples/latest/rick-and-morty-graphql.json +100 -25
- package/examples/latest/rick-and-morty-rest.json +7 -3
- package/examples/latest/rick-and-morty-with-indexing.json +13 -5
- package/examples/latest/schema-where-filter.json +40 -11
- package/examples/latest/schema-with-repeater-draftjs.json +8 -3
- package/examples/latest/schema-with-rick-and-morty.json +4 -2
- package/examples/latest/shape-books-v3_2_0.json +71 -17
- package/examples/latest/shape-books.json +71 -17
- package/examples/latest/shape-editor-schema-edited.json +69 -23
- package/examples/latest/shape-editor-schema-initial.json +28 -10
- package/examples/latest/shapedb-crud-every-prop-type.json +22 -8
- package/examples/latest/shopify-lookbook.json +19 -5
- package/examples/latest/shopify-product-2022-07.json +3217 -726
- package/examples/latest/shopify-product-2023-04.json +4496 -1012
- package/examples/latest/shopify-store-with-widget.json +942 -213
- package/examples/latest/stripe-product-runtime-schema.json +277 -81
- package/examples/latest/stripe-starter-resolved.json +1953 -476
- package/examples/latest/user-schema-no-required.json +13 -3
- package/examples/latest/user-schema-with-defaults.json +27 -5
- package/examples/latest/valvoline-ai-demo.json +69 -17
- package/examples/latest/vector-search-schema.json +24 -8
- package/package.json +24 -26
- package/dist/cjs/package.json +0 -1
- package/dist/cjs/src/agents.js +0 -147
- package/dist/cjs/src/api-version.js +0 -24
- package/dist/cjs/src/auth-schemas.js +0 -8
- package/dist/cjs/src/builtin-schema.js +0 -616
- package/dist/cjs/src/constants.js +0 -4
- package/dist/cjs/src/content-schema-transform.js +0 -175
- package/dist/cjs/src/create-input-schema.js +0 -66
- package/dist/cjs/src/enum.js +0 -12
- package/dist/cjs/src/flatten-templates.js +0 -26
- package/dist/cjs/src/get-is-leaf.js +0 -59
- package/dist/cjs/src/index.js +0 -62
- package/dist/cjs/src/interfaces.js +0 -98
- package/dist/cjs/src/layers/layers.js +0 -313
- package/dist/cjs/src/layers/refs.js +0 -243
- package/dist/cjs/src/layers/type-utils.js +0 -145
- package/dist/cjs/src/layers/visitor.js +0 -42
- package/dist/cjs/src/migration/index.js +0 -142
- package/dist/cjs/src/migration/to/v3.0.0.js +0 -217
- package/dist/cjs/src/migration/to/v3.1.0.js +0 -199
- package/dist/cjs/src/migration/to/v3.10.0.js +0 -72
- package/dist/cjs/src/migration/to/v3.11.0.js +0 -90
- package/dist/cjs/src/migration/to/v3.12.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.12.1.js +0 -12
- package/dist/cjs/src/migration/to/v3.12.2.js +0 -12
- package/dist/cjs/src/migration/to/v3.12.3.js +0 -92
- package/dist/cjs/src/migration/to/v3.13.0.js +0 -22
- package/dist/cjs/src/migration/to/v3.14.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.15.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.16.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.17.0.js +0 -27
- package/dist/cjs/src/migration/to/v3.17.1.js +0 -12
- package/dist/cjs/src/migration/to/v3.18.0.js +0 -69
- package/dist/cjs/src/migration/to/v3.18.1.js +0 -20
- package/dist/cjs/src/migration/to/v3.18.2.js +0 -24
- package/dist/cjs/src/migration/to/v3.19.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.2.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.20.0.js +0 -29
- package/dist/cjs/src/migration/to/v3.21.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.22.0.js +0 -30
- package/dist/cjs/src/migration/to/v3.23.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.24.0.js +0 -13
- package/dist/cjs/src/migration/to/v3.25.0.js +0 -13
- package/dist/cjs/src/migration/to/v3.26.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.27.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.28.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.29.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.3.0.js +0 -15
- package/dist/cjs/src/migration/to/v3.30.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.31.0.js +0 -43
- package/dist/cjs/src/migration/to/v3.32.0.js +0 -61
- package/dist/cjs/src/migration/to/v3.33.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.34.0.js +0 -123
- package/dist/cjs/src/migration/to/v3.35.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.36.0.js +0 -27
- package/dist/cjs/src/migration/to/v3.37.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.38.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.39.0.js +0 -47
- package/dist/cjs/src/migration/to/v3.4.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.40.0.js +0 -31
- package/dist/cjs/src/migration/to/v3.41.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.42.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.43.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.44.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.45.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.46.0.js +0 -37
- package/dist/cjs/src/migration/to/v3.47.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.48.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.49.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.5.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.5.1.js +0 -12
- package/dist/cjs/src/migration/to/v3.50.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.51.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.6.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.7.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.8.0.js +0 -12
- package/dist/cjs/src/migration/to/v3.9.0.js +0 -84
- package/dist/cjs/src/migration/types.js +0 -2
- package/dist/cjs/src/migration/utils.js +0 -10
- package/dist/cjs/src/mocks.js +0 -65
- package/dist/cjs/src/models/project-schema.js +0 -99
- package/dist/cjs/src/models/query.js +0 -35
- package/dist/cjs/src/models/service.js +0 -24
- package/dist/cjs/src/models/shape.js +0 -89
- package/dist/cjs/src/patterns.js +0 -2
- package/dist/cjs/src/project-schema/index.js +0 -156
- package/dist/cjs/src/project-schema/latest.js +0 -8
- package/dist/cjs/src/project-schema/migrate.js +0 -198
- package/dist/cjs/src/project-schema/v1.0.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.0.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.1.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.10.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.11.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.12.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.12.1.js +0 -8
- package/dist/cjs/src/project-schema/v3.12.2.js +0 -8
- package/dist/cjs/src/project-schema/v3.12.3.js +0 -8
- package/dist/cjs/src/project-schema/v3.13.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.13.1.js +0 -8
- package/dist/cjs/src/project-schema/v3.14.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.15.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.16.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.17.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.17.1.js +0 -8
- package/dist/cjs/src/project-schema/v3.18.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.18.1.js +0 -8
- package/dist/cjs/src/project-schema/v3.18.2.js +0 -8
- package/dist/cjs/src/project-schema/v3.19.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.2.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.20.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.21.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.22.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.23.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.24.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.25.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.26.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.27.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.28.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.29.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.3.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.30.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.31.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.32.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.33.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.34.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.35.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.36.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.37.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.38.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.39.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.4.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.40.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.41.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.42.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.43.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.44.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.45.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.46.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.47.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.48.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.49.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.5.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.5.1.js +0 -8
- package/dist/cjs/src/project-schema/v3.50.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.51.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.6.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.7.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.8.0.js +0 -8
- package/dist/cjs/src/project-schema/v3.9.0.js +0 -8
- package/dist/cjs/src/project-schema/v4.0.0.js +0 -8
- package/dist/cjs/src/refs.js +0 -671
- package/dist/cjs/src/relationships.js +0 -326
- package/dist/cjs/src/runtime-schema.js +0 -88
- package/dist/cjs/src/scalars.js +0 -8
- package/dist/cjs/src/schema-transform.js +0 -83
- package/dist/cjs/src/schema-util.js +0 -1140
- package/dist/cjs/src/schemas/auth-schemas.json +0 -313
- package/dist/cjs/src/schemas/index.js +0 -162
- package/dist/cjs/src/schemas/project-schema/experimental.json +0 -1101
- package/dist/cjs/src/schemas/user-schema.json +0 -51
- package/dist/cjs/src/service-dependencies.js +0 -172
- package/dist/cjs/src/services/services.js +0 -156
- package/dist/cjs/src/services/types.js +0 -2
- package/dist/cjs/src/services/util.js +0 -45
- package/dist/cjs/src/taxonomies.js +0 -28
- package/dist/cjs/src/template-shapes/index.js +0 -37
- package/dist/cjs/src/template-shapes/names.js +0 -26
- package/dist/cjs/src/template-shapes/templates.js +0 -331
- package/dist/cjs/src/template-shapes/types.js +0 -10
- package/dist/cjs/src/template-shapes/where.js +0 -414
- package/dist/cjs/src/types/index.js +0 -19
- package/dist/cjs/src/types/transforms.js +0 -2
- package/dist/cjs/src/types/types.js +0 -21
- package/dist/cjs/src/types/utils.js +0 -344
- package/dist/cjs/src/unions.js +0 -88
- package/dist/cjs/src/user-schema.js +0 -8
- package/dist/cjs/src/util/ai-tools.js +0 -10
- package/dist/cjs/src/util/api-indexing.js +0 -62
- package/dist/cjs/src/util/detect-cycles.js +0 -48
- package/dist/cjs/src/util/find-shape-at-path.js +0 -57
- package/dist/cjs/src/util/form-config.js +0 -66
- package/dist/cjs/src/util/get-conflicting-properties.js +0 -58
- package/dist/cjs/src/util/get-return-shape.js +0 -34
- package/dist/cjs/src/util/has-arg.js +0 -17
- package/dist/cjs/src/util/merge.js +0 -269
- package/dist/cjs/src/util/patch-schema.js +0 -55
- package/dist/cjs/src/util/shapes.js +0 -31
- package/dist/cjs/src/validate.js +0 -1140
- package/dist/cjs/src/versions.js +0 -8
- package/dist/cjs/src/workflows.js +0 -76
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +0 -1
- package/dist/esm/package.json +0 -1
- package/dist/esm/src/content-schema-transform.js +0 -162
- package/dist/esm/src/flatten-templates.js +0 -20
- package/dist/esm/src/get-is-leaf.js +0 -56
- package/dist/esm/src/index.js +0 -46
- package/dist/esm/src/interfaces.js +0 -85
- package/dist/esm/src/layers/layers.js +0 -301
- package/dist/esm/src/layers/refs.js +0 -220
- package/dist/esm/src/layers/type-utils.js +0 -118
- package/dist/esm/src/layers/visitor.js +0 -38
- package/dist/esm/src/migration/index.js +0 -122
- package/dist/esm/src/migration/to/v3.0.0.js +0 -212
- package/dist/esm/src/migration/to/v3.1.0.js +0 -194
- package/dist/esm/src/migration/to/v3.32.0.js +0 -59
- package/dist/esm/src/migration/to/v3.34.0.js +0 -116
- package/dist/esm/src/migration/to/v3.39.0.js +0 -45
- package/dist/esm/src/mocks.js +0 -58
- package/dist/esm/src/models/project-schema.js +0 -92
- package/dist/esm/src/models/shape.js +0 -85
- package/dist/esm/src/project-schema/index.js +0 -138
- package/dist/esm/src/project-schema/migrate.js +0 -194
- package/dist/esm/src/refs.js +0 -608
- package/dist/esm/src/relationships.js +0 -311
- package/dist/esm/src/runtime-schema.js +0 -80
- package/dist/esm/src/schema-transform.js +0 -74
- package/dist/esm/src/schema-util.js +0 -1077
- package/dist/esm/src/schemas/auth-schemas.json +0 -313
- package/dist/esm/src/schemas/index.js +0 -154
- package/dist/esm/src/schemas/project-schema/experimental.json +0 -1101
- package/dist/esm/src/schemas/project-schema/latest.json +0 -3320
- package/dist/esm/src/schemas/project-schema/meta-schema-v1.0.0.json +0 -193
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.0.0.json +0 -608
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.1.0.json +0 -608
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.2.0.json +0 -612
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.3.0.json +0 -612
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.4.0.json +0 -637
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.5.0.json +0 -626
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.5.1.json +0 -626
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.6.0.json +0 -629
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.7.0.json +0 -1137
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.8.0.json +0 -1137
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.9.0.json +0 -1477
- package/dist/esm/src/schemas/project-schema/v1.0.0.json +0 -321
- package/dist/esm/src/schemas/project-schema/v3.0.0.json +0 -414
- package/dist/esm/src/schemas/project-schema/v3.1.0.json +0 -572
- package/dist/esm/src/schemas/project-schema/v3.10.0.json +0 -2097
- package/dist/esm/src/schemas/project-schema/v3.11.0.json +0 -2141
- package/dist/esm/src/schemas/project-schema/v3.12.0.json +0 -2144
- package/dist/esm/src/schemas/project-schema/v3.12.1.json +0 -2282
- package/dist/esm/src/schemas/project-schema/v3.12.2.json +0 -2304
- package/dist/esm/src/schemas/project-schema/v3.12.3.json +0 -2357
- package/dist/esm/src/schemas/project-schema/v3.13.0.json +0 -2377
- package/dist/esm/src/schemas/project-schema/v3.14.0.json +0 -2385
- package/dist/esm/src/schemas/project-schema/v3.15.0.json +0 -2365
- package/dist/esm/src/schemas/project-schema/v3.16.0.json +0 -2373
- package/dist/esm/src/schemas/project-schema/v3.17.0.json +0 -2378
- package/dist/esm/src/schemas/project-schema/v3.17.1.json +0 -2380
- package/dist/esm/src/schemas/project-schema/v3.18.0.json +0 -2356
- package/dist/esm/src/schemas/project-schema/v3.18.1.json +0 -2357
- package/dist/esm/src/schemas/project-schema/v3.18.2.json +0 -2357
- package/dist/esm/src/schemas/project-schema/v3.19.0.json +0 -2369
- package/dist/esm/src/schemas/project-schema/v3.2.0.json +0 -580
- package/dist/esm/src/schemas/project-schema/v3.20.0.json +0 -2369
- package/dist/esm/src/schemas/project-schema/v3.21.0.json +0 -2376
- package/dist/esm/src/schemas/project-schema/v3.22.0.json +0 -2381
- package/dist/esm/src/schemas/project-schema/v3.23.0.json +0 -2456
- package/dist/esm/src/schemas/project-schema/v3.24.0.json +0 -2556
- package/dist/esm/src/schemas/project-schema/v3.25.0.json +0 -2552
- package/dist/esm/src/schemas/project-schema/v3.26.0.json +0 -2599
- package/dist/esm/src/schemas/project-schema/v3.27.0.json +0 -2611
- package/dist/esm/src/schemas/project-schema/v3.28.0.json +0 -2656
- package/dist/esm/src/schemas/project-schema/v3.29.0.json +0 -2670
- package/dist/esm/src/schemas/project-schema/v3.3.0.json +0 -581
- package/dist/esm/src/schemas/project-schema/v3.30.0.json +0 -2656
- package/dist/esm/src/schemas/project-schema/v3.31.0.json +0 -2714
- package/dist/esm/src/schemas/project-schema/v3.32.0.json +0 -2708
- package/dist/esm/src/schemas/project-schema/v3.33.0.json +0 -2715
- package/dist/esm/src/schemas/project-schema/v3.34.0.json +0 -2715
- package/dist/esm/src/schemas/project-schema/v3.35.0.json +0 -2748
- package/dist/esm/src/schemas/project-schema/v3.36.0.json +0 -2756
- package/dist/esm/src/schemas/project-schema/v3.37.0.json +0 -2821
- package/dist/esm/src/schemas/project-schema/v3.38.0.json +0 -2819
- package/dist/esm/src/schemas/project-schema/v3.39.0.json +0 -2827
- package/dist/esm/src/schemas/project-schema/v3.4.0.json +0 -571
- package/dist/esm/src/schemas/project-schema/v3.40.0.json +0 -2830
- package/dist/esm/src/schemas/project-schema/v3.41.0.json +0 -2830
- package/dist/esm/src/schemas/project-schema/v3.42.0.json +0 -2835
- package/dist/esm/src/schemas/project-schema/v3.43.0.json +0 -2841
- package/dist/esm/src/schemas/project-schema/v3.44.0.json +0 -3013
- package/dist/esm/src/schemas/project-schema/v3.45.0.json +0 -3064
- package/dist/esm/src/schemas/project-schema/v3.46.0.json +0 -3136
- package/dist/esm/src/schemas/project-schema/v3.47.0.json +0 -3189
- package/dist/esm/src/schemas/project-schema/v3.48.0.json +0 -3196
- package/dist/esm/src/schemas/project-schema/v3.49.0.json +0 -3239
- package/dist/esm/src/schemas/project-schema/v3.5.0.json +0 -571
- package/dist/esm/src/schemas/project-schema/v3.5.1.json +0 -571
- package/dist/esm/src/schemas/project-schema/v3.50.0.json +0 -3320
- package/dist/esm/src/schemas/project-schema/v3.51.0.json +0 -3320
- package/dist/esm/src/schemas/project-schema/v3.6.0.json +0 -587
- package/dist/esm/src/schemas/project-schema/v3.7.0.json +0 -587
- package/dist/esm/src/schemas/project-schema/v3.8.0.json +0 -604
- package/dist/esm/src/schemas/project-schema/v3.9.0.json +0 -604
- package/dist/esm/src/schemas/project-schema/v4.0.0.json +0 -2316
- package/dist/esm/src/schemas/project-schema.json +0 -190
- package/dist/esm/src/schemas/user-schema.json +0 -51
- package/dist/esm/src/service-dependencies.js +0 -165
- package/dist/esm/src/services/services.js +0 -145
- package/dist/esm/src/taxonomies.js +0 -24
- package/dist/esm/src/template-shapes/templates.js +0 -319
- package/dist/esm/src/template-shapes/where.js +0 -402
- package/dist/esm/src/types/index.js +0 -3
- package/dist/esm/src/types/utils.js +0 -279
- package/dist/esm/src/unions.js +0 -77
- package/dist/esm/src/user-schema.js +0 -7
- package/dist/esm/src/util/api-indexing.js +0 -57
- package/dist/esm/src/util/detect-cycles.js +0 -45
- package/dist/esm/src/util/form-config.js +0 -62
- package/dist/esm/src/util/get-conflicting-properties.js +0 -55
- package/dist/esm/src/util/get-return-shape.js +0 -30
- package/dist/esm/src/util/has-arg.js +0 -13
- package/dist/esm/src/util/merge.js +0 -256
- package/dist/esm/src/validate.js +0 -1126
- package/dist/esm/src/versions.js +0 -4
- package/dist/esm/src/workflows.js +0 -66
- package/dist/esm/tsconfig.esm.tsbuildinfo +0 -1
- package/dist/types/src/agents.d.ts +0 -14
- package/dist/types/src/auth-schemas.d.ts +0 -104
- package/dist/types/src/builtin-schema.d.ts +0 -8
- package/dist/types/src/content-schema-transform.d.ts +0 -35
- package/dist/types/src/create-input-schema.d.ts +0 -9
- package/dist/types/src/enum.d.ts +0 -2
- package/dist/types/src/flatten-templates.d.ts +0 -2
- package/dist/types/src/get-is-leaf.d.ts +0 -3
- package/dist/types/src/index.d.ts +0 -48
- package/dist/types/src/interfaces.d.ts +0 -12
- package/dist/types/src/layers/layers.d.ts +0 -26
- package/dist/types/src/layers/refs.d.ts +0 -102
- package/dist/types/src/layers/type-utils.d.ts +0 -59
- package/dist/types/src/layers/visitor.d.ts +0 -5
- package/dist/types/src/migration/index.d.ts +0 -64
- package/dist/types/src/migration/to/v3.0.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.1.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.10.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.11.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.12.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.12.1.d.ts +0 -4
- package/dist/types/src/migration/to/v3.12.2.d.ts +0 -4
- package/dist/types/src/migration/to/v3.12.3.d.ts +0 -4
- package/dist/types/src/migration/to/v3.13.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.14.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.15.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.16.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.17.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.17.1.d.ts +0 -4
- package/dist/types/src/migration/to/v3.18.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.18.1.d.ts +0 -4
- package/dist/types/src/migration/to/v3.18.2.d.ts +0 -4
- package/dist/types/src/migration/to/v3.19.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.2.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.20.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.21.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.22.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.23.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.24.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.25.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.26.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.27.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.28.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.29.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.3.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.30.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.31.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.32.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.33.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.34.0.d.ts +0 -6
- package/dist/types/src/migration/to/v3.35.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.36.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.37.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.38.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.39.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.4.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.40.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.41.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.42.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.43.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.44.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.45.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.46.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.47.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.48.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.49.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.5.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.5.1.d.ts +0 -4
- package/dist/types/src/migration/to/v3.50.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.51.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.6.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.7.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.8.0.d.ts +0 -4
- package/dist/types/src/migration/to/v3.9.0.d.ts +0 -4
- package/dist/types/src/migration/types.d.ts +0 -19
- package/dist/types/src/mocks.d.ts +0 -13
- package/dist/types/src/models/project-schema.d.ts +0 -35
- package/dist/types/src/models/query.d.ts +0 -17
- package/dist/types/src/models/service.d.ts +0 -12
- package/dist/types/src/models/shape.d.ts +0 -41
- package/dist/types/src/project-schema/index.d.ts +0 -187
- package/dist/types/src/project-schema/latest.d.ts +0 -2221
- package/dist/types/src/project-schema/migrate.d.ts +0 -4
- package/dist/types/src/project-schema/v3.48.0.d.ts +0 -2160
- package/dist/types/src/project-schema/v3.49.0.d.ts +0 -2169
- package/dist/types/src/project-schema/v3.50.0.d.ts +0 -2221
- package/dist/types/src/project-schema/v3.51.0.d.ts +0 -2221
- package/dist/types/src/refs.d.ts +0 -226
- package/dist/types/src/relationships.d.ts +0 -40
- package/dist/types/src/runtime-schema.d.ts +0 -5
- package/dist/types/src/schema-transform.d.ts +0 -19
- package/dist/types/src/schema-util.d.ts +0 -210
- package/dist/types/src/service-dependencies.d.ts +0 -13
- package/dist/types/src/services/services.d.ts +0 -31
- package/dist/types/src/services/util.d.ts +0 -16
- package/dist/types/src/taxonomies.d.ts +0 -15
- package/dist/types/src/template-shapes/index.d.ts +0 -7
- package/dist/types/src/template-shapes/names.d.ts +0 -10
- package/dist/types/src/template-shapes/templates.d.ts +0 -32
- package/dist/types/src/template-shapes/types.d.ts +0 -15
- package/dist/types/src/template-shapes/where.d.ts +0 -37
- package/dist/types/src/types/index.d.ts +0 -3
- package/dist/types/src/types/transforms.d.ts +0 -13
- package/dist/types/src/types/types.d.ts +0 -211
- package/dist/types/src/types/utils.d.ts +0 -117
- package/dist/types/src/unions.d.ts +0 -14
- package/dist/types/src/user-schema.d.ts +0 -38
- package/dist/types/src/util/ai-tools.d.ts +0 -3
- package/dist/types/src/util/api-indexing.d.ts +0 -9
- package/dist/types/src/util/detect-cycles.d.ts +0 -7
- package/dist/types/src/util/find-shape-at-path.d.ts +0 -21
- package/dist/types/src/util/form-config.d.ts +0 -11
- package/dist/types/src/util/get-conflicting-properties.d.ts +0 -6
- package/dist/types/src/util/get-return-shape.d.ts +0 -4
- package/dist/types/src/util/has-arg.d.ts +0 -4
- package/dist/types/src/util/merge.d.ts +0 -15
- package/dist/types/src/util/patch-schema.d.ts +0 -8
- package/dist/types/src/util/shapes.d.ts +0 -5
- package/dist/types/src/validate.d.ts +0 -75
- package/dist/types/src/versions.d.ts +0 -4
- package/dist/types/src/workflows.d.ts +0 -14
- package/dist/types/tsconfig.types.tsbuildinfo +0 -1
- /package/dist/{esm/src/migration/types.js → __tests__/_examples.test.d.ts} +0 -0
- /package/dist/{esm/src/patterns.js → __tests__/agents.test.d.ts} +0 -0
- /package/dist/{esm/src/services/types.js → __tests__/api-version.test.d.ts} +0 -0
- /package/dist/{esm/src/types/transforms.js → __tests__/builtin-schema.test.d.ts} +0 -0
- /package/dist/{esm/src/agents.js → agents.js} +0 -0
- /package/dist/{types/src/api-version.d.ts → api-version.d.ts} +0 -0
- /package/dist/{esm/src/api-version.js → api-version.js} +0 -0
- /package/dist/{esm/src/auth-schemas.js → auth-schemas.js} +0 -0
- /package/dist/{esm/src/builtin-schema.js → builtin-schema.js} +0 -0
- /package/dist/{types/src/constants.d.ts → constants.d.ts} +0 -0
- /package/dist/{esm/src/constants.js → constants.js} +0 -0
- /package/dist/{esm/src/create-input-schema.js → create-input-schema.js} +0 -0
- /package/dist/{esm/src/enum.js → enum.js} +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.10.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.11.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.12.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.12.1.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.12.2.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.12.3.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.13.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.14.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.15.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.16.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.17.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.17.1.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.18.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.18.1.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.18.2.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.19.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.2.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.20.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.21.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.22.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.23.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.24.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.25.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.26.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.27.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.28.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.29.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.3.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.30.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.31.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.33.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.35.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.36.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.37.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.38.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.4.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.40.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.41.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.42.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.43.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.44.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.45.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.46.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.47.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.48.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.49.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.5.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.5.1.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.50.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.51.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.6.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.7.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.8.0.js +0 -0
- /package/dist/{esm/src/migration → migration}/to/v3.9.0.js +0 -0
- /package/dist/{types/src/migration → migration}/utils.d.ts +0 -0
- /package/dist/{esm/src/migration → migration}/utils.js +0 -0
- /package/dist/{esm/src/models → models}/query.js +0 -0
- /package/dist/{esm/src/models → models}/service.js +0 -0
- /package/dist/{types/src/patterns.d.ts → patterns.d.ts} +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/latest.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v1.0.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v1.0.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.0.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.0.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.1.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.1.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.10.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.10.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.11.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.11.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.12.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.12.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.12.1.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.12.1.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.12.2.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.12.2.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.12.3.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.12.3.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.13.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.13.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.13.1.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.13.1.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.14.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.14.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.15.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.15.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.16.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.16.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.17.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.17.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.17.1.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.17.1.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.18.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.18.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.18.1.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.18.1.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.18.2.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.18.2.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.19.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.19.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.2.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.2.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.20.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.20.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.21.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.21.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.22.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.22.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.23.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.23.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.24.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.24.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.25.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.25.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.26.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.26.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.27.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.27.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.28.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.28.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.29.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.29.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.3.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.3.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.30.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.30.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.31.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.31.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.32.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.32.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.33.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.33.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.34.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.34.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.35.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.35.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.36.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.36.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.37.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.37.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.38.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.38.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.39.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.39.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.4.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.4.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.40.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.40.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.41.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.41.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.42.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.42.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.43.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.43.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.44.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.44.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.45.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.45.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.46.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.46.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.47.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.47.0.js +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.48.0.js +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.49.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.5.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.5.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.5.1.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.5.1.js +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.50.0.js +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.51.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.6.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.6.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.7.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.7.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.8.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.8.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v3.9.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v3.9.0.js +0 -0
- /package/dist/{types/src/project-schema → project-schema}/v4.0.0.d.ts +0 -0
- /package/dist/{esm/src/project-schema → project-schema}/v4.0.0.js +0 -0
- /package/dist/{types/src/scalars.d.ts → scalars.d.ts} +0 -0
- /package/dist/{esm/src/scalars.js → scalars.js} +0 -0
- /package/dist/{types/src/schemas → schemas}/index.d.ts +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/latest.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v1.0.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.0.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.1.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.2.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.3.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.4.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.5.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.5.1.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.6.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.7.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.8.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.9.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v1.0.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.0.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.1.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.10.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.11.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.12.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.12.1.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.12.2.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.12.3.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.13.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.14.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.15.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.16.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.17.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.17.1.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.18.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.18.1.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.18.2.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.19.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.2.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.20.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.21.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.22.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.23.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.24.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.25.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.26.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.27.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.28.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.29.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.3.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.30.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.31.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.32.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.33.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.34.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.35.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.36.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.37.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.38.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.39.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.4.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.40.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.41.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.42.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.43.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.44.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.45.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.46.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.47.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.48.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.49.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.5.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.5.1.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.50.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.51.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.6.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.7.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.8.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.9.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema/v4.0.0.json +0 -0
- /package/dist/{cjs/src/schemas → schemas}/project-schema.json +0 -0
- /package/dist/{types/src/services → services}/types.d.ts +0 -0
- /package/dist/{esm/src/services → services}/util.js +0 -0
- /package/dist/{esm/src/template-shapes → template-shapes}/index.js +0 -0
- /package/dist/{esm/src/template-shapes → template-shapes}/names.js +0 -0
- /package/dist/{esm/src/template-shapes → template-shapes}/types.js +0 -0
- /package/dist/{esm/src/types → types}/types.js +0 -0
- /package/dist/{esm/src/util → util}/ai-tools.js +0 -0
- /package/dist/{esm/src/util → util}/find-shape-at-path.js +0 -0
- /package/dist/{esm/src/util → util}/patch-schema.js +0 -0
- /package/dist/{esm/src/util → util}/shapes.js +0 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export * from "./content-schema-transform.js";
|
|
2
|
+
export * from "./get-is-leaf.js";
|
|
3
|
+
export * from "./project-schema/index.js";
|
|
4
|
+
export * from "./project-schema/migrate.js";
|
|
5
|
+
export * from "./schema-util.js";
|
|
6
|
+
export * from "./template-shapes/index.js";
|
|
7
|
+
export * from "./taxonomies.js";
|
|
8
|
+
export * from "./workflows.js";
|
|
9
|
+
export * from "./api-version.js";
|
|
10
|
+
export * from "./migration/index.js";
|
|
11
|
+
export * from "./validate/validate.js";
|
|
12
|
+
export * from "./validate/errors.js";
|
|
13
|
+
export * from "./builtin-schema.js";
|
|
14
|
+
export * from "./versions.js";
|
|
15
|
+
export * from "./mocks.js";
|
|
16
|
+
export * from "./scalars.js";
|
|
17
|
+
export * from "./refs.js";
|
|
18
|
+
export * from "./unions.js";
|
|
19
|
+
export * from "./enum.js";
|
|
20
|
+
export * from "./patterns.js";
|
|
21
|
+
export * from "./types/transforms.js";
|
|
22
|
+
export * from "./types/types.js";
|
|
23
|
+
export * from "./types/utils.js";
|
|
24
|
+
export * from "./flatten-templates.js";
|
|
25
|
+
export * from "./relationships.js";
|
|
26
|
+
export * from "./create-input-schema.js";
|
|
27
|
+
export * from "./schema-transform.js";
|
|
28
|
+
export * from "./interfaces.js";
|
|
29
|
+
export * from "./agents.js";
|
|
30
|
+
export * from "./services/services.js";
|
|
31
|
+
export * from "./services/util.js";
|
|
32
|
+
export * from "./services/types.js";
|
|
33
|
+
export * from "./util/api-indexing.js";
|
|
34
|
+
export * from "./util/form-config.js";
|
|
35
|
+
export * from "./util/ai-tools.js";
|
|
36
|
+
export * from "./util/detect-cycles.js";
|
|
37
|
+
export * from "./util/find-shape-at-path.js";
|
|
38
|
+
export * from "./util/get-conflicting-properties.js";
|
|
39
|
+
export * from "./util/get-return-shape.js";
|
|
40
|
+
export * from "./util/has-arg.js";
|
|
41
|
+
export * from "./util/merge.js";
|
|
42
|
+
export * from "./util/patch-schema.js";
|
|
43
|
+
export * from "./util/shapes.js";
|
|
44
|
+
export * from "./constants.js";
|
|
45
|
+
export * from "./runtime-schema.js";
|
|
46
|
+
export * from "./service-dependencies.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { OneOfSchema, ProjectSchemaJSON, PropertySchema, ShapeJSON, ShapeMap } from './project-schema/index.ts';
|
|
2
|
+
import type { RefItem, ServicesShapesContext } from './refs.ts';
|
|
3
|
+
export declare function isInterfaceShape(shape?: ShapeJSON): boolean;
|
|
4
|
+
export type ImplementationShapeMap = Record<string, Set<ShapeJSON>>;
|
|
5
|
+
export type ImplementationShapeNameMap = Record<string, Set<string>>;
|
|
6
|
+
export declare function isInterfaceRef(context: ServicesShapesContext, propertySchema: PropertySchema): boolean;
|
|
7
|
+
export declare function getImplementationShapeMap(shapeMap: ShapeMap): ImplementationShapeMap;
|
|
8
|
+
export declare function getImplementationShapeNameMap(shapeMap: ShapeMap): ImplementationShapeNameMap;
|
|
9
|
+
export declare function pruneUnusedInterfaces(projectSchema: ProjectSchemaJSON, shapeMap: ShapeMap): ShapeMap;
|
|
10
|
+
export declare function getImplementingShapes(context: Pick<ProjectSchemaJSON, 'services' | 'shapes'>, interfaceRef: RefItem): ShapeJSON[];
|
|
11
|
+
export declare function interfaceToUnion(context: Pick<ProjectSchemaJSON, 'shapes' | 'services'>, interfaceRef: RefItem): OneOfSchema;
|
|
12
|
+
export declare function getPossibleShapeNames(projectSchema: ProjectSchemaJSON, shape: ShapeJSON): string[];
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { isDefined } from '@takeshape/util';
|
|
2
|
+
import mapValues from 'lodash/mapValues.js';
|
|
3
|
+
import { getRef, normalizeRefExpression, refExpressionToRefItem, refItemToNamespacedShapeName, refItemToShape, shapeToRefItem } from "./refs.js";
|
|
4
|
+
import { isUnionSchema } from "./unions.js";
|
|
5
|
+
export function isInterfaceShape(shape) {
|
|
6
|
+
return shape?.type === 'interface';
|
|
7
|
+
}
|
|
8
|
+
export function isInterfaceRef(context, propertySchema) {
|
|
9
|
+
const ref = getRef(context, propertySchema);
|
|
10
|
+
return Boolean(ref && isInterfaceShape(refItemToShape(context, ref)));
|
|
11
|
+
}
|
|
12
|
+
function add(record, key, value) {
|
|
13
|
+
if (!record[key]) {
|
|
14
|
+
record[key] = new Set([value]);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
record[key].add(value);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function getImplementationsHelper(shapeMap, mapFn) {
|
|
21
|
+
const result = {};
|
|
22
|
+
for (const shape of Object.values(shapeMap)) {
|
|
23
|
+
for (const interfaceName of shape.interfaces ?? []) {
|
|
24
|
+
add(result, interfaceName, mapFn(shape));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
export function getImplementationShapeMap(shapeMap) {
|
|
30
|
+
return getImplementationsHelper(shapeMap, (x) => x);
|
|
31
|
+
}
|
|
32
|
+
export function getImplementationShapeNameMap(shapeMap) {
|
|
33
|
+
return getImplementationsHelper(shapeMap, (shape) => shape.name);
|
|
34
|
+
}
|
|
35
|
+
export function pruneUnusedInterfaces(projectSchema, shapeMap) {
|
|
36
|
+
return mapValues(shapeMap, (shape) => {
|
|
37
|
+
const { interfaces } = shape;
|
|
38
|
+
if (interfaces?.length) {
|
|
39
|
+
const filteredInterfaces = interfaces.filter((refExpression) => shapeMap[refItemToNamespacedShapeName(refExpressionToRefItem(projectSchema, refExpression))]);
|
|
40
|
+
if (interfaces.length !== filteredInterfaces.length) {
|
|
41
|
+
return { ...shape, interfaces: filteredInterfaces };
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return shape;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function compareRefItems(refItem1, refItem2) {
|
|
48
|
+
return refItem1.typeName === refItem2.typeName && refItem1.serviceKey === refItem2.serviceKey;
|
|
49
|
+
}
|
|
50
|
+
export function getImplementingShapes(context, interfaceRef) {
|
|
51
|
+
const shapeMap = context.shapes;
|
|
52
|
+
const implementingShapes = [];
|
|
53
|
+
for (const shape of Object.values(shapeMap)) {
|
|
54
|
+
if (shape.interfaces?.find((interfaceRefExpression) => compareRefItems(refExpressionToRefItem(context, interfaceRefExpression), interfaceRef))) {
|
|
55
|
+
implementingShapes.push(shape);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return implementingShapes;
|
|
59
|
+
}
|
|
60
|
+
export function interfaceToUnion(context, interfaceRef) {
|
|
61
|
+
const shapes = getImplementingShapes(context, interfaceRef);
|
|
62
|
+
return {
|
|
63
|
+
oneOf: shapes.map((shape) => ({
|
|
64
|
+
'@ref': normalizeRefExpression(context, shape.name)
|
|
65
|
+
}))
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export function getPossibleShapeNames(projectSchema, shape) {
|
|
69
|
+
let names;
|
|
70
|
+
if (isInterfaceShape(shape)) {
|
|
71
|
+
names = getImplementingShapes(projectSchema, shapeToRefItem(projectSchema, shape)).map((shape) => shape.name);
|
|
72
|
+
}
|
|
73
|
+
else if (isUnionSchema(shape.schema)) {
|
|
74
|
+
names = shape.schema.oneOf
|
|
75
|
+
.map((member) => {
|
|
76
|
+
const ref = getRef(projectSchema, member);
|
|
77
|
+
return ref && refItemToNamespacedShapeName(ref);
|
|
78
|
+
})
|
|
79
|
+
.filter(isDefined);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
names = [shape.name];
|
|
83
|
+
}
|
|
84
|
+
return names;
|
|
85
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { expect, test } from 'vitest';
|
|
4
|
+
import { flattenSchema } from "../layers.js";
|
|
5
|
+
function loadFile(fileName) {
|
|
6
|
+
return JSON.parse(fs.readFileSync(fileName, 'utf8'));
|
|
7
|
+
}
|
|
8
|
+
function getPath(...filePath) {
|
|
9
|
+
return path.join(__dirname, '..', '..', '..', 'examples', 'v4_0_0', ...filePath);
|
|
10
|
+
}
|
|
11
|
+
const layerCache = new Map();
|
|
12
|
+
const getLayer = (exampleName) => (layerId) => {
|
|
13
|
+
const layerPath = getPath(exampleName, 'layers', `${layerId}.json`);
|
|
14
|
+
let layer = layerCache.get(layerPath);
|
|
15
|
+
if (!layer) {
|
|
16
|
+
layer = loadFile(layerPath);
|
|
17
|
+
layerCache.set(layerPath, layer);
|
|
18
|
+
}
|
|
19
|
+
return layer;
|
|
20
|
+
};
|
|
21
|
+
function getSchema(exampleName) {
|
|
22
|
+
return loadFile(getPath(exampleName, 'schema.json'));
|
|
23
|
+
}
|
|
24
|
+
function getFlattenedSchema(exampleName) {
|
|
25
|
+
return loadFile(getPath(exampleName, 'flattened-schema.json'));
|
|
26
|
+
}
|
|
27
|
+
test.skip('flattenSchema - rick-and-morty-notes', () => {
|
|
28
|
+
const exampleName = 'rick-and-morty-notes';
|
|
29
|
+
const schema = getSchema(exampleName);
|
|
30
|
+
const flattened = flattenSchema(schema, getLayer(exampleName));
|
|
31
|
+
expect(flattened).toEqual(getFlattenedSchema(exampleName));
|
|
32
|
+
});
|
|
33
|
+
test.skip('flattenSchema - shopify-lookbook', () => {
|
|
34
|
+
const exampleName = 'shopify-lookbook';
|
|
35
|
+
const schema = getSchema(exampleName);
|
|
36
|
+
const flattened = flattenSchema(schema, getLayer(exampleName));
|
|
37
|
+
expect(flattened).toEqual(getFlattenedSchema(exampleName));
|
|
38
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FlattenedSchemaV4_0_0, LayerSchemaV4_0_0, ObjectSchemaV4_0_0, ProjectSchemaJSONV4_0_0, PropertySchemaV4_0_0, QueryJSONV4_0_0, ShapeMapV4_0_0 } from '../project-schema/index.ts';
|
|
2
|
+
import { type RefItemWithPath } from './refs.ts';
|
|
3
|
+
export type GetLayer = (layerId: string) => LayerSchemaV4_0_0 | undefined;
|
|
4
|
+
export declare function isObjectSchemaV4_0_0(maybeObjectSchema: PropertySchemaV4_0_0): maybeObjectSchema is ObjectSchemaV4_0_0;
|
|
5
|
+
export type RefPredicate = (ref: RefItemWithPath) => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Walk through a `ProjectSchema` and collect all the `ref`s.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getAllRefsInShapes(shapes: ShapeMapV4_0_0, predicate?: RefPredicate): RefItemWithPath[];
|
|
10
|
+
/**
|
|
11
|
+
* Get all refs
|
|
12
|
+
*/
|
|
13
|
+
export declare function getAllRefsInQuery(shapes: ShapeMapV4_0_0, queryPath: string[], query: QueryJSONV4_0_0, predicate?: (ref: RefItemWithPath) => boolean): RefItemWithPath[];
|
|
14
|
+
type SchemaContext = Pick<FlattenedSchemaV4_0_0, 'shapes' | 'queries' | 'mutations'>;
|
|
15
|
+
/**
|
|
16
|
+
* Collect refs from `queries` or `mutations`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getAllRefsInQueries(context: SchemaContext, rootPropertyName: 'queries' | 'mutations', predicate?: RefPredicate): RefItemWithPath[];
|
|
19
|
+
/**
|
|
20
|
+
* Get all refs in a ProjectSchema
|
|
21
|
+
* @param predicate return true to include the ref in
|
|
22
|
+
*/
|
|
23
|
+
export declare function getAllRefs(projectSchema: SchemaContext, predicate?: RefPredicate): RefItemWithPath[];
|
|
24
|
+
export declare function collectReferencedShapeNames(layerId: string, refSet: Set<string>): (schema: PropertySchemaV4_0_0) => void;
|
|
25
|
+
export declare function flattenSchema(projectSchema: ProjectSchemaJSONV4_0_0, getLayer: GetLayer): FlattenedSchemaV4_0_0;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { deepClone, isDefined, isRecord } from '@takeshape/util';
|
|
2
|
+
import set from 'lodash/set.js';
|
|
3
|
+
import uniq from 'lodash/uniq.js';
|
|
4
|
+
import minimatch from 'minimatch';
|
|
5
|
+
import { parseTemplateShape } from "../refs.js";
|
|
6
|
+
import { dereferenceSchema, getArgsReferenceWithPath, getRefOrItemsRef, parseReturnShape, refItemToString, splitAtRef } from "./refs.js";
|
|
7
|
+
import { isAllOfSchema, isObjectSchema, isOneOfSchema, isRefSchema } from "./type-utils.js";
|
|
8
|
+
import { visitSchemaProperties } from "./visitor.js";
|
|
9
|
+
const layerDefaults = {
|
|
10
|
+
namespace: '',
|
|
11
|
+
visibility: []
|
|
12
|
+
};
|
|
13
|
+
function filterMap(prefix, fields, filters) {
|
|
14
|
+
const result = {};
|
|
15
|
+
for (const [name, value] of Object.entries(fields)) {
|
|
16
|
+
for (const filter of filters) {
|
|
17
|
+
if (minimatch(`${prefix}.${name}`, filter)) {
|
|
18
|
+
result[name] = value;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
function filterLayer(layerSchema, filters) {
|
|
25
|
+
return {
|
|
26
|
+
...layerSchema,
|
|
27
|
+
queries: filterMap('queries', layerSchema.queries ?? {}, filters),
|
|
28
|
+
mutations: filterMap('mutations', layerSchema.mutations ?? {}, filters),
|
|
29
|
+
shapes: filterMap('shapes', layerSchema.shapes ?? {}, filters),
|
|
30
|
+
workflows: filterMap('workflows', layerSchema.workflows ?? {}, filters)
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
// TODO use non-versioned util eventually
|
|
34
|
+
export function isObjectSchemaV4_0_0(maybeObjectSchema) {
|
|
35
|
+
return maybeObjectSchema.type === 'object' && isRecord(maybeObjectSchema.properties);
|
|
36
|
+
}
|
|
37
|
+
function mergeShape(a, b) {
|
|
38
|
+
if (b.override === 'extend') {
|
|
39
|
+
if (isObjectSchemaV4_0_0(a.schema) && isObjectSchemaV4_0_0(b.schema)) {
|
|
40
|
+
const combinedRequired = uniq((a.schema.required ?? []).concat(b.schema.required ?? []));
|
|
41
|
+
const combinedSchema = {
|
|
42
|
+
type: 'object',
|
|
43
|
+
properties: {
|
|
44
|
+
...a.schema.properties,
|
|
45
|
+
...b.schema.properties
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
if (combinedRequired.length) {
|
|
49
|
+
combinedSchema.required = combinedRequired;
|
|
50
|
+
}
|
|
51
|
+
return { ...a, ...b, schema: combinedSchema };
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return b;
|
|
55
|
+
}
|
|
56
|
+
function assignShapes(flattenedShapes, layerShapes) {
|
|
57
|
+
for (const [shapeName, shape] of Object.entries(layerShapes)) {
|
|
58
|
+
flattenedShapes[shapeName] = flattenedShapes[shapeName] ? mergeShape(flattenedShapes[shapeName], shape) : shape;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function addRef(refs, ref, predicate) {
|
|
62
|
+
if (ref && (!predicate || predicate(ref))) {
|
|
63
|
+
refs.push(ref);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Walk through a `ProjectSchema` and collect all the `ref`s.
|
|
68
|
+
*/
|
|
69
|
+
export function getAllRefsInShapes(shapes, predicate) {
|
|
70
|
+
const items = [];
|
|
71
|
+
const shapeVisitor = (schema, schemaPath) => {
|
|
72
|
+
if (schema['@args'] && typeof schema['@args'] === 'object') {
|
|
73
|
+
visitSchemaProperties(schema['@args'], schemaPath.concat(['@args']), (argSchema, argPath) => {
|
|
74
|
+
addRef(items, getRefOrItemsRef(argSchema, argPath), predicate);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
addRef(items, getArgsReferenceWithPath(schema, schemaPath), predicate);
|
|
78
|
+
const newPath = schema.items ? schemaPath.concat('items') : schemaPath;
|
|
79
|
+
const newSchema = schema.items ?? schema;
|
|
80
|
+
if (isRefSchema(newSchema)) {
|
|
81
|
+
addRef(items, getRefOrItemsRef(newSchema, newPath), predicate);
|
|
82
|
+
}
|
|
83
|
+
else if (isObjectSchema(newSchema) || isAllOfSchema(newSchema) || isOneOfSchema(newSchema)) {
|
|
84
|
+
visitSchemaProperties(newSchema, newPath, shapeVisitor);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
for (const [shapeName, shape] of Object.entries(shapes)) {
|
|
88
|
+
visitSchemaProperties(shape.schema, ['shapes', shapeName, 'schema'], shapeVisitor);
|
|
89
|
+
}
|
|
90
|
+
return items;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Get all refs
|
|
94
|
+
*/
|
|
95
|
+
export function getAllRefsInQuery(shapes, queryPath, query, predicate) {
|
|
96
|
+
const refItems = [];
|
|
97
|
+
const propertyVisitor = (propSchema, propSchemaPath) => {
|
|
98
|
+
addRef(refItems, getRefOrItemsRef(propSchema, propSchemaPath), predicate);
|
|
99
|
+
};
|
|
100
|
+
if (query.args && typeof query.args === 'string') {
|
|
101
|
+
addRef(refItems, getArgsReferenceWithPath(query, queryPath), predicate);
|
|
102
|
+
}
|
|
103
|
+
if (query.args && typeof query.args === 'object') {
|
|
104
|
+
visitSchemaProperties(dereferenceSchema(shapes, query.args), queryPath, propertyVisitor);
|
|
105
|
+
}
|
|
106
|
+
if (query.shape) {
|
|
107
|
+
const refItem = parseReturnShape(query.shape).ref;
|
|
108
|
+
if (refItem) {
|
|
109
|
+
addRef(refItems, {
|
|
110
|
+
...refItem,
|
|
111
|
+
path: queryPath.concat(['shape'])
|
|
112
|
+
}, predicate);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return refItems;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Collect refs from `queries` or `mutations`.
|
|
119
|
+
*/
|
|
120
|
+
export function getAllRefsInQueries(context, rootPropertyName, predicate) {
|
|
121
|
+
const refItems = [];
|
|
122
|
+
const rootPath = [rootPropertyName];
|
|
123
|
+
for (const [queryName, query] of Object.entries(context[rootPropertyName])) {
|
|
124
|
+
const queryPath = rootPath.concat([queryName]);
|
|
125
|
+
const queryRefs = getAllRefsInQuery(context.shapes, queryPath, query, predicate);
|
|
126
|
+
if (queryRefs.length) {
|
|
127
|
+
refItems.push(...queryRefs);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return refItems;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Get all refs in a ProjectSchema
|
|
134
|
+
* @param predicate return true to include the ref in
|
|
135
|
+
*/
|
|
136
|
+
export function getAllRefs(projectSchema, predicate) {
|
|
137
|
+
return [
|
|
138
|
+
...getAllRefsInShapes(projectSchema.shapes, predicate),
|
|
139
|
+
...getAllRefsInQueries(projectSchema, 'queries', predicate),
|
|
140
|
+
...getAllRefsInQueries(projectSchema, 'mutations', predicate)
|
|
141
|
+
];
|
|
142
|
+
}
|
|
143
|
+
export function collectReferencedShapeNames(layerId, refSet) {
|
|
144
|
+
const addLayerId = (ref) => ({ ...ref, layerId });
|
|
145
|
+
const collect = (schema) => {
|
|
146
|
+
const args = schema['@args'];
|
|
147
|
+
if (args && typeof args === 'object') {
|
|
148
|
+
Object.values(args.properties).forEach(collect);
|
|
149
|
+
}
|
|
150
|
+
const argsRefItem = getArgsReferenceWithPath(schema);
|
|
151
|
+
if (argsRefItem) {
|
|
152
|
+
refSet.add(refItemToString(addLayerId(argsRefItem)));
|
|
153
|
+
}
|
|
154
|
+
const refItem = getRefOrItemsRef(schema);
|
|
155
|
+
if (refItem) {
|
|
156
|
+
refSet.add(refItemToString(addLayerId(refItem)));
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
return collect;
|
|
160
|
+
}
|
|
161
|
+
function collectServiceRefs(flattenedSchema, getLayer) {
|
|
162
|
+
const refs = new Set(getAllRefs(flattenedSchema, (refItem) => refItem.layerId !== 'local').map(refItemToString));
|
|
163
|
+
if (refs.size) {
|
|
164
|
+
for (const ref of refs) {
|
|
165
|
+
const [layerId, shapeName] = splitAtRef(ref);
|
|
166
|
+
if (layerId !== 'local') {
|
|
167
|
+
const layer = getLayer(layerId);
|
|
168
|
+
const shape = layer?.shapes?.[shapeName];
|
|
169
|
+
if (shape) {
|
|
170
|
+
visitSchemaProperties(shape.schema, ['schema'], collectReferencedShapeNames(layerId, refs));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return refs;
|
|
176
|
+
}
|
|
177
|
+
function ensureServiceLayer(flattenedSchema, layerId) {
|
|
178
|
+
flattenedSchema.serviceLayers ||= {};
|
|
179
|
+
let serviceLayer = flattenedSchema.serviceLayers[layerId];
|
|
180
|
+
if (!serviceLayer) {
|
|
181
|
+
serviceLayer = {
|
|
182
|
+
layerId,
|
|
183
|
+
schemaVersion: '4.0.0',
|
|
184
|
+
shapes: {},
|
|
185
|
+
queries: {},
|
|
186
|
+
mutations: {}
|
|
187
|
+
};
|
|
188
|
+
flattenedSchema.serviceLayers[layerId] = serviceLayer;
|
|
189
|
+
}
|
|
190
|
+
return serviceLayer;
|
|
191
|
+
}
|
|
192
|
+
function rewriteLayerId(localShapes, layerId, query) {
|
|
193
|
+
const newQuery = deepClone(query);
|
|
194
|
+
const propertyVisitor = (propSchema, propSchemaPath) => {
|
|
195
|
+
const ref = (propSchema.items ?? propSchema)['@ref'];
|
|
196
|
+
if (ref) {
|
|
197
|
+
const [argsLayerId, shapeName] = splitAtRef(ref);
|
|
198
|
+
if (argsLayerId === 'local' && !localShapes[shapeName]) {
|
|
199
|
+
const path = propSchemaPath.concat(propSchema.items ? ['items', '@ref'] : ['@ref']);
|
|
200
|
+
set(newQuery, path, `${layerId}:${shapeName}`);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
if (query.args) {
|
|
205
|
+
if (typeof query.args === 'string') {
|
|
206
|
+
const [argsLayerId, shapeName] = splitAtRef(parseTemplateShape(query.args).shapeName);
|
|
207
|
+
if (argsLayerId === 'local' && !localShapes[shapeName]) {
|
|
208
|
+
newQuery.args = `${layerId}:${shapeName}`;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
visitSchemaProperties(query.args, ['args'], propertyVisitor);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
if (typeof query.shape === 'string') {
|
|
216
|
+
const [argsLayerId, shapeName] = splitAtRef(parseTemplateShape(query.shape).shapeName);
|
|
217
|
+
if (argsLayerId === 'local' && !localShapes[shapeName]) {
|
|
218
|
+
newQuery.shape = `${layerId}:${shapeName}`;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
const ref = query.shape.items['@ref'];
|
|
223
|
+
if (ref) {
|
|
224
|
+
const [argsLayerId, shapeName] = splitAtRef(ref);
|
|
225
|
+
if (argsLayerId === 'local' && !localShapes[shapeName]) {
|
|
226
|
+
set(newQuery, ['shape', 'items', '@ref'], `${layerId}:${shapeName}`);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return newQuery;
|
|
231
|
+
}
|
|
232
|
+
function assignQueries(localShapes, queries, layerId, layerQueries) {
|
|
233
|
+
for (const [queryName, query] of Object.entries(layerQueries)) {
|
|
234
|
+
queries[queryName] = rewriteLayerId(localShapes, layerId, query);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
export function flattenSchema(projectSchema, getLayer) {
|
|
238
|
+
const { layers, ...rest } = projectSchema;
|
|
239
|
+
const flattenedSchema = {
|
|
240
|
+
...rest,
|
|
241
|
+
shapes: {},
|
|
242
|
+
queries: {},
|
|
243
|
+
mutations: {},
|
|
244
|
+
workflows: {},
|
|
245
|
+
forms: {}
|
|
246
|
+
};
|
|
247
|
+
const filteredLayers = layers
|
|
248
|
+
.reverse()
|
|
249
|
+
.map((layer) => {
|
|
250
|
+
const config = typeof layer === 'string' ? { ...layerDefaults, id: layer } : layer;
|
|
251
|
+
const layerSchema = getLayer(config.id);
|
|
252
|
+
if (!layerSchema) {
|
|
253
|
+
throw new Error(`Unable to flatten schema for project ${projectSchema.projectId}. Cannot get layer ${config.id}`);
|
|
254
|
+
}
|
|
255
|
+
return config.visibility?.length ? filterLayer(layerSchema, config.visibility) : undefined;
|
|
256
|
+
})
|
|
257
|
+
.filter(isDefined);
|
|
258
|
+
for (const filteredLayer of filteredLayers) {
|
|
259
|
+
const { layerId } = filteredLayer;
|
|
260
|
+
// Preserve original queries
|
|
261
|
+
if (projectSchema.services?.[layerId]) {
|
|
262
|
+
const serviceLayer = ensureServiceLayer(flattenedSchema, layerId);
|
|
263
|
+
if (serviceLayer.queries && filteredLayer.queries) {
|
|
264
|
+
Object.assign(serviceLayer.queries, filteredLayer.queries);
|
|
265
|
+
}
|
|
266
|
+
if (serviceLayer.mutations && filteredLayer.mutations) {
|
|
267
|
+
Object.assign(serviceLayer.mutations, filteredLayer.mutations);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
if (filteredLayer.workflows) {
|
|
271
|
+
Object.assign(flattenedSchema.workflows, filteredLayer.workflows);
|
|
272
|
+
}
|
|
273
|
+
if (flattenedSchema.forms && filteredLayer.forms) {
|
|
274
|
+
Object.assign(flattenedSchema.forms, filteredLayer.forms);
|
|
275
|
+
}
|
|
276
|
+
if (filteredLayer.shapes) {
|
|
277
|
+
assignShapes(flattenedSchema.shapes, filteredLayer.shapes);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
for (const filteredLayer of filteredLayers) {
|
|
281
|
+
if (filteredLayer.queries) {
|
|
282
|
+
assignQueries(flattenedSchema.shapes, flattenedSchema.queries, filteredLayer.layerId, filteredLayer.queries);
|
|
283
|
+
}
|
|
284
|
+
if (filteredLayer.mutations) {
|
|
285
|
+
assignQueries(flattenedSchema.shapes, flattenedSchema.mutations, filteredLayer.layerId, filteredLayer.mutations);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
// Preserve original service schema shapes
|
|
289
|
+
for (const refStr of collectServiceRefs(flattenedSchema, getLayer)) {
|
|
290
|
+
const [layerId, shapeName] = splitAtRef(refStr);
|
|
291
|
+
if (layerId !== 'local') {
|
|
292
|
+
const shape = getLayer(layerId)?.shapes?.[shapeName];
|
|
293
|
+
if (shape) {
|
|
294
|
+
const serviceLayer = ensureServiceLayer(flattenedSchema, layerId);
|
|
295
|
+
serviceLayer.shapes ||= {};
|
|
296
|
+
serviceLayer.shapes[shapeName] = shape;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return flattenedSchema;
|
|
301
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { Maybe } from '@takeshape/util';
|
|
2
|
+
import type { PropertySchemaV4_0_0, QueryJSONV4_0_0, ReturnShapeV4_0_0, ShapeJSONV4_0_0, ShapeMapV4_0_0 } from '../project-schema/index.ts';
|
|
3
|
+
import type { SchemaPath } from '../types/index.ts';
|
|
4
|
+
/**
|
|
5
|
+
* This interface describes a parsed `@ref` or `$ref`.
|
|
6
|
+
* The intended usage is to convert a schema with a ref to a RefItem which can then
|
|
7
|
+
* be passed to the various rich utilities in this file.
|
|
8
|
+
*/
|
|
9
|
+
export type RefItem = {
|
|
10
|
+
typeName: string;
|
|
11
|
+
layerId: string;
|
|
12
|
+
template?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Adds a schema path, needed when visiting a whole schema to report errors.
|
|
16
|
+
*/
|
|
17
|
+
export type RefItemWithPath = {
|
|
18
|
+
path: SchemaPath;
|
|
19
|
+
} & RefItem;
|
|
20
|
+
/**
|
|
21
|
+
* Safely turn a "template" shape reference (`@args`, `args`, `shape`) into a `RefItem`
|
|
22
|
+
*
|
|
23
|
+
* @param context A partial project schema
|
|
24
|
+
* @param refExpression
|
|
25
|
+
* A ref expression might include "template" name and refer to a local or remote
|
|
26
|
+
* shape, `Foo` or `CreateArgs<Foo>` or `CreateArgs<remote:Foo>`.*
|
|
27
|
+
*/
|
|
28
|
+
export declare function refExpressionToRefItem(refExpression: string): RefItem;
|
|
29
|
+
/**
|
|
30
|
+
* Sugar for converting a `refExpression` directly into a shape, without the
|
|
31
|
+
* intermediate `refItem`.
|
|
32
|
+
*
|
|
33
|
+
* @param context A partial project schema
|
|
34
|
+
* @param refExpression
|
|
35
|
+
* A ref expression might include "template" name and refer to a local or remote
|
|
36
|
+
* shape, `Foo` or `CreateArgs<Foo>` or `CreateArgs<remote:Foo>`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function refExpressionToShape(shapes: ShapeMapV4_0_0, refExpression: string): Maybe<ShapeJSONV4_0_0>;
|
|
39
|
+
/**
|
|
40
|
+
* Provided a service name and a referenced type. Supports 2 or 3 part
|
|
41
|
+
* references, e.g., `shopify:my-store:ProductInput` or `my-store:ProductInput`.
|
|
42
|
+
*
|
|
43
|
+
* @returns
|
|
44
|
+
* A 2 member array, where 0 is the service name, 1 is the referenced type.
|
|
45
|
+
*/
|
|
46
|
+
export declare function splitAtRef(atRef: string): [string, string];
|
|
47
|
+
/**
|
|
48
|
+
* Parses and returns a typeName, serviceKey, and potentially a namespace for
|
|
49
|
+
* the type.
|
|
50
|
+
*/
|
|
51
|
+
export declare function atRefToRefItem(atRef: string, template?: string): RefItem;
|
|
52
|
+
/**
|
|
53
|
+
* Given a content schema and project schema, finds a `@ref` or `$ref` and
|
|
54
|
+
* returns a `RefItem` suitable for loading a referenced schema...
|
|
55
|
+
*/
|
|
56
|
+
export declare function getRef(refSchema: PropertySchemaV4_0_0): Maybe<RefItem>;
|
|
57
|
+
export declare function getRefWithPath(refSchema: PropertySchemaV4_0_0, schemaPath?: SchemaPath): Maybe<RefItemWithPath>;
|
|
58
|
+
/**
|
|
59
|
+
* Tests for a `@ref` or `$ref` property directly on the passed schema.
|
|
60
|
+
*
|
|
61
|
+
* @param schema Any schema that might could have a ref property.
|
|
62
|
+
*/
|
|
63
|
+
export declare function hasRefProperty(schema: PropertySchemaV4_0_0): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* From a schema with a ref, will return the top-level ref, and potentially
|
|
66
|
+
* a ref item from a nested `items` property.
|
|
67
|
+
*/
|
|
68
|
+
export declare function getRefOrItemsRef(refSchema: PropertySchemaV4_0_0, schemaPath?: SchemaPath): Maybe<RefItemWithPath>;
|
|
69
|
+
/**
|
|
70
|
+
* Turns a `RefItem` into an `@ref`.
|
|
71
|
+
*/
|
|
72
|
+
export declare function refItemToString(refItem: RefItem): string;
|
|
73
|
+
/**
|
|
74
|
+
* Get a Shape referenced by a `RefItem`.
|
|
75
|
+
*/
|
|
76
|
+
export declare function refItemToShape(shapes: ShapeMapV4_0_0, refItem: RefItem): Maybe<ShapeJSONV4_0_0>;
|
|
77
|
+
/**
|
|
78
|
+
* Helper fn to omit `ref` props from the target schema, and then extend it with the source schema.
|
|
79
|
+
*/
|
|
80
|
+
export declare const omitRefAndExtend: (targetSchema: PropertySchemaV4_0_0, sourceSchema: PropertySchemaV4_0_0) => import("lodash").Omit<PropertySchemaV4_0_0, "@ref" | "$ref"> & PropertySchemaV4_0_0;
|
|
81
|
+
/**
|
|
82
|
+
* If there is a $ref, this will insert a content schema from the top level
|
|
83
|
+
* in place of the reference.
|
|
84
|
+
*/
|
|
85
|
+
export declare function followRef(shapes: ShapeMapV4_0_0, contentSchema: PropertySchemaV4_0_0): PropertySchemaV4_0_0;
|
|
86
|
+
/**
|
|
87
|
+
* Returns whether a schema has refs.
|
|
88
|
+
*/
|
|
89
|
+
export declare function hasRef(contentSchema: PropertySchemaV4_0_0): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Returns whether a schema has refs which can be followed.
|
|
92
|
+
*/
|
|
93
|
+
export declare function hasResolvableRef(shapes: ShapeMapV4_0_0, contentSchema: PropertySchemaV4_0_0): boolean;
|
|
94
|
+
export declare function getArgsReferenceWithPath(argsSchema: PropertySchemaV4_0_0 | QueryJSONV4_0_0, schemaPath?: SchemaPath): Maybe<RefItemWithPath>;
|
|
95
|
+
export declare function dereferenceSchema(shapes: ShapeMapV4_0_0, shapeOrFieldSchema: PropertySchemaV4_0_0, schemaPath?: SchemaPath): PropertySchemaV4_0_0;
|
|
96
|
+
export type ParsedReturnShape = {
|
|
97
|
+
isArray: boolean;
|
|
98
|
+
template?: string;
|
|
99
|
+
shapeName: string;
|
|
100
|
+
ref?: RefItem;
|
|
101
|
+
};
|
|
102
|
+
export declare function parseReturnShape(shape: ReturnShapeV4_0_0): ParsedReturnShape;
|