@takeshape/schema 11.45.5 → 11.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/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 +18 -16
- 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 +15 -13
- 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
package/dist/esm/src/enum.js
CHANGED
|
@@ -3,7 +3,7 @@ export function isEnumLikeSchema(schema) {
|
|
|
3
3
|
return true;
|
|
4
4
|
}
|
|
5
5
|
if (schema.oneOf) {
|
|
6
|
-
return schema.oneOf.every(optionSchema => optionSchema.title !== undefined && (optionSchema.enum ?? optionSchema.const));
|
|
6
|
+
return schema.oneOf.every((optionSchema) => optionSchema.title !== undefined && (optionSchema.enum ?? optionSchema.const));
|
|
7
7
|
}
|
|
8
8
|
return false;
|
|
9
9
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import set from "lodash/set.js";
|
|
2
1
|
import { deepClone } from "@takeshape/util";
|
|
3
|
-
import
|
|
4
|
-
import { getAllRefs } from "./schema-util.js";
|
|
2
|
+
import set from "lodash/set.js";
|
|
5
3
|
import { refItemToNamespacedShapeName } from "./refs.js";
|
|
4
|
+
import { getAllRefs } from "./schema-util.js";
|
|
5
|
+
import { isValidTemplate, resolveTemplate } from "./template-shapes/index.js";
|
|
6
6
|
export function flattenTemplates(projectSchema) {
|
|
7
|
-
const templateRefs = getAllRefs(projectSchema, ref => Boolean(ref.template));
|
|
7
|
+
const templateRefs = getAllRefs(projectSchema, (ref) => Boolean(ref.template));
|
|
8
8
|
if (!templateRefs.length) {
|
|
9
9
|
return projectSchema;
|
|
10
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getType } from "./content-schema-transform.js";
|
|
2
|
-
import { getStorageKey, isBuiltinType } from "./schema-util.js";
|
|
3
2
|
import { followRef, getRefShapeName } from "./refs.js";
|
|
3
|
+
import { getStorageKey, isBuiltinType } from "./schema-util.js";
|
|
4
4
|
import { isPropertySchemaWithRelationship } from "./types/index.js";
|
|
5
5
|
const scalarTags = new Set(["draftjs"]);
|
|
6
6
|
function isLeafTypeV3(projectSchema, propertySchema) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import mapValues from "lodash/mapValues.js";
|
|
2
1
|
import { isDefined } from "@takeshape/util";
|
|
3
|
-
import
|
|
2
|
+
import mapValues from "lodash/mapValues.js";
|
|
3
|
+
import { getRef, normalizeRefExpression, refExpressionToRefItem, refItemToNamespacedShapeName, refItemToShape, shapeToRefItem } from "./refs.js";
|
|
4
4
|
import { isUnionSchema } from "./unions.js";
|
|
5
5
|
export function isInterfaceShape(shape) {
|
|
6
6
|
return shape?.type === "interface";
|
|
@@ -27,16 +27,16 @@ function getImplementationsHelper(shapeMap, mapFn) {
|
|
|
27
27
|
return result;
|
|
28
28
|
}
|
|
29
29
|
export function getImplementationShapeMap(shapeMap) {
|
|
30
|
-
return getImplementationsHelper(shapeMap, x => x);
|
|
30
|
+
return getImplementationsHelper(shapeMap, (x) => x);
|
|
31
31
|
}
|
|
32
32
|
export function getImplementationShapeNameMap(shapeMap) {
|
|
33
|
-
return getImplementationsHelper(shapeMap, shape => shape.name);
|
|
33
|
+
return getImplementationsHelper(shapeMap, (shape) => shape.name);
|
|
34
34
|
}
|
|
35
35
|
export function pruneUnusedInterfaces(projectSchema, shapeMap) {
|
|
36
|
-
return mapValues(shapeMap, shape => {
|
|
36
|
+
return mapValues(shapeMap, (shape) => {
|
|
37
37
|
const { interfaces } = shape;
|
|
38
38
|
if (interfaces?.length) {
|
|
39
|
-
const filteredInterfaces = interfaces.filter(refExpression => shapeMap[refItemToNamespacedShapeName(refExpressionToRefItem(projectSchema, refExpression))]);
|
|
39
|
+
const filteredInterfaces = interfaces.filter((refExpression) => shapeMap[refItemToNamespacedShapeName(refExpressionToRefItem(projectSchema, refExpression))]);
|
|
40
40
|
if (interfaces.length !== filteredInterfaces.length) {
|
|
41
41
|
return { ...shape, interfaces: filteredInterfaces };
|
|
42
42
|
}
|
|
@@ -51,7 +51,7 @@ export function getImplementingShapes(context, interfaceRef) {
|
|
|
51
51
|
const shapeMap = context.shapes;
|
|
52
52
|
const implementingShapes = [];
|
|
53
53
|
for (const shape of Object.values(shapeMap)) {
|
|
54
|
-
if (shape.interfaces?.find(interfaceRefExpression => compareRefItems(refExpressionToRefItem(context, interfaceRefExpression), interfaceRef))) {
|
|
54
|
+
if (shape.interfaces?.find((interfaceRefExpression) => compareRefItems(refExpressionToRefItem(context, interfaceRefExpression), interfaceRef))) {
|
|
55
55
|
implementingShapes.push(shape);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -60,17 +60,19 @@ export function getImplementingShapes(context, interfaceRef) {
|
|
|
60
60
|
export function interfaceToUnion(context, interfaceRef) {
|
|
61
61
|
const shapes = getImplementingShapes(context, interfaceRef);
|
|
62
62
|
return {
|
|
63
|
-
oneOf: shapes.map(shape => ({
|
|
63
|
+
oneOf: shapes.map((shape) => ({
|
|
64
|
+
"@ref": normalizeRefExpression(context, shape.name)
|
|
65
|
+
}))
|
|
64
66
|
};
|
|
65
67
|
}
|
|
66
68
|
export function getPossibleShapeNames(projectSchema, shape) {
|
|
67
69
|
let names;
|
|
68
70
|
if (isInterfaceShape(shape)) {
|
|
69
|
-
names = getImplementingShapes(projectSchema, shapeToRefItem(projectSchema, shape)).map(shape => shape.name);
|
|
71
|
+
names = getImplementingShapes(projectSchema, shapeToRefItem(projectSchema, shape)).map((shape) => shape.name);
|
|
70
72
|
}
|
|
71
73
|
else if (isUnionSchema(shape.schema)) {
|
|
72
74
|
names = shape.schema.oneOf
|
|
73
|
-
.map(member => {
|
|
75
|
+
.map((member) => {
|
|
74
76
|
const ref = getRef(projectSchema, member);
|
|
75
77
|
return ref && refItemToNamespacedShapeName(ref);
|
|
76
78
|
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import minimatch from "minimatch";
|
|
2
1
|
import { deepClone, isDefined, isRecord } from "@takeshape/util";
|
|
3
|
-
import uniq from "lodash/uniq.js";
|
|
4
2
|
import set from "lodash/set.js";
|
|
3
|
+
import uniq from "lodash/uniq.js";
|
|
4
|
+
import minimatch from "minimatch";
|
|
5
5
|
import { parseTemplateShape } from "../refs.js";
|
|
6
|
-
import { getArgsReferenceWithPath, getRefOrItemsRef,
|
|
6
|
+
import { dereferenceSchema, getArgsReferenceWithPath, getRefOrItemsRef, parseReturnShape, refItemToString, splitAtRef } from "./refs.js";
|
|
7
7
|
import { isAllOfSchema, isObjectSchema, isOneOfSchema, isRefSchema } from "./type-utils.js";
|
|
8
8
|
import { visitSchemaProperties } from "./visitor.js";
|
|
9
9
|
const layerDefaults = {
|
|
@@ -159,7 +159,7 @@ export function collectReferencedShapeNames(layerId, refSet) {
|
|
|
159
159
|
return collect;
|
|
160
160
|
}
|
|
161
161
|
function collectServiceRefs(flattenedSchema, getLayer) {
|
|
162
|
-
const refs = new Set(getAllRefs(flattenedSchema, refItem => refItem.layerId !== "local").map(refItemToString));
|
|
162
|
+
const refs = new Set(getAllRefs(flattenedSchema, (refItem) => refItem.layerId !== "local").map(refItemToString));
|
|
163
163
|
if (refs.size) {
|
|
164
164
|
for (const ref of refs) {
|
|
165
165
|
const [layerId, shapeName] = splitAtRef(ref);
|
|
@@ -178,7 +178,13 @@ function ensureServiceLayer(flattenedSchema, layerId) {
|
|
|
178
178
|
flattenedSchema.serviceLayers ||= {};
|
|
179
179
|
let serviceLayer = flattenedSchema.serviceLayers[layerId];
|
|
180
180
|
if (!serviceLayer) {
|
|
181
|
-
serviceLayer = {
|
|
181
|
+
serviceLayer = {
|
|
182
|
+
layerId,
|
|
183
|
+
schemaVersion: "4.0.0",
|
|
184
|
+
shapes: {},
|
|
185
|
+
queries: {},
|
|
186
|
+
mutations: {}
|
|
187
|
+
};
|
|
182
188
|
flattenedSchema.serviceLayers[layerId] = serviceLayer;
|
|
183
189
|
}
|
|
184
190
|
return serviceLayer;
|
|
@@ -240,7 +246,7 @@ export function flattenSchema(projectSchema, getLayer) {
|
|
|
240
246
|
};
|
|
241
247
|
const filteredLayers = layers
|
|
242
248
|
.reverse()
|
|
243
|
-
.map(layer => {
|
|
249
|
+
.map((layer) => {
|
|
244
250
|
const config = typeof layer === "string" ? { ...layerDefaults, id: layer } : layer;
|
|
245
251
|
const layerSchema = getLayer(config.id);
|
|
246
252
|
if (!layerSchema) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { mergeWithArrayConcat } from "@takeshape/util";
|
|
1
2
|
import assign from "lodash/fp/assign.js";
|
|
2
3
|
import omit from "lodash/fp/omit.js";
|
|
3
|
-
import { mergeWithArrayConcat } from "@takeshape/util";
|
|
4
4
|
import isEmpty from "lodash/isEmpty.js";
|
|
5
5
|
import { parseTemplateShape } from "../refs.js";
|
|
6
6
|
import { isAllOfSchema, isOneOfSchema, isRefSchema } from "./type-utils.js";
|
|
@@ -150,10 +150,10 @@ export function hasResolvableRef(shapes, contentSchema) {
|
|
|
150
150
|
return Boolean(refItemToShape(shapes, getRef(contentSchema)));
|
|
151
151
|
}
|
|
152
152
|
if (isAllOfSchema(contentSchema)) {
|
|
153
|
-
return Boolean(contentSchema.allOf.find(s => hasResolvableRef(shapes, s)));
|
|
153
|
+
return Boolean(contentSchema.allOf.find((s) => hasResolvableRef(shapes, s)));
|
|
154
154
|
}
|
|
155
155
|
if (isOneOfSchema(contentSchema)) {
|
|
156
|
-
return Boolean(contentSchema.oneOf.find(s => hasResolvableRef(shapes, s)));
|
|
156
|
+
return Boolean(contentSchema.oneOf.find((s) => hasResolvableRef(shapes, s)));
|
|
157
157
|
}
|
|
158
158
|
return false;
|
|
159
159
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isRecord } from "@takeshape/util";
|
|
2
|
+
import isArray from "lodash/isArray.js";
|
|
2
3
|
import isPlainObject from "lodash/isPlainObject.js";
|
|
3
4
|
import isString from "lodash/isString.js";
|
|
4
|
-
import isArray from "lodash/isArray.js";
|
|
5
5
|
import { latestSchemaJson } from "../schemas/index.js";
|
|
6
6
|
/** Resolver Type Utils **/
|
|
7
7
|
/**
|
|
@@ -56,6 +56,7 @@ import migrateToV3_47_0 from "./to/v3.47.0.js";
|
|
|
56
56
|
import migrateToV3_48_0 from "./to/v3.48.0.js";
|
|
57
57
|
import migrateToV3_49_0 from "./to/v3.49.0.js";
|
|
58
58
|
import migrateToV3_50_0 from "./to/v3.50.0.js";
|
|
59
|
+
import migrateToV3_51_0 from "./to/v3.51.0.js";
|
|
59
60
|
export const migrateTo = {
|
|
60
61
|
"v3.0.0": migrateToV3_0_0,
|
|
61
62
|
"v3.1.0": migrateToV3_1_0,
|
|
@@ -114,7 +115,8 @@ export const migrateTo = {
|
|
|
114
115
|
"v3.47.0": migrateToV3_47_0,
|
|
115
116
|
"v3.48.0": migrateToV3_48_0,
|
|
116
117
|
"v3.49.0": migrateToV3_49_0,
|
|
117
|
-
"v3.50.0": migrateToV3_50_0
|
|
118
|
+
"v3.50.0": migrateToV3_50_0,
|
|
119
|
+
"v3.51.0": migrateToV3_51_0
|
|
118
120
|
};
|
|
119
121
|
export * from "./utils.js";
|
|
120
122
|
export const listTypePrefix = "PaginatedList";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { deepClone, pascalCase } from "@takeshape/util";
|
|
1
2
|
import forEach from "lodash/forEach.js";
|
|
2
3
|
import pick from "lodash/pick.js";
|
|
3
|
-
import { pascalCase, deepClone } from "@takeshape/util";
|
|
4
4
|
import { arraySchemaKeys, getShapeQueriesAndMutations, multipleRelationshipSchemaKeys, objectSchemaKeys, scalarSchemaKeys, schemaMetadataKeys } from "../../schema-util.js";
|
|
5
5
|
import { formatDate } from "../utils.js";
|
|
6
6
|
const annotationMap = {
|
|
@@ -37,7 +37,6 @@ function getRelationshipSchema(relationship) {
|
|
|
37
37
|
"@relationship": relationship
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
// eslint-disable-next-line complexity
|
|
41
40
|
function migrateToContentSchemaV3(params) {
|
|
42
41
|
const { schema, service, name, key, setSource, omitAllSources } = params;
|
|
43
42
|
const { type } = schema;
|
|
@@ -46,12 +45,13 @@ function migrateToContentSchemaV3(params) {
|
|
|
46
45
|
if (annotationMap[key]) {
|
|
47
46
|
const newAnnotation = annotationMap[key];
|
|
48
47
|
schema[newAnnotation] = value;
|
|
49
|
-
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
50
48
|
delete schema[key];
|
|
51
49
|
}
|
|
52
50
|
});
|
|
53
51
|
if (type === "string" || type === "boolean" || type === "number" || type === "integer") {
|
|
54
|
-
return {
|
|
52
|
+
return {
|
|
53
|
+
schema: { ...pick(schema, scalarSchemaKeys), "@mapping": mapping }
|
|
54
|
+
};
|
|
55
55
|
}
|
|
56
56
|
const { relationship } = schema;
|
|
57
57
|
if (relationship) {
|
|
@@ -69,10 +69,22 @@ function migrateToContentSchemaV3(params) {
|
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
if (type === "object" && schema.draftjs) {
|
|
72
|
-
return {
|
|
72
|
+
return {
|
|
73
|
+
schema: {
|
|
74
|
+
...pick(schema, scalarSchemaKeys),
|
|
75
|
+
"@mapping": mapping,
|
|
76
|
+
"@tag": "draftjs"
|
|
77
|
+
}
|
|
78
|
+
};
|
|
73
79
|
}
|
|
74
80
|
if (isColor(schema)) {
|
|
75
|
-
return {
|
|
81
|
+
return {
|
|
82
|
+
schema: {
|
|
83
|
+
...pick(schema, scalarSchemaKeys),
|
|
84
|
+
$ref: "#/shapes/TSColor/schema",
|
|
85
|
+
"@mapping": mapping
|
|
86
|
+
}
|
|
87
|
+
};
|
|
76
88
|
}
|
|
77
89
|
if (type === "object" && schema.properties) {
|
|
78
90
|
const properties = {};
|
|
@@ -179,11 +191,11 @@ const migrate = async (_, projectSchema) => {
|
|
|
179
191
|
const { contentTypes, created, updated, ...rest } = projectSchema;
|
|
180
192
|
const shapes = {};
|
|
181
193
|
const forms = {};
|
|
182
|
-
Object.keys(contentTypes)
|
|
194
|
+
for (const contentTypeId of Object.keys(contentTypes)) {
|
|
183
195
|
const contentType = contentTypes[contentTypeId];
|
|
184
196
|
Object.assign(shapes, contentTypeToShape(contentType, contentTypeId));
|
|
185
197
|
forms[pascalCase(contentType.name)] = contentType.forms;
|
|
186
|
-
}
|
|
198
|
+
}
|
|
187
199
|
// Use deepClone to drop undefined values, this improves compatibility with validation and testing
|
|
188
200
|
// Schemas are typically saved in Dynamo or JSON files which also remove undefined values
|
|
189
201
|
// Dropping them here is done for consistency's sake
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { deepClone, pascalCase } from "@takeshape/util";
|
|
2
2
|
import isObject from "lodash/isObject.js";
|
|
3
3
|
import isString from "lodash/isString.js";
|
|
4
4
|
import isUndefined from "lodash/isUndefined.js";
|
|
5
|
-
import
|
|
5
|
+
import pReduce from "p-reduce";
|
|
6
6
|
import { isAnyServiceConfig } from "../../types/utils.js";
|
|
7
7
|
/**
|
|
8
8
|
* `graphql:my-key` `my-key`
|
|
9
9
|
*/
|
|
10
10
|
function parseV3ServiceStr(service) {
|
|
11
11
|
const parts = service.split(":");
|
|
12
|
-
return {
|
|
12
|
+
return {
|
|
13
|
+
provider: parts.length > 1 ? parts[0] : undefined,
|
|
14
|
+
id: parts.length > 1 ? parts[1] : parts[0]
|
|
15
|
+
};
|
|
13
16
|
}
|
|
14
17
|
/**
|
|
15
18
|
* Ensures a consistent service config, inluding updating the service
|
|
16
19
|
* authentication object.
|
|
17
20
|
*/
|
|
18
|
-
// eslint-disable-next-line complexity
|
|
19
21
|
function updateServiceConfigV3ToV3_1(serviceConfig, serviceKey) {
|
|
20
22
|
if (isAnyServiceConfig(serviceConfig)) {
|
|
21
23
|
if (isString(serviceConfig.authentication) || isUndefined(serviceConfig.authentication)) {
|
|
@@ -6,7 +6,7 @@ const migrate = async (_, projectSchema) => {
|
|
|
6
6
|
parent['@backreference'] = { enabled: true };
|
|
7
7
|
if (relationship.relatedName) {
|
|
8
8
|
parent['@backreference'].name = relationship.relatedName;
|
|
9
|
-
|
|
9
|
+
relationship.relatedName = undefined;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { visit } from '@takeshape/util';
|
|
2
2
|
import get from 'lodash/get.js';
|
|
3
|
-
import set from 'lodash/set.js';
|
|
4
3
|
import omit from 'lodash/omit.js';
|
|
4
|
+
import set from 'lodash/set.js';
|
|
5
5
|
const migrate = async (_, projectSchema) => {
|
|
6
6
|
visit(projectSchema, ['@user'], (_, path) => {
|
|
7
7
|
const parentPath = path.slice(0, -1);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { isDefined, visit } from '@takeshape/util';
|
|
2
2
|
import get from 'lodash/get.js';
|
|
3
|
-
import set from 'lodash/set.js';
|
|
4
3
|
import omit from 'lodash/omit.js';
|
|
4
|
+
import set from 'lodash/set.js';
|
|
5
5
|
const migrate = async (_, projectSchema) => {
|
|
6
6
|
visit(projectSchema, ['@relationship'], (relationship, path) => {
|
|
7
7
|
const propertyPath = path.slice(0, -1);
|
|
8
8
|
const originalPropertySchema = get(projectSchema, propertyPath);
|
|
9
9
|
const propertySchema = omit(originalPropertySchema, ['@relationship', 'type', '$ref']);
|
|
10
|
-
const shapeIdMap = new Map(Object.values(projectSchema.shapes).map(shape => [shape.id, shape]));
|
|
10
|
+
const shapeIdMap = new Map(Object.values(projectSchema.shapes).map((shape) => [shape.id, shape]));
|
|
11
11
|
const shapeIdsToShapeRefs = (shapeIds) => {
|
|
12
12
|
return shapeIds
|
|
13
|
-
.map(shapeId => {
|
|
13
|
+
.map((shapeId) => {
|
|
14
14
|
let shape;
|
|
15
15
|
if (shapeId === 'ASSET') {
|
|
16
16
|
shape = { name: 'Asset' };
|
|
@@ -40,7 +40,7 @@ const migrate = async (_, projectSchema) => {
|
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
|
-
|
|
43
|
+
propertySchema.type = undefined;
|
|
44
44
|
Object.assign(propertySchema, shapeRefsSchema);
|
|
45
45
|
propertySchema['@input'] = {
|
|
46
46
|
'@ref': 'local:TSRelationship'
|
|
@@ -3,7 +3,7 @@ function updateGenericServices(projectSchema) {
|
|
|
3
3
|
if (projectSchema.services) {
|
|
4
4
|
return {
|
|
5
5
|
...projectSchema,
|
|
6
|
-
services: mapValues(projectSchema.services, serviceConfig =>
|
|
6
|
+
services: mapValues(projectSchema.services, (serviceConfig) =>
|
|
7
7
|
// generic provider has been renamed to match service type
|
|
8
8
|
serviceConfig.provider === 'generic' ? { ...serviceConfig, provider: serviceConfig.serviceType } : serviceConfig)
|
|
9
9
|
};
|
|
@@ -3,10 +3,13 @@ function updateGenericServices(projectSchema) {
|
|
|
3
3
|
if (projectSchema.services) {
|
|
4
4
|
return {
|
|
5
5
|
...projectSchema,
|
|
6
|
-
services: mapValues(projectSchema.services, serviceConfig =>
|
|
6
|
+
services: mapValues(projectSchema.services, (serviceConfig) =>
|
|
7
7
|
// generic provider has been renamed to match service type
|
|
8
8
|
serviceConfig.provider === 'shopify'
|
|
9
|
-
? {
|
|
9
|
+
? {
|
|
10
|
+
...serviceConfig,
|
|
11
|
+
options: { ...serviceConfig.options, legacyApp: true }
|
|
12
|
+
}
|
|
10
13
|
: serviceConfig)
|
|
11
14
|
};
|
|
12
15
|
}
|
|
@@ -16,7 +16,7 @@ const migrate = async (_, projectSchema) => {
|
|
|
16
16
|
ignoreFields,
|
|
17
17
|
maxDepth: objectDepthLimit
|
|
18
18
|
},
|
|
19
|
-
queries: mapValues(indexedShape.queries, config => config && omit(config, ['ignoreFields', 'objectDepthLimit']))
|
|
19
|
+
queries: mapValues(indexedShape.queries, (config) => config && omit(config, ['ignoreFields', 'objectDepthLimit']))
|
|
20
20
|
};
|
|
21
21
|
});
|
|
22
22
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { visit } from '@takeshape/util';
|
|
2
|
-
import set from 'lodash/set.js';
|
|
3
|
-
import last from 'lodash/last.js';
|
|
4
2
|
import isString from 'lodash/isString.js';
|
|
3
|
+
import last from 'lodash/last.js';
|
|
4
|
+
import set from 'lodash/set.js';
|
|
5
5
|
import unset from 'lodash/unset.js';
|
|
6
6
|
const TAKESHAPE_RESOLVERS = ['takeshape:getUser', 'takeshape:search', 'takeshape:queryApiIndex', 'util:wrap'];
|
|
7
7
|
function getServicePath(path) {
|
|
@@ -34,7 +34,9 @@ const migrate = async (_, projectSchema) => {
|
|
|
34
34
|
name,
|
|
35
35
|
id: name,
|
|
36
36
|
title: name,
|
|
37
|
-
schema: {
|
|
37
|
+
schema: {
|
|
38
|
+
extends: [{ "@ref": normalizeRefExpression(projectSchema, name) }]
|
|
39
|
+
}
|
|
38
40
|
};
|
|
39
41
|
const loaders = queriesToLoaders(config.queries);
|
|
40
42
|
if (loaders) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { deepClone } from "@takeshape/util";
|
|
2
|
-
import upperFirst from "lodash/upperFirst.js";
|
|
3
2
|
import set from "lodash/fp/set.js";
|
|
4
3
|
import unset from "lodash/fp/unset.js";
|
|
4
|
+
import upperFirst from "lodash/upperFirst.js";
|
|
5
|
+
import { SERVICE_OBJECT_PATTERN_NAME } from "../../constants.js";
|
|
5
6
|
import { getRefOrItemsRef } from "../../refs.js";
|
|
6
7
|
import { createSchemaPropertyAccessor } from "../../schema-util.js";
|
|
7
8
|
import { CURRENT_SCHEMA_VERSION } from "../../schemas/index.js";
|
|
8
9
|
import { getServiceObjectFields } from "../../services/services.js";
|
|
9
|
-
import { SERVICE_OBJECT_PATTERN_NAME } from "../../constants.js";
|
|
10
10
|
// Inline utilities for posterity
|
|
11
11
|
function refItemToShapeName(refItem) {
|
|
12
12
|
const { serviceNamespace, typeName } = refItem;
|
|
@@ -23,8 +23,8 @@ export function normalizeForms(projectSchema) {
|
|
|
23
23
|
const storeSourceForm = (shapeName, formConfig, propName) => {
|
|
24
24
|
normalizedForms[shapeName] ||= { default: deepClone(formConfig) };
|
|
25
25
|
const propConfig = normalizedForms[shapeName].default.properties[propName];
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
propConfig.properties = undefined;
|
|
27
|
+
propConfig.order = undefined;
|
|
28
28
|
propConfig.widget = widgetMigrations[propConfig.widget] ?? propConfig.widget;
|
|
29
29
|
};
|
|
30
30
|
const normalizeNested = (shapeName, formConfig) => {
|
|
@@ -81,7 +81,6 @@ export function migrateInterfaceShapes(projectSchema) {
|
|
|
81
81
|
continue;
|
|
82
82
|
}
|
|
83
83
|
for (const template of ["CreateArgs", "UpdateArgs"]) {
|
|
84
|
-
// eslint-disable-next-line max-depth
|
|
85
84
|
if (mutation.args === `${template}<${interfaceShapeName}>`) {
|
|
86
85
|
updatedProjectSchema = set(["mutations", mutationName], { ...mutation, args: `${template}<${serviceShapeName}>` }, updatedProjectSchema);
|
|
87
86
|
}
|
|
@@ -101,15 +100,13 @@ const migrate = async (_, projectSchema) => {
|
|
|
101
100
|
}
|
|
102
101
|
catch (e) {
|
|
103
102
|
// TODO remove console.log when a formal warning mechanism is added https://app.shortcut.com/takeshape/story/11533/return-warnings-from-schema-migration
|
|
104
|
-
|
|
105
|
-
console.log(`v3.34.0 migration warning: Failed to normalize forms`, e.message);
|
|
103
|
+
console.info("v3.34.0 migration warning: Failed to normalize forms", e.message);
|
|
106
104
|
}
|
|
107
105
|
try {
|
|
108
106
|
normalized = migrateInterfaceShapes(normalized);
|
|
109
107
|
}
|
|
110
108
|
catch (e) {
|
|
111
|
-
|
|
112
|
-
console.log(`v3.34.0 migration warning: Failed to migrate interface shapes`, e.message);
|
|
109
|
+
console.info("v3.34.0 migration warning: Failed to migrate interface shapes", e.message);
|
|
113
110
|
}
|
|
114
111
|
return {
|
|
115
112
|
...normalized,
|
|
@@ -4,7 +4,7 @@ const migrate = async (_, projectSchema) => {
|
|
|
4
4
|
...projectSchema,
|
|
5
5
|
schemaVersion: '3.36.0'
|
|
6
6
|
};
|
|
7
|
-
result.services &&= mapValues(result.services, config => {
|
|
7
|
+
result.services &&= mapValues(result.services, (config) => {
|
|
8
8
|
// Add transformVersion to OpenAPI services so we can preserve the legacy behavior
|
|
9
9
|
if (config.serviceType === 'openapi') {
|
|
10
10
|
return {
|
|
@@ -3,12 +3,12 @@ const migrate = async ({ decryptFn, encryptFn }, projectSchema) => {
|
|
|
3
3
|
/**
|
|
4
4
|
* Move unencrypted searchParams out of the authentication object.
|
|
5
5
|
*/
|
|
6
|
-
Object.values(projectSchema.services ?? {})
|
|
6
|
+
for (const serviceConfig of Object.values(projectSchema.services ?? {})) {
|
|
7
7
|
if (serviceConfig.authentication) {
|
|
8
8
|
const authentication = decryptFn(serviceConfig.authentication);
|
|
9
9
|
if (isServiceAuthentication(authentication) && isSearchParamsAuthentication(authentication)) {
|
|
10
10
|
if (serviceConfig.provider === "judgeMe") {
|
|
11
|
-
const shopDomain = authentication.params.find(param => param.name === "shop_domain");
|
|
11
|
+
const shopDomain = authentication.params.find((param) => param.name === "shop_domain");
|
|
12
12
|
if (shopDomain) {
|
|
13
13
|
serviceConfig.options = {
|
|
14
14
|
...serviceConfig.options,
|
|
@@ -16,12 +16,12 @@ const migrate = async ({ decryptFn, encryptFn }, projectSchema) => {
|
|
|
16
16
|
shop_domain: shopDomain.value
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
serviceConfig.options.shopDomain = undefined;
|
|
20
20
|
}
|
|
21
|
-
authentication.params = authentication.params.filter(param => param.name !== "shop_domain");
|
|
21
|
+
authentication.params = authentication.params.filter((param) => param.name !== "shop_domain");
|
|
22
22
|
}
|
|
23
23
|
if (serviceConfig.provider === "reviewsIo") {
|
|
24
|
-
const storeId = authentication.params.find(param => param.name === "store");
|
|
24
|
+
const storeId = authentication.params.find((param) => param.name === "store");
|
|
25
25
|
if (storeId) {
|
|
26
26
|
serviceConfig.options = {
|
|
27
27
|
...serviceConfig.options,
|
|
@@ -29,14 +29,14 @@ const migrate = async ({ decryptFn, encryptFn }, projectSchema) => {
|
|
|
29
29
|
store: storeId.value
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
serviceConfig.options.storeId = undefined;
|
|
33
33
|
}
|
|
34
|
-
authentication.params = authentication.params.filter(param => param.name !== "store");
|
|
34
|
+
authentication.params = authentication.params.filter((param) => param.name !== "store");
|
|
35
35
|
}
|
|
36
36
|
serviceConfig.authentication = encryptFn(authentication);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
}
|
|
39
|
+
}
|
|
40
40
|
return {
|
|
41
41
|
...projectSchema,
|
|
42
42
|
schemaVersion: "3.39.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import mapValues from 'lodash/mapValues.js';
|
|
2
2
|
const migrate = async (_, projectSchema) => {
|
|
3
|
-
const newShapes = mapValues(projectSchema.shapes, shape => {
|
|
3
|
+
const newShapes = mapValues(projectSchema.shapes, (shape) => {
|
|
4
4
|
// Set includeDeprecated to true for shapes to preserve behavior when indexing shapes by maxDepth
|
|
5
5
|
if (shape.cache?.fragment?.maxDepth !== undefined) {
|
|
6
6
|
const newShape = {
|
|
@@ -19,7 +19,7 @@ const migrate = async (_, projectSchema) => {
|
|
|
19
19
|
/**
|
|
20
20
|
* Function will visit each resolver in the schema and mutate them.
|
|
21
21
|
*/
|
|
22
|
-
visit(projectSchema, ['resolver', '@resolver'], maybeResolver => {
|
|
22
|
+
visit(projectSchema, ['resolver', '@resolver'], (maybeResolver) => {
|
|
23
23
|
if (isComposeResolver(maybeResolver)) {
|
|
24
24
|
maybeResolver.compose.forEach(renameResolver);
|
|
25
25
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { visit } from '@takeshape/util';
|
|
2
|
-
import omit from 'lodash/omit.js';
|
|
3
2
|
import isEmpty from 'lodash/isEmpty.js';
|
|
3
|
+
import omit from 'lodash/omit.js';
|
|
4
4
|
function omitOptions(resolver, names) {
|
|
5
5
|
if (resolver.options) {
|
|
6
6
|
const newOptions = omit(resolver.options, names);
|
|
7
7
|
if (isEmpty(newOptions)) {
|
|
8
|
-
|
|
8
|
+
resolver.options = undefined;
|
|
9
9
|
}
|
|
10
10
|
else {
|
|
11
11
|
resolver.options = newOptions;
|
|
@@ -63,7 +63,7 @@ const migrate = async (_, projectSchema) => {
|
|
|
63
63
|
/**
|
|
64
64
|
* Function will visit each resolver in the schema and mutate them.
|
|
65
65
|
*/
|
|
66
|
-
visit(projectSchema, ['resolver', '@resolver'], resolver => {
|
|
66
|
+
visit(projectSchema, ['resolver', '@resolver'], (resolver) => {
|
|
67
67
|
if (resolver.compose) {
|
|
68
68
|
resolver.compose.forEach(ensureResolverOptions);
|
|
69
69
|
}
|
package/dist/esm/src/mocks.js
CHANGED
|
@@ -2,9 +2,9 @@ import omit from "lodash/omit.js";
|
|
|
2
2
|
import { atRefToRefItem, getRef, normalizeRefExpression, refExpressionToRefItem, shapeToRefItem } from "../refs.js";
|
|
3
3
|
import { getAllRefs } from "../schema-util.js";
|
|
4
4
|
import { getShape, getShapeById } from "../util/shapes.js";
|
|
5
|
-
import { ShapeModel } from "./shape.js";
|
|
6
5
|
import { QueryModel } from "./query.js";
|
|
7
6
|
import { ServiceConfig } from "./service.js";
|
|
7
|
+
import { ShapeModel } from "./shape.js";
|
|
8
8
|
/**
|
|
9
9
|
* Model object representing a ProjectSchema.
|
|
10
10
|
* Intended to help make it easier to find the right utils
|
|
@@ -50,7 +50,7 @@ export class ProjectSchema {
|
|
|
50
50
|
return new ShapeModel(this, shapeRef);
|
|
51
51
|
}
|
|
52
52
|
get shapes() {
|
|
53
|
-
this._cache.shapes ??= Object.keys(this.json.shapes).map(name => new ShapeModel(this, normalizeRefExpression(this.json, name)));
|
|
53
|
+
this._cache.shapes ??= Object.keys(this.json.shapes).map((name) => new ShapeModel(this, normalizeRefExpression(this.json, name)));
|
|
54
54
|
return this._cache.shapes;
|
|
55
55
|
}
|
|
56
56
|
get refs() {
|
|
@@ -61,14 +61,14 @@ export class ProjectSchema {
|
|
|
61
61
|
return new QueryModel(this, "query", queryName);
|
|
62
62
|
}
|
|
63
63
|
get queries() {
|
|
64
|
-
this._cache.queries ??= Object.keys(this.json.queries).map(name => new QueryModel(this, "query", name));
|
|
64
|
+
this._cache.queries ??= Object.keys(this.json.queries).map((name) => new QueryModel(this, "query", name));
|
|
65
65
|
return this._cache.queries;
|
|
66
66
|
}
|
|
67
67
|
getMutationByName(mutationName) {
|
|
68
68
|
return new QueryModel(this, "mutation", mutationName);
|
|
69
69
|
}
|
|
70
70
|
get mutations() {
|
|
71
|
-
this._cache.mutations = Object.keys(this.json.mutations).map(name => new QueryModel(this, "mutation", name));
|
|
71
|
+
this._cache.mutations = Object.keys(this.json.mutations).map((name) => new QueryModel(this, "mutation", name));
|
|
72
72
|
return this._cache.mutations;
|
|
73
73
|
}
|
|
74
74
|
getServiceById(serviceId) {
|