@contember/schema-utils 1.1.1 → 1.2.0-alpha.10

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.
Files changed (65) hide show
  1. package/dist/src/acl/PredicateDefinitionProcessor.d.ts.map +1 -1
  2. package/dist/src/acl/PredicateDefinitionProcessor.js +1 -0
  3. package/dist/src/acl/PredicateDefinitionProcessor.js.map +1 -1
  4. package/dist/src/model/NamingHelper.d.ts +2 -0
  5. package/dist/src/model/NamingHelper.d.ts.map +1 -1
  6. package/dist/src/model/NamingHelper.js +20 -7
  7. package/dist/src/model/NamingHelper.js.map +1 -1
  8. package/dist/src/schemaNormalizer.d.ts.map +1 -1
  9. package/dist/src/schemaNormalizer.js +15 -4
  10. package/dist/src/schemaNormalizer.js.map +1 -1
  11. package/dist/src/tsconfig.tsbuildinfo +1 -1
  12. package/dist/src/type-schema/acl.d.ts.map +1 -1
  13. package/dist/src/type-schema/acl.js +15 -3
  14. package/dist/src/type-schema/acl.js.map +1 -1
  15. package/dist/src/type-schema/condition.d.ts +5 -0
  16. package/dist/src/type-schema/condition.d.ts.map +1 -0
  17. package/dist/src/type-schema/condition.js +95 -0
  18. package/dist/src/type-schema/condition.js.map +1 -0
  19. package/dist/src/type-schema/index.d.ts +1 -0
  20. package/dist/src/type-schema/index.d.ts.map +1 -1
  21. package/dist/src/type-schema/index.js +1 -0
  22. package/dist/src/type-schema/index.js.map +1 -1
  23. package/dist/src/type-schema/model.d.ts +1 -0
  24. package/dist/src/type-schema/model.d.ts.map +1 -1
  25. package/dist/src/type-schema/model.js +5 -0
  26. package/dist/src/type-schema/model.js.map +1 -1
  27. package/dist/src/validation/AclValidator.d.ts.map +1 -1
  28. package/dist/src/validation/AclValidator.js +13 -2
  29. package/dist/src/validation/AclValidator.js.map +1 -1
  30. package/dist/src/validation/MembershipResolver.d.ts +37 -0
  31. package/dist/src/validation/MembershipResolver.d.ts.map +1 -0
  32. package/dist/src/validation/MembershipResolver.js +104 -0
  33. package/dist/src/validation/MembershipResolver.js.map +1 -0
  34. package/dist/src/validation/ModelValidator.d.ts.map +1 -1
  35. package/dist/src/validation/ModelValidator.js +11 -4
  36. package/dist/src/validation/ModelValidator.js.map +1 -1
  37. package/dist/src/validation/index.d.ts +1 -0
  38. package/dist/src/validation/index.d.ts.map +1 -1
  39. package/dist/src/validation/index.js +1 -0
  40. package/dist/src/validation/index.js.map +1 -1
  41. package/dist/tests/cases/unit/conditionSchema.test.d.ts +2 -0
  42. package/dist/tests/cases/unit/conditionSchema.test.d.ts.map +1 -0
  43. package/dist/tests/cases/unit/conditionSchema.test.js +50 -0
  44. package/dist/tests/cases/unit/conditionSchema.test.js.map +1 -0
  45. package/dist/tests/cases/unit/membershipResolver.test.d.ts +2 -0
  46. package/dist/tests/cases/unit/membershipResolver.test.d.ts.map +1 -0
  47. package/dist/tests/cases/unit/membershipResolver.test.js +149 -0
  48. package/dist/tests/cases/unit/membershipResolver.test.js.map +1 -0
  49. package/dist/tests/tsconfig.tsbuildinfo +1 -0
  50. package/package.json +5 -5
  51. package/src/acl/PredicateDefinitionProcessor.ts +1 -0
  52. package/src/model/NamingHelper.ts +19 -8
  53. package/src/schemaNormalizer.ts +15 -4
  54. package/src/type-schema/acl.ts +30 -9
  55. package/src/type-schema/condition.ts +81 -0
  56. package/src/type-schema/index.ts +1 -0
  57. package/src/type-schema/model.ts +7 -0
  58. package/src/validation/AclValidator.ts +12 -2
  59. package/src/validation/MembershipResolver.ts +133 -0
  60. package/src/validation/ModelValidator.ts +13 -4
  61. package/src/validation/index.ts +1 -0
  62. package/tests/cases/unit/conditionSchema.test.ts +55 -0
  63. package/tests/cases/unit/membershipResolver.test.ts +161 -0
  64. package/tests/tsconfig.json +12 -0
  65. package/tsconfig.json +8 -1
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../../../node_modules/typescript/lib/lib.es5.d.ts","../../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../../node_modules/typescript/lib/lib.esnext.d.ts","../../../../node_modules/typescript/lib/lib.dom.d.ts","../../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../node_modules/tinyspy/dist/index.d.ts","../../../../node_modules/@types/node/assert.d.ts","../../../../node_modules/@types/node/assert/strict.d.ts","../../../../node_modules/@types/node/globals.d.ts","../../../../node_modules/@types/node/async_hooks.d.ts","../../../../node_modules/@types/node/buffer.d.ts","../../../../node_modules/@types/node/child_process.d.ts","../../../../node_modules/@types/node/cluster.d.ts","../../../../node_modules/@types/node/console.d.ts","../../../../node_modules/@types/node/constants.d.ts","../../../../node_modules/@types/node/crypto.d.ts","../../../../node_modules/@types/node/dgram.d.ts","../../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../../node_modules/@types/node/dns.d.ts","../../../../node_modules/@types/node/dns/promises.d.ts","../../../../node_modules/@types/node/domain.d.ts","../../../../node_modules/@types/node/events.d.ts","../../../../node_modules/@types/node/fs.d.ts","../../../../node_modules/@types/node/fs/promises.d.ts","../../../../node_modules/@types/node/http.d.ts","../../../../node_modules/@types/node/http2.d.ts","../../../../node_modules/@types/node/https.d.ts","../../../../node_modules/@types/node/inspector.d.ts","../../../../node_modules/@types/node/module.d.ts","../../../../node_modules/@types/node/net.d.ts","../../../../node_modules/@types/node/os.d.ts","../../../../node_modules/@types/node/path.d.ts","../../../../node_modules/@types/node/perf_hooks.d.ts","../../../../node_modules/@types/node/process.d.ts","../../../../node_modules/@types/node/punycode.d.ts","../../../../node_modules/@types/node/querystring.d.ts","../../../../node_modules/@types/node/readline.d.ts","../../../../node_modules/@types/node/readline/promises.d.ts","../../../../node_modules/@types/node/repl.d.ts","../../../../node_modules/@types/node/stream.d.ts","../../../../node_modules/@types/node/stream/promises.d.ts","../../../../node_modules/@types/node/stream/consumers.d.ts","../../../../node_modules/@types/node/stream/web.d.ts","../../../../node_modules/@types/node/string_decoder.d.ts","../../../../node_modules/@types/node/test.d.ts","../../../../node_modules/@types/node/timers.d.ts","../../../../node_modules/@types/node/timers/promises.d.ts","../../../../node_modules/@types/node/tls.d.ts","../../../../node_modules/@types/node/trace_events.d.ts","../../../../node_modules/@types/node/tty.d.ts","../../../../node_modules/@types/node/url.d.ts","../../../../node_modules/@types/node/util.d.ts","../../../../node_modules/@types/node/v8.d.ts","../../../../node_modules/@types/node/vm.d.ts","../../../../node_modules/@types/node/wasi.d.ts","../../../../node_modules/@types/node/worker_threads.d.ts","../../../../node_modules/@types/node/zlib.d.ts","../../../../node_modules/@types/node/globals.global.d.ts","../../../../node_modules/@types/node/index.d.ts","../../../../node_modules/esbuild/lib/main.d.ts","../../../../node_modules/rollup/dist/rollup.d.ts","../../../../node_modules/source-map-js/source-map.d.ts","../../../../node_modules/postcss/lib/comment.d.ts","../../../../node_modules/postcss/lib/at-rule.d.ts","../../../../node_modules/postcss/lib/rule.d.ts","../../../../node_modules/postcss/lib/container.d.ts","../../../../node_modules/postcss/lib/declaration.d.ts","../../../../node_modules/postcss/lib/previous-map.d.ts","../../../../node_modules/postcss/lib/input.d.ts","../../../../node_modules/postcss/lib/css-syntax-error.d.ts","../../../../node_modules/postcss/lib/warning.d.ts","../../../../node_modules/postcss/lib/document.d.ts","../../../../node_modules/postcss/lib/root.d.ts","../../../../node_modules/postcss/lib/lazy-result.d.ts","../../../../node_modules/postcss/lib/no-work-result.d.ts","../../../../node_modules/postcss/lib/processor.d.ts","../../../../node_modules/postcss/lib/result.d.ts","../../../../node_modules/postcss/lib/node.d.ts","../../../../node_modules/postcss/lib/list.d.ts","../../../../node_modules/postcss/lib/postcss.d.ts","../../../../node_modules/vite/dist/node/index.d.ts","../../../../node_modules/vitest/dist/global-fe52f84b.d.ts","../../../../node_modules/vitest/dist/index-ea17aa0c.d.ts","../../../../node_modules/@types/chai/index.d.ts","../../../../node_modules/vitest/dist/index.d.ts","../../../schema/dist/src/schema/value.d.ts","../../../schema/dist/src/schema/input.d.ts","../../../schema/dist/src/schema/model.d.ts","../../../schema/dist/src/schema/json.d.ts","../../../schema/dist/src/schema/acl.d.ts","../../../schema/dist/src/schema/validation.d.ts","../../../schema/dist/src/schema/result.d.ts","../../../schema/dist/src/ProjectRole.d.ts","../../../schema/dist/src/index.d.ts","../../../typesafe/dist/src/index.d.ts","../src/type-schema/acl.d.ts","../src/type-schema/condition.d.ts","../src/type-schema/model.d.ts","../src/type-schema/validation.d.ts","../src/type-schema/index.d.ts","../../tests/cases/unit/conditionSchema.test.ts","../src/model/modelUtils.d.ts","../src/model/NamingHelper.d.ts","../src/model/index.d.ts","../src/acl/AllowAllPermissionFactory.d.ts","../src/acl/PredicateDefinitionProcessor.d.ts","../src/acl/schemaUtils.d.ts","../src/acl/index.d.ts","../src/dataUtils.d.ts","../src/validation/errors.d.ts","../src/validation/AclValidator.d.ts","../src/validation/ModelValidator.d.ts","../src/validation/ValidationValidator.d.ts","../src/validation/SchemaValidator.d.ts","../src/validation/MembershipResolver.d.ts","../src/validation/index.d.ts","../src/schemaNormalizer.d.ts","../src/schemaFilter.d.ts","../src/utils/assertNever.d.ts","../src/utils/isIt.d.ts","../src/utils/deepCompare.d.ts","../src/utils/index.d.ts","../src/index.d.ts","../../tests/cases/unit/membershipResolver.test.ts","../../../../node_modules/@types/accepts/index.d.ts","../../../../node_modules/@types/bcrypt/index.d.ts","../../../../node_modules/@types/connect/index.d.ts","../../../../node_modules/@types/body-parser/index.d.ts","../../../../node_modules/@types/keyv/index.d.ts","../../../../node_modules/@types/http-cache-semantics/index.d.ts","../../../../node_modules/@types/responselike/index.d.ts","../../../../node_modules/@types/cacheable-request/index.d.ts","../../../../node_modules/@types/caseless/index.d.ts","../../../../node_modules/@types/chai-subset/index.d.ts","../../../../node_modules/@types/content-disposition/index.d.ts","../../../../node_modules/@types/cookiejar/index.d.ts","../../../../node_modules/@types/keygrip/index.d.ts","../../../../node_modules/@types/range-parser/index.d.ts","../../../../node_modules/@types/qs/index.d.ts","../../../../node_modules/@types/express-serve-static-core/index.d.ts","../../../../node_modules/@types/mime/Mime.d.ts","../../../../node_modules/@types/mime/index.d.ts","../../../../node_modules/@types/serve-static/index.d.ts","../../../../node_modules/@types/express/index.d.ts","../../../../node_modules/@types/cookies/index.d.ts","../../../../node_modules/@types/fs-extra/index.d.ts","../../../../node_modules/@types/http-assert/index.d.ts","../../../../node_modules/@types/http-errors/index.d.ts","../../../../node_modules/@types/js-yaml/index.d.ts","../../../../node_modules/@types/json-buffer/index.d.ts","../../../../node_modules/@types/json-schema/index.d.ts","../../../../node_modules/@types/json-stable-stringify/index.d.ts","../../../../node_modules/@types/jsonwebtoken/index.d.ts","../../../../node_modules/@types/koa-compose/index.d.ts","../../../../node_modules/@types/koa/index.d.ts","../../../../node_modules/@types/koa-bodyparser/index.d.ts","../../../../node_modules/@types/koa-compress/index.d.ts","../../../../node_modules/@types/koa__cors/index.d.ts","../../../../node_modules/@types/mime-types/index.d.ts","../../../../node_modules/@types/mustache/index.d.ts","../../../../node_modules/form-data/index.d.ts","../../../../node_modules/@types/node-fetch/externals.d.ts","../../../../node_modules/@types/node-fetch/index.d.ts","../../../../node_modules/@types/nodemailer/lib/dkim/index.d.ts","../../../../node_modules/@types/nodemailer/lib/mailer/mail-message.d.ts","../../../../node_modules/@types/nodemailer/lib/xoauth2/index.d.ts","../../../../node_modules/@types/nodemailer/lib/mailer/index.d.ts","../../../../node_modules/@types/nodemailer/lib/mime-node/index.d.ts","../../../../node_modules/@types/nodemailer/lib/smtp-connection/index.d.ts","../../../../node_modules/@types/nodemailer/lib/shared/index.d.ts","../../../../node_modules/@types/nodemailer/lib/json-transport/index.d.ts","../../../../node_modules/@types/nodemailer/lib/sendmail-transport/index.d.ts","../../../../node_modules/@types/nodemailer/lib/ses-transport/index.d.ts","../../../../node_modules/@types/nodemailer/lib/smtp-pool/index.d.ts","../../../../node_modules/@types/nodemailer/lib/smtp-transport/index.d.ts","../../../../node_modules/@types/nodemailer/lib/stream-transport/index.d.ts","../../../../node_modules/@types/nodemailer/index.d.ts","../../../../node_modules/@types/npm-package-arg/index.d.ts","../../../../node_modules/@types/parse-json/index.d.ts","../../../../node_modules/pg-types/index.d.ts","../../../../node_modules/pg-protocol/dist/messages.d.ts","../../../../node_modules/pg-protocol/dist/serializer.d.ts","../../../../node_modules/pg-protocol/dist/parser.d.ts","../../../../node_modules/pg-protocol/dist/index.d.ts","../../../../node_modules/@types/pg/index.d.ts","../../../../node_modules/@types/prompts/index.d.ts","../../../../node_modules/@types/request/node_modules/form-data/index.d.ts","../../../../node_modules/@types/tough-cookie/index.d.ts","../../../../node_modules/@types/request/index.d.ts","../../../../node_modules/@types/sinonjs__fake-timers/index.d.ts","../../../../node_modules/@types/sinon/index.d.ts","../../../../node_modules/buffer/index.d.ts","../../../../node_modules/@types/superagent/index.d.ts","../../../../node_modules/@types/supertest/index.d.ts","../../../../node_modules/@types/uuid/index.d.ts","../../../../node_modules/@types/ws/index.d.ts"],"fileInfos":[{"version":"f20c05dbfe50a208301d2a1da37b9931bce0466eb5a1f4fe240971b4ecc82b67","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f","d11a03592451da2d1065e09e61f4e2a9bf68f780f4f6623c18b57816a9679d17","aea179452def8a6152f98f63b191b84e7cbd69b0e248c91e61fb2e52328abe8c",{"version":"9b087de7268e4efc5f215347a62656663933d63c0b1d7b624913240367b999ea","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"55f400eec64d17e888e278f4def2f254b41b89515d3b88ad75d5e05f019daddd","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"775d9c9fd150d5de79e0450f35bc8b8f94ae64e3eb5da12725ff2a649dccc777","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"34c839eaaa6d78c8674ae2c37af2236dee6831b13db7b4ef4df3ec889a04d4f2","affectsGlobalScope":true},{"version":"34478567f8a80171f88f2f30808beb7da15eac0538ae91282dd33dce928d98ed","affectsGlobalScope":true},{"version":"ab7d58e6161a550ff92e5aff755dc37fe896245348332cd5f1e1203479fe0ed1","affectsGlobalScope":true},{"version":"6bda95ea27a59a276e46043b7065b55bd4b316c25e70e29b572958fa77565d43","affectsGlobalScope":true},{"version":"aedb8de1abb2ff1095c153854a6df7deae4a5709c37297f9d6e9948b6806fa66","affectsGlobalScope":true},{"version":"a4da0551fd39b90ca7ce5f68fb55d4dc0c1396d589b612e1902f68ee090aaada","affectsGlobalScope":true},{"version":"11ffe3c281f375fff9ffdde8bbec7669b4dd671905509079f866f2354a788064","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"a7157ee945ba3e7ccf605cf5f2e83e62f7694b92a3ddf8bc69c5182fe93aa98f","9122ed7070e054b73ebab37c2373a196def2d90e7d1a9a7fcd9d46b0e51fae78","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"77f0b5c6a193a699c9f7d7fb0578e64e562d271afa740783665d2a827104a873","affectsGlobalScope":true},"21a167fec8f933752fb8157f06d28fab6817af3ad9b0bdb1908a10762391eab9",{"version":"002d6d5f044365b3fbfba0ba9be3bb57cac09b81547c8df4b0795755d2081d90","affectsGlobalScope":true},"0c0cee62cb619aed81133b904f644515ba3064487002a7da83fd8aa07b1b4abd","5a94487653355b56018122d92392beb2e5f4a6c63ba5cef83bbe1c99775ef713",{"version":"d5135ad93b33adcce80b18f8065087934cdc1730d63db58562edcf017e1aad9b","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","c4cfc9a6e2ebb8bc8c0e2392dfc4056993ced3b35069ebf132ac18ca7a562881","bb9c4ffa5e6290c6980b63c815cdd1625876dadb2efaf77edbe82984be93e55e","75ecef44f126e2ae018b4abbd85b6e8a2e2ba1638ebec56cc64274643ce3567b","f30bb836526d930a74593f7b0f5c1c46d10856415a8f69e5e2fc3db80371e362","14b5aa23c5d0ae1907bc696ac7b6915d88f7d85799cc0dc2dcf98fbce2c5a67c","5c439dafdc09abe4d6c260a96b822fa0ba5be7203c71a63ab1f1423cd9e838ea",{"version":"bae4ea23beb8397755b935cb84d3cdc6cdb0b1b4a329b90de9fc6c8774d71994","affectsGlobalScope":true},"cec36af22f514322f870e81d30675c78df82ae8bf4863f5fd4e4424c040c678d","df36874d9e56aff601e921c4b3971d37cf66d14f6455935ce821e6cad13b1823","68915895d4a136df5cf5f90aaa41d8e1e47ec047e7781a150b5d0cf273dbb7a9","acfbb5aaef964e1d441f961a1846197f03241dba3c63b1e4d1903684888ef465","09416dd69576b03a3f485adf329a02f043e4a481e060ef5b208194e488d31fd9","2c828a5405191d006115ab34e191b8474bc6c86ffdc401d1a9864b1b6e088a58",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"76527127c8b749bee5977408861ce3ee56ec19ddcea8704c628f98ca610283e6","a907bf91df26df2400858ef75f749498fb5cf00062bf90a737ac3949cc07978d","cb92bc2e42b261e4299025756f1beb826b3d9666a3f0d46f8a7254ca512f57e4","cb4f3f03480e1727eae46400606cecaa97f550186ff8fa909ebc00db4180531b",{"version":"b3624aed92dab6da8484280d3cb3e2f4130ec3f4ef3f8201c95144ae9e898bb6","affectsGlobalScope":true},"5153a2fd150e46ce57bb3f8db1318d33f6ad3261ed70ceeff92281c0608c74a3","d1a78a3c5708807e8de3e399f91df4797c62e44b02195eefc2209b2e713e54ee","36b03690b628eab08703d63f04eaa89c5df202e5f1edf3989f13ad389cd2c091","0effadd232a20498b11308058e334d3339cc5bf8c4c858393e38d9d4c0013dcf","25846d43937c672bab7e8195f3d881f93495df712ee901860effc109918938cc","556bf5c36deb62cffa1bf697c1789fe008ec82db0273025001db66732714e9d9","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","23b89798789dffbd437c0c423f5d02d11f9736aea73d6abf16db4f812ff36eda","0830071706fa0e477fb5e95f0955cc1062b5948b146b7d4e03a126f12ad6085f",{"version":"970a90f76d4d219ad60819d61f5994514087ba94c985647a3474a5a3d12714ed","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","4c8525f256873c7ba3135338c647eaf0ca7115a1a2805ae2d0056629461186ce","3c13ef48634e7b5012fcf7e8fce7496352c2d779a7201389ca96a2a81ee4314d","5d0a25ec910fa36595f85a67ac992d7a53dd4064a1ba6aea1c9f14ab73a023f2",{"version":"bfe39beb986d2a2e512c091cbe924f1c415bc65de54de0e2f6a0dc6f84c183d9","affectsGlobalScope":true},"2d526e6f21d8cc66ac11ada32874e95ae88d870c6c9d3d9d4e03b1d1f9ad7b8e","06d7c42d256f0ce6afe1b2b6cfbc97ab391f29dadb00dd0ae8e8f23f5bc916c3","ec4bd1b200670fb567920db572d6701ed42a9641d09c4ff6869768c8f81b404c","e59a892d87e72733e2a9ca21611b9beb52977be2696c7ba4b216cbbb9a48f5aa","d2ec52f565f0570e90b659811347bd689f8c6039b11eaaccd0f243759d46da6e","8a300fa9b698845a1f9c41ecbe2c5966634582a8e2020d51abcace9b55aa959e",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"a12806a1bde5e9f137bb79728d87a4ceaedf04e95efc9967d3288a3c252d9a7b","47e4d28317fd882a6b6c19bcecd7543b8419c1fff599d5e6b293e1a29acb4a2b","9f47d99ed5c23a78163db6ac3adee21d0398b2c53f264ceac0d77ce5ee4dabd5","858d0d831826c6eb563df02f7db71c90e26deadd0938652096bea3cc14899700","d1c89db652113258e4ba4bbdf5cc7a2a3a600403d4d864a2087b95186253cd5b","11a90d2cb2eaf7fdf931a63b58279e8161f1477a1bd1e914ae026c1bbf9afed3","af18e30f3ba06e9870b61dfa4a109215caabdaa337590c51b4a044a9f338ce96","ace603f7b60599f2dcdbd71c07137b60a747dd33be540f4a294b890f9e0b89dc","7658fbdd425c656fb1849b44932ae7431e8c3198d22c65ce1490deb582743b52","7786c75c1b46e93b33c63dccf689143a5f47ff451a6b3bd9b10e4801cdeadcc2","615b7264db151461b896cd79719414d63f7b2b2100b275828e53cab95a356e2f","31491a01ed7466e0b3b0ef8407f2524683055eceb955b1d5ccf7096129468b39","f4b12f7dde4fc0e386648318481bdcfe861b566be246bebf0e8a11ebd909adf9","e8966f7c424780bb0b9d411ebe13eda8555ca15aa675603316c2952bc027b0e3","df0e5f3c4a518111d160cf3bebc9a3ac7d39c6e3bfb7a21d43c304896c3015e2","df4e2f161f74870708c2cc5e1036a6405b878496408fda1ee50d5b10e50d6601","bf791da347fb1c0ffc1e2fcd35867e64bb8355270ae26278198c521bdcf94569","e0e0e3c068e145fbb322120979299ff130ffdd39f0dcd0d5aeaa9f3f8a0d01d9","fde91356172e35b9ea68bbdf33721f7c80307a4ce65b82105eac800e9e744995","9bd5e5a4a1e66b35efe3c48ddac1116537ef86e041717f3a9b9f1e060c74efa6","d7e4a5f4ccfb749c3033fafc233073b4d1dcca0249785186c589602a81f9d86f","68161b6f3004fc10f8bb47a4986cef13c3b0728fb1ca3e1dc7316227d09b2c8d","c9ea666d25f520c9a46da8a32df7f29b68b3ea7c7c604881641dbd11d38ed16b",{"version":"78f2ca8c9f39685056afa70c009798ebe30ae92b33f7dd8db8046d3ad55d2b13","affectsGlobalScope":true},"72c94bbd3e8d997794f0d4b4fe697bffa46e9bc16b004697ff20daf00507ff71",{"version":"127bf414ca8ced28c9738b91a935121009d03bbc136668db980bd1ba18976b2b","affectsGlobalScope":true},"ff3cc25e0b9d37a21b92f22309037f501ca43e329159a5216e77045e72c3719f","54d7b38e70f49e16e409e31bc3aa3f783333883d10b4a64288f26d8182e40317","2dcc342b8f20fdc8f20146b6044e890c59facfbbe4494a007e51b1f80c3595d4","48cfe65b609f0889bf7d8ffedaf97e7649c8e4527a3782bd115cad66421531d4","1a56e890ce283cffb5fcfd798dcf611537671c01aaf65c777583f2628c14a420","670f91ec754cd7169ac33ccb5f3dd2ff1b943b152169da61f6f15b035928988b","bd9cf823528e4b898ab79fecc4d065ac5bea2b949fa412cbba3a939c0c19d90c","1f8e74f5c12a8a589a3481e16de762f3793231c820d39fc48b8667e03c270496","63b9eee470bd3614d3e4d9bc984817bf83643caec9cfdaada125c56c1552906c","41161650713d47bf2be0f63ecb56240e828212c883952cb149b39cf9bf7052dc","c2b80ece688f0b975dbb874dac0a9aac1e53b47c752b3cbb36c44e6977bc00ff","26ca46f6e4aa5153805c46b1b6ace3dae47fd1966b5cb9f0d112450deb6ac35f","b99a11b75c6dc7a6653a469b893367a76550f750180cbdd1d7075f1f40f02ee0","58559e87bff56195169e0f79cba5e91c140abd8bc47b409c6e9b9f103b736beb","4e3b73bcd3b645372ed8b2a6196f4a3334543f121549e3c7a688d90f2bce8962","f91f80abab09f00e389566b377368142d8e4892f23e3f8258e3cde02f1931b96",{"version":"2f81a163fdb114f7c65f82d5c8e303c63bcfd0c49590ee151da88762a6f72ef3","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"594aea27f4b909e676763ded405f16036c051ccb4de64d7f8a4067646d121662","dea76be2a527c8af8356e2102cfcc79a4527e1506d8aa2073af98bcedf27be8e","191b630015687186f270d7128f06f84153a8bd818be4db760994abd02fff150c","94cbd6e195ba666580972c589a6742ceb7737df80cdf4463e3a1a0b692d8ee71","5339c4ddf8f1342c63751bd5e186ab67818e780f7203d040aa1688b6a3628fe6","91fde34f0434e94fc67c9f2eaa418b661b50c5c170db6f67459616d846436886","a0fb3491fd481df80018ea786a687229f19aab04897efda1db40fecaf016f3c3","31f0efc8ce4f09a1e5bfd9cb920b6862c5ba9f42a0a9f691f6ab4f166a7031ed","d898c836432c8b1727b629d84eb33ef2247c9420213152e530c7e28ba6049f78","451a650793c87c70c699b68f940954b4bf95d5115eae277595c590b470312b31","dfae5468e1cfa976e5f19388bfe4e64fac62838e3418a0cc72d7a45d9df0902d","96e37cf5e50bac5af9ffc1df2ebe3582dcde0905f4a4ef987f9c188434da12a1","803ebdaff877e156078806a22f9d24e038c8f1690cb67943619a4647b799202f","ee2c7f06f890565e9a636162b7ec6144f2039336e9302dd599f5225f87cca45c","07f6acddb30ad60bcefd2c6738e14086b733cabd0bb0ee752b9cd9ca1b49a877","2cbe1796c1a0028e0ecb0a82143f15a9815c0efb7611fddfec8170ee437fb88c","a4803090dd5bc992b44cefefe7b8f9a4023011b594d6194e8efe517de2b2f5e8","15be5bd580a13feacf1da73771a1325d35aea3c76baf8cf9d3bac422a03c86c8","f0923c98945e86e8516418c4a32275c1856d6a5a3dee23a840f38e95ea5dab8e","89b96b06bfbee597ca294e8286df549064529a31f51cc0962549613a43d47810","80ede86db6081ea65dde877fe0d214bd3157aaa9197d32476b69d42e15ca1002","a70fbb03fef0f10e07ea335a233a9745ce7363f2d8094284cc56d893399fdf64",{"version":"0597960a735f43f442b5237a9023777a279a9378715abb7fb84eb5e3c5149d63","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"6738101ae8e56cd3879ab3f99630ada7d78097fc9fd334df7e766216778ca219","57ddc4e066366bbe04f497f9afce1c88e088dbd09be0618e072754450de3acbb","6d829824ead8999f87b6df21200df3c6150391b894b4e80662caa462bd48d073","afc559c1b93df37c25aef6b3dfa2d64325b0e112e887ee18bf7e6f4ec383fc90","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","cab425b5559edac18327eb2c3c0f47e7e9f71b667290b7689faafd28aac69eae","3cfb0cb51cc2c2e1b313d7c4df04dbf7e5bda0a133c6b309bf6af77cf614b971","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","5343f3c160282dfbaab9af350119a0c3b59b7076ef0117bb5995a66e240dab28",{"version":"f4c0db3a49cea9babd5d224ba14243a6a6119bf65a65198994033aaea3a60a71","affectsGlobalScope":true},"204dbe6c72467fb14bbe8f06510b11fb541b6ce29580c6e10ebd3bdb2eb0c1f9","8d48b8f8a377ade8dd1f000625bc276eea067f2529cc9cafdf082d17142107d6","ce013414484233b24f42c0fcfca48a60bb66ab4e13c82953662305e8f1ee4925","16d51f964ec125ad2024cf03f0af444b3bc3ec3614d9345cc54d09bab45c9a4c","ba601641fac98c229ccd4a303f747de376d761babb33229bb7153bed9356c9cc",{"version":"ae3fe461989bbd951344efc1f1fe932360ce7392e6126bdb225a82a1bbaf15ee","affectsGlobalScope":true},"5b9ecf7da4d71cf3832dbb8336150fa924631811f488ad4690c2dfec2b4fb1d7","951c85f75aac041dddbedfedf565886a7b494e29ec1532e2a9b4a6180560b50e","f47887b61c6cf2f48746980390d6cb5b8013518951d912cfb37fe748071942be","15c88bfd1b8dc7231ff828ae8df5d955bae5ebca4cf2bcb417af5821e52299ae","eb96a2321f717bccc3e49e104e299152984b927ea4546b559ae631c06565819c","ed19da84b7dbf00952ad0b98ce5c194f1903bcf7c94d8103e8e0d63b271543ae","e98185f4249720ace1921d59c1ff4612fa5c633a183fc9bf28e2e7b8e3c7fd51","6168414aa12d33d0fcfac4f9870aa81ce27e136db6faf182001a5f3792e1d720","686e548ae30250d62532c8cacb43fccc922b693408371bd3503563c4a0f28eed","75bdc1b420f0ffc6cc6fd0b6694d89f5072bf755b4e6c7e65a2fda797ca0bb8a","f3e604694b624fa3f83f6684185452992088f5efb2cf136b62474aa106d6f1b6","13cc3979e1f548aacaa23911f2d6e69c1a2999266c4a1952806de1e9593bdaaa","bb4ed283cfb3db7ec1d4bb79c37f5e96d39b340f1f4de995c4b0b836c8d5fa05","5006668996956580886022c05108e32c742823e1b5652aff7914917233731518","3a9b877f47119ac64aab98c61cae91a304ddeb6e8285ccd824a6aa665ffaeb95","aff59cc6a1f2049bc6ac37cdd5a7d449584f28e7ee5ba240bd903aefdaef6418","77224b06a9d39e8710eca2050acadd9f9e062b068d74aa98e38a6854c272d35e","dcb9aa62f2662b999047096125adfa905cca0c988d7f5130e38ab41afeb96a3f","c757372a092924f5c16eaf11a1475b80b95bb4dae49fe3242d2ad908f97d5abe","017cfb3f6986b6b449fda402cce0f7da77820cb7000d5faf5a8b62587684031a","736097ddbb2903bef918bb3b5811ef1c9c5656f2a73bd39b22a91b9cc2525e50","3898e3dbe94b6fe529fbe8f0faee1309c1923100516d7a014b301955e52ece77","3663d1b50f356656a314e5df169bb51cb9d5fd75905fa703f75db6bb32030568","bb654d426b82e0846cd4bd7de91d637039ecdfd63c94447373490178f80846fe","db90f54098b237753ac9c846e39cd49aa538dcad07a2e1c68a138f3c0f8e621d","92ad68795c32309fb43576cacb38bd2677deeed38f5730dcd4a8c5e65463ae15","6e41751646fe275206d052a2e5ba87d27dd0df4dcbca134fc3fd2dc4d3d410d2","eecb2ea10a1500dcc6bdeff14be1fb43806f63a9b8562e16e1b4fc8baa8dfa8d","221a6ab66d611349faaf80af49c7a34d95623787610fd153fed4da0811abdcae","f3d84d6f83cf131e4db335dc8100898adbeb01dd4cf4e2fe695ab220eac98be4","6521aaade4e1d23cbc4b665083b004aeaca23f3347ba2422f88d1828968a0056","e79130cf2ba010f2b79747bf43b086252ad041b130768331a1144c0a86185877","e9709ed827c40789c669736fc78e2ab603605e8e81325d1e6d7a5eb451810dd0","dafce7a7b279977940b6b4b50017625e4f922f73094433d2875994bdc0b27e87","6fc76efbb61d3336833ef44ff3f37552667f26c2a73b368f3b4b259f19f2c234","479496e5bb48f2f5e981ef646665bc09fd9ab080e86e9ea882ca4369411604af","6c559dee3c6251c261b67df08e01d4cbc89cbd7a63300150c636705733cebfff","9b5a5e0d06f8646aa2978afb1b5bb5e608649751e9cfc7290e86be42605ba42f","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","f60e3e3060207ac982da13363181fd7ee4beecc19a7c569f0d6bb034331066c2","17230b34bb564a3a2e36f9d3985372ccab4ad1722df2c43f7c5c2b553f68e5db","87ed0f84f0691d5c724b23159db96342e6b04ac69201b02c65936f4281ce1fbe","13868c5792808236b17dfe2803eafce911ea4d09d3b2fda95391891a494f988f","0dfe35191a04e8f9dc7caeb9f52f2ee07402736563d12cbccd15fb5f31ac877f","fa5c2d3fcd8e227e180815df0a0903ed4b116400452af8a75ac5b68e5e1de9da","5f7614d60b32dc66e5d665eafd10d7619eedca3a20f0e876e9ec73141735e364","e91ad231af87f864b3f07cd0e39b1cf6c133988156f087c1c3ccb0a5491c9115","cc256fd958b33576ed32c7338c64adb0d08fc0c2c6525010202fab83f32745da","bf0b1297461549a0e32cd57dffb992c63d7c7134fe0f9e15d359abcc88dbd28c","f83b320cceccfc48457a818d18fc9a006ab18d0bdd727aa2c2e73dc1b4a45e98","354abbae08f72ea982b1a767a8908f1b3efe8bbe53955c64f9c0c249c8832d5d","8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6","31c502014e5ba046d5cb060136929b73fd53f0f989aa37b2b0424644cb0d93ef","76232dbb982272b182a76ad8745a9b02724dc9896e2328ce360e2c56c64c9778","fab58e600970e66547644a44bc9918e3223aa2cbd9e8763cec004b2cfb48827e","b4358a89fcd9c579f84a6c68e2ce44ca91b07e4db3f8f403c2b7a72c1a1e04b6"],"options":{"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"experimentalDecorators":true,"module":1,"noEmitOnError":true,"outDir":"./","sourceMap":true,"strict":true,"target":5},"fileIdsList":[[74,101,108],[101,108],[74,101,108,176],[71,74,100,101,108,178,179,180],[101],[101,133],[74,101,108,176,186,193],[71,74,101,108,187,188],[101,177,188,189,192],[72,101,108],[71,101,108],[101,204],[101,106,108,204],[71,74,75,79,85,100,101,108,174,184,186,194,196,197,203],[101,191],[101,190],[74,100,101,108,210,211],[56,101],[59,101],[60,65,101],[61,71,72,79,89,100,101],[61,62,71,79,101],[63,101],[64,65,72,80,101],[65,89,97,101],[66,68,71,79,101],[67,101],[68,69,101],[70,71,101],[71,101],[71,72,73,89,100,101],[71,72,73,89,92,101],[101,105],[74,79,89,100,101],[71,72,74,75,79,89,97,100,101],[74,76,89,97,100,101],[56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107],[71,77,101],[78,100,101],[68,71,79,89,101],[80,101],[81,101],[59,82,101],[83,99,101,105],[84,101],[85,101],[71,86,87,101],[86,88,101,103],[71,89,90,91,92,101],[89,91,101],[89,90,101],[92,101],[93,101],[71,95,96,101],[95,96,101],[65,79,89,97,101],[98,101],[79,99,101],[60,74,85,100,101],[65,101],[89,101,102],[101,103],[101,104],[60,65,71,73,82,89,100,101,103,105],[89,101,106],[101,108,214,216,220,221,222,223,224,225],[89,101,108],[71,101,108,214,216,217,219,226],[71,79,89,100,101,108,213,214,215,217,218,219,226],[89,101,108,216,217],[89,101,108,216,218],[101,108,214,216,217,219,226],[89,101,108,218],[71,79,89,97,101,108,215,217,219],[71,101,108,214,216,217,218,219,226],[71,89,101,108,214,215,216,217,218,219,226],[71,89,101,108,214,216,217,219,226],[74,89,101,108,219],[71,89,97,101,108,229,230,233,234],[72,74,76,79,89,100,101,108,182,236,237],[74,89,101,108],[74,101,108,191],[101,239],[60,72,74,89,101,108,185],[101,242],[71,74,76,89,97,100,101,106,108],[101,108,230,231,232],[89,101,108,230],[101,115],[101,115,127],[101,112,113,114,116,127],[101,118],[101,115,122,126,129],[101,117,129],[101,120,122,125,126,129],[101,120,122,123,125,126,129],[101,112,113,114,115,116,118,119,120,121,122,126,129],[101,111,112,113,114,115,116,118,119,120,121,122,123,125,126,127,128],[101,111,129],[101,122,123,124,126,129],[101,125,129],[101,115,121,126,129],[101,119,127],[101,111],[71,72,74,76,79,89,97,100,101,106,108,109,110,129],[72,101,105,130,131],[55,101,131],[55,72,101,105,130,131,132,133],[101,143],[101,154,155,156],[101,143,144,153,157,158,165,166,167,171],[101,151,152],[101,143,144],[101,145,146,147,148],[101,168,169,170],[101,143,159],[101,159,160,161,162,163,164],[101,134,143,149],[101,134,143,172],[101,135,136,137,138,139,140,141,142],[101,136,138],[101,135],[101,136],[101,138]],"referencedMap":[[174,1],[175,2],[177,3],[181,4],[182,5],[183,6],[133,5],[176,1],[184,5],[185,5],[194,7],[189,8],[193,9],[195,10],[196,5],[179,5],[197,5],[198,5],[199,5],[200,5],[201,5],[202,2],[186,5],[178,11],[205,12],[203,12],[206,13],[204,14],[207,12],[208,5],[190,15],[191,16],[209,5],[211,5],[212,17],[56,18],[57,18],[59,19],[60,20],[61,21],[62,22],[63,23],[64,24],[65,25],[66,26],[67,27],[68,28],[69,28],[70,29],[71,30],[72,31],[73,32],[58,33],[107,5],[74,34],[75,35],[76,36],[108,37],[77,38],[78,39],[79,40],[80,41],[81,42],[82,43],[83,44],[84,45],[85,46],[86,47],[87,47],[88,48],[89,49],[91,50],[90,51],[92,52],[93,53],[94,5],[95,54],[96,55],[97,56],[98,57],[99,58],[100,59],[101,60],[102,61],[103,62],[104,63],[105,64],[106,65],[226,66],[213,67],[220,68],[216,69],[214,70],[217,71],[221,72],[222,68],[219,73],[218,74],[223,75],[224,76],[225,77],[215,78],[227,5],[228,5],[234,79],[235,67],[188,5],[187,5],[238,80],[236,81],[180,81],[192,82],[240,83],[239,5],[242,84],[243,85],[237,5],[244,5],[245,86],[241,5],[109,5],[210,81],[233,87],[230,2],[232,88],[231,2],[229,5],[113,89],[112,90],[115,91],[119,92],[116,90],[121,93],[118,94],[123,95],[128,5],[124,96],[127,97],[129,98],[117,99],[125,100],[126,101],[122,102],[114,89],[120,103],[110,5],[111,104],[55,5],[11,5],[13,5],[12,5],[2,5],[14,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[3,5],[4,5],[25,5],[22,5],[23,5],[24,5],[26,5],[27,5],[28,5],[5,5],[29,5],[30,5],[31,5],[32,5],[6,5],[33,5],[34,5],[35,5],[36,5],[7,5],[37,5],[42,5],[43,5],[38,5],[39,5],[40,5],[41,5],[8,5],[47,5],[44,5],[45,5],[46,5],[48,5],[9,5],[49,5],[50,5],[51,5],[52,5],[53,5],[1,5],[10,5],[54,5],[130,105],[131,106],[132,107],[134,108],[154,109],[155,109],[157,110],[156,109],[158,109],[172,111],[152,5],[153,112],[151,109],[167,109],[166,109],[145,113],[146,113],[149,114],[147,113],[148,113],[168,5],[170,5],[171,115],[169,5],[160,116],[164,109],[161,116],[163,116],[162,116],[159,5],[165,117],[150,118],[173,119],[142,5],[143,120],[139,121],[136,122],[138,5],[137,123],[141,122],[140,124],[135,5],[144,5]],"exportedModulesMap":[[174,1],[175,2],[177,3],[181,4],[182,5],[183,6],[133,5],[176,1],[184,5],[185,5],[194,7],[189,8],[193,9],[195,10],[196,5],[179,5],[197,5],[198,5],[199,5],[200,5],[201,5],[202,2],[186,5],[178,11],[205,12],[203,12],[206,13],[204,14],[207,12],[208,5],[190,15],[191,16],[209,5],[211,5],[212,17],[56,18],[57,18],[59,19],[60,20],[61,21],[62,22],[63,23],[64,24],[65,25],[66,26],[67,27],[68,28],[69,28],[70,29],[71,30],[72,31],[73,32],[58,33],[107,5],[74,34],[75,35],[76,36],[108,37],[77,38],[78,39],[79,40],[80,41],[81,42],[82,43],[83,44],[84,45],[85,46],[86,47],[87,47],[88,48],[89,49],[91,50],[90,51],[92,52],[93,53],[94,5],[95,54],[96,55],[97,56],[98,57],[99,58],[100,59],[101,60],[102,61],[103,62],[104,63],[105,64],[106,65],[226,66],[213,67],[220,68],[216,69],[214,70],[217,71],[221,72],[222,68],[219,73],[218,74],[223,75],[224,76],[225,77],[215,78],[227,5],[228,5],[234,79],[235,67],[188,5],[187,5],[238,80],[236,81],[180,81],[192,82],[240,83],[239,5],[242,84],[243,85],[237,5],[244,5],[245,86],[241,5],[109,5],[210,81],[233,87],[230,2],[232,88],[231,2],[229,5],[113,89],[112,90],[115,91],[119,92],[116,90],[121,93],[118,94],[123,95],[128,5],[124,96],[127,97],[129,98],[117,99],[125,100],[126,101],[122,102],[114,89],[120,103],[110,5],[111,104],[55,5],[11,5],[13,5],[12,5],[2,5],[14,5],[15,5],[16,5],[17,5],[18,5],[19,5],[20,5],[21,5],[3,5],[4,5],[25,5],[22,5],[23,5],[24,5],[26,5],[27,5],[28,5],[5,5],[29,5],[30,5],[31,5],[32,5],[6,5],[33,5],[34,5],[35,5],[36,5],[7,5],[37,5],[42,5],[43,5],[38,5],[39,5],[40,5],[41,5],[8,5],[47,5],[44,5],[45,5],[46,5],[48,5],[9,5],[49,5],[50,5],[51,5],[52,5],[53,5],[1,5],[10,5],[54,5],[130,105],[131,106],[132,107],[134,108],[154,109],[155,109],[157,110],[156,109],[158,109],[172,111],[152,5],[153,112],[151,109],[167,109],[166,109],[145,113],[146,113],[149,114],[147,113],[148,113],[168,5],[170,5],[171,115],[169,5],[160,116],[164,109],[161,116],[163,116],[162,116],[159,5],[165,117],[142,5],[143,120],[139,121],[136,122],[138,5],[137,123],[141,122],[140,124],[135,5],[144,5]],"semanticDiagnosticsPerFile":[174,175,177,181,182,183,133,176,184,185,194,189,193,195,196,179,197,198,199,200,201,202,186,178,205,203,206,204,207,208,190,191,209,211,212,56,57,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,58,107,74,75,76,108,77,78,79,80,81,82,83,84,85,86,87,88,89,91,90,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,226,213,220,216,214,217,221,222,219,218,223,224,225,215,227,228,234,235,188,187,238,236,180,192,240,239,242,243,237,244,245,241,109,210,233,230,232,231,229,113,112,115,119,116,121,118,123,128,124,127,129,117,125,126,122,114,120,110,111,55,11,13,12,2,14,15,16,17,18,19,20,21,3,4,25,22,23,24,26,27,28,5,29,30,31,32,6,33,34,35,36,7,37,42,43,38,39,40,41,8,47,44,45,46,48,9,49,50,51,52,53,1,10,54,130,131,132,134,154,155,157,156,158,172,152,153,151,167,166,145,146,149,147,148,168,170,171,169,160,164,161,163,162,159,165,150,173,142,143,139,136,138,137,141,140,135,144],"latestChangedDtsFile":"./cases/unit/membershipResolver.test.d.ts"},"version":"4.8.2"}
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@contember/schema-utils",
3
- "version": "1.1.1",
3
+ "version": "1.2.0-alpha.10",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/src/index.js",
6
6
  "typings": "dist/src/index.d.ts",
7
7
  "scripts": {
8
- "test": "echo 'No tests'"
8
+ "test": "vitest"
9
9
  },
10
10
  "dependencies": {
11
- "@contember/schema": "^1.1.1",
12
- "@contember/typesafe": "^1.1.1"
11
+ "@contember/schema": "^1.2.0-alpha.10",
12
+ "@contember/typesafe": "^1.2.0-alpha.10"
13
13
  },
14
14
  "devDependencies": {
15
- "@types/node": "^17.0.5"
15
+ "@types/node": "^18"
16
16
  }
17
17
  }
@@ -61,6 +61,7 @@ class PredicateDefinitionProcessor {
61
61
  })
62
62
  if (
63
63
  typeof processedValue === 'object' &&
64
+ processedValue !== null &&
64
65
  'constructor' in processedValue &&
65
66
  processedValue.constructor.name === 'Object'
66
67
  ) {
@@ -2,20 +2,31 @@ import crypto from 'crypto'
2
2
 
3
3
  export class NamingHelper {
4
4
  public static createForeignKeyName(fromTable: string, fromColumn: string, toTable: string, toColumn: string): string {
5
- const uniqueSuffix = crypto
6
- .createHash('sha256')
7
- .update(JSON.stringify([fromTable, fromColumn, toTable, toColumn]), 'ascii')
8
- .digest('hex')
5
+ return 'fk_'
6
+ + fromTable + '_'
7
+ + fromColumn + '_'
8
+ + this.createUniqueSuffix([fromTable, fromColumn, toTable, toColumn])
9
+ }
9
10
 
10
- return 'fk_' + fromTable + '_' + fromColumn + '_' + uniqueSuffix.slice(0, 6)
11
+ public static createIndexName = (entityName: string, fields: readonly string[]): string => {
12
+ return 'idx_'
13
+ + entityName + '_'
14
+ + fields.join('_') + '_'
15
+ + this.createUniqueSuffix([entityName, ...fields])
11
16
  }
12
17
 
13
18
  public static createUniqueConstraintName = (entityName: string, fields: readonly string[]): string => {
19
+ return 'unique_'
20
+ + entityName + '_'
21
+ + fields.join('_') + '_'
22
+ + this.createUniqueSuffix([entityName, ...fields])
23
+ }
24
+
25
+ private static createUniqueSuffix = (values: string[]): string => {
14
26
  const uniqueSuffix = crypto
15
27
  .createHash('sha256')
16
- .update(JSON.stringify([entityName, ...fields]), 'ascii')
28
+ .update(JSON.stringify(values), 'ascii')
17
29
  .digest('hex')
18
-
19
- return 'unique_' + entityName + '_' + fields.join('_') + '_' + uniqueSuffix.slice(0, 6)
30
+ return uniqueSuffix.slice(0, 6)
20
31
  }
21
32
  }
@@ -18,6 +18,14 @@ export const normalizeSchema = <S extends Schema>(schema: S): S => {
18
18
  read: true,
19
19
  },
20
20
  },
21
+ content: {
22
+ export: true,
23
+ import: true,
24
+ },
25
+ system: {
26
+ export: true,
27
+ import: true,
28
+ },
21
29
  ...((schema.acl.roles?.[ProjectRole.ADMIN] as Acl.RolePermissions | undefined) || {}),
22
30
  },
