@takeshape/schema 11.45.5 → 11.47.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/src/agents.js +6 -6
- package/dist/cjs/src/api-version.js +1 -1
- package/dist/cjs/src/content-schema-transform.js +12 -12
- package/dist/cjs/src/create-input-schema.js +1 -1
- package/dist/cjs/src/enum.js +1 -1
- package/dist/cjs/src/flatten-templates.js +4 -4
- package/dist/cjs/src/get-is-leaf.js +1 -1
- package/dist/cjs/src/interfaces.js +11 -9
- package/dist/cjs/src/layers/layers.js +11 -5
- package/dist/cjs/src/layers/refs.js +3 -3
- package/dist/cjs/src/layers/type-utils.js +1 -1
- package/dist/cjs/src/migration/index.js +3 -1
- package/dist/cjs/src/migration/to/v3.0.0.js +20 -8
- package/dist/cjs/src/migration/to/v3.1.0.js +6 -4
- package/dist/cjs/src/migration/to/v3.10.0.js +1 -1
- package/dist/cjs/src/migration/to/v3.13.0.js +1 -1
- package/dist/cjs/src/migration/to/v3.17.0.js +1 -1
- package/dist/cjs/src/migration/to/v3.18.0.js +4 -4
- package/dist/cjs/src/migration/to/v3.18.1.js +1 -1
- package/dist/cjs/src/migration/to/v3.18.2.js +1 -1
- package/dist/cjs/src/migration/to/v3.20.0.js +5 -2
- package/dist/cjs/src/migration/to/v3.22.0.js +1 -1
- package/dist/cjs/src/migration/to/v3.31.0.js +2 -2
- package/dist/cjs/src/migration/to/v3.32.0.js +3 -1
- package/dist/cjs/src/migration/to/v3.34.0.js +6 -9
- package/dist/cjs/src/migration/to/v3.36.0.js +1 -1
- package/dist/cjs/src/migration/to/v3.39.0.js +8 -8
- package/dist/cjs/src/migration/to/v3.40.0.js +1 -1
- package/dist/cjs/src/migration/to/v3.46.0.js +1 -1
- package/dist/cjs/src/migration/to/v3.51.0.js +12 -0
- package/dist/cjs/src/migration/to/v3.9.0.js +3 -3
- package/dist/cjs/src/models/project-schema.js +4 -4
- package/dist/cjs/src/models/shape.js +2 -2
- package/dist/cjs/src/project-schema/index.js +4 -2
- package/dist/cjs/src/project-schema/migrate.js +3 -1
- package/dist/cjs/src/project-schema/v3.51.0.js +8 -0
- package/dist/cjs/src/refs.js +28 -18
- package/dist/cjs/src/relationships.js +25 -20
- package/dist/cjs/src/runtime-schema.js +16 -9
- package/dist/cjs/src/schema-transform.js +3 -3
- package/dist/cjs/src/schema-util.js +38 -30
- package/dist/cjs/src/schemas/auth-schemas.json +18 -78
- package/dist/cjs/src/schemas/index.js +7 -5
- package/dist/cjs/src/schemas/project-schema/experimental.json +7 -20
- package/dist/cjs/src/schemas/project-schema/latest.json +166 -566
- package/dist/cjs/src/schemas/project-schema/meta-schema-v1.0.0.json +3 -17
- package/dist/cjs/src/schemas/project-schema/meta-schema-v3.0.0.json +4 -4
- package/dist/cjs/src/schemas/project-schema/meta-schema-v3.1.0.json +4 -4
- package/dist/cjs/src/schemas/project-schema/meta-schema-v3.2.0.json +5 -5
- package/dist/cjs/src/schemas/project-schema/meta-schema-v3.3.0.json +5 -5
- package/dist/cjs/src/schemas/project-schema/meta-schema-v3.4.0.json +11 -43
- package/dist/cjs/src/schemas/project-schema/meta-schema-v3.5.0.json +7 -7
- package/dist/cjs/src/schemas/project-schema/meta-schema-v3.5.1.json +8 -11
- package/dist/cjs/src/schemas/project-schema/meta-schema-v3.6.0.json +8 -11
- package/dist/cjs/src/schemas/project-schema/meta-schema-v3.7.0.json +11 -9
- package/dist/cjs/src/schemas/project-schema/meta-schema-v3.8.0.json +11 -9
- package/dist/cjs/src/schemas/project-schema/meta-schema-v3.9.0.json +24 -22
- package/dist/cjs/src/schemas/project-schema/v1.0.0.json +3 -3
- package/dist/cjs/src/schemas/project-schema/v3.0.0.json +1 -1
- package/dist/cjs/src/schemas/project-schema/v3.1.0.json +2 -2
- package/dist/cjs/src/schemas/project-schema/v3.10.0.json +32 -30
- package/dist/cjs/src/schemas/project-schema/v3.11.0.json +32 -30
- package/dist/cjs/src/schemas/project-schema/v3.12.0.json +33 -36
- package/dist/cjs/src/schemas/project-schema/v3.12.1.json +33 -36
- package/dist/cjs/src/schemas/project-schema/v3.12.2.json +2122 -2125
- package/dist/cjs/src/schemas/project-schema/v3.12.3.json +2175 -2178
- package/dist/cjs/src/schemas/project-schema/v3.13.0.json +32 -30
- package/dist/cjs/src/schemas/project-schema/v3.14.0.json +32 -30
- package/dist/cjs/src/schemas/project-schema/v3.15.0.json +40 -38
- package/dist/cjs/src/schemas/project-schema/v3.16.0.json +40 -38
- package/dist/cjs/src/schemas/project-schema/v3.17.0.json +47 -39
- package/dist/cjs/src/schemas/project-schema/v3.17.1.json +2204 -2196
- package/dist/cjs/src/schemas/project-schema/v3.18.0.json +40 -38
- package/dist/cjs/src/schemas/project-schema/v3.18.1.json +40 -38
- package/dist/cjs/src/schemas/project-schema/v3.18.2.json +40 -38
- package/dist/cjs/src/schemas/project-schema/v3.19.0.json +40 -38
- package/dist/cjs/src/schemas/project-schema/v3.2.0.json +1 -1
- package/dist/cjs/src/schemas/project-schema/v3.20.0.json +40 -38
- package/dist/cjs/src/schemas/project-schema/v3.21.0.json +41 -39
- package/dist/cjs/src/schemas/project-schema/v3.22.0.json +41 -39
- package/dist/cjs/src/schemas/project-schema/v3.23.0.json +43 -43
- package/dist/cjs/src/schemas/project-schema/v3.24.0.json +105 -458
- package/dist/cjs/src/schemas/project-schema/v3.25.0.json +105 -458
- package/dist/cjs/src/schemas/project-schema/v3.26.0.json +107 -466
- package/dist/cjs/src/schemas/project-schema/v3.27.0.json +107 -466
- package/dist/cjs/src/schemas/project-schema/v3.28.0.json +112 -471
- package/dist/cjs/src/schemas/project-schema/v3.29.0.json +112 -471
- package/dist/cjs/src/schemas/project-schema/v3.3.0.json +1 -1
- package/dist/cjs/src/schemas/project-schema/v3.30.0.json +112 -472
- package/dist/cjs/src/schemas/project-schema/v3.31.0.json +112 -486
- package/dist/cjs/src/schemas/project-schema/v3.32.0.json +113 -488
- package/dist/cjs/src/schemas/project-schema/v3.33.0.json +113 -488
- package/dist/cjs/src/schemas/project-schema/v3.34.0.json +113 -488
- package/dist/cjs/src/schemas/project-schema/v3.35.0.json +114 -491
- package/dist/cjs/src/schemas/project-schema/v3.36.0.json +114 -491
- package/dist/cjs/src/schemas/project-schema/v3.37.0.json +118 -511
- package/dist/cjs/src/schemas/project-schema/v3.38.0.json +118 -511
- package/dist/cjs/src/schemas/project-schema/v3.39.0.json +118 -511
- package/dist/cjs/src/schemas/project-schema/v3.4.0.json +1 -1
- package/dist/cjs/src/schemas/project-schema/v3.40.0.json +118 -512
- package/dist/cjs/src/schemas/project-schema/v3.41.0.json +118 -512
- package/dist/cjs/src/schemas/project-schema/v3.42.0.json +118 -512
- package/dist/cjs/src/schemas/project-schema/v3.43.0.json +118 -512
- package/dist/cjs/src/schemas/project-schema/v3.44.0.json +125 -540
- package/dist/cjs/src/schemas/project-schema/v3.45.0.json +128 -554
- package/dist/cjs/src/schemas/project-schema/v3.46.0.json +129 -560
- package/dist/cjs/src/schemas/project-schema/v3.47.0.json +131 -568
- package/dist/cjs/src/schemas/project-schema/v3.48.0.json +132 -572
- package/dist/cjs/src/schemas/project-schema/v3.49.0.json +132 -558
- package/dist/cjs/src/schemas/project-schema/v3.5.0.json +1 -1
- package/dist/cjs/src/schemas/project-schema/v3.5.1.json +1 -1
- package/dist/cjs/src/schemas/project-schema/v3.50.0.json +165 -565
- package/dist/cjs/src/schemas/project-schema/v3.51.0.json +3320 -0
- package/dist/cjs/src/schemas/project-schema/v3.6.0.json +1 -1
- package/dist/cjs/src/schemas/project-schema/v3.7.0.json +1 -1
- package/dist/cjs/src/schemas/project-schema/v3.8.0.json +1 -1
- package/dist/cjs/src/schemas/project-schema/v3.9.0.json +1 -1
- package/dist/cjs/src/schemas/project-schema/v4.0.0.json +31 -29
- package/dist/cjs/src/schemas/project-schema.json +3 -0
- package/dist/cjs/src/schemas/user-schema.json +2 -9
- package/dist/cjs/src/service-dependencies.js +15 -9
- package/dist/cjs/src/services/services.js +12 -11
- package/dist/cjs/src/services/util.js +4 -4
- package/dist/cjs/src/template-shapes/templates.js +18 -12
- package/dist/cjs/src/template-shapes/where.js +23 -14
- package/dist/cjs/src/types/utils.js +3 -3
- package/dist/cjs/src/unions.js +6 -8
- package/dist/cjs/src/util/api-indexing.js +4 -4
- package/dist/cjs/src/util/detect-cycles.js +2 -2
- package/dist/cjs/src/util/find-shape-at-path.js +1 -1
- package/dist/cjs/src/util/form-config.js +0 -1
- package/dist/cjs/src/util/get-conflicting-properties.js +1 -1
- package/dist/cjs/src/util/merge.js +22 -13
- package/dist/cjs/src/util/patch-schema.js +2 -2
- package/dist/cjs/src/util/shapes.js +2 -2
- package/dist/cjs/src/validate.js +64 -47
- package/dist/cjs/src/workflows.js +4 -4
- package/dist/esm/src/agents.js +6 -6
- package/dist/esm/src/api-version.js +1 -1
- package/dist/esm/src/content-schema-transform.js +12 -12
- package/dist/esm/src/create-input-schema.js +1 -1
- package/dist/esm/src/enum.js +1 -1
- package/dist/esm/src/flatten-templates.js +4 -4
- package/dist/esm/src/get-is-leaf.js +1 -1
- package/dist/esm/src/interfaces.js +12 -10
- package/dist/esm/src/layers/layers.js +12 -6
- package/dist/esm/src/layers/refs.js +3 -3
- package/dist/esm/src/layers/type-utils.js +1 -1
- package/dist/esm/src/migration/index.js +3 -1
- package/dist/esm/src/migration/to/v3.0.0.js +20 -8
- package/dist/esm/src/migration/to/v3.1.0.js +6 -4
- package/dist/esm/src/migration/to/v3.10.0.js +1 -1
- package/dist/esm/src/migration/to/v3.13.0.js +1 -1
- package/dist/esm/src/migration/to/v3.17.0.js +1 -1
- package/dist/esm/src/migration/to/v3.18.0.js +4 -4
- package/dist/esm/src/migration/to/v3.18.1.js +1 -1
- package/dist/esm/src/migration/to/v3.18.2.js +1 -1
- package/dist/esm/src/migration/to/v3.20.0.js +5 -2
- package/dist/esm/src/migration/to/v3.22.0.js +1 -1
- package/dist/esm/src/migration/to/v3.31.0.js +2 -2
- package/dist/esm/src/migration/to/v3.32.0.js +3 -1
- package/dist/esm/src/migration/to/v3.34.0.js +6 -9
- package/dist/esm/src/migration/to/v3.36.0.js +1 -1
- package/dist/esm/src/migration/to/v3.39.0.js +8 -8
- package/dist/esm/src/migration/to/v3.40.0.js +1 -1
- package/dist/esm/src/migration/to/v3.46.0.js +1 -1
- package/dist/esm/src/migration/to/v3.51.0.js +10 -0
- package/dist/esm/src/migration/to/v3.9.0.js +3 -3
- package/dist/esm/src/mocks.js +1 -1
- package/dist/esm/src/models/project-schema.js +4 -4
- package/dist/esm/src/models/shape.js +2 -2
- package/dist/esm/src/project-schema/index.js +3 -1
- package/dist/esm/src/project-schema/migrate.js +4 -2
- package/dist/esm/src/project-schema/v3.51.0.js +7 -0
- package/dist/esm/src/refs.js +29 -19
- package/dist/esm/src/relationships.js +26 -21
- package/dist/esm/src/runtime-schema.js +16 -9
- package/dist/esm/src/schema-transform.js +3 -3
- package/dist/esm/src/schema-util.js +40 -32
- package/dist/esm/src/schemas/auth-schemas.json +18 -78
- package/dist/esm/src/schemas/index.js +4 -2
- package/dist/esm/src/schemas/project-schema/experimental.json +7 -20
- package/dist/esm/src/schemas/project-schema/latest.json +166 -566
- package/dist/esm/src/schemas/project-schema/meta-schema-v1.0.0.json +3 -17
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.0.0.json +4 -4
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.1.0.json +4 -4
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.2.0.json +5 -5
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.3.0.json +5 -5
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.4.0.json +11 -43
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.5.0.json +7 -7
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.5.1.json +8 -11
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.6.0.json +8 -11
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.7.0.json +11 -9
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.8.0.json +11 -9
- package/dist/esm/src/schemas/project-schema/meta-schema-v3.9.0.json +24 -22
- package/dist/esm/src/schemas/project-schema/v1.0.0.json +3 -3
- package/dist/esm/src/schemas/project-schema/v3.0.0.json +1 -1
- package/dist/esm/src/schemas/project-schema/v3.1.0.json +2 -2
- package/dist/esm/src/schemas/project-schema/v3.10.0.json +32 -30
- package/dist/esm/src/schemas/project-schema/v3.11.0.json +32 -30
- package/dist/esm/src/schemas/project-schema/v3.12.0.json +33 -36
- package/dist/esm/src/schemas/project-schema/v3.12.1.json +33 -36
- package/dist/esm/src/schemas/project-schema/v3.12.2.json +2122 -2125
- package/dist/esm/src/schemas/project-schema/v3.12.3.json +2175 -2178
- package/dist/esm/src/schemas/project-schema/v3.13.0.json +32 -30
- package/dist/esm/src/schemas/project-schema/v3.14.0.json +32 -30
- package/dist/esm/src/schemas/project-schema/v3.15.0.json +40 -38
- package/dist/esm/src/schemas/project-schema/v3.16.0.json +40 -38
- package/dist/esm/src/schemas/project-schema/v3.17.0.json +47 -39
- package/dist/esm/src/schemas/project-schema/v3.17.1.json +2204 -2196
- package/dist/esm/src/schemas/project-schema/v3.18.0.json +40 -38
- package/dist/esm/src/schemas/project-schema/v3.18.1.json +40 -38
- package/dist/esm/src/schemas/project-schema/v3.18.2.json +40 -38
- package/dist/esm/src/schemas/project-schema/v3.19.0.json +40 -38
- package/dist/esm/src/schemas/project-schema/v3.2.0.json +1 -1
- package/dist/esm/src/schemas/project-schema/v3.20.0.json +40 -38
- package/dist/esm/src/schemas/project-schema/v3.21.0.json +41 -39
- package/dist/esm/src/schemas/project-schema/v3.22.0.json +41 -39
- package/dist/esm/src/schemas/project-schema/v3.23.0.json +43 -43
- package/dist/esm/src/schemas/project-schema/v3.24.0.json +105 -458
- package/dist/esm/src/schemas/project-schema/v3.25.0.json +105 -458
- package/dist/esm/src/schemas/project-schema/v3.26.0.json +107 -466
- package/dist/esm/src/schemas/project-schema/v3.27.0.json +107 -466
- package/dist/esm/src/schemas/project-schema/v3.28.0.json +112 -471
- package/dist/esm/src/schemas/project-schema/v3.29.0.json +112 -471
- package/dist/esm/src/schemas/project-schema/v3.3.0.json +1 -1
- package/dist/esm/src/schemas/project-schema/v3.30.0.json +112 -472
- package/dist/esm/src/schemas/project-schema/v3.31.0.json +112 -486
- package/dist/esm/src/schemas/project-schema/v3.32.0.json +113 -488
- package/dist/esm/src/schemas/project-schema/v3.33.0.json +113 -488
- package/dist/esm/src/schemas/project-schema/v3.34.0.json +113 -488
- package/dist/esm/src/schemas/project-schema/v3.35.0.json +114 -491
- package/dist/esm/src/schemas/project-schema/v3.36.0.json +114 -491
- package/dist/esm/src/schemas/project-schema/v3.37.0.json +118 -511
- package/dist/esm/src/schemas/project-schema/v3.38.0.json +118 -511
- package/dist/esm/src/schemas/project-schema/v3.39.0.json +118 -511
- package/dist/esm/src/schemas/project-schema/v3.4.0.json +1 -1
- package/dist/esm/src/schemas/project-schema/v3.40.0.json +118 -512
- package/dist/esm/src/schemas/project-schema/v3.41.0.json +118 -512
- package/dist/esm/src/schemas/project-schema/v3.42.0.json +118 -512
- package/dist/esm/src/schemas/project-schema/v3.43.0.json +118 -512
- package/dist/esm/src/schemas/project-schema/v3.44.0.json +125 -540
- package/dist/esm/src/schemas/project-schema/v3.45.0.json +128 -554
- package/dist/esm/src/schemas/project-schema/v3.46.0.json +129 -560
- package/dist/esm/src/schemas/project-schema/v3.47.0.json +131 -568
- package/dist/esm/src/schemas/project-schema/v3.48.0.json +132 -572
- package/dist/esm/src/schemas/project-schema/v3.49.0.json +132 -558
- package/dist/esm/src/schemas/project-schema/v3.5.0.json +1 -1
- package/dist/esm/src/schemas/project-schema/v3.5.1.json +1 -1
- package/dist/esm/src/schemas/project-schema/v3.50.0.json +165 -565
- package/dist/esm/src/schemas/project-schema/v3.51.0.json +3320 -0
- package/dist/esm/src/schemas/project-schema/v3.6.0.json +1 -1
- package/dist/esm/src/schemas/project-schema/v3.7.0.json +1 -1
- package/dist/esm/src/schemas/project-schema/v3.8.0.json +1 -1
- package/dist/esm/src/schemas/project-schema/v3.9.0.json +1 -1
- package/dist/esm/src/schemas/project-schema/v4.0.0.json +31 -29
- package/dist/esm/src/schemas/project-schema.json +3 -0
- package/dist/esm/src/schemas/user-schema.json +2 -9
- package/dist/esm/src/service-dependencies.js +17 -11
- package/dist/esm/src/services/services.js +12 -11
- package/dist/esm/src/services/util.js +4 -4
- package/dist/esm/src/template-shapes/templates.js +18 -12
- package/dist/esm/src/template-shapes/where.js +24 -15
- package/dist/esm/src/types/utils.js +3 -3
- package/dist/esm/src/unions.js +6 -8
- package/dist/esm/src/util/api-indexing.js +4 -4
- package/dist/esm/src/util/detect-cycles.js +2 -2
- package/dist/esm/src/util/find-shape-at-path.js +1 -1
- package/dist/esm/src/util/form-config.js +0 -1
- package/dist/esm/src/util/get-conflicting-properties.js +1 -1
- package/dist/esm/src/util/merge.js +23 -14
- package/dist/esm/src/util/patch-schema.js +2 -2
- package/dist/esm/src/util/shapes.js +2 -2
- package/dist/esm/src/validate.js +64 -47
- package/dist/esm/src/workflows.js +4 -4
- package/dist/types/src/agents.d.ts +1 -1
- package/dist/types/src/builtin-schema.d.ts +2 -2
- package/dist/types/src/content-schema-transform.d.ts +1 -1
- package/dist/types/src/create-input-schema.d.ts +1 -1
- package/dist/types/src/enum.d.ts +1 -1
- package/dist/types/src/flatten-templates.d.ts +1 -1
- package/dist/types/src/layers/layers.d.ts +1 -1
- package/dist/types/src/layers/refs.d.ts +1 -1
- package/dist/types/src/layers/type-utils.d.ts +1 -1
- package/dist/types/src/layers/visitor.d.ts +2 -2
- package/dist/types/src/migration/index.d.ts +1 -0
- package/dist/types/src/migration/to/v3.17.1.d.ts +1 -1
- package/dist/types/src/migration/to/v3.19.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.21.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.22.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.23.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.24.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.25.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.26.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.27.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.28.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.29.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.30.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.31.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.32.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.33.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.34.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.35.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.36.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.37.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.38.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.39.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.40.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.41.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.42.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.43.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.44.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.45.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.46.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.47.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.48.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.49.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.50.0.d.ts +1 -1
- package/dist/types/src/migration/to/v3.51.0.d.ts +4 -0
- package/dist/types/src/migration/types.d.ts +1 -1
- package/dist/types/src/mocks.d.ts +1 -1
- package/dist/types/src/models/project-schema.d.ts +3 -3
- package/dist/types/src/models/query.d.ts +2 -2
- package/dist/types/src/models/service.d.ts +2 -2
- package/dist/types/src/models/shape.d.ts +2 -2
- package/dist/types/src/project-schema/index.d.ts +4 -1
- package/dist/types/src/project-schema/latest.d.ts +28 -10
- package/dist/types/src/project-schema/v3.50.0.d.ts +27 -9
- package/dist/types/src/project-schema/v3.51.0.d.ts +2189 -0
- package/dist/types/src/refs.d.ts +1 -1
- package/dist/types/src/relationships.d.ts +2 -2
- package/dist/types/src/runtime-schema.d.ts +1 -1
- package/dist/types/src/schema-transform.d.ts +1 -1
- package/dist/types/src/schema-util.d.ts +2 -2
- package/dist/types/src/schemas/index.d.ts +2 -2
- package/dist/types/src/service-dependencies.d.ts +2 -2
- package/dist/types/src/services/services.d.ts +3 -3
- package/dist/types/src/services/util.d.ts +2 -2
- package/dist/types/src/template-shapes/index.d.ts +2 -2
- package/dist/types/src/template-shapes/names.d.ts +1 -1
- package/dist/types/src/template-shapes/types.d.ts +2 -2
- package/dist/types/src/template-shapes/where.d.ts +1 -1
- package/dist/types/src/types/transforms.d.ts +1 -1
- package/dist/types/src/types/types.d.ts +4 -4
- package/dist/types/src/types/utils.d.ts +2 -2
- package/dist/types/src/unions.d.ts +2 -2
- package/dist/types/src/util/ai-tools.d.ts +1 -1
- package/dist/types/src/util/api-indexing.d.ts +1 -1
- package/dist/types/src/util/detect-cycles.d.ts +1 -1
- package/dist/types/src/util/find-shape-at-path.d.ts +1 -1
- package/dist/types/src/util/form-config.d.ts +1 -1
- package/dist/types/src/util/get-conflicting-properties.d.ts +1 -1
- package/dist/types/src/util/get-return-shape.d.ts +1 -1
- package/dist/types/src/util/has-arg.d.ts +2 -2
- package/dist/types/src/util/merge.d.ts +1 -1
- package/dist/types/src/util/patch-schema.d.ts +2 -2
- package/dist/types/src/util/shapes.d.ts +1 -1
- package/dist/types/src/validate.d.ts +4 -4
- package/dist/types/src/workflows.d.ts +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/examples/latest/agent-schema.json +5 -13
- package/examples/latest/all-fields-shapes-inline.json +19 -53
- package/examples/latest/all-fields-shapes.json +27 -77
- package/examples/latest/betzino.json +903 -3140
- package/examples/latest/blog-schema.json +9 -29
- package/examples/latest/brewery-schema.json +8 -26
- package/examples/latest/clear-cache-schema.json +4 -8
- package/examples/latest/complex-project-schema.json +99 -360
- package/examples/latest/complex-schema.json +487 -1754
- package/examples/latest/edit-schema.json +5 -12
- package/examples/latest/fabric-ecommerce.json +188 -839
- package/examples/latest/frank-and-fred-schema.json +489 -1756
- package/examples/latest/klirr-schema.json +683 -2412
- package/examples/latest/layers/rick-and-morty-layer.json +12 -33
- package/examples/latest/layers/shopify-layer-2023-01.json +2207 -8638
- package/examples/latest/layers/shopify-storefront-2023-04.json +403 -1713
- package/examples/latest/layers/wordpress-2024-01.json +689 -2744
- package/examples/latest/massive-schema.json +132 -585
- package/examples/latest/mill-components-schema.json +30 -126
- package/examples/latest/nested-shape-arrays.json +8 -20
- package/examples/latest/one-earth.json +237 -1114
- package/examples/latest/pet-oneof-array.json +8 -23
- package/examples/latest/post-schema.json +7 -21
- package/examples/latest/pruned-shopify-product-schema.json +186 -831
- package/examples/latest/rag-example.json +6 -16
- package/examples/latest/real-world-schema.json +15 -57
- package/examples/latest/recursive-repeater-schema.json +5 -12
- package/examples/latest/recursive-schema.json +5 -12
- package/examples/latest/rick-and-morty-ast.json +46 -175
- package/examples/latest/rick-and-morty-graphql.json +26 -101
- package/examples/latest/rick-and-morty-rest.json +4 -8
- package/examples/latest/rick-and-morty-with-indexing.json +6 -14
- package/examples/latest/schema-where-filter.json +12 -41
- package/examples/latest/schema-with-repeater-draftjs.json +4 -9
- package/examples/latest/schema-with-rick-and-morty.json +3 -5
- package/examples/latest/shape-books-v3_2_0.json +18 -72
- package/examples/latest/shape-books.json +18 -72
- package/examples/latest/shape-editor-schema-edited.json +24 -70
- package/examples/latest/shape-editor-schema-initial.json +11 -29
- package/examples/latest/shapedb-crud-every-prop-type.json +9 -23
- package/examples/latest/shopify-lookbook.json +6 -20
- package/examples/latest/shopify-product-2022-07.json +727 -3218
- package/examples/latest/shopify-product-2023-04.json +1013 -4497
- package/examples/latest/shopify-store-with-widget.json +214 -943
- package/examples/latest/stripe-product-runtime-schema.json +82 -278
- package/examples/latest/stripe-starter-resolved.json +477 -1954
- package/examples/latest/user-schema-no-required.json +4 -14
- package/examples/latest/user-schema-with-defaults.json +6 -28
- package/examples/latest/valvoline-ai-demo.json +18 -70
- package/examples/latest/vector-search-schema.json +9 -25
- package/examples/source/agent-schema.json +29 -16
- package/examples/source/all-fields-shapes-inline.json +21 -30
- package/examples/source/all-fields-shapes.json +26 -76
- package/examples/source/betzino.json +1501 -4960
- package/examples/source/blog-schema.json +1 -1
- package/examples/source/brewery-schema.json +1 -1
- package/examples/source/clear-cache-schema.json +4 -4
- package/examples/source/complex-project-schema.json +196 -688
- package/examples/source/edit-schema.json +3 -3
- package/examples/source/fabric-ecommerce.json +186 -837
- package/examples/source/frank-and-fred-schema.json +1136 -3929
- package/examples/source/layers/rick-and-morty-layer.json +10 -31
- package/examples/source/layers/shopify-layer-2023-01.json +2205 -8636
- package/examples/source/layers/shopify-storefront-2023-04.json +401 -1711
- package/examples/source/layers/wordpress-2024-01.json +689 -2743
- package/examples/source/massive-schema.json +386 -1455
- package/examples/source/nested-shape-arrays.json +12 -12
- package/examples/source/pet-oneof-array.json +31 -29
- package/examples/source/post-schema.json +1 -1
- package/examples/source/pruned-shopify-product-schema.json +184 -829
- package/examples/source/rag-example.json +5 -15
- package/examples/source/real-world-schema.json +32 -119
- package/examples/source/recursive-repeater-schema.json +3 -8
- package/examples/source/recursive-schema.json +1 -1
- package/examples/source/rick-and-morty-ast.json +66 -251
- package/examples/source/rick-and-morty-graphql.json +41 -162
- package/examples/source/rick-and-morty-rest.json +24 -6
- package/examples/source/rick-and-morty-with-indexing.json +25 -25
- package/examples/source/schema-where-filter.json +29 -50
- package/examples/source/schema-with-repeater-draftjs.json +9 -31
- package/examples/source/schema-with-rick-and-morty.json +4 -4
- package/examples/source/shape-books.json +49 -181
- package/examples/source/shape-editor-schema-edited.json +22 -68
- package/examples/source/shape-editor-schema-initial.json +9 -27
- package/examples/source/shapedb-crud-every-prop-type.json +20 -29
- package/examples/source/shopify-product-2022-07.json +736 -3261
- package/examples/source/shopify-product-2023-04.json +1022 -4540
- package/examples/source/shopify-store-with-widget.json +212 -941
- package/examples/source/stripe-product-runtime-schema.json +91 -321
- package/examples/source/stripe-starter-resolved.json +475 -1952
- package/examples/source/user-schema-with-defaults.json +1 -9
- package/examples/source/valvoline-ai-demo.json +175 -219
- package/examples/source/vector-search-schema.json +37 -38
- package/examples/v4_0_0/rick-and-morty-notes/flattened-schema.json +15 -49
- package/examples/v4_0_0/rick-and-morty-notes/layers/character-notes.json +8 -8
- package/examples/v4_0_0/rick-and-morty-notes/layers/takeshape-builtins.json +1 -3
- package/examples/v4_0_0/rick-and-morty-notes/layers/takeshape-static-sites.json +19 -79
- package/examples/v4_0_0/rick-and-morty-notes/schema.json +8 -5
- package/examples/v4_0_0/shopify-lookbook/flattened-schema.json +190 -851
- package/examples/v4_0_0/shopify-lookbook/layers/andrews-store.json +1103 -4431
- package/examples/v4_0_0/shopify-lookbook/layers/lookbook.json +64 -56
- package/examples/v4_0_0/shopify-lookbook/layers/takeshape-assets.json +1 -4
- package/examples/v4_0_0/shopify-lookbook/layers/takeshape-builtins.json +1 -3
- package/examples/v4_0_0/shopify-lookbook/schema.json +3 -10
- package/package.json +12 -9
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
},
|
|
155
155
|
"items": {
|
|
156
156
|
"oneOf": [
|
|
157
|
-
{"$ref": "#/definitions/refSchema"},
|
|
157
|
+
{ "$ref": "#/definitions/refSchema" },
|
|
158
158
|
{
|
|
159
159
|
"type": "object",
|
|
160
160
|
"properties": {
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
"allOfSchema": {
|
|
200
200
|
"title": "AllOfSchema",
|
|
201
201
|
"allOf": [
|
|
202
|
-
{"$ref": "#/definitions/propertySchema"},
|
|
202
|
+
{ "$ref": "#/definitions/propertySchema" },
|
|
203
203
|
{
|
|
204
204
|
"type": "object",
|
|
205
205
|
"properties": {
|
|
@@ -253,7 +253,7 @@
|
|
|
253
253
|
"oneOfSchema": {
|
|
254
254
|
"title": "OneOfSchema",
|
|
255
255
|
"allOf": [
|
|
256
|
-
{"$ref": "#/definitions/propertySchema"},
|
|
256
|
+
{ "$ref": "#/definitions/propertySchema" },
|
|
257
257
|
{
|
|
258
258
|
"type": "object",
|
|
259
259
|
"properties": {
|
|
@@ -284,10 +284,10 @@
|
|
|
284
284
|
"title": "Shape Schema",
|
|
285
285
|
"type": "object",
|
|
286
286
|
"oneOf": [
|
|
287
|
-
{"$ref": "#/definitions/shapeSchemaAllOf"},
|
|
288
|
-
{"$ref": "#/definitions/shapeSchemaOneOf"},
|
|
289
|
-
{"$ref": "#/definitions/shapeSchemaEnum"},
|
|
290
|
-
{"$ref": "#/definitions/objectSchema"}
|
|
287
|
+
{ "$ref": "#/definitions/shapeSchemaAllOf" },
|
|
288
|
+
{ "$ref": "#/definitions/shapeSchemaOneOf" },
|
|
289
|
+
{ "$ref": "#/definitions/shapeSchemaEnum" },
|
|
290
|
+
{ "$ref": "#/definitions/objectSchema" }
|
|
291
291
|
]
|
|
292
292
|
},
|
|
293
293
|
"queryMap": {
|
|
@@ -302,11 +302,11 @@
|
|
|
302
302
|
},
|
|
303
303
|
"args": {
|
|
304
304
|
"title": "Args",
|
|
305
|
-
"oneOf": [{"type": "string"}, {"$ref": "#/definitions/objectSchema"}]
|
|
305
|
+
"oneOf": [{ "type": "string" }, { "$ref": "#/definitions/objectSchema" }]
|
|
306
306
|
},
|
|
307
307
|
"returnShape": {
|
|
308
308
|
"title": "Return Shape",
|
|
309
|
-
"oneOf": [{"type": "string"}, {"$ref": "#/definitions/returnShapeArraySchema"}]
|
|
309
|
+
"oneOf": [{ "type": "string" }, { "$ref": "#/definitions/returnShapeArraySchema" }]
|
|
310
310
|
},
|
|
311
311
|
"directiveConfigItem": {
|
|
312
312
|
"title": "Directive Config Item",
|
|
@@ -471,7 +471,9 @@
|
|
|
471
471
|
"paths": {
|
|
472
472
|
"type": "object",
|
|
473
473
|
"patternProperties": {
|
|
474
|
-
"^[^\\n\\r]*$": {
|
|
474
|
+
"^[^\\n\\r]*$": {
|
|
475
|
+
"$ref": "#/definitions/parameterSerializeOptions"
|
|
476
|
+
}
|
|
475
477
|
}
|
|
476
478
|
}
|
|
477
479
|
},
|
|
@@ -837,13 +839,13 @@
|
|
|
837
839
|
"title": "Directive Mapping Array Item",
|
|
838
840
|
"description": "A tuple with a string key and a directive config to evaluate",
|
|
839
841
|
"type": "array",
|
|
840
|
-
"items": [{"type": "string"}, {"$ref": "#/definitions/directiveConfig"}]
|
|
842
|
+
"items": [{ "type": "string" }, { "$ref": "#/definitions/directiveConfig" }]
|
|
841
843
|
},
|
|
842
844
|
"directiveMappingArray": {
|
|
843
845
|
"title": "Directive Mapping Array",
|
|
844
846
|
"description": "An array of key / value or directive config tuples",
|
|
845
847
|
"type": "array",
|
|
846
|
-
"items": {"$ref": "#/definitions/directiveMappingArrayItem"}
|
|
848
|
+
"items": { "$ref": "#/definitions/directiveMappingArrayItem" }
|
|
847
849
|
},
|
|
848
850
|
"basicResolver": {
|
|
849
851
|
"title": "BasicResolver",
|
|
@@ -946,7 +948,7 @@
|
|
|
946
948
|
"title": "TakeshapeResolver",
|
|
947
949
|
"type": "object",
|
|
948
950
|
"properties": {
|
|
949
|
-
"if": {"type": "string"},
|
|
951
|
+
"if": { "type": "string" },
|
|
950
952
|
"id": {
|
|
951
953
|
"type": "string",
|
|
952
954
|
"pattern": "^(?=[a-zA-Z])[-_a-zA-Z0-9]+$"
|
|
@@ -1046,7 +1048,7 @@
|
|
|
1046
1048
|
"title": "GraphqlResolver",
|
|
1047
1049
|
"type": "object",
|
|
1048
1050
|
"properties": {
|
|
1049
|
-
"if": {"type": "string"},
|
|
1051
|
+
"if": { "type": "string" },
|
|
1050
1052
|
"id": {
|
|
1051
1053
|
"type": "string",
|
|
1052
1054
|
"pattern": "^(?=[a-zA-Z])[-_a-zA-Z0-9]+$"
|
|
@@ -1071,13 +1073,13 @@
|
|
|
1071
1073
|
"title": "GraphqlResolverOptions",
|
|
1072
1074
|
"type": "object",
|
|
1073
1075
|
"properties": {
|
|
1074
|
-
"selectionSet": {"type": "string"},
|
|
1075
|
-
"unboxParentSelectionSet": {"type": "boolean"},
|
|
1076
|
-
"ignoreErrors": {"type": "boolean"},
|
|
1077
|
-
"skipWhenMissingArgs": {"type": "boolean"},
|
|
1078
|
-
"ttl": {"type": "number"},
|
|
1079
|
-
"timeout": {"type": "number"},
|
|
1080
|
-
"retry": {"oneOf": [{"type": "number"}, {"type": "object"}]}
|
|
1076
|
+
"selectionSet": { "type": "string" },
|
|
1077
|
+
"unboxParentSelectionSet": { "type": "boolean" },
|
|
1078
|
+
"ignoreErrors": { "type": "boolean" },
|
|
1079
|
+
"skipWhenMissingArgs": { "type": "boolean" },
|
|
1080
|
+
"ttl": { "type": "number" },
|
|
1081
|
+
"timeout": { "type": "number" },
|
|
1082
|
+
"retry": { "oneOf": [{ "type": "number" }, { "type": "object" }] }
|
|
1081
1083
|
},
|
|
1082
1084
|
"additionalProperties": true
|
|
1083
1085
|
},
|
|
@@ -1109,7 +1111,7 @@
|
|
|
1109
1111
|
"title": "RestResolver",
|
|
1110
1112
|
"type": "object",
|
|
1111
1113
|
"properties": {
|
|
1112
|
-
"if": {"type": "string"},
|
|
1114
|
+
"if": { "type": "string" },
|
|
1113
1115
|
"id": {
|
|
1114
1116
|
"type": "string",
|
|
1115
1117
|
"pattern": "^(?=[a-zA-Z])[-_a-zA-Z0-9]+$"
|
|
@@ -1137,10 +1139,10 @@
|
|
|
1137
1139
|
"title": "RestResolverOptions",
|
|
1138
1140
|
"type": "object",
|
|
1139
1141
|
"properties": {
|
|
1140
|
-
"trailingSlash": {"type": "boolean"},
|
|
1141
|
-
"ttl": {"type": "number"},
|
|
1142
|
-
"timeout": {"type": "number"},
|
|
1143
|
-
"retry": {"oneOf": [{"type": "number"}, {"type": "object"}]}
|
|
1142
|
+
"trailingSlash": { "type": "boolean" },
|
|
1143
|
+
"ttl": { "type": "number" },
|
|
1144
|
+
"timeout": { "type": "number" },
|
|
1145
|
+
"retry": { "oneOf": [{ "type": "number" }, { "type": "object" }] }
|
|
1144
1146
|
},
|
|
1145
1147
|
"additionalProperties": true
|
|
1146
1148
|
},
|
|
@@ -1191,7 +1193,7 @@
|
|
|
1191
1193
|
"title": "AwsLambdaResolver",
|
|
1192
1194
|
"type": "object",
|
|
1193
1195
|
"properties": {
|
|
1194
|
-
"if": {"type": "string"},
|
|
1196
|
+
"if": { "type": "string" },
|
|
1195
1197
|
"id": {
|
|
1196
1198
|
"type": "string",
|
|
1197
1199
|
"pattern": "^(?=[a-zA-Z])[-_a-zA-Z0-9]+$"
|
|
@@ -1282,7 +1284,7 @@
|
|
|
1282
1284
|
},
|
|
1283
1285
|
"resolver": {
|
|
1284
1286
|
"title": "Resolver",
|
|
1285
|
-
"oneOf": [{"$ref": "#/definitions/basicResolver"}, {"$ref": "#/definitions/composeResolver"}]
|
|
1287
|
+
"oneOf": [{ "$ref": "#/definitions/basicResolver" }, { "$ref": "#/definitions/composeResolver" }]
|
|
1286
1288
|
},
|
|
1287
1289
|
"query": {
|
|
1288
1290
|
"title": "Query JSON",
|
|
@@ -2287,7 +2289,7 @@
|
|
|
2287
2289
|
"layers": {
|
|
2288
2290
|
"type": "array",
|
|
2289
2291
|
"items": {
|
|
2290
|
-
"oneOf": [{"type": "string"}, {"$ref": "#/definitions/layerConfig"}]
|
|
2292
|
+
"oneOf": [{ "type": "string" }, { "$ref": "#/definitions/layerConfig" }]
|
|
2291
2293
|
}
|
|
2292
2294
|
},
|
|
2293
2295
|
"dataKey": {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { addAll,
|
|
1
|
+
import { addAll, deepClone, mapSet } from "@takeshape/util";
|
|
2
2
|
import get from "lodash/get.js";
|
|
3
|
-
import set from "lodash/set.js";
|
|
4
3
|
import isObject from "lodash/isObject.js";
|
|
5
4
|
import pick from "lodash/pick.js";
|
|
6
|
-
import
|
|
7
|
-
import { createGetNamespace, dereferenceObjectSchema, getAllPropertyRefs, getRef, getRefShapeName, propertyRefItemToPath, refExpressionToRefItem, refItemToNamespacedShapeName } from "./refs.js";
|
|
5
|
+
import set from "lodash/set.js";
|
|
8
6
|
import { getImplementationShapeNameMap, isInterfaceShape, pruneUnusedInterfaces } from "./interfaces.js";
|
|
9
|
-
import {
|
|
7
|
+
import { createGetNamespace, dereferenceObjectSchema, getAllPropertyRefs, getRef, getRefShapeName, propertyRefItemToPath, refExpressionToRefItem, refItemToNamespacedShapeName } from "./refs.js";
|
|
8
|
+
import { getAllNamespaceShapes, getAllRefsInQuery, getArgsReference, isValidRefItem, visitSchemaProperties } from "./schema-util.js";
|
|
9
|
+
import { isExtendsSchema, isObjectSchema, isProjectSchemaWithServices } from "./types/index.js";
|
|
10
10
|
function getGraphQLServiceShapeMap(layers) {
|
|
11
|
-
return Object.assign({}, ...Object.values(layers).map(layer => layer.schema?.shapes ?? {}));
|
|
11
|
+
return Object.assign({}, ...Object.values(layers).map((layer) => layer.schema?.shapes ?? {}));
|
|
12
12
|
}
|
|
13
13
|
function schemaExtendsShape(context, shapeName, schema) {
|
|
14
14
|
return (isExtendsSchema(schema) &&
|
|
@@ -16,7 +16,7 @@ function schemaExtendsShape(context, shapeName, schema) {
|
|
|
16
16
|
}
|
|
17
17
|
function getMissingPropertyRefs(projectSchema, getNamespace) {
|
|
18
18
|
const propertyRefs = getAllPropertyRefs(projectSchema);
|
|
19
|
-
return propertyRefs.filter(ref => {
|
|
19
|
+
return propertyRefs.filter((ref) => {
|
|
20
20
|
const path = propertyRefItemToPath(getNamespace, ref);
|
|
21
21
|
return !get(projectSchema, path);
|
|
22
22
|
});
|
|
@@ -46,7 +46,7 @@ function getShapeRefs(services, serviceSchemas, propertyRefs) {
|
|
|
46
46
|
return results;
|
|
47
47
|
}
|
|
48
48
|
function interfacesToShapeNames(projectSchema, shapeRefArray) {
|
|
49
|
-
return shapeRefArray.map(shapeRef => refItemToNamespacedShapeName(refExpressionToRefItem(projectSchema, shapeRef)));
|
|
49
|
+
return shapeRefArray.map((shapeRef) => refItemToNamespacedShapeName(refExpressionToRefItem(projectSchema, shapeRef)));
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* Add all referenced shape names to the refSet meant to be used as a callback to visitSchemaProperties
|
|
@@ -115,7 +115,7 @@ export function resolveSchemaShapeDependencies(projectSchema, serviceLayers) {
|
|
|
115
115
|
collectDependencies(requiredShapeNames);
|
|
116
116
|
// Collect interfaces that requiredShapeNames implement
|
|
117
117
|
const interfaceNames = new Set();
|
|
118
|
-
const requiredShapes = mapSet(requiredShapeNames, shapeName => newSchema.shapes[shapeName] ?? remoteShapeMap[shapeName]);
|
|
118
|
+
const requiredShapes = mapSet(requiredShapeNames, (shapeName) => newSchema.shapes[shapeName] ?? remoteShapeMap[shapeName]);
|
|
119
119
|
for (const shape of requiredShapes) {
|
|
120
120
|
if (shape?.interfaces) {
|
|
121
121
|
addAll(interfaceNames, interfacesToShapeNames(projectSchema, shape.interfaces));
|
|
@@ -123,7 +123,10 @@ export function resolveSchemaShapeDependencies(projectSchema, serviceLayers) {
|
|
|
123
123
|
}
|
|
124
124
|
// Collect implementations for interfaces in requiredShapeNames
|
|
125
125
|
const implementationNames = new Set();
|
|
126
|
-
const implementations = getImplementationShapeNameMap({
|
|
126
|
+
const implementations = getImplementationShapeNameMap({
|
|
127
|
+
...newSchema.shapes,
|
|
128
|
+
...remoteShapeMap
|
|
129
|
+
});
|
|
127
130
|
for (const shape of requiredShapes) {
|
|
128
131
|
if (isInterfaceShape(shape) && implementations[shape.name]) {
|
|
129
132
|
addAll(implementationNames, implementations[shape.name]);
|
|
@@ -136,7 +139,10 @@ export function resolveSchemaShapeDependencies(projectSchema, serviceLayers) {
|
|
|
136
139
|
addAll(requiredShapeNames, implementationNames);
|
|
137
140
|
// Populate a ShapeMap with the remote shapes we've gathered
|
|
138
141
|
// A combined context which prefers remote shapes for use when merging/inlining
|
|
139
|
-
const mergingContext = {
|
|
142
|
+
const mergingContext = {
|
|
143
|
+
services: newSchema.services,
|
|
144
|
+
shapes: { ...newSchema.shapes, ...remoteShapeMap }
|
|
145
|
+
};
|
|
140
146
|
for (const name of requiredShapeNames) {
|
|
141
147
|
const localShape = newSchema.shapes[name];
|
|
142
148
|
const remoteShape = remoteShapeMap[name];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { mergeWithArrayMerge } from "@takeshape/util";
|
|
2
|
-
import { createAjv } from "@takeshape/json-schema";
|
|
3
1
|
import { SchemaValidationError } from "@takeshape/errors";
|
|
4
|
-
import
|
|
2
|
+
import { createAjv } from "@takeshape/json-schema";
|
|
3
|
+
import { mergeWithArrayMerge } from "@takeshape/util";
|
|
5
4
|
import isEqual from "lodash/isEqual.js";
|
|
6
|
-
import
|
|
7
|
-
import { createSchemaPropertyList, getGeneratorVersion, getServiceIdFieldName, getShapeDependencies, pathBetween } from "../schema-util.js";
|
|
5
|
+
import isNull from "lodash/isNull.js";
|
|
8
6
|
import { SERVICE_OBJECT_PATTERN_NAME } from "../constants.js";
|
|
7
|
+
import { createSchemaPropertyList, getGeneratorVersion, getServiceIdFieldName, getShapeDependencies, pathBetween } from "../schema-util.js";
|
|
9
8
|
import { latestSchemaJson } from "../schemas/index.js";
|
|
9
|
+
import { isEncryptedServiceConfig, isServiceAuthentication, isServiceResolver } from "../types/utils.js";
|
|
10
10
|
import { formatError } from "../validate.js";
|
|
11
11
|
import { getStoredServiceConfig } from "./util.js";
|
|
12
12
|
/**
|
|
@@ -58,7 +58,6 @@ export function validateServiceConfig(maybeServiceConfig) {
|
|
|
58
58
|
* Prepare a `ServiceConfig` object update, validating the overall structure
|
|
59
59
|
* and encrypting the `ServiceAuthentication` object.
|
|
60
60
|
*/
|
|
61
|
-
// eslint-disable-next-line max-params
|
|
62
61
|
export function prepareServiceUpdate(encryptFn, decryptFn, projectSchema, serviceConfigUpdate, serviceKey) {
|
|
63
62
|
const storedServiceConfig = getStoredServiceConfig(projectSchema, serviceKey);
|
|
64
63
|
let newServiceConfig = serviceConfigUpdate;
|
|
@@ -68,6 +67,7 @@ export function prepareServiceUpdate(encryptFn, decryptFn, projectSchema, servic
|
|
|
68
67
|
}
|
|
69
68
|
const { authentication, authenticationType } = newServiceConfig;
|
|
70
69
|
if (authenticationType === "none" || isNull(authentication)) {
|
|
70
|
+
// biome-ignore lint/performance/noDelete: Property presence may matter here
|
|
71
71
|
delete newServiceConfig.authentication;
|
|
72
72
|
}
|
|
73
73
|
else if (authentication !== undefined) {
|
|
@@ -92,15 +92,16 @@ export function prepareServiceUpdate(encryptFn, decryptFn, projectSchema, servic
|
|
|
92
92
|
return serviceConfig;
|
|
93
93
|
}
|
|
94
94
|
export function getServiceObjectFields(projectSchema, shape, provider) {
|
|
95
|
-
return (getServiceInfo(projectSchema, shape)[provider] ?? []).filter(serviceInfo => serviceInfo.generators[SERVICE_OBJECT_PATTERN_NAME]);
|
|
95
|
+
return (getServiceInfo(projectSchema, shape)[provider] ?? []).filter((serviceInfo) => serviceInfo.generators[SERVICE_OBJECT_PATTERN_NAME]);
|
|
96
96
|
}
|
|
97
97
|
// Returns info for all services found in shape, keyed by provider
|
|
98
98
|
export function getServiceInfo(projectSchema, shape) {
|
|
99
99
|
const result = {};
|
|
100
100
|
// Get inline dependencies by not following refs with @resolver
|
|
101
|
-
const inlineDepShapes = getShapeDependencies(projectSchema, shape, prop => !prop["@resolver"]).map(name => projectSchema.shapes[name]);
|
|
101
|
+
const inlineDepShapes = getShapeDependencies(projectSchema, shape, (prop) => !prop["@resolver"]).map((name) => projectSchema.shapes[name]);
|
|
102
102
|
const shapesToCheck = [shape, ...inlineDepShapes];
|
|
103
|
-
|
|
103
|
+
for (const thisShape of shapesToCheck) {
|
|
104
|
+
// biome-ignore lint/complexity/noForEach: Types for createSchemaPropertyList do not include the iterator
|
|
104
105
|
createSchemaPropertyList(projectSchema, thisShape).forEach(([key, value]) => {
|
|
105
106
|
const resolver = value["@resolver"];
|
|
106
107
|
if (!isServiceResolver(resolver)) {
|
|
@@ -131,7 +132,7 @@ export function getServiceInfo(projectSchema, shape) {
|
|
|
131
132
|
};
|
|
132
133
|
if (Array.isArray(result[provider])) {
|
|
133
134
|
// Dedupe service info
|
|
134
|
-
if (!result[provider].find(existingServiceInfo => isEqual(existingServiceInfo, serviceInfo))) {
|
|
135
|
+
if (!result[provider].find((existingServiceInfo) => isEqual(existingServiceInfo, serviceInfo))) {
|
|
135
136
|
result[provider].push(serviceInfo);
|
|
136
137
|
}
|
|
137
138
|
}
|
|
@@ -139,6 +140,6 @@ export function getServiceInfo(projectSchema, shape) {
|
|
|
139
140
|
result[provider] = [serviceInfo];
|
|
140
141
|
}
|
|
141
142
|
});
|
|
142
|
-
}
|
|
143
|
+
}
|
|
143
144
|
return result;
|
|
144
145
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { isDefined } from '@takeshape/util';
|
|
1
2
|
import isEmpty from 'lodash/isEmpty.js';
|
|
2
3
|
import uniq from 'lodash/uniq.js';
|
|
3
|
-
import { isDefined } from '@takeshape/util';
|
|
4
4
|
/**
|
|
5
5
|
* Get a service config from a project schema.
|
|
6
6
|
*/
|
|
@@ -18,12 +18,12 @@ export function getServiceNamespaces(context) {
|
|
|
18
18
|
const namespaces = new Map();
|
|
19
19
|
const { services } = context;
|
|
20
20
|
if (services) {
|
|
21
|
-
Object.keys(services)
|
|
21
|
+
for (const serviceKey of Object.keys(services)) {
|
|
22
22
|
const namespace = services[serviceKey]?.namespace;
|
|
23
23
|
if (namespace) {
|
|
24
24
|
namespaces.set(namespace, serviceKey);
|
|
25
25
|
}
|
|
26
|
-
}
|
|
26
|
+
}
|
|
27
27
|
}
|
|
28
28
|
return namespaces;
|
|
29
29
|
}
|
|
@@ -32,5 +32,5 @@ export function isMissingAuth(service) {
|
|
|
32
32
|
}
|
|
33
33
|
export function getResolverServices(resolver) {
|
|
34
34
|
const resolverArray = 'compose' in resolver ? resolver.compose : [resolver];
|
|
35
|
-
return uniq(resolverArray.map(resolver => ('service' in resolver ? resolver.service : undefined)).filter(isDefined));
|
|
35
|
+
return uniq(resolverArray.map((resolver) => ('service' in resolver ? resolver.service : undefined)).filter(isDefined));
|
|
36
36
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { deepClone, formatShapeName, isDefined, visit } from "@takeshape/util";
|
|
2
|
-
import keyBy from "lodash/keyBy.js";
|
|
3
2
|
import get from "lodash/get.js";
|
|
4
|
-
import
|
|
5
|
-
import { getFlattenedTemplateShapeName, getRef, getRefShapeName, refItemToAtRef, refItemToNamespacedShapeName } from "../refs.js";
|
|
6
|
-
import { listTypePrefix } from "../migration/index.js";
|
|
7
|
-
import { mergeObjectSchemas, mergeSchemaProperties } from "../util/merge.js";
|
|
3
|
+
import keyBy from "lodash/keyBy.js";
|
|
8
4
|
import { createInputSchema } from "../create-input-schema.js";
|
|
5
|
+
import { listTypePrefix } from "../migration/index.js";
|
|
6
|
+
import { getFlattenedTemplateShapeName, getRef, getRefShapeName, refItemToAtRef, refItemToNamespacedShapeName } from "../refs.js";
|
|
7
|
+
import { createShape, getShapeDependencies } from "../schema-util.js";
|
|
9
8
|
import { isCachedShape } from "../types/index.js";
|
|
10
|
-
import {
|
|
9
|
+
import { mergeObjectSchemas, mergeSchemaProperties } from "../util/merge.js";
|
|
10
|
+
import { getInputShapeName, getMutationInputShapeName } from "./names.js";
|
|
11
11
|
import { TemplateVerbs } from "./types.js";
|
|
12
|
-
import {
|
|
12
|
+
import { getWhereSearchArg } from "./where.js";
|
|
13
13
|
export const TSGetArgs = getIDQueryArgs("TSGetArgs");
|
|
14
14
|
export const TSGetSingletonArgs = getIDQueryArgs("TSGetSingletonArgs");
|
|
15
15
|
export const TSListArgs = getShapeListQueryArgs("TSListArgs", true);
|
|
@@ -112,7 +112,10 @@ export function getSearchResultsShape(context, shape) {
|
|
|
112
112
|
[shapeName]: createShape(shapeName, {
|
|
113
113
|
type: "object",
|
|
114
114
|
properties: {
|
|
115
|
-
results: {
|
|
115
|
+
results: {
|
|
116
|
+
type: "array",
|
|
117
|
+
items: { "@ref": `local:${shape.name}` }
|
|
118
|
+
},
|
|
116
119
|
total: { type: "integer" }
|
|
117
120
|
},
|
|
118
121
|
required: ["results", "total"]
|
|
@@ -162,6 +165,7 @@ function rewriteRefs(context, shapeSchema, rewriteShapeName) {
|
|
|
162
165
|
? refItemToAtRef(refItem)
|
|
163
166
|
: `local:${rewriteShapeName(refItemToNamespacedShapeName(refItem))}`;
|
|
164
167
|
if (value.$ref) {
|
|
168
|
+
// biome-ignore lint/performance/noDelete: Property presence may matter here
|
|
165
169
|
delete value.$ref;
|
|
166
170
|
}
|
|
167
171
|
}
|
|
@@ -206,7 +210,7 @@ export function getMutationArgs(templateName, verb) {
|
|
|
206
210
|
...(verb !== TemplateVerbs.Delete &&
|
|
207
211
|
keyBy(getShapeDependencies(projectSchema,
|
|
208
212
|
// get the shape dependencies of the shape with the @input swapped
|
|
209
|
-
createShape(inputShape.name, rewrittenSchema), propSchema => {
|
|
213
|
+
createShape(inputShape.name, rewrittenSchema), (propSchema) => {
|
|
210
214
|
if (propSchema["@resolver"]) {
|
|
211
215
|
return false;
|
|
212
216
|
}
|
|
@@ -216,7 +220,7 @@ export function getMutationArgs(templateName, verb) {
|
|
|
216
220
|
}
|
|
217
221
|
return true;
|
|
218
222
|
})
|
|
219
|
-
.map(shapeName => {
|
|
223
|
+
.map((shapeName) => {
|
|
220
224
|
const shape = projectSchema.shapes[shapeName];
|
|
221
225
|
if (!shape) {
|
|
222
226
|
return;
|
|
@@ -232,7 +236,9 @@ export function getMutationArgs(templateName, verb) {
|
|
|
232
236
|
}
|
|
233
237
|
export function getMutationResultType(verb) {
|
|
234
238
|
return (context, shape) => {
|
|
235
|
-
const shapeName = formatShapeName([verb, shape.name, "result"], {
|
|
239
|
+
const shapeName = formatShapeName([verb, shape.name, "result"], {
|
|
240
|
+
shapeNameIndex: 1
|
|
241
|
+
});
|
|
236
242
|
const result = verb === TemplateVerbs.Delete ? { type: "boolean" } : { "@ref": `local:${shape.name}` };
|
|
237
243
|
return {
|
|
238
244
|
shapeName,
|
|
@@ -298,7 +304,7 @@ export function getShapeListQueryArgs(templateName, legacyArgs) {
|
|
|
298
304
|
const isAllShapes = shape.name === "TSSearchable";
|
|
299
305
|
const shapeName = isAllShapes ? templateName : getFlattenedTemplateShapeName(shape.name, templateName);
|
|
300
306
|
const shapes = isAllShapes
|
|
301
|
-
? Object.values(projectSchema.shapes).filter(s => s.model !== undefined || isCachedShape(s))
|
|
307
|
+
? Object.values(projectSchema.shapes).filter((s) => s.model !== undefined || isCachedShape(s))
|
|
302
308
|
: [shape];
|
|
303
309
|
const { schema, dependencies } = getWhereSearchArg(projectSchema, shapes);
|
|
304
310
|
return {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { formatShapeName, isDefined, pascalCase } from "@takeshape/util";
|
|
2
|
+
import md5 from "blueimp-md5";
|
|
2
3
|
import isFunction from "lodash/isFunction.js";
|
|
3
4
|
import uniqBy from "lodash/uniqBy.js";
|
|
4
|
-
import
|
|
5
|
-
import { pascalCase, isDefined, formatShapeName } from "@takeshape/util";
|
|
6
|
-
import { createSchemaPropertyList, createShape, getAllRefsInShapes } from "../schema-util.js";
|
|
5
|
+
import unset from "lodash/unset.js";
|
|
7
6
|
import { workflowsEnabled } from "../api-version.js";
|
|
8
|
-
import { followRef, getRef, getRefOrItemsRef, hasRefProperty, hasResolvableRef,
|
|
9
|
-
import {
|
|
7
|
+
import { followRef, getRef, getRefOrItemsRef, hasRefProperty, hasResolvableRef, refItemToNamespacedShapeName, refItemToShape } from "../refs.js";
|
|
8
|
+
import { getRelationship, getRelationshipShapes, isEqualRelationship } from "../relationships.js";
|
|
9
|
+
import { createSchemaPropertyList, createShape, getAllRefsInShapes } from "../schema-util.js";
|
|
10
10
|
import { isCachedShape, isObjectSchema, isPropertySchemaWithRelationship } from "../types/utils.js";
|
|
11
|
-
import {
|
|
11
|
+
import { enumerateOneOfKeys, isUnionSchema } from "../unions.js";
|
|
12
12
|
export const MAX_RELATIONSHIP_DEPTH = 1;
|
|
13
13
|
export const exceededRelationshipDepth = (depth = 0) => depth >= MAX_RELATIONSHIP_DEPTH;
|
|
14
14
|
class ShapeCache {
|
|
@@ -44,9 +44,18 @@ export const fieldTypeComparison = {
|
|
|
44
44
|
boolean: { comparators: ["eq"], type: "boolean" },
|
|
45
45
|
string: { comparators: ["eq", "in", "match", "regexp"], type: "string" },
|
|
46
46
|
date: { comparators: ["eq", "lt", "lte", "gt", "gte"], type: "string" },
|
|
47
|
-
number: {
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
number: {
|
|
48
|
+
comparators: ["eq", "lt", "lte", "gt", "gte", "in"],
|
|
49
|
+
type: "number"
|
|
50
|
+
},
|
|
51
|
+
integer: {
|
|
52
|
+
comparators: ["eq", "lt", "lte", "gt", "gte", "in"],
|
|
53
|
+
type: "integer"
|
|
54
|
+
},
|
|
55
|
+
workflow: {
|
|
56
|
+
comparators: ["eq", "lt", "lte", "gt", "gte", "in"],
|
|
57
|
+
type: "string"
|
|
58
|
+
},
|
|
50
59
|
draftjs: { comparators: ["match"], type: "string" },
|
|
51
60
|
mdx: { comparators: ["match"], type: "string" }
|
|
52
61
|
};
|
|
@@ -135,7 +144,7 @@ function truncateNames(names) {
|
|
|
135
144
|
*/
|
|
136
145
|
function getRelationshipShapeName(refs) {
|
|
137
146
|
return refs
|
|
138
|
-
.map(ref => {
|
|
147
|
+
.map((ref) => {
|
|
139
148
|
const shapeName = ref.split(":")[1];
|
|
140
149
|
return formatShapeName(shapeName);
|
|
141
150
|
})
|
|
@@ -149,7 +158,7 @@ function getTypeName(name, prop, shapeName, context) {
|
|
|
149
158
|
const { projectSchema, relationshipDepth, conflictingProperties } = context;
|
|
150
159
|
let type = getPropType(projectSchema, name, prop);
|
|
151
160
|
if (isId(name)) {
|
|
152
|
-
return
|
|
161
|
+
return "TSWhereID";
|
|
153
162
|
}
|
|
154
163
|
const relationship = getRelationship(prop);
|
|
155
164
|
if (relationship) {
|
|
@@ -162,7 +171,7 @@ function getTypeName(name, prop, shapeName, context) {
|
|
|
162
171
|
}
|
|
163
172
|
if (isUnionSchema(prop)) {
|
|
164
173
|
if (prop.oneOf.length > 1) {
|
|
165
|
-
const shapeNames = truncateNames(joinShapeNames(enumerateOneOfKeys(projectSchema, prop.oneOf).map(child => child.shapeName)));
|
|
174
|
+
const shapeNames = truncateNames(joinShapeNames(enumerateOneOfKeys(projectSchema, prop.oneOf).map((child) => child.shapeName)));
|
|
166
175
|
return `TSWhere${shapeNames}Union`;
|
|
167
176
|
}
|
|
168
177
|
type = "object";
|
|
@@ -254,7 +263,7 @@ export function getPropertyComparisonType(name, prop, shapeName, context) {
|
|
|
254
263
|
});
|
|
255
264
|
}
|
|
256
265
|
else if (isUnionSchema(propOrItems)) {
|
|
257
|
-
const shapes = enumerateOneOfKeys(projectSchema, propOrItems.oneOf).map(option => projectSchema.shapes[option.shapeName]);
|
|
266
|
+
const shapes = enumerateOneOfKeys(projectSchema, propOrItems.oneOf).map((option) => projectSchema.shapes[option.shapeName]);
|
|
258
267
|
props = getFields(typeName, shapes, {
|
|
259
268
|
...context,
|
|
260
269
|
booleanOperators: false
|
|
@@ -347,7 +356,7 @@ function getReferencedShape(context) {
|
|
|
347
356
|
* Expand union shapes
|
|
348
357
|
*/
|
|
349
358
|
function expandUnionShapes(projectSchema, shapes) {
|
|
350
|
-
return uniqBy(shapes.flatMap(shape => isUnionSchema(shape.schema) ? shape.schema.oneOf.map(getReferencedShape(projectSchema)).filter(isDefined) : shape), "name");
|
|
359
|
+
return uniqBy(shapes.flatMap((shape) => isUnionSchema(shape.schema) ? shape.schema.oneOf.map(getReferencedShape(projectSchema)).filter(isDefined) : shape), "name");
|
|
351
360
|
}
|
|
352
361
|
export function getWhereShape(projectSchema, selectedShapes) {
|
|
353
362
|
const shapeName = selectedShapes.length === 1 ? `TSWhere${pascalCase(selectedShapes[0].name)}Input` : "TSWhereInput";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isRecord } from "@takeshape/util";
|
|
2
|
+
import has from "lodash/has.js";
|
|
3
|
+
import isArray from "lodash/isArray.js";
|
|
2
4
|
import isPlainObject from "lodash/isPlainObject.js";
|
|
3
5
|
import isString from "lodash/isString.js";
|
|
4
|
-
import isArray from "lodash/isArray.js";
|
|
5
|
-
import has from "lodash/has.js";
|
|
6
6
|
import isUndefined from "lodash/isUndefined.js";
|
|
7
7
|
import { latestSchemaJson } from "../schemas/index.js";
|
|
8
8
|
import { ArgsType, RefType } from "./types.js";
|
|
@@ -57,7 +57,7 @@ export function containsResolver(resolver, predicate) {
|
|
|
57
57
|
if (isBasicResolver(resolver)) {
|
|
58
58
|
return predicate(resolver);
|
|
59
59
|
}
|
|
60
|
-
return Boolean(resolver.compose.find(resolver => containsResolver(resolver, predicate)));
|
|
60
|
+
return Boolean(resolver.compose.find((resolver) => containsResolver(resolver, predicate)));
|
|
61
61
|
}
|
|
62
62
|
/** Directive Mapping Utils **/
|
|
63
63
|
/**
|
package/dist/esm/src/unions.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { BadDataError } from "@takeshape/errors";
|
|
1
2
|
import { camelCase, isRecord } from "@takeshape/util";
|
|
2
3
|
import omit from "lodash/omit.js";
|
|
3
|
-
import { BadDataError } from "@takeshape/errors";
|
|
4
4
|
import { getRef, refItemToNamespacedShapeName } from "./refs.js";
|
|
5
|
+
import { getOutputShapeName } from "./template-shapes/names.js";
|
|
5
6
|
import { isRefSchema } from "./types/utils.js";
|
|
6
7
|
import { getShapeById } from "./util/shapes.js";
|
|
7
|
-
import { getOutputShapeName } from "./template-shapes/names.js";
|
|
8
8
|
export function enumerateOneOfKeys(projectSchema, oneOf) {
|
|
9
9
|
const result = [];
|
|
10
10
|
for (const child of oneOf) {
|
|
@@ -41,15 +41,14 @@ export function oneOfToObject(projectSchema, schema) {
|
|
|
41
41
|
return { ...omit(schema, "oneOf"), type: "object", properties };
|
|
42
42
|
}
|
|
43
43
|
function formatKeys(keys) {
|
|
44
|
-
return keys.map(k => `"${k}"`).join(", ");
|
|
44
|
+
return keys.map((k) => `"${k}"`).join(", ");
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
export const createUnwrapTransform = projectSchema => (obj, schema, name, shape, next) => {
|
|
46
|
+
export const createUnwrapTransform = (projectSchema) => (obj, schema, name, shape, next) => {
|
|
48
47
|
if (isRecord(obj)) {
|
|
49
48
|
const oneOfKeys = enumerateOneOfKeys(projectSchema, getOneOf(schema));
|
|
50
49
|
const objectKeys = Object.keys(obj);
|
|
51
50
|
if (objectKeys.length !== 1) {
|
|
52
|
-
const propNames = oneOfKeys.map(k => k.propName);
|
|
51
|
+
const propNames = oneOfKeys.map((k) => k.propName);
|
|
53
52
|
throw new BadDataError(`Object should only specify one of the following keys: ${formatKeys(propNames)}, but found keys: ${formatKeys(objectKeys)}`);
|
|
54
53
|
}
|
|
55
54
|
for (const { propName, shapeId, propSchema } of oneOfKeys) {
|
|
@@ -66,8 +65,7 @@ export const createUnwrapTransform = projectSchema => (obj, schema, name, shape,
|
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
67
|
};
|
|
69
|
-
|
|
70
|
-
export const createWrapTransform = projectSchema => (obj, schema, name, shape, next) => {
|
|
68
|
+
export const createWrapTransform = (projectSchema) => (obj, schema, name, shape, next) => {
|
|
71
69
|
if (isRecord(obj) && typeof obj._shapeId === "string") {
|
|
72
70
|
const shape = getShapeById(projectSchema, obj._shapeId);
|
|
73
71
|
if (shape) {
|