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