cruddl 3.3.1 → 3.3.2
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/src/cruddl-version.js +1 -1
- package/dist/src/meta-schema/meta-schema.js +19 -17
- package/dist/src/meta-schema/meta-schema.js.map +1 -1
- package/package.json +1 -1
- package/dist/spec/authorization/move-errors-to-output-nodes.spec.d.ts +0 -1
- package/dist/spec/authorization/move-errors-to-output-nodes.spec.js +0 -111
- package/dist/spec/authorization/move-errors-to-output-nodes.spec.js.map +0 -1
- package/dist/spec/authorization/permission-descriptor.spec.d.ts +0 -1
- package/dist/spec/authorization/permission-descriptor.spec.js +0 -85
- package/dist/spec/authorization/permission-descriptor.spec.js.map +0 -1
- package/dist/spec/authorization/permission-profile.spec.d.ts +0 -1
- package/dist/spec/authorization/permission-profile.spec.js +0 -110
- package/dist/spec/authorization/permission-profile.spec.js.map +0 -1
- package/dist/spec/database/arangodb/aql-generator.spec.d.ts +0 -1
- package/dist/spec/database/arangodb/aql-generator.spec.js +0 -21
- package/dist/spec/database/arangodb/aql-generator.spec.js.map +0 -1
- package/dist/spec/database/arangodb/aql.spec.d.ts +0 -1
- package/dist/spec/database/arangodb/aql.spec.js +0 -78
- package/dist/spec/database/arangodb/aql.spec.js.map +0 -1
- package/dist/spec/database/arangodb/arangodb-adapter.spec.d.ts +0 -1
- package/dist/spec/database/arangodb/arangodb-adapter.spec.js +0 -192
- package/dist/spec/database/arangodb/arangodb-adapter.spec.js.map +0 -1
- package/dist/spec/database/arangodb/arangodb-test-utils.d.ts +0 -1
- package/dist/spec/database/arangodb/arangodb-test-utils.js +0 -8
- package/dist/spec/database/arangodb/arangodb-test-utils.js.map +0 -1
- package/dist/spec/database/arangodb/retry.spec.d.ts +0 -1
- package/dist/spec/database/arangodb/retry.spec.js +0 -74
- package/dist/spec/database/arangodb/retry.spec.js.map +0 -1
- package/dist/spec/database/arangodb/schema-migration/arango-search-helper.spec.d.ts +0 -1
- package/dist/spec/database/arangodb/schema-migration/arango-search-helper.spec.js +0 -76
- package/dist/spec/database/arangodb/schema-migration/arango-search-helper.spec.js.map +0 -1
- package/dist/spec/database/arangodb/ttl.spec.d.ts +0 -1
- package/dist/spec/database/arangodb/ttl.spec.js +0 -346
- package/dist/spec/database/arangodb/ttl.spec.js.map +0 -1
- package/dist/spec/database/like-helper.spec.d.ts +0 -1
- package/dist/spec/database/like-helper.spec.js +0 -87
- package/dist/spec/database/like-helper.spec.js.map +0 -1
- package/dist/spec/dev/fast-server.d.ts +0 -4
- package/dist/spec/dev/fast-server.js +0 -57
- package/dist/spec/dev/fast-server.js.map +0 -1
- package/dist/spec/dev/server.d.ts +0 -12
- package/dist/spec/dev/server.js +0 -121
- package/dist/spec/dev/server.js.map +0 -1
- package/dist/spec/dev/start.d.ts +0 -1
- package/dist/spec/dev/start.js +0 -10
- package/dist/spec/dev/start.js.map +0 -1
- package/dist/spec/graphql/query-distiller.spec.d.ts +0 -1
- package/dist/spec/graphql/query-distiller.spec.js +0 -220
- package/dist/spec/graphql/query-distiller.spec.js.map +0 -1
- package/dist/spec/helpers/log4js-logger-provider.d.ts +0 -11
- package/dist/spec/helpers/log4js-logger-provider.js +0 -18
- package/dist/spec/helpers/log4js-logger-provider.js.map +0 -1
- package/dist/spec/init.mocha.d.ts +0 -1
- package/dist/spec/init.mocha.js +0 -11
- package/dist/spec/init.mocha.js.map +0 -1
- package/dist/spec/meta-schema/meta-schema.spec.d.ts +0 -1
- package/dist/spec/meta-schema/meta-schema.spec.js +0 -951
- package/dist/spec/meta-schema/meta-schema.spec.js.map +0 -1
- package/dist/spec/model/create-model.spec.d.ts +0 -1
- package/dist/spec/model/create-model.spec.js +0 -158
- package/dist/spec/model/create-model.spec.js.map +0 -1
- package/dist/spec/model/implementation/billing-validation.spec.d.ts +0 -1
- package/dist/spec/model/implementation/billing-validation.spec.js +0 -180
- package/dist/spec/model/implementation/billing-validation.spec.js.map +0 -1
- package/dist/spec/model/implementation/collect-path.spec.d.ts +0 -1
- package/dist/spec/model/implementation/collect-path.spec.js +0 -678
- package/dist/spec/model/implementation/collect-path.spec.js.map +0 -1
- package/dist/spec/model/implementation/entity-extenion-type.spec.d.ts +0 -1
- package/dist/spec/model/implementation/entity-extenion-type.spec.js +0 -71
- package/dist/spec/model/implementation/entity-extenion-type.spec.js.map +0 -1
- package/dist/spec/model/implementation/field.spec.d.ts +0 -1
- package/dist/spec/model/implementation/field.spec.js +0 -648
- package/dist/spec/model/implementation/field.spec.js.map +0 -1
- package/dist/spec/model/implementation/flex-search-validation.spec.d.ts +0 -1
- package/dist/spec/model/implementation/flex-search-validation.spec.js +0 -288
- package/dist/spec/model/implementation/flex-search-validation.spec.js.map +0 -1
- package/dist/spec/model/implementation/i18n-fields.spec.d.ts +0 -1
- package/dist/spec/model/implementation/i18n-fields.spec.js +0 -208
- package/dist/spec/model/implementation/i18n-fields.spec.js.map +0 -1
- package/dist/spec/model/implementation/i18n-types.spec.d.ts +0 -1
- package/dist/spec/model/implementation/i18n-types.spec.js +0 -160
- package/dist/spec/model/implementation/i18n-types.spec.js.map +0 -1
- package/dist/spec/model/implementation/i18n-validation.spec.d.ts +0 -1
- package/dist/spec/model/implementation/i18n-validation.spec.js +0 -210
- package/dist/spec/model/implementation/i18n-validation.spec.js.map +0 -1
- package/dist/spec/model/implementation/indices.spec.d.ts +0 -1
- package/dist/spec/model/implementation/indices.spec.js +0 -96
- package/dist/spec/model/implementation/indices.spec.js.map +0 -1
- package/dist/spec/model/implementation/model.spec.d.ts +0 -1
- package/dist/spec/model/implementation/model.spec.js +0 -101
- package/dist/spec/model/implementation/model.spec.js.map +0 -1
- package/dist/spec/model/implementation/namespace.spec.d.ts +0 -1
- package/dist/spec/model/implementation/namespace.spec.js +0 -231
- package/dist/spec/model/implementation/namespace.spec.js.map +0 -1
- package/dist/spec/model/implementation/object-type.spec.d.ts +0 -1
- package/dist/spec/model/implementation/object-type.spec.js +0 -65
- package/dist/spec/model/implementation/object-type.spec.js.map +0 -1
- package/dist/spec/model/implementation/relation.spec.d.ts +0 -1
- package/dist/spec/model/implementation/relation.spec.js +0 -99
- package/dist/spec/model/implementation/relation.spec.js.map +0 -1
- package/dist/spec/model/implementation/root-entity-type.spec.d.ts +0 -1
- package/dist/spec/model/implementation/root-entity-type.spec.js +0 -470
- package/dist/spec/model/implementation/root-entity-type.spec.js.map +0 -1
- package/dist/spec/model/implementation/type.spec.d.ts +0 -1
- package/dist/spec/model/implementation/type.spec.js +0 -52
- package/dist/spec/model/implementation/type.spec.js.map +0 -1
- package/dist/spec/model/implementation/validation-utils.d.ts +0 -7
- package/dist/spec/model/implementation/validation-utils.js +0 -34
- package/dist/spec/model/implementation/validation-utils.js.map +0 -1
- package/dist/spec/model/model-spec.helper.d.ts +0 -3
- package/dist/spec/model/model-spec.helper.js +0 -35
- package/dist/spec/model/model-spec.helper.js.map +0 -1
- package/dist/spec/performance/associations.perf.d.ts +0 -3
- package/dist/spec/performance/associations.perf.js +0 -78
- package/dist/spec/performance/associations.perf.js.map +0 -1
- package/dist/spec/performance/count.perf.d.ts +0 -5
- package/dist/spec/performance/count.perf.js +0 -52
- package/dist/spec/performance/count.perf.js.map +0 -1
- package/dist/spec/performance/crud.perf.d.ts +0 -3
- package/dist/spec/performance/crud.perf.js +0 -100
- package/dist/spec/performance/crud.perf.js.map +0 -1
- package/dist/spec/performance/filter.perf.d.ts +0 -3
- package/dist/spec/performance/filter.perf.js +0 -32
- package/dist/spec/performance/filter.perf.js.map +0 -1
- package/dist/spec/performance/index.d.ts +0 -1
- package/dist/spec/performance/index.js +0 -21
- package/dist/spec/performance/index.js.map +0 -1
- package/dist/spec/performance/pagination.perf.d.ts +0 -5
- package/dist/spec/performance/pagination.perf.js +0 -50
- package/dist/spec/performance/pagination.perf.js.map +0 -1
- package/dist/spec/performance/query-pipeline.perf.d.ts +0 -3
- package/dist/spec/performance/query-pipeline.perf.js +0 -196
- package/dist/spec/performance/query-pipeline.perf.js.map +0 -1
- package/dist/spec/performance/references.perf.d.ts +0 -3
- package/dist/spec/performance/references.perf.js +0 -62
- package/dist/spec/performance/references.perf.js.map +0 -1
- package/dist/spec/performance/support/async-bench.d.ts +0 -92
- package/dist/spec/performance/support/async-bench.js +0 -237
- package/dist/spec/performance/support/async-bench.js.map +0 -1
- package/dist/spec/performance/support/helpers.d.ts +0 -28
- package/dist/spec/performance/support/helpers.js +0 -130
- package/dist/spec/performance/support/helpers.js.map +0 -1
- package/dist/spec/performance/support/runner.d.ts +0 -2
- package/dist/spec/performance/support/runner.js +0 -72
- package/dist/spec/performance/support/runner.js.map +0 -1
- package/dist/spec/project/project.spec.d.ts +0 -1
- package/dist/spec/project/project.spec.js +0 -72
- package/dist/spec/project/project.spec.js.map +0 -1
- package/dist/spec/query-tree/utils/simplify-booleans.spec.d.ts +0 -1
- package/dist/spec/query-tree/utils/simplify-booleans.spec.js +0 -87
- package/dist/spec/query-tree/utils/simplify-booleans.spec.js.map +0 -1
- package/dist/spec/regression/drop-test-db.d.ts +0 -1
- package/dist/spec/regression/drop-test-db.js +0 -5
- package/dist/spec/regression/drop-test-db.js.map +0 -1
- package/dist/spec/regression/initialization.d.ts +0 -10
- package/dist/spec/regression/initialization.js +0 -148
- package/dist/spec/regression/initialization.js.map +0 -1
- package/dist/spec/regression/regression-suite.d.ts +0 -28
- package/dist/spec/regression/regression-suite.js +0 -228
- package/dist/spec/regression/regression-suite.js.map +0 -1
- package/dist/spec/regression/regressions.spec.d.ts +0 -1
- package/dist/spec/regression/regressions.spec.js +0 -54
- package/dist/spec/regression/regressions.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/business-object.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/business-object.spec.js +0 -27
- package/dist/spec/schema/ast-validation-modules/business-object.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/check-directed-relation-edges-validator.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/check-directed-relation-edges-validator.spec.js +0 -73
- package/dist/spec/schema/ast-validation-modules/check-directed-relation-edges-validator.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/collect-validation.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/collect-validation.spec.js +0 -633
- package/dist/spec/schema/ast-validation-modules/collect-validation.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/entity-directive-nesting-validator.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/entity-directive-nesting-validator.spec.js +0 -94
- package/dist/spec/schema/ast-validation-modules/entity-directive-nesting-validator.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/flex-search-commit-interval-msec-validator.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/flex-search-commit-interval-msec-validator.spec.js +0 -235
- package/dist/spec/schema/ast-validation-modules/flex-search-commit-interval-msec-validator.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/helpers.d.ts +0 -10
- package/dist/spec/schema/ast-validation-modules/helpers.js +0 -85
- package/dist/spec/schema/ast-validation-modules/helpers.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/illegal-enum-values.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/illegal-enum-values.spec.js +0 -24
- package/dist/spec/schema/ast-validation-modules/illegal-enum-values.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/indices-validator.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/indices-validator.spec.js +0 -117
- package/dist/spec/schema/ast-validation-modules/indices-validator.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/key-field-validator.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/key-field-validator.spec.js +0 -139
- package/dist/spec/schema/ast-validation-modules/key-field-validator.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/known-field-directive-validator.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/known-field-directive-validator.spec.js +0 -27
- package/dist/spec/schema/ast-validation-modules/known-field-directive-validator.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/known-object-type-directive-validator.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/known-object-type-directive-validator.spec.js +0 -31
- package/dist/spec/schema/ast-validation-modules/known-object-type-directive-validator.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/no-duplicate-types-validator.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/no-duplicate-types-validator.spec.js +0 -32
- package/dist/spec/schema/ast-validation-modules/no-duplicate-types-validator.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/no-lists-of-lists-validator.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/no-lists-of-lists-validator.spec.js +0 -27
- package/dist/spec/schema/ast-validation-modules/no-lists-of-lists-validator.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/no-lists-of-references-validator.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/no-lists-of-references-validator.spec.js +0 -27
- package/dist/spec/schema/ast-validation-modules/no-lists-of-references-validator.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/no-unused-non-root-object-types-validator.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/no-unused-non-root-object-types-validator.spec.js +0 -27
- package/dist/spec/schema/ast-validation-modules/no-unused-non-root-object-types-validator.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/non-unique-fields-validator.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/non-unique-fields-validator.spec.js +0 -29
- package/dist/spec/schema/ast-validation-modules/non-unique-fields-validator.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/object-directive-count-validator.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/object-directive-count-validator.spec.js +0 -53
- package/dist/spec/schema/ast-validation-modules/object-directive-count-validator.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/only-allowed-types-validator.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/only-allowed-types-validator.spec.js +0 -30
- package/dist/spec/schema/ast-validation-modules/only-allowed-types-validator.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/parent-field.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/parent-field.spec.js +0 -451
- package/dist/spec/schema/ast-validation-modules/parent-field.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/references-only-to-root-entities-with-key-field-validator.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/references-only-to-root-entities-with-key-field-validator.spec.js +0 -40
- package/dist/spec/schema/ast-validation-modules/references-only-to-root-entities-with-key-field-validator.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/references-with-key-field.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/references-with-key-field.spec.js +0 -74
- package/dist/spec/schema/ast-validation-modules/references-with-key-field.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/relations-only-in-root-entities-validator.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/relations-only-in-root-entities-validator.spec.js +0 -26
- package/dist/spec/schema/ast-validation-modules/relations-only-in-root-entities-validator.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/relations-only-to-root-entities-validator.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/relations-only-to-root-entities-validator.spec.js +0 -26
- package/dist/spec/schema/ast-validation-modules/relations-only-to-root-entities-validator.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/relations.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/relations.spec.js +0 -145
- package/dist/spec/schema/ast-validation-modules/relations.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/roles-and-permission-profile-combined.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/roles-and-permission-profile-combined.spec.js +0 -31
- package/dist/spec/schema/ast-validation-modules/roles-and-permission-profile-combined.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/roles-on-non-root-entity-types.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/roles-on-non-root-entity-types.spec.js +0 -35
- package/dist/spec/schema/ast-validation-modules/roles-on-non-root-entity-types.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/root-entities-without-read-roles.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/root-entities-without-read-roles.spec.js +0 -27
- package/dist/spec/schema/ast-validation-modules/root-entities-without-read-roles.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/root-field.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/root-field.spec.js +0 -405
- package/dist/spec/schema/ast-validation-modules/root-field.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/ttl.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/ttl.spec.js +0 -362
- package/dist/spec/schema/ast-validation-modules/ttl.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/undefined-permission-profile.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/undefined-permission-profile.spec.js +0 -79
- package/dist/spec/schema/ast-validation-modules/undefined-permission-profile.spec.js.map +0 -1
- package/dist/spec/schema/ast-validation-modules/undefined-types.spec.d.ts +0 -1
- package/dist/spec/schema/ast-validation-modules/undefined-types.spec.js +0 -38
- package/dist/spec/schema/ast-validation-modules/undefined-types.spec.js.map +0 -1
- package/dist/spec/schema/preparation/ast-transformation-modules/add-namespaces-to-types-transformer.spec.d.ts +0 -1
- package/dist/spec/schema/preparation/ast-transformation-modules/add-namespaces-to-types-transformer.spec.js +0 -53
- package/dist/spec/schema/preparation/ast-transformation-modules/add-namespaces-to-types-transformer.spec.js.map +0 -1
- package/dist/spec/schema/scalars/date-time.spec.d.ts +0 -1
- package/dist/spec/schema/scalars/date-time.spec.js +0 -74
- package/dist/spec/schema/scalars/date-time.spec.js.map +0 -1
- package/dist/spec/schema/scalars/fixed-point-decimals.spec.d.ts +0 -1
- package/dist/spec/schema/scalars/fixed-point-decimals.spec.js +0 -66
- package/dist/spec/schema/scalars/fixed-point-decimals.spec.js.map +0 -1
- package/dist/spec/schema/scalars/int53.spec.d.ts +0 -1
- package/dist/spec/schema/scalars/int53.spec.js +0 -45
- package/dist/spec/schema/scalars/int53.spec.js.map +0 -1
- package/dist/spec/schema/scalars/local-date.spec.d.ts +0 -1
- package/dist/spec/schema/scalars/local-date.spec.js +0 -30
- package/dist/spec/schema/scalars/local-date.spec.js.map +0 -1
- package/dist/spec/schema/scalars/local-time.spec.d.ts +0 -1
- package/dist/spec/schema/scalars/local-time.spec.js +0 -64
- package/dist/spec/schema/scalars/local-time.spec.js.map +0 -1
- package/dist/spec/schema/scalars/offset-date-time.spec.d.ts +0 -1
- package/dist/spec/schema/scalars/offset-date-time.spec.js +0 -82
- package/dist/spec/schema/scalars/offset-date-time.spec.js.map +0 -1
- package/dist/spec/schema/scalars/string-map.spec.d.ts +0 -1
- package/dist/spec/schema/scalars/string-map.spec.js +0 -230
- package/dist/spec/schema/scalars/string-map.spec.js.map +0 -1
- package/dist/spec/schema/schema-builder.spec.d.ts +0 -1
- package/dist/spec/schema/schema-builder.spec.js +0 -105
- package/dist/spec/schema/schema-builder.spec.js.map +0 -1
- package/dist/spec/schema/source-validation-modules/check-graphql-syntax.spec.d.ts +0 -1
- package/dist/spec/schema/source-validation-modules/check-graphql-syntax.spec.js +0 -30
- package/dist/spec/schema/source-validation-modules/check-graphql-syntax.spec.js.map +0 -1
- package/dist/spec/schema/source-validation-modules/check-json-syntax.spec.d.ts +0 -1
- package/dist/spec/schema/source-validation-modules/check-json-syntax.spec.js +0 -36
- package/dist/spec/schema/source-validation-modules/check-json-syntax.spec.js.map +0 -1
- package/dist/spec/schema/source-validation-modules/check-yaml-syntax.spec.d.ts +0 -1
- package/dist/spec/schema/source-validation-modules/check-yaml-syntax.spec.js +0 -30
- package/dist/spec/schema/source-validation-modules/check-yaml-syntax.spec.js.map +0 -1
- package/dist/spec/schema/source-validation-modules/graphql-rules.spec.d.ts +0 -1
- package/dist/spec/schema/source-validation-modules/graphql-rules.spec.js +0 -89
- package/dist/spec/schema/source-validation-modules/graphql-rules.spec.js.map +0 -1
- package/dist/spec/schema/source-validation-modules/permission-profile-validator.spec.d.ts +0 -1
- package/dist/spec/schema/source-validation-modules/permission-profile-validator.spec.js +0 -99
- package/dist/spec/schema/source-validation-modules/permission-profile-validator.spec.js.map +0 -1
- package/dist/spec/schema/source-validation-modules/sidecar-schema.spec.d.ts +0 -1
- package/dist/spec/schema/source-validation-modules/sidecar-schema.spec.js +0 -145
- package/dist/spec/schema/source-validation-modules/sidecar-schema.spec.js.map +0 -1
- package/dist/spec/schema/source-validation-modules/source-validation-helper.d.ts +0 -3
- package/dist/spec/schema/source-validation-modules/source-validation-helper.js +0 -12
- package/dist/spec/schema/source-validation-modules/source-validation-helper.js.map +0 -1
- package/dist/spec/schema/source-validation-modules/yaml-parser.spec.d.ts +0 -1
- package/dist/spec/schema/source-validation-modules/yaml-parser.spec.js +0 -87
- package/dist/spec/schema/source-validation-modules/yaml-parser.spec.js.map +0 -1
- package/dist/spec/schema-generation/create-input-type-generator.spec.d.ts +0 -1
- package/dist/spec/schema-generation/create-input-type-generator.spec.js +0 -518
- package/dist/spec/schema-generation/create-input-type-generator.spec.js.map +0 -1
- package/dist/spec/schema-generation/createdat-updatedat-modification.spec.d.ts +0 -1
- package/dist/spec/schema-generation/createdat-updatedat-modification.spec.js +0 -160
- package/dist/spec/schema-generation/createdat-updatedat-modification.spec.js.map +0 -1
- package/dist/spec/schema-generation/enum-type-generator.spec.d.ts +0 -1
- package/dist/spec/schema-generation/enum-type-generator.spec.js +0 -21
- package/dist/spec/schema-generation/enum-type-generator.spec.js.map +0 -1
- package/dist/spec/schema-generation/memorize-decorator.spec.d.ts +0 -1
- package/dist/spec/schema-generation/memorize-decorator.spec.js +0 -39
- package/dist/spec/schema-generation/memorize-decorator.spec.js.map +0 -1
- package/dist/spec/schema-generation/order-by-enum-generator.spec.d.ts +0 -1
- package/dist/spec/schema-generation/order-by-enum-generator.spec.js +0 -188
- package/dist/spec/schema-generation/order-by-enum-generator.spec.js.map +0 -1
- package/dist/spec/utils/group-by-equivalence.spec.d.ts +0 -1
- package/dist/spec/utils/group-by-equivalence.spec.js +0 -11
- package/dist/spec/utils/group-by-equivalence.spec.js.map +0 -1
- package/dist/spec/utils/utils.spec.d.ts +0 -1
- package/dist/spec/utils/utils.spec.js +0 -24
- package/dist/spec/utils/utils.spec.js.map +0 -1
- package/dist/spec/utils/visitor.spec.d.ts +0 -1
- package/dist/spec/utils/visitor.spec.js +0 -119
- package/dist/spec/utils/visitor.spec.js.map +0 -1
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getMessages = void 0;
|
|
4
|
-
const validation_1 = require("../../../src/model/validation");
|
|
5
|
-
const schema_builder_1 = require("../../../src/schema/schema-builder");
|
|
6
|
-
function getMessages(source) {
|
|
7
|
-
const validationContext = new validation_1.ValidationContext();
|
|
8
|
-
(0, schema_builder_1.parseProjectSource)(source, {}, validationContext);
|
|
9
|
-
return validationContext.asResult().messages;
|
|
10
|
-
}
|
|
11
|
-
exports.getMessages = getMessages;
|
|
12
|
-
//# sourceMappingURL=source-validation-helper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"source-validation-helper.js","sourceRoot":"","sources":["../../../../spec/schema/source-validation-modules/source-validation-helper.ts"],"names":[],"mappings":";;;AAAA,8DAAqF;AAErF,uEAAwE;AAExE,SAAgB,WAAW,CAAC,MAAqB;IAC7C,MAAM,iBAAiB,GAAG,IAAI,8BAAiB,EAAE,CAAC;IAClD,IAAA,mCAAkB,EAAC,MAAM,EAAE,EAAE,EAAE,iBAAiB,CAAC,CAAC;IAElD,OAAO,iBAAiB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC;AACjD,CAAC;AALD,kCAKC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const parsed_project_1 = require("../../../src/config/parsed-project");
|
|
4
|
-
const validation_1 = require("../../../src/model/validation");
|
|
5
|
-
const source_1 = require("../../../src/project/source");
|
|
6
|
-
const chai_1 = require("chai");
|
|
7
|
-
const schema_builder_1 = require("../../../src/schema/schema-builder");
|
|
8
|
-
const yamlContent = `
|
|
9
|
-
a:
|
|
10
|
-
b:
|
|
11
|
-
c: apfel
|
|
12
|
-
d:
|
|
13
|
-
- test1
|
|
14
|
-
- test2
|
|
15
|
-
- test3
|
|
16
|
-
e:
|
|
17
|
-
- 0
|
|
18
|
-
- 1
|
|
19
|
-
- 2
|
|
20
|
-
|
|
21
|
-
`;
|
|
22
|
-
const correspondingObject = {
|
|
23
|
-
a: { b: { c: 'apfel' } },
|
|
24
|
-
d: ['test1', 'test2', 'test3'],
|
|
25
|
-
e: [0, 1, 2],
|
|
26
|
-
};
|
|
27
|
-
describe('YAML parser and validator', () => {
|
|
28
|
-
it('returns the right message locations', () => {
|
|
29
|
-
const source = new source_1.ProjectSource('test.yaml', yamlContent);
|
|
30
|
-
const validationContext = new validation_1.ValidationContext();
|
|
31
|
-
const result = (0, schema_builder_1.parseProjectSource)(source, {}, validationContext);
|
|
32
|
-
if (!result) {
|
|
33
|
-
(0, chai_1.expect)(result).not.to.be.undefined;
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
if (result.kind == parsed_project_1.ParsedProjectSourceBaseKind.OBJECT) {
|
|
37
|
-
(0, chai_1.expect)(result.pathLocationMap['/a']._start).to.be.eq(1);
|
|
38
|
-
(0, chai_1.expect)(result.pathLocationMap['/a']._end).to.be.eq(21);
|
|
39
|
-
(0, chai_1.expect)(result.pathLocationMap['/a/b']._start).to.be.eq(6);
|
|
40
|
-
(0, chai_1.expect)(result.pathLocationMap['/a/b']._end).to.be.eq(21);
|
|
41
|
-
(0, chai_1.expect)(result.pathLocationMap['/a/b/c']._start).to.be.eq(13);
|
|
42
|
-
(0, chai_1.expect)(result.pathLocationMap['/a/b/c']._end).to.be.eq(21);
|
|
43
|
-
(0, chai_1.expect)(result.pathLocationMap['/a'].start.line).to.be.eq(2);
|
|
44
|
-
(0, chai_1.expect)(result.pathLocationMap['/a/b'].start.line).to.be.eq(3);
|
|
45
|
-
(0, chai_1.expect)(result.pathLocationMap['/a/b/c'].start.line).to.be.eq(4);
|
|
46
|
-
(0, chai_1.expect)(result.pathLocationMap['/d/0'].start.line).to.be.eq(6);
|
|
47
|
-
(0, chai_1.expect)(result.pathLocationMap['/d/0'].start.column).to.be.eq(5);
|
|
48
|
-
(0, chai_1.expect)(result.pathLocationMap['/d/0'].end.line).to.be.eq(6);
|
|
49
|
-
(0, chai_1.expect)(result.pathLocationMap['/d/0'].end.column).to.be.eq(10);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
(0, chai_1.expect)(result.kind).to.eq(parsed_project_1.ParsedProjectSourceBaseKind.OBJECT);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
it('can extract the corresponding json data', () => {
|
|
56
|
-
const source = new source_1.ProjectSource('test.yaml', yamlContent);
|
|
57
|
-
const validationContext = new validation_1.ValidationContext();
|
|
58
|
-
const result = (0, schema_builder_1.parseProjectSource)(source, {}, validationContext);
|
|
59
|
-
if (!result) {
|
|
60
|
-
(0, chai_1.expect)(result).not.to.be.undefined;
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
if (result.kind == parsed_project_1.ParsedProjectSourceBaseKind.OBJECT) {
|
|
64
|
-
(0, chai_1.expect)(result.object).to.deep.equals(correspondingObject);
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
(0, chai_1.expect)(result.kind).to.eq(parsed_project_1.ParsedProjectSourceBaseKind.OBJECT);
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
it('accepts empty files', () => {
|
|
71
|
-
const source = new source_1.ProjectSource('test.yaml', '');
|
|
72
|
-
const validationContext = new validation_1.ValidationContext();
|
|
73
|
-
const result = (0, schema_builder_1.parseProjectSource)(source, {}, validationContext);
|
|
74
|
-
(0, chai_1.expect)(validationContext.asResult().hasErrors(), validationContext.asResult().toString()).to
|
|
75
|
-
.be.false;
|
|
76
|
-
(0, chai_1.expect)(result).to.be.undefined;
|
|
77
|
-
});
|
|
78
|
-
it('does not break when node is undefined', () => {
|
|
79
|
-
const source = new source_1.ProjectSource('test.yaml', `
|
|
80
|
-
i18n:
|
|
81
|
-
de: `);
|
|
82
|
-
const validationContext = new validation_1.ValidationContext();
|
|
83
|
-
const result = (0, schema_builder_1.parseProjectSource)(source, {}, validationContext);
|
|
84
|
-
(0, chai_1.expect)(result).to.not.be.undefined;
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
//# sourceMappingURL=yaml-parser.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"yaml-parser.spec.js","sourceRoot":"","sources":["../../../../spec/schema/source-validation-modules/yaml-parser.spec.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,518 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const chai_1 = require("chai");
|
|
4
|
-
const graphql_1 = require("graphql");
|
|
5
|
-
const model_1 = require("../../src/model");
|
|
6
|
-
const create_input_types_1 = require("../../src/schema-generation/create-input-types");
|
|
7
|
-
const enum_type_generator_1 = require("../../src/schema-generation/enum-type-generator");
|
|
8
|
-
const query_node_object_type_1 = require("../../src/schema-generation/query-node-object-type");
|
|
9
|
-
describe('CreateInputTypeGenerator', () => {
|
|
10
|
-
const model = new model_1.Model({ types: [] });
|
|
11
|
-
const generator = new create_input_types_1.CreateInputTypeGenerator(new enum_type_generator_1.EnumTypeGenerator());
|
|
12
|
-
const context = (0, query_node_object_type_1.createRootFieldContext)();
|
|
13
|
-
describe('with simple scalar fields', () => {
|
|
14
|
-
const type = new model_1.RootEntityType({
|
|
15
|
-
kind: model_1.TypeKind.ROOT_ENTITY,
|
|
16
|
-
name: 'Hero',
|
|
17
|
-
fields: [
|
|
18
|
-
{
|
|
19
|
-
name: 'name',
|
|
20
|
-
typeName: 'String',
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
}, model);
|
|
24
|
-
const inputType = generator.generate(type);
|
|
25
|
-
it('includes them in the input type', () => {
|
|
26
|
-
(0, chai_1.expect)(inputType.getInputType().getFields()['name'].type).to.equal(graphql_1.GraphQLString);
|
|
27
|
-
});
|
|
28
|
-
describe('prepare()', () => {
|
|
29
|
-
it('includes it if specified', () => {
|
|
30
|
-
const prepared = inputType.prepareValue({ name: 'Batman' }, context);
|
|
31
|
-
(0, chai_1.expect)(prepared.name).to.equal('Batman');
|
|
32
|
-
});
|
|
33
|
-
it('includes it if set to null', () => {
|
|
34
|
-
// mimic the update case where setting to null does not remove the property but sets it to null
|
|
35
|
-
const prepared = inputType.prepareValue({ name: null }, context);
|
|
36
|
-
(0, chai_1.expect)(prepared.name).to.be.null;
|
|
37
|
-
});
|
|
38
|
-
it('does not include it it if not specified', () => {
|
|
39
|
-
const prepared = inputType.prepareValue({}, context);
|
|
40
|
-
(0, chai_1.expect)(prepared.name).to.be.undefined;
|
|
41
|
-
});
|
|
42
|
-
it('does not include non-existing fields', () => {
|
|
43
|
-
const prepared = inputType.prepareValue({ somethingElse: 'yt' }, context);
|
|
44
|
-
(0, chai_1.expect)(prepared.somethingElse).to.be.undefined;
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
describe('getAffectedFields()', () => {
|
|
48
|
-
it('includes it if specified', () => {
|
|
49
|
-
const fields = inputType.getAffectedFields({ name: 'Batman' }, context);
|
|
50
|
-
(0, chai_1.expect)(fields).to.deep.equal([type.getFieldOrThrow('name')]);
|
|
51
|
-
});
|
|
52
|
-
it('includes it if specified as null', () => {
|
|
53
|
-
const fields = inputType.getAffectedFields({ name: null }, context);
|
|
54
|
-
(0, chai_1.expect)(fields).to.deep.equal([type.getFieldOrThrow('name')]);
|
|
55
|
-
});
|
|
56
|
-
it('does not include it if not specified', () => {
|
|
57
|
-
const fields = inputType.getAffectedFields({}, context);
|
|
58
|
-
(0, chai_1.expect)(fields).be.empty;
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
describe('with enum fields', () => {
|
|
63
|
-
const model = new model_1.Model({
|
|
64
|
-
types: [
|
|
65
|
-
{
|
|
66
|
-
kind: model_1.TypeKind.ENUM,
|
|
67
|
-
name: 'Morality',
|
|
68
|
-
values: [{ value: 'GOOD' }, { value: 'EVIL' }],
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
});
|
|
72
|
-
const type = new model_1.RootEntityType({
|
|
73
|
-
kind: model_1.TypeKind.ROOT_ENTITY,
|
|
74
|
-
name: 'Hero',
|
|
75
|
-
fields: [
|
|
76
|
-
{
|
|
77
|
-
name: 'morality',
|
|
78
|
-
typeName: 'Morality',
|
|
79
|
-
},
|
|
80
|
-
],
|
|
81
|
-
}, model);
|
|
82
|
-
const inputType = generator.generate(type);
|
|
83
|
-
it('includes them in the input type', () => {
|
|
84
|
-
(0, chai_1.expect)(inputType.getInputType().getFields()['morality'].type).to.be.an.instanceOf(graphql_1.GraphQLEnumType);
|
|
85
|
-
});
|
|
86
|
-
describe('prepare()', () => {
|
|
87
|
-
it('includes it if specified', () => {
|
|
88
|
-
const prepared = inputType.prepareValue({ morality: 'EVIL' }, context);
|
|
89
|
-
(0, chai_1.expect)(prepared.morality).to.equal('EVIL');
|
|
90
|
-
});
|
|
91
|
-
it('includes it if set to null', () => {
|
|
92
|
-
// mimic the update case where setting to null does not remove the property but sets it to null
|
|
93
|
-
const prepared = inputType.prepareValue({ morality: null }, context);
|
|
94
|
-
(0, chai_1.expect)(prepared.morality).to.be.null;
|
|
95
|
-
});
|
|
96
|
-
it('does not include it it if not specified', () => {
|
|
97
|
-
const prepared = inputType.prepareValue({}, context);
|
|
98
|
-
(0, chai_1.expect)(prepared.morality).to.be.undefined;
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
describe('getAffectedFields()', () => {
|
|
102
|
-
it('includes it if specified', () => {
|
|
103
|
-
const fields = inputType.getAffectedFields({ morality: 'EVIL' }, context);
|
|
104
|
-
(0, chai_1.expect)(fields).to.deep.equal([type.getFieldOrThrow('morality')]);
|
|
105
|
-
});
|
|
106
|
-
it('includes it if specified as null', () => {
|
|
107
|
-
const fields = inputType.getAffectedFields({ morality: null }, context);
|
|
108
|
-
(0, chai_1.expect)(fields).to.deep.equal([type.getFieldOrThrow('morality')]);
|
|
109
|
-
});
|
|
110
|
-
it('does not include it if not specified', () => {
|
|
111
|
-
const fields = inputType.getAffectedFields({}, context);
|
|
112
|
-
(0, chai_1.expect)(fields).be.empty;
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
describe('with simple scalar fields with default value', () => {
|
|
117
|
-
const type = new model_1.RootEntityType({
|
|
118
|
-
kind: model_1.TypeKind.ROOT_ENTITY,
|
|
119
|
-
name: 'Hero',
|
|
120
|
-
fields: [
|
|
121
|
-
{
|
|
122
|
-
name: 'name',
|
|
123
|
-
typeName: 'String',
|
|
124
|
-
defaultValue: 'Batman',
|
|
125
|
-
},
|
|
126
|
-
],
|
|
127
|
-
}, model);
|
|
128
|
-
const inputType = generator.generate(type);
|
|
129
|
-
describe('prepare()', () => {
|
|
130
|
-
it('includes it if specified', () => {
|
|
131
|
-
const prepared = inputType.prepareValue({ name: 'Hero' }, context);
|
|
132
|
-
(0, chai_1.expect)(prepared.name).to.equal('Hero');
|
|
133
|
-
});
|
|
134
|
-
it('includes default value if not specified', () => {
|
|
135
|
-
const prepared = inputType.prepareValue({}, context);
|
|
136
|
-
(0, chai_1.expect)(prepared.name).to.equal('Batman');
|
|
137
|
-
});
|
|
138
|
-
it('keeps null values', () => {
|
|
139
|
-
const prepared = inputType.prepareValue({ name: null }, context);
|
|
140
|
-
(0, chai_1.expect)(prepared.name).to.be.null;
|
|
141
|
-
});
|
|
142
|
-
});
|
|
143
|
-
describe('getAffectedFields()', () => {
|
|
144
|
-
it('includes it if specified', () => {
|
|
145
|
-
const fields = inputType.getAffectedFields({ name: 'Hero' }, context);
|
|
146
|
-
(0, chai_1.expect)(fields).to.deep.equal([type.getFieldOrThrow('name')]);
|
|
147
|
-
});
|
|
148
|
-
it('does not include it if not specified', () => {
|
|
149
|
-
const fields = inputType.getAffectedFields({}, context);
|
|
150
|
-
(0, chai_1.expect)(fields).to.deep.equal([]);
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
describe('with list scalar fields', () => {
|
|
155
|
-
const type = new model_1.RootEntityType({
|
|
156
|
-
kind: model_1.TypeKind.ROOT_ENTITY,
|
|
157
|
-
name: 'Hero',
|
|
158
|
-
fields: [
|
|
159
|
-
{
|
|
160
|
-
name: 'nickNames',
|
|
161
|
-
typeName: 'String',
|
|
162
|
-
isList: true,
|
|
163
|
-
},
|
|
164
|
-
],
|
|
165
|
-
}, model);
|
|
166
|
-
const inputType = generator.generate(type);
|
|
167
|
-
describe('input field', () => {
|
|
168
|
-
const field = inputType.getInputType().getFields()['nickNames'];
|
|
169
|
-
it('exists', () => {
|
|
170
|
-
(0, chai_1.expect)(field).not.to.be.undefined;
|
|
171
|
-
});
|
|
172
|
-
it('has correct type', () => {
|
|
173
|
-
(0, chai_1.expect)(field.type).to.deep.equal(new graphql_1.GraphQLList(new graphql_1.GraphQLNonNull(graphql_1.GraphQLString)));
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
describe('prepare()', () => {
|
|
177
|
-
it('includes it if specified', () => {
|
|
178
|
-
const prepared = inputType.prepareValue({ nickNames: ['Dark Knight', 'Batsy'] }, context);
|
|
179
|
-
(0, chai_1.expect)(prepared.nickNames).to.deep.equal(['Dark Knight', 'Batsy']);
|
|
180
|
-
});
|
|
181
|
-
it('coerces to empty list if specified as null', () => {
|
|
182
|
-
// when querying/filtering, null is interpreted as [] anyway, so avoid having a mix of both in the db
|
|
183
|
-
const prepared = inputType.prepareValue({ nickNames: null }, context);
|
|
184
|
-
(0, chai_1.expect)(prepared.nickNames).to.deep.equal([]);
|
|
185
|
-
});
|
|
186
|
-
it('does not include it if not specified', () => {
|
|
187
|
-
// when querying/filtering, null is interpreted as [] anyway, so avoid having a mix of both in the db
|
|
188
|
-
const prepared = inputType.prepareValue({}, context);
|
|
189
|
-
(0, chai_1.expect)(prepared.nickNames).to.be.undefined;
|
|
190
|
-
});
|
|
191
|
-
});
|
|
192
|
-
describe('getAffectedFields()', () => {
|
|
193
|
-
it('includes it if specified', () => {
|
|
194
|
-
const fields = inputType.getAffectedFields({ nickNames: ['Dark Knight', 'Batsy'] }, context);
|
|
195
|
-
(0, chai_1.expect)(fields).to.deep.equal([type.getFieldOrThrow('nickNames')]);
|
|
196
|
-
});
|
|
197
|
-
it('includes it if specified null', () => {
|
|
198
|
-
const fields = inputType.getAffectedFields({ nickNames: null }, context);
|
|
199
|
-
(0, chai_1.expect)(fields).to.deep.equal([type.getFieldOrThrow('nickNames')]);
|
|
200
|
-
});
|
|
201
|
-
it('does not include it if not specified', () => {
|
|
202
|
-
const fields = inputType.getAffectedFields({}, context);
|
|
203
|
-
(0, chai_1.expect)(fields).be.empty;
|
|
204
|
-
});
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
describe('with child entity fields', () => {
|
|
208
|
-
const model = new model_1.Model({
|
|
209
|
-
types: [
|
|
210
|
-
{
|
|
211
|
-
kind: model_1.TypeKind.CHILD_ENTITY,
|
|
212
|
-
name: 'Movie',
|
|
213
|
-
fields: [
|
|
214
|
-
{
|
|
215
|
-
name: 'name',
|
|
216
|
-
typeName: 'String',
|
|
217
|
-
},
|
|
218
|
-
],
|
|
219
|
-
},
|
|
220
|
-
],
|
|
221
|
-
});
|
|
222
|
-
const type = new model_1.RootEntityType({
|
|
223
|
-
kind: model_1.TypeKind.ROOT_ENTITY,
|
|
224
|
-
name: 'Hero',
|
|
225
|
-
fields: [
|
|
226
|
-
{
|
|
227
|
-
name: 'movies',
|
|
228
|
-
typeName: 'Movie',
|
|
229
|
-
isList: true,
|
|
230
|
-
},
|
|
231
|
-
],
|
|
232
|
-
}, model);
|
|
233
|
-
const movieType = model.getChildEntityTypeOrThrow('Movie');
|
|
234
|
-
const inputType = generator.generate(type);
|
|
235
|
-
const movies = [
|
|
236
|
-
{ name: 'Batman Begins' },
|
|
237
|
-
{ name: 'The dark Knight Rises' },
|
|
238
|
-
{ name: 'The Dark Knight Rises' },
|
|
239
|
-
];
|
|
240
|
-
describe('input field', () => {
|
|
241
|
-
const field = inputType.getInputType().getFields()['movies'];
|
|
242
|
-
it('exists', () => {
|
|
243
|
-
(0, chai_1.expect)(field).not.to.be.undefined;
|
|
244
|
-
});
|
|
245
|
-
it('has correct type', () => {
|
|
246
|
-
(0, chai_1.expect)(field.type).to.be.an.instanceOf(graphql_1.GraphQLList);
|
|
247
|
-
(0, chai_1.expect)(field.type.ofType).to.be.an.instanceOf(graphql_1.GraphQLNonNull);
|
|
248
|
-
const movieInputType = field.type.ofType
|
|
249
|
-
.ofType;
|
|
250
|
-
(0, chai_1.expect)(movieInputType).to.be.an.instanceOf(graphql_1.GraphQLInputObjectType);
|
|
251
|
-
(0, chai_1.expect)(movieInputType.getFields()['name']).not.to.be.undefined;
|
|
252
|
-
(0, chai_1.expect)(movieInputType.getFields()['name'].type).to.equal(graphql_1.GraphQLString);
|
|
253
|
-
});
|
|
254
|
-
});
|
|
255
|
-
describe('prepare()', () => {
|
|
256
|
-
it('includes it if specified', () => {
|
|
257
|
-
const prepared = inputType.prepareValue({ movies }, context);
|
|
258
|
-
(0, chai_1.expect)(prepared.movies).to.be.an('array');
|
|
259
|
-
(0, chai_1.expect)(prepared.movies).to.have.lengthOf(3);
|
|
260
|
-
(0, chai_1.expect)(prepared.movies[0].name).to.equal('Batman Begins');
|
|
261
|
-
});
|
|
262
|
-
it('adds child-entity specific fields', () => {
|
|
263
|
-
const prepared = inputType.prepareValue({ movies }, context);
|
|
264
|
-
(0, chai_1.expect)(prepared.movies[0].id).to.be.a('string');
|
|
265
|
-
});
|
|
266
|
-
it('coerces to empty list if specified as null', () => {
|
|
267
|
-
// when querying/filtering, null is interpreted as [] anyway, so avoid having a mix of both in the db
|
|
268
|
-
const prepared = inputType.prepareValue({ movies: null }, context);
|
|
269
|
-
(0, chai_1.expect)(prepared.movies).to.deep.equal([]);
|
|
270
|
-
});
|
|
271
|
-
it('does not include it if not specified', () => {
|
|
272
|
-
// when querying/filtering, null is interpreted as [] anyway, so avoid having a mix of both in the db
|
|
273
|
-
const prepared = inputType.prepareValue({}, context);
|
|
274
|
-
(0, chai_1.expect)(prepared.movies).to.be.undefined;
|
|
275
|
-
});
|
|
276
|
-
});
|
|
277
|
-
describe('getAffectedFields()', () => {
|
|
278
|
-
it('includes it and its inner fields if specified', () => {
|
|
279
|
-
const fields = inputType.getAffectedFields({ movies }, context);
|
|
280
|
-
(0, chai_1.expect)(fields).to.deep.equal([
|
|
281
|
-
type.getFieldOrThrow('movies'),
|
|
282
|
-
movieType.getFieldOrThrow('name'),
|
|
283
|
-
]);
|
|
284
|
-
});
|
|
285
|
-
it('includes it if specified null', () => {
|
|
286
|
-
const fields = inputType.getAffectedFields({ movies: null }, context);
|
|
287
|
-
(0, chai_1.expect)(fields).to.deep.equal([type.getFieldOrThrow('movies')]);
|
|
288
|
-
});
|
|
289
|
-
it('does not include it if not specified', () => {
|
|
290
|
-
const fields = inputType.getAffectedFields({}, context);
|
|
291
|
-
(0, chai_1.expect)(fields).be.empty;
|
|
292
|
-
});
|
|
293
|
-
});
|
|
294
|
-
});
|
|
295
|
-
describe('with entity extension fields', () => {
|
|
296
|
-
const model = new model_1.Model({
|
|
297
|
-
types: [
|
|
298
|
-
{
|
|
299
|
-
kind: model_1.TypeKind.ENTITY_EXTENSION,
|
|
300
|
-
name: 'Suit',
|
|
301
|
-
fields: [
|
|
302
|
-
{
|
|
303
|
-
name: 'color',
|
|
304
|
-
typeName: 'String',
|
|
305
|
-
},
|
|
306
|
-
],
|
|
307
|
-
},
|
|
308
|
-
],
|
|
309
|
-
});
|
|
310
|
-
const type = new model_1.RootEntityType({
|
|
311
|
-
kind: model_1.TypeKind.ROOT_ENTITY,
|
|
312
|
-
name: 'Hero',
|
|
313
|
-
fields: [
|
|
314
|
-
{
|
|
315
|
-
name: 'suit',
|
|
316
|
-
typeName: 'Suit',
|
|
317
|
-
},
|
|
318
|
-
],
|
|
319
|
-
}, model);
|
|
320
|
-
const suitType = model.getEntityExtensionTypeOrThrow('Suit');
|
|
321
|
-
const inputType = generator.generate(type);
|
|
322
|
-
describe('input field', () => {
|
|
323
|
-
const field = inputType.getInputType().getFields()['suit'];
|
|
324
|
-
it('exists', () => {
|
|
325
|
-
(0, chai_1.expect)(field).not.to.be.undefined;
|
|
326
|
-
});
|
|
327
|
-
it('has correct type', () => {
|
|
328
|
-
(0, chai_1.expect)(field.type).to.be.an.instanceOf(graphql_1.GraphQLInputObjectType);
|
|
329
|
-
(0, chai_1.expect)(field.type.getFields().color).not.to.be
|
|
330
|
-
.undefined;
|
|
331
|
-
});
|
|
332
|
-
});
|
|
333
|
-
describe('prepare()', () => {
|
|
334
|
-
it('includes it if specified', () => {
|
|
335
|
-
const prepared = inputType.prepareValue({ suit: { color: 'black' } }, context);
|
|
336
|
-
(0, chai_1.expect)(prepared.suit).to.deep.equal({ color: 'black' });
|
|
337
|
-
});
|
|
338
|
-
it('defaults to {} on null value', () => {
|
|
339
|
-
const prepared = inputType.prepareValue({ suit: null }, context);
|
|
340
|
-
(0, chai_1.expect)(prepared.suit).to.deep.equal({});
|
|
341
|
-
});
|
|
342
|
-
it('defaults to {} if not specified', () => {
|
|
343
|
-
const prepared = inputType.prepareValue({}, context);
|
|
344
|
-
(0, chai_1.expect)(prepared.suit).to.deep.equal({});
|
|
345
|
-
});
|
|
346
|
-
});
|
|
347
|
-
describe('getAffectedFields()', () => {
|
|
348
|
-
it('includes it and its inner fields if specified', () => {
|
|
349
|
-
const fields = inputType.getAffectedFields({ suit: { color: 'black' } }, context);
|
|
350
|
-
(0, chai_1.expect)(fields).to.deep.equal([
|
|
351
|
-
type.getFieldOrThrow('suit'),
|
|
352
|
-
suitType.getFieldOrThrow('color'),
|
|
353
|
-
]);
|
|
354
|
-
});
|
|
355
|
-
it('includes it if specified null', () => {
|
|
356
|
-
const fields = inputType.getAffectedFields({ suit: null }, context);
|
|
357
|
-
(0, chai_1.expect)(fields).to.deep.equal([type.getFieldOrThrow('suit')]);
|
|
358
|
-
});
|
|
359
|
-
it('does not include it if not specified', () => {
|
|
360
|
-
const fields = inputType.getAffectedFields({}, context);
|
|
361
|
-
(0, chai_1.expect)(fields).be.empty;
|
|
362
|
-
});
|
|
363
|
-
});
|
|
364
|
-
});
|
|
365
|
-
describe('with reference fields', () => {
|
|
366
|
-
const model = new model_1.Model({
|
|
367
|
-
types: [
|
|
368
|
-
{
|
|
369
|
-
kind: model_1.TypeKind.ROOT_ENTITY,
|
|
370
|
-
name: 'Country',
|
|
371
|
-
keyFieldName: 'isoCode',
|
|
372
|
-
fields: [
|
|
373
|
-
{
|
|
374
|
-
name: 'isoCode',
|
|
375
|
-
typeName: 'String',
|
|
376
|
-
},
|
|
377
|
-
],
|
|
378
|
-
},
|
|
379
|
-
],
|
|
380
|
-
});
|
|
381
|
-
const type = new model_1.RootEntityType({
|
|
382
|
-
kind: model_1.TypeKind.ROOT_ENTITY,
|
|
383
|
-
name: 'Hero',
|
|
384
|
-
fields: [
|
|
385
|
-
{
|
|
386
|
-
name: 'country',
|
|
387
|
-
typeName: 'Country',
|
|
388
|
-
isReference: true,
|
|
389
|
-
},
|
|
390
|
-
],
|
|
391
|
-
}, model);
|
|
392
|
-
const inputType = generator.generate(type);
|
|
393
|
-
it('includes it in the input type', () => {
|
|
394
|
-
(0, chai_1.expect)(inputType.getInputType().getFields()['country'].type).to.equal(graphql_1.GraphQLString);
|
|
395
|
-
});
|
|
396
|
-
describe('prepare()', () => {
|
|
397
|
-
it('includes it if specified', () => {
|
|
398
|
-
const prepared = inputType.prepareValue({ country: 'US' }, context);
|
|
399
|
-
(0, chai_1.expect)(prepared.country).to.equal('US');
|
|
400
|
-
});
|
|
401
|
-
it('includes it if set to null', () => {
|
|
402
|
-
// mimic the update case where setting to null does not remove the property but sets it to null
|
|
403
|
-
const prepared = inputType.prepareValue({ country: null }, context);
|
|
404
|
-
(0, chai_1.expect)(prepared.country).to.be.null;
|
|
405
|
-
});
|
|
406
|
-
it('does not include it it if not specified', () => {
|
|
407
|
-
const prepared = inputType.prepareValue({}, context);
|
|
408
|
-
(0, chai_1.expect)(prepared.country).to.be.undefined;
|
|
409
|
-
});
|
|
410
|
-
});
|
|
411
|
-
describe('getAffectedFields()', () => {
|
|
412
|
-
it('includes it if specified', () => {
|
|
413
|
-
const fields = inputType.getAffectedFields({ country: 'US' }, context);
|
|
414
|
-
(0, chai_1.expect)(fields).to.deep.equal([type.getFieldOrThrow('country')]);
|
|
415
|
-
});
|
|
416
|
-
it('includes it if specified as null', () => {
|
|
417
|
-
const fields = inputType.getAffectedFields({ country: null }, context);
|
|
418
|
-
(0, chai_1.expect)(fields).to.deep.equal([type.getFieldOrThrow('country')]);
|
|
419
|
-
});
|
|
420
|
-
it('does not include it if not specified', () => {
|
|
421
|
-
const fields = inputType.getAffectedFields({}, context);
|
|
422
|
-
(0, chai_1.expect)(fields).be.empty;
|
|
423
|
-
});
|
|
424
|
-
});
|
|
425
|
-
});
|
|
426
|
-
describe('for root entities', () => {
|
|
427
|
-
const type = new model_1.RootEntityType({
|
|
428
|
-
kind: model_1.TypeKind.ROOT_ENTITY,
|
|
429
|
-
name: 'Hero',
|
|
430
|
-
fields: [
|
|
431
|
-
{
|
|
432
|
-
name: 'name',
|
|
433
|
-
typeName: 'String',
|
|
434
|
-
defaultValue: 'Batman',
|
|
435
|
-
},
|
|
436
|
-
],
|
|
437
|
-
}, model);
|
|
438
|
-
const inputType = generator.generate(type);
|
|
439
|
-
describe('input type', () => {
|
|
440
|
-
it('does not include createdAt or updatedAt', () => {
|
|
441
|
-
(0, chai_1.expect)(inputType.getInputType().getFields().createdAt).to.be.undefined;
|
|
442
|
-
(0, chai_1.expect)(inputType.getInputType().getFields().updatedAt).to.be.undefined;
|
|
443
|
-
});
|
|
444
|
-
});
|
|
445
|
-
describe('prepare()', () => {
|
|
446
|
-
it('includes createdAt and updatedAt', () => {
|
|
447
|
-
const prepared = inputType.prepareValue({}, context);
|
|
448
|
-
(0, chai_1.expect)(prepared.updatedAt).to.be.a('string');
|
|
449
|
-
(0, chai_1.expect)(prepared.createdAt).to.be.a('string');
|
|
450
|
-
});
|
|
451
|
-
it('does not include id', () => {
|
|
452
|
-
// id is generated by database adapter
|
|
453
|
-
const prepared = inputType.prepareValue({}, context);
|
|
454
|
-
(0, chai_1.expect)(prepared.id).to.be.undefined;
|
|
455
|
-
});
|
|
456
|
-
});
|
|
457
|
-
});
|
|
458
|
-
describe('for child entities', () => {
|
|
459
|
-
const type = new model_1.ChildEntityType({
|
|
460
|
-
kind: model_1.TypeKind.CHILD_ENTITY,
|
|
461
|
-
name: 'Hero',
|
|
462
|
-
fields: [
|
|
463
|
-
{
|
|
464
|
-
name: 'name',
|
|
465
|
-
typeName: 'String',
|
|
466
|
-
defaultValue: 'Batman',
|
|
467
|
-
},
|
|
468
|
-
],
|
|
469
|
-
}, model);
|
|
470
|
-
const inputType = generator.generate(type);
|
|
471
|
-
describe('prepare()', () => {
|
|
472
|
-
it('includes createdAt, updatedAt and id', () => {
|
|
473
|
-
const prepared = inputType.prepareValue({}, context);
|
|
474
|
-
(0, chai_1.expect)(prepared.updatedAt).to.be.a('string');
|
|
475
|
-
(0, chai_1.expect)(prepared.createdAt).to.be.a('string');
|
|
476
|
-
(0, chai_1.expect)(prepared.id).to.be.a('string');
|
|
477
|
-
});
|
|
478
|
-
});
|
|
479
|
-
describe('input type', () => {
|
|
480
|
-
it('does not include id, createdAt, or updatedAt', () => {
|
|
481
|
-
(0, chai_1.expect)(inputType.getInputType().getFields().id).to.be.undefined;
|
|
482
|
-
(0, chai_1.expect)(inputType.getInputType().getFields().createdAt).to.be.undefined;
|
|
483
|
-
(0, chai_1.expect)(inputType.getInputType().getFields().updatedAt).to.be.undefined;
|
|
484
|
-
});
|
|
485
|
-
});
|
|
486
|
-
});
|
|
487
|
-
describe('with recursive types', () => {
|
|
488
|
-
const model = new model_1.Model({
|
|
489
|
-
types: [
|
|
490
|
-
{
|
|
491
|
-
kind: model_1.TypeKind.VALUE_OBJECT,
|
|
492
|
-
name: 'Node',
|
|
493
|
-
fields: [
|
|
494
|
-
{
|
|
495
|
-
name: 'parent',
|
|
496
|
-
typeName: 'Node',
|
|
497
|
-
},
|
|
498
|
-
],
|
|
499
|
-
},
|
|
500
|
-
],
|
|
501
|
-
});
|
|
502
|
-
it('does not enter an infinite loop on creation', () => {
|
|
503
|
-
generator.generate(model.getValueObjectTypeOrThrow('Node'));
|
|
504
|
-
});
|
|
505
|
-
it('creates a cyclic object structure', () => {
|
|
506
|
-
const inputType = generator.generate(model.getValueObjectTypeOrThrow('Node'));
|
|
507
|
-
const parentField = inputType.fields.find((f) => f.name == 'parent');
|
|
508
|
-
(0, chai_1.expect)(parentField.objectInputType).to.equal(inputType);
|
|
509
|
-
});
|
|
510
|
-
it('creates a cyclic graphql input type structure', () => {
|
|
511
|
-
const inputType = generator.generate(model.getValueObjectTypeOrThrow('Node'));
|
|
512
|
-
const graphqlType = inputType.getInputType();
|
|
513
|
-
const parentField = graphqlType.getFields().parent;
|
|
514
|
-
(0, chai_1.expect)(parentField.type).to.equal(graphqlType);
|
|
515
|
-
});
|
|
516
|
-
});
|
|
517
|
-
});
|
|
518
|
-
//# sourceMappingURL=create-input-type-generator.spec.js.map
|