23
31
  [ProjectRole.CONTENT_ADMIN]: {
@@ -30,11 +38,14 @@ export const normalizeSchema = <S extends Schema>(schema: S): S => {
30
38
  read: true,
31
39
  },
32
40
  },
41
+ content: {
42
+ export: true,
43
+ import: true,
44
+ },
33
45
  system: {
34
- diff: Acl.SystemPermissionsLevel.any,
35
- history: Acl.SystemPermissionsLevel.any,
36
- release: Acl.SystemPermissionsLevel.any,
37
- rebase: Acl.SystemPermissionsLevel.any,
46
+ history: true,
47
+ export: true,
48
+ import: true,
38
49
  },
39
50
  ...((schema.acl.roles?.[ProjectRole.CONTENT_ADMIN] as Acl.RolePermissions | undefined) || {}),
40
51
  },
@@ -1,18 +1,26 @@
1
1
  import { Acl, Model } from '@contember/schema'
2
2
  import * as Typesafe from '@contember/typesafe'
3
3
 
4
+ const membershipMatchRuleSchema = Typesafe.record(
5
+ Typesafe.string,
6
+ Typesafe.union(
7
+ Typesafe.literal(true),
8
+ Typesafe.partial({
9
+ variables: Typesafe.union(
10
+ Typesafe.literal(true),
11
+ Typesafe.record(
12
+ Typesafe.string,
13
+ Typesafe.union(Typesafe.literal(true), Typesafe.string),
14
+ ),
15
+ ),
16
+ }),
17
+ ),
18
+ )
19
+
4
20
  const tenantPermissionsSchema = Typesafe.partial({
5
21
  invite: Typesafe.boolean,
6
22
  unmanagedInvite: Typesafe.boolean,
7
- manage: Typesafe.record(Typesafe.string, Typesafe.partial({
8
- variables: Typesafe.union(
9
- Typesafe.literal(true),
10
- Typesafe.record(
11
- Typesafe.string,
12
- Typesafe.union(Typesafe.literal(true), Typesafe.string),
13
- ),
14
- ),
15
- })),
23
+ manage: membershipMatchRuleSchema,
16
24
  })
