@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/mocks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mocks.d.ts","sourceRoot":"","sources":["../../src/mocks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"mocks.d.ts","sourceRoot":"","sources":["../../src/mocks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAE,aAAa,EAAE,SAAS,EAAE,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACrG,OAAO,KAAK,EAAC,WAAW,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAI3D;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,iBAAiB,CAAM,GAAG,iBAAiB,CAM9G;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,EACjB,MAAM,GAAE,OAAO,CAAC,iBAAiB,CAAM,GACtC,iBAAiB,CAMnB;AAED,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAiBrH;AAED,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,UAAU,EACtB,aAAa,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GACzC,iBAAiB,CAMnB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,SAAS,GAAG,WAAW,CAUnE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ShapeJSON, ProjectSchemaJSON } from '../project-schema';
|
|
2
|
+
import { RefItem, RefItemWithPath } from '../refs';
|
|
3
|
+
import { SchemaWithRef } from '../types';
|
|
4
|
+
import { ShapeModel } from './shape';
|
|
5
|
+
import { QueryModel } from './query';
|
|
6
|
+
import { ServiceConfig } from './service';
|
|
7
|
+
/**
|
|
8
|
+
* Model object representing a ProjectSchema.
|
|
9
|
+
* Intended to help make it easier to find the right utils
|
|
10
|
+
* and avoid direct schema json access where a util would be preferred.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ProjectSchema {
|
|
13
|
+
private readonly _projectSchemaJSON;
|
|
14
|
+
private _cache;
|
|
15
|
+
constructor(unfilteredProjectSchema: ProjectSchemaJSON);
|
|
16
|
+
get json(): ProjectSchemaJSON;
|
|
17
|
+
get projectId(): string;
|
|
18
|
+
get $schema(): string | undefined;
|
|
19
|
+
get author(): string | undefined;
|
|
20
|
+
getShapeByName(shapeName: string): ShapeModel | undefined;
|
|
21
|
+
getShapeById(shapeId: string): ShapeModel | undefined;
|
|
22
|
+
getShapeByRef(shapeRef: string): ShapeModel;
|
|
23
|
+
get shapes(): ShapeJSON[];
|
|
24
|
+
get refs(): RefItemWithPath[];
|
|
25
|
+
getQueryByName(queryName: string): QueryModel;
|
|
26
|
+
get queries(): QueryModel[];
|
|
27
|
+
getMutationByName(mutationName: string): QueryModel;
|
|
28
|
+
get mutations(): QueryModel[];
|
|
29
|
+
getServiceById(serviceId: string): ServiceConfig;
|
|
30
|
+
atRefToRefItem(atRef: string, template?: string): RefItem;
|
|
31
|
+
refItemToShape(refItem: RefItem): ShapeModel;
|
|
32
|
+
getRef(refSchema: SchemaWithRef): import("@takeshape/util").Maybe<RefItem>;
|
|
33
|
+
shapeNameToRef(shapeName: string): string;
|
|
34
|
+
shapeNameToRefItem(shapeName: string): RefItem;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=project-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-schema.d.ts","sourceRoot":"","sources":["../../../src/models/project-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EACL,OAAO,EACP,eAAe,EAMhB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AACvC,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AACnC,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AACnC,OAAO,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AASxC;;;;GAIG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAoB;IACvD,OAAO,CAAC,MAAM,CAA0B;gBAE5B,uBAAuB,EAAE,iBAAiB;IAMtD,IAAI,IAAI,sBAEP;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,OAAO,uBAEV;IAED,IAAI,MAAM,uBAET;IAED,cAAc,CAAC,SAAS,EAAE,MAAM;IAUhC,YAAY,CAAC,OAAO,EAAE,MAAM;IAU5B,aAAa,CAAC,QAAQ,EAAE,MAAM;IAI9B,IAAI,MAAM,gBAKT;IAED,IAAI,IAAI,sBAGP;IAED,cAAc,CAAC,SAAS,EAAE,MAAM;IAIhC,IAAI,OAAO,iBAIV;IAED,iBAAiB,CAAC,YAAY,EAAE,MAAM;IAItC,IAAI,SAAS,iBAGZ;IAED,cAAc,CAAC,SAAS,EAAE,MAAM;IAIhC,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;IAI/C,cAAc,CAAC,OAAO,EAAE,OAAO;IAI/B,MAAM,CAAC,SAAS,EAAE,aAAa;IAI/B,cAAc,CAAC,SAAS,EAAE,MAAM;IAIhC,kBAAkB,CAAC,SAAS,EAAE,MAAM;CAGrC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ProjectSchema = void 0;
|
|
7
|
+
|
|
8
|
+
var _refs = require("../refs");
|
|
9
|
+
|
|
10
|
+
var _schemaUtil = require("../schema-util");
|
|
11
|
+
|
|
12
|
+
var _omit = _interopRequireDefault(require("lodash/omit"));
|
|
13
|
+
|
|
14
|
+
var _shape = require("./shape");
|
|
15
|
+
|
|
16
|
+
var _query = require("./query");
|
|
17
|
+
|
|
18
|
+
var _service = require("./service");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Model object representing a ProjectSchema.
|
|
24
|
+
* Intended to help make it easier to find the right utils
|
|
25
|
+
* and avoid direct schema json access where a util would be preferred.
|
|
26
|
+
*/
|
|
27
|
+
class ProjectSchema {
|
|
28
|
+
_cache = {};
|
|
29
|
+
|
|
30
|
+
constructor(unfilteredProjectSchema) {
|
|
31
|
+
// You can pass a ProjectSchemaCompat in here, but we remove its values so they don't get passed through to getJSON.
|
|
32
|
+
// If you need to use this metadata it should be stored separately.
|
|
33
|
+
this._projectSchemaJSON = (0, _omit.default)(unfilteredProjectSchema, ['created', 'updated', 'version']);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
get json() {
|
|
37
|
+
return this._projectSchemaJSON;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
get projectId() {
|
|
41
|
+
return this.json.projectId;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
get $schema() {
|
|
45
|
+
return this.json.$schema;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
get author() {
|
|
49
|
+
return this.json.author;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
getShapeByName(shapeName) {
|
|
53
|
+
const shapeJSON = (0, _schemaUtil.getShape)(this.json, shapeName);
|
|
54
|
+
|
|
55
|
+
if (!shapeJSON) {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const shapeRefItem = (0, _refs.shapeToRefItem)(this.json, shapeJSON);
|
|
60
|
+
return new _shape.ShapeModel(this, shapeRefItem);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
getShapeById(shapeId) {
|
|
64
|
+
const shapeJSON = (0, _schemaUtil.getShapeById)(this.json, shapeId);
|
|
65
|
+
|
|
66
|
+
if (!shapeJSON) {
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const shapeRefItem = (0, _refs.shapeToRefItem)(this.json, shapeJSON);
|
|
71
|
+
return new _shape.ShapeModel(this, shapeRefItem);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
getShapeByRef(shapeRef) {
|
|
75
|
+
return new _shape.ShapeModel(this, shapeRef);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
get shapes() {
|
|
79
|
+
this._cache.shapes = this._cache.shapes ?? Object.keys(this.json.shapes).map(name => new _shape.ShapeModel(this, (0, _refs.shapeNameToRef)(this.json, name)));
|
|
80
|
+
return this._cache.shapes;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
get refs() {
|
|
84
|
+
this._cache.refs = this._cache.refs ?? (0, _schemaUtil.getAllRefs)(this.json);
|
|
85
|
+
return this._cache.refs;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
getQueryByName(queryName) {
|
|
89
|
+
return new _query.QueryModel(this, 'query', queryName);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
get queries() {
|
|
93
|
+
this._cache.queries = this._cache.queries ?? Object.keys(this.json.queries).map(name => new _query.QueryModel(this, 'query', name));
|
|
94
|
+
return this._cache.queries;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
getMutationByName(mutationName) {
|
|
98
|
+
return new _query.QueryModel(this, 'mutation', mutationName);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
get mutations() {
|
|
102
|
+
this._cache.mutations = Object.keys(this.json.mutations).map(name => new _query.QueryModel(this, 'mutation', name));
|
|
103
|
+
return this._cache.mutations;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
getServiceById(serviceId) {
|
|
107
|
+
return new _service.ServiceConfig(this, serviceId);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
atRefToRefItem(atRef, template) {
|
|
111
|
+
return (0, _refs.atRefToRefItem)(this.json, atRef, template);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
refItemToShape(refItem) {
|
|
115
|
+
return new _shape.ShapeModel(this, refItem);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
getRef(refSchema) {
|
|
119
|
+
return (0, _refs.getRef)(this.json, refSchema);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
shapeNameToRef(shapeName) {
|
|
123
|
+
return (0, _refs.shapeNameToRef)(this.json, shapeName);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
shapeNameToRefItem(shapeName) {
|
|
127
|
+
return (0, _refs.shapeNameToRefItem)(this.json, shapeName);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
exports.ProjectSchema = ProjectSchema;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { QueryJSON } from '../project-schema';
|
|
2
|
+
import { ProjectSchema } from './project-schema';
|
|
3
|
+
/**
|
|
4
|
+
* Create a model object representing a query or mutation.
|
|
5
|
+
*/
|
|
6
|
+
export declare class QueryModel {
|
|
7
|
+
private readonly _queryType;
|
|
8
|
+
private readonly _queryName;
|
|
9
|
+
private readonly _rawQuery;
|
|
10
|
+
constructor(projectSchemaModel: ProjectSchema, _queryType: 'query' | 'mutation', _queryName: string);
|
|
11
|
+
get queryType(): "query" | "mutation";
|
|
12
|
+
get name(): string;
|
|
13
|
+
get json(): QueryJSON;
|
|
14
|
+
get description(): string | undefined;
|
|
15
|
+
get resolver(): import("../project-schema").Resolver;
|
|
16
|
+
get returnShape(): import("../project-schema").ReturnShape;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/models/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE/C;;GAEG;AACH,qBAAa,UAAU;IAKnB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAL7B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;gBAGpC,kBAAkB,EAAE,aAAa,EAChB,UAAU,EAAE,OAAO,GAAG,UAAU,EAChC,UAAU,EAAE,MAAM;IAKrC,IAAI,SAAS,yBAEZ;IAED,IAAI,IAAI,WAEP;IAED,IAAI,IAAI,cAEP;IAED,IAAI,WAAW,uBAEd;IAED,IAAI,QAAQ,yCAEX;IAED,IAAI,WAAW,4CAEd;CACF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.QueryModel = void 0;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Create a model object representing a query or mutation.
|
|
10
|
+
*/
|
|
11
|
+
class QueryModel {
|
|
12
|
+
constructor(projectSchemaModel, _queryType, _queryName) {
|
|
13
|
+
this._queryType = _queryType;
|
|
14
|
+
this._queryName = _queryName;
|
|
15
|
+
this._rawQuery = projectSchemaModel.json[_queryType === 'query' ? 'queries' : 'mutations'][_queryName];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
get queryType() {
|
|
19
|
+
return this._queryType;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
get name() {
|
|
23
|
+
return this._queryName;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
get json() {
|
|
27
|
+
return this._rawQuery;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
get description() {
|
|
31
|
+
return this.json.description;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
get resolver() {
|
|
35
|
+
return this.json.resolver;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
get returnShape() {
|
|
39
|
+
return this.json.shape;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
exports.QueryModel = QueryModel;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ServiceConfigJSON } from '../project-schema';
|
|
2
|
+
import { ProjectSchema } from './project-schema';
|
|
3
|
+
/**
|
|
4
|
+
* Create a model object representing a service configuration.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ServiceConfig {
|
|
7
|
+
private readonly _serviceId;
|
|
8
|
+
private readonly _storedServiceConfig;
|
|
9
|
+
constructor(projectSchemaModel: ProjectSchema, _serviceId: string);
|
|
10
|
+
get id(): string;
|
|
11
|
+
get json(): ServiceConfigJSON;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/models/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE/C;;GAEG;AACH,qBAAa,aAAa;IAGuB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAF1E,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAoB;gBAE7C,kBAAkB,EAAE,aAAa,EAAmB,UAAU,EAAE,MAAM;IAQlF,IAAI,EAAE,WAEL;IAED,IAAI,IAAI,sBAEP;CACF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ServiceConfig = void 0;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Create a model object representing a service configuration.
|
|
10
|
+
*/
|
|
11
|
+
class ServiceConfig {
|
|
12
|
+
constructor(projectSchemaModel, _serviceId) {
|
|
13
|
+
var _projectSchemaModel$j;
|
|
14
|
+
|
|
15
|
+
this._serviceId = _serviceId;
|
|
16
|
+
|
|
17
|
+
if (!((_projectSchemaModel$j = projectSchemaModel.json.services) !== null && _projectSchemaModel$j !== void 0 && _projectSchemaModel$j[_serviceId])) {
|
|
18
|
+
throw new Error(`Could not create service model for ${_serviceId}`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
this._storedServiceConfig = projectSchemaModel.json.services[_serviceId];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
get id() {
|
|
25
|
+
return this._serviceId;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
get json() {
|
|
29
|
+
return this._storedServiceConfig;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
exports.ServiceConfig = ServiceConfig;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ShapeJSON } from '../project-schema';
|
|
2
|
+
import { ProjectSchema } from './project-schema';
|
|
3
|
+
import { RefItem } from '../refs';
|
|
4
|
+
/**
|
|
5
|
+
* Create a shape model from either a ref item or a ref string such as `rick:Character`
|
|
6
|
+
*/
|
|
7
|
+
export declare class ShapeModel {
|
|
8
|
+
private readonly _projectSchemaModel;
|
|
9
|
+
private readonly _rawShape;
|
|
10
|
+
private readonly _shapeRefItem;
|
|
11
|
+
private readonly _shapeAtRef;
|
|
12
|
+
constructor(_projectSchemaModel: ProjectSchema, refArg: RefItem | string);
|
|
13
|
+
get json(): ShapeJSON;
|
|
14
|
+
get id(): string;
|
|
15
|
+
get name(): string;
|
|
16
|
+
get title(): string;
|
|
17
|
+
get description(): string | undefined;
|
|
18
|
+
get schema(): import("../project-schema").ShapeSchema;
|
|
19
|
+
get schemaPropertyList(): {
|
|
20
|
+
_propertyIterator: Map<string, import("../project-schema").PropertySchema>;
|
|
21
|
+
orderBy: (iteratees?: ((n: import("..").SchemaPropertyNode) => string)[], orders?: ("asc" | "desc")[]) => any;
|
|
22
|
+
sortWith: (comparator?: ((a: import("..").SchemaPropertyNode, b: import("..").SchemaPropertyNode) => number) | undefined) => any;
|
|
23
|
+
sortByNamesWithList: (comparatorArray?: string[] | undefined) => any;
|
|
24
|
+
filterBy: (predicate: (n: import("..").SchemaPropertyNode) => boolean) => any;
|
|
25
|
+
forEach: (iteratee: (n: import("..").SchemaPropertyNode) => void) => any;
|
|
26
|
+
getNodes: () => import("..").SchemaPropertyNode[];
|
|
27
|
+
getObject: () => Record<string, import("../project-schema").PropertySchema>;
|
|
28
|
+
getNames: () => string[];
|
|
29
|
+
getValues: () => import("../project-schema").PropertySchema[];
|
|
30
|
+
};
|
|
31
|
+
get schemaPropertyAccessor(): import("../schema-util").SchemaPropertyAccessor;
|
|
32
|
+
get refString(): string;
|
|
33
|
+
get refItem(): RefItem;
|
|
34
|
+
get serviceId(): string;
|
|
35
|
+
get modelType(): import("../project-schema").ModelType | undefined;
|
|
36
|
+
get interfaces(): string[] | undefined;
|
|
37
|
+
get isModel(): boolean;
|
|
38
|
+
get isCached(): boolean;
|
|
39
|
+
get isAsset(): boolean;
|
|
40
|
+
get isInterfaceShape(): boolean;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape.d.ts","sourceRoot":"","sources":["../../../src/models/shape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAC,OAAO,EAAiB,MAAM,SAAS,CAAC;AAUhD;;GAEG;AACH,qBAAa,UAAU;IAIT,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IAHhD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IACtC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAU;IACxC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;gBACR,mBAAmB,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM;IAsBzF,IAAI,IAAI,cAEP;IAED,IAAI,EAAE,WAEL;IAED,IAAI,IAAI,WAEP;IAED,IAAI,KAAK,WAER;IAED,IAAI,WAAW,uBAEd;IAED,IAAI,MAAM,4CAET;IAED,IAAI,kBAAkB;;;;;;;;;;;MAErB;IAED,IAAI,sBAAsB,oDAEzB;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,OAAO,YAEV;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,SAAS,sDAEZ;IAED,IAAI,UAAU,yBAEb;IAED,IAAI,OAAO,YAEV;IAED,IAAI,QAAQ,YAEX;IAED,IAAI,OAAO,YAEV;IAED,IAAI,gBAAgB,YAEnB;CACF"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ShapeModel = void 0;
|
|
7
|
+
|
|
8
|
+
var _refs = require("../refs");
|
|
9
|
+
|
|
10
|
+
var _schemaUtil = require("../schema-util");
|
|
11
|
+
|
|
12
|
+
var _interfaces = require("../interfaces");
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Create a shape model from either a ref item or a ref string such as `rick:Character`
|
|
16
|
+
*/
|
|
17
|
+
class ShapeModel {
|
|
18
|
+
constructor(_projectSchemaModel, refArg) {
|
|
19
|
+
this._projectSchemaModel = _projectSchemaModel;
|
|
20
|
+
|
|
21
|
+
if (typeof refArg === 'string') {
|
|
22
|
+
const rawShape = (0, _schemaUtil.getShapeByRef)(_projectSchemaModel.json, refArg);
|
|
23
|
+
|
|
24
|
+
if (!rawShape) {
|
|
25
|
+
throw new Error(`Error creating shape model: ${refArg} is not in project schema`);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
this._rawShape = rawShape;
|
|
29
|
+
this._shapeRefItem = _projectSchemaModel.atRefToRefItem(refArg);
|
|
30
|
+
this._shapeAtRef = refArg;
|
|
31
|
+
} else {
|
|
32
|
+
const rawShape = (0, _refs.refItemToShape)(_projectSchemaModel.json, refArg);
|
|
33
|
+
|
|
34
|
+
if (!rawShape) {
|
|
35
|
+
throw new Error(`Error creating shape model: ref item argument could not be resolved to a shape`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
this._rawShape = rawShape;
|
|
39
|
+
this._shapeRefItem = refArg;
|
|
40
|
+
this._shapeAtRef = `${refArg.serviceKey}:${refArg.typeName}`;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
get json() {
|
|
45
|
+
return this._rawShape;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
get id() {
|
|
49
|
+
return this._rawShape.id;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
get name() {
|
|
53
|
+
return this._rawShape.name;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
get title() {
|
|
57
|
+
return this._rawShape.title;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
get description() {
|
|
61
|
+
return this._rawShape.description;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
get schema() {
|
|
65
|
+
return this._rawShape.schema;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
get schemaPropertyList() {
|
|
69
|
+
return (0, _schemaUtil.createSchemaPropertyList)(this._projectSchemaModel.json, this._rawShape);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
get schemaPropertyAccessor() {
|
|
73
|
+
return (0, _schemaUtil.createSchemaPropertyAccessor)(this._projectSchemaModel.json, this._rawShape);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
get refString() {
|
|
77
|
+
return this._shapeAtRef;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
get refItem() {
|
|
81
|
+
return this._shapeRefItem;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
get serviceId() {
|
|
85
|
+
return this._shapeRefItem.serviceKey;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
get modelType() {
|
|
89
|
+
var _this$_rawShape$model;
|
|
90
|
+
|
|
91
|
+
return (_this$_rawShape$model = this._rawShape.model) === null || _this$_rawShape$model === void 0 ? void 0 : _this$_rawShape$model.type;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
get interfaces() {
|
|
95
|
+
return this._rawShape.interfaces;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
get isModel() {
|
|
99
|
+
return (0, _schemaUtil.isModelShape)(this._rawShape);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
get isCached() {
|
|
103
|
+
return (0, _schemaUtil.isCachedShape)(this._rawShape);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
get isAsset() {
|
|
107
|
+
return this._rawShape.id === 'ASSET';
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
get isInterfaceShape() {
|
|
111
|
+
return (0, _interfaces.isInterfaceShape)(this._rawShape);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
exports.ShapeModel = ShapeModel;
|