@things-factory/auth-base 6.0.0-alpha.0 → 6.0.0-alpha.12
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-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/router/oauth2/oauth2-server.js +1 -1
- package/dist-server/router/oauth2/oauth2-server.js.map +1 -1
- package/dist-server/service/application/application-mutation.d.ts +3 -0
- package/dist-server/service/application/application-query.js +1 -1
- package/dist-server/service/application/application-query.js.map +1 -1
- package/dist-server/service/application/application-types.d.ts +3 -1
- package/dist-server/service/application/application-types.js +8 -0
- package/dist-server/service/application/application-types.js.map +1 -1
- package/dist-server/service/application/application.d.ts +11 -2
- package/dist-server/service/application/application.js +32 -6
- package/dist-server/service/application/application.js.map +1 -1
- package/dist-server/service/domain-generator/domain-generator-mutation.js +4 -1
- package/dist-server/service/domain-generator/domain-generator-mutation.js.map +1 -1
- package/dist-server/service/granted-role/granted-role-mutation.js +3 -1
- package/dist-server/service/granted-role/granted-role-mutation.js.map +1 -1
- package/dist-server/service/granted-role/granted-role-query.js +1 -1
- package/dist-server/service/granted-role/granted-role-query.js.map +1 -1
- package/dist-server/service/partner/partner-query.js +2 -2
- package/dist-server/service/partner/partner-query.js.map +1 -1
- package/dist-server/service/privilege/privilege-mutation.js +3 -1
- package/dist-server/service/privilege/privilege-mutation.js.map +1 -1
- package/dist-server/service/role/role-mutation.js +2 -2
- package/dist-server/service/role/role-mutation.js.map +1 -1
- package/dist-server/service/user/user-mutation.js +14 -12
- package/dist-server/service/user/user-mutation.js.map +1 -1
- package/dist-server/service/user/user-query.js +15 -2
- package/dist-server/service/user/user-query.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/dist-server/utils/get-domain-users.js +1 -1
- package/dist-server/utils/get-domain-users.js.map +1 -1
- package/package.json +7 -7
- package/server/router/oauth2/oauth2-server.ts +1 -1
- package/server/service/application/application-query.ts +1 -1
- package/server/service/application/application-types.ts +9 -2
- package/server/service/application/application.ts +34 -7
- package/server/service/domain-generator/domain-generator-mutation.ts +4 -1
- package/server/service/granted-role/granted-role-mutation.ts +3 -1
- package/server/service/granted-role/granted-role-query.ts +1 -1
- package/server/service/partner/partner-query.ts +2 -2
- package/server/service/privilege/privilege-mutation.ts +3 -1
- package/server/service/role/role-mutation.ts +2 -2
- package/server/service/user/user-mutation.ts +14 -12
- package/server/service/user/user-query.ts +18 -3
- package/server/utils/get-domain-users.ts +1 -1
|
@@ -1 +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.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.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.esnext.intl.d.ts","../../../node_modules/tslib/tslib.d.ts","../client/auth.ts","../../../node_modules/redux/index.d.ts","../../../node_modules/pwa-helpers/lazy-reducer-enhancer.d.ts","../../../node_modules/@operato/shell/dist/src/store.d.ts","../../../node_modules/@operato/shell/dist/src/actions/app.d.ts","../../../node_modules/@operato/shell/dist/src/actions/route.d.ts","../../../node_modules/@operato/shell/dist/src/actions/index.d.ts","../../../node_modules/@lit/reactive-element/css-tag.d.ts","../../../node_modules/@lit/reactive-element/reactive-controller.d.ts","../../../node_modules/@lit/reactive-element/reactive-element.d.ts","../../../node_modules/@types/trusted-types/lib/index.d.ts","../../../node_modules/@types/trusted-types/index.d.ts","../../../node_modules/lit-html/directive.d.ts","../../../node_modules/lit-html/lit-html.d.ts","../../../node_modules/lit-element/lit-element.d.ts","../../../node_modules/lit/index.d.ts","../../../node_modules/@operato/shell/dist/src/app/pages/page-view.d.ts","../../../node_modules/@operato/shell/dist/src/index.d.ts","../../../node_modules/redux-thunk/es/types.d.ts","../../../node_modules/redux-thunk/es/index.d.ts","../client/actions/auth.ts","../client/reducers/auth.ts","../client/bootstrap.ts","../client/index.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/jest-diff/build/cleanupsemantic.d.ts","../../../node_modules/jest-diff/build/types.d.ts","../../../node_modules/jest-diff/build/difflines.d.ts","../../../node_modules/jest-diff/build/printdiffs.d.ts","../../../node_modules/jest-diff/build/index.d.ts","../../../node_modules/@types/jest/node_modules/pretty-format/build/types.d.ts","../../../node_modules/@types/jest/node_modules/pretty-format/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts"],"fileInfos":[{"version":"f5c28122bee592cfaf5c72ed7bcc47f453b79778ffa6e301f45d21a0970719d4","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"3f149f903dd20dfeb7c80e228b659f0e436532de772469980dbd00702cc05cc1","affectsGlobalScope":true},{"version":"1272277fe7daa738e555eb6cc45ded42cc2d0f76c07294142283145d49e96186","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","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":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","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":"cd483c056da900716879771893a3c9772b66c3c88f8943b4205aec738a94b1d0","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"c37f8a49593a0030eecb51bbfa270e709bec9d79a6cc3bb851ef348d4e6b26f8","affectsGlobalScope":true},"14a84fbe4ec531dcbaf5d2594fd95df107258e60ae6c6a076404f13c3f66f28e",{"version":"64a5230ae6777f94cc6bfb1091d5a6001957dcedca03877acda0505921f693b7","signature":"fedb19d1a7f4776e76af0da1d5f34d56cc1e092ee34afb6abd94acdf9da571b9"},{"version":"fd624f7d7b264922476685870f08c5e1c6d6a0f05dee2429a9747b41f6b699d4","affectsGlobalScope":true},"701978f3975f96e76e3ffc2e1762e3a97e3d323812049fb6fdfd559579b89708",{"version":"4ab17f80ced148d509345cee706b2b85941515dd76e32cf47118bcdf6a4bd56a","affectsGlobalScope":true},"641089f0b8094ef74b9d4b3364d5dec1592d5e3b8a51c1ba491bc8872049e79a","6d0c23f8c9efcd67b96bae7e7140cd9fdfeacc314c79220f48aaa5086585e31d","0dd5f5946c922d5bcf94d0b088bfed3f6a4dd3331e9fce9423d0adbb60c889c1","52dd370c807255c61765347fc90a9bee3c522b8744dc222714e2bf6b5be3a823","1e5743b25a63fd34ffbae89adcbf248ee17db6ed08d90079ffa93803c3e80d2a","13bb750b495c48fd60d7b5e09f65d4a7b010ab7e09a8943a6d54511e7d184f84","2fcd2d22b1f30555e785105597cd8f57ed50300e213c4f1bbca6ae149f782c38",{"version":"bb4248c7f953233ac52332088fac897d62b82be07244e551d87c5049600b6cf7","affectsGlobalScope":true},"3f30c6b57bf5eb7a7d4298506b78b18d428a39a409e1eadd93a3fdd0299d2687","19926529d718864dd255640a05f1b7b87fad1ac5791a4092ea00a83713b6a77b","eba7cf33380cc3a3cf614faf67300e14d0bdff9ea6c5cd6f4b040b1756a48ab1","f07a77a7fb1d49aa2b61cb68bf712a083487acd7130d20223a83de03af0c257d","6bf72b2541469cac7a7882468d25a04fdff489625452ff7d3e670c764e5a9ba1","5257b95e47714b754c367ce742ada7042aade5bf8c88bc7dd5a23194e3a50fb0","d50a158fc581be7b1c51253ad33cb29c0a8ce3c42ca38775ffadf104c36376d0","1f2cdbf59d0b7933678a64ac26ae2818c48ff9ebf93249dde775dc3e173e16bf",{"version":"d9ada24b70b5731f77ad997ad1bb671b80dcdff931e7c46171fef07ee0dad104","signature":"64b224909f444ceb75c3306e078b6cd5f484b1487ffe18e13f150c9d2689dcd8"},{"version":"d3a72e3acec55990c739ec2c7ec487ace738418d0650356c2db86b67a3d1b818","signature":"6a716b8d3a52002354a3e530ee6c90d52209af1f53eaefb9c4527228bf0a6f67"},{"version":"8d55dba17babd73716321b2ed065017dcbe6c84fc21aa0cab4e3cc48fbdc526e","signature":"aac4ddff3d5c1247433870879e9838b1e23b81a9b62c75f59c3e1b64802f2b16"},{"version":"f528a2210943d5d3f1f4a154387da39afab55e9e91ca68f6fb4e3ef8a43a9823","signature":"0d1e9013237428428f2c4b8c4c64e3b5fce66d8140bc75629c0cc320c85c4925"},"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","3c135ff5bda0355f6b52a10ea931736ec7c5a80b7fb8772019054e0eaa0fd6b6","1abb206a4ecd13b21536b677d7d5f66e0d7316f0d44610197cfcc5776f78884a","dbe5aa5a5dd8bd1c6a8d11b1310c3f0cdabaacc78a37b394a8c7b14faeb5fb84","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","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","69da61a7b5093dac77fa3bec8be95dcf9a74c95a0e9161edb98bb24e30e439d2","561eca7a381b96d6ccac6e4061e6d2ae53f5bc44203f3fd9f5b26864c32ae6e9","62ea38627e3ebab429f7616812a9394d327c2bc271003dfba985de9b4137369f","b4439890c168d646357928431100daac5cbdee1d345a34e6bf6eca9f3abe22bc","5d72971a459517c44c1379dab9ed248e87a61ba0a1e0f25c9d67e1e640cd9a09","02d734976af36f4273d930bea88b3e62adf6b078cf120c1c63d49aa8d8427c5c",{"version":"516a426e3960379f310107635b8f3a7e8c307c6c665080b128039d9299ec4087","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"importHelpers":true,"inlineSources":true,"module":99,"noEmitOnError":true,"noImplicitAny":false,"outDir":"./","sourceMap":true,"strict":true,"target":4,"useDefineForClassFields":false},"fileIdsList":[[113],[51,52,113],[48,49,113],[59,113],[47,50,60,113],[45,46,113],[113,125,127],[113,126],[68,113],[71,113],[72,77,113],[73,83,84,91,101,112,113],[73,74,83,91,113],[75,113],[76,77,84,92,113],[77,101,109,113],[78,80,83,91,113],[79,113],[80,81,113],[82,83,113],[83,113],[83,84,85,101,112,113],[83,84,85,101,104,113],[113,117],[86,91,101,112,113],[83,84,86,87,91,101,109,112,113],[86,88,101,109,112,113],[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,108,109,110,111,112,113,114,115,116,117,118,119],[83,89,113],[90,112,113],[80,83,91,101,113],[92,113],[93,113],[71,94,113],[95,111,113,117],[96,113],[97,113],[83,98,99,113],[98,100,113,115],[83,101,102,103,104,113],[101,103,113],[101,102,113],[104,113],[105,113],[83,107,108,113],[107,108,113],[77,91,101,109,113],[110,113],[91,111,113],[72,86,97,112,113],[77,113],[101,113,114],[113,115],[113,116],[72,77,83,85,94,101,112,113,115,117],[101,113,118],[54,113],[113,121,122],[113,121,122,123,124],[53,57,113],[57,113],[55,56,113],[53,57,58,113],[45,113],[45,62,113],[43,45,63,113],[43,113],[43,44,61,64,65,113],[43,44,113],[43,64,113],[45,63],[44]],"referencedMap":[[51,1],[52,1],[53,2],[48,1],[50,3],[49,1],[60,4],[61,5],[47,6],[128,7],[127,8],[126,1],[68,9],[69,9],[71,10],[72,11],[73,12],[74,13],[75,14],[76,15],[77,16],[78,17],[79,18],[80,19],[81,19],[82,20],[83,21],[84,22],[85,23],[70,24],[119,1],[86,25],[87,26],[88,27],[120,28],[89,29],[90,30],[91,31],[92,32],[93,33],[94,34],[95,35],[96,36],[97,37],[98,38],[99,38],[100,39],[101,40],[103,41],[102,42],[104,43],[105,44],[106,1],[107,45],[108,46],[109,47],[110,48],[111,49],[112,50],[113,51],[114,52],[115,53],[116,54],[117,55],[118,56],[55,57],[54,1],[121,1],[123,58],[125,59],[124,58],[122,1],[58,60],[56,61],[57,62],[59,63],[46,64],[63,65],[62,64],[45,1],[43,1],[8,1],[9,1],[11,1],[10,1],[2,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[3,1],[4,1],[23,1],[20,1],[21,1],[22,1],[24,1],[25,1],[26,1],[5,1],[27,1],[28,1],[29,1],[30,1],[6,1],[31,1],[32,1],[33,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[42,1],[64,66],[44,67],[66,68],[67,69],[65,70]],"exportedModulesMap":[[51,1],[52,1],[53,2],[48,1],[50,3],[49,1],[60,4],[61,5],[47,6],[128,7],[127,8],[126,1],[68,9],[69,9],[71,10],[72,11],[73,12],[74,13],[75,14],[76,15],[77,16],[78,17],[79,18],[80,19],[81,19],[82,20],[83,21],[84,22],[85,23],[70,24],[119,1],[86,25],[87,26],[88,27],[120,28],[89,29],[90,30],[91,31],[92,32],[93,33],[94,34],[95,35],[96,36],[97,37],[98,38],[99,38],[100,39],[101,40],[103,41],[102,42],[104,43],[105,44],[106,1],[107,45],[108,46],[109,47],[110,48],[111,49],[112,50],[113,51],[114,52],[115,53],[116,54],[117,55],[118,56],[55,57],[54,1],[121,1],[123,58],[125,59],[124,58],[122,1],[58,60],[56,61],[57,62],[59,63],[46,64],[63,65],[62,64],[45,1],[43,1],[8,1],[9,1],[11,1],[10,1],[2,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[3,1],[4,1],[23,1],[20,1],[21,1],[22,1],[24,1],[25,1],[26,1],[5,1],[27,1],[28,1],[29,1],[30,1],[6,1],[31,1],[32,1],[33,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[42,1],[64,71],[67,72]],"semanticDiagnosticsPerFile":[51,52,53,48,50,49,60,61,47,128,127,126,68,69,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,70,119,86,87,88,120,89,90,91,92,93,94,95,96,97,98,99,100,101,103,102,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,55,54,121,123,125,124,122,58,56,57,59,46,63,62,45,43,8,9,11,10,2,12,13,14,15,16,17,18,19,3,4,23,20,21,22,24,25,26,5,27,28,29,30,6,31,32,33,34,7,35,40,41,36,37,38,39,1,42,64,44,66,67,65]},"version":"4.7.4"}
|
|
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.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.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.esnext.intl.d.ts","../../../node_modules/tslib/tslib.d.ts","../client/auth.ts","../../../node_modules/redux/index.d.ts","../../../node_modules/pwa-helpers/lazy-reducer-enhancer.d.ts","../../../node_modules/@operato/shell/dist/src/store.d.ts","../../../node_modules/@operato/shell/dist/src/actions/app.d.ts","../../../node_modules/@operato/shell/dist/src/actions/route.d.ts","../../../node_modules/@operato/shell/dist/src/actions/const.d.ts","../../../node_modules/@operato/shell/dist/src/actions/index.d.ts","../../../node_modules/@lit/reactive-element/css-tag.d.ts","../../../node_modules/@lit/reactive-element/reactive-controller.d.ts","../../../node_modules/@lit/reactive-element/reactive-element.d.ts","../../../node_modules/@types/trusted-types/lib/index.d.ts","../../../node_modules/@types/trusted-types/index.d.ts","../../../node_modules/lit-html/directive.d.ts","../../../node_modules/lit-html/lit-html.d.ts","../../../node_modules/lit-element/lit-element.d.ts","../../../node_modules/lit-html/is-server.d.ts","../../../node_modules/lit/index.d.ts","../../../node_modules/@operato/shell/dist/src/app/pages/page-view.d.ts","../../../node_modules/@operato/shell/dist/src/index.d.ts","../../../node_modules/redux-thunk/es/types.d.ts","../../../node_modules/redux-thunk/es/index.d.ts","../client/actions/auth.ts","../client/reducers/auth.ts","../client/bootstrap.ts","../client/index.ts","../../../node_modules/@types/node/ts4.8/assert.d.ts","../../../node_modules/@types/node/ts4.8/assert/strict.d.ts","../../../node_modules/@types/node/ts4.8/globals.d.ts","../../../node_modules/@types/node/ts4.8/async_hooks.d.ts","../../../node_modules/@types/node/ts4.8/buffer.d.ts","../../../node_modules/@types/node/ts4.8/child_process.d.ts","../../../node_modules/@types/node/ts4.8/cluster.d.ts","../../../node_modules/@types/node/ts4.8/console.d.ts","../../../node_modules/@types/node/ts4.8/constants.d.ts","../../../node_modules/@types/node/ts4.8/crypto.d.ts","../../../node_modules/@types/node/ts4.8/dgram.d.ts","../../../node_modules/@types/node/ts4.8/diagnostics_channel.d.ts","../../../node_modules/@types/node/ts4.8/dns.d.ts","../../../node_modules/@types/node/ts4.8/dns/promises.d.ts","../../../node_modules/@types/node/ts4.8/domain.d.ts","../../../node_modules/@types/node/ts4.8/dom-events.d.ts","../../../node_modules/@types/node/ts4.8/events.d.ts","../../../node_modules/@types/node/ts4.8/fs.d.ts","../../../node_modules/@types/node/ts4.8/fs/promises.d.ts","../../../node_modules/@types/node/ts4.8/http.d.ts","../../../node_modules/@types/node/ts4.8/http2.d.ts","../../../node_modules/@types/node/ts4.8/https.d.ts","../../../node_modules/@types/node/ts4.8/inspector.d.ts","../../../node_modules/@types/node/ts4.8/module.d.ts","../../../node_modules/@types/node/ts4.8/net.d.ts","../../../node_modules/@types/node/ts4.8/os.d.ts","../../../node_modules/@types/node/ts4.8/path.d.ts","../../../node_modules/@types/node/ts4.8/perf_hooks.d.ts","../../../node_modules/@types/node/ts4.8/process.d.ts","../../../node_modules/@types/node/ts4.8/punycode.d.ts","../../../node_modules/@types/node/ts4.8/querystring.d.ts","../../../node_modules/@types/node/ts4.8/readline.d.ts","../../../node_modules/@types/node/ts4.8/readline/promises.d.ts","../../../node_modules/@types/node/ts4.8/repl.d.ts","../../../node_modules/@types/node/ts4.8/stream.d.ts","../../../node_modules/@types/node/ts4.8/stream/promises.d.ts","../../../node_modules/@types/node/ts4.8/stream/consumers.d.ts","../../../node_modules/@types/node/ts4.8/stream/web.d.ts","../../../node_modules/@types/node/ts4.8/string_decoder.d.ts","../../../node_modules/@types/node/ts4.8/test.d.ts","../../../node_modules/@types/node/ts4.8/timers.d.ts","../../../node_modules/@types/node/ts4.8/timers/promises.d.ts","../../../node_modules/@types/node/ts4.8/tls.d.ts","../../../node_modules/@types/node/ts4.8/trace_events.d.ts","../../../node_modules/@types/node/ts4.8/tty.d.ts","../../../node_modules/@types/node/ts4.8/url.d.ts","../../../node_modules/@types/node/ts4.8/util.d.ts","../../../node_modules/@types/node/ts4.8/v8.d.ts","../../../node_modules/@types/node/ts4.8/vm.d.ts","../../../node_modules/@types/node/ts4.8/wasi.d.ts","../../../node_modules/@types/node/ts4.8/worker_threads.d.ts","../../../node_modules/@types/node/ts4.8/zlib.d.ts","../../../node_modules/@types/node/ts4.8/globals.global.d.ts","../../../node_modules/@types/node/ts4.8/index.d.ts","../../../node_modules/jest-diff/build/cleanupsemantic.d.ts","../../../node_modules/jest-diff/build/types.d.ts","../../../node_modules/jest-diff/build/difflines.d.ts","../../../node_modules/jest-diff/build/printdiffs.d.ts","../../../node_modules/jest-diff/build/index.d.ts","../../../node_modules/@types/jest/node_modules/pretty-format/build/types.d.ts","../../../node_modules/@types/jest/node_modules/pretty-format/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts"],"fileInfos":[{"version":"f5c28122bee592cfaf5c72ed7bcc47f453b79778ffa6e301f45d21a0970719d4","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"3f149f903dd20dfeb7c80e228b659f0e436532de772469980dbd00702cc05cc1","affectsGlobalScope":true},{"version":"1272277fe7daa738e555eb6cc45ded42cc2d0f76c07294142283145d49e96186","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","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":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","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":"cd483c056da900716879771893a3c9772b66c3c88f8943b4205aec738a94b1d0","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"c37f8a49593a0030eecb51bbfa270e709bec9d79a6cc3bb851ef348d4e6b26f8","affectsGlobalScope":true},"14a84fbe4ec531dcbaf5d2594fd95df107258e60ae6c6a076404f13c3f66f28e",{"version":"64a5230ae6777f94cc6bfb1091d5a6001957dcedca03877acda0505921f693b7","signature":"fedb19d1a7f4776e76af0da1d5f34d56cc1e092ee34afb6abd94acdf9da571b9"},{"version":"fd624f7d7b264922476685870f08c5e1c6d6a0f05dee2429a9747b41f6b699d4","affectsGlobalScope":true},"701978f3975f96e76e3ffc2e1762e3a97e3d323812049fb6fdfd559579b89708",{"version":"4ab17f80ced148d509345cee706b2b85941515dd76e32cf47118bcdf6a4bd56a","affectsGlobalScope":true},"641089f0b8094ef74b9d4b3364d5dec1592d5e3b8a51c1ba491bc8872049e79a","9197b3ca76c01df6120b4ee288fe2d08f8a2089221da97956bee402de0ffd37e","7af29b0589483f7bb8a99405ddb849f34bc053146184561ed4179e02f5fe4d0f","d8afb84d78023735e55f1b96e06b3e221eb7ce5473ca1c93564d30e7efb0f991","52dd370c807255c61765347fc90a9bee3c522b8744dc222714e2bf6b5be3a823","1e5743b25a63fd34ffbae89adcbf248ee17db6ed08d90079ffa93803c3e80d2a","13bb750b495c48fd60d7b5e09f65d4a7b010ab7e09a8943a6d54511e7d184f84","2fcd2d22b1f30555e785105597cd8f57ed50300e213c4f1bbca6ae149f782c38",{"version":"bb4248c7f953233ac52332088fac897d62b82be07244e551d87c5049600b6cf7","affectsGlobalScope":true},"3f30c6b57bf5eb7a7d4298506b78b18d428a39a409e1eadd93a3fdd0299d2687","62da965db3bd1b4ce135048ae8a317d7eb1949068824cb949dd4a91f7e3d6c2d","eba7cf33380cc3a3cf614faf67300e14d0bdff9ea6c5cd6f4b040b1756a48ab1","5e7e090243bf203382a5cb04eabbdc38d78f6d5922f16f543e4da8fa007d5ff9","cd823094ded7c8ac4f94ab6dc387dab699293eb8323d9f948304efc07e4ae7b2","6bf72b2541469cac7a7882468d25a04fdff489625452ff7d3e670c764e5a9ba1","5257b95e47714b754c367ce742ada7042aade5bf8c88bc7dd5a23194e3a50fb0","d50a158fc581be7b1c51253ad33cb29c0a8ce3c42ca38775ffadf104c36376d0","1f2cdbf59d0b7933678a64ac26ae2818c48ff9ebf93249dde775dc3e173e16bf",{"version":"d9ada24b70b5731f77ad997ad1bb671b80dcdff931e7c46171fef07ee0dad104","signature":"64b224909f444ceb75c3306e078b6cd5f484b1487ffe18e13f150c9d2689dcd8"},{"version":"d3a72e3acec55990c739ec2c7ec487ace738418d0650356c2db86b67a3d1b818","signature":"6a716b8d3a52002354a3e530ee6c90d52209af1f53eaefb9c4527228bf0a6f67"},{"version":"8d55dba17babd73716321b2ed065017dcbe6c84fc21aa0cab4e3cc48fbdc526e","signature":"aac4ddff3d5c1247433870879e9838b1e23b81a9b62c75f59c3e1b64802f2b16"},{"version":"f528a2210943d5d3f1f4a154387da39afab55e9e91ca68f6fb4e3ef8a43a9823","signature":"0d1e9013237428428f2c4b8c4c64e3b5fce66d8140bc75629c0cc320c85c4925"},"7e771891adaa85b690266bc37bd6eb43bc57eecc4b54693ead36467e7369952a","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"02873d070f9cb79f50833fbf4a9a27ac578a2edf8ddb8421eba1b37faba83bfb","affectsGlobalScope":true},"21a167fec8f933752fb8157f06d28fab6817af3ad9b0bdb1908a10762391eab9",{"version":"c0db280fa6b09d7b8d6720a19a47f485956a41ee0e6914f1b704033eb69c6058","affectsGlobalScope":true},"0c0cee62cb619aed81133b904f644515ba3064487002a7da83fd8aa07b1b4abd","5a94487653355b56018122d92392beb2e5f4a6c63ba5cef83bbe1c99775ef713",{"version":"d5135ad93b33adcce80b18f8065087934cdc1730d63db58562edcf017e1aad9b","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","dd1d8b922bd0874a7715e43015ebfe4ce1eb55fbe405a6d97b7c9756dc608813","bb9c4ffa5e6290c6980b63c815cdd1625876dadb2efaf77edbe82984be93e55e","75ecef44f126e2ae018b4abbd85b6e8a2e2ba1638ebec56cc64274643ce3567b","f30bb836526d930a74593f7b0f5c1c46d10856415a8f69e5e2fc3db80371e362","14b5aa23c5d0ae1907bc696ac7b6915d88f7d85799cc0dc2dcf98fbce2c5a67c","5c439dafdc09abe4d6c260a96b822fa0ba5be7203c71a63ab1f1423cd9e838ea",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"816ad2e607a96de5bcac7d437f843f5afd8957f1fa5eefa6bba8e4ed7ca8fd84","affectsGlobalScope":true},"cec36af22f514322f870e81d30675c78df82ae8bf4863f5fd4e4424c040c678d","d903fafe96674bc0b2ac38a5be4a8fc07b14c2548d1cdb165a80ea24c44c0c54","b01a80007e448d035a16c74b5c95a5405b2e81b12fabcf18b75aa9eb9ef28990","04eb6578a588d6a46f50299b55f30e3a04ef27d0c5a46c57d8fcc211cd530faa","dbe5aa5a5dd8bd1c6a8d11b1310c3f0cdabaacc78a37b394a8c7b14faeb5fb84","2c828a5405191d006115ab34e191b8474bc6c86ffdc401d1a9864b1b6e088a58",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"d4ac44f01d42f541631c5fc88d0ed8efac29a3a3ad9a745d9fd58f8b61ed132e","7c013aa892414a7fdcfd861ae524a668eaa3ede8c7c0acafaf611948122c8d93","b0973c3cbcdc59b37bf477731d468696ecaf442593ec51bab497a613a580fe30",{"version":"4989e92ba5b69b182d2caaea6295af52b7dc73a4f7a2e336a676722884e7139d","affectsGlobalScope":true},{"version":"b3624aed92dab6da8484280d3cb3e2f4130ec3f4ef3f8201c95144ae9e898bb6","affectsGlobalScope":true},"5153a2fd150e46ce57bb3f8db1318d33f6ad3261ed70ceeff92281c0608c74a3","210d54cd652ec0fec8c8916e4af59bb341065576ecda039842f9ffb2e908507c","36b03690b628eab08703d63f04eaa89c5df202e5f1edf3989f13ad389cd2c091","0effadd232a20498b11308058e334d3339cc5bf8c4c858393e38d9d4c0013dcf","25846d43937c672bab7e8195f3d881f93495df712ee901860effc109918938cc","3163f47436da41706c6e2b3c1511f3b7cce9f9f3905b2f3e01246c48b4ba7d14","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","69ee23dd0d215b09907ad30d23f88b7790c93329d1faf31d7835552a10cf7cbf","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","23b89798789dffbd437c0c423f5d02d11f9736aea73d6abf16db4f812ff36eda","24ad30a03d6c9266b63540956868dd70fa2dc523d60d780d6586eb0c281946bc",{"version":"970a90f76d4d219ad60819d61f5994514087ba94c985647a3474a5a3d12714ed","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","4c8525f256873c7ba3135338c647eaf0ca7115a1a2805ae2d0056629461186ce","3c13ef48634e7b5012fcf7e8fce7496352c2d779a7201389ca96a2a81ee4314d","5d0a25ec910fa36595f85a67ac992d7a53dd4064a1ba6aea1c9f14ab73a023f2",{"version":"f0900cd5d00fe1263ff41201fb8073dbeb984397e4af3b8002a5c207a30bdc33","affectsGlobalScope":true},{"version":"f7db71191aa7aac5d6bc927ed6e7075c2763d22c7238227ec0c63c8cf5cb6a8b","affectsGlobalScope":true},"06d7c42d256f0ce6afe1b2b6cfbc97ab391f29dadb00dd0ae8e8f23f5bc916c3","ec4bd1b200670fb567920db572d6701ed42a9641d09c4ff6869768c8f81b404c","e59a892d87e72733e2a9ca21611b9beb52977be2696c7ba4b216cbbb9a48f5aa",{"version":"da26af7362f53d122283bc69fed862b9a9fe27e01bc6a69d1d682e0e5a4df3e6","affectsGlobalScope":true},"8a300fa9b698845a1f9c41ecbe2c5966634582a8e2020d51abcace9b55aa959e",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"652ee9c5103e89102d87bc20d167a02a0e3e5e53665674466c8cfea8a9e418c7","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","69da61a7b5093dac77fa3bec8be95dcf9a74c95a0e9161edb98bb24e30e439d2","561eca7a381b96d6ccac6e4061e6d2ae53f5bc44203f3fd9f5b26864c32ae6e9","62ea38627e3ebab429f7616812a9394d327c2bc271003dfba985de9b4137369f","b4439890c168d646357928431100daac5cbdee1d345a34e6bf6eca9f3abe22bc","5d72971a459517c44c1379dab9ed248e87a61ba0a1e0f25c9d67e1e640cd9a09","02d734976af36f4273d930bea88b3e62adf6b078cf120c1c63d49aa8d8427c5c",{"version":"516a426e3960379f310107635b8f3a7e8c307c6c665080b128039d9299ec4087","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"importHelpers":true,"inlineSources":true,"module":99,"noEmitOnError":true,"noImplicitAny":false,"outDir":"./","sourceMap":true,"strict":true,"target":4,"useDefineForClassFields":false},"fileIdsList":[[116],[52,53,116],[48,49,50,116],[61,116],[47,51,62,116],[45,46,116],[116,128,130],[116,129],[70,116],[73,116],[74,79,107,116],[75,86,87,94,104,115,116],[75,76,86,94,116],[77,116],[78,79,87,95,116],[79,104,112,116],[80,82,86,94,116],[81,116],[82,83,116],[86,116],[84,86,116],[86,87,88,104,115,116],[86,87,88,101,104,107,116],[116,120],[89,94,104,115,116],[86,87,89,90,94,104,112,115,116],[89,91,104,112,115,116],[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,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122],[86,92,116],[93,115,116],[82,86,94,104,116],[95,116],[96,116],[73,97,116],[98,114,116,120],[99,116],[100,116],[86,101,102,116],[101,103,116,118],[74,86,104,105,106,107,116],[74,104,106,116],[104,105,116],[107,116],[108,116],[86,110,111,116],[110,111,116],[79,94,104,112,116],[113,116],[94,114,116],[74,89,100,115,116],[79,116],[104,116,117],[116,118],[116,119],[74,79,86,88,97,104,115,116,118,120],[104,116,121],[55,116],[116,124,125],[116,124,125,126,127],[54,58,116],[58,116],[56,57,116],[54,58,59,60,116],[45,116],[45,64,116],[43,45,65,116],[43,116],[43,44,63,66,67,116],[43,44,116],[43,66,116],[45,65],[44]],"referencedMap":[[52,1],[53,1],[54,2],[48,1],[50,1],[51,3],[49,1],[62,4],[63,5],[47,6],[131,7],[130,8],[129,1],[70,9],[71,9],[73,10],[74,11],[75,12],[76,13],[77,14],[78,15],[79,16],[80,17],[81,18],[82,19],[83,19],[85,20],[84,21],[86,20],[87,22],[88,23],[72,24],[122,1],[89,25],[90,26],[91,27],[123,28],[92,29],[93,30],[94,31],[95,32],[96,33],[97,34],[98,35],[99,36],[100,37],[101,38],[102,38],[103,39],[104,40],[106,41],[105,42],[107,43],[108,44],[109,1],[110,45],[111,46],[112,47],[113,48],[114,49],[115,50],[116,51],[117,52],[118,53],[119,54],[120,55],[121,56],[56,57],[55,1],[124,1],[126,58],[128,59],[127,58],[125,1],[59,60],[57,61],[60,1],[58,62],[61,63],[46,64],[65,65],[64,64],[45,1],[43,1],[8,1],[9,1],[11,1],[10,1],[2,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[3,1],[4,1],[23,1],[20,1],[21,1],[22,1],[24,1],[25,1],[26,1],[5,1],[27,1],[28,1],[29,1],[30,1],[6,1],[31,1],[32,1],[33,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[42,1],[66,66],[44,67],[68,68],[69,69],[67,70]],"exportedModulesMap":[[52,1],[53,1],[54,2],[48,1],[50,1],[51,3],[49,1],[62,4],[63,5],[47,6],[131,7],[130,8],[129,1],[70,9],[71,9],[73,10],[74,11],[75,12],[76,13],[77,14],[78,15],[79,16],[80,17],[81,18],[82,19],[83,19],[85,20],[84,21],[86,20],[87,22],[88,23],[72,24],[122,1],[89,25],[90,26],[91,27],[123,28],[92,29],[93,30],[94,31],[95,32],[96,33],[97,34],[98,35],[99,36],[100,37],[101,38],[102,38],[103,39],[104,40],[106,41],[105,42],[107,43],[108,44],[109,1],[110,45],[111,46],[112,47],[113,48],[114,49],[115,50],[116,51],[117,52],[118,53],[119,54],[120,55],[121,56],[56,57],[55,1],[124,1],[126,58],[128,59],[127,58],[125,1],[59,60],[57,61],[60,1],[58,62],[61,63],[46,64],[65,65],[64,64],[45,1],[43,1],[8,1],[9,1],[11,1],[10,1],[2,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[3,1],[4,1],[23,1],[20,1],[21,1],[22,1],[24,1],[25,1],[26,1],[5,1],[27,1],[28,1],[29,1],[30,1],[6,1],[31,1],[32,1],[33,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[42,1],[66,71],[69,72]],"semanticDiagnosticsPerFile":[52,53,54,48,50,51,49,62,63,47,131,130,129,70,71,73,74,75,76,77,78,79,80,81,82,83,85,84,86,87,88,72,122,89,90,91,123,92,93,94,95,96,97,98,99,100,101,102,103,104,106,105,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,56,55,124,126,128,127,125,59,57,60,58,61,46,65,64,45,43,8,9,11,10,2,12,13,14,15,16,17,18,19,3,4,23,20,21,22,24,25,26,5,27,28,29,30,6,31,32,33,34,7,35,40,41,36,37,38,39,1,42,66,44,68,69,67]},"version":"4.7.4"}
|
|
@@ -175,7 +175,7 @@ exports.server.exchange(oauth2orize_koa_1.default.exchange.refreshToken(async (c
|
|
|
175
175
|
}
|
|
176
176
|
const roles = await (0, shell_1.getRepository)(role_1.Role).findBy({
|
|
177
177
|
name: (0, typeorm_1.In)(scopes),
|
|
178
|
-
domain
|
|
178
|
+
domain: { id: domain.id }
|
|
179
179
|
});
|
|
180
180
|
var accessToken = application_1.Application.generateAccessToken(domain, appuser, appKey, scope);
|
|
181
181
|
var refreshToken = application_1.Application.generateRefreshToken(domain, appuser, appKey, scope);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth2-server.js","sourceRoot":"","sources":["../../../server/router/oauth2/oauth2-server.ts"],"names":[],"mappings":";;;;AAAA,8EAAyC;AACzC,qCAA4B;AAE5B,6CAA4C;AAC5C,iDAA6D;AAE7D,uEAAmE;AACnE,kDAA8C;AAC9C,kDAA0D;AAE1D,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;AAEnB,QAAA,QAAQ,GAAG,UAAU,CAAA;AACrB,QAAA,SAAS,GAAG;IACvB,EAAE,EAAE,gBAAQ;CACb,CAAA;AAED,0BAA0B;AACb,QAAA,MAAM,GAAG,yBAAW,CAAC,YAAY,EAAE,CAAA;AAEhD,2DAA2D;AAC3D,EAAE;AACF,oEAAoE;AACpE,4EAA4E;AAC5E,8EAA8E;AAC9E,2EAA2E;AAC3E,yBAAyB;AACzB,EAAE;AACF,8EAA8E;AAC9E,0EAA0E;AAC1E,6EAA6E;AAC7E,sCAAsC;AAEtC,cAAM,CAAC,eAAe,CAAC,KAAK,WAAW,MAAM;IAC3C,OAAO,MAAM,CAAC,EAAE,CAAA;AAClB,CAAC,CAAC,CAAA;AAEF,cAAM,CAAC,iBAAiB,CAAC,KAAK,WAAW,EAAE;IACzC,IAAI,EAAE,IAAI,gBAAQ,EAAE;QAClB,OAAO,EAAE,CAAA;KACV;IAED,MAAM,WAAW,GAAG,MAAM,IAAA,qBAAa,EAAC,yBAAW,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;IACtE,OAAO,WAAW,CAAA;AACpB,CAAC,CAAC,CAAA;AAEF,kCAAkC;A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Aa,EAAC,WAAI,CAAC,CAAC,MAAM,CAAC;QAC7C,IAAI,EAAE,IAAA,YAAE,EAAC,MAAM,CAAC;QAChB,MAAM;KACP,CAAC,CAAA;IAEF,IAAI,WAAW,GAAG,yBAAW,CAAC,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;IACjF,IAAI,YAAY,GAAQ,yBAAW,CAAC,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;IAExF,MAAM,IAAA,qBAAa,EAAC,WAAI,CAAC,CAAC,IAAI,iCACxB,OAAe,KACnB,KAAK,EACL,QAAQ,EAAE,YAAY,IACtB,CAAA;IAEF,OAAO;QACL,WAAW;QACX,YAAY;QACZ;YACE,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,SAAS;YACvC,UAAU,EAAE,QAAQ;SACrB;KACF,CAAA;AACH,CAAC,CAAC,CACH,CAAA","sourcesContent":["import oauth2orize from 'oauth2orize-koa'\nimport { In } from 'typeorm'\n\nimport { logger } from '@things-factory/env'\nimport { Domain, getRepository } from '@things-factory/shell'\n\nimport { Application } from '../../service/application/application'\nimport { Role } from '../../service/role/role'\nimport { User, UserStatus } from '../../service/user/user'\n\nconst crypto = require('crypto')\n\nexport const NOTFOUND = 'NOTFOUND'\nexport const NonClient = {\n id: NOTFOUND\n}\n\n// create OAuth 2.0 server\nexport const server = oauth2orize.createServer()\n\n// Register serialialization and deserialization functions.\n//\n// When a client redirects a user to user authorization endpoint, an\n// authorization transaction is initiated. To complete the transaction, the\n// user must authenticate and approve the authorization request. Because this\n// may involve multiple HTTP request/response exchanges, the transaction is\n// stored in the session.\n//\n// An application must supply serialization functions, which determine how the\n// client object is serialized into the session. Typically this will be a\n// simple matter of serializing the client's ID, and deserializing by finding\n// the client by ID from the database.\n\nserver.serializeClient(async function (client) {\n return client.id\n})\n\nserver.deserializeClient(async function (id) {\n if (id == NOTFOUND) {\n return {}\n }\n\n const application = await getRepository(Application).findOneBy({ id })\n return application\n})\n\n// Register supported grant types.\n//\n// OAuth 2.0 specifies a framework that allows users to grant client\n// applications limited access to their protected resources. It does this\n// through a process of the user granting access, and the client exchanging\n// the grant for an access token.\n\n// Grant authorization codes. The callback takes the `client` requesting\n// authorization, the `redirectURI` (which is used as a verifier in the\n// subsequent exchange), the authenticated `user` granting access, and\n// their response, which contains approved scope, duration, etc. as parsed by\n// the application. The application issues a code, which is bound to these\n// values, and will be exchanged for an access token.\n\nserver.grant(\n oauth2orize.grant.code(async (client, redirectUrl, user, ares, areq) => {\n const { email, appKey, subdomain, scopes, state } = ares\n\n return Application.generateAuthCode(email, appKey, subdomain, scopes, state)\n })\n)\n\n// Exchange authorization codes for access tokens. The callback accepts the\n// `client`, which is exchanging `code` and any `redirectURI` from the\n// authorization request for verification. If these values are validated, the\n// application issues an access token on behalf of the user who authorized the\n// code.\n\nserver.exchange(\n oauth2orize.exchange.code(async (client, code, redirectUrl) => {\n try {\n /* authorization code */\n var decoded: any = Application.verifyAuthCode(code)\n } catch (e) {\n return false\n }\n let { email, appKey, subdomain, scopes } = decoded\n\n const application: Application = await getRepository(Application).findOneBy({\n appKey\n })\n\n if (!application) {\n return false\n }\n\n /* DONT-FORGET uncomment after test */\n // if (redirectUrl !== application.redirectUrl && redirectUrl.indexOf(application.redirectUrl) != 0) {\n // logger.error(\n // 'oauth2 exchange error - redirectUrl should begins with the application setting',\n // redirectUrl,\n // application.redirectUrl\n // )\n // // return false\n // throw new TypeError(\n // `oauth2 exchange error - redirectUrl should begins with the application setting : '${redirectUrl}':'${application.redirectUrl}'`\n // )\n // }\n\n const domain: Domain = await getRepository(Domain).findOneBy({\n subdomain\n })\n\n const creator: User = await getRepository(User).findOneBy({ email })\n\n const appuserEmail = `${crypto.randomUUID()}@${subdomain}`\n\n var appuser: User = await getRepository(User).findOne({\n where: {\n email: appuserEmail,\n reference: application.id,\n userType: 'application'\n },\n\n relations: ['domains', 'creator', 'updater']\n })\n\n appuser = await getRepository(User).save({\n ...(appuser || {}),\n email: appuserEmail,\n name: application.name,\n userType: 'application',\n reference: application.id,\n domains: [domain],\n roles: scopes,\n status: UserStatus.ACTIVATED,\n updater: creator,\n creator\n })\n\n // appuser = await getRepository(User).findOne({\n // where: { email: appuserEmail },\n // relations: ['domains']\n // })\n\n // appuser.domains = Promise.resolve([domain])\n // await getRepository(User).save(appuser)\n // Lazy relation 필드들(domain, domains)들에 대한 업데이트. 이상의 방법으로 업데이트 해야하는 것 같다.\n // Lazy relation 업데이트 방법의 일관성이 부족하므로, Lazy relation 필드를 사용하지 않기를 권장함.\n\n var accessToken = Application.generateAccessToken(domain, appuser, appKey, scopes)\n var refreshToken = Application.generateRefreshToken(domain, appuser, appKey, scopes)\n\n await getRepository(User).save({\n ...(appuser as any),\n password: refreshToken\n })\n\n return [\n accessToken,\n refreshToken,\n {\n expires_in: 30 * 24 * 60 * 60 /* 30d */,\n token_type: 'bearer',\n centerId: subdomain\n }\n ]\n })\n)\n\nserver.exchange(\n oauth2orize.exchange.refreshToken(async (client, refreshToken, scope) => {\n try {\n /* refresh token */\n var decoded: any = Application.verifyAuthCode(refreshToken)\n } catch (e) {\n logger.error(e)\n return false\n }\n const {\n id,\n userType,\n email,\n application: { appKey },\n domain: { subdomain },\n scope: originalScope,\n exp: expires_in\n } = decoded\n\n const application: Application = await getRepository(Application).findOneBy({\n appKey\n })\n\n if (!application) {\n logger.error('application is not exist')\n return false\n }\n\n if (Date.now() > expires_in * 1000) {\n logger.error('refresh token is expired')\n return false\n }\n\n const domain: Domain = await getRepository(Domain).findOneBy({\n subdomain\n })\n\n const creator: User = await getRepository(User).findOneBy({\n id,\n userType\n })\n\n const appuserEmail = `${appKey}@${subdomain}`\n\n var appuser: User = await getRepository(User).findOne({\n where: {\n email: appuserEmail,\n reference: application.id,\n userType: 'application'\n },\n relations: ['domain', 'creator', 'updater']\n })\n\n if (!appuser) {\n logger.error('application is not bound')\n return false\n }\n\n /*\n * `scope` is the scope of access requested by the client, which must not include any scope not originally granted.\n */\n\n scope = scope || originalScope\n\n const scopes: string[] = scope.split(',')\n const originalScopes = (originalScope || '').split(',')\n const additionalScope = scopes.find(scope => originalScopes.indexOf(scope) === -1)\n if (additionalScope) {\n logger.error(`additional scope(${additionalScope}) required`)\n return false\n }\n\n const roles = await getRepository(Role).findBy({\n name: In(scopes),\n domain\n })\n\n var accessToken = Application.generateAccessToken(domain, appuser, appKey, scope)\n var refreshToken: any = Application.generateRefreshToken(domain, appuser, appKey, scope)\n\n await getRepository(User).save({\n ...(appuser as any),\n roles,\n password: refreshToken\n })\n\n return [\n accessToken,\n refreshToken,\n {\n expires_in: 30 * 24 * 60 * 60 /* 30d */,\n token_type: 'bearer'\n }\n ]\n })\n)\n"]}
|
|
1
|
+
{"version":3,"file":"oauth2-server.js","sourceRoot":"","sources":["../../../server/router/oauth2/oauth2-server.ts"],"names":[],"mappings":";;;;AAAA,8EAAyC;AACzC,qCAA4B;AAE5B,6CAA4C;AAC5C,iDAA6D;AAE7D,uEAAmE;AACnE,kDAA8C;AAC9C,kDAA0D;AAE1D,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;AAEnB,QAAA,QAAQ,GAAG,UAAU,CAAA;AACrB,QAAA,SAAS,GAAG;IACvB,EAAE,EAAE,gBAAQ;CACb,CAAA;AAED,0BAA0B;AACb,QAAA,MAAM,GAAG,yBAAW,CAAC,YAAY,EAAE,CAAA;AAEhD,2DAA2D;AAC3D,EAAE;AACF,oEAAoE;AACpE,4EAA4E;AAC5E,8EAA8E;AAC9E,2EAA2E;AAC3E,yBAAyB;AACzB,EAAE;AACF,8EAA8E;AAC9E,0EAA0E;AAC1E,6EAA6E;AAC7E,sCAAsC;AAEtC,cAAM,CAAC,eAAe,CAAC,KAAK,WAAW,MAAM;IAC3C,OAAO,MAAM,CAAC,EAAE,CAAA;AAClB,CAAC,CAAC,CAAA;AAEF,cAAM,CAAC,iBA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MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAClF,IAAI,eAAe,EAAE;QACnB,YAAM,CAAC,KAAK,CAAC,oBAAoB,eAAe,YAAY,CAAC,CAAA;QAC7D,OAAO,KAAK,CAAA;KACb;IAED,MAAM,KAAK,GAAG,MAAM,IAAA,qBAAa,EAAC,WAAI,CAAC,CAAC,MAAM,CAAC;QAC7C,IAAI,EAAE,IAAA,YAAE,EAAC,MAAM,CAAC;QAChB,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE;KAC1B,CAAC,CAAA;IAEF,IAAI,WAAW,GAAG,yBAAW,CAAC,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;IACjF,IAAI,YAAY,GAAQ,yBAAW,CAAC,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;IAExF,MAAM,IAAA,qBAAa,EAAC,WAAI,CAAC,CAAC,IAAI,iCACxB,OAAe,KACnB,KAAK,EACL,QAAQ,EAAE,YAAY,IACtB,CAAA;IAEF,OAAO;QACL,WAAW;QACX,YAAY;QACZ;YACE,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,SAAS;YACvC,UAAU,EAAE,QAAQ;SACrB;KACF,CAAA;AACH,CAAC,CAAC,CACH,CAAA","sourcesContent":["import oauth2orize from 'oauth2orize-koa'\nimport { In } from 'typeorm'\n\nimport { logger } from '@things-factory/env'\nimport { Domain, getRepository } from '@things-factory/shell'\n\nimport { Application } from '../../service/application/application'\nimport { Role } from '../../service/role/role'\nimport { User, UserStatus } from '../../service/user/user'\n\nconst crypto = require('crypto')\n\nexport const NOTFOUND = 'NOTFOUND'\nexport const NonClient = {\n id: NOTFOUND\n}\n\n// create OAuth 2.0 server\nexport const server = oauth2orize.createServer()\n\n// Register serialialization and deserialization functions.\n//\n// When a client redirects a user to user authorization endpoint, an\n// authorization transaction is initiated. To complete the transaction, the\n// user must authenticate and approve the authorization request. Because this\n// may involve multiple HTTP request/response exchanges, the transaction is\n// stored in the session.\n//\n// An application must supply serialization functions, which determine how the\n// client object is serialized into the session. Typically this will be a\n// simple matter of serializing the client's ID, and deserializing by finding\n// the client by ID from the database.\n\nserver.serializeClient(async function (client) {\n return client.id\n})\n\nserver.deserializeClient(async function (id) {\n if (id == NOTFOUND) {\n return {}\n }\n\n const application = await getRepository(Application).findOneBy({ id })\n return application\n})\n\n// Register supported grant types.\n//\n// OAuth 2.0 specifies a framework that allows users to grant client\n// applications limited access to their protected resources. It does this\n// through a process of the user granting access, and the client exchanging\n// the grant for an access token.\n\n// Grant authorization codes. The callback takes the `client` requesting\n// authorization, the `redirectURI` (which is used as a verifier in the\n// subsequent exchange), the authenticated `user` granting access, and\n// their response, which contains approved scope, duration, etc. as parsed by\n// the application. The application issues a code, which is bound to these\n// values, and will be exchanged for an access token.\n\nserver.grant(\n oauth2orize.grant.code(async (client, redirectUrl, user, ares, areq) => {\n const { email, appKey, subdomain, scopes, state } = ares\n\n return Application.generateAuthCode(email, appKey, subdomain, scopes, state)\n })\n)\n\n// Exchange authorization codes for access tokens. The callback accepts the\n// `client`, which is exchanging `code` and any `redirectURI` from the\n// authorization request for verification. If these values are validated, the\n// application issues an access token on behalf of the user who authorized the\n// code.\n\nserver.exchange(\n oauth2orize.exchange.code(async (client, code, redirectUrl) => {\n try {\n /* authorization code */\n var decoded: any = Application.verifyAuthCode(code)\n } catch (e) {\n return false\n }\n let { email, appKey, subdomain, scopes } = decoded\n\n const application: Application = await getRepository(Application).findOneBy({\n appKey\n })\n\n if (!application) {\n return false\n }\n\n /* DONT-FORGET uncomment after test */\n // if (redirectUrl !== application.redirectUrl && redirectUrl.indexOf(application.redirectUrl) != 0) {\n // logger.error(\n // 'oauth2 exchange error - redirectUrl should begins with the application setting',\n // redirectUrl,\n // application.redirectUrl\n // )\n // // return false\n // throw new TypeError(\n // `oauth2 exchange error - redirectUrl should begins with the application setting : '${redirectUrl}':'${application.redirectUrl}'`\n // )\n // }\n\n const domain: Domain = await getRepository(Domain).findOneBy({\n subdomain\n })\n\n const creator: User = await getRepository(User).findOneBy({ email })\n\n const appuserEmail = `${crypto.randomUUID()}@${subdomain}`\n\n var appuser: User = await getRepository(User).findOne({\n where: {\n email: appuserEmail,\n reference: application.id,\n userType: 'application'\n },\n\n relations: ['domains', 'creator', 'updater']\n })\n\n appuser = await getRepository(User).save({\n ...(appuser || {}),\n email: appuserEmail,\n name: application.name,\n userType: 'application',\n reference: application.id,\n domains: [domain],\n roles: scopes,\n status: UserStatus.ACTIVATED,\n updater: creator,\n creator\n })\n\n // appuser = await getRepository(User).findOne({\n // where: { email: appuserEmail },\n // relations: ['domains']\n // })\n\n // appuser.domains = Promise.resolve([domain])\n // await getRepository(User).save(appuser)\n // Lazy relation 필드들(domain, domains)들에 대한 업데이트. 이상의 방법으로 업데이트 해야하는 것 같다.\n // Lazy relation 업데이트 방법의 일관성이 부족하므로, Lazy relation 필드를 사용하지 않기를 권장함.\n\n var accessToken = Application.generateAccessToken(domain, appuser, appKey, scopes)\n var refreshToken = Application.generateRefreshToken(domain, appuser, appKey, scopes)\n\n await getRepository(User).save({\n ...(appuser as any),\n password: refreshToken\n })\n\n return [\n accessToken,\n refreshToken,\n {\n expires_in: 30 * 24 * 60 * 60 /* 30d */,\n token_type: 'bearer',\n centerId: subdomain\n }\n ]\n })\n)\n\nserver.exchange(\n oauth2orize.exchange.refreshToken(async (client, refreshToken, scope) => {\n try {\n /* refresh token */\n var decoded: any = Application.verifyAuthCode(refreshToken)\n } catch (e) {\n logger.error(e)\n return false\n }\n const {\n id,\n userType,\n email,\n application: { appKey },\n domain: { subdomain },\n scope: originalScope,\n exp: expires_in\n } = decoded\n\n const application: Application = await getRepository(Application).findOneBy({\n appKey\n })\n\n if (!application) {\n logger.error('application is not exist')\n return false\n }\n\n if (Date.now() > expires_in * 1000) {\n logger.error('refresh token is expired')\n return false\n }\n\n const domain: Domain = await getRepository(Domain).findOneBy({\n subdomain\n })\n\n const creator: User = await getRepository(User).findOneBy({\n id,\n userType\n })\n\n const appuserEmail = `${appKey}@${subdomain}`\n\n var appuser: User = await getRepository(User).findOne({\n where: {\n email: appuserEmail,\n reference: application.id,\n userType: 'application'\n },\n relations: ['domain', 'creator', 'updater']\n })\n\n if (!appuser) {\n logger.error('application is not bound')\n return false\n }\n\n /*\n * `scope` is the scope of access requested by the client, which must not include any scope not originally granted.\n */\n\n scope = scope || originalScope\n\n const scopes: string[] = scope.split(',')\n const originalScopes = (originalScope || '').split(',')\n const additionalScope = scopes.find(scope => originalScopes.indexOf(scope) === -1)\n if (additionalScope) {\n logger.error(`additional scope(${additionalScope}) required`)\n return false\n }\n\n const roles = await getRepository(Role).findBy({\n name: In(scopes),\n domain: { id: domain.id }\n })\n\n var accessToken = Application.generateAccessToken(domain, appuser, appKey, scope)\n var refreshToken: any = Application.generateRefreshToken(domain, appuser, appKey, scope)\n\n await getRepository(User).save({\n ...(appuser as any),\n roles,\n password: refreshToken\n })\n\n return [\n accessToken,\n refreshToken,\n {\n expires_in: 30 * 24 * 60 * 60 /* 30d */,\n token_type: 'bearer'\n }\n ]\n })\n)\n"]}
|
|
@@ -15,6 +15,7 @@ export declare class ApplicationMutation {
|
|
|
15
15
|
icon?: string;
|
|
16
16
|
redirectUrl?: string;
|
|
17
17
|
webhook?: string;
|
|
18
|
+
type?: import("./application").ApplicationType;
|
|
18
19
|
} & Application>;
|
|
19
20
|
deleteApplication(id: string, context: ResolverContext): Promise<boolean>;
|
|
20
21
|
generateApplicationSecret(id: string, context: ResolverContext): Promise<{
|
|
@@ -32,6 +33,7 @@ export declare class ApplicationMutation {
|
|
|
32
33
|
webhook: string;
|
|
33
34
|
appKey: string;
|
|
34
35
|
status: import("./application").ApplicationStatus;
|
|
36
|
+
type: import("./application").ApplicationType;
|
|
35
37
|
createdAt: Date;
|
|
36
38
|
updatedAt: Date;
|
|
37
39
|
creator: User;
|
|
@@ -51,6 +53,7 @@ export declare class ApplicationMutation {
|
|
|
51
53
|
icon: string;
|
|
52
54
|
redirectUrl: string;
|
|
53
55
|
webhook: string;
|
|
56
|
+
type: import("./application").ApplicationType;
|
|
54
57
|
id: string;
|
|
55
58
|
domain: import("@things-factory/shell").Domain;
|
|
56
59
|
domainId: string;
|
|
@@ -24,7 +24,7 @@ let ApplicationQuery = class ApplicationQuery {
|
|
|
24
24
|
}
|
|
25
25
|
async availableScopes(context) {
|
|
26
26
|
const { domain } = context.state;
|
|
27
|
-
const roles = await (0, shell_1.getRepository)(role_1.Role).findBy({ domain });
|
|
27
|
+
const roles = await (0, shell_1.getRepository)(role_1.Role).findBy({ domain: { id: domain.id } });
|
|
28
28
|
return roles.map((role) => role.name).join(' ');
|
|
29
29
|
}
|
|
30
30
|
async accessTokenUrl(context) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-query.js","sourceRoot":"","sources":["../../../server/service/application/application-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,6BAAyB;AAEzB,6CAA4C;AAC5C,iDAAoF;AAEpF,uCAAmC;AACnC,uCAAmC;AACnC,+CAA2C;AAC3C,2DAAqD;AAErD,MAAM,QAAQ,GAAW,YAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;AAG/C,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;IAE3B,KAAK,CAAC,WAAW,CAAY,EAAU,EAAS,OAAwB;QACtE,MAAM,UAAU,GAAG,IAAA,qBAAa,EAAC,yBAAW,CAAC,CAAA;QAE7C,OAAO,MAAM,UAAU,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;IAC3C,CAAC;IAGD,KAAK,CAAC,YAAY,CAAS,MAAiB,EAAS,OAAwB;QAC3E,MAAM,EAAE,GAAoC,IAAA,qBAAa,EAAC,yBAAW,CAAC,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAA;QACxG,IAAA,kBAAU,EAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;QAE/B,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,EAAE,CAAC,eAAe,EAAE,CAAA;QAEjD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGD,KAAK,CAAC,eAAe,CAAQ,OAAwB;QACnD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAChC,MAAM,KAAK,GAAG,MAAM,IAAA,qBAAa,EAAC,WAAI,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"application-query.js","sourceRoot":"","sources":["../../../server/service/application/application-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,6BAAyB;AAEzB,6CAA4C;AAC5C,iDAAoF;AAEpF,uCAAmC;AACnC,uCAAmC;AACnC,+CAA2C;AAC3C,2DAAqD;AAErD,MAAM,QAAQ,GAAW,YAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;AAG/C,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;IAE3B,KAAK,CAAC,WAAW,CAAY,EAAU,EAAS,OAAwB;QACtE,MAAM,UAAU,GAAG,IAAA,qBAAa,EAAC,yBAAW,CAAC,CAAA;QAE7C,OAAO,MAAM,UAAU,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;IAC3C,CAAC;IAGD,KAAK,CAAC,YAAY,CAAS,MAAiB,EAAS,OAAwB;QAC3E,MAAM,EAAE,GAAoC,IAAA,qBAAa,EAAC,yBAAW,CAAC,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAA;QACxG,IAAA,kBAAU,EAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;QAE/B,MAAM,CAAC,KAAK,EAAE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;IAC9D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAA;IAClC,IAAI,GAAG,GAAQ,IAAI,SAAG,CAAC,MAAM,CAAC,CAAA;IAC9B,GAAG,CAAC,QAAQ,GAAG,QAAQ,IAAI,GAAG,CAAC,QAAQ,CAAA;IACvC,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAA;IACvB,OAAO,GAAG,CAAC,IAAI,CAAA;AACjB,CAAC","sourcesContent":["import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\nimport { SelectQueryBuilder } from 'typeorm'\nimport { URL } from 'url'\n\nimport { config } from '@things-factory/env'\nimport { buildQuery, Domain, getRepository, ListParam } from '@things-factory/shell'\n\nimport { Role } from '../role/role'\nimport { User } from '../user/user'\nimport { Application } from './application'\nimport { ApplicationList } from './application-types'\n\nconst protocol: string = config.get('protocol')\n\n@Resolver(Application)\nexport class ApplicationQuery {\n @Query(returns => Application, { description: 'To fetch application' })\n async application(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Application> {\n const repository = getRepository(Application)\n\n return await repository.findOneBy({ id })\n }\n\n @Query(returns => ApplicationList, { description: 'To fetch multiple application' })\n async applications(@Args() params: ListParam, @Ctx() context: ResolverContext) {\n const qb: SelectQueryBuilder<Application> = getRepository(Application).createQueryBuilder('Application')\n buildQuery(qb, params, context)\n\n const [items, total] = await qb.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => String)\n async availableScopes(@Ctx() context: ResolverContext): Promise<string> {\n const { domain } = context.state\n const roles = await getRepository(Role).findBy({ domain: { id: domain.id } })\n\n return roles.map((role: Role) => role.name).join(' ')\n }\n\n @FieldResolver(type => String)\n async accessTokenUrl(@Ctx() context: ResolverContext): Promise<string> {\n return buildAuthURL('/oauth/access-token', context)\n }\n\n @FieldResolver(type => String)\n async authUrl(@Ctx() context: ResolverContext): Promise<string> {\n return buildAuthURL('/oauth/authorize', context)\n }\n\n @FieldResolver(type => Domain)\n async domain(@Ctx() context: ResolverContext) {\n return context.state.domain\n }\n\n @FieldResolver(type => User)\n async updater(@Root() application: Application): Promise<User> {\n return await getRepository(User).findOneBy({ id: application.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() application: Application): Promise<User> {\n return await getRepository(User).findOneBy({ id: application.creatorId })\n }\n}\n\nfunction buildAuthURL(pathname: string, context: ResolverContext): string {\n const { origin } = context.request\n let url: URL = new URL(origin)\n url.protocol = protocol || url.protocol\n url.pathname = pathname\n return url.href\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Application } from './application';
|
|
1
|
+
import { Application, ApplicationType } from './application';
|
|
2
2
|
export declare class AccessToken {
|
|
3
3
|
accesToken: string;
|
|
4
4
|
refreshToken: string;
|
|
@@ -15,6 +15,7 @@ export declare class ApplicationPatch {
|
|
|
15
15
|
icon?: string;
|
|
16
16
|
redirectUrl?: string;
|
|
17
17
|
webhook?: string;
|
|
18
|
+
type?: ApplicationType;
|
|
18
19
|
}
|
|
19
20
|
export declare class NewApplication {
|
|
20
21
|
name: string;
|
|
@@ -24,4 +25,5 @@ export declare class NewApplication {
|
|
|
24
25
|
icon?: string;
|
|
25
26
|
redirectUrl?: string;
|
|
26
27
|
webhook?: string;
|
|
28
|
+
type?: ApplicationType;
|
|
27
29
|
}
|
|
@@ -62,6 +62,10 @@ tslib_1.__decorate([
|
|
|
62
62
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
63
63
|
tslib_1.__metadata("design:type", String)
|
|
64
64
|
], ApplicationPatch.prototype, "webhook", void 0);
|
|
65
|
+
tslib_1.__decorate([
|
|
66
|
+
(0, type_graphql_1.Field)(type => application_1.ApplicationType, { nullable: true }),
|
|
67
|
+
tslib_1.__metadata("design:type", String)
|
|
68
|
+
], ApplicationPatch.prototype, "type", void 0);
|
|
65
69
|
ApplicationPatch = tslib_1.__decorate([
|
|
66
70
|
(0, type_graphql_1.InputType)()
|
|
67
71
|
], ApplicationPatch);
|
|
@@ -96,6 +100,10 @@ tslib_1.__decorate([
|
|
|
96
100
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
97
101
|
tslib_1.__metadata("design:type", String)
|
|
98
102
|
], NewApplication.prototype, "webhook", void 0);
|
|
103
|
+
tslib_1.__decorate([
|
|
104
|
+
(0, type_graphql_1.Field)(type => application_1.ApplicationType, { nullable: true }),
|
|
105
|
+
tslib_1.__metadata("design:type", String)
|
|
106
|
+
], NewApplication.prototype, "type", void 0);
|
|
99
107
|
NewApplication = tslib_1.__decorate([
|
|
100
108
|
(0, type_graphql_1.InputType)()
|
|
101
109
|
], NewApplication);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-types.js","sourceRoot":"","sources":["../../../server/service/application/application-types.ts"],"names":[],"mappings":";;;;AAAA,+CAAgE;
|
|
1
|
+
{"version":3,"file":"application-types.js","sourceRoot":"","sources":["../../../server/service/application/application-types.ts"],"names":[],"mappings":";;;;AAAA,+CAAgE;AAEhE,+CAA4D;AAG5D,IAAa,WAAW,GAAxB,MAAa,WAAW;CAMvB,CAAA;AAJC;IADC,IAAA,oBAAK,GAAE;;+CACU;AAGlB;IADC,IAAA,oBAAK,GAAE;;iDACY;AALT,WAAW;IADvB,IAAA,yBAAU,GAAE;GACA,WAAW,CAMvB;AANY,kCAAW;AASxB,IAAa,eAAe,GAA5B,MAAa,eAAe;CAM3B,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,yBAAW,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CAC5B;AAGrB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACzB;AALH,eAAe;IAD3B,IAAA,yBAAU,GAAE;GACA,eAAe,CAM3B;AANY,0CAAe;AAS5B,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;CAwB5B,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AAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,6BAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CAC7B;AAvBX,cAAc;IAD1B,IAAA,wBAAS,GAAE;GACC,cAAc,CAwB1B;AAxBY,wCAAc","sourcesContent":["import { Field, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { Application, ApplicationType } from './application'\n\n@ObjectType()\nexport class AccessToken {\n @Field()\n accesToken: string\n\n @Field()\n refreshToken: string\n}\n\n@ObjectType()\nexport class ApplicationList {\n @Field(type => [Application], { nullable: true })\n items?: Application[]\n\n @Field(type => Int, { nullable: true })\n total?: number\n}\n\n@InputType()\nexport class ApplicationPatch {\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n email?: string\n\n @Field({ nullable: true })\n url?: string\n\n @Field({ nullable: true })\n icon?: string\n\n @Field({ nullable: true })\n redirectUrl?: string\n\n @Field({ nullable: true })\n webhook?: string\n\n @Field(type => ApplicationType, { nullable: true })\n type?: ApplicationType\n}\n\n@InputType()\nexport class NewApplication {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n email?: string\n\n @Field({ nullable: true })\n url?: string\n\n @Field({ nullable: true })\n icon?: string\n\n @Field({ nullable: true })\n redirectUrl?: string\n\n @Field({ nullable: true })\n webhook?: string\n\n @Field(type => ApplicationType, { nullable: true })\n type?: ApplicationType\n}\n"]}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import { User } from '../user/user';
|
|
2
|
-
import { Domain } from '@things-factory/shell';
|
|
3
1
|
import jwt from 'jsonwebtoken';
|
|
2
|
+
import { Domain } from '@things-factory/shell';
|
|
3
|
+
import { User } from '../user/user';
|
|
4
4
|
export declare enum ApplicationStatus {
|
|
5
5
|
DRAFT = "DRAFT",
|
|
6
6
|
ACTIVATED = "ACTIVATED"
|
|
7
7
|
}
|
|
8
|
+
export declare enum ApplicationType {
|
|
9
|
+
SELLERCRAFT = "SELLERCRAFT",
|
|
10
|
+
XILNEX = "XILNEX",
|
|
11
|
+
MMS = "MMS",
|
|
12
|
+
XERO = "XERO",
|
|
13
|
+
OTHERS = "OTHERS",
|
|
14
|
+
SFTP = "SFTP"
|
|
15
|
+
}
|
|
8
16
|
export declare class Application {
|
|
9
17
|
readonly id: string;
|
|
10
18
|
domain: Domain;
|
|
@@ -19,6 +27,7 @@ export declare class Application {
|
|
|
19
27
|
appKey: string;
|
|
20
28
|
appSecret: string;
|
|
21
29
|
status: ApplicationStatus;
|
|
30
|
+
type: ApplicationType;
|
|
22
31
|
createdAt: Date;
|
|
23
32
|
updatedAt: Date;
|
|
24
33
|
creator: User;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Application = exports.ApplicationStatus = void 0;
|
|
3
|
+
exports.Application = exports.ApplicationType = exports.ApplicationStatus = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const crypto_1 = tslib_1.__importDefault(require("crypto"));
|
|
6
|
+
const jsonwebtoken_1 = tslib_1.__importDefault(require("jsonwebtoken"));
|
|
6
7
|
const type_graphql_1 = require("type-graphql");
|
|
7
|
-
const
|
|
8
|
+
const typeorm_1 = require("typeorm");
|
|
9
|
+
const env_1 = require("@things-factory/env");
|
|
8
10
|
const shell_1 = require("@things-factory/shell");
|
|
9
11
|
const get_secret_1 = require("../../utils/get-secret");
|
|
10
|
-
const
|
|
11
|
-
const crypto_1 = tslib_1.__importDefault(require("crypto"));
|
|
12
|
-
const jsonwebtoken_1 = tslib_1.__importDefault(require("jsonwebtoken"));
|
|
12
|
+
const user_1 = require("../user/user");
|
|
13
13
|
const ORMCONFIG = env_1.config.get('ormconfig', {});
|
|
14
14
|
const DATABASE_TYPE = ORMCONFIG.type;
|
|
15
15
|
var ApplicationStatus;
|
|
@@ -21,6 +21,19 @@ var ApplicationStatus;
|
|
|
21
21
|
name: 'ApplicationStatus',
|
|
22
22
|
description: 'state enumeration of a application'
|
|
23
23
|
});
|
|
24
|
+
var ApplicationType;
|
|
25
|
+
(function (ApplicationType) {
|
|
26
|
+
ApplicationType["SELLERCRAFT"] = "SELLERCRAFT";
|
|
27
|
+
ApplicationType["XILNEX"] = "XILNEX";
|
|
28
|
+
ApplicationType["MMS"] = "MMS";
|
|
29
|
+
ApplicationType["XERO"] = "XERO";
|
|
30
|
+
ApplicationType["OTHERS"] = "OTHERS";
|
|
31
|
+
ApplicationType["SFTP"] = "SFTP";
|
|
32
|
+
})(ApplicationType = exports.ApplicationType || (exports.ApplicationType = {}));
|
|
33
|
+
(0, type_graphql_1.registerEnumType)(ApplicationType, {
|
|
34
|
+
name: 'ApplicationType',
|
|
35
|
+
description: 'state enumeration of a application'
|
|
36
|
+
});
|
|
24
37
|
let Application = class Application {
|
|
25
38
|
/* generateAppSecret */
|
|
26
39
|
static generateAppSecret() {
|
|
@@ -155,6 +168,19 @@ tslib_1.__decorate([
|
|
|
155
168
|
(0, type_graphql_1.Field)(),
|
|
156
169
|
tslib_1.__metadata("design:type", String)
|
|
157
170
|
], Application.prototype, "status", void 0);
|
|
171
|
+
tslib_1.__decorate([
|
|
172
|
+
(0, typeorm_1.Column)({
|
|
173
|
+
type: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
174
|
+
? 'enum'
|
|
175
|
+
: DATABASE_TYPE == 'oracle'
|
|
176
|
+
? 'varchar2'
|
|
177
|
+
: 'smallint',
|
|
178
|
+
enum: ApplicationType,
|
|
179
|
+
default: ApplicationType.OTHERS
|
|
180
|
+
}),
|
|
181
|
+
(0, type_graphql_1.Field)(),
|
|
182
|
+
tslib_1.__metadata("design:type", String)
|
|
183
|
+
], Application.prototype, "type", void 0);
|
|
158
184
|
tslib_1.__decorate([
|
|
159
185
|
(0, typeorm_1.CreateDateColumn)(),
|
|
160
186
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.js","sourceRoot":"","sources":["../../../server/service/application/application.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"application.js","sourceRoot":"","sources":["../../../server/service/application/application.ts"],"names":[],"mappings":";;;;AAAA,4DAA2B;AAC3B,wEAA8B;AAC9B,+CAAsE;AACtE,qCASgB;AAEhB,6CAA4C;AAC5C,iDAA8C;AAE9C,uDAA+C;AAC/C,uCAA+C;AAE/C,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAEpC,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,oCAAe,CAAA;IACf,4CAAuB,CAAA;AACzB,CAAC,EAHW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAG5B;AAED,IAAA,+BAAgB,EAAC,iBAAiB,EAAE;IAClC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,oCAAoC;CAClD,CAAC,CAAA;AAEF,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,8CAA2B,CAAA;IAC3B,oCAAiB,CAAA;IACjB,8BAAW,CAAA;IACX,gCAAa,CAAA;IACb,oCAAiB,CAAA;IACjB,gCAAa,CAAA;AACf,CAAC,EAPW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAO1B;AAED,IAAA,+BAAgB,EAAC,eAAe,EAAE;IAChC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,oCAAoC;CAClD,CAAC,CAAA;AAIF,IAAa,WAAW,GAAxB,MAAa,WAAW;IA4GtB,uBAAuB;IACvB,MAAM,CAAC,iBAAiB;QACtB,OAAO,gBAAM,CAAC,WAAW,CAAC,EAAE,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AAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjB,WAAI;4CAAA;AAGb;IADC,IAAA,oBAAU,EAAC,CAAC,WAAwB,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC;;8CAC7C;AAMjB;IAJC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,WAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjB,WAAI;4CAAA;AAGb;IADC,IAAA,oBAAU,EAAC,CAAC,WAAwB,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC;;8CAC7C;AA1GN,WAAW;IAHvB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,WAAwB,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC/F,IAAA,yBAAU,GAAE;GACA,WAAW,CAwKvB;AAxKY,kCAAW","sourcesContent":["import crypto from 'crypto'\nimport jwt from 'jsonwebtoken'\nimport { Field, ID, ObjectType, registerEnumType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\n\nimport { config } from '@things-factory/env'\nimport { Domain } from '@things-factory/shell'\n\nimport { SECRET } from '../../utils/get-secret'\nimport { User, UserStatus } from '../user/user'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\nexport enum ApplicationStatus {\n DRAFT = 'DRAFT',\n ACTIVATED = 'ACTIVATED'\n}\n\nregisterEnumType(ApplicationStatus, {\n name: 'ApplicationStatus',\n description: 'state enumeration of a application'\n})\n\nexport enum ApplicationType {\n SELLERCRAFT = 'SELLERCRAFT',\n XILNEX = 'XILNEX',\n MMS = 'MMS',\n XERO = 'XERO',\n OTHERS = 'OTHERS',\n SFTP = 'SFTP'\n}\n\nregisterEnumType(ApplicationType, {\n name: 'ApplicationType',\n description: 'state enumeration of a application'\n})\n@Entity()\n@Index('ix_application_0', (application: Application) => [application.appKey], { unique: true })\n@ObjectType()\nexport class Application {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n domain: Domain\n\n @RelationId((application: Application) => application.domain)\n domainId: string\n\n @Column()\n @Field()\n name: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description: string\n\n @Column()\n @Field()\n email: string\n\n @Column()\n @Field()\n url: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n icon: string\n\n @Column()\n @Field()\n redirectUrl: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n webhook: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n appKey: string\n\n @Column({\n nullable: true,\n type:\n DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'longtext'\n : DATABASE_TYPE == 'oracle'\n ? 'clob'\n : 'varchar'\n })\n @Field({ nullable: true })\n appSecret: string\n\n @Column({\n default: ApplicationStatus.DRAFT\n })\n @Field()\n status: ApplicationStatus\n\n @Column({\n type:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'enum'\n : DATABASE_TYPE == 'oracle'\n ? 'varchar2'\n : 'smallint',\n enum: ApplicationType,\n default: ApplicationType.OTHERS\n })\n @Field()\n type: ApplicationType\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt: Date\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n creator: User\n\n @RelationId((application: Application) => application.creator)\n creatorId: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater: User\n\n @RelationId((application: Application) => application.updater)\n updaterId: string\n\n /* generateAppSecret */\n static generateAppSecret() {\n return crypto.randomBytes(16).toString('hex')\n }\n\n static generateAppKey() {\n return crypto.randomBytes(16).toString('hex')\n }\n\n /* signing for jsonwebtoken */\n static sign(subject, expiresIn, domain, user, appKey, scope) {\n var application = {\n id: user.id,\n userType: 'application',\n application: {\n appKey\n },\n status: UserStatus.ACTIVATED,\n domain: {\n subdomain: domain.subdomain\n },\n scope\n }\n\n return jwt.sign(application, SECRET, {\n expiresIn,\n issuer: 'hatiolab.com',\n subject\n })\n }\n\n static generateAccessToken(domain, user, appKey, scope) {\n /* how to set expiresIn https://github.com/vercel/ms */\n return this.sign('access-token', '30d', domain, user, appKey, scope)\n }\n\n static generateRefreshToken(domain, user, appKey, scope) {\n /* how to set expiresIn https://github.com/vercel/ms */\n return this.sign('refresh-token', '1y', domain, user, appKey, scope)\n }\n\n /* auth-code signing for jsonwebtoken */\n static generateAuthCode(email, appKey, subdomain, scopes, state) {\n var credential = {\n email,\n appKey,\n subdomain,\n scopes,\n state\n }\n\n return jwt.sign(credential, SECRET, {\n expiresIn: '1m'\n })\n }\n\n /* auth-code signing for jsonwebtoken */\n static verifyAuthCode(authcode) {\n return jwt.verify(authcode, SECRET)\n }\n}\n"]}
|
|
@@ -42,7 +42,9 @@ let DomainGeneratorMutation = class DomainGeneratorMutation {
|
|
|
42
42
|
var _a;
|
|
43
43
|
if ((_a = role.privileges) === null || _a === void 0 ? void 0 : _a.length) {
|
|
44
44
|
const privilegeIds = role.privileges.map((p) => p.id);
|
|
45
|
-
role.privileges = await privilegeRepository.findBy({
|
|
45
|
+
role.privileges = await privilegeRepository.findBy({
|
|
46
|
+
id: (0, typeorm_1.In)(privilegeIds)
|
|
47
|
+
});
|
|
46
48
|
}
|
|
47
49
|
role.domain = newDomain;
|
|
48
50
|
return await roleRepository.save(role);
|
|
@@ -79,6 +81,7 @@ let DomainGeneratorMutation = class DomainGeneratorMutation {
|
|
|
79
81
|
};
|
|
80
82
|
tslib_1.__decorate([
|
|
81
83
|
(0, type_graphql_1.Directive)('@privilege(category: "system", privilege: "mutation", superUserGranted: true)'),
|
|
84
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
82
85
|
(0, type_graphql_1.Mutation)(returns => shell_1.Domain),
|
|
83
86
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('domainInput')),
|
|
84
87
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-generator-mutation.js","sourceRoot":"","sources":["../../../server/service/domain-generator/domain-generator-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAAwC;AAExC,iDAA6D;AAC7D,iDAA+C;AAE/C,sDAAkD;AAClD,uCAAmC;AACnC,uCAAmC;AACnC,qEAAoF;AAGpF,IAAa,uBAAuB,GAApC,MAAa,uBAAuB;
|
|
1
|
+
{"version":3,"file":"domain-generator-mutation.js","sourceRoot":"","sources":["../../../server/service/domain-generator/domain-generator-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAAwC;AAExC,iDAA6D;AAC7D,iDAA+C;AAE/C,sDAAkD;AAClD,uCAAmC;AACnC,uCAAmC;AACnC,qEAAoF;AAGpF,IAAa,uBAAuB,GAApC,MAAa,uBAAuB;IAIlC,KAAK,CAAC,cAAc,CACE,WAAiC,EAC9C,OAAwB;QAE/B,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAC9B,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,WAAW,CAAA;QACzC,MAAM,UAAU,GAAuB,IAAA,qBAAa,EAAC,cAAM,CAAC,CAAA;QAC5D,MAAM,SAAS,GAAW,IAAA,eAAO,EAAC,IAAI,CAAC,CAAA;QAEvC,MAAM,MAAM,GAAW,MAAM,UAAU,CAAC,SAAS,CAA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,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,cAAM,CAAC;IAEzB,mBAAA,IAAA,kBAAG,EAAC,eAAe,CAAC,CAAA;IACpB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAD+B,4CAAmB;;qEA0EzD;AAlGU,uBAAuB;IADnC,IAAA,uBAAQ,GAAE;GACE,uBAAuB,CAmGnC;AAnGY,0DAAuB;AAqGpC,SAAS,eAAe,CAAC,SAAiB,EAAE,QAAgB;IAC1D,MAAM,aAAa,GAAa,SAAS,CAAC,GAAG,CAAC,CAAC,CAAO,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IAClE,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAO,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;AACzE,CAAC","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In, Repository } from 'typeorm'\n\nimport { Domain, getRepository } from '@things-factory/shell'\nimport { slugger } from '@things-factory/utils'\n\nimport { Privilege } from '../privilege/privilege'\nimport { Role } from '../role/role'\nimport { User } from '../user/user'\nimport { DomainGeneratorInput, DomainUserRoleInput } from './domain-generator-types'\n\n@Resolver()\nexport class DomainGeneratorMutation {\n @Directive('@privilege(category: \"system\", privilege: \"mutation\", superUserGranted: true)')\n @Directive('@transaction')\n @Mutation(returns => Domain)\n async domainRegister(\n @Arg('domainInput') domainInput: DomainGeneratorInput,\n @Ctx() context: ResolverContext\n ): Promise<Domain> {\n const { user } = context.state\n const { name, description } = domainInput\n const domainRepo: Repository<Domain> = getRepository(Domain)\n const subdomain: string = slugger(name)\n\n const domain: Domain = await domainRepo.findOneBy({ subdomain })\n if (domain) {\n throw new Error('domain is duplicated')\n }\n\n return await domainRepo.save({ name, description, subdomain, owner: user.id })\n }\n\n @Directive('@transaction')\n @Mutation(returns => Domain)\n async domainUserRoleRegister(\n @Arg('newDomainInfo') newDomainInfo: DomainUserRoleInput,\n @Ctx() context: ResolverContext\n ): Promise<Domain> {\n const { tx } = context.state\n // 도메인 생성\n const { domain, users, roles } = newDomainInfo\n const domainOwner = users.find(user => user.owner === true)\n\n const domainRepository: Repository<Domain> = tx.getRepository(Domain)\n const roleRepository: Repository<Role> = tx.getRepository(Role)\n const userRepository: Repository<User> = tx.getRepository(User)\n const privilegeRepository: Repository<Privilege> = tx.getRepository(Privilege)\n\n const subdomain: string = slugger(domain.name)\n\n const newDomain = await domainRepository.save({\n name: domain.name,\n description: domain.description,\n subdomain\n })\n\n // 역할 생성\n const newRoles: Role[] = await Promise.all(\n roles.map(async (role: Role) => {\n if (role.privileges?.length) {\n const privilegeIds: string[] = role.privileges.map((p: Privilege) => p.id)\n role.privileges = await privilegeRepository.findBy({\n id: In(privilegeIds)\n })\n }\n\n role.domain = newDomain\n return await roleRepository.save(role)\n })\n )\n\n // 사용자 생성\n let inviteUsers = []\n let createUsers = []\n users.forEach(user => (user.isInvitee ? inviteUsers.push(user) : createUsers.push(user)))\n\n // create user\n await Promise.all(\n createUsers.map(async user => {\n user.domains = [newDomain]\n user.password = User.encode(user.password, user.salt)\n user.salt = User.generateSalt()\n user.passwordUpdatedAt = new Date()\n user.userType = 'user'\n user.roles = filterUserRoles(user.roles, newRoles)\n\n return await userRepository.save(user)\n })\n )\n\n // invite user\n await Promise.all(\n inviteUsers.map(async inviteUser => {\n const user: User = await userRepository.findOne({\n where: { email: inviteUser.email },\n relations: ['domains', 'roles']\n })\n\n user.domains = [...user.domains, newDomain]\n user.roles = [...user.roles, ...filterUserRoles(inviteUser.roles, newRoles)]\n\n return await userRepository.save(user)\n })\n )\n\n // domain owner\n const { id } = await userRepository.findOne({ where: { email: domainOwner.email } })\n newDomain.owner = id\n return await domainRepository.save(newDomain)\n }\n}\n\nfunction filterUserRoles(userRoles: Role[], newRoles: Role[]): Role[] {\n const userRoleNames: string[] = userRoles.map((r: Role) => r.name)\n return newRoles.filter((r: Role) => userRoleNames.indexOf(r.name) >= 0)\n}\n"]}
|
|
@@ -26,7 +26,9 @@ let GrantedRoleMutation = class GrantedRoleMutation {
|
|
|
26
26
|
await tx.getRepository(granted_role_1.GrantedRole).delete(grantedRoles.map((gr) => gr.id));
|
|
27
27
|
}
|
|
28
28
|
// Insert newly granted roles
|
|
29
|
-
await tx.getRepository(role_1.Role).findBy({
|
|
29
|
+
await tx.getRepository(role_1.Role).findBy({
|
|
30
|
+
id: (0, typeorm_1.In)(roles.map((role) => role.id))
|
|
31
|
+
});
|
|
30
32
|
const newlyGrantedRoles = roles.map((role) => {
|
|
31
33
|
return {
|
|
32
34
|
domain: customerDomain,
|