17
25
  const tenantSchemaCheck: Typesafe.Equals<Acl.TenantPermissions, ReturnType<typeof tenantPermissionsSchema>> = true
18
26
 
@@ -20,9 +28,18 @@ const systemPermissionsSchema = Typesafe.partial({
20
28
  history: Typesafe.union(Typesafe.boolean, Typesafe.enumeration('any', 'none')),
21
29
  migrate: Typesafe.boolean,
22
30
  assumeIdentity: Typesafe.boolean,
31
+ export: Typesafe.boolean,
32
+ import: Typesafe.boolean,
23
33
  })
24
34
  const systemSchemaCheck: Typesafe.Equals<Acl.SystemPermissions, ReturnType<typeof systemPermissionsSchema>> = true
25
35
 
36
+ const contentPermissionsSchema = Typesafe.partial({
37
+ assumeMembership: membershipMatchRuleSchema,
38
+ export: Typesafe.boolean,
39
+ import: Typesafe.boolean,
40
+ })
41
+ const contentSchemaCheck: Typesafe.Equals<Acl.ContentPermissions, ReturnType<typeof contentPermissionsSchema>> = true
42
+
26
43
  const variablesSchema = Typesafe.record(
27
44
  Typesafe.string,
28
45
  Typesafe.union(
@@ -34,6 +51,9 @@ const variablesSchema = Typesafe.record(
34
51
  type: Typesafe.literal(Acl.VariableType.predefined),
35
52
  value: Typesafe.enumeration('identityID', 'personID'),
36
53
  }),
54
+ Typesafe.object({
55
+ type: Typesafe.literal(Acl.VariableType.condition),
56
+ }),
37
57
  ),
