@takeshape/schema 9.47.0 → 9.49.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/content-schema-transform.d.ts +6 -6
- package/dist/content-schema-transform.d.ts.map +1 -1
- package/dist/create-input-schema.d.ts +2 -2
- package/dist/create-input-schema.d.ts.map +1 -1
- package/dist/flatten-templates.d.ts +2 -2
- package/dist/flatten-templates.d.ts.map +1 -1
- package/dist/get-is-leaf.d.ts +2 -2
- package/dist/get-is-leaf.d.ts.map +1 -1
- package/dist/interfaces.d.ts +6 -6
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/layers/layers.d.ts +3 -3
- package/dist/layers/layers.d.ts.map +1 -1
- package/dist/layers/refs.d.ts +4 -4
- package/dist/layers/refs.d.ts.map +1 -1
- package/dist/migration/index.d.ts +43 -42
- package/dist/migration/index.d.ts.map +1 -1
- package/dist/migration/index.js +4 -1
- package/dist/migration/to/utils/v3.34.0-utils.d.ts +1 -0
- package/dist/migration/to/utils/v3.34.0-utils.d.ts.map +1 -0
- package/dist/migration/to/utils/v3.34.0-utils.js +1 -0
- package/dist/migration/to/v3.0.0.d.ts +2 -2
- package/dist/migration/to/v3.0.0.d.ts.map +1 -1
- package/dist/migration/to/v3.1.0.d.ts +2 -2
- package/dist/migration/to/v3.1.0.d.ts.map +1 -1
- package/dist/migration/to/v3.10.0.d.ts +2 -2
- package/dist/migration/to/v3.10.0.d.ts.map +1 -1
- package/dist/migration/to/v3.11.0.d.ts +2 -2
- package/dist/migration/to/v3.11.0.d.ts.map +1 -1
- package/dist/migration/to/v3.12.0.d.ts +2 -2
- package/dist/migration/to/v3.12.0.d.ts.map +1 -1
- package/dist/migration/to/v3.12.1.d.ts +2 -2
- package/dist/migration/to/v3.12.1.d.ts.map +1 -1
- package/dist/migration/to/v3.12.2.d.ts +2 -2
- package/dist/migration/to/v3.12.2.d.ts.map +1 -1
- package/dist/migration/to/v3.12.3.d.ts +2 -2
- package/dist/migration/to/v3.12.3.d.ts.map +1 -1
- package/dist/migration/to/v3.13.0.d.ts +2 -2
- package/dist/migration/to/v3.13.0.d.ts.map +1 -1
- package/dist/migration/to/v3.14.0.d.ts +2 -2
- package/dist/migration/to/v3.14.0.d.ts.map +1 -1
- package/dist/migration/to/v3.15.0.d.ts +2 -2
- package/dist/migration/to/v3.15.0.d.ts.map +1 -1
- package/dist/migration/to/v3.16.0.d.ts +2 -2
- package/dist/migration/to/v3.16.0.d.ts.map +1 -1
- package/dist/migration/to/v3.17.0.d.ts +2 -2
- package/dist/migration/to/v3.17.0.d.ts.map +1 -1
- package/dist/migration/to/v3.17.1.d.ts +2 -2
- package/dist/migration/to/v3.17.1.d.ts.map +1 -1
- package/dist/migration/to/v3.18.0.d.ts +2 -2
- package/dist/migration/to/v3.18.0.d.ts.map +1 -1
- package/dist/migration/to/v3.18.1.d.ts +2 -2
- package/dist/migration/to/v3.18.1.d.ts.map +1 -1
- package/dist/migration/to/v3.18.2.d.ts +2 -2
- package/dist/migration/to/v3.18.2.d.ts.map +1 -1
- package/dist/migration/to/v3.19.0.d.ts +2 -2
- package/dist/migration/to/v3.19.0.d.ts.map +1 -1
- package/dist/migration/to/v3.2.0.d.ts +2 -2
- package/dist/migration/to/v3.2.0.d.ts.map +1 -1
- package/dist/migration/to/v3.20.0.d.ts +2 -2
- package/dist/migration/to/v3.20.0.d.ts.map +1 -1
- package/dist/migration/to/v3.21.0.d.ts +2 -2
- package/dist/migration/to/v3.21.0.d.ts.map +1 -1
- package/dist/migration/to/v3.22.0.d.ts +2 -2
- package/dist/migration/to/v3.22.0.d.ts.map +1 -1
- package/dist/migration/to/v3.23.0.d.ts +2 -2
- package/dist/migration/to/v3.23.0.d.ts.map +1 -1
- package/dist/migration/to/v3.24.0.d.ts +2 -2
- package/dist/migration/to/v3.24.0.d.ts.map +1 -1
- package/dist/migration/to/v3.25.0.d.ts +2 -2
- package/dist/migration/to/v3.25.0.d.ts.map +1 -1
- package/dist/migration/to/v3.26.0.d.ts +2 -2
- package/dist/migration/to/v3.26.0.d.ts.map +1 -1
- package/dist/migration/to/v3.27.0.d.ts +2 -2
- package/dist/migration/to/v3.27.0.d.ts.map +1 -1
- package/dist/migration/to/v3.28.0.d.ts +2 -2
- package/dist/migration/to/v3.28.0.d.ts.map +1 -1
- package/dist/migration/to/v3.29.0.d.ts +2 -2
- package/dist/migration/to/v3.29.0.d.ts.map +1 -1
- package/dist/migration/to/v3.3.0.d.ts +2 -2
- package/dist/migration/to/v3.3.0.d.ts.map +1 -1
- package/dist/migration/to/v3.30.0.d.ts +2 -2
- package/dist/migration/to/v3.30.0.d.ts.map +1 -1
- package/dist/migration/to/v3.31.0.d.ts +2 -2
- package/dist/migration/to/v3.31.0.d.ts.map +1 -1
- package/dist/migration/to/v3.32.0.d.ts +2 -2
- package/dist/migration/to/v3.32.0.d.ts.map +1 -1
- package/dist/migration/to/v3.33.0.d.ts +2 -2
- package/dist/migration/to/v3.33.0.d.ts.map +1 -1
- package/dist/migration/to/v3.34.0.d.ts +4 -4
- package/dist/migration/to/v3.34.0.d.ts.map +1 -1
- package/dist/migration/to/v3.34.0.js +28 -6
- package/dist/migration/to/v3.35.0.d.ts +5 -0
- package/dist/migration/to/v3.35.0.d.ts.map +1 -0
- package/dist/migration/to/v3.35.0.js +18 -0
- package/dist/migration/to/v3.4.0.d.ts +2 -2
- package/dist/migration/to/v3.4.0.d.ts.map +1 -1
- package/dist/migration/to/v3.5.0.d.ts +2 -2
- package/dist/migration/to/v3.5.0.d.ts.map +1 -1
- package/dist/migration/to/v3.5.1.d.ts +2 -2
- package/dist/migration/to/v3.5.1.d.ts.map +1 -1
- package/dist/migration/to/v3.6.0.d.ts +2 -2
- package/dist/migration/to/v3.6.0.d.ts.map +1 -1
- package/dist/migration/to/v3.7.0.d.ts +2 -2
- package/dist/migration/to/v3.7.0.d.ts.map +1 -1
- package/dist/migration/to/v3.8.0.d.ts +2 -2
- package/dist/migration/to/v3.8.0.d.ts.map +1 -1
- package/dist/migration/to/v3.9.0.d.ts +2 -2
- package/dist/migration/to/v3.9.0.d.ts.map +1 -1
- package/dist/migration/types.d.ts +6 -6
- package/dist/migration/types.d.ts.map +1 -1
- package/dist/mocks.d.ts +5 -5
- package/dist/mocks.d.ts.map +1 -1
- package/dist/models/project-schema.d.ts +36 -0
- package/dist/models/project-schema.d.ts.map +1 -0
- package/dist/models/project-schema.js +132 -0
- package/dist/models/query.d.ts +18 -0
- package/dist/models/query.d.ts.map +1 -0
- package/dist/models/query.js +44 -0
- package/dist/models/service.d.ts +13 -0
- package/dist/models/service.d.ts.map +1 -0
- package/dist/models/service.js +34 -0
- package/dist/models/shape.d.ts +42 -0
- package/dist/models/shape.d.ts.map +1 -0
- package/dist/models/shape.js +116 -0
- package/dist/project-schema/index.d.ts +94 -91
- package/dist/project-schema/index.d.ts.map +1 -1
- package/dist/project-schema/index.js +154 -137
- package/dist/project-schema/latest.d.ts +145 -126
- package/dist/project-schema/latest.d.ts.map +1 -1
- package/dist/project-schema/migrate.d.ts +3 -3
- package/dist/project-schema/migrate.d.ts.map +1 -1
- package/dist/project-schema/migrate.js +49 -45
- package/dist/project-schema/v1.0.0.d.ts +13 -13
- package/dist/project-schema/v1.0.0.d.ts.map +1 -1
- package/dist/project-schema/v3.0.0.d.ts +23 -23
- package/dist/project-schema/v3.0.0.d.ts.map +1 -1
- package/dist/project-schema/v3.1.0.d.ts +35 -35
- package/dist/project-schema/v3.1.0.d.ts.map +1 -1
- package/dist/project-schema/v3.10.0.d.ts +104 -104
- package/dist/project-schema/v3.10.0.d.ts.map +1 -1
- package/dist/project-schema/v3.11.0.d.ts +104 -104
- package/dist/project-schema/v3.11.0.d.ts.map +1 -1
- package/dist/project-schema/v3.12.0.d.ts +104 -104
- package/dist/project-schema/v3.12.0.d.ts.map +1 -1
- package/dist/project-schema/v3.12.1.d.ts +110 -110
- package/dist/project-schema/v3.12.1.d.ts.map +1 -1
- package/dist/project-schema/v3.12.2.d.ts +111 -111
- package/dist/project-schema/v3.12.2.d.ts.map +1 -1
- package/dist/project-schema/v3.12.3.d.ts +114 -114
- package/dist/project-schema/v3.12.3.d.ts.map +1 -1
- package/dist/project-schema/v3.13.0.d.ts +115 -115
- package/dist/project-schema/v3.13.0.d.ts.map +1 -1
- package/dist/project-schema/v3.14.0.d.ts +116 -116
- package/dist/project-schema/v3.14.0.d.ts.map +1 -1
- package/dist/project-schema/v3.15.0.d.ts +119 -119
- package/dist/project-schema/v3.15.0.d.ts.map +1 -1
- package/dist/project-schema/v3.16.0.d.ts +119 -119
- package/dist/project-schema/v3.16.0.d.ts.map +1 -1
- package/dist/project-schema/v3.17.0.d.ts +119 -119
- package/dist/project-schema/v3.17.0.d.ts.map +1 -1
- package/dist/project-schema/v3.17.1.d.ts +119 -119
- package/dist/project-schema/v3.17.1.d.ts.map +1 -1
- package/dist/project-schema/v3.18.0.d.ts +117 -117
- package/dist/project-schema/v3.18.0.d.ts.map +1 -1
- package/dist/project-schema/v3.18.1.d.ts +117 -117
- package/dist/project-schema/v3.18.1.d.ts.map +1 -1
- package/dist/project-schema/v3.18.2.d.ts +117 -117
- package/dist/project-schema/v3.18.2.d.ts.map +1 -1
- package/dist/project-schema/v3.19.0.d.ts +117 -117
- package/dist/project-schema/v3.19.0.d.ts.map +1 -1
- package/dist/project-schema/v3.2.0.d.ts +36 -36
- package/dist/project-schema/v3.2.0.d.ts.map +1 -1
- package/dist/project-schema/v3.20.0.d.ts +117 -117
- package/dist/project-schema/v3.20.0.d.ts.map +1 -1
- package/dist/project-schema/v3.21.0.d.ts +117 -117
- package/dist/project-schema/v3.21.0.d.ts.map +1 -1
- package/dist/project-schema/v3.22.0.d.ts +118 -118
- package/dist/project-schema/v3.22.0.d.ts.map +1 -1
- package/dist/project-schema/v3.23.0.d.ts +120 -120
- package/dist/project-schema/v3.23.0.d.ts.map +1 -1
- package/dist/project-schema/v3.24.0.d.ts +120 -120
- package/dist/project-schema/v3.24.0.d.ts.map +1 -1
- package/dist/project-schema/v3.25.0.d.ts +120 -120
- package/dist/project-schema/v3.25.0.d.ts.map +1 -1
- package/dist/project-schema/v3.26.0.d.ts +121 -121
- package/dist/project-schema/v3.26.0.d.ts.map +1 -1
- package/dist/project-schema/v3.27.0.d.ts +122 -122
- package/dist/project-schema/v3.27.0.d.ts.map +1 -1
- package/dist/project-schema/v3.28.0.d.ts +123 -123
- package/dist/project-schema/v3.28.0.d.ts.map +1 -1
- package/dist/project-schema/v3.29.0.d.ts +124 -124
- package/dist/project-schema/v3.29.0.d.ts.map +1 -1
- package/dist/project-schema/v3.3.0.d.ts +36 -36
- package/dist/project-schema/v3.3.0.d.ts.map +1 -1
- package/dist/project-schema/v3.30.0.d.ts +123 -123
- package/dist/project-schema/v3.30.0.d.ts.map +1 -1
- package/dist/project-schema/v3.31.0.d.ts +125 -125
- package/dist/project-schema/v3.31.0.d.ts.map +1 -1
- package/dist/project-schema/v3.32.0.d.ts +124 -124
- package/dist/project-schema/v3.32.0.d.ts.map +1 -1
- package/dist/project-schema/v3.33.0.d.ts +125 -125
- package/dist/project-schema/v3.33.0.d.ts.map +1 -1
- package/dist/project-schema/v3.34.0.d.ts +125 -125
- package/dist/project-schema/v3.34.0.d.ts.map +1 -1
- package/dist/project-schema/v3.35.0.d.ts +1465 -0
- package/dist/project-schema/v3.35.0.d.ts.map +1 -0
- package/dist/project-schema/v3.35.0.js +5 -0
- package/dist/project-schema/v3.4.0.d.ts +36 -36
- package/dist/project-schema/v3.4.0.d.ts.map +1 -1
- package/dist/project-schema/v3.5.0.d.ts +36 -36
- package/dist/project-schema/v3.5.0.d.ts.map +1 -1
- package/dist/project-schema/v3.5.1.d.ts +36 -36
- package/dist/project-schema/v3.5.1.d.ts.map +1 -1
- package/dist/project-schema/v3.6.0.d.ts +37 -37
- package/dist/project-schema/v3.6.0.d.ts.map +1 -1
- package/dist/project-schema/v3.7.0.d.ts +37 -37
- package/dist/project-schema/v3.7.0.d.ts.map +1 -1
- package/dist/project-schema/v3.8.0.d.ts +39 -39
- package/dist/project-schema/v3.8.0.d.ts.map +1 -1
- package/dist/project-schema/v3.9.0.d.ts +39 -39
- package/dist/project-schema/v3.9.0.d.ts.map +1 -1
- package/dist/project-schema/v4.0.0.d.ts +113 -113
- package/dist/project-schema/v4.0.0.d.ts.map +1 -1
- package/dist/refs.d.ts +16 -13
- package/dist/refs.d.ts.map +1 -1
- package/dist/refs.js +21 -0
- package/dist/relationships.d.ts +5 -5
- package/dist/relationships.d.ts.map +1 -1
- package/dist/schema-util.d.ts +46 -40
- package/dist/schema-util.d.ts.map +1 -1
- package/dist/schema-util.js +34 -29
- package/dist/schemas/index.d.ts +2 -2
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +6 -4
- package/dist/schemas/index.ts +4 -2
- package/dist/schemas/project-schema/latest.json +42 -7
- package/dist/schemas/project-schema/meta-schema-v3.0.0.json +1 -1
- package/dist/schemas/project-schema/meta-schema-v3.1.0.json +1 -1
- package/dist/schemas/project-schema/meta-schema-v3.2.0.json +1 -1
- package/dist/schemas/project-schema/meta-schema-v3.3.0.json +1 -1
- package/dist/schemas/project-schema/meta-schema-v3.4.0.json +1 -1
- package/dist/schemas/project-schema/meta-schema-v3.5.0.json +1 -1
- package/dist/schemas/project-schema/meta-schema-v3.5.1.json +1 -1
- package/dist/schemas/project-schema/meta-schema-v3.6.0.json +1 -1
- package/dist/schemas/project-schema/meta-schema-v3.7.0.json +1 -1
- package/dist/schemas/project-schema/meta-schema-v3.8.0.json +1 -1
- package/dist/schemas/project-schema/meta-schema-v3.9.0.json +1 -1
- package/dist/schemas/project-schema/v1.0.0.json +1 -1
- package/dist/schemas/project-schema/v3.0.0.json +2 -2
- package/dist/schemas/project-schema/v3.1.0.json +4 -4
- package/dist/schemas/project-schema/v3.10.0.json +5 -5
- package/dist/schemas/project-schema/v3.11.0.json +5 -5
- package/dist/schemas/project-schema/v3.12.0.json +5 -5
- package/dist/schemas/project-schema/v3.12.1.json +5 -5
- package/dist/schemas/project-schema/v3.12.2.json +5 -5
- package/dist/schemas/project-schema/v3.12.3.json +5 -5
- package/dist/schemas/project-schema/v3.13.0.json +5 -5
- package/dist/schemas/project-schema/v3.14.0.json +5 -5
- package/dist/schemas/project-schema/v3.15.0.json +5 -5
- package/dist/schemas/project-schema/v3.16.0.json +5 -5
- package/dist/schemas/project-schema/v3.17.0.json +5 -5
- package/dist/schemas/project-schema/v3.17.1.json +5 -5
- package/dist/schemas/project-schema/v3.18.0.json +5 -5
- package/dist/schemas/project-schema/v3.18.1.json +5 -5
- package/dist/schemas/project-schema/v3.18.2.json +5 -5
- package/dist/schemas/project-schema/v3.19.0.json +5 -5
- package/dist/schemas/project-schema/v3.2.0.json +4 -4
- package/dist/schemas/project-schema/v3.20.0.json +5 -5
- package/dist/schemas/project-schema/v3.21.0.json +5 -5
- package/dist/schemas/project-schema/v3.22.0.json +5 -5
- package/dist/schemas/project-schema/v3.23.0.json +5 -5
- package/dist/schemas/project-schema/v3.24.0.json +5 -5
- package/dist/schemas/project-schema/v3.25.0.json +5 -5
- package/dist/schemas/project-schema/v3.26.0.json +6 -6
- package/dist/schemas/project-schema/v3.27.0.json +6 -6
- package/dist/schemas/project-schema/v3.28.0.json +5 -5
- package/dist/schemas/project-schema/v3.29.0.json +5 -5
- package/dist/schemas/project-schema/v3.3.0.json +4 -4
- package/dist/schemas/project-schema/v3.30.0.json +5 -5
- package/dist/schemas/project-schema/v3.31.0.json +6 -6
- package/dist/schemas/project-schema/v3.32.0.json +6 -6
- package/dist/schemas/project-schema/v3.33.0.json +6 -6
- package/dist/schemas/project-schema/v3.34.0.json +5 -5
- package/dist/schemas/project-schema/v3.35.0.json +3123 -0
- package/dist/schemas/project-schema/v3.4.0.json +4 -4
- package/dist/schemas/project-schema/v3.5.0.json +4 -4
- package/dist/schemas/project-schema/v3.5.1.json +4 -4
- package/dist/schemas/project-schema/v3.6.0.json +4 -4
- package/dist/schemas/project-schema/v3.7.0.json +4 -4
- package/dist/schemas/project-schema/v3.8.0.json +4 -4
- package/dist/schemas/project-schema/v3.9.0.json +4 -4
- package/dist/schemas/project-schema/v4.0.0.json +5 -5
- package/dist/schemas/project-schema.json +3 -0
- package/dist/services.d.ts +12 -12
- package/dist/services.d.ts.map +1 -1
- package/dist/services.js +3 -3
- package/dist/taxonomies.d.ts +4 -4
- package/dist/taxonomies.d.ts.map +1 -1
- package/dist/template-shapes/index.d.ts +2 -2
- package/dist/template-shapes/index.d.ts.map +1 -1
- package/dist/template-shapes/templates.d.ts +21 -21
- package/dist/template-shapes/templates.d.ts.map +1 -1
- package/dist/template-shapes/types.d.ts +3 -3
- package/dist/template-shapes/types.d.ts.map +1 -1
- package/dist/template-shapes/where.d.ts +6 -6
- package/dist/template-shapes/where.d.ts.map +1 -1
- package/dist/types/types.d.ts +10 -9
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils.d.ts +5 -4
- package/dist/types/utils.d.ts.map +1 -1
- package/dist/types/utils.js +5 -0
- package/dist/unions.d.ts +8 -8
- package/dist/unions.d.ts.map +1 -1
- package/dist/util/api-indexing.d.ts +4 -4
- package/dist/util/api-indexing.d.ts.map +1 -1
- package/dist/util/detect-cycles.d.ts +3 -3
- package/dist/util/detect-cycles.d.ts.map +1 -1
- package/dist/util/find-shape-at-path.d.ts +3 -3
- package/dist/util/find-shape-at-path.d.ts.map +1 -1
- package/dist/util/form-config.d.ts +3 -3
- package/dist/util/form-config.d.ts.map +1 -1
- package/dist/util/get-conflicting-properties.d.ts +2 -2
- package/dist/util/get-conflicting-properties.d.ts.map +1 -1
- package/dist/util/get-return-shape.d.ts +4 -2
- package/dist/util/get-return-shape.d.ts.map +1 -1
- package/dist/util/get-return-shape.js +5 -0
- package/dist/util/has-arg.d.ts +2 -2
- package/dist/util/has-arg.d.ts.map +1 -1
- package/dist/util/merge.d.ts +3 -3
- package/dist/util/merge.d.ts.map +1 -1
- package/dist/util/patch-schema.d.ts +2 -2
- package/dist/util/patch-schema.d.ts.map +1 -1
- package/dist/validate.d.ts +3 -3
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +84 -5
- package/dist/workflows.d.ts +3 -3
- package/dist/workflows.d.ts.map +1 -1
- package/es/migration/index.js +3 -1
- package/es/migration/to/utils/v3.34.0-utils.js +0 -0
- package/es/migration/to/v3.34.0.js +28 -7
- package/es/migration/to/v3.35.0.js +10 -0
- package/es/models/project-schema.js +116 -0
- package/es/models/query.js +35 -0
- package/es/models/service.js +25 -0
- package/es/models/shape.js +105 -0
- package/es/project-schema/index.js +47 -45
- package/es/project-schema/migrate.js +50 -46
- package/es/project-schema/v3.35.0.js +1 -0
- package/es/refs.js +15 -0
- package/es/schema-util.js +32 -29
- package/es/schemas/index.js +4 -3
- package/es/schemas/index.ts +4 -2
- package/es/schemas/project-schema/latest.json +42 -7
- package/es/schemas/project-schema/meta-schema-v3.0.0.json +1 -1
- package/es/schemas/project-schema/meta-schema-v3.1.0.json +1 -1
- package/es/schemas/project-schema/meta-schema-v3.2.0.json +1 -1
- package/es/schemas/project-schema/meta-schema-v3.3.0.json +1 -1
- package/es/schemas/project-schema/meta-schema-v3.4.0.json +1 -1
- package/es/schemas/project-schema/meta-schema-v3.5.0.json +1 -1
- package/es/schemas/project-schema/meta-schema-v3.5.1.json +1 -1
- package/es/schemas/project-schema/meta-schema-v3.6.0.json +1 -1
- package/es/schemas/project-schema/meta-schema-v3.7.0.json +1 -1
- package/es/schemas/project-schema/meta-schema-v3.8.0.json +1 -1
- package/es/schemas/project-schema/meta-schema-v3.9.0.json +1 -1
- package/es/schemas/project-schema/v1.0.0.json +1 -1
- package/es/schemas/project-schema/v3.0.0.json +2 -2
- package/es/schemas/project-schema/v3.1.0.json +4 -4
- package/es/schemas/project-schema/v3.10.0.json +5 -5
- package/es/schemas/project-schema/v3.11.0.json +5 -5
- package/es/schemas/project-schema/v3.12.0.json +5 -5
- package/es/schemas/project-schema/v3.12.1.json +5 -5
- package/es/schemas/project-schema/v3.12.2.json +5 -5
- package/es/schemas/project-schema/v3.12.3.json +5 -5
- package/es/schemas/project-schema/v3.13.0.json +5 -5
- package/es/schemas/project-schema/v3.14.0.json +5 -5
- package/es/schemas/project-schema/v3.15.0.json +5 -5
- package/es/schemas/project-schema/v3.16.0.json +5 -5
- package/es/schemas/project-schema/v3.17.0.json +5 -5
- package/es/schemas/project-schema/v3.17.1.json +5 -5
- package/es/schemas/project-schema/v3.18.0.json +5 -5
- package/es/schemas/project-schema/v3.18.1.json +5 -5
- package/es/schemas/project-schema/v3.18.2.json +5 -5
- package/es/schemas/project-schema/v3.19.0.json +5 -5
- package/es/schemas/project-schema/v3.2.0.json +4 -4
- package/es/schemas/project-schema/v3.20.0.json +5 -5
- package/es/schemas/project-schema/v3.21.0.json +5 -5
- package/es/schemas/project-schema/v3.22.0.json +5 -5
- package/es/schemas/project-schema/v3.23.0.json +5 -5
- package/es/schemas/project-schema/v3.24.0.json +5 -5
- package/es/schemas/project-schema/v3.25.0.json +5 -5
- package/es/schemas/project-schema/v3.26.0.json +6 -6
- package/es/schemas/project-schema/v3.27.0.json +6 -6
- package/es/schemas/project-schema/v3.28.0.json +5 -5
- package/es/schemas/project-schema/v3.29.0.json +5 -5
- package/es/schemas/project-schema/v3.3.0.json +4 -4
- package/es/schemas/project-schema/v3.30.0.json +5 -5
- package/es/schemas/project-schema/v3.31.0.json +6 -6
- package/es/schemas/project-schema/v3.32.0.json +6 -6
- package/es/schemas/project-schema/v3.33.0.json +6 -6
- package/es/schemas/project-schema/v3.34.0.json +5 -5
- package/es/schemas/project-schema/v3.35.0.json +3123 -0
- package/es/schemas/project-schema/v3.4.0.json +4 -4
- package/es/schemas/project-schema/v3.5.0.json +4 -4
- package/es/schemas/project-schema/v3.5.1.json +4 -4
- package/es/schemas/project-schema/v3.6.0.json +4 -4
- package/es/schemas/project-schema/v3.7.0.json +4 -4
- package/es/schemas/project-schema/v3.8.0.json +4 -4
- package/es/schemas/project-schema/v3.9.0.json +4 -4
- package/es/schemas/project-schema/v4.0.0.json +5 -5
- package/es/schemas/project-schema.json +3 -0
- package/es/services.js +3 -3
- package/es/types/utils.js +3 -0
- package/es/util/get-return-shape.js +3 -0
- package/es/validate.js +85 -6
- package/examples/latest/betzino.json +1 -1
- package/examples/latest/blog-schema.json +1 -1
- package/examples/latest/brewery-schema.json +1 -1
- package/examples/latest/complex-project-schema.json +1 -1
- package/examples/latest/complex-schema.json +1 -1
- package/examples/latest/fabric-ecommerce.json +1 -1
- package/examples/latest/frank-and-fred-schema.json +1 -1
- package/examples/latest/klirr-schema.json +1 -1
- package/examples/latest/massive-schema.json +1 -1
- package/examples/latest/mill-components-schema.json +1 -1
- package/examples/latest/one-earth.json +1 -1
- package/examples/latest/pet-oneof-array.json +1 -1
- package/examples/latest/post-schema.json +1 -1
- package/examples/latest/pruned-shopify-product-schema.json +1 -1
- package/examples/latest/real-world-schema.json +1 -1
- package/examples/latest/recursive-repeater-schema.json +1 -1
- package/examples/latest/recursive-schema.json +1 -1
- package/examples/latest/rick-and-morty-ast.json +1 -1
- package/examples/latest/rick-and-morty-graphql.json +1 -1
- package/examples/latest/rick-and-morty-rest.json +1 -1
- package/examples/latest/schema-with-repeater-draftjs.json +1 -1
- package/examples/latest/shape-books-v3_2_0.json +1 -1
- package/examples/latest/shape-books.json +1 -1
- package/examples/latest/shape-editor-schema-edited.json +2 -2
- package/examples/latest/shape-editor-schema-initial.json +1 -1
- package/examples/latest/shopify-lookbook.json +1 -1
- package/examples/latest/shopify-product-2022-07.json +1 -1
- package/examples/latest/shopify-product-2023-04.json +1 -1
- package/examples/latest/shopify-store-with-widget.json +1 -1
- package/examples/latest/stripe-product-runtime-schema.json +1 -1
- package/examples/latest/stripe-starter-resolved.json +1 -1
- package/examples/latest/user-schema-no-required.json +1 -1
- package/examples/latest/user-schema-with-defaults.json +1 -1
- package/package.json +5 -5
package/dist/validate.js
CHANGED
|
@@ -491,6 +491,78 @@ async function validateQueryConfigs(context, projectSchema) {
|
|
|
491
491
|
return (0, _lodash.flatten)(await Promise.all(promises));
|
|
492
492
|
}
|
|
493
493
|
|
|
494
|
+
function listShapeJoins(projectSchema) {
|
|
495
|
+
const joins = [];
|
|
496
|
+
|
|
497
|
+
for (const shapeKey of Object.keys(projectSchema.shapes)) {
|
|
498
|
+
const shape = projectSchema.shapes[shapeKey];
|
|
499
|
+
|
|
500
|
+
if ('joins' in shape) {
|
|
501
|
+
for (const joinRef of Object.keys(shape.joins)) {
|
|
502
|
+
const join = shape.joins[joinRef];
|
|
503
|
+
joins.push({
|
|
504
|
+
ref: joinRef,
|
|
505
|
+
path: ['shapes', shapeKey, 'joins', joinRef],
|
|
506
|
+
join
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
return joins;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
function validateLocalShapeJoinRef(projectSchema, item) {
|
|
516
|
+
const refItem = (0, _refs.atRefToRefItem)(projectSchema, item.ref);
|
|
517
|
+
|
|
518
|
+
if (refItem.serviceKey === 'local') {
|
|
519
|
+
const shape = (0, _refs.refItemToShape)(projectSchema, refItem);
|
|
520
|
+
|
|
521
|
+
if (!shape) {
|
|
522
|
+
return [{
|
|
523
|
+
type: 'notFound',
|
|
524
|
+
path: item.path,
|
|
525
|
+
message: `Invalid join "${item.ref}" not found`
|
|
526
|
+
}];
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
return [];
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
function validateLocalShapeJoins(projectSchema) {
|
|
534
|
+
return listShapeJoins(projectSchema).flatMap(item => validateLocalShapeJoinRef(projectSchema, item).concat(validateResolver(projectSchema, item.path.concat('resolver'), item.join.resolver)));
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
async function validateShapeJoinRef(context, projectSchema, item) {
|
|
538
|
+
const refItem = (0, _refs.atRefToRefItem)(projectSchema, item.ref);
|
|
539
|
+
|
|
540
|
+
if (refItem) {
|
|
541
|
+
const layer = await context.resolveLayer(refItem.serviceKey);
|
|
542
|
+
const valid = isValidRef(context, projectSchema, layer, refItem);
|
|
543
|
+
|
|
544
|
+
if (!valid) {
|
|
545
|
+
return [{
|
|
546
|
+
type: 'notFound',
|
|
547
|
+
path: item.path,
|
|
548
|
+
message: `Invalid join "${item.ref}" not found`
|
|
549
|
+
}];
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
return [];
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
async function validateShapeJoins(context, projectSchema) {
|
|
557
|
+
const promises = [];
|
|
558
|
+
|
|
559
|
+
for (const item of listShapeJoins(projectSchema)) {
|
|
560
|
+
promises.push(validateShapeJoinRef(context, projectSchema, item), validateResolverReferences(context, projectSchema, item.path, item.join.resolver));
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
return (0, _lodash.flatten)(await Promise.all(promises));
|
|
564
|
+
}
|
|
565
|
+
|
|
494
566
|
function validateIndexedShapeConfig(projectSchema, shapeName, config) {
|
|
495
567
|
var _config$queries;
|
|
496
568
|
|
|
@@ -686,6 +758,15 @@ function validateLocalRefs(projectSchema) {
|
|
|
686
758
|
return errors;
|
|
687
759
|
}
|
|
688
760
|
|
|
761
|
+
function isValidRef(context, projectSchema, layer, item) {
|
|
762
|
+
const {
|
|
763
|
+
serviceKey: layerId
|
|
764
|
+
} = item;
|
|
765
|
+
const shapeName = (0, _refs.refItemToShapeName)(item);
|
|
766
|
+
const localShapeExists = Boolean(projectSchema.shapes[shapeName]) || builtInShapeNames.has(shapeName);
|
|
767
|
+
return layerId === 'local' ? localShapeExists : localShapeExists || isValidShapeReference(context, layer, shapeName);
|
|
768
|
+
}
|
|
769
|
+
|
|
689
770
|
async function validateRefs(context, projectSchema) {
|
|
690
771
|
const {
|
|
691
772
|
resolveLayer
|
|
@@ -714,9 +795,7 @@ async function validateRefs(context, projectSchema) {
|
|
|
714
795
|
const {
|
|
715
796
|
serviceKey: layerId
|
|
716
797
|
} = item;
|
|
717
|
-
const
|
|
718
|
-
const localShapeExists = Boolean(projectSchema.shapes[shapeName]) || builtInShapeNames.has(shapeName);
|
|
719
|
-
const valid = layerId === 'local' ? localShapeExists : localShapeExists || isValidShapeReference(context, layersById[layerId], shapeName);
|
|
798
|
+
const valid = isValidRef(context, projectSchema, layersById[layerId], item);
|
|
720
799
|
|
|
721
800
|
if (!valid) {
|
|
722
801
|
errors.push({
|
|
@@ -1076,13 +1155,13 @@ const validators = [{
|
|
|
1076
1155
|
validateSyntax(schemaVersion, context, obj) {
|
|
1077
1156
|
const schema = obj;
|
|
1078
1157
|
let errors = [];
|
|
1079
|
-
errors = errors.concat(checkShapeNames(schema.shapes)).concat(checkShapeIds(schema.shapes)).concat(validateWorkflowsV3(schema)).concat(validateLocalQueryConfigs(schema)).concat(validateLocalRefs(schema)).concat(validateDirectives(schema)).concat(validateLocales(schema)).concat(checkWorkflowStepNames(schema.workflows)).concat(checkWorkflowStepKeys(schema.workflows)).concat(validateOneOfs(schema)).concat(validateIndexedShapes(schema)).concat(validateInterfaces(schema)).concat(validateInterfaceImplementations(schema));
|
|
1158
|
+
errors = errors.concat(checkShapeNames(schema.shapes)).concat(checkShapeIds(schema.shapes)).concat(validateWorkflowsV3(schema)).concat(validateLocalQueryConfigs(schema)).concat(validateLocalRefs(schema)).concat(validateLocalShapeJoins(schema)).concat(validateDirectives(schema)).concat(validateLocales(schema)).concat(checkWorkflowStepNames(schema.workflows)).concat(checkWorkflowStepKeys(schema.workflows)).concat(validateOneOfs(schema)).concat(validateIndexedShapes(schema)).concat(validateInterfaces(schema)).concat(validateInterfaceImplementations(schema));
|
|
1080
1159
|
return formatValidationResult(context, errors, schema);
|
|
1081
1160
|
},
|
|
1082
1161
|
|
|
1083
1162
|
async validateReferences(schemaVersion, context, obj) {
|
|
1084
1163
|
const schema = obj;
|
|
1085
|
-
const errors = (0, _lodash.flatten)(await Promise.all([validateRefs(context, schema), validateQueryConfigs(context, schema)]));
|
|
1164
|
+
const errors = (0, _lodash.flatten)(await Promise.all([validateRefs(context, schema), validateQueryConfigs(context, schema), validateShapeJoins(context, schema)]));
|
|
1086
1165
|
return formatValidationResult(context, errors, schema);
|
|
1087
1166
|
}
|
|
1088
1167
|
|
package/dist/workflows.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProjectSchemaJSON, PropertySchema, Workflow, WorkflowMap, WorkflowStep, ShapeJSON } from './project-schema';
|
|
2
2
|
export declare const defaultWorkflow: Workflow;
|
|
3
|
-
export declare function getWorkflow(projectSchema:
|
|
3
|
+
export declare function getWorkflow(projectSchema: ProjectSchemaJSON, shapeId: string): Workflow;
|
|
4
4
|
export interface StepContext {
|
|
5
5
|
index: number;
|
|
6
6
|
step: WorkflowStep;
|
|
7
7
|
}
|
|
8
8
|
export declare function statusFallback(workflow: Workflow, enabled: boolean): WorkflowStep;
|
|
9
9
|
export declare function findWorkflowStep(workflow: Workflow, keyOrName: string): StepContext | undefined;
|
|
10
|
-
export declare function getStatusField(workflows: WorkflowMap, shape:
|
|
10
|
+
export declare function getStatusField(workflows: WorkflowMap, shape: ShapeJSON): PropertySchema;
|
|
11
11
|
export type WorkflowComparisonOperatorKey = 'lt' | 'lte' | 'gte' | 'gt' | 'eq' | 'in';
|
|
12
12
|
export declare function getStepRange(steps: WorkflowStep[], index: number, op: WorkflowComparisonOperatorKey): WorkflowStep[];
|
|
13
13
|
export declare function getWorkflowStepKeys(workflow: Workflow, stepKey: string, op: WorkflowComparisonOperatorKey): string[];
|
package/dist/workflows.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/workflows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/workflows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,cAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAGnH,eAAO,MAAM,eAAe,EAAE,QAmB7B,CAAC;AAEF,wBAAgB,WAAW,CAAC,aAAa,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,GAAG,QAAQ,CAQvF;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,YAAY,CAEjF;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAG/F;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,GAAG,cAAc,CAOvF;AAED,MAAM,MAAM,6BAA6B,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEtF,wBAAgB,YAAY,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,6BAA6B,GAAG,YAAY,EAAE,CASpH;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,6BAA6B,GAAG,MAAM,EAAE,CAQpH;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,EAAE,CAE5D"}
|
package/es/migration/index.js
CHANGED
|
@@ -40,6 +40,7 @@ import migrateToV3_31_0 from './to/v3.31.0';
|
|
|
40
40
|
import migrateToV3_32_0 from './to/v3.32.0';
|
|
41
41
|
import migrateToV3_33_0 from './to/v3.33.0';
|
|
42
42
|
import migrateToV3_34_0 from './to/v3.34.0';
|
|
43
|
+
import migrateToV3_35_0 from './to/v3.35.0';
|
|
43
44
|
export const migrateTo = {
|
|
44
45
|
'v3.0.0': migrateToV3_0_0,
|
|
45
46
|
'v3.1.0': migrateToV3_1_0,
|
|
@@ -82,7 +83,8 @@ export const migrateTo = {
|
|
|
82
83
|
'v3.31.0': migrateToV3_31_0,
|
|
83
84
|
'v3.32.0': migrateToV3_32_0,
|
|
84
85
|
'v3.33.0': migrateToV3_33_0,
|
|
85
|
-
'v3.34.0': migrateToV3_34_0
|
|
86
|
+
'v3.34.0': migrateToV3_34_0,
|
|
87
|
+
'v3.35.0': migrateToV3_35_0
|
|
86
88
|
};
|
|
87
89
|
export * from './utils';
|
|
88
90
|
export const listTypePrefix = 'PaginatedList';
|
|
File without changes
|
|
@@ -4,7 +4,8 @@ import { getRefOrItemsRef } from '../../refs';
|
|
|
4
4
|
import upperFirst from 'lodash/upperFirst';
|
|
5
5
|
import set from 'lodash/fp/set';
|
|
6
6
|
import unset from 'lodash/fp/unset';
|
|
7
|
-
import { getServiceObjectFields } from '../../services';
|
|
7
|
+
import { getServiceObjectFields } from '../../services';
|
|
8
|
+
import { CURRENT_SCHEMA_VERSION } from '../../schemas'; // Inline utilities for posterity
|
|
8
9
|
|
|
9
10
|
function refItemToShapeName(refItem) {
|
|
10
11
|
const {
|
|
@@ -84,9 +85,12 @@ export function migrateInterfaceShapes(projectSchema) {
|
|
|
84
85
|
for (const shape of Object.values(projectSchema.shapes)) {
|
|
85
86
|
if (!shape.model) {
|
|
86
87
|
continue;
|
|
87
|
-
}
|
|
88
|
+
} // Set the schema version to the current to appease type check this line will eventually break as the schema diverges
|
|
89
|
+
|
|
88
90
|
|
|
89
|
-
const serviceObjectFields = getServiceObjectFields(projectSchema,
|
|
91
|
+
const serviceObjectFields = getServiceObjectFields({ ...projectSchema,
|
|
92
|
+
schemaVersion: CURRENT_SCHEMA_VERSION
|
|
93
|
+
}, shape, 'shopify');
|
|
90
94
|
|
|
91
95
|
for (const field of serviceObjectFields) {
|
|
92
96
|
const {
|
|
@@ -130,11 +134,28 @@ export function migrateInterfaceShapes(projectSchema) {
|
|
|
130
134
|
}
|
|
131
135
|
|
|
132
136
|
const migrate = async (_, projectSchema) => {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
137
|
+
let normalized = projectSchema;
|
|
138
|
+
|
|
139
|
+
try {
|
|
140
|
+
normalized = { ...projectSchema,
|
|
141
|
+
forms: normalizeForms(projectSchema)
|
|
142
|
+
};
|
|
143
|
+
} catch (e) {
|
|
144
|
+
// TODO remove console.log when a formal warning mechanism is added https://app.shortcut.com/takeshape/story/11533/return-warnings-from-schema-migration
|
|
145
|
+
// eslint-disable-next-line no-console
|
|
146
|
+
console.log(`v3.34.0 migration warning: Failed to normalize forms`, e.message);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
try {
|
|
150
|
+
normalized = migrateInterfaceShapes(normalized);
|
|
151
|
+
} catch (e) {
|
|
152
|
+
// eslint-disable-next-line no-console
|
|
153
|
+
console.log(`v3.34.0 migration warning: Failed to migrate interface shapes`, e.message);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return { ...normalized,
|
|
136
157
|
schemaVersion: '3.34.0'
|
|
137
|
-
}
|
|
158
|
+
};
|
|
138
159
|
};
|
|
139
160
|
|
|
140
161
|
export default migrate;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { atRefToRefItem, getRef, shapeNameToRef, shapeNameToRefItem, shapeToRefItem } from '../refs';
|
|
2
|
+
import { getAllRefs, getShape, getShapeById } from '../schema-util';
|
|
3
|
+
import omit from 'lodash/omit';
|
|
4
|
+
import { ShapeModel } from './shape';
|
|
5
|
+
import { QueryModel } from './query';
|
|
6
|
+
import { ServiceConfig } from './service';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Model object representing a ProjectSchema.
|
|
10
|
+
* Intended to help make it easier to find the right utils
|
|
11
|
+
* and avoid direct schema json access where a util would be preferred.
|
|
12
|
+
*/
|
|
13
|
+
export class ProjectSchema {
|
|
14
|
+
_cache = {};
|
|
15
|
+
|
|
16
|
+
constructor(unfilteredProjectSchema) {
|
|
17
|
+
// You can pass a ProjectSchemaCompat in here, but we remove its values so they don't get passed through to getJSON.
|
|
18
|
+
// If you need to use this metadata it should be stored separately.
|
|
19
|
+
this._projectSchemaJSON = omit(unfilteredProjectSchema, ['created', 'updated', 'version']);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
get json() {
|
|
23
|
+
return this._projectSchemaJSON;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
get projectId() {
|
|
27
|
+
return this.json.projectId;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
get $schema() {
|
|
31
|
+
return this.json.$schema;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
get author() {
|
|
35
|
+
return this.json.author;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
getShapeByName(shapeName) {
|
|
39
|
+
const shapeJSON = getShape(this.json, shapeName);
|
|
40
|
+
|
|
41
|
+
if (!shapeJSON) {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const shapeRefItem = shapeToRefItem(this.json, shapeJSON);
|
|
46
|
+
return new ShapeModel(this, shapeRefItem);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
getShapeById(shapeId) {
|
|
50
|
+
const shapeJSON = getShapeById(this.json, shapeId);
|
|
51
|
+
|
|
52
|
+
if (!shapeJSON) {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const shapeRefItem = shapeToRefItem(this.json, shapeJSON);
|
|
57
|
+
return new ShapeModel(this, shapeRefItem);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
getShapeByRef(shapeRef) {
|
|
61
|
+
return new ShapeModel(this, shapeRef);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
get shapes() {
|
|
65
|
+
this._cache.shapes = this._cache.shapes ?? Object.keys(this.json.shapes).map(name => new ShapeModel(this, shapeNameToRef(this.json, name)));
|
|
66
|
+
return this._cache.shapes;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
get refs() {
|
|
70
|
+
this._cache.refs = this._cache.refs ?? getAllRefs(this.json);
|
|
71
|
+
return this._cache.refs;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
getQueryByName(queryName) {
|
|
75
|
+
return new QueryModel(this, 'query', queryName);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
get queries() {
|
|
79
|
+
this._cache.queries = this._cache.queries ?? Object.keys(this.json.queries).map(name => new QueryModel(this, 'query', name));
|
|
80
|
+
return this._cache.queries;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
getMutationByName(mutationName) {
|
|
84
|
+
return new QueryModel(this, 'mutation', mutationName);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
get mutations() {
|
|
88
|
+
this._cache.mutations = Object.keys(this.json.mutations).map(name => new QueryModel(this, 'mutation', name));
|
|
89
|
+
return this._cache.mutations;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
getServiceById(serviceId) {
|
|
93
|
+
return new ServiceConfig(this, serviceId);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
atRefToRefItem(atRef, template) {
|
|
97
|
+
return atRefToRefItem(this.json, atRef, template);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
refItemToShape(refItem) {
|
|
101
|
+
return new ShapeModel(this, refItem);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
getRef(refSchema) {
|
|
105
|
+
return getRef(this.json, refSchema);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
shapeNameToRef(shapeName) {
|
|
109
|
+
return shapeNameToRef(this.json, shapeName);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
shapeNameToRefItem(shapeName) {
|
|
113
|
+
return shapeNameToRefItem(this.json, shapeName);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a model object representing a query or mutation.
|
|
3
|
+
*/
|
|
4
|
+
export class QueryModel {
|
|
5
|
+
constructor(projectSchemaModel, _queryType, _queryName) {
|
|
6
|
+
this._queryType = _queryType;
|
|
7
|
+
this._queryName = _queryName;
|
|
8
|
+
this._rawQuery = projectSchemaModel.json[_queryType === 'query' ? 'queries' : 'mutations'][_queryName];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
get queryType() {
|
|
12
|
+
return this._queryType;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
get name() {
|
|
16
|
+
return this._queryName;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
get json() {
|
|
20
|
+
return this._rawQuery;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
get description() {
|
|
24
|
+
return this.json.description;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
get resolver() {
|
|
28
|
+
return this.json.resolver;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
get returnShape() {
|
|
32
|
+
return this.json.shape;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a model object representing a service configuration.
|
|
3
|
+
*/
|
|
4
|
+
export class ServiceConfig {
|
|
5
|
+
constructor(projectSchemaModel, _serviceId) {
|
|
6
|
+
var _projectSchemaModel$j;
|
|
7
|
+
|
|
8
|
+
this._serviceId = _serviceId;
|
|
9
|
+
|
|
10
|
+
if (!((_projectSchemaModel$j = projectSchemaModel.json.services) !== null && _projectSchemaModel$j !== void 0 && _projectSchemaModel$j[_serviceId])) {
|
|
11
|
+
throw new Error(`Could not create service model for ${_serviceId}`);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
this._storedServiceConfig = projectSchemaModel.json.services[_serviceId];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
get id() {
|
|
18
|
+
return this._serviceId;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
get json() {
|
|
22
|
+
return this._storedServiceConfig;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { refItemToShape } from '../refs';
|
|
2
|
+
import { createSchemaPropertyAccessor, createSchemaPropertyList, getShapeByRef, isCachedShape, isModelShape } from '../schema-util';
|
|
3
|
+
import { isInterfaceShape } from '../interfaces';
|
|
4
|
+
/**
|
|
5
|
+
* Create a shape model from either a ref item or a ref string such as `rick:Character`
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export class ShapeModel {
|
|
9
|
+
constructor(_projectSchemaModel, refArg) {
|
|
10
|
+
this._projectSchemaModel = _projectSchemaModel;
|
|
11
|
+
|
|
12
|
+
if (typeof refArg === 'string') {
|
|
13
|
+
const rawShape = getShapeByRef(_projectSchemaModel.json, refArg);
|
|
14
|
+
|
|
15
|
+
if (!rawShape) {
|
|
16
|
+
throw new Error(`Error creating shape model: ${refArg} is not in project schema`);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
this._rawShape = rawShape;
|
|
20
|
+
this._shapeRefItem = _projectSchemaModel.atRefToRefItem(refArg);
|
|
21
|
+
this._shapeAtRef = refArg;
|
|
22
|
+
} else {
|
|
23
|
+
const rawShape = refItemToShape(_projectSchemaModel.json, refArg);
|
|
24
|
+
|
|
25
|
+
if (!rawShape) {
|
|
26
|
+
throw new Error(`Error creating shape model: ref item argument could not be resolved to a shape`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
this._rawShape = rawShape;
|
|
30
|
+
this._shapeRefItem = refArg;
|
|
31
|
+
this._shapeAtRef = `${refArg.serviceKey}:${refArg.typeName}`;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
get json() {
|
|
36
|
+
return this._rawShape;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
get id() {
|
|
40
|
+
return this._rawShape.id;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
get name() {
|
|
44
|
+
return this._rawShape.name;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
get title() {
|
|
48
|
+
return this._rawShape.title;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
get description() {
|
|
52
|
+
return this._rawShape.description;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
get schema() {
|
|
56
|
+
return this._rawShape.schema;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
get schemaPropertyList() {
|
|
60
|
+
return createSchemaPropertyList(this._projectSchemaModel.json, this._rawShape);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
get schemaPropertyAccessor() {
|
|
64
|
+
return createSchemaPropertyAccessor(this._projectSchemaModel.json, this._rawShape);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
get refString() {
|
|
68
|
+
return this._shapeAtRef;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
get refItem() {
|
|
72
|
+
return this._shapeRefItem;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
get serviceId() {
|
|
76
|
+
return this._shapeRefItem.serviceKey;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
get modelType() {
|
|
80
|
+
var _this$_rawShape$model;
|
|
81
|
+
|
|
82
|
+
return (_this$_rawShape$model = this._rawShape.model) === null || _this$_rawShape$model === void 0 ? void 0 : _this$_rawShape$model.type;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
get interfaces() {
|
|
86
|
+
return this._rawShape.interfaces;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
get isModel() {
|
|
90
|
+
return isModelShape(this._rawShape);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
get isCached() {
|
|
94
|
+
return isCachedShape(this._rawShape);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
get isAsset() {
|
|
98
|
+
return this._rawShape.id === 'ASSET';
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
get isInterfaceShape() {
|
|
102
|
+
return isInterfaceShape(this._rawShape);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
}
|
|
@@ -43,6 +43,7 @@ export * from './v3.31.0';
|
|
|
43
43
|
export * from './v3.32.0';
|
|
44
44
|
export * from './v3.33.0';
|
|
45
45
|
export * from './v3.34.0';
|
|
46
|
+
export * from './v3.35.0';
|
|
46
47
|
export * from './v4.0.0';
|
|
47
48
|
|
|
48
49
|
// Schema type utilities
|
|
@@ -64,48 +65,49 @@ function createVersionPredicate(expectedVersion) {
|
|
|
64
65
|
};
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
export const
|
|
68
|
-
export const
|
|
69
|
-
export const
|
|
70
|
-
export const
|
|
71
|
-
export const
|
|
72
|
-
export const
|
|
73
|
-
export const
|
|
74
|
-
export const
|
|
75
|
-
export const
|
|
76
|
-
export const
|
|
77
|
-
export const
|
|
78
|
-
export const
|
|
79
|
-
export const
|
|
80
|
-
export const
|
|
81
|
-
export const
|
|
82
|
-
export const
|
|
83
|
-
export const
|
|
84
|
-
export const
|
|
85
|
-
export const
|
|
86
|
-
export const
|
|
87
|
-
export const
|
|
88
|
-
export const
|
|
89
|
-
export const
|
|
90
|
-
export const
|
|
91
|
-
export const
|
|
92
|
-
export const
|
|
93
|
-
export const
|
|
94
|
-
export const
|
|
95
|
-
export const
|
|
96
|
-
export const
|
|
97
|
-
export const
|
|
98
|
-
export const
|
|
99
|
-
export const
|
|
100
|
-
export const
|
|
101
|
-
export const
|
|
102
|
-
export const
|
|
103
|
-
export const
|
|
104
|
-
export const
|
|
105
|
-
export const
|
|
106
|
-
export const
|
|
107
|
-
export const
|
|
108
|
-
export const
|
|
109
|
-
export const
|
|
110
|
-
export const
|
|
111
|
-
export const
|
|
68
|
+
export const isProjectSchemaJSONV1_0_0 = createVersionPredicate('1.0.0');
|
|
69
|
+
export const isProjectSchemaJSONV3_0_0 = createVersionPredicate('3.0.0');
|
|
70
|
+
export const isProjectSchemaJSONV3_1_0 = createVersionPredicate('3.1.0');
|
|
71
|
+
export const isProjectSchemaJSONV3_2_0 = createVersionPredicate('3.2.0');
|
|
72
|
+
export const isProjectSchemaJSONV3_3_0 = createVersionPredicate('3.3.0');
|
|
73
|
+
export const isProjectSchemaJSONV3_4_0 = createVersionPredicate('3.4.0');
|
|
74
|
+
export const isProjectSchemaJSONV3_5_0 = createVersionPredicate('3.5.0');
|
|
75
|
+
export const isProjectSchemaJSONV3_5_1 = createVersionPredicate('3.5.1');
|
|
76
|
+
export const isProjectSchemaJSONV3_6_0 = createVersionPredicate('3.6.0');
|
|
77
|
+
export const isProjectSchemaJSONV3_7_0 = createVersionPredicate('3.7.0');
|
|
78
|
+
export const isProjectSchemaJSONV3_8_0 = createVersionPredicate('3.8.0');
|
|
79
|
+
export const isProjectSchemaJSONV3_9_0 = createVersionPredicate('3.9.0');
|
|
80
|
+
export const isProjectSchemaJSONV3_10_0 = createVersionPredicate('3.10.0');
|
|
81
|
+
export const isProjectSchemaJSONV3_11_0 = createVersionPredicate('3.11.0');
|
|
82
|
+
export const isProjectSchemaJSONV3_12_0 = createVersionPredicate('3.12.0');
|
|
83
|
+
export const isProjectSchemaJSONV3_12_1 = createVersionPredicate('3.12.1');
|
|
84
|
+
export const isProjectSchemaJSONV3_12_2 = createVersionPredicate('3.12.2');
|
|
85
|
+
export const isProjectSchemaJSONV3_12_3 = createVersionPredicate('3.12.3');
|
|
86
|
+
export const isProjectSchemaJSONV3_13_0 = createVersionPredicate('3.13.0');
|
|
87
|
+
export const isProjectSchemaJSONV3_14_0 = createVersionPredicate('3.14.0');
|
|
88
|
+
export const isProjectSchemaJSONV3_15_0 = createVersionPredicate('3.15.0');
|
|
89
|
+
export const isProjectSchemaJSONV3_16_0 = createVersionPredicate('3.16.0');
|
|
90
|
+
export const isProjectSchemaJSONV3_17_0 = createVersionPredicate('3.17.0');
|
|
91
|
+
export const isProjectSchemaJSONV3_17_1 = createVersionPredicate('3.17.1');
|
|
92
|
+
export const isProjectSchemaJSONV3_18_0 = createVersionPredicate('3.18.0');
|
|
93
|
+
export const isProjectSchemaJSONV3_18_1 = createVersionPredicate('3.18.1');
|
|
94
|
+
export const isProjectSchemaJSONV3_18_2 = createVersionPredicate('3.18.2');
|
|
95
|
+
export const isProjectSchemaJSONV3_19_0 = createVersionPredicate('3.19.0');
|
|
96
|
+
export const isProjectSchemaJSONV3_20_0 = createVersionPredicate('3.20.0');
|
|
97
|
+
export const isProjectSchemaJSONV3_21_0 = createVersionPredicate('3.21.0');
|
|
98
|
+
export const isProjectSchemaJSONV3_22_0 = createVersionPredicate('3.22.0');
|
|
99
|
+
export const isProjectSchemaJSONV3_23_0 = createVersionPredicate('3.23.0');
|
|
100
|
+
export const isProjectSchemaJSONV3_24_0 = createVersionPredicate('3.24.0');
|
|
101
|
+
export const isProjectSchemaJSONV3_25_0 = createVersionPredicate('3.25.0');
|
|
102
|
+
export const isProjectSchemaJSONV3_26_0 = createVersionPredicate('3.26.0');
|
|
103
|
+
export const isProjectSchemaJSONV3_27_0 = createVersionPredicate('3.27.0');
|
|
104
|
+
export const isProjectSchemaJSONV3_28_0 = createVersionPredicate('3.28.0');
|
|
105
|
+
export const isProjectSchemaJSONV3_29_0 = createVersionPredicate('3.29.0');
|
|
106
|
+
export const isProjectSchemaJSONV3_30_0 = createVersionPredicate('3.30.0');
|
|
107
|
+
export const isProjectSchemaJSONV3_31_0 = createVersionPredicate('3.31.0');
|
|
108
|
+
export const isProjectSchemaJSONV3_32_0 = createVersionPredicate('3.32.0');
|
|
109
|
+
export const isProjectSchemaJSONV3_33_0 = createVersionPredicate('3.33.0');
|
|
110
|
+
export const isProjectSchemaJSONV3_34_0 = createVersionPredicate('3.34.0');
|
|
111
|
+
export const isProjectSchemaJSONV3_35_0 = createVersionPredicate('3.35.0');
|
|
112
|
+
export const isLatestProjectSchemaJSON = createVersionPredicate('3.35.0');
|
|
113
|
+
export const isProjectSchemaJSONV4_0_0 = createVersionPredicate('4.0.0');
|