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,648 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const chai_1 = require("chai");
|
|
4
|
-
const model_1 = require("../../../src/model");
|
|
5
|
-
const validation_utils_1 = require("./validation-utils");
|
|
6
|
-
describe('Field', () => {
|
|
7
|
-
const model = new model_1.Model({
|
|
8
|
-
types: [
|
|
9
|
-
{
|
|
10
|
-
name: 'Address',
|
|
11
|
-
kind: model_1.TypeKind.VALUE_OBJECT,
|
|
12
|
-
fields: [
|
|
13
|
-
{
|
|
14
|
-
name: 'name',
|
|
15
|
-
typeName: 'String',
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: 'Country',
|
|
21
|
-
kind: model_1.TypeKind.ROOT_ENTITY,
|
|
22
|
-
keyFieldName: 'isoCode',
|
|
23
|
-
fields: [
|
|
24
|
-
{
|
|
25
|
-
name: 'isoCode',
|
|
26
|
-
typeName: 'String',
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: 'Shipment',
|
|
32
|
-
kind: model_1.TypeKind.ROOT_ENTITY,
|
|
33
|
-
fields: [
|
|
34
|
-
{
|
|
35
|
-
name: 'deliveries',
|
|
36
|
-
typeName: 'Delivery',
|
|
37
|
-
isList: true,
|
|
38
|
-
isRelation: true,
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
name: 'delivery',
|
|
42
|
-
typeName: 'Delivery',
|
|
43
|
-
isRelation: true,
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
name: 'deliveryNonRelation',
|
|
47
|
-
typeName: 'Delivery',
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
name: 'deliveryWithInverseOf',
|
|
51
|
-
typeName: 'Delivery',
|
|
52
|
-
isRelation: true,
|
|
53
|
-
inverseOfFieldName: 'shipment',
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: 'handlingUnits',
|
|
57
|
-
typeName: 'HandlingUnit',
|
|
58
|
-
isRelation: true,
|
|
59
|
-
isList: true,
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
name: 'Delivery',
|
|
65
|
-
kind: model_1.TypeKind.ROOT_ENTITY,
|
|
66
|
-
fields: [
|
|
67
|
-
{
|
|
68
|
-
name: 'shipment',
|
|
69
|
-
typeName: 'Shipment',
|
|
70
|
-
isRelation: true,
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
name: 'countryIsoCode',
|
|
74
|
-
typeName: 'String',
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: 'lineItems',
|
|
78
|
-
typeName: 'DeliveryLineItem',
|
|
79
|
-
isList: true,
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: 'HandlingUnit',
|
|
85
|
-
kind: model_1.TypeKind.ROOT_ENTITY,
|
|
86
|
-
fields: [],
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
name: 'Item',
|
|
90
|
-
kind: model_1.TypeKind.CHILD_ENTITY,
|
|
91
|
-
fields: [],
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
name: 'DangerousGoodsInfo',
|
|
95
|
-
kind: model_1.TypeKind.ENTITY_EXTENSION,
|
|
96
|
-
fields: [],
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
name: 'DeliveryLineItem',
|
|
100
|
-
kind: model_1.TypeKind.CHILD_ENTITY,
|
|
101
|
-
fields: [
|
|
102
|
-
{
|
|
103
|
-
name: 'parent',
|
|
104
|
-
isParentField: true,
|
|
105
|
-
typeName: 'Delivery',
|
|
106
|
-
},
|
|
107
|
-
],
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
permissionProfiles: [
|
|
111
|
-
{
|
|
112
|
-
profiles: {
|
|
113
|
-
default: {
|
|
114
|
-
permissions: [
|
|
115
|
-
{
|
|
116
|
-
roles: ['accounting'],
|
|
117
|
-
access: 'readWrite',
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
|
-
},
|
|
121
|
-
accounting: {
|
|
122
|
-
permissions: [
|
|
123
|
-
{
|
|
124
|
-
roles: ['accounting'],
|
|
125
|
-
access: 'readWrite',
|
|
126
|
-
},
|
|
127
|
-
],
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
],
|
|
132
|
-
});
|
|
133
|
-
const shipmentType = model.getRootEntityTypeOrThrow('Shipment');
|
|
134
|
-
const deliveryType = model.getRootEntityTypeOrThrow('Delivery');
|
|
135
|
-
const handlingUnitType = model.getRootEntityTypeOrThrow('HandlingUnit');
|
|
136
|
-
const addressType = model.getValueObjectTypeOrThrow('Address');
|
|
137
|
-
const itemType = model.getChildEntityTypeOrThrow('Item');
|
|
138
|
-
const dangerousGoodsInfoType = model.getEntityExtensionTypeOrThrow('DangerousGoodsInfo');
|
|
139
|
-
describe('with type', () => {
|
|
140
|
-
it('accepts built-in type', () => {
|
|
141
|
-
const field = new model_1.Field({
|
|
142
|
-
name: 'deliveryNumber',
|
|
143
|
-
typeName: 'String',
|
|
144
|
-
}, deliveryType);
|
|
145
|
-
(0, validation_utils_1.expectToBeValid)(field);
|
|
146
|
-
});
|
|
147
|
-
it('accepts user-defined types', () => {
|
|
148
|
-
const field = new model_1.Field({
|
|
149
|
-
name: 'address',
|
|
150
|
-
typeName: 'Address',
|
|
151
|
-
}, deliveryType);
|
|
152
|
-
(0, validation_utils_1.expectToBeValid)(field);
|
|
153
|
-
(0, chai_1.expect)(field.type).to.equal(model.getType('Address'));
|
|
154
|
-
(0, chai_1.expect)(field.hasValidType).to.be.true;
|
|
155
|
-
});
|
|
156
|
-
it('reports undefined type', () => {
|
|
157
|
-
const field = new model_1.Field({
|
|
158
|
-
name: 'deliveryNumber',
|
|
159
|
-
typeName: 'UndefinedType',
|
|
160
|
-
}, deliveryType);
|
|
161
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, 'UndefinedType');
|
|
162
|
-
});
|
|
163
|
-
it('falls back to pseudo type if typeName is not found', () => {
|
|
164
|
-
// this is important so that the model does not break if it is invalid
|
|
165
|
-
const field = new model_1.Field({
|
|
166
|
-
name: 'deliveryNumber',
|
|
167
|
-
typeName: 'Undefined',
|
|
168
|
-
}, deliveryType);
|
|
169
|
-
(0, chai_1.expect)(field.type).not.to.be.undefined;
|
|
170
|
-
(0, chai_1.expect)(field.type.name).to.equal('Undefined');
|
|
171
|
-
(0, chai_1.expect)(field.hasValidType).to.be.false;
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
describe('with name', () => {
|
|
175
|
-
it('rejects empty names', () => {
|
|
176
|
-
const field = new model_1.Field({
|
|
177
|
-
name: '',
|
|
178
|
-
typeName: 'String',
|
|
179
|
-
}, deliveryType);
|
|
180
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, `Field name is empty.`);
|
|
181
|
-
});
|
|
182
|
-
it('accepts one-character names', () => {
|
|
183
|
-
// describe('me', () => it('is not stupid') );
|
|
184
|
-
const field = new model_1.Field({
|
|
185
|
-
name: 'a',
|
|
186
|
-
typeName: 'String',
|
|
187
|
-
}, deliveryType);
|
|
188
|
-
(0, validation_utils_1.expectToBeValid)(field);
|
|
189
|
-
});
|
|
190
|
-
it('warns about names including an underscore', () => {
|
|
191
|
-
const field = new model_1.Field({
|
|
192
|
-
name: 'some_field_name',
|
|
193
|
-
typeName: 'String',
|
|
194
|
-
}, deliveryType);
|
|
195
|
-
(0, validation_utils_1.expectSingleWarningToInclude)(field, `Field names should not include underscores.`);
|
|
196
|
-
});
|
|
197
|
-
it('rejects names starting with an underscore', () => {
|
|
198
|
-
const field = new model_1.Field({
|
|
199
|
-
name: '_internal',
|
|
200
|
-
typeName: 'String',
|
|
201
|
-
}, deliveryType);
|
|
202
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, `Field names cannot start with an underscore.`);
|
|
203
|
-
});
|
|
204
|
-
it('warns about names starting with an uppercase character', () => {
|
|
205
|
-
const field = new model_1.Field({
|
|
206
|
-
name: 'ThisIsNotAFieldName',
|
|
207
|
-
typeName: 'String',
|
|
208
|
-
}, deliveryType);
|
|
209
|
-
(0, validation_utils_1.expectSingleWarningToInclude)(field, `Field names should start with a lowercase character.`);
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
describe('with root entity type', () => {
|
|
213
|
-
it('rejects fields with root entity type without @relation or @reference', () => {
|
|
214
|
-
const field = new model_1.Field({
|
|
215
|
-
name: 'country',
|
|
216
|
-
typeName: 'Country',
|
|
217
|
-
}, deliveryType);
|
|
218
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, 'root entity');
|
|
219
|
-
});
|
|
220
|
-
it('rejects fields with both @relation and @reference', () => {
|
|
221
|
-
const field = new model_1.Field({
|
|
222
|
-
name: 'country',
|
|
223
|
-
typeName: 'Country',
|
|
224
|
-
isRelation: true,
|
|
225
|
-
isReference: true,
|
|
226
|
-
referenceKeyField: 'countryIsoCode',
|
|
227
|
-
}, deliveryType);
|
|
228
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, '@reference and @relation cannot be combined');
|
|
229
|
-
});
|
|
230
|
-
});
|
|
231
|
-
describe('with relations', () => {
|
|
232
|
-
it('rejects @relation on non-root-entity-type as declaring type', () => {
|
|
233
|
-
const field = new model_1.Field({
|
|
234
|
-
name: 'handlingUnit',
|
|
235
|
-
typeName: 'HandlingUnit',
|
|
236
|
-
isRelation: true,
|
|
237
|
-
}, addressType);
|
|
238
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, 'Relations can only be defined on root entity types. Consider using @reference instead');
|
|
239
|
-
});
|
|
240
|
-
it('rejects @relation to non-root-entity type', () => {
|
|
241
|
-
const field = new model_1.Field({
|
|
242
|
-
name: 'address',
|
|
243
|
-
typeName: 'Address',
|
|
244
|
-
isRelation: true,
|
|
245
|
-
}, deliveryType);
|
|
246
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, 'Type "Address" cannot be used with @relation because it is not a root entity type');
|
|
247
|
-
});
|
|
248
|
-
describe('without inverseOf', () => {
|
|
249
|
-
it('accepts', () => {
|
|
250
|
-
const field = deliveryType.getFieldOrThrow('shipment'); // need a field woven into the model here
|
|
251
|
-
(0, validation_utils_1.expectToBeValid)(field);
|
|
252
|
-
});
|
|
253
|
-
it('provides the other field as inverseField', () => {
|
|
254
|
-
const field = deliveryType.getFieldOrThrow('shipment'); // need a field woven into the model here
|
|
255
|
-
(0, chai_1.expect)(field.inverseField).to.equal(shipmentType.getFieldOrThrow('deliveryWithInverseOf'));
|
|
256
|
-
});
|
|
257
|
-
it('resolves inverseField to undefined if there is none', () => {
|
|
258
|
-
const field = shipmentType.getFieldOrThrow('handlingUnits');
|
|
259
|
-
(0, chai_1.expect)(field.inverseField).to.be.undefined;
|
|
260
|
-
});
|
|
261
|
-
it('rejects if there are multiple inverse fields', () => {
|
|
262
|
-
const m = new model_1.Model({
|
|
263
|
-
types: [
|
|
264
|
-
{
|
|
265
|
-
name: 'Delivery',
|
|
266
|
-
kind: model_1.TypeKind.ROOT_ENTITY,
|
|
267
|
-
fields: [
|
|
268
|
-
{
|
|
269
|
-
name: 'packager',
|
|
270
|
-
typeName: 'Person',
|
|
271
|
-
isRelation: true,
|
|
272
|
-
inverseOfFieldName: 'delivery',
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
name: 'shipper',
|
|
276
|
-
typeName: 'Person',
|
|
277
|
-
isRelation: true,
|
|
278
|
-
inverseOfFieldName: 'delivery',
|
|
279
|
-
},
|
|
280
|
-
],
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
name: 'Person',
|
|
284
|
-
kind: model_1.TypeKind.ROOT_ENTITY,
|
|
285
|
-
fields: [
|
|
286
|
-
{
|
|
287
|
-
name: 'delivery',
|
|
288
|
-
typeName: 'Delivery',
|
|
289
|
-
isRelation: true,
|
|
290
|
-
},
|
|
291
|
-
],
|
|
292
|
-
},
|
|
293
|
-
],
|
|
294
|
-
});
|
|
295
|
-
const field = m.getRootEntityTypeOrThrow('Person').getFieldOrThrow('delivery');
|
|
296
|
-
const result = (0, validation_utils_1.validate)(field);
|
|
297
|
-
(0, chai_1.expect)(result.messages.length).to.equal(2);
|
|
298
|
-
for (const message of result.messages) {
|
|
299
|
-
(0, chai_1.expect)(message.severity).to.equal(model_1.Severity.Error);
|
|
300
|
-
(0, chai_1.expect)(message.message).to.equal('Multiple fields ("Delivery.packager", "Delivery.shipper") declare inverseOf to "Person.delivery".');
|
|
301
|
-
}
|
|
302
|
-
});
|
|
303
|
-
describe('warns if there is an unrelated inverse relation', () => {
|
|
304
|
-
const field = shipmentType.getFieldOrThrow('delivery');
|
|
305
|
-
const result = (0, validation_utils_1.validate)(field);
|
|
306
|
-
(0, chai_1.expect)(result.messages.length, result.toString()).to.equal(1);
|
|
307
|
-
(0, chai_1.expect)(result.messages[0].severity).to.equal(model_1.Severity.Warning);
|
|
308
|
-
(0, chai_1.expect)(result.messages[0].message).to.equal('This field and "Delivery.shipment" define separate relations. Consider using the "inverseOf" argument to add a backlink to an existing relation.');
|
|
309
|
-
});
|
|
310
|
-
});
|
|
311
|
-
describe('with inverseOf', () => {
|
|
312
|
-
describe('that is not a list', () => {
|
|
313
|
-
const field = new model_1.Field({
|
|
314
|
-
name: 'shipment',
|
|
315
|
-
typeName: 'Shipment',
|
|
316
|
-
isRelation: true,
|
|
317
|
-
inverseOfFieldName: 'delivery',
|
|
318
|
-
}, deliveryType);
|
|
319
|
-
it('accepts', () => {
|
|
320
|
-
(0, validation_utils_1.expectToBeValid)(field);
|
|
321
|
-
});
|
|
322
|
-
it('provides the field in inverseOf', () => {
|
|
323
|
-
(0, chai_1.expect)(field.inverseOf).to.equal(shipmentType.getField('delivery'));
|
|
324
|
-
});
|
|
325
|
-
});
|
|
326
|
-
describe('that is a list', () => {
|
|
327
|
-
const field = new model_1.Field({
|
|
328
|
-
name: 'shipment',
|
|
329
|
-
typeName: 'Shipment',
|
|
330
|
-
isRelation: true,
|
|
331
|
-
inverseOfFieldName: 'deliveries',
|
|
332
|
-
}, deliveryType);
|
|
333
|
-
it('accepts', () => {
|
|
334
|
-
(0, validation_utils_1.expectToBeValid)(field);
|
|
335
|
-
});
|
|
336
|
-
it('provides the field in inverseOf', () => {
|
|
337
|
-
(0, chai_1.expect)(field.inverseOf).to.equal(shipmentType.getField('deliveries'));
|
|
338
|
-
});
|
|
339
|
-
});
|
|
340
|
-
it('rejects inverseOf to undefined field', () => {
|
|
341
|
-
const field = new model_1.Field({
|
|
342
|
-
name: 'shipment',
|
|
343
|
-
typeName: 'Shipment',
|
|
344
|
-
isRelation: true,
|
|
345
|
-
inverseOfFieldName: 'undefinedField',
|
|
346
|
-
}, deliveryType);
|
|
347
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, 'Field "undefinedField" does not exist on type "Shipment"');
|
|
348
|
-
});
|
|
349
|
-
it('rejects inverseOf to non-relation field', () => {
|
|
350
|
-
const field = new model_1.Field({
|
|
351
|
-
name: 'shipment',
|
|
352
|
-
typeName: 'Shipment',
|
|
353
|
-
isRelation: true,
|
|
354
|
-
inverseOfFieldName: 'deliveryNonRelation',
|
|
355
|
-
}, deliveryType);
|
|
356
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, 'Field "Shipment.deliveryNonRelation" used as inverse field of "Delivery.shipment" does not have the @relation directive');
|
|
357
|
-
});
|
|
358
|
-
it('rejects inverseOf to field that has inverseOf set', () => {
|
|
359
|
-
const field = new model_1.Field({
|
|
360
|
-
name: 'shipment',
|
|
361
|
-
typeName: 'Shipment',
|
|
362
|
-
isRelation: true,
|
|
363
|
-
inverseOfFieldName: 'deliveryWithInverseOf',
|
|
364
|
-
}, deliveryType);
|
|
365
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, 'Field "Shipment.deliveryWithInverseOf" used as inverse field of "Delivery.shipment" should not declare inverseOf itself');
|
|
366
|
-
});
|
|
367
|
-
it("rejects inverseOf to field with different type than the field's declaring type", () => {
|
|
368
|
-
const field = new model_1.Field({
|
|
369
|
-
name: 'shipment',
|
|
370
|
-
typeName: 'Shipment',
|
|
371
|
-
isRelation: true,
|
|
372
|
-
inverseOfFieldName: 'handlingUnits',
|
|
373
|
-
}, deliveryType);
|
|
374
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, 'Field "Shipment.handlingUnits" used as inverse field of "Delivery.shipment" has named type "HandlingUnit" but should be of type "Delivery"');
|
|
375
|
-
});
|
|
376
|
-
it('does not set inverseField', () => {
|
|
377
|
-
const field = new model_1.Field({
|
|
378
|
-
name: 'shipment',
|
|
379
|
-
typeName: 'Shipment',
|
|
380
|
-
isRelation: true,
|
|
381
|
-
inverseOfFieldName: 'delivery',
|
|
382
|
-
}, deliveryType);
|
|
383
|
-
(0, chai_1.expect)(field.inverseField).to.be.undefined;
|
|
384
|
-
});
|
|
385
|
-
});
|
|
386
|
-
});
|
|
387
|
-
describe('with references', () => {
|
|
388
|
-
it('accepts @reference to root entity type', () => {
|
|
389
|
-
const field = new model_1.Field({
|
|
390
|
-
name: 'country',
|
|
391
|
-
typeName: 'Country',
|
|
392
|
-
isReference: true,
|
|
393
|
-
referenceKeyField: 'countryIsoCode',
|
|
394
|
-
}, deliveryType);
|
|
395
|
-
(0, validation_utils_1.expectToBeValid)(field);
|
|
396
|
-
});
|
|
397
|
-
it('rejects @reference to root entity type without @key field', () => {
|
|
398
|
-
const field = new model_1.Field({
|
|
399
|
-
name: 'handlingUnit',
|
|
400
|
-
typeName: 'HandlingUnit',
|
|
401
|
-
isReference: true,
|
|
402
|
-
}, deliveryType);
|
|
403
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, `"HandlingUnit" cannot be used as @reference type because it does not have a field annotated with @key`);
|
|
404
|
-
});
|
|
405
|
-
it('rejects @reference to value object type', () => {
|
|
406
|
-
const field = new model_1.Field({
|
|
407
|
-
name: 'address',
|
|
408
|
-
typeName: 'Address',
|
|
409
|
-
isReference: true,
|
|
410
|
-
}, deliveryType);
|
|
411
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, `"Address" cannot be used as @reference type because is not a root entity type.`);
|
|
412
|
-
});
|
|
413
|
-
it('rejects @reference on list field', () => {
|
|
414
|
-
const field = new model_1.Field({
|
|
415
|
-
name: 'countries',
|
|
416
|
-
typeName: 'Country',
|
|
417
|
-
isReference: true,
|
|
418
|
-
referenceKeyField: 'countryIsoCode',
|
|
419
|
-
isList: true,
|
|
420
|
-
}, deliveryType);
|
|
421
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, `@reference is not supported with list types. Consider wrapping the reference in a child entity or value object type.`);
|
|
422
|
-
});
|
|
423
|
-
});
|
|
424
|
-
describe('with entity extension type', () => {
|
|
425
|
-
it('accepts entity extensions embedded in root entities', () => {
|
|
426
|
-
const field = new model_1.Field({
|
|
427
|
-
name: 'items',
|
|
428
|
-
typeName: 'DangerousGoodsInfo',
|
|
429
|
-
}, deliveryType);
|
|
430
|
-
(0, validation_utils_1.expectToBeValid)(field);
|
|
431
|
-
});
|
|
432
|
-
it('accepts entity extensions embedded in child entities', () => {
|
|
433
|
-
const field = new model_1.Field({
|
|
434
|
-
name: 'items',
|
|
435
|
-
typeName: 'DangerousGoodsInfo',
|
|
436
|
-
}, itemType);
|
|
437
|
-
(0, validation_utils_1.expectToBeValid)(field);
|
|
438
|
-
});
|
|
439
|
-
it('accepts entity extensions embedded in entity extensions', () => {
|
|
440
|
-
const field = new model_1.Field({
|
|
441
|
-
name: 'items',
|
|
442
|
-
typeName: 'DangerousGoodsInfo',
|
|
443
|
-
}, dangerousGoodsInfoType);
|
|
444
|
-
(0, validation_utils_1.expectToBeValid)(field);
|
|
445
|
-
});
|
|
446
|
-
it('rejects entity extensions embedded in value objects', () => {
|
|
447
|
-
const field = new model_1.Field({
|
|
448
|
-
name: 'items',
|
|
449
|
-
typeName: 'DangerousGoodsInfo',
|
|
450
|
-
}, addressType);
|
|
451
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, `Type "DangerousGoodsInfo" is an entity extension type and cannot be used within value object types. Change "Address" to an entity extension type or use a value object type for "items".`);
|
|
452
|
-
});
|
|
453
|
-
it('rejects entity extension types on list fields', () => {
|
|
454
|
-
const field = new model_1.Field({
|
|
455
|
-
name: 'items',
|
|
456
|
-
typeName: 'DangerousGoodsInfo',
|
|
457
|
-
isList: true,
|
|
458
|
-
}, deliveryType);
|
|
459
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, `Type "DangerousGoodsInfo" is an entity extension type and cannot be used in a list. Change the field type to "DangerousGoodsInfo" (without brackets), or use a child entity or value object type instead.`);
|
|
460
|
-
});
|
|
461
|
-
});
|
|
462
|
-
describe('with child entity type', () => {
|
|
463
|
-
it('accepts child entities embedded in root entities', () => {
|
|
464
|
-
const field = new model_1.Field({
|
|
465
|
-
name: 'items',
|
|
466
|
-
typeName: 'Item',
|
|
467
|
-
isList: true,
|
|
468
|
-
}, deliveryType);
|
|
469
|
-
(0, validation_utils_1.expectToBeValid)(field);
|
|
470
|
-
});
|
|
471
|
-
it('accepts child entities embedded in child entities', () => {
|
|
472
|
-
const field = new model_1.Field({
|
|
473
|
-
name: 'items',
|
|
474
|
-
typeName: 'Item',
|
|
475
|
-
isList: true,
|
|
476
|
-
}, itemType);
|
|
477
|
-
(0, validation_utils_1.expectToBeValid)(field);
|
|
478
|
-
});
|
|
479
|
-
it('accepts child entities embedded in entity extensions', () => {
|
|
480
|
-
const field = new model_1.Field({
|
|
481
|
-
name: 'items',
|
|
482
|
-
typeName: 'Item',
|
|
483
|
-
isList: true,
|
|
484
|
-
}, dangerousGoodsInfoType);
|
|
485
|
-
(0, validation_utils_1.expectToBeValid)(field);
|
|
486
|
-
});
|
|
487
|
-
it('rejects child entities embedded in value objects', () => {
|
|
488
|
-
const field = new model_1.Field({
|
|
489
|
-
name: 'items',
|
|
490
|
-
typeName: 'Item',
|
|
491
|
-
isList: true,
|
|
492
|
-
}, addressType);
|
|
493
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, `Type "Item" is a child entity type and cannot be used within value object types. Change "Address" to an entity extension type or use a value object type for "items".`);
|
|
494
|
-
});
|
|
495
|
-
it('rejects child entity types on non-list fields', () => {
|
|
496
|
-
const field = new model_1.Field({
|
|
497
|
-
name: 'items',
|
|
498
|
-
typeName: 'Item',
|
|
499
|
-
isList: false,
|
|
500
|
-
}, deliveryType);
|
|
501
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, `Type "Item" is a child entity type and can only be used in a list. Change the field type to "[Item]", or use an entity extension or value object type instead.`);
|
|
502
|
-
});
|
|
503
|
-
});
|
|
504
|
-
describe('with default value', () => {
|
|
505
|
-
it('accepts on scalar types', () => {
|
|
506
|
-
const field = new model_1.Field({
|
|
507
|
-
name: 'amount',
|
|
508
|
-
typeName: 'Int',
|
|
509
|
-
defaultValue: 123,
|
|
510
|
-
}, itemType);
|
|
511
|
-
const res = (0, validation_utils_1.validate)(field);
|
|
512
|
-
(0, chai_1.expect)(res.messages.length, res.toString()).to.equal(1);
|
|
513
|
-
(0, chai_1.expect)(res.messages[0].severity, res.toString()).to.equal(model_1.Severity.Info); // warning about no type checking for default values
|
|
514
|
-
});
|
|
515
|
-
it('accepts on value object types', () => {
|
|
516
|
-
const field = new model_1.Field({
|
|
517
|
-
name: 'address',
|
|
518
|
-
typeName: 'Address',
|
|
519
|
-
defaultValue: 123,
|
|
520
|
-
}, deliveryType);
|
|
521
|
-
const res = (0, validation_utils_1.validate)(field);
|
|
522
|
-
(0, chai_1.expect)(res.messages.length, res.toString()).to.equal(1);
|
|
523
|
-
(0, chai_1.expect)(res.messages[0].severity, res.toString()).to.equal(model_1.Severity.Info); // warning about no type checking for default values
|
|
524
|
-
});
|
|
525
|
-
});
|
|
526
|
-
describe('with permissions', () => {
|
|
527
|
-
describe('with permission profile', () => {
|
|
528
|
-
const field = new model_1.Field({
|
|
529
|
-
name: 'totalAmount',
|
|
530
|
-
typeName: 'Int',
|
|
531
|
-
permissions: {
|
|
532
|
-
permissionProfileName: 'accounting',
|
|
533
|
-
},
|
|
534
|
-
}, deliveryType);
|
|
535
|
-
it('accepts', () => {
|
|
536
|
-
(0, validation_utils_1.expectToBeValid)(field);
|
|
537
|
-
});
|
|
538
|
-
it('resolves permission profile', () => {
|
|
539
|
-
(0, chai_1.expect)(field.permissionProfile).to.equal(model.rootNamespace.getPermissionProfileOrThrow('accounting'));
|
|
540
|
-
});
|
|
541
|
-
});
|
|
542
|
-
it('accepts direct role specifier', () => {
|
|
543
|
-
const field = new model_1.Field({
|
|
544
|
-
name: 'totalAmount',
|
|
545
|
-
typeName: 'Int',
|
|
546
|
-
permissions: {
|
|
547
|
-
roles: {
|
|
548
|
-
read: ['accounting'],
|
|
549
|
-
readWrite: ['admin'],
|
|
550
|
-
},
|
|
551
|
-
},
|
|
552
|
-
}, deliveryType);
|
|
553
|
-
(0, validation_utils_1.expectToBeValid)(field);
|
|
554
|
-
});
|
|
555
|
-
it('rejects combining roles and permission profiles', () => {
|
|
556
|
-
const field = new model_1.Field({
|
|
557
|
-
name: 'totalAmount',
|
|
558
|
-
typeName: 'Int',
|
|
559
|
-
permissions: {
|
|
560
|
-
permissionProfileName: 'accounting',
|
|
561
|
-
roles: {
|
|
562
|
-
read: ['accounting'],
|
|
563
|
-
readWrite: ['admin'],
|
|
564
|
-
},
|
|
565
|
-
},
|
|
566
|
-
}, deliveryType);
|
|
567
|
-
const result = (0, validation_utils_1.validate)(field);
|
|
568
|
-
(0, chai_1.expect)(result.messages.length).to.equal(2);
|
|
569
|
-
for (const message of result.messages) {
|
|
570
|
-
(0, chai_1.expect)(message.severity).to.equal(model_1.Severity.Error);
|
|
571
|
-
(0, chai_1.expect)(message.message).to.equal(`Permission profile and explicit role specifiers cannot be combined.`);
|
|
572
|
-
}
|
|
573
|
-
});
|
|
574
|
-
it('rejects missing permission profile', () => {
|
|
575
|
-
const field = new model_1.Field({
|
|
576
|
-
name: 'totalAmount',
|
|
577
|
-
typeName: 'Int',
|
|
578
|
-
permissions: {
|
|
579
|
-
permissionProfileName: 'undefined',
|
|
580
|
-
},
|
|
581
|
-
}, deliveryType);
|
|
582
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, `Permission profile "undefined" not found`);
|
|
583
|
-
});
|
|
584
|
-
});
|
|
585
|
-
describe('with calc mutations', () => {
|
|
586
|
-
it('accepts ADD and MULTIPLY on Int', () => {
|
|
587
|
-
const field = new model_1.Field({
|
|
588
|
-
name: 'amount',
|
|
589
|
-
typeName: 'Int',
|
|
590
|
-
calcMutationOperators: [
|
|
591
|
-
model_1.CalcMutationsOperator.ADD,
|
|
592
|
-
model_1.CalcMutationsOperator.MULTIPLY,
|
|
593
|
-
],
|
|
594
|
-
}, itemType);
|
|
595
|
-
(0, validation_utils_1.expectToBeValid)(field);
|
|
596
|
-
});
|
|
597
|
-
it('accepts APPEND on String', () => {
|
|
598
|
-
const field = new model_1.Field({
|
|
599
|
-
name: 'log',
|
|
600
|
-
typeName: 'String',
|
|
601
|
-
calcMutationOperators: [model_1.CalcMutationsOperator.APPEND],
|
|
602
|
-
}, deliveryType);
|
|
603
|
-
(0, validation_utils_1.expectToBeValid)(field);
|
|
604
|
-
});
|
|
605
|
-
it('rejects APPEND on Boolean', () => {
|
|
606
|
-
const field = new model_1.Field({
|
|
607
|
-
name: 'isConfirmed',
|
|
608
|
-
typeName: 'Boolean',
|
|
609
|
-
calcMutationOperators: [model_1.CalcMutationsOperator.APPEND],
|
|
610
|
-
}, deliveryType);
|
|
611
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, `Type "Boolean" does not support any calc mutation operators.`);
|
|
612
|
-
});
|
|
613
|
-
it('rejects APPEND on Int', () => {
|
|
614
|
-
const field = new model_1.Field({
|
|
615
|
-
name: 'amount',
|
|
616
|
-
typeName: 'Int',
|
|
617
|
-
calcMutationOperators: [model_1.CalcMutationsOperator.APPEND],
|
|
618
|
-
}, deliveryType);
|
|
619
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, `Calc mutation operator "APPEND" is not supported on type "Int" (supported operators: "MULTIPLY", "DIVIDE", "ADD", "SUBTRACT", "MODULO").`);
|
|
620
|
-
});
|
|
621
|
-
it('rejects MULTIPLY on String', () => {
|
|
622
|
-
const field = new model_1.Field({
|
|
623
|
-
name: 'deliveryNumber',
|
|
624
|
-
typeName: 'String',
|
|
625
|
-
calcMutationOperators: [model_1.CalcMutationsOperator.MULTIPLY],
|
|
626
|
-
}, deliveryType);
|
|
627
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, `Calc mutation operator "MULTIPLY" is not supported on type "String" (supported operators: "APPEND", "PREPEND").`);
|
|
628
|
-
});
|
|
629
|
-
it('rejects APPEND on lists', () => {
|
|
630
|
-
const field = new model_1.Field({
|
|
631
|
-
name: 'amount',
|
|
632
|
-
typeName: 'String',
|
|
633
|
-
isList: true,
|
|
634
|
-
calcMutationOperators: [model_1.CalcMutationsOperator.APPEND],
|
|
635
|
-
}, deliveryType);
|
|
636
|
-
(0, validation_utils_1.expectSingleErrorToInclude)(field, `Calc mutations are not supported on list fields.`);
|
|
637
|
-
});
|
|
638
|
-
it('warns about @calcMutations within a value object', () => {
|
|
639
|
-
const field = new model_1.Field({
|
|
640
|
-
name: 'amount',
|
|
641
|
-
typeName: 'Int',
|
|
642
|
-
calcMutationOperators: [model_1.CalcMutationsOperator.ADD],
|
|
643
|
-
}, addressType);
|
|
644
|
-
(0, validation_utils_1.expectSingleWarningToInclude)(field, `Calc mutations do not work within value objects because value objects cannot be updated. This will be an error in a future release.`);
|
|
645
|
-
});
|
|
646
|
-
});
|
|
647
|
-
});
|
|
648
|
-
//# sourceMappingURL=field.spec.js.map
|