38
58
  )
39
59
 
@@ -81,6 +101,7 @@ const baseRolePermissionsSchema = Typesafe.intersection(
81
101
  ),
82
102
  tenant: tenantPermissionsSchema,
83
103
  system: systemPermissionsSchema,
104
+ content: contentPermissionsSchema,
84
105
  }),
85
106
  )
86
107
  const baseRolePermissionsCheck: Typesafe.Equals<Acl.BaseRolePermissions, ReturnType<typeof baseRolePermissionsSchema>> = true
@@ -0,0 +1,81 @@
1
+ import * as Typesafe from '@contember/typesafe'
2
+ import { Json, Type } from '@contember/typesafe'
3
+ import { Input, Model, Value } from '@contember/schema'
4
+
5
+ export const conditionSchema = <T extends Value.FieldValue>(type?: Model.ColumnType): Type<Input.Condition<T>> => {
6
+ const metadata = type ? resolveColumnMetadata(type) : { type: Typesafe.scalar }
7
+ return conditionSchemaInner(metadata)
8
+ }
9
+
10
+ interface ResolvedColumnMetadata<T extends Json> {
11
+ type: Typesafe.Type<T>
12
+ isJson?: boolean
13
+ isString?: boolean
14
+ }
15
+
16
+ const conditionSchemaInner = <T extends Json>(metadata: ResolvedColumnMetadata<T>): Type<Input.Condition<T>> => {
17
+ return (input: unknown, path: PropertyKey[] = []): Input.Condition<T> => {
18
+ const self = conditionSchemaInner(metadata)
19
+ const inner = metadata.type
20
+ const objectSchema = Typesafe.noExtraProps(Typesafe.partial({
21
+ and: Typesafe.array(self),
22
+ or: Typesafe.array(self),
23
+ not: self,
24
+ null: Typesafe.boolean,
25
+ isNull: Typesafe.boolean,
26
+ never: Typesafe.true_,
27
+ always: Typesafe.true_,
28
+ ...(metadata.isJson !== true ? {
29
+ eq: inner,
30
+ notEq: inner,
31
+ in: Typesafe.array(inner),
32
+ notIn: Typesafe.array(inner),
33
+ lt: inner,
34
+ lte: inner,
35
+ gt: inner,
36
+ gte: inner,
37
+ } : {}),
38
+ ...(metadata.isString !== false ? {
39
+ contains: Typesafe.string,
40
+ startsWith: Typesafe.string,
41
+ endsWith: Typesafe.string,
42
+ containsCI: Typesafe.string,
43
+ startsWithCI: Typesafe.string,
44
+ endsWithCI: Typesafe.string,
45
+ } : {}),
46
+ }))
47
+ return objectSchema(input, path) as Input.Condition<T>
48
+ }
49
+ }
50
+
51
+ const resolveColumnMetadata = (type: Model.ColumnType): ResolvedColumnMetadata<any> => {
52
+ const resolvedType = Typesafe.nullable(resolveColumnTypeSchema(type))
53
+ return {
54
+ type: resolvedType,
55
+ isJson: type === Model.ColumnType.Json,
56
+ isString: type === Model.ColumnType.String,
57
+
58
+ }
59
+ }
60
+
61
+
62
+ const resolveColumnTypeSchema = (type: Model.ColumnType) => {
63
+ switch (type) {
64
+ case Model.ColumnType.Bool:
65
+ return Typesafe.boolean
66
+
67
+ // todo: validate format of string-like inputs uuid, date, enum
68
+ case Model.ColumnType.Date:
69
+ case Model.ColumnType.DateTime:
70
+ case Model.ColumnType.Uuid:
71
+ case Model.ColumnType.Enum:
72
+ case Model.ColumnType.String:
73
+ return Typesafe.string
74
+ case Model.ColumnType.Double:
75
+ return Typesafe.number
76
+ case Model.ColumnType.Int:
77
+ return Typesafe.integer
78
+ case Model.ColumnType.Json:
79
+ return Typesafe.anyJson
80
+ }
81
+ }
@@ -1,3 +1,4 @@
1
1
  export * from './acl'
2
+ export * from './condition'
2
3
  export * from './model'
3
4
  export * from './validation'
@@ -147,6 +147,12 @@ const viewSchemaInner = Typesafe.intersection(
147
147
  const viewSchemaCheck: Typesafe.Equals<Model.View, ReturnType<typeof viewSchemaInner>> = true
148
148
  const viewSchema: Typesafe.Type<Model.View> = viewSchemaInner
149
149
 
150
+
151
+ const indexesSchema = Typesafe.coalesce<Model.Indexes, Model.Indexes>(Typesafe.record(Typesafe.string, Typesafe.object({
152
+ fields: Typesafe.array(Typesafe.string),
153
+ name: Typesafe.string,
154
+ })), { })
155
+
150
156
  const entitySchema = Typesafe.intersection(
151
157
  Typesafe.object({
152
158
  name: Typesafe.string,
@@ -158,6 +164,7 @@ const entitySchema = Typesafe.intersection(
158
164
  fields: Typesafe.array(Typesafe.string),
159
165
  name: Typesafe.string,
160
166
  })),
167
+ indexes: indexesSchema,
161
168
  eventLog: eventLogSchema,
162
169
  }),
163
170
  Typesafe.partial({
@@ -2,6 +2,8 @@ import { Acl, Model } from '@contember/schema'
2
2
  import { PredicateDefinitionProcessor } from '../acl'
3
3
  import { getEntity } from '../model'
4
4
  import { ErrorBuilder, ValidationError } from './errors'
5
+ import { conditionSchema } from '../type-schema/condition'
6
+ import { anyJson } from '@contember/typesafe'
5
7
 
6
8
 
7
9
  export class AclValidator {
@@ -128,8 +130,16 @@ export class AclValidator {
128
130
  const processor = new PredicateDefinitionProcessor(this.model)
129
131
  processor.process(entity, predicate, {
130
132
  handleColumn: ctx => {
131
- if (typeof ctx.value === 'string' && !variables[ctx.value]) {
132
- errorBuilder.for(...ctx.path).add(`Undefined variable ${ctx.value}`)
133
+ if (typeof ctx.value === 'string') {
134
+ if (!variables[ctx.value]) {
135
+ errorBuilder.for(...ctx.path).add(`Undefined variable ${ctx.value}`)
136
+ }
137
+ } else {
138
+ try {
139
+ conditionSchema(ctx.column.type)(ctx.value)
140
+ } catch (e: any) {
141
+ errorBuilder.for(...ctx.path).add(`Invalid condition (${e.message}): ${JSON.stringify(ctx.value)}`)
142
+ }
133
143
  }
134
144
  return ctx.value
135
145
  },
@@ -0,0 +1,133 @@
1
+ import { Acl, Input } from '@contember/schema'
2
+ import { getRoleVariables } from '../acl'
3
+ import { conditionSchema } from '../type-schema'
4
+
5
+
6
+ export class MembershipResolver {
7
+ public static UnknownIdentity = { identityId: '00000000-0000-0000-0000-000000000000' }
8
+
9
+ resolve(
10
+ acl: Acl.Schema,
11
+ memberships: readonly Acl.Membership[],
12
+ identity: {
13
+ identityId: string
14
+ personId?: string
15
+ },
16
+ ): MembershipReadResult {
17
+ const errors: MembershipValidationError[] = []
18
+ const parsed: ParsedMembership[] = []
19
+ const roles = acl.roles
20
+ for (const membership of memberships) {
21
+ if (!roles[membership.role]) {
22
+ errors.push(new MembershipValidationError(membership.role, MembershipValidationErrorType.ROLE_NOT_FOUND))
23
+ continue
24
+ }
25
+ const roleVariables = getRoleVariables(membership.role, acl)
26
+ for (const variable of membership.variables) {
27
+ if (!roleVariables[variable.name] || roleVariables[variable.name].type === Acl.VariableType.predefined) {
28
+ errors.push(
29
+ new MembershipValidationError(
30
+ membership.role,
31
+ MembershipValidationErrorType.VARIABLE_NOT_FOUND,
32
+ variable.name,
33
+ ),
34
+ )
35
+ }
36
+ }
37
+ const [membershipErrors, parsedVariables] = this.readMembershipVariables(roleVariables, membership, identity)
38
+ errors.push(...membershipErrors)
39
+ parsed.push({
40
+ role: membership.role,
41
+ variables: parsedVariables,
42
+ })
43
+ }
44
+ return new MembershipReadResult(errors, parsed)
45
+ }
46
+
47
+ private readMembershipVariables(roleVariables: Acl.Variables, membership: Acl.Membership, identity: {
48
+ identityId: string
49
+ personId?: string
50
+ }): [MembershipValidationError[], ParsedMembershipVariable[]] {
51
+ const errors: MembershipValidationError[] = []
52
+ const parsedVariables: ParsedMembershipVariable[] = []
53
+ for (const [name, variable] of Object.entries(roleVariables)) {
54
+ const inputVariable = membership.variables.find(it => it.name === name)
55
+ if (variable.type === Acl.VariableType.predefined) {
56
+ switch (variable.value) {
57
+ case 'identityID':
58
+ parsedVariables.push({ name, condition: { in: [identity.identityId] } })
59
+ break
60
+ case 'personID':
61
+ parsedVariables.push({
62
+ name,
63
+ condition: { in: identity.personId ? [identity.personId] : [] },
64
+ })
65
+ break
66
+ default:
67
+ parsedVariables.push({ name, condition: { never: true } })
68
+ errors.push(new MembershipValidationError(membership.role, MembershipValidationErrorType.VARIABLE_INVALID, name))
69
+ break
70
+ }
71
+ continue
72
+ }
73
+
74
+ if (!inputVariable) {
75
+ errors.push(new MembershipValidationError(membership.role, MembershipValidationErrorType.VARIABLE_EMPTY, name))
76
+ parsedVariables.push({ name, condition: { never: true } })
77
+ continue
78
+ }
79
+
80
+ if (variable.type === Acl.VariableType.entity) {
81
+ parsedVariables.push({ name, condition: { in: inputVariable.values } }) // todo: cast to int where primary is int
82
+
83
+ } else if (variable.type === Acl.VariableType.condition) {
84
+ try {
85
+ const conditions = inputVariable.values.map(it => conditionSchema()(JSON.parse(it)))
86
+ parsedVariables.push({
87
+ name,
88
+ condition: conditions.length === 1 ? conditions[0] : { or: conditions },
89
+ })
90
+ } catch {
91
+ errors.push(new MembershipValidationError(membership.role, MembershipValidationErrorType.VARIABLE_INVALID, name))
92
+ parsedVariables.push({ name, condition: { never: true } })
93
+ }
94
+ }
95
+ }
96
+ return [errors, parsedVariables]
97
+ }
98
+ }
99
+
100
+ export class MembershipReadResult {
101
+ constructor(
102
+ public readonly errors: MembershipValidationError[],
103
+ public readonly memberships: ParsedMembership[],
104
+ ) {
105
+ }
106
+ }
107
+
108
+ export class MembershipValidationError {
109
+ constructor(
110
+ public readonly role: string,
111
+ public readonly error: MembershipValidationErrorType,
112
+ public readonly variable?: string,
113
+ ) {
114
+ }
115
+ }
116
+
117
+ export enum MembershipValidationErrorType {
118
+ ROLE_NOT_FOUND = 'roleNotFound',
119
+ VARIABLE_NOT_FOUND = 'variableNotFound',
120
+ VARIABLE_EMPTY = 'variableEmpty',
121
+ VARIABLE_INVALID = 'variableInvalid',
122
+ }
123
+
124
+
125
+ export interface ParsedMembershipVariable {
126
+ readonly name: string
127
+ readonly condition: Input.Condition
128
+ }
129
+
130
+ export interface ParsedMembership {
131
+ readonly role: string
132
+ readonly variables: readonly ParsedMembershipVariable[]
133
+ }
@@ -105,12 +105,21 @@ export class ModelValidator {
105
105
  })
106
106
  }
107
107
  if (partialEntity.view) {
108
+ if (field.type === Model.RelationType.ManyHasMany) {
109
+ return errors.add('Many-has-many relation is not allowed on a view entity.')
110
+ }
111
+ if (
112
+ !targetEntity.view &&
113
+ field.type === Model.RelationType.OneHasMany
114
+ ) {
115
+ return errors.add('One-has-many relation fields on views must point to a view entity.')
116
+ }
108
117
  if (
109
- field.type === Model.RelationType.ManyHasMany ||
110
- field.type === Model.RelationType.OneHasMany ||
111
- (field.type === Model.RelationType.OneHasOne && !('joiningColumn' in field))
118
+ !targetEntity.view &&
119
+ field.type === Model.RelationType.OneHasOne &&
120
+ !('joiningColumn' in field)
112
121
  ) {
113
- return errors.add('This relation type is not allowed on a view entity. Only one-has-one owning and many-has one are allowed.')
122
+ return errors.add('One-has-one relation fields on views must be owning or point to a view entity.')
114
123
  }
115
124
  }
116
125
  if (isInverseRelation(field)) {
@@ -3,3 +3,4 @@ export * from './ModelValidator'
3
3
  export * from './ValidationValidator'
4
4
  export * from './errors'
5
5
  export * from './SchemaValidator'
6
+ export * from './MembershipResolver'
@@ -0,0 +1,55 @@
1
+ import { assert, test, describe } from 'vitest'
2
+ import { conditionSchema } from '../../../src/type-schema'
3
+ import { Model } from '@contember/schema'
4
+
5
+ describe('condition schema', () => {
6
+ test('accept composite type', () => {
7
+ const condition = {
8
+ and: [{ isNull: true }, { not: { isNull: false } }],
9
+ }
10
+ assert.deepStrictEqual(conditionSchema()(condition), condition)
11
+ })
12
+
13
+ test('accept string-only condition for unknown type', () => {
14
+ const condition = {
15
+ containsCI: 'foo',
16
+ }
17
+ assert.deepStrictEqual(conditionSchema()(condition), condition)
18
+ })
19
+
20
+ test('accept string-only condition for string type', () => {
21
+ const condition = {
22
+ containsCI: 'foo',
23
+ }
24
+ assert.deepStrictEqual(conditionSchema(Model.ColumnType.String)(condition), condition)
25
+ })
26
+
27
+ test('reject string-only condition for int type', () => {
28
+ const condition = {
29
+ containsCI: 'foo',
30
+ }
31
+ assert.throw(() => conditionSchema(Model.ColumnType.Int)(condition), 'value at root: extra property containsCI found')
32
+ })
33
+
34
+
35
+ test('accept non-json condition for unknown type', () => {
36
+ const condition = {
37
+ eq: 'foo',
38
+ }
39
+ assert.deepStrictEqual(conditionSchema()(condition), condition)
40
+ })
41
+
42
+ test('accept non-json condition for string type', () => {
43
+ const condition = {
44
+ eq: 'foo',
45
+ }
46
+ assert.deepStrictEqual(conditionSchema(Model.ColumnType.String)(condition), condition)
47
+ })
48
+
49
+ test('reject non-json condition for json type', () => {
50
+ const condition = {
51
+ eq: 'foo',
52
+ }
53
+ assert.throw(() => conditionSchema(Model.ColumnType.Json)(condition), 'value at root: extra property eq found')
54
+ })
55
+ })