diff --git a/.vscode/settings.json b/.vscode/settings.json index 735e66f..7633af8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,21 +1,21 @@ ({ // Hide files that are rarely edited for better folder arrangement "files.exclude": { - "LICENSE": true, - "**/.DS_Store": true, - "**/.git": true, - "**/.webpack": true, - "**/build": true, - "**/dist": true, - "**/coverage": true, - "**/node_modules": true, + // "LICENSE": true, + // "**/.DS_Store": true, + // "**/.git": true, + // "**/.webpack": true, + // "**/build": true, + // "**/dist": true, + // "**/coverage": true, + // "**/node_modules": true, // "**.prettier*": true, // "**.travis*": true, // "**/lerna.json": true, // "**/.eslint*": true, // "**/.gitignore*": true, // "**/package-lock.json": true, - "**/yarn.lock": true + // "**/yarn.lock": true // "**/source-map-install.js": true, // "**/tsconfig.json": true, // "**/webpack.config.js": true diff --git a/src/api/Dockerfile b/src/api/Dockerfile deleted file mode 100644 index 3d47a37..0000000 --- a/src/api/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM node:alpine -RUN mkdir -p /app -WORKDIR /app -COPY . /app -RUN cd /app -RUN yarn install -RUN yarn build -EXPOSE 3000 -CMD ["node", "dist/index.js"] diff --git a/src/api/coverage/clover.xml b/src/api/coverage/clover.xml deleted file mode 100644 index f9fcf45..0000000 --- a/src/api/coverage/clover.xml +++ /dev/null @@ -1,966 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/api/coverage/coverage-final.json b/src/api/coverage/coverage-final.json deleted file mode 100644 index eed96cc..0000000 --- a/src/api/coverage/coverage-final.json +++ /dev/null @@ -1,64 +0,0 @@ -{"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/constants.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/constants.ts","statementMap":{"0":{"start":{"line":1,"column":13},"end":{"line":1,"column":null}},"1":{"start":{"line":2,"column":13},"end":{"line":2,"column":null}},"2":{"start":{"line":3,"column":13},"end":{"line":3,"column":null}}},"fnMap":{},"branchMap":{},"s":{"0":18,"1":18,"2":18},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/helpers/clone.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/helpers/clone.ts","statementMap":{"0":{"start":{"line":3,"column":13},"end":{"line":5,"column":null}},"1":{"start":{"line":4,"column":2},"end":{"line":4,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":3,"column":21},"end":{"line":3,"column":22}},"loc":{"start":{"line":3,"column":47},"end":{"line":5,"column":1}}}},"branchMap":{},"s":{"0":1,"1":4},"f":{"0":4},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/helpers/dayjs.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/helpers/dayjs.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}},"1":{"start":{"line":3,"column":13},"end":{"line":3,"column":null}}},"fnMap":{},"branchMap":{},"s":{"0":18,"1":18},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/helpers/firstError.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/helpers/firstError.ts","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":2,"column":61}},"1":{"start":{"line":4,"column":13},"end":{"line":7,"column":null}},"2":{"start":{"line":5,"column":26},"end":{"line":5,"column":60}},"3":{"start":{"line":6,"column":2},"end":{"line":6,"column":null}},"4":{"start":{"line":6,"column":23},"end":{"line":6,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":4,"column":26},"end":{"line":4,"column":27}},"loc":{"start":{"line":4,"column":62},"end":{"line":7,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":5,"column":26},"end":{"line":5,"column":35}},"type":"binary-expr","locations":[{"start":{"line":5,"column":26},"end":{"line":5,"column":35}},{"start":{"line":5,"column":39},"end":{"line":5,"column":60}}]},"1":{"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":null}},"type":"if","locations":[{"start":{"line":6,"column":2},"end":{"line":6,"column":null}},{"start":{"line":6,"column":2},"end":{"line":6,"column":null}}]}},"s":{"0":18,"1":18,"2":3,"3":3,"4":2},"f":{"0":3},"b":{"0":[3,2],"1":[2,1]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/helpers/typegoose.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/helpers/typegoose.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":82}},"1":{"start":{"line":3,"column":13},"end":{"line":3,"column":null}},"2":{"start":{"line":4,"column":13},"end":{"line":4,"column":null}},"3":{"start":{"line":5,"column":13},"end":{"line":5,"column":null}},"4":{"start":{"line":6,"column":13},"end":{"line":6,"column":null}}},"fnMap":{},"branchMap":{},"s":{"0":18,"1":18,"2":18,"3":18,"4":18},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/captcha/helpers/captchaSolutions.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/captcha/helpers/captchaSolutions.ts","statementMap":{"0":{"start":{"line":3,"column":13},"end":{"line":104,"column":null}}},"fnMap":{},"branchMap":{},"s":{"0":19},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/captcha/helpers/createCaptcha.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/captcha/helpers/createCaptcha.ts","statementMap":{"0":{"start":{"line":3,"column":0},"end":{"line":3,"column":71}},"1":{"start":{"line":6,"column":0},"end":{"line":6,"column":61}},"2":{"start":{"line":12,"column":13},"end":{"line":25,"column":null}},"3":{"start":{"line":13,"column":2},"end":{"line":13,"column":null}},"4":{"start":{"line":15,"column":35},"end":{"line":15,"column":57}},"5":{"start":{"line":17,"column":27},"end":{"line":22,"column":11}},"6":{"start":{"line":24,"column":2},"end":{"line":24,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":12,"column":44},"end":{"line":12,"column":49}},"loc":{"start":{"line":12,"column":73},"end":{"line":25,"column":1}}}},"branchMap":{},"s":{"0":18,"1":18,"2":18,"3":22,"4":22,"5":22,"6":22},"f":{"0":22},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/captcha/helpers/getRandomCaptchaPair.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/captcha/helpers/getRandomCaptchaPair.ts","statementMap":{"0":{"start":{"line":5,"column":0},"end":{"line":5,"column":53}},"1":{"start":{"line":11,"column":13},"end":{"line":20,"column":null}},"2":{"start":{"line":12,"column":31},"end":{"line":12,"column":62}},"3":{"start":{"line":13,"column":43},"end":{"line":13,"column":73}},"4":{"start":{"line":14,"column":35},"end":{"line":17,"column":null}},"5":{"start":{"line":19,"column":2},"end":{"line":19,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":11,"column":54},"end":{"line":11,"column":57}},"loc":{"start":{"line":11,"column":59},"end":{"line":20,"column":1}}}},"branchMap":{},"s":{"0":19,"1":19,"2":2,"3":2,"4":2,"5":2},"f":{"0":2},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/comment/addCommentView/addCommentView.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/comment/addCommentView/addCommentView.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":50}},"2":{"start":{"line":5,"column":0},"end":{"line":5,"column":67}},"3":{"start":{"line":6,"column":0},"end":{"line":6,"column":56}},"4":{"start":{"line":7,"column":0},"end":{"line":7,"column":77}},"5":{"start":{"line":8,"column":0},"end":{"line":8,"column":62}},"6":{"start":{"line":11,"column":13},"end":{"line":28,"column":null}},"7":{"start":{"line":12,"column":29},"end":{"line":12,"column":116}},"8":{"start":{"line":13,"column":2},"end":{"line":13,"column":null}},"9":{"start":{"line":14,"column":24},"end":{"line":14,"column":42}},"10":{"start":{"line":16,"column":40},"end":{"line":19,"column":10}},"11":{"start":{"line":21,"column":33},"end":{"line":21,"column":120}},"12":{"start":{"line":22,"column":2},"end":{"line":22,"column":null}},"13":{"start":{"line":22,"column":31},"end":{"line":22,"column":null}},"14":{"start":{"line":24,"column":2},"end":{"line":24,"column":null}},"15":{"start":{"line":25,"column":2},"end":{"line":25,"column":null}},"16":{"start":{"line":27,"column":2},"end":{"line":27,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":11,"column":30},"end":{"line":11,"column":35}},"loc":{"start":{"line":11,"column":80},"end":{"line":28,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":21,"column":33},"end":{"line":21,"column":51}},"type":"binary-expr","locations":[{"start":{"line":21,"column":33},"end":{"line":21,"column":51}},{"start":{"line":21,"column":55},"end":{"line":21,"column":83}},{"start":{"line":21,"column":87},"end":{"line":21,"column":120}}]},"1":{"loc":{"start":{"line":22,"column":2},"end":{"line":22,"column":null}},"type":"if","locations":[{"start":{"line":22,"column":2},"end":{"line":22,"column":null}},{"start":{"line":22,"column":2},"end":{"line":22,"column":null}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":2,"8":2,"9":2,"10":2,"11":2,"12":2,"13":1,"14":1,"15":1,"16":1},"f":{"0":2},"b":{"0":[2,2,1],"1":[1,1]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/comment/getComment/getComment.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/comment/getComment/getComment.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":50}},"2":{"start":{"line":5,"column":0},"end":{"line":5,"column":56}},"3":{"start":{"line":6,"column":0},"end":{"line":6,"column":71}},"4":{"start":{"line":7,"column":0},"end":{"line":7,"column":88}},"5":{"start":{"line":8,"column":0},"end":{"line":8,"column":67}},"6":{"start":{"line":10,"column":0},"end":{"line":10,"column":53}},"7":{"start":{"line":11,"column":0},"end":{"line":11,"column":83}},"8":{"start":{"line":13,"column":13},"end":{"line":35,"column":null}},"9":{"start":{"line":14,"column":25},"end":{"line":16,"column":4}},"10":{"start":{"line":17,"column":2},"end":{"line":17,"column":null}},"11":{"start":{"line":18,"column":24},"end":{"line":18,"column":38}},"12":{"start":{"line":20,"column":19},"end":{"line":20,"column":72}},"13":{"start":{"line":21,"column":2},"end":{"line":21,"column":null}},"14":{"start":{"line":21,"column":16},"end":{"line":21,"column":null}},"15":{"start":{"line":23,"column":28},"end":{"line":26,"column":10}},"16":{"start":{"line":27,"column":2},"end":{"line":27,"column":null}},"17":{"start":{"line":27,"column":13},"end":{"line":27,"column":null}},"18":{"start":{"line":29,"column":37},"end":{"line":29,"column":54}},"19":{"start":{"line":31,"column":2},"end":{"line":31,"column":null}},"20":{"start":{"line":32,"column":2},"end":{"line":32,"column":null}},"21":{"start":{"line":34,"column":2},"end":{"line":34,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":13,"column":26},"end":{"line":13,"column":31}},"loc":{"start":{"line":13,"column":76},"end":{"line":35,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":21,"column":2},"end":{"line":21,"column":null}},"type":"if","locations":[{"start":{"line":21,"column":2},"end":{"line":21,"column":null}},{"start":{"line":21,"column":2},"end":{"line":21,"column":null}}]},"1":{"loc":{"start":{"line":27,"column":2},"end":{"line":27,"column":null}},"type":"if","locations":[{"start":{"line":27,"column":2},"end":{"line":27,"column":null}},{"start":{"line":27,"column":2},"end":{"line":27,"column":null}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":3,"10":3,"11":3,"12":3,"13":3,"14":1,"15":2,"16":2,"17":1,"18":1,"19":1,"20":1,"21":1},"f":{"0":3},"b":{"0":[1,2],"1":[1,1]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/comment/getLatestComments/getLatestComments.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/comment/getLatestComments/getLatestComments.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":50}},"2":{"start":{"line":5,"column":0},"end":{"line":5,"column":56}},"3":{"start":{"line":6,"column":0},"end":{"line":6,"column":71}},"4":{"start":{"line":7,"column":0},"end":{"line":7,"column":109}},"5":{"start":{"line":9,"column":0},"end":{"line":9,"column":53}},"6":{"start":{"line":10,"column":0},"end":{"line":10,"column":83}},"7":{"start":{"line":12,"column":13},"end":{"line":39,"column":null}},"8":{"start":{"line":13,"column":32},"end":{"line":15,"column":4}},"9":{"start":{"line":16,"column":2},"end":{"line":16,"column":null}},"10":{"start":{"line":17,"column":23},"end":{"line":17,"column":44}},"11":{"start":{"line":19,"column":17},"end":{"line":19,"column":19}},"12":{"start":{"line":20,"column":2},"end":{"line":20,"column":null}},"13":{"start":{"line":20,"column":16},"end":{"line":20,"column":null}},"14":{"start":{"line":21,"column":28},"end":{"line":26,"column":11}},"15":{"start":{"line":27,"column":2},"end":{"line":27,"column":null}},"16":{"start":{"line":27,"column":42},"end":{"line":27,"column":null}},"17":{"start":{"line":29,"column":18},"end":{"line":29,"column":59}},"18":{"start":{"line":29,"column":44},"end":{"line":29,"column":58}},"19":{"start":{"line":30,"column":28},"end":{"line":30,"column":110}},"20":{"start":{"line":31,"column":2},"end":{"line":31,"column":null}},"21":{"start":{"line":31,"column":36},"end":{"line":31,"column":null}},"22":{"start":{"line":33,"column":45},"end":{"line":33,"column":64}},"23":{"start":{"line":35,"column":2},"end":{"line":35,"column":null}},"24":{"start":{"line":36,"column":2},"end":{"line":36,"column":null}},"25":{"start":{"line":38,"column":2},"end":{"line":38,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":12,"column":33},"end":{"line":12,"column":38}},"loc":{"start":{"line":12,"column":83},"end":{"line":39,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":29,"column":31},"end":{"line":29,"column":32}},"loc":{"start":{"line":29,"column":44},"end":{"line":29,"column":58}}}},"branchMap":{"0":{"loc":{"start":{"line":20,"column":2},"end":{"line":20,"column":null}},"type":"if","locations":[{"start":{"line":20,"column":2},"end":{"line":20,"column":null}},{"start":{"line":20,"column":2},"end":{"line":20,"column":null}}]},"1":{"loc":{"start":{"line":27,"column":2},"end":{"line":27,"column":null}},"type":"if","locations":[{"start":{"line":27,"column":2},"end":{"line":27,"column":null}},{"start":{"line":27,"column":2},"end":{"line":27,"column":null}}]},"2":{"loc":{"start":{"line":27,"column":6},"end":{"line":27,"column":15}},"type":"binary-expr","locations":[{"start":{"line":27,"column":6},"end":{"line":27,"column":15}},{"start":{"line":27,"column":19},"end":{"line":27,"column":40}}]},"3":{"loc":{"start":{"line":31,"column":2},"end":{"line":31,"column":null}},"type":"if","locations":[{"start":{"line":31,"column":2},"end":{"line":31,"column":null}},{"start":{"line":31,"column":2},"end":{"line":31,"column":null}}]},"4":{"loc":{"start":{"line":31,"column":6},"end":{"line":31,"column":12}},"type":"binary-expr","locations":[{"start":{"line":31,"column":6},"end":{"line":31,"column":12}},{"start":{"line":31,"column":16},"end":{"line":31,"column":34}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":2,"9":2,"10":2,"11":2,"12":2,"13":1,"14":2,"15":2,"16":1,"17":2,"18":2,"19":2,"20":2,"21":1,"22":2,"23":2,"24":2,"25":2},"f":{"0":2,"1":2},"b":{"0":[1,1],"1":[1,1],"2":[2,2],"3":[1,1],"4":[2,2]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/comment/newComment/newComment.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/comment/newComment/newComment.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":50}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":38}},"3":{"start":{"line":6,"column":0},"end":{"line":6,"column":56}},"4":{"start":{"line":7,"column":0},"end":{"line":7,"column":71}},"5":{"start":{"line":10,"column":0},"end":{"line":10,"column":53}},"6":{"start":{"line":11,"column":0},"end":{"line":11,"column":66}},"7":{"start":{"line":12,"column":0},"end":{"line":12,"column":59}},"8":{"start":{"line":13,"column":0},"end":{"line":13,"column":62}},"9":{"start":{"line":14,"column":0},"end":{"line":14,"column":88}},"10":{"start":{"line":16,"column":13},"end":{"line":56,"column":null}},"11":{"start":{"line":17,"column":25},"end":{"line":17,"column":108}},"12":{"start":{"line":18,"column":2},"end":{"line":18,"column":null}},"13":{"start":{"line":19,"column":59},"end":{"line":19,"column":73}},"14":{"start":{"line":21,"column":21},"end":{"line":21,"column":44}},"15":{"start":{"line":23,"column":2},"end":{"line":23,"column":null}},"16":{"start":{"line":25,"column":28},"end":{"line":34,"column":11}},"17":{"start":{"line":36,"column":2},"end":{"line":40,"column":null}},"18":{"start":{"line":42,"column":33},"end":{"line":48,"column":null}},"19":{"start":{"line":50,"column":37},"end":{"line":50,"column":66}},"20":{"start":{"line":52,"column":2},"end":{"line":52,"column":null}},"21":{"start":{"line":53,"column":2},"end":{"line":53,"column":null}},"22":{"start":{"line":55,"column":2},"end":{"line":55,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":16,"column":26},"end":{"line":16,"column":31}},"loc":{"start":{"line":16,"column":76},"end":{"line":56,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":28,"column":18},"end":{"line":28,"column":32}},"type":"cond-expr","locations":[{"start":{"line":28,"column":18},"end":{"line":28,"column":32}},{"start":{"line":28,"column":35},"end":{"line":28,"column":44}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":2,"12":2,"13":2,"14":2,"15":2,"16":2,"17":2,"18":2,"19":2,"20":2,"21":2,"22":2},"f":{"0":2},"b":{"0":[1,1]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/notification/getLatestNotifications/getLatestNotifications.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/notification/getLatestNotifications/getLatestNotifications.ts","statementMap":{"0":{"start":{"line":3,"column":0},"end":{"line":3,"column":91}},"1":{"start":{"line":5,"column":0},"end":{"line":5,"column":62}},"2":{"start":{"line":7,"column":13},"end":{"line":21,"column":null}},"3":{"start":{"line":8,"column":21},"end":{"line":8,"column":44}},"4":{"start":{"line":10,"column":40},"end":{"line":15,"column":11}},"5":{"start":{"line":17,"column":2},"end":{"line":17,"column":null}},"6":{"start":{"line":18,"column":2},"end":{"line":18,"column":null}},"7":{"start":{"line":20,"column":2},"end":{"line":20,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":7,"column":38},"end":{"line":7,"column":43}},"loc":{"start":{"line":7,"column":88},"end":{"line":21,"column":1}}}},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1},"f":{"0":1},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/quota/rateLimit/rateLimit.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/quota/rateLimit/rateLimit.ts","statementMap":{"0":{"start":{"line":3,"column":0},"end":{"line":3,"column":67}},"1":{"start":{"line":4,"column":0},"end":{"line":4,"column":63}},"2":{"start":{"line":5,"column":0},"end":{"line":5,"column":41}},"3":{"start":{"line":6,"column":0},"end":{"line":6,"column":59}},"4":{"start":{"line":12,"column":13},"end":{"line":25,"column":null}},"5":{"start":{"line":13,"column":2},"end":{"line":13,"column":43}},"6":{"start":{"line":13,"column":37},"end":{"line":13,"column":43}},"7":{"start":{"line":15,"column":36},"end":{"line":21,"column":10}},"8":{"start":{"line":23,"column":2},"end":{"line":24,"column":null}},"9":{"start":{"line":24,"column":4},"end":{"line":24,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":12,"column":36},"end":{"line":12,"column":41}},"loc":{"start":{"line":12,"column":53},"end":{"line":25,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":13,"column":2},"end":{"line":13,"column":43}},"type":"if","locations":[{"start":{"line":13,"column":2},"end":{"line":13,"column":43}},{"start":{"line":13,"column":2},"end":{"line":13,"column":43}}]},"1":{"loc":{"start":{"line":23,"column":2},"end":{"line":24,"column":null}},"type":"if","locations":[{"start":{"line":23,"column":2},"end":{"line":24,"column":null}},{"start":{"line":23,"column":2},"end":{"line":24,"column":null}}]},"2":{"loc":{"start":{"line":23,"column":6},"end":{"line":23,"column":17}},"type":"binary-expr","locations":[{"start":{"line":23,"column":6},"end":{"line":23,"column":17}},{"start":{"line":23,"column":21},"end":{"line":23,"column":38}},{"start":{"line":23,"column":42},"end":{"line":23,"column":65}}]}},"s":{"0":9,"1":9,"2":9,"3":9,"4":9,"5":52,"6":21,"7":31,"8":31,"9":1},"f":{"0":52},"b":{"0":[21,31],"1":[1,30],"2":[31,30,30]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/changePassword/changePassword.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/changePassword/changePassword.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":48}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":50}},"3":{"start":{"line":6,"column":0},"end":{"line":6,"column":56}},"4":{"start":{"line":7,"column":0},"end":{"line":7,"column":74}},"5":{"start":{"line":8,"column":0},"end":{"line":8,"column":59}},"6":{"start":{"line":9,"column":0},"end":{"line":9,"column":54}},"7":{"start":{"line":10,"column":0},"end":{"line":10,"column":56}},"8":{"start":{"line":11,"column":0},"end":{"line":11,"column":59}},"9":{"start":{"line":13,"column":13},"end":{"line":33,"column":null}},"10":{"start":{"line":14,"column":29},"end":{"line":16,"column":4}},"11":{"start":{"line":17,"column":2},"end":{"line":17,"column":null}},"12":{"start":{"line":18,"column":36},"end":{"line":18,"column":54}},"13":{"start":{"line":20,"column":21},"end":{"line":20,"column":44}},"14":{"start":{"line":22,"column":2},"end":{"line":22,"column":null}},"15":{"start":{"line":24,"column":2},"end":{"line":24,"column":null}},"16":{"start":{"line":26,"column":25},"end":{"line":26,"column":52}},"17":{"start":{"line":27,"column":2},"end":{"line":27,"column":null}},"18":{"start":{"line":29,"column":2},"end":{"line":29,"column":null}},"19":{"start":{"line":30,"column":2},"end":{"line":30,"column":null}},"20":{"start":{"line":32,"column":2},"end":{"line":32,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":13,"column":30},"end":{"line":13,"column":35}},"loc":{"start":{"line":13,"column":80},"end":{"line":33,"column":1}}}},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":2,"11":2,"12":2,"13":2,"14":2,"15":2,"16":1,"17":1,"18":1,"19":1,"20":1},"f":{"0":2},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/forgotPassword/forgotPassword.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/forgotPassword/forgotPassword.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":50}},"2":{"start":{"line":5,"column":0},"end":{"line":5,"column":56}},"3":{"start":{"line":7,"column":0},"end":{"line":7,"column":63}},"4":{"start":{"line":8,"column":0},"end":{"line":8,"column":67}},"5":{"start":{"line":9,"column":0},"end":{"line":9,"column":74}},"6":{"start":{"line":10,"column":0},"end":{"line":10,"column":59}},"7":{"start":{"line":11,"column":0},"end":{"line":11,"column":67}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":76}},"9":{"start":{"line":13,"column":0},"end":{"line":13,"column":70}},"10":{"start":{"line":14,"column":0},"end":{"line":14,"column":59}},"11":{"start":{"line":16,"column":13},"end":{"line":39,"column":null}},"12":{"start":{"line":17,"column":29},"end":{"line":17,"column":116}},"13":{"start":{"line":18,"column":2},"end":{"line":18,"column":null}},"14":{"start":{"line":19,"column":46},"end":{"line":19,"column":64}},"15":{"start":{"line":21,"column":2},"end":{"line":21,"column":null}},"16":{"start":{"line":23,"column":26},"end":{"line":23,"column":84}},"17":{"start":{"line":24,"column":2},"end":{"line":26,"column":null}},"18":{"start":{"line":25,"column":4},"end":{"line":25,"column":null}},"19":{"start":{"line":27,"column":2},"end":{"line":27,"column":null}},"20":{"start":{"line":27,"column":13},"end":{"line":27,"column":null}},"21":{"start":{"line":29,"column":2},"end":{"line":29,"column":null}},"22":{"start":{"line":31,"column":27},"end":{"line":31,"column":95}},"23":{"start":{"line":33,"column":2},"end":{"line":33,"column":null}},"24":{"start":{"line":35,"column":2},"end":{"line":35,"column":null}},"25":{"start":{"line":36,"column":2},"end":{"line":36,"column":null}},"26":{"start":{"line":38,"column":2},"end":{"line":38,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":16,"column":30},"end":{"line":16,"column":35}},"loc":{"start":{"line":16,"column":80},"end":{"line":39,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":24,"column":2},"end":{"line":26,"column":null}},"type":"if","locations":[{"start":{"line":24,"column":2},"end":{"line":26,"column":null}},{"start":{"line":24,"column":2},"end":{"line":26,"column":null}}]},"1":{"loc":{"start":{"line":27,"column":2},"end":{"line":27,"column":null}},"type":"if","locations":[{"start":{"line":27,"column":2},"end":{"line":27,"column":null}},{"start":{"line":27,"column":2},"end":{"line":27,"column":null}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":3,"13":3,"14":3,"15":3,"16":3,"17":3,"18":2,"19":3,"20":1,"21":2,"22":2,"23":2,"24":2,"25":2,"26":2},"f":{"0":3},"b":{"0":[2,1],"1":[1,2]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/getPublicUser/getPublicUser.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/getPublicUser/getPublicUser.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":50}},"2":{"start":{"line":5,"column":0},"end":{"line":5,"column":56}},"3":{"start":{"line":6,"column":0},"end":{"line":6,"column":67}},"4":{"start":{"line":7,"column":0},"end":{"line":7,"column":94}},"5":{"start":{"line":9,"column":0},"end":{"line":9,"column":53}},"6":{"start":{"line":11,"column":13},"end":{"line":11,"column":null}},"7":{"start":{"line":13,"column":13},"end":{"line":27,"column":null}},"8":{"start":{"line":14,"column":28},"end":{"line":14,"column":114}},"9":{"start":{"line":15,"column":2},"end":{"line":15,"column":null}},"10":{"start":{"line":16,"column":21},"end":{"line":16,"column":38}},"11":{"start":{"line":18,"column":28},"end":{"line":18,"column":103}},"12":{"start":{"line":19,"column":2},"end":{"line":19,"column":null}},"13":{"start":{"line":19,"column":13},"end":{"line":19,"column":null}},"14":{"start":{"line":21,"column":41},"end":{"line":21,"column":49}},"15":{"start":{"line":23,"column":2},"end":{"line":23,"column":null}},"16":{"start":{"line":24,"column":2},"end":{"line":24,"column":null}},"17":{"start":{"line":26,"column":2},"end":{"line":26,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":13,"column":29},"end":{"line":13,"column":34}},"loc":{"start":{"line":13,"column":79},"end":{"line":27,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":19,"column":2},"end":{"line":19,"column":null}},"type":"if","locations":[{"start":{"line":19,"column":2},"end":{"line":19,"column":null}},{"start":{"line":19,"column":2},"end":{"line":19,"column":null}}]}},"s":{"0":3,"1":3,"2":3,"3":3,"4":3,"5":3,"6":3,"7":3,"8":2,"9":2,"10":2,"11":2,"12":2,"13":1,"14":1,"15":1,"16":1,"17":1},"f":{"0":2},"b":{"0":[1,1]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/authenticate.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/authenticate.ts","statementMap":{"0":{"start":{"line":3,"column":0},"end":{"line":3,"column":67}},"1":{"start":{"line":6,"column":0},"end":{"line":6,"column":59}},"2":{"start":{"line":7,"column":0},"end":{"line":7,"column":51}},"3":{"start":{"line":13,"column":13},"end":{"line":25,"column":null}},"4":{"start":{"line":14,"column":22},"end":{"line":14,"column":89}},"5":{"start":{"line":15,"column":2},"end":{"line":15,"column":null}},"6":{"start":{"line":15,"column":20},"end":{"line":15,"column":null}},"7":{"start":{"line":17,"column":19},"end":{"line":17,"column":53}},"8":{"start":{"line":19,"column":33},"end":{"line":19,"column":53}},"9":{"start":{"line":21,"column":22},"end":{"line":21,"column":77}},"10":{"start":{"line":22,"column":2},"end":{"line":22,"column":null}},"11":{"start":{"line":22,"column":13},"end":{"line":22,"column":null}},"12":{"start":{"line":24,"column":2},"end":{"line":24,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":13,"column":42},"end":{"line":13,"column":47}},"loc":{"start":{"line":13,"column":56},"end":{"line":25,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":14,"column":44},"end":{"line":14,"column":77}},"type":"cond-expr","locations":[{"start":{"line":14,"column":44},"end":{"line":14,"column":77}},{"start":{"line":14,"column":80},"end":{"line":14,"column":89}}]},"1":{"loc":{"start":{"line":15,"column":2},"end":{"line":15,"column":null}},"type":"if","locations":[{"start":{"line":15,"column":2},"end":{"line":15,"column":null}},{"start":{"line":15,"column":2},"end":{"line":15,"column":null}}]},"2":{"loc":{"start":{"line":22,"column":2},"end":{"line":22,"column":null}},"type":"if","locations":[{"start":{"line":22,"column":2},"end":{"line":22,"column":null}},{"start":{"line":22,"column":2},"end":{"line":22,"column":null}}]}},"s":{"0":7,"1":7,"2":7,"3":7,"4":20,"5":20,"6":1,"7":19,"8":19,"9":18,"10":18,"11":1,"12":17},"f":{"0":20},"b":{"0":[19,1],"1":[1,19],"2":[1,17]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/getSignedJwt.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/getSignedJwt.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":44}},"2":{"start":{"line":13,"column":13},"end":{"line":34,"column":null}},"3":{"start":{"line":14,"column":26},"end":{"line":14,"column":57}},"4":{"start":{"line":16,"column":30},"end":{"line":21,"column":null}},"5":{"start":{"line":23,"column":35},"end":{"line":29,"column":null}},"6":{"start":{"line":31,"column":19},"end":{"line":31,"column":97}},"7":{"start":{"line":33,"column":2},"end":{"line":33,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":13,"column":42},"end":{"line":13,"column":43}},"loc":{"start":{"line":13,"column":70},"end":{"line":34,"column":1}}}},"branchMap":{},"s":{"0":19,"1":19,"2":19,"3":22,"4":22,"5":22,"6":22,"7":22},"f":{"0":22},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/matchPassword.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/matchPassword.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}},"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":67}},"2":{"start":{"line":9,"column":13},"end":{"line":12,"column":null}},"3":{"start":{"line":10,"column":27},"end":{"line":10,"column":74}},"4":{"start":{"line":11,"column":2},"end":{"line":11,"column":null}},"5":{"start":{"line":11,"column":16},"end":{"line":11,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":9,"column":44},"end":{"line":9,"column":49}},"loc":{"start":{"line":9,"column":87},"end":{"line":12,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":11,"column":2},"end":{"line":11,"column":null}},"type":"if","locations":[{"start":{"line":11,"column":2},"end":{"line":11,"column":null}},{"start":{"line":11,"column":2},"end":{"line":11,"column":null}}]}},"s":{"0":3,"1":3,"2":3,"3":7,"4":7,"5":3},"f":{"0":7},"b":{"0":[3,4]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/sendEmailForgotPassword.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/sendEmailForgotPassword.ts","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":2,"column":42}},"1":{"start":{"line":8,"column":13},"end":{"line":20,"column":null}},"2":{"start":{"line":9,"column":2},"end":{"line":9,"column":null}},"3":{"start":{"line":11,"column":36},"end":{"line":17,"column":null}},"4":{"start":{"line":19,"column":2},"end":{"line":19,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":8,"column":64},"end":{"line":8,"column":69}},"loc":{"start":{"line":8,"column":101},"end":{"line":20,"column":1}}}},"branchMap":{},"s":{"0":2,"1":2,"2":1,"3":1,"4":1},"f":{"0":1},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/sendEmailVerifyEmail.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/sendEmailVerifyEmail.ts","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":2,"column":42}},"1":{"start":{"line":8,"column":13},"end":{"line":20,"column":null}},"2":{"start":{"line":9,"column":2},"end":{"line":9,"column":null}},"3":{"start":{"line":11,"column":36},"end":{"line":17,"column":null}},"4":{"start":{"line":19,"column":2},"end":{"line":19,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":8,"column":58},"end":{"line":8,"column":63}},"loc":{"start":{"line":8,"column":88},"end":{"line":20,"column":1}}}},"branchMap":{},"s":{"0":18,"1":18,"2":1,"3":1,"4":1},"f":{"0":1},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/verifyCaptcha.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/verifyCaptcha.ts","statementMap":{"0":{"start":{"line":3,"column":0},"end":{"line":3,"column":71}},"1":{"start":{"line":5,"column":0},"end":{"line":5,"column":67}},"2":{"start":{"line":11,"column":13},"end":{"line":24,"column":null}},"3":{"start":{"line":12,"column":28},"end":{"line":12,"column":85}},"4":{"start":{"line":14,"column":2},"end":{"line":14,"column":null}},"5":{"start":{"line":14,"column":16},"end":{"line":14,"column":null}},"6":{"start":{"line":16,"column":2},"end":{"line":17,"column":null}},"7":{"start":{"line":17,"column":4},"end":{"line":17,"column":null}},"8":{"start":{"line":19,"column":2},"end":{"line":19,"column":51}},"9":{"start":{"line":19,"column":45},"end":{"line":19,"column":51}},"10":{"start":{"line":21,"column":2},"end":{"line":21,"column":null}},"11":{"start":{"line":23,"column":2},"end":{"line":23,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":11,"column":44},"end":{"line":11,"column":49}},"loc":{"start":{"line":11,"column":91},"end":{"line":24,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":14,"column":2},"end":{"line":14,"column":null}},"type":"if","locations":[{"start":{"line":14,"column":2},"end":{"line":14,"column":null}},{"start":{"line":14,"column":2},"end":{"line":14,"column":null}}]},"1":{"loc":{"start":{"line":16,"column":2},"end":{"line":17,"column":null}},"type":"if","locations":[{"start":{"line":16,"column":2},"end":{"line":17,"column":null}},{"start":{"line":16,"column":2},"end":{"line":17,"column":null}}]},"2":{"loc":{"start":{"line":16,"column":6},"end":{"line":16,"column":22}},"type":"binary-expr","locations":[{"start":{"line":16,"column":6},"end":{"line":16,"column":22}},{"start":{"line":16,"column":26},"end":{"line":16,"column":47}}]},"3":{"loc":{"start":{"line":19,"column":2},"end":{"line":19,"column":51}},"type":"if","locations":[{"start":{"line":19,"column":2},"end":{"line":19,"column":51}},{"start":{"line":19,"column":2},"end":{"line":19,"column":51}}]}},"s":{"0":3,"1":3,"2":3,"3":8,"4":8,"5":1,"6":7,"7":1,"8":6,"9":3,"10":3,"11":3},"f":{"0":8},"b":{"0":[1,7],"1":[1,6],"2":[7,3],"3":[3,3]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/verifyRecaptchaToken.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/verifyRecaptchaToken.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}},"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":54}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":67}},"3":{"start":{"line":10,"column":13},"end":{"line":24,"column":null}},"4":{"start":{"line":11,"column":2},"end":{"line":11,"column":83}},"5":{"start":{"line":11,"column":77},"end":{"line":11,"column":83}},"6":{"start":{"line":13,"column":19},"end":{"line":21,"column":4}},"7":{"start":{"line":23,"column":2},"end":{"line":23,"column":null}},"8":{"start":{"line":23,"column":61},"end":{"line":23,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":10,"column":58},"end":{"line":10,"column":63}},"loc":{"start":{"line":10,"column":83},"end":{"line":24,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":11,"column":2},"end":{"line":11,"column":83}},"type":"if","locations":[{"start":{"line":11,"column":2},"end":{"line":11,"column":83}},{"start":{"line":11,"column":2},"end":{"line":11,"column":83}}]},"1":{"loc":{"start":{"line":11,"column":6},"end":{"line":11,"column":42}},"type":"binary-expr","locations":[{"start":{"line":11,"column":6},"end":{"line":11,"column":42}},{"start":{"line":11,"column":46},"end":{"line":11,"column":75}}]},"2":{"loc":{"start":{"line":23,"column":2},"end":{"line":23,"column":null}},"type":"if","locations":[{"start":{"line":23,"column":2},"end":{"line":23,"column":null}},{"start":{"line":23,"column":2},"end":{"line":23,"column":null}}]},"3":{"loc":{"start":{"line":23,"column":8},"end":{"line":23,"column":16}},"type":"binary-expr","locations":[{"start":{"line":23,"column":8},"end":{"line":23,"column":16}},{"start":{"line":23,"column":20},"end":{"line":23,"column":33}},{"start":{"line":23,"column":37},"end":{"line":23,"column":58}}]}},"s":{"0":18,"1":18,"2":18,"3":18,"4":24,"5":22,"6":2,"7":2,"8":1},"f":{"0":24},"b":{"0":[22,2],"1":[24,23],"2":[1,1],"3":[2,2,2]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/verifySignedJwt.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/verifySignedJwt.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}},"1":{"start":{"line":12,"column":13},"end":{"line":30,"column":null}},"2":{"start":{"line":13,"column":33},"end":{"line":13,"column":71}},"3":{"start":{"line":15,"column":24},"end":{"line":21,"column":null}},"4":{"start":{"line":23,"column":33},"end":{"line":26,"column":null}},"5":{"start":{"line":29,"column":2},"end":{"line":29,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":12,"column":48},"end":{"line":12,"column":49}},"loc":{"start":{"line":12,"column":56},"end":{"line":30,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":17,"column":26},"end":{"line":17,"column":45}},"type":"cond-expr","locations":[{"start":{"line":17,"column":26},"end":{"line":17,"column":45}},{"start":{"line":17,"column":48},"end":{"line":17,"column":57}}]}},"s":{"0":8,"1":8,"2":21,"3":21,"4":21,"5":19},"f":{"0":21},"b":{"0":[20,1]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/login/login.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/login/login.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":50}},"2":{"start":{"line":5,"column":0},"end":{"line":5,"column":56}},"3":{"start":{"line":6,"column":0},"end":{"line":6,"column":67}},"4":{"start":{"line":7,"column":0},"end":{"line":7,"column":70}},"5":{"start":{"line":8,"column":0},"end":{"line":8,"column":59}},"6":{"start":{"line":9,"column":0},"end":{"line":9,"column":54}},"7":{"start":{"line":10,"column":0},"end":{"line":10,"column":56}},"8":{"start":{"line":11,"column":0},"end":{"line":11,"column":70}},"9":{"start":{"line":12,"column":0},"end":{"line":12,"column":59}},"10":{"start":{"line":15,"column":13},"end":{"line":42,"column":null}},"11":{"start":{"line":16,"column":20},"end":{"line":16,"column":98}},"12":{"start":{"line":17,"column":2},"end":{"line":17,"column":null}},"13":{"start":{"line":18,"column":54},"end":{"line":18,"column":63}},"14":{"start":{"line":20,"column":2},"end":{"line":20,"column":null}},"15":{"start":{"line":22,"column":2},"end":{"line":22,"column":null}},"16":{"start":{"line":24,"column":26},"end":{"line":24,"column":84}},"17":{"start":{"line":25,"column":2},"end":{"line":27,"column":null}},"18":{"start":{"line":26,"column":4},"end":{"line":26,"column":null}},"19":{"start":{"line":28,"column":2},"end":{"line":28,"column":null}},"20":{"start":{"line":28,"column":13},"end":{"line":28,"column":null}},"21":{"start":{"line":30,"column":2},"end":{"line":30,"column":null}},"22":{"start":{"line":32,"column":2},"end":{"line":32,"column":null}},"23":{"start":{"line":34,"column":19},"end":{"line":34,"column":70}},"24":{"start":{"line":36,"column":33},"end":{"line":36,"column":40}},"25":{"start":{"line":38,"column":2},"end":{"line":38,"column":null}},"26":{"start":{"line":39,"column":2},"end":{"line":39,"column":null}},"27":{"start":{"line":41,"column":2},"end":{"line":41,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":15,"column":21},"end":{"line":15,"column":26}},"loc":{"start":{"line":15,"column":71},"end":{"line":42,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":25,"column":2},"end":{"line":27,"column":null}},"type":"if","locations":[{"start":{"line":25,"column":2},"end":{"line":27,"column":null}},{"start":{"line":25,"column":2},"end":{"line":27,"column":null}}]},"1":{"loc":{"start":{"line":28,"column":2},"end":{"line":28,"column":null}},"type":"if","locations":[{"start":{"line":28,"column":2},"end":{"line":28,"column":null}},{"start":{"line":28,"column":2},"end":{"line":28,"column":null}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":4,"12":4,"13":4,"14":4,"15":4,"16":4,"17":4,"18":2,"19":4,"20":1,"21":3,"22":3,"23":2,"24":2,"25":2,"26":2,"27":2},"f":{"0":4},"b":{"0":[2,2],"1":[1,3]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/resendEmailVerification/resendEmailVerification.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/resendEmailVerification/resendEmailVerification.ts","statementMap":{"0":{"start":{"line":3,"column":0},"end":{"line":3,"column":71}},"1":{"start":{"line":4,"column":0},"end":{"line":4,"column":63}},"2":{"start":{"line":6,"column":0},"end":{"line":6,"column":67}},"3":{"start":{"line":7,"column":0},"end":{"line":7,"column":54}},"4":{"start":{"line":8,"column":0},"end":{"line":8,"column":70}},"5":{"start":{"line":9,"column":0},"end":{"line":9,"column":59}},"6":{"start":{"line":11,"column":13},"end":{"line":29,"column":null}},"7":{"start":{"line":12,"column":21},"end":{"line":12,"column":44}},"8":{"start":{"line":14,"column":2},"end":{"line":14,"column":null}},"9":{"start":{"line":16,"column":32},"end":{"line":19,"column":11}},"10":{"start":{"line":21,"column":2},"end":{"line":21,"column":null}},"11":{"start":{"line":21,"column":16},"end":{"line":21,"column":null}},"12":{"start":{"line":23,"column":2},"end":{"line":23,"column":null}},"13":{"start":{"line":25,"column":2},"end":{"line":25,"column":null}},"14":{"start":{"line":26,"column":2},"end":{"line":26,"column":null}},"15":{"start":{"line":28,"column":2},"end":{"line":28,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":11,"column":39},"end":{"line":11,"column":44}},"loc":{"start":{"line":11,"column":89},"end":{"line":29,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":21,"column":2},"end":{"line":21,"column":null}},"type":"if","locations":[{"start":{"line":21,"column":2},"end":{"line":21,"column":null}},{"start":{"line":21,"column":2},"end":{"line":21,"column":null}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":2,"8":2,"9":2,"10":2,"11":1,"12":2,"13":2,"14":2,"15":2},"f":{"0":2},"b":{"0":[1,1]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/resetPassword/resetPassword.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/resetPassword/resetPassword.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":48}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":50}},"3":{"start":{"line":6,"column":0},"end":{"line":6,"column":56}},"4":{"start":{"line":7,"column":0},"end":{"line":7,"column":71}},"5":{"start":{"line":8,"column":0},"end":{"line":8,"column":63}},"6":{"start":{"line":9,"column":0},"end":{"line":9,"column":67}},"7":{"start":{"line":10,"column":0},"end":{"line":10,"column":72}},"8":{"start":{"line":11,"column":0},"end":{"line":11,"column":59}},"9":{"start":{"line":12,"column":0},"end":{"line":12,"column":56}},"10":{"start":{"line":13,"column":0},"end":{"line":13,"column":59}},"11":{"start":{"line":15,"column":13},"end":{"line":43,"column":null}},"12":{"start":{"line":16,"column":28},"end":{"line":16,"column":114}},"13":{"start":{"line":17,"column":2},"end":{"line":17,"column":null}},"14":{"start":{"line":18,"column":43},"end":{"line":18,"column":60}},"15":{"start":{"line":20,"column":28},"end":{"line":23,"column":11}},"16":{"start":{"line":24,"column":2},"end":{"line":24,"column":null}},"17":{"start":{"line":24,"column":16},"end":{"line":24,"column":null}},"18":{"start":{"line":26,"column":22},"end":{"line":26,"column":77}},"19":{"start":{"line":27,"column":2},"end":{"line":27,"column":null}},"20":{"start":{"line":27,"column":13},"end":{"line":27,"column":null}},"21":{"start":{"line":29,"column":2},"end":{"line":29,"column":null}},"22":{"start":{"line":31,"column":2},"end":{"line":31,"column":null}},"23":{"start":{"line":33,"column":33},"end":{"line":33,"column":60}},"24":{"start":{"line":35,"column":2},"end":{"line":35,"column":null}},"25":{"start":{"line":37,"column":2},"end":{"line":37,"column":null}},"26":{"start":{"line":39,"column":2},"end":{"line":39,"column":null}},"27":{"start":{"line":40,"column":2},"end":{"line":40,"column":null}},"28":{"start":{"line":42,"column":2},"end":{"line":42,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":15,"column":29},"end":{"line":15,"column":34}},"loc":{"start":{"line":15,"column":79},"end":{"line":43,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":24,"column":2},"end":{"line":24,"column":null}},"type":"if","locations":[{"start":{"line":24,"column":2},"end":{"line":24,"column":null}},{"start":{"line":24,"column":2},"end":{"line":24,"column":null}}]},"1":{"loc":{"start":{"line":27,"column":2},"end":{"line":27,"column":null}},"type":"if","locations":[{"start":{"line":27,"column":2},"end":{"line":27,"column":null}},{"start":{"line":27,"column":2},"end":{"line":27,"column":null}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":3,"13":3,"14":3,"15":3,"16":3,"17":1,"18":2,"19":2,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1},"f":{"0":3},"b":{"0":[1,2],"1":[1,1]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/signUp/signUp.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/signUp/signUp.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":48}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":50}},"3":{"start":{"line":6,"column":0},"end":{"line":6,"column":56}},"4":{"start":{"line":8,"column":0},"end":{"line":8,"column":63}},"5":{"start":{"line":9,"column":0},"end":{"line":9,"column":67}},"6":{"start":{"line":11,"column":0},"end":{"line":11,"column":73}},"7":{"start":{"line":12,"column":0},"end":{"line":12,"column":59}},"8":{"start":{"line":13,"column":0},"end":{"line":13,"column":67}},"9":{"start":{"line":14,"column":0},"end":{"line":14,"column":54}},"10":{"start":{"line":15,"column":0},"end":{"line":15,"column":70}},"11":{"start":{"line":16,"column":0},"end":{"line":16,"column":70}},"12":{"start":{"line":18,"column":13},"end":{"line":49,"column":null}},"13":{"start":{"line":19,"column":21},"end":{"line":19,"column":100}},"14":{"start":{"line":20,"column":2},"end":{"line":20,"column":null}},"15":{"start":{"line":21,"column":54},"end":{"line":21,"column":64}},"16":{"start":{"line":23,"column":2},"end":{"line":23,"column":null}},"17":{"start":{"line":24,"column":2},"end":{"line":24,"column":null}},"18":{"start":{"line":26,"column":2},"end":{"line":26,"column":null}},"19":{"start":{"line":28,"column":41},"end":{"line":28,"column":82}},"20":{"start":{"line":29,"column":2},"end":{"line":29,"column":null}},"21":{"start":{"line":29,"column":25},"end":{"line":29,"column":null}},"22":{"start":{"line":31,"column":44},"end":{"line":31,"column":88}},"23":{"start":{"line":32,"column":2},"end":{"line":32,"column":null}},"24":{"start":{"line":32,"column":28},"end":{"line":32,"column":null}},"25":{"start":{"line":34,"column":25},"end":{"line":34,"column":49}},"26":{"start":{"line":35,"column":21},"end":{"line":35,"column":84}},"27":{"start":{"line":37,"column":19},"end":{"line":37,"column":70}},"28":{"start":{"line":39,"column":27},"end":{"line":39,"column":93}},"29":{"start":{"line":41,"column":2},"end":{"line":41,"column":null}},"30":{"start":{"line":43,"column":34},"end":{"line":43,"column":41}},"31":{"start":{"line":45,"column":2},"end":{"line":45,"column":null}},"32":{"start":{"line":46,"column":2},"end":{"line":46,"column":null}},"33":{"start":{"line":48,"column":2},"end":{"line":48,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":18,"column":22},"end":{"line":18,"column":27}},"loc":{"start":{"line":18,"column":72},"end":{"line":49,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":29,"column":2},"end":{"line":29,"column":null}},"type":"if","locations":[{"start":{"line":29,"column":2},"end":{"line":29,"column":null}},{"start":{"line":29,"column":2},"end":{"line":29,"column":null}}]},"1":{"loc":{"start":{"line":32,"column":2},"end":{"line":32,"column":null}},"type":"if","locations":[{"start":{"line":32,"column":2},"end":{"line":32,"column":null}},{"start":{"line":32,"column":2},"end":{"line":32,"column":null}}]}},"s":{"0":17,"1":17,"2":17,"3":17,"4":17,"5":17,"6":17,"7":17,"8":17,"9":17,"10":17,"11":17,"12":17,"13":21,"14":21,"15":20,"16":20,"17":20,"18":20,"19":20,"20":20,"21":1,"22":19,"23":19,"24":1,"25":18,"26":18,"27":18,"28":18,"29":18,"30":18,"31":18,"32":18,"33":18},"f":{"0":21},"b":{"0":[1,19],"1":[1,18]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/verifyEmail/verifyEmail.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/verifyEmail/verifyEmail.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":50}},"2":{"start":{"line":5,"column":0},"end":{"line":5,"column":56}},"3":{"start":{"line":6,"column":0},"end":{"line":6,"column":62}},"4":{"start":{"line":7,"column":0},"end":{"line":7,"column":63}},"5":{"start":{"line":8,"column":0},"end":{"line":8,"column":59}},"6":{"start":{"line":9,"column":0},"end":{"line":9,"column":68}},"7":{"start":{"line":10,"column":0},"end":{"line":10,"column":54}},"8":{"start":{"line":11,"column":0},"end":{"line":11,"column":56}},"9":{"start":{"line":12,"column":0},"end":{"line":12,"column":59}},"10":{"start":{"line":14,"column":13},"end":{"line":36,"column":null}},"11":{"start":{"line":15,"column":26},"end":{"line":15,"column":110}},"12":{"start":{"line":16,"column":2},"end":{"line":16,"column":null}},"13":{"start":{"line":17,"column":23},"end":{"line":17,"column":38}},"14":{"start":{"line":19,"column":21},"end":{"line":19,"column":44}},"15":{"start":{"line":21,"column":2},"end":{"line":21,"column":null}},"16":{"start":{"line":23,"column":2},"end":{"line":23,"column":null}},"17":{"start":{"line":25,"column":2},"end":{"line":25,"column":null}},"18":{"start":{"line":27,"column":2},"end":{"line":30,"column":null}},"19":{"start":{"line":32,"column":2},"end":{"line":32,"column":null}},"20":{"start":{"line":33,"column":2},"end":{"line":33,"column":null}},"21":{"start":{"line":35,"column":2},"end":{"line":35,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":14,"column":27},"end":{"line":14,"column":32}},"loc":{"start":{"line":14,"column":77},"end":{"line":36,"column":1}}}},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1},"f":{"0":1},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/vote/sendVote/sendVote.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/vote/sendVote/sendVote.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":50}},"2":{"start":{"line":5,"column":0},"end":{"line":5,"column":56}},"3":{"start":{"line":6,"column":0},"end":{"line":6,"column":71}},"4":{"start":{"line":7,"column":0},"end":{"line":7,"column":67}},"5":{"start":{"line":9,"column":0},"end":{"line":9,"column":77}},"6":{"start":{"line":10,"column":0},"end":{"line":10,"column":80}},"7":{"start":{"line":11,"column":0},"end":{"line":11,"column":59}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":59}},"9":{"start":{"line":13,"column":0},"end":{"line":13,"column":66}},"10":{"start":{"line":14,"column":0},"end":{"line":14,"column":62}},"11":{"start":{"line":15,"column":0},"end":{"line":15,"column":59}},"12":{"start":{"line":16,"column":0},"end":{"line":16,"column":62}},"13":{"start":{"line":18,"column":13},"end":{"line":84,"column":null}},"14":{"start":{"line":19,"column":23},"end":{"line":19,"column":104}},"15":{"start":{"line":20,"column":2},"end":{"line":20,"column":null}},"16":{"start":{"line":21,"column":39},"end":{"line":21,"column":51}},"17":{"start":{"line":23,"column":21},"end":{"line":23,"column":44}},"18":{"start":{"line":25,"column":2},"end":{"line":25,"column":null}},"19":{"start":{"line":28,"column":28},"end":{"line":28,"column":81}},"20":{"start":{"line":29,"column":2},"end":{"line":29,"column":null}},"21":{"start":{"line":29,"column":16},"end":{"line":29,"column":null}},"22":{"start":{"line":32,"column":28},"end":{"line":36,"column":11}},"23":{"start":{"line":37,"column":2},"end":{"line":37,"column":null}},"24":{"start":{"line":37,"column":12},"end":{"line":37,"column":null}},"25":{"start":{"line":40,"column":40},"end":{"line":46,"column":10}},"26":{"start":{"line":49,"column":21},"end":{"line":49,"column":76}},"27":{"start":{"line":50,"column":21},"end":{"line":50,"column":113}},"28":{"start":{"line":52,"column":17},"end":{"line":52,"column":19}},"29":{"start":{"line":53,"column":2},"end":{"line":56,"column":48}},"30":{"start":{"line":53,"column":58},"end":{"line":53,"column":null}},"31":{"start":{"line":54,"column":7},"end":{"line":56,"column":48}},"32":{"start":{"line":54,"column":61},"end":{"line":54,"column":null}},"33":{"start":{"line":55,"column":7},"end":{"line":56,"column":48}},"34":{"start":{"line":55,"column":63},"end":{"line":55,"column":null}},"35":{"start":{"line":56,"column":7},"end":{"line":56,"column":48}},"36":{"start":{"line":58,"column":2},"end":{"line":63,"column":null}},"37":{"start":{"line":66,"column":30},"end":{"line":66,"column":85}},"38":{"start":{"line":68,"column":2},"end":{"line":78,"column":null}},"39":{"start":{"line":70,"column":6},"end":{"line":70,"column":114}},"40":{"start":{"line":71,"column":4},"end":{"line":77,"column":null}},"41":{"start":{"line":80,"column":2},"end":{"line":80,"column":null}},"42":{"start":{"line":81,"column":2},"end":{"line":81,"column":null}},"43":{"start":{"line":83,"column":2},"end":{"line":83,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":18,"column":24},"end":{"line":18,"column":29}},"loc":{"start":{"line":18,"column":74},"end":{"line":84,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":29,"column":2},"end":{"line":29,"column":null}},"type":"if","locations":[{"start":{"line":29,"column":2},"end":{"line":29,"column":null}},{"start":{"line":29,"column":2},"end":{"line":29,"column":null}}]},"1":{"loc":{"start":{"line":37,"column":2},"end":{"line":37,"column":null}},"type":"if","locations":[{"start":{"line":37,"column":2},"end":{"line":37,"column":null}},{"start":{"line":37,"column":2},"end":{"line":37,"column":null}}]},"2":{"loc":{"start":{"line":49,"column":21},"end":{"line":49,"column":39}},"type":"binary-expr","locations":[{"start":{"line":49,"column":21},"end":{"line":49,"column":39}},{"start":{"line":49,"column":43},"end":{"line":49,"column":76}}]},"3":{"loc":{"start":{"line":50,"column":21},"end":{"line":50,"column":39}},"type":"binary-expr","locations":[{"start":{"line":50,"column":21},"end":{"line":50,"column":39}},{"start":{"line":50,"column":43},"end":{"line":50,"column":70}},{"start":{"line":50,"column":74},"end":{"line":50,"column":113}}]},"4":{"loc":{"start":{"line":53,"column":2},"end":{"line":56,"column":48}},"type":"if","locations":[{"start":{"line":53,"column":2},"end":{"line":56,"column":48}},{"start":{"line":53,"column":2},"end":{"line":56,"column":48}}]},"5":{"loc":{"start":{"line":53,"column":6},"end":{"line":53,"column":16}},"type":"binary-expr","locations":[{"start":{"line":53,"column":6},"end":{"line":53,"column":16}},{"start":{"line":53,"column":20},"end":{"line":53,"column":56}}]},"6":{"loc":{"start":{"line":54,"column":7},"end":{"line":56,"column":48}},"type":"if","locations":[{"start":{"line":54,"column":7},"end":{"line":56,"column":48}},{"start":{"line":54,"column":7},"end":{"line":56,"column":48}}]},"7":{"loc":{"start":{"line":54,"column":11},"end":{"line":54,"column":21}},"type":"binary-expr","locations":[{"start":{"line":54,"column":11},"end":{"line":54,"column":21}},{"start":{"line":54,"column":25},"end":{"line":54,"column":59}}]},"8":{"loc":{"start":{"line":55,"column":7},"end":{"line":56,"column":48}},"type":"if","locations":[{"start":{"line":55,"column":7},"end":{"line":56,"column":48}},{"start":{"line":55,"column":7},"end":{"line":56,"column":48}}]},"9":{"loc":{"start":{"line":55,"column":11},"end":{"line":55,"column":21}},"type":"binary-expr","locations":[{"start":{"line":55,"column":11},"end":{"line":55,"column":21}},{"start":{"line":55,"column":25},"end":{"line":55,"column":61}}]},"10":{"loc":{"start":{"line":68,"column":2},"end":{"line":78,"column":null}},"type":"if","locations":[{"start":{"line":68,"column":2},"end":{"line":78,"column":null}},{"start":{"line":68,"column":2},"end":{"line":78,"column":null}}]},"11":{"loc":{"start":{"line":70,"column":45},"end":{"line":70,"column":79}},"type":"cond-expr","locations":[{"start":{"line":70,"column":45},"end":{"line":70,"column":79}},{"start":{"line":70,"column":82},"end":{"line":70,"column":114}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":8,"15":8,"16":8,"17":8,"18":8,"19":8,"20":8,"21":1,"22":7,"23":7,"24":1,"25":6,"26":6,"27":6,"28":6,"29":6,"30":1,"31":5,"32":1,"33":4,"34":2,"35":2,"36":6,"37":6,"38":6,"39":3,"40":3,"41":6,"42":6,"43":6},"f":{"0":8},"b":{"0":[1,7],"1":[1,6],"2":[6,6],"3":[6,6,2],"4":[1,5],"5":[6,2],"6":[1,4],"7":[5,1],"8":[2,2],"9":[4,4],"10":[3,3],"11":[1,2]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/captcha/Captcha.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/captcha/Captcha.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":86}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":34}},"3":{"start":{"line":5,"column":0},"end":{"line":5,"column":43}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":67}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":41}},"6":{"start":{"line":10,"column":0},"end":{"line":55,"column":null}},"7":{"start":{"line":12,"column":2},"end":{"line":12,"column":null}},"8":{"start":{"line":16,"column":2},"end":{"line":16,"column":null}},"9":{"start":{"line":20,"column":2},"end":{"line":20,"column":null}},"10":{"start":{"line":24,"column":2},"end":{"line":24,"column":null}},"11":{"start":{"line":28,"column":2},"end":{"line":28,"column":null}},"12":{"start":{"line":33,"column":2},"end":{"line":33,"column":null}},"13":{"start":{"line":40,"column":2},"end":{"line":40,"column":null}},"14":{"start":{"line":48,"column":2},"end":{"line":48,"column":null}},"15":{"start":{"line":51,"column":2},"end":{"line":51,"column":null}},"16":{"start":{"line":54,"column":2},"end":{"line":54,"column":null}},"17":{"start":{"line":10,"column":13},"end":{"line":55,"column":null}},"18":{"start":{"line":10,"column":13},"end":{"line":10,"column":20}},"19":{"start":{"line":57,"column":13},"end":{"line":57,"column":null}}},"fnMap":{},"branchMap":{},"s":{"0":18,"1":18,"2":18,"3":18,"4":18,"5":18,"6":18,"7":18,"8":18,"9":18,"10":18,"11":18,"12":18,"13":18,"14":18,"15":18,"16":18,"17":18,"18":18,"19":18},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/captcha/CaptchaFor.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/captcha/CaptchaFor.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":2,"column":2},"end":{"line":2,"column":null}},"2":{"start":{"line":3,"column":2},"end":{"line":3,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}},"loc":{"start":{"line":1,"column":22},"end":{"line":4,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":22}},"type":"binary-expr","locations":[{"start":{"line":1,"column":12},"end":{"line":1,"column":22}},{"start":{"line":1,"column":12},"end":{"line":1,"column":null}}]}},"s":{"0":18,"1":18,"2":18},"f":{"0":18},"b":{"0":[18,18]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/AddCommentView.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/AddCommentView.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":42}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":34}},"3":{"start":{"line":8,"column":2},"end":{"line":8,"column":null}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":13}},"5":{"start":{"line":11,"column":0},"end":{"line":11,"column":13}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/Comment.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/Comment.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":97}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":34}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":60}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":43}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":47}},"5":{"start":{"line":9,"column":2},"end":{"line":9,"column":null}},"6":{"start":{"line":13,"column":2},"end":{"line":13,"column":null}},"7":{"start":{"line":18,"column":2},"end":{"line":18,"column":null}},"8":{"start":{"line":23,"column":2},"end":{"line":23,"column":null}},"9":{"start":{"line":28,"column":2},"end":{"line":28,"column":null}},"10":{"start":{"line":33,"column":2},"end":{"line":33,"column":null}},"11":{"start":{"line":37,"column":2},"end":{"line":37,"column":null}},"12":{"start":{"line":42,"column":2},"end":{"line":42,"column":null}},"13":{"start":{"line":47,"column":2},"end":{"line":47,"column":null}},"14":{"start":{"line":52,"column":2},"end":{"line":52,"column":null}},"15":{"start":{"line":57,"column":2},"end":{"line":57,"column":null}},"16":{"start":{"line":62,"column":2},"end":{"line":62,"column":null}},"17":{"start":{"line":67,"column":2},"end":{"line":67,"column":null}},"18":{"start":{"line":72,"column":2},"end":{"line":72,"column":null}},"19":{"start":{"line":77,"column":2},"end":{"line":77,"column":null}},"20":{"start":{"line":82,"column":2},"end":{"line":82,"column":null}},"21":{"start":{"line":87,"column":2},"end":{"line":87,"column":null}},"22":{"start":{"line":90,"column":2},"end":{"line":90,"column":null}},"23":{"start":{"line":93,"column":2},"end":{"line":93,"column":null}},"24":{"start":{"line":7,"column":0},"end":{"line":7,"column":13}},"25":{"start":{"line":96,"column":13},"end":{"line":96,"column":null}}},"fnMap":{},"branchMap":{},"s":{"0":5,"1":5,"2":5,"3":5,"4":5,"5":5,"6":5,"7":5,"8":5,"9":5,"10":5,"11":5,"12":5,"13":5,"14":5,"15":5,"16":5,"17":5,"18":5,"19":5,"20":5,"21":5,"22":5,"23":5,"24":5,"25":5},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/CommentStatus.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/CommentStatus.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":2,"column":2},"end":{"line":2,"column":null}},"2":{"start":{"line":3,"column":2},"end":{"line":3,"column":null}},"3":{"start":{"line":4,"column":2},"end":{"line":4,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}},"loc":{"start":{"line":1,"column":25},"end":{"line":5,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":25}},"type":"binary-expr","locations":[{"start":{"line":1,"column":12},"end":{"line":1,"column":25}},{"start":{"line":1,"column":12},"end":{"line":1,"column":null}}]}},"s":{"0":5,"1":5,"2":5,"3":5},"f":{"0":5},"b":{"0":[5,5]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/CommentType.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/CommentType.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":2,"column":2},"end":{"line":2,"column":null}},"2":{"start":{"line":3,"column":2},"end":{"line":3,"column":null}},"3":{"start":{"line":4,"column":2},"end":{"line":4,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}},"loc":{"start":{"line":1,"column":23},"end":{"line":5,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":23}},"type":"binary-expr","locations":[{"start":{"line":1,"column":12},"end":{"line":1,"column":23}},{"start":{"line":1,"column":12},"end":{"line":1,"column":null}}]}},"s":{"0":5,"1":5,"2":5,"3":5},"f":{"0":5},"b":{"0":[5,5]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/GetComment.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/GetComment.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":42}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":34}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":47}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":35}},"5":{"start":{"line":10,"column":2},"end":{"line":10,"column":null}},"6":{"start":{"line":7,"column":0},"end":{"line":7,"column":13}},"7":{"start":{"line":15,"column":2},"end":{"line":15,"column":null}},"8":{"start":{"line":18,"column":2},"end":{"line":18,"column":null}},"9":{"start":{"line":13,"column":0},"end":{"line":13,"column":13}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/GetLatestComments.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/GetLatestComments.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":64}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":42}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":34}},"3":{"start":{"line":11,"column":2},"end":{"line":11,"column":null}},"4":{"start":{"line":7,"column":0},"end":{"line":7,"column":13}},"5":{"start":{"line":17,"column":2},"end":{"line":17,"column":null}},"6":{"start":{"line":21,"column":2},"end":{"line":21,"column":null}},"7":{"start":{"line":14,"column":0},"end":{"line":14,"column":13}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/NewComment.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/NewComment.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":60}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":42}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":47}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":43}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":35}},"5":{"start":{"line":11,"column":2},"end":{"line":11,"column":null}},"6":{"start":{"line":15,"column":2},"end":{"line":15,"column":null}},"7":{"start":{"line":20,"column":2},"end":{"line":20,"column":null}},"8":{"start":{"line":25,"column":2},"end":{"line":25,"column":null}},"9":{"start":{"line":30,"column":2},"end":{"line":30,"column":null}},"10":{"start":{"line":7,"column":0},"end":{"line":7,"column":13}},"11":{"start":{"line":35,"column":2},"end":{"line":35,"column":null}},"12":{"start":{"line":38,"column":2},"end":{"line":38,"column":null}},"13":{"start":{"line":33,"column":0},"end":{"line":33,"column":13}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/mongo/ResponseError.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/mongo/ResponseError.ts","statementMap":{"0":{"start":{"line":6,"column":4},"end":{"line":6,"column":null}},"1":{"start":{"line":7,"column":4},"end":{"line":7,"column":null}},"2":{"start":{"line":8,"column":4},"end":{"line":8,"column":null}},"3":{"start":{"line":10,"column":4},"end":{"line":10,"column":null}},"4":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":5,"column":2},"end":{"line":5,"column":14}},"loc":{"start":{"line":5,"column":39},"end":{"line":11,"column":3}}}},"branchMap":{},"s":{"0":26,"1":26,"2":26,"3":26,"4":20},"f":{"0":26},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/notification/Notification.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/notification/Notification.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":86}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":34}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":60}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":41}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":53}},"5":{"start":{"line":9,"column":2},"end":{"line":9,"column":null}},"6":{"start":{"line":13,"column":2},"end":{"line":13,"column":null}},"7":{"start":{"line":18,"column":2},"end":{"line":18,"column":null}},"8":{"start":{"line":23,"column":2},"end":{"line":23,"column":null}},"9":{"start":{"line":28,"column":2},"end":{"line":28,"column":null}},"10":{"start":{"line":33,"column":2},"end":{"line":33,"column":null}},"11":{"start":{"line":38,"column":2},"end":{"line":38,"column":null}},"12":{"start":{"line":43,"column":2},"end":{"line":43,"column":null}},"13":{"start":{"line":47,"column":2},"end":{"line":47,"column":null}},"14":{"start":{"line":50,"column":2},"end":{"line":50,"column":null}},"15":{"start":{"line":53,"column":2},"end":{"line":53,"column":null}},"16":{"start":{"line":7,"column":0},"end":{"line":7,"column":13}},"17":{"start":{"line":56,"column":13},"end":{"line":56,"column":null}}},"fnMap":{},"branchMap":{},"s":{"0":2,"1":2,"2":2,"3":2,"4":2,"5":2,"6":2,"7":2,"8":2,"9":2,"10":2,"11":2,"12":2,"13":2,"14":2,"15":2,"16":2,"17":2},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/notification/NotificationType.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/notification/NotificationType.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":2,"column":2},"end":{"line":2,"column":null}},"2":{"start":{"line":3,"column":2},"end":{"line":3,"column":null}},"3":{"start":{"line":4,"column":2},"end":{"line":4,"column":null}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":null}},"5":{"start":{"line":6,"column":2},"end":{"line":6,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}},"loc":{"start":{"line":1,"column":28},"end":{"line":7,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":28}},"type":"binary-expr","locations":[{"start":{"line":1,"column":12},"end":{"line":1,"column":28}},{"start":{"line":1,"column":12},"end":{"line":1,"column":null}}]}},"s":{"0":2,"1":2,"2":2,"3":2,"4":2,"5":2},"f":{"0":2},"b":{"0":[2,2]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/notification/TargetType.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/notification/TargetType.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":2,"column":2},"end":{"line":2,"column":null}},"2":{"start":{"line":3,"column":2},"end":{"line":3,"column":null}},"3":{"start":{"line":4,"column":2},"end":{"line":4,"column":null}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}},"loc":{"start":{"line":1,"column":22},"end":{"line":6,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":22}},"type":"binary-expr","locations":[{"start":{"line":1,"column":12},"end":{"line":1,"column":22}},{"start":{"line":1,"column":12},"end":{"line":1,"column":null}}]}},"s":{"0":2,"1":2,"2":2,"3":2,"4":2},"f":{"0":2},"b":{"0":[2,2]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/quota/Quota.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/quota/Quota.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":78}},"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":34}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":43}},"3":{"start":{"line":5,"column":0},"end":{"line":5,"column":67}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":39}},"5":{"start":{"line":9,"column":0},"end":{"line":34,"column":null}},"6":{"start":{"line":11,"column":2},"end":{"line":11,"column":null}},"7":{"start":{"line":15,"column":2},"end":{"line":15,"column":null}},"8":{"start":{"line":20,"column":2},"end":{"line":20,"column":null}},"9":{"start":{"line":25,"column":2},"end":{"line":25,"column":null}},"10":{"start":{"line":33,"column":2},"end":{"line":33,"column":null}},"11":{"start":{"line":9,"column":13},"end":{"line":34,"column":null}},"12":{"start":{"line":9,"column":13},"end":{"line":9,"column":18}},"13":{"start":{"line":36,"column":13},"end":{"line":36,"column":null}}},"fnMap":{},"branchMap":{},"s":{"0":9,"1":9,"2":9,"3":9,"4":9,"5":9,"6":9,"7":9,"8":9,"9":9,"10":9,"11":9,"12":9,"13":9},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/quota/QuotaType.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/quota/QuotaType.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":2,"column":2},"end":{"line":2,"column":null}},"2":{"start":{"line":3,"column":2},"end":{"line":3,"column":null}},"3":{"start":{"line":4,"column":2},"end":{"line":4,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}},"loc":{"start":{"line":1,"column":21},"end":{"line":5,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":21}},"type":"binary-expr","locations":[{"start":{"line":1,"column":12},"end":{"line":1,"column":21}},{"start":{"line":1,"column":12},"end":{"line":1,"column":null}}]}},"s":{"0":9,"1":9,"2":9,"3":9},"f":{"0":9},"b":{"0":[9,9]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/ChangePassword.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/ChangePassword.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":42}},"2":{"start":{"line":8,"column":2},"end":{"line":8,"column":null}},"3":{"start":{"line":13,"column":2},"end":{"line":13,"column":null}},"4":{"start":{"line":4,"column":0},"end":{"line":4,"column":13}},"5":{"start":{"line":16,"column":0},"end":{"line":16,"column":13}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/ForgotPassword.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/ForgotPassword.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":42}},"2":{"start":{"line":7,"column":2},"end":{"line":7,"column":null}},"3":{"start":{"line":11,"column":2},"end":{"line":11,"column":null}},"4":{"start":{"line":4,"column":0},"end":{"line":4,"column":13}},"5":{"start":{"line":14,"column":0},"end":{"line":14,"column":13}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/GetPublicUser.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/GetPublicUser.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":42}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":34}},"3":{"start":{"line":9,"column":2},"end":{"line":9,"column":null}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":13}},"5":{"start":{"line":12,"column":0},"end":{"line":12,"column":13}}},"fnMap":{},"branchMap":{},"s":{"0":3,"1":3,"2":3,"3":3,"4":3,"5":3},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/IsEqualTo.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/IsEqualTo.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":91}},"1":{"start":{"line":4,"column":2},"end":{"line":24,"column":null}},"2":{"start":{"line":5,"column":4},"end":{"line":23,"column":null}},"3":{"start":{"line":13,"column":40},"end":{"line":13,"column":56}},"4":{"start":{"line":14,"column":32},"end":{"line":14,"column":72}},"5":{"start":{"line":15,"column":10},"end":{"line":15,"column":null}},"6":{"start":{"line":19,"column":40},"end":{"line":19,"column":56}},"7":{"start":{"line":20,"column":10},"end":{"line":20,"column":null}},"8":{"start":{"line":3,"column":0},"end":{"line":3,"column":16}}},"fnMap":{"0":{"name":"IsEqualTo","decl":{"start":{"line":3,"column":16},"end":{"line":3,"column":25}},"loc":{"start":{"line":3,"column":81},"end":{"line":25,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":4,"column":9},"end":{"line":4,"column":10}},"loc":{"start":{"line":4,"column":52},"end":{"line":24,"column":3}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":12,"column":8},"end":{"line":12,"column":16}},"loc":{"start":{"line":12,"column":54},"end":{"line":16,"column":9}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":18,"column":8},"end":{"line":18,"column":22}},"loc":{"start":{"line":18,"column":48},"end":{"line":21,"column":9}}}},"branchMap":{},"s":{"0":17,"1":17,"2":17,"3":21,"4":21,"5":21,"6":0,"7":0,"8":17},"f":{"0":17,"1":17,"2":21,"3":0},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/Login.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/Login.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":42}},"2":{"start":{"line":8,"column":2},"end":{"line":8,"column":null}},"3":{"start":{"line":13,"column":2},"end":{"line":13,"column":null}},"4":{"start":{"line":17,"column":2},"end":{"line":17,"column":null}},"5":{"start":{"line":5,"column":0},"end":{"line":5,"column":13}},"6":{"start":{"line":23,"column":2},"end":{"line":23,"column":null}},"7":{"start":{"line":20,"column":0},"end":{"line":20,"column":13}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/PublicUser.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/PublicUser.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":85}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":34}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":37}},"3":{"start":{"line":8,"column":2},"end":{"line":8,"column":null}},"4":{"start":{"line":12,"column":2},"end":{"line":12,"column":null}},"5":{"start":{"line":15,"column":2},"end":{"line":15,"column":null}},"6":{"start":{"line":18,"column":2},"end":{"line":18,"column":null}},"7":{"start":{"line":21,"column":2},"end":{"line":21,"column":null}},"8":{"start":{"line":6,"column":0},"end":{"line":6,"column":13}}},"fnMap":{},"branchMap":{},"s":{"0":2,"1":2,"2":2,"3":2,"4":2,"5":2,"6":2,"7":2,"8":2},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/ResetPassword.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/ResetPassword.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":42}},"2":{"start":{"line":7,"column":2},"end":{"line":7,"column":null}},"3":{"start":{"line":11,"column":2},"end":{"line":11,"column":null}},"4":{"start":{"line":16,"column":2},"end":{"line":16,"column":null}},"5":{"start":{"line":4,"column":0},"end":{"line":4,"column":13}},"6":{"start":{"line":19,"column":0},"end":{"line":19,"column":13}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/SignUp.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/SignUp.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":65}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":42}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":39}},"3":{"start":{"line":10,"column":2},"end":{"line":10,"column":null}},"4":{"start":{"line":14,"column":2},"end":{"line":14,"column":null}},"5":{"start":{"line":19,"column":2},"end":{"line":19,"column":null}},"6":{"start":{"line":24,"column":2},"end":{"line":24,"column":null}},"7":{"start":{"line":28,"column":2},"end":{"line":28,"column":null}},"8":{"start":{"line":6,"column":0},"end":{"line":6,"column":13}},"9":{"start":{"line":34,"column":2},"end":{"line":34,"column":null}},"10":{"start":{"line":31,"column":0},"end":{"line":31,"column":13}}},"fnMap":{},"branchMap":{},"s":{"0":17,"1":17,"2":17,"3":17,"4":17,"5":17,"6":17,"7":17,"8":17,"9":17,"10":17},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/User.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/User.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":108}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":34}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":60}},"3":{"start":{"line":5,"column":0},"end":{"line":5,"column":37}},"4":{"start":{"line":10,"column":2},"end":{"line":10,"column":null}},"5":{"start":{"line":15,"column":2},"end":{"line":15,"column":null}},"6":{"start":{"line":19,"column":2},"end":{"line":19,"column":null}},"7":{"start":{"line":24,"column":2},"end":{"line":24,"column":null}},"8":{"start":{"line":27,"column":2},"end":{"line":27,"column":null}},"9":{"start":{"line":32,"column":2},"end":{"line":32,"column":null}},"10":{"start":{"line":37,"column":2},"end":{"line":37,"column":null}},"11":{"start":{"line":40,"column":2},"end":{"line":40,"column":null}},"12":{"start":{"line":43,"column":2},"end":{"line":43,"column":null}},"13":{"start":{"line":8,"column":0},"end":{"line":8,"column":13}},"14":{"start":{"line":46,"column":13},"end":{"line":46,"column":null}}},"fnMap":{},"branchMap":{},"s":{"0":17,"1":17,"2":17,"3":17,"4":17,"5":17,"6":17,"7":17,"8":17,"9":17,"10":17,"11":17,"12":17,"13":17,"14":17},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/UserRole.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/UserRole.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":2,"column":2},"end":{"line":2,"column":null}},"2":{"start":{"line":3,"column":2},"end":{"line":3,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}},"loc":{"start":{"line":1,"column":20},"end":{"line":4,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}},"type":"binary-expr","locations":[{"start":{"line":1,"column":12},"end":{"line":1,"column":20}},{"start":{"line":1,"column":12},"end":{"line":1,"column":null}}]}},"s":{"0":18,"1":18,"2":18},"f":{"0":18},"b":{"0":[18,18]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/VerifyEmail.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/VerifyEmail.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":42}},"2":{"start":{"line":7,"column":2},"end":{"line":7,"column":null}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":13}},"4":{"start":{"line":10,"column":0},"end":{"line":10,"column":13}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/vote/SendVote.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/vote/SendVote.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":42}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":34}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":47}},"4":{"start":{"line":9,"column":2},"end":{"line":9,"column":null}},"5":{"start":{"line":13,"column":2},"end":{"line":13,"column":null}},"6":{"start":{"line":6,"column":0},"end":{"line":6,"column":13}},"7":{"start":{"line":16,"column":0},"end":{"line":16,"column":13}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/vote/Vote.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/vote/Vote.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":71}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":34}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":67}},"3":{"start":{"line":5,"column":0},"end":{"line":5,"column":47}},"4":{"start":{"line":9,"column":0},"end":{"line":31,"column":null}},"5":{"start":{"line":11,"column":2},"end":{"line":11,"column":null}},"6":{"start":{"line":15,"column":2},"end":{"line":15,"column":null}},"7":{"start":{"line":19,"column":2},"end":{"line":19,"column":null}},"8":{"start":{"line":24,"column":2},"end":{"line":24,"column":null}},"9":{"start":{"line":27,"column":2},"end":{"line":27,"column":null}},"10":{"start":{"line":30,"column":2},"end":{"line":30,"column":null}},"11":{"start":{"line":9,"column":13},"end":{"line":31,"column":null}},"12":{"start":{"line":9,"column":13},"end":{"line":9,"column":17}},"13":{"start":{"line":33,"column":13},"end":{"line":33,"column":null}}},"fnMap":{},"branchMap":{},"s":{"0":2,"1":2,"2":2,"3":2,"4":2,"5":2,"6":2,"7":2,"8":2,"9":2,"10":2,"11":2,"12":2,"13":2},"f":{},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/vote/VoteDirection.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/vote/VoteDirection.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"1":{"start":{"line":2,"column":2},"end":{"line":2,"column":null}},"2":{"start":{"line":3,"column":2},"end":{"line":3,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}},"loc":{"start":{"line":1,"column":25},"end":{"line":4,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":25}},"type":"binary-expr","locations":[{"start":{"line":1,"column":12},"end":{"line":1,"column":25}},{"start":{"line":1,"column":12},"end":{"line":1,"column":null}}]}},"s":{"0":2,"1":2,"2":2},"f":{"0":2},"b":{"0":[2,2]}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/test/createTestUser.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/test/createTestUser.ts","statementMap":{"0":{"start":{"line":3,"column":0},"end":{"line":3,"column":95}},"1":{"start":{"line":4,"column":0},"end":{"line":4,"column":92}},"2":{"start":{"line":5,"column":0},"end":{"line":5,"column":56}},"3":{"start":{"line":8,"column":0},"end":{"line":8,"column":53}},"4":{"start":{"line":9,"column":0},"end":{"line":9,"column":43}},"5":{"start":{"line":21,"column":13},"end":{"line":57,"column":null}},"6":{"start":{"line":22,"column":2},"end":{"line":23,"column":null}},"7":{"start":{"line":24,"column":2},"end":{"line":25,"column":null}},"8":{"start":{"line":26,"column":2},"end":{"line":26,"column":null}},"9":{"start":{"line":28,"column":23},"end":{"line":28,"column":24}},"10":{"start":{"line":29,"column":43},"end":{"line":29,"column":49}},"11":{"start":{"line":31,"column":2},"end":{"line":31,"column":null}},"12":{"start":{"line":32,"column":2},"end":{"line":32,"column":null}},"13":{"start":{"line":32,"column":96},"end":{"line":32,"column":113}},"14":{"start":{"line":34,"column":33},"end":{"line":46,"column":null}},"15":{"start":{"line":48,"column":22},"end":{"line":48,"column":51}},"16":{"start":{"line":48,"column":34},"end":{"line":48,"column":51}},"17":{"start":{"line":50,"column":2},"end":{"line":50,"column":null}},"18":{"start":{"line":52,"column":22},"end":{"line":52,"column":76}},"19":{"start":{"line":54,"column":19},"end":{"line":54,"column":41}},"20":{"start":{"line":56,"column":2},"end":{"line":56,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":21,"column":46},"end":{"line":21,"column":51}},"loc":{"start":{"line":21,"column":82},"end":{"line":57,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":32,"column":84},"end":{"line":32,"column":89}},"loc":{"start":{"line":32,"column":96},"end":{"line":32,"column":113}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":48,"column":22},"end":{"line":48,"column":27}},"loc":{"start":{"line":48,"column":34},"end":{"line":48,"column":51}}}},"branchMap":{},"s":{"0":16,"1":16,"2":16,"3":16,"4":16,"5":16,"6":17,"7":17,"8":17,"9":17,"10":17,"11":17,"12":17,"13":19,"14":17,"15":17,"16":40,"17":17,"18":17,"19":17,"20":17},"f":{"0":17,"1":19,"2":40},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/test/deleteTestUser.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/test/deleteTestUser.ts","statementMap":{"0":{"start":{"line":3,"column":0},"end":{"line":3,"column":56}},"1":{"start":{"line":4,"column":0},"end":{"line":4,"column":57}},"2":{"start":{"line":5,"column":0},"end":{"line":5,"column":47}},"3":{"start":{"line":11,"column":13},"end":{"line":14,"column":null}},"4":{"start":{"line":12,"column":2},"end":{"line":12,"column":null}},"5":{"start":{"line":13,"column":2},"end":{"line":13,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":11,"column":46},"end":{"line":11,"column":51}},"loc":{"start":{"line":11,"column":63},"end":{"line":14,"column":1}}}},"branchMap":{},"s":{"0":16,"1":16,"2":16,"3":16,"4":16,"5":16},"f":{"0":16},"b":{}} -,"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/test/mockConnect.ts": {"path":"/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/test/mockConnect.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}},"1":{"start":{"line":3,"column":13},"end":{"line":10,"column":null}},"2":{"start":{"line":4,"column":2},"end":{"line":9,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":3,"column":27},"end":{"line":3,"column":32}},"loc":{"start":{"line":3,"column":53},"end":{"line":10,"column":1}}}},"branchMap":{},"s":{"0":18,"1":18,"2":34},"f":{"0":34},"b":{}} -} diff --git a/src/api/coverage/lcov-report/base.css b/src/api/coverage/lcov-report/base.css deleted file mode 100644 index f418035..0000000 --- a/src/api/coverage/lcov-report/base.css +++ /dev/null @@ -1,224 +0,0 @@ -body, html { - margin:0; padding: 0; - height: 100%; -} -body { - font-family: Helvetica Neue, Helvetica, Arial; - font-size: 14px; - color:#333; -} -.small { font-size: 12px; } -*, *:after, *:before { - -webkit-box-sizing:border-box; - -moz-box-sizing:border-box; - box-sizing:border-box; - } -h1 { font-size: 20px; margin: 0;} -h2 { font-size: 14px; } -pre { - font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; - margin: 0; - padding: 0; - -moz-tab-size: 2; - -o-tab-size: 2; - tab-size: 2; -} -a { color:#0074D9; text-decoration:none; } -a:hover { text-decoration:underline; } -.strong { font-weight: bold; } -.space-top1 { padding: 10px 0 0 0; } -.pad2y { padding: 20px 0; } -.pad1y { padding: 10px 0; } -.pad2x { padding: 0 20px; } -.pad2 { padding: 20px; } -.pad1 { padding: 10px; } -.space-left2 { padding-left:55px; } -.space-right2 { padding-right:20px; } -.center { text-align:center; } -.clearfix { display:block; } -.clearfix:after { - content:''; - display:block; - height:0; - clear:both; - visibility:hidden; - } -.fl { float: left; } -@media only screen and (max-width:640px) { - .col3 { width:100%; max-width:100%; } - .hide-mobile { display:none!important; } -} - -.quiet { - color: #7f7f7f; - color: rgba(0,0,0,0.5); -} -.quiet a { opacity: 0.7; } - -.fraction { - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; - font-size: 10px; - color: #555; - background: #E8E8E8; - padding: 4px 5px; - border-radius: 3px; - vertical-align: middle; -} - -div.path a:link, div.path a:visited { color: #333; } -table.coverage { - border-collapse: collapse; - margin: 10px 0 0 0; - padding: 0; -} - -table.coverage td { - margin: 0; - padding: 0; - vertical-align: top; -} -table.coverage td.line-count { - text-align: right; - padding: 0 5px 0 20px; -} -table.coverage td.line-coverage { - text-align: right; - padding-right: 10px; - min-width:20px; -} - -table.coverage td span.cline-any { - display: inline-block; - padding: 0 5px; - width: 100%; -} -.missing-if-branch { - display: inline-block; - margin-right: 5px; - border-radius: 3px; - position: relative; - padding: 0 4px; - background: #333; - color: yellow; -} - -.skip-if-branch { - display: none; - margin-right: 10px; - position: relative; - padding: 0 4px; - background: #ccc; - color: white; -} -.missing-if-branch .typ, .skip-if-branch .typ { - color: inherit !important; -} -.coverage-summary { - border-collapse: collapse; - width: 100%; -} -.coverage-summary tr { border-bottom: 1px solid #bbb; } -.keyline-all { border: 1px solid #ddd; } -.coverage-summary td, .coverage-summary th { padding: 10px; } -.coverage-summary tbody { border: 1px solid #bbb; } -.coverage-summary td { border-right: 1px solid #bbb; } -.coverage-summary td:last-child { border-right: none; } -.coverage-summary th { - text-align: left; - font-weight: normal; - white-space: nowrap; -} -.coverage-summary th.file { border-right: none !important; } -.coverage-summary th.pct { } -.coverage-summary th.pic, -.coverage-summary th.abs, -.coverage-summary td.pct, -.coverage-summary td.abs { text-align: right; } -.coverage-summary td.file { white-space: nowrap; } -.coverage-summary td.pic { min-width: 120px !important; } -.coverage-summary tfoot td { } - -.coverage-summary .sorter { - height: 10px; - width: 7px; - display: inline-block; - margin-left: 0.5em; - background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; -} -.coverage-summary .sorted .sorter { - background-position: 0 -20px; -} -.coverage-summary .sorted-desc .sorter { - background-position: 0 -10px; -} -.status-line { height: 10px; } -/* yellow */ -.cbranch-no { background: yellow !important; color: #111; } -/* dark red */ -.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } -.low .chart { border:1px solid #C21F39 } -.highlighted, -.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{ - background: #C21F39 !important; -} -/* medium red */ -.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } -/* light red */ -.low, .cline-no { background:#FCE1E5 } -/* light green */ -.high, .cline-yes { background:rgb(230,245,208) } -/* medium green */ -.cstat-yes { background:rgb(161,215,106) } -/* dark green */ -.status-line.high, .high .cover-fill { background:rgb(77,146,33) } -.high .chart { border:1px solid rgb(77,146,33) } -/* dark yellow (gold) */ -.status-line.medium, .medium .cover-fill { background: #f9cd0b; } -.medium .chart { border:1px solid #f9cd0b; } -/* light yellow */ -.medium { background: #fff4c2; } - -.cstat-skip { background: #ddd; color: #111; } -.fstat-skip { background: #ddd; color: #111 !important; } -.cbranch-skip { background: #ddd !important; color: #111; } - -span.cline-neutral { background: #eaeaea; } - -.coverage-summary td.empty { - opacity: .5; - padding-top: 4px; - padding-bottom: 4px; - line-height: 1; - color: #888; -} - -.cover-fill, .cover-empty { - display:inline-block; - height: 12px; -} -.chart { - line-height: 0; -} -.cover-empty { - background: white; -} -.cover-full { - border-right: none !important; -} -pre.prettyprint { - border: none !important; - padding: 0 !important; - margin: 0 !important; -} -.com { color: #999 !important; } -.ignore-none { color: #999; font-weight: normal; } - -.wrapper { - min-height: 100%; - height: auto !important; - height: 100%; - margin: 0 auto -48px; -} -.footer, .push { - height: 48px; -} diff --git a/src/api/coverage/lcov-report/block-navigation.js b/src/api/coverage/lcov-report/block-navigation.js deleted file mode 100644 index c7ff5a5..0000000 --- a/src/api/coverage/lcov-report/block-navigation.js +++ /dev/null @@ -1,79 +0,0 @@ -/* eslint-disable */ -var jumpToCode = (function init() { - // Classes of code we would like to highlight in the file view - var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no']; - - // Elements to highlight in the file listing view - var fileListingElements = ['td.pct.low']; - - // We don't want to select elements that are direct descendants of another match - var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > ` - - // Selecter that finds elements on the page to which we can jump - var selector = - fileListingElements.join(', ') + - ', ' + - notSelector + - missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b` - - // The NodeList of matching elements - var missingCoverageElements = document.querySelectorAll(selector); - - var currentIndex; - - function toggleClass(index) { - missingCoverageElements - .item(currentIndex) - .classList.remove('highlighted'); - missingCoverageElements.item(index).classList.add('highlighted'); - } - - function makeCurrent(index) { - toggleClass(index); - currentIndex = index; - missingCoverageElements.item(index).scrollIntoView({ - behavior: 'smooth', - block: 'center', - inline: 'center' - }); - } - - function goToPrevious() { - var nextIndex = 0; - if (typeof currentIndex !== 'number' || currentIndex === 0) { - nextIndex = missingCoverageElements.length - 1; - } else if (missingCoverageElements.length > 1) { - nextIndex = currentIndex - 1; - } - - makeCurrent(nextIndex); - } - - function goToNext() { - var nextIndex = 0; - - if ( - typeof currentIndex === 'number' && - currentIndex < missingCoverageElements.length - 1 - ) { - nextIndex = currentIndex + 1; - } - - makeCurrent(nextIndex); - } - - return function jump(event) { - switch (event.which) { - case 78: // n - case 74: // j - goToNext(); - break; - case 66: // b - case 75: // k - case 80: // p - goToPrevious(); - break; - } - }; -})(); -window.addEventListener('keydown', jumpToCode); diff --git a/src/api/coverage/lcov-report/favicon.png b/src/api/coverage/lcov-report/favicon.png deleted file mode 100644 index 6691817..0000000 Binary files a/src/api/coverage/lcov-report/favicon.png and /dev/null differ diff --git a/src/api/coverage/lcov-report/index.html b/src/api/coverage/lcov-report/index.html deleted file mode 100644 index 00562c3..0000000 --- a/src/api/coverage/lcov-report/index.html +++ /dev/null @@ -1,500 +0,0 @@ - - - - - - Code coverage report for All files - - - - - - - - -
-
-

All files

-
- -
- 99.72% - Statements - 725/727 -
- - -
- 100% - Branches - 120/120 -
- - -
- 97.83% - Functions - 45/46 -
- - -
- 99.71% - Lines - 688/690 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
src -
-
100%3/3100%0/0100%0/0100%3/3
src/helpers -
-
100%14/14100%4/4100%2/2100%13/13
src/resolvers/captcha/helpers -
-
100%14/14100%0/0100%2/2100%14/14
src/resolvers/comment/addCommentView -
-
100%17/17100%5/5100%1/1100%16/16
src/resolvers/comment/getComment -
-
100%22/22100%4/4100%1/1100%20/20
src/resolvers/comment/getLatestComments -
-
100%26/26100%10/10100%2/2100%22/22
src/resolvers/comment/newComment -
-
100%23/23100%2/2100%1/1100%23/23
src/resolvers/notification/getLatestNotifications -
-
100%8/8100%0/0100%1/1100%8/8
src/resolvers/quota/rateLimit -
-
100%10/10100%7/7100%1/1100%9/9
src/resolvers/user/changePassword -
-
100%21/21100%0/0100%1/1100%21/21
src/resolvers/user/forgotPassword -
-
100%27/27100%4/4100%1/1100%26/26
src/resolvers/user/getPublicUser -
-
100%18/18100%2/2100%1/1100%17/17
src/resolvers/user/helpers -
-
100%64/64100%27/27100%8/8100%57/57
src/resolvers/user/login -
-
100%28/28100%4/4100%1/1100%27/27
src/resolvers/user/resendEmailVerification -
-
100%16/16100%2/2100%1/1100%15/15
src/resolvers/user/resetPassword -
-
100%29/29100%4/4100%1/1100%27/27
src/resolvers/user/signUp -
-
100%34/34100%4/4100%1/1100%32/32
src/resolvers/user/verifyEmail -
-
100%22/22100%0/0100%1/1100%22/22
src/resolvers/vote/sendVote -
-
100%44/44100%25/25100%1/1100%39/39
src/shared/captcha -
-
100%23/23100%2/2100%1/1100%21/21
src/shared/comment -
-
100%72/72100%4/4100%2/2100%72/72
src/shared/mongo -
-
100%5/5100%0/0100%1/1100%5/5
src/shared/notification -
-
100%29/29100%4/4100%2/2100%29/29
src/shared/quota -
-
100%18/18100%2/2100%1/1100%16/16
src/shared/user -
-
97.65%83/85100%2/280%4/597.65%83/85
src/shared/vote -
-
100%25/25100%2/2100%1/1100%23/23
src/test -
-
100%30/30100%0/0100%5/5100%28/28
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/prettify.css b/src/api/coverage/lcov-report/prettify.css deleted file mode 100644 index b317a7c..0000000 --- a/src/api/coverage/lcov-report/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/src/api/coverage/lcov-report/prettify.js b/src/api/coverage/lcov-report/prettify.js deleted file mode 100644 index b322523..0000000 --- a/src/api/coverage/lcov-report/prettify.js +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/src/api/coverage/lcov-report/sort-arrow-sprite.png b/src/api/coverage/lcov-report/sort-arrow-sprite.png deleted file mode 100644 index 03f704a..0000000 Binary files a/src/api/coverage/lcov-report/sort-arrow-sprite.png and /dev/null differ diff --git a/src/api/coverage/lcov-report/sorter.js b/src/api/coverage/lcov-report/sorter.js deleted file mode 100644 index 16de10c..0000000 --- a/src/api/coverage/lcov-report/sorter.js +++ /dev/null @@ -1,170 +0,0 @@ -/* eslint-disable */ -var addSorting = (function() { - 'use strict'; - var cols, - currentSort = { - index: 0, - desc: false - }; - - // returns the summary table element - function getTable() { - return document.querySelector('.coverage-summary'); - } - // returns the thead element of the summary table - function getTableHeader() { - return getTable().querySelector('thead tr'); - } - // returns the tbody element of the summary table - function getTableBody() { - return getTable().querySelector('tbody'); - } - // returns the th element for nth column - function getNthColumn(n) { - return getTableHeader().querySelectorAll('th')[n]; - } - - // loads all columns - function loadColumns() { - var colNodes = getTableHeader().querySelectorAll('th'), - colNode, - cols = [], - col, - i; - - for (i = 0; i < colNodes.length; i += 1) { - colNode = colNodes[i]; - col = { - key: colNode.getAttribute('data-col'), - sortable: !colNode.getAttribute('data-nosort'), - type: colNode.getAttribute('data-type') || 'string' - }; - cols.push(col); - if (col.sortable) { - col.defaultDescSort = col.type === 'number'; - colNode.innerHTML = - colNode.innerHTML + ''; - } - } - return cols; - } - // attaches a data attribute to every tr element with an object - // of data values keyed by column name - function loadRowData(tableRow) { - var tableCols = tableRow.querySelectorAll('td'), - colNode, - col, - data = {}, - i, - val; - for (i = 0; i < tableCols.length; i += 1) { - colNode = tableCols[i]; - col = cols[i]; - val = colNode.getAttribute('data-value'); - if (col.type === 'number') { - val = Number(val); - } - data[col.key] = val; - } - return data; - } - // loads all row data - function loadData() { - var rows = getTableBody().querySelectorAll('tr'), - i; - - for (i = 0; i < rows.length; i += 1) { - rows[i].data = loadRowData(rows[i]); - } - } - // sorts the table using the data for the ith column - function sortByIndex(index, desc) { - var key = cols[index].key, - sorter = function(a, b) { - a = a.data[key]; - b = b.data[key]; - return a < b ? -1 : a > b ? 1 : 0; - }, - finalSorter = sorter, - tableBody = document.querySelector('.coverage-summary tbody'), - rowNodes = tableBody.querySelectorAll('tr'), - rows = [], - i; - - if (desc) { - finalSorter = function(a, b) { - return -1 * sorter(a, b); - }; - } - - for (i = 0; i < rowNodes.length; i += 1) { - rows.push(rowNodes[i]); - tableBody.removeChild(rowNodes[i]); - } - - rows.sort(finalSorter); - - for (i = 0; i < rows.length; i += 1) { - tableBody.appendChild(rows[i]); - } - } - // removes sort indicators for current column being sorted - function removeSortIndicators() { - var col = getNthColumn(currentSort.index), - cls = col.className; - - cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); - col.className = cls; - } - // adds sort indicators for current column being sorted - function addSortIndicators() { - getNthColumn(currentSort.index).className += currentSort.desc - ? ' sorted-desc' - : ' sorted'; - } - // adds event listeners for all sorter widgets - function enableUI() { - var i, - el, - ithSorter = function ithSorter(i) { - var col = cols[i]; - - return function() { - var desc = col.defaultDescSort; - - if (currentSort.index === i) { - desc = !currentSort.desc; - } - sortByIndex(i, desc); - removeSortIndicators(); - currentSort.index = i; - currentSort.desc = desc; - addSortIndicators(); - }; - }; - for (i = 0; i < cols.length; i += 1) { - if (cols[i].sortable) { - // add the click event handler on the th so users - // dont have to click on those tiny arrows - el = getNthColumn(i).querySelector('.sorter').parentElement; - if (el.addEventListener) { - el.addEventListener('click', ithSorter(i)); - } else { - el.attachEvent('onclick', ithSorter(i)); - } - } - } - } - // adds sorting functionality to the UI - return function() { - if (!getTable()) { - return; - } - cols = loadColumns(); - loadData(); - addSortIndicators(); - enableUI(); - }; -})(); - -window.addEventListener('load', addSorting); diff --git a/src/api/coverage/lcov-report/src/captcha/captcha.model.ts.html b/src/api/coverage/lcov-report/src/captcha/captcha.model.ts.html deleted file mode 100644 index 8a00a71..0000000 --- a/src/api/coverage/lcov-report/src/captcha/captcha.model.ts.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - Code coverage report for src/captcha/captcha.model.ts - - - - - - - - - -
-
-

All files / src/captcha captcha.model.ts

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -618x -  -18x -  -18x - 
import { getModelForClass } from '@typegoose/typegoose'
- 
-import { Captcha } from '../shared/captcha/Captcha'
- 
-export const CaptchaModel = getModelForClass(Captcha, { schemaOptions: { timestamps: true } })
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/captcha/helpers/captchaSolutions.ts.html b/src/api/coverage/lcov-report/src/captcha/helpers/captchaSolutions.ts.html deleted file mode 100644 index 10c1ead..0000000 --- a/src/api/coverage/lcov-report/src/captcha/helpers/captchaSolutions.ts.html +++ /dev/null @@ -1,392 +0,0 @@ - - - - - - Code coverage report for src/captcha/helpers/captchaSolutions.ts - - - - - - - - - -
-
-

All files / src/captcha/helpers captchaSolutions.ts

-
- -
- 100% - Statements - 1/1 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 1/1 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105  -  -19x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import { CaptchaSolution } from '../../shared/captcha/CaptchaSolution'
- 
-export const captchaSolutions: CaptchaSolution[] = [
-  '0021',
-  '0031',
-  '0054',
-  '0160',
-  '0175',
-  '0259',
-  '0376',
-  '0379',
-  '0391',
-  '0511',
-  '0595',
-  '0655',
-  '1027',
-  '1070',
-  '1284',
-  '1564',
-  '1802',
-  '1924',
-  '2112',
-  '2285',
-  '2327',
-  '2541',
-  '2576',
-  '2705',
-  '2893',
-  '3032',
-  '3202',
-  '3214',
-  '3353',
-  '3355',
-  '3552',
-  '3637',
-  '3641',
-  '3784',
-  '3895',
-  '3986',
-  '4010',
-  '4066',
-  '4068',
-  '4263',
-  '4521',
-  '4589',
-  '4650',
-  '4679',
-  '4967',
-  '5005',
-  '5210',
-  '5286',
-  '5318',
-  '5325',
-  '5415',
-  '5573',
-  '5677',
-  '5738',
-  '5790',
-  '5799',
-  '5851',
-  '5910',
-  '6030',
-  '6057',
-  '6185',
-  '6684',
-  '6747',
-  '6800',
-  '6803',
-  '7002',
-  '7088',
-  '7172',
-  '7457',
-  '7484',
-  '7533',
-  '7555',
-  '7563',
-  '7784',
-  '7946',
-  '8173',
-  '8211',
-  '8300',
-  '8319',
-  '8408',
-  '8468',
-  '8706',
-  '8713',
-  '8730',
-  '8848',
-  '9083',
-  '9173',
-  '9223',
-  '9226',
-  '9301',
-  '9326',
-  '9367',
-  '9377',
-  '9402',
-  '9585',
-  '9644',
-  '9662',
-  '9683',
-  '9784',
-  '9824',
-]
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/captcha/helpers/createCaptcha.ts.html b/src/api/coverage/lcov-report/src/captcha/helpers/createCaptcha.ts.html deleted file mode 100644 index 4230d92..0000000 --- a/src/api/coverage/lcov-report/src/captcha/helpers/createCaptcha.ts.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - Code coverage report for src/captcha/helpers/createCaptcha.ts - - - - - - - - - -
-
-

All files / src/captcha/helpers createCaptcha.ts

-
- -
- 100% - Statements - 7/7 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 7/7 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27  -  -  -  -  -18x -18x -  -  -  -  -  -18x -21x -  -21x -  -21x -  -  -  -  -  -  -21x -  - 
import { ObjectId } from 'mongodb'
- 
-import { Captcha } from '../../shared/captcha/Captcha'
-import { CaptchaFor } from '../../shared/captcha/CaptchaFor'
-import { CaptchaPair } from '../../shared/captcha/CaptchaPair'
-import { CaptchaModel } from '../captcha.model'
-import { getRandomCaptchaPair } from './getRandomCaptchaPair'
- 
-interface CreateCaptcha {
-  (userId: ObjectId, captchaFor: CaptchaFor): Promise<Captcha>
-}
- 
-export const createCaptcha: CreateCaptcha = async (userId, captchaFor) => {
-  await CaptchaModel.deleteOne({ userId, captchaFor })
- 
-  const captchaPair: CaptchaPair = getRandomCaptchaPair()
- 
-  const captcha: Captcha = await new CaptchaModel({
-    userId,
-    index: captchaPair.captchaIndex,
-    solution: captchaPair.captchaSolution,
-    captchaFor,
-  }).save()
- 
-  return captcha
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/captcha/helpers/getRandomCaptchaPair.ts.html b/src/api/coverage/lcov-report/src/captcha/helpers/getRandomCaptchaPair.ts.html deleted file mode 100644 index 8b41cd5..0000000 --- a/src/api/coverage/lcov-report/src/captcha/helpers/getRandomCaptchaPair.ts.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - Code coverage report for src/captcha/helpers/getRandomCaptchaPair.ts - - - - - - - - - -
-
-

All files / src/captcha/helpers getRandomCaptchaPair.ts

-
- -
- 100% - Statements - 6/6 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 6/6 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21  -  -  -  -19x -  -  -  -  -  -19x -2x -2x -2x -  -  -  -  -2x -  - 
/* eslint-disable security/detect-object-injection */
- 
-import { CaptchaPair } from '../../shared/captcha/CaptchaPair'
-import { CaptchaSolution } from '../../shared/captcha/CaptchaSolution'
-import { captchaSolutions } from './captchaSolutions'
- 
-interface GetRandomCaptcha {
-  (): CaptchaPair
-}
- 
-export const getRandomCaptchaPair: GetRandomCaptcha = () => {
-  const captchaIndex: number = Math.floor(Math.random() * 100)
-  const captchaSolution: CaptchaSolution = captchaSolutions[captchaIndex]
-  const captchaPair: CaptchaPair = {
-    captchaIndex,
-    captchaSolution,
-  }
- 
-  return captchaPair
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/captcha/helpers/index.html b/src/api/coverage/lcov-report/src/captcha/helpers/index.html deleted file mode 100644 index 2b42cda..0000000 --- a/src/api/coverage/lcov-report/src/captcha/helpers/index.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - Code coverage report for src/captcha/helpers - - - - - - - - - -
-
-

All files src/captcha/helpers

-
- -
- 100% - Statements - 14/14 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 2/2 -
- - -
- 100% - Lines - 14/14 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
captchaSolutions.ts -
-
100%1/1100%0/0100%0/0100%1/1
createCaptcha.ts -
-
100%7/7100%0/0100%1/1100%7/7
getRandomCaptchaPair.ts -
-
100%6/6100%0/0100%1/1100%6/6
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/captcha/index.html b/src/api/coverage/lcov-report/src/captcha/index.html deleted file mode 100644 index 686b143..0000000 --- a/src/api/coverage/lcov-report/src/captcha/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/captcha - - - - - - - - - -
-
-

All files src/captcha

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
captcha.model.ts -
-
100%3/3100%0/0100%0/0100%3/3
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/comment/addCommentView/addCommentView.ts.html b/src/api/coverage/lcov-report/src/comment/addCommentView/addCommentView.ts.html deleted file mode 100644 index 8e799d7..0000000 --- a/src/api/coverage/lcov-report/src/comment/addCommentView/addCommentView.ts.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - Code coverage report for src/comment/addCommentView/addCommentView.ts - - - - - - - - - -
-
-

All files / src/comment/addCommentView addCommentView.ts

-
- -
- 100% - Statements - 15/15 -
- - -
- 100% - Branches - 5/5 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 15/15 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -281x -1x -  -  -1x -1x -  -1x -  -1x -2x -2x -2x -  -2x -  -  -  -  -2x -1x -  -1x -1x -  -1x -  - 
import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { firstError } from '../../helpers/firstError'
-import { AddCommentViewArgs } from '../../shared/comment/AddCommentViewArgs'
-import { UpdateRes } from '../../shared/mongo/UpdateRes'
-import { CommentModel } from '../comment.model'
- 
-export const addCommentView = async (ctx: Context, next: Next): Promise<void> => {
-  const addCommentViewArgs = plainToClass(AddCommentViewArgs, ctx.request.body, { excludeExtraneousValues: true })
-  await validateOrReject(addCommentViewArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { commentId } = addCommentViewArgs
- 
-  const incrementViewCount: UpdateRes = await CommentModel.updateOne(
-    { _id: commentId },
-    { $inc: { viewCount: 1 } },
-  ).exec()
- 
-  if (!(incrementViewCount && incrementViewCount.nModified && incrementViewCount.nModified >= 1))
-    throw new Error('Comment not found')
- 
-  ctx.status = 200
-  ctx.body = { status: true }
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/comment/addCommentView/index.html b/src/api/coverage/lcov-report/src/comment/addCommentView/index.html deleted file mode 100644 index f364025..0000000 --- a/src/api/coverage/lcov-report/src/comment/addCommentView/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/comment/addCommentView - - - - - - - - - -
-
-

All files src/comment/addCommentView

-
- -
- 100% - Statements - 15/15 -
- - -
- 100% - Branches - 5/5 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 15/15 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
addCommentView.ts -
-
100%15/15100%5/5100%1/1100%15/15
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/comment/comment.model.ts.html b/src/api/coverage/lcov-report/src/comment/comment.model.ts.html deleted file mode 100644 index 25bd633..0000000 --- a/src/api/coverage/lcov-report/src/comment/comment.model.ts.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - Code coverage report for src/comment/comment.model.ts - - - - - - - - - -
-
-

All files / src/comment comment.model.ts

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -55x -5x -  -5x - 
import { getModelForClass } from '@typegoose/typegoose'
-import { Comment } from '../shared/comment/Comment'
- 
-export const CommentModel = getModelForClass(Comment, { schemaOptions: { timestamps: true } })
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/comment/getCommentWithPublicUser/getCommentWithPublicUser.ts.html b/src/api/coverage/lcov-report/src/comment/getCommentWithPublicUser/getCommentWithPublicUser.ts.html deleted file mode 100644 index 5cf9fac..0000000 --- a/src/api/coverage/lcov-report/src/comment/getCommentWithPublicUser/getCommentWithPublicUser.ts.html +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - Code coverage report for src/comment/getCommentWithPublicUser/getCommentWithPublicUser.ts - - - - - - - - - -
-
-

All files / src/comment/getCommentWithPublicUser getCommentWithPublicUser.ts

-
- -
- 100% - Statements - 21/21 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 19/19 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -371x -1x -  -  -1x -  -  -1x -  -1x -1x -1x -  -1x -3x -  -  -3x -3x -  -3x -3x -  -2x -  -  -  -2x -  -1x -  -1x -1x -  -1x -  - 
import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { firstError } from '../../helpers/firstError'
-import { Comment } from '../../shared/comment/Comment'
-import { CommentWithPublicUser } from '../../shared/comment/CommentWithPublicUser'
-import { GetCommentWithPublicUserArgs } from '../../shared/comment/GetCommentWithPublicUserArgs'
-import { PublicUser } from '../../shared/user/PublicUser'
-import { PUBLIC_USER_MONGO_SELECTOR } from '../../user/getPublicUser/getPublicUser'
-import { UserModel } from '../../user/user.model'
-import { CommentModel } from '../comment.model'
- 
-export const getCommentWithPublicUser = async (ctx: Context, next: Next): Promise<void> => {
-  const getCommentWithPublicUserArgs = plainToClass(GetCommentWithPublicUserArgs, ctx.request.body, {
-    excludeExtraneousValues: true,
-  })
-  await validateOrReject(getCommentWithPublicUserArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { commentId } = getCommentWithPublicUserArgs
- 
-  const comment = (await CommentModel.findOne({ _id: commentId }).lean()) as Comment
-  if (!comment) throw new Error('Comment not found')
- 
-  const publicUser: PublicUser = (await UserModel.findOne(
-    { _id: comment.userId },
-    PUBLIC_USER_MONGO_SELECTOR,
-  ).lean()) as PublicUser
-  if (!publicUser) throw new Error('User not found')
- 
-  const commentWithPublicUser: CommentWithPublicUser = { comment, publicUser }
- 
-  ctx.status = 200
-  ctx.body = { commentWithPublicUser }
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/comment/getCommentWithPublicUser/index.html b/src/api/coverage/lcov-report/src/comment/getCommentWithPublicUser/index.html deleted file mode 100644 index 89e2534..0000000 --- a/src/api/coverage/lcov-report/src/comment/getCommentWithPublicUser/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/comment/getCommentWithPublicUser - - - - - - - - - -
-
-

All files src/comment/getCommentWithPublicUser

-
- -
- 100% - Statements - 21/21 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 19/19 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
getCommentWithPublicUser.ts -
-
100%21/21100%4/4100%1/1100%19/19
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/comment/getLatestCommentsWithPublicUsers/getLatestCommentsWithPublicUsers.ts.html b/src/api/coverage/lcov-report/src/comment/getLatestCommentsWithPublicUsers/getLatestCommentsWithPublicUsers.ts.html deleted file mode 100644 index a542a63..0000000 --- a/src/api/coverage/lcov-report/src/comment/getLatestCommentsWithPublicUsers/getLatestCommentsWithPublicUsers.ts.html +++ /dev/null @@ -1,200 +0,0 @@ - - - - - - Code coverage report for src/comment/getLatestCommentsWithPublicUsers/getLatestCommentsWithPublicUsers.ts - - - - - - - - - -
-
-

All files / src/comment/getLatestCommentsWithPublicUsers getLatestCommentsWithPublicUsers.ts

-
- -
- 100% - Statements - 24/24 -
- - -
- 100% - Branches - 6/6 -
- - -
- 100% - Functions - 2/2 -
- - -
- 100% - Lines - 21/21 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -411x -1x -  -  -1x -  -  -1x -  -1x -1x -1x -  -1x -2x -  -  -2x -2x -  -2x -2x -2x -  -  -  -  -  -2x -  -2x -2x -  -2x -  -2x -2x -  -2x -  - 
import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { firstError } from '../../helpers/firstError'
-import { Comment } from '../../shared/comment/Comment'
-import { CommentsWithPublicUsers } from '../../shared/comment/CommentsWithPublicUsers'
-import { GetLatestCommentsWithPublicUsersArgs } from '../../shared/comment/GetLatestCommentsWithPublicUsersArgs'
-import { PublicUser } from '../../shared/user/PublicUser'
-import { PUBLIC_USER_MONGO_SELECTOR } from '../../user/getPublicUser/getPublicUser'
-import { UserModel } from '../../user/user.model'
-import { CommentModel } from '../comment.model'
- 
-export const getLatestCommentsWithPublicUsers = async (ctx: Context, next: Next): Promise<void> => {
-  const getLatestCommentsWithPublicUsersArgs = plainToClass(GetLatestCommentsWithPublicUsersArgs, ctx.request.body, {
-    excludeExtraneousValues: true,
-  })
-  await validateOrReject(getLatestCommentsWithPublicUsersArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { cursorId } = getLatestCommentsWithPublicUsersArgs
- 
-  let selector = {}
-  if (cursorId) selector = { _id: { $lt: cursorId } }
-  let comments: Comment[] = await CommentModel.find(selector, null, {
-    limit: 20,
-    // sort: { createdAt: -1 },
-  })
-    .lean()
-    .exec()
-  if (!comments || comments.length === 0) comments = []
- 
-  const userIds = comments.map((comment) => comment.userId)
-  const publicUsers: PublicUser[] = await UserModel.find({ _id: { $in: userIds } }, PUBLIC_USER_MONGO_SELECTOR).lean()
- 
-  const commentsWithPublicUsers: CommentsWithPublicUsers = { comments, publicUsers }
- 
-  ctx.status = 200
-  ctx.body = { commentsWithPublicUsers }
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/comment/getLatestCommentsWithPublicUsers/index.html b/src/api/coverage/lcov-report/src/comment/getLatestCommentsWithPublicUsers/index.html deleted file mode 100644 index 5e7f475..0000000 --- a/src/api/coverage/lcov-report/src/comment/getLatestCommentsWithPublicUsers/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/comment/getLatestCommentsWithPublicUsers - - - - - - - - - -
-
-

All files src/comment/getLatestCommentsWithPublicUsers

-
- -
- 100% - Statements - 24/24 -
- - -
- 100% - Branches - 6/6 -
- - -
- 100% - Functions - 2/2 -
- - -
- 100% - Lines - 21/21 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
getLatestCommentsWithPublicUsers.ts -
-
100%24/24100%6/6100%2/2100%21/21
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/comment/index.html b/src/api/coverage/lcov-report/src/comment/index.html deleted file mode 100644 index 4e6b02a..0000000 --- a/src/api/coverage/lcov-report/src/comment/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/comment - - - - - - - - - -
-
-

All files src/comment

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
comment.model.ts -
-
100%3/3100%0/0100%0/0100%3/3
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/comment/newComment/index.html b/src/api/coverage/lcov-report/src/comment/newComment/index.html deleted file mode 100644 index 7606683..0000000 --- a/src/api/coverage/lcov-report/src/comment/newComment/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/comment/newComment - - - - - - - - - -
-
-

All files src/comment/newComment

-
- -
- 96.3% - Statements - 26/27 -
- - -
- 50% - Branches - 2/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 26/26 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
newComment.ts -
-
96.3%26/2750%2/4100%1/1100%26/26
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/comment/newComment/newComment.ts.html b/src/api/coverage/lcov-report/src/comment/newComment/newComment.ts.html deleted file mode 100644 index c029dc8..0000000 --- a/src/api/coverage/lcov-report/src/comment/newComment/newComment.ts.html +++ /dev/null @@ -1,251 +0,0 @@ - - - - - - Code coverage report for src/comment/newComment/newComment.ts - - - - - - - - - -
-
-

All files / src/comment/newComment newComment.ts

-
- -
- 96.3% - Statements - 26/27 -
- - -
- 50% - Branches - 2/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 26/26 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -581x -1x -  -1x -  -1x -  -  -1x -  -  -1x -1x -1x -1x -1x -1x -1x -  -1x -1x -1x -1x -  -1x -  -1x -  -1x -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -1x -  -  -  -1x -  -1x -  -1x -1x -  -1x -  - 
import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
-import * as getSlug from 'speakingurl'
- 
-import { firstError } from '../../helpers/firstError'
-import { Comment } from '../../shared/comment/Comment'
-import { CommentWithPublicUser } from '../../shared/comment/CommentWithPublicUser'
-import { NewCommentArgs } from '../../shared/comment/NewCommentArgs'
-import { PublicUser } from '../../shared/user/PublicUser'
-import { User } from '../../shared/user/User'
-import { VoteDirection } from '../../shared/vote/VoteDirection'
-import { PUBLIC_USER_MONGO_SELECTOR } from '../../user/getPublicUser/getPublicUser'
-import { authenticate } from '../../user/helpers/authenticate'
-import { rateLimit } from '../../user/helpers/rateLimit'
-import { UserModel } from '../../user/user.model'
-import { VoteModel } from '../../vote/vote.model'
-import { CommentModel } from '../comment.model'
- 
-export const newComment = async (ctx: Context, next: Next): Promise<void> => {
-  const newCommentArgs = plainToClass(NewCommentArgs, ctx.request.body, { excludeExtraneousValues: true })
-  await validateOrReject(newCommentArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { title, content, category, image } = newCommentArgs
- 
-  const user: User = await authenticate(ctx)
- 
-  await rateLimit(user, 5)
- 
-  const comment: Comment = (await new CommentModel({
-    userId: user._id,
-    title,
-    slug: title ? getSlug(title) : undefined,
-    content,
-    category,
-    image,
-    upCount: 1,
-  }).save()) as Comment
- 
-  await new VoteModel({
-    userId: user._id,
-    commentId: comment._id,
-    direction: VoteDirection.UP,
-  }).save()
- 
-  const publicUser: PublicUser = (await UserModel.findOne(
-    { _id: user._id },
-    PUBLIC_USER_MONGO_SELECTOR,
-  ).lean()) as PublicUser
-  Iif (!publicUser) throw new Error('User not found')
- 
-  const commentWithPublicUser: CommentWithPublicUser = { comment, publicUser }
- 
-  ctx.status = 200
-  ctx.body = { commentWithPublicUser }
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/constants.ts.html b/src/api/coverage/lcov-report/src/constants.ts.html deleted file mode 100644 index dab1a23..0000000 --- a/src/api/coverage/lcov-report/src/constants.ts.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - Code coverage report for src/constants.ts - - - - - - - - -
-
-

All files / src constants.ts

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -418x -18x -18x - 
export const TEST = 'test'
-export const DEVELOPMENT = 'development'
-export const PRODUCTION = 'production'
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/helpers/clone.ts.html b/src/api/coverage/lcov-report/src/helpers/clone.ts.html deleted file mode 100644 index e429d94..0000000 --- a/src/api/coverage/lcov-report/src/helpers/clone.ts.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - Code coverage report for src/helpers/clone.ts - - - - - - - - -
-
-

All files / src/helpers clone.ts

-
- -
- 100% - Statements - 2/2 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 2/2 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6  -  -1x -4x -  - 
import { Context } from 'koa'
- 
-export const clone = (ctx: Context): Context => {
-  return JSON.parse(JSON.stringify(ctx))
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/helpers/dayjs.ts.html b/src/api/coverage/lcov-report/src/helpers/dayjs.ts.html deleted file mode 100644 index 8a00328..0000000 --- a/src/api/coverage/lcov-report/src/helpers/dayjs.ts.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - Code coverage report for src/helpers/dayjs.ts - - - - - - - - -
-
-

All files / src/helpers dayjs.ts

-
- -
- 100% - Statements - 2/2 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 2/2 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -418x -  -18x - 
import * as dayjs from 'dayjs'
- 
-export const DayJs = dayjs
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/helpers/firstError.ts.html b/src/api/coverage/lcov-report/src/helpers/firstError.ts.html deleted file mode 100644 index f7b04cd..0000000 --- a/src/api/coverage/lcov-report/src/helpers/firstError.ts.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - Code coverage report for src/helpers/firstError.ts - - - - - - - - -
-
-

All files / src/helpers firstError.ts

-
- -
- 100% - Statements - 5/5 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 4/4 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8  -18x -  -18x -3x -3x -  - 
import { ValidationError } from 'class-validator'
-import { ResponseError } from '../shared/mongo/ResponseError'
- 
-export const firstError = (errors: ValidationError[]): void => {
-  const firstConstraint = errors[0] && errors[0].constraints
-  if (firstConstraint) throw new ResponseError(400, firstConstraint[Object.keys(firstConstraint)[0]])
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/helpers/index.html b/src/api/coverage/lcov-report/src/helpers/index.html deleted file mode 100644 index 7809d96..0000000 --- a/src/api/coverage/lcov-report/src/helpers/index.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - Code coverage report for src/helpers - - - - - - - - -
-
-

All files src/helpers

-
- -
- 100% - Statements - 14/14 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 2/2 -
- - -
- 100% - Lines - 13/13 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
clone.ts -
-
100%2/2100%0/0100%1/1100%2/2
dayjs.ts -
-
100%2/2100%0/0100%0/0100%2/2
firstError.ts -
-
100%5/5100%4/4100%1/1100%4/4
typegoose.ts -
-
100%5/5100%0/0100%0/0100%5/5
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/helpers/sanitize.ts.html b/src/api/coverage/lcov-report/src/helpers/sanitize.ts.html deleted file mode 100644 index 85b95bc..0000000 --- a/src/api/coverage/lcov-report/src/helpers/sanitize.ts.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - Code coverage report for src/helpers/sanitize.ts - - - - - - - - - -
-
-

All files / src/helpers sanitize.ts

-
- -
- 100% - Statements - 8/8 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 2/2 -
- - -
- 100% - Lines - 8/8 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -1315x -15x -  -15x -41x -41x -1x -1x -  -  -40x -  - 
import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
- 
-export const sanitize = async (input: any, validator: any): Promise<any> => {
-  const signUpArgs = plainToClass(validator, input, { excludeExtraneousValues: true })
-  await validateOrReject(signUpArgs, { forbidUnknownValues: true }).catch((errors) => {
-    const obj = errors[0].constraints
-    throw new Error(obj[Object.keys(obj)[0]])
-  })
- 
-  return { ...signUpArgs }
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/helpers/typegoose.ts.html b/src/api/coverage/lcov-report/src/helpers/typegoose.ts.html deleted file mode 100644 index be9908a..0000000 --- a/src/api/coverage/lcov-report/src/helpers/typegoose.ts.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - Code coverage report for src/helpers/typegoose.ts - - - - - - - - -
-
-

All files / src/helpers typegoose.ts

-
- -
- 100% - Statements - 5/5 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 5/5 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -718x -  -18x -18x -18x -18x - 
import { prop, index, getModelForClass, modelOptions } from '@typegoose/typegoose'
- 
-export const Property = prop
-export const Index = index
-export const getModel = getModelForClass
-export const ModelOptions = modelOptions
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/index.html b/src/api/coverage/lcov-report/src/index.html deleted file mode 100644 index 42409b4..0000000 --- a/src/api/coverage/lcov-report/src/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src - - - - - - - - -
-
-

All files src

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
constants.ts -
-
100%3/3100%0/0100%0/0100%3/3
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/notification/getLatestNotifications/getLatestNotifications.ts.html b/src/api/coverage/lcov-report/src/notification/getLatestNotifications/getLatestNotifications.ts.html deleted file mode 100644 index 095ff10..0000000 --- a/src/api/coverage/lcov-report/src/notification/getLatestNotifications/getLatestNotifications.ts.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - Code coverage report for src/notification/getLatestNotifications/getLatestNotifications.ts - - - - - - - - - -
-
-

All files / src/notification/getLatestNotifications getLatestNotifications.ts

-
- -
- 100% - Statements - 8/8 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 8/8 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23  -  -1x -  -  -1x -  -1x -1x -  -1x -  -  -  -  -  -  -1x -1x -  -1x -  - 
import { Context, Next } from 'koa'
- 
-import { NotificationModel } from '../../notification/notification.model'
-import { Notification } from '../../shared/notification/Notification'
-import { User } from '../../shared/user/User'
-import { authenticate } from '../../user/helpers/authenticate'
- 
-export const getLatestNotifications = async (ctx: Context, next: Next): Promise<void> => {
-  const user: User = await authenticate(ctx)
- 
-  const notifications: Notification[] = await NotificationModel.find({ userId: user._id }, null, {
-    limit: 50,
-    sort: { updatedAt: -1 },
-  })
-    .lean()
-    .exec()
- 
-  ctx.status = 200
-  ctx.body = { notifications }
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/notification/getLatestNotifications/index.html b/src/api/coverage/lcov-report/src/notification/getLatestNotifications/index.html deleted file mode 100644 index 8f21b43..0000000 --- a/src/api/coverage/lcov-report/src/notification/getLatestNotifications/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/notification/getLatestNotifications - - - - - - - - - -
-
-

All files src/notification/getLatestNotifications

-
- -
- 100% - Statements - 8/8 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 8/8 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
getLatestNotifications.ts -
-
100%8/8100%0/0100%1/1100%8/8
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/notification/index.html b/src/api/coverage/lcov-report/src/notification/index.html deleted file mode 100644 index 804bc27..0000000 --- a/src/api/coverage/lcov-report/src/notification/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/notification - - - - - - - - - -
-
-

All files src/notification

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
notification.model.ts -
-
100%3/3100%0/0100%0/0100%3/3
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/notification/notification.model.ts.html b/src/api/coverage/lcov-report/src/notification/notification.model.ts.html deleted file mode 100644 index 66fbe38..0000000 --- a/src/api/coverage/lcov-report/src/notification/notification.model.ts.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - Code coverage report for src/notification/notification.model.ts - - - - - - - - - -
-
-

All files / src/notification notification.model.ts

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -52x -2x -  -2x - 
import { getModelForClass } from '@typegoose/typegoose'
-import { Notification } from '../shared/notification/Notification'
- 
-export const NotificationModel = getModelForClass(Notification, { schemaOptions: { timestamps: true } })
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/captcha/captcha.model.ts.html b/src/api/coverage/lcov-report/src/resolvers/captcha/captcha.model.ts.html deleted file mode 100644 index eb4d428..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/captcha/captcha.model.ts.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - Code coverage report for src/resolvers/captcha/captcha.model.ts - - - - - - - - - -
-
-

All files / src/resolvers/captcha captcha.model.ts

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -618x -  -18x -  -18x - 
import { getModelForClass } from '@typegoose/typegoose'
- 
-import { Captcha } from '../../shared/captcha/Captcha'
- 
-export const CaptchaModel = getModelForClass(Captcha, { schemaOptions: { timestamps: true } })
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/captcha/helpers/captchaSolutions.ts.html b/src/api/coverage/lcov-report/src/resolvers/captcha/helpers/captchaSolutions.ts.html deleted file mode 100644 index ae0c55d..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/captcha/helpers/captchaSolutions.ts.html +++ /dev/null @@ -1,391 +0,0 @@ - - - - - - Code coverage report for src/resolvers/captcha/helpers/captchaSolutions.ts - - - - - - - - -
-
-

All files / src/resolvers/captcha/helpers captchaSolutions.ts

-
- -
- 100% - Statements - 1/1 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 1/1 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105  -  -19x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import { CaptchaSolution } from '../../../shared/captcha/CaptchaSolution'
- 
-export const captchaSolutions: CaptchaSolution[] = [
-  '0021',
-  '0031',
-  '0054',
-  '0160',
-  '0175',
-  '0259',
-  '0376',
-  '0379',
-  '0391',
-  '0511',
-  '0595',
-  '0655',
-  '1027',
-  '1070',
-  '1284',
-  '1564',
-  '1802',
-  '1924',
-  '2112',
-  '2285',
-  '2327',
-  '2541',
-  '2576',
-  '2705',
-  '2893',
-  '3032',
-  '3202',
-  '3214',
-  '3353',
-  '3355',
-  '3552',
-  '3637',
-  '3641',
-  '3784',
-  '3895',
-  '3986',
-  '4010',
-  '4066',
-  '4068',
-  '4263',
-  '4521',
-  '4589',
-  '4650',
-  '4679',
-  '4967',
-  '5005',
-  '5210',
-  '5286',
-  '5318',
-  '5325',
-  '5415',
-  '5573',
-  '5677',
-  '5738',
-  '5790',
-  '5799',
-  '5851',
-  '5910',
-  '6030',
-  '6057',
-  '6185',
-  '6684',
-  '6747',
-  '6800',
-  '6803',
-  '7002',
-  '7088',
-  '7172',
-  '7457',
-  '7484',
-  '7533',
-  '7555',
-  '7563',
-  '7784',
-  '7946',
-  '8173',
-  '8211',
-  '8300',
-  '8319',
-  '8408',
-  '8468',
-  '8706',
-  '8713',
-  '8730',
-  '8848',
-  '9083',
-  '9173',
-  '9223',
-  '9226',
-  '9301',
-  '9326',
-  '9367',
-  '9377',
-  '9402',
-  '9585',
-  '9644',
-  '9662',
-  '9683',
-  '9784',
-  '9824',
-]
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/captcha/helpers/createCaptcha.ts.html b/src/api/coverage/lcov-report/src/resolvers/captcha/helpers/createCaptcha.ts.html deleted file mode 100644 index 5d32805..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/captcha/helpers/createCaptcha.ts.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - Code coverage report for src/resolvers/captcha/helpers/createCaptcha.ts - - - - - - - - -
-
-

All files / src/resolvers/captcha/helpers createCaptcha.ts

-
- -
- 100% - Statements - 7/7 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 7/7 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26  -  -18x -  -  -18x -  -  -  -  -  -18x -22x -  -22x -  -22x -  -  -  -  -  -  -22x -  - 
import { ObjectId } from 'mongodb'
- 
-import { Captcha, CaptchaModel } from '../../../shared/captcha/Captcha'
-import { CaptchaFor } from '../../../shared/captcha/CaptchaFor'
-import { CaptchaPair } from '../../../shared/captcha/CaptchaPair'
-import { getRandomCaptchaPair } from './getRandomCaptchaPair'
- 
-interface CreateCaptcha {
-  (userId: ObjectId, captchaFor: CaptchaFor): Promise<Captcha>
-}
- 
-export const createCaptcha: CreateCaptcha = async (userId, captchaFor) => {
-  await CaptchaModel.deleteOne({ userId, captchaFor })
- 
-  const captchaPair: CaptchaPair = getRandomCaptchaPair()
- 
-  const captcha: Captcha = await new CaptchaModel({
-    userId,
-    index: captchaPair.captchaIndex,
-    solution: captchaPair.captchaSolution,
-    captchaFor,
-  }).save()
- 
-  return captcha
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/captcha/helpers/getRandomCaptchaPair.ts.html b/src/api/coverage/lcov-report/src/resolvers/captcha/helpers/getRandomCaptchaPair.ts.html deleted file mode 100644 index 1a953cd..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/captcha/helpers/getRandomCaptchaPair.ts.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - Code coverage report for src/resolvers/captcha/helpers/getRandomCaptchaPair.ts - - - - - - - - -
-
-

All files / src/resolvers/captcha/helpers getRandomCaptchaPair.ts

-
- -
- 100% - Statements - 6/6 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 6/6 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21  -  -  -  -19x -  -  -  -  -  -19x -2x -2x -2x -  -  -  -  -2x -  - 
/* eslint-disable security/detect-object-injection */
- 
-import { CaptchaPair } from '../../../shared/captcha/CaptchaPair'
-import { CaptchaSolution } from '../../../shared/captcha/CaptchaSolution'
-import { captchaSolutions } from './captchaSolutions'
- 
-interface GetRandomCaptcha {
-  (): CaptchaPair
-}
- 
-export const getRandomCaptchaPair: GetRandomCaptcha = () => {
-  const captchaIndex: number = Math.floor(Math.random() * 100)
-  const captchaSolution: CaptchaSolution = captchaSolutions[captchaIndex]
-  const captchaPair: CaptchaPair = {
-    captchaIndex,
-    captchaSolution,
-  }
- 
-  return captchaPair
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/captcha/helpers/index.html b/src/api/coverage/lcov-report/src/resolvers/captcha/helpers/index.html deleted file mode 100644 index f254be0..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/captcha/helpers/index.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - Code coverage report for src/resolvers/captcha/helpers - - - - - - - - -
-
-

All files src/resolvers/captcha/helpers

-
- -
- 100% - Statements - 14/14 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 2/2 -
- - -
- 100% - Lines - 14/14 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
captchaSolutions.ts -
-
100%1/1100%0/0100%0/0100%1/1
createCaptcha.ts -
-
100%7/7100%0/0100%1/1100%7/7
getRandomCaptchaPair.ts -
-
100%6/6100%0/0100%1/1100%6/6
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/captcha/index.html b/src/api/coverage/lcov-report/src/resolvers/captcha/index.html deleted file mode 100644 index 105c391..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/captcha/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/resolvers/captcha - - - - - - - - - -
-
-

All files src/resolvers/captcha

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
captcha.model.ts -
-
100%3/3100%0/0100%0/0100%3/3
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/comment/addCommentView/addCommentView.ts.html b/src/api/coverage/lcov-report/src/resolvers/comment/addCommentView/addCommentView.ts.html deleted file mode 100644 index 9ad9f30..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/comment/addCommentView/addCommentView.ts.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - Code coverage report for src/resolvers/comment/addCommentView/addCommentView.ts - - - - - - - - -
-
-

All files / src/resolvers/comment/addCommentView addCommentView.ts

-
- -
- 100% - Statements - 17/17 -
- - -
- 100% - Branches - 5/5 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 16/16 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -291x -1x -  -  -1x -1x -1x -1x -  -  -1x -2x -2x -2x -  -2x -  -  -  -  -2x -2x -  -1x -1x -  -1x -  - 
import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { ResponseError } from '../../../shared/mongo/ResponseError'
-import { firstError } from '../../../helpers/firstError'
-import { AddCommentViewInputs } from '../../../shared/comment/AddCommentView'
-import { CommentModel } from '../../../shared/comment/Comment'
-import { UpdateRes } from '../../../shared/mongo/UpdateRes'
- 
-export const addCommentView = async (ctx: Context, next: Next): Promise<void> => {
-  const addCommentViewArgs = plainToClass(AddCommentViewInputs, ctx.request.body, { excludeExtraneousValues: true })
-  await validateOrReject(addCommentViewArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { commentId } = addCommentViewArgs
- 
-  const incrementViewCount: UpdateRes = await CommentModel.updateOne(
-    { _id: commentId },
-    { $inc: { viewCount: 1 } },
-  ).exec()
- 
-  const viewCountIsIncremented = incrementViewCount && incrementViewCount.nModified && incrementViewCount.nModified >= 1
-  if (!viewCountIsIncremented) throw new ResponseError(400, 'Comment not found')
- 
-  ctx.status = 200
-  ctx.body = {}
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/comment/addCommentView/index.html b/src/api/coverage/lcov-report/src/resolvers/comment/addCommentView/index.html deleted file mode 100644 index 5b6ffa5..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/comment/addCommentView/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/resolvers/comment/addCommentView - - - - - - - - -
-
-

All files src/resolvers/comment/addCommentView

-
- -
- 100% - Statements - 17/17 -
- - -
- 100% - Branches - 5/5 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 16/16 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
addCommentView.ts -
-
100%17/17100%5/5100%1/1100%16/16
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/comment/comment.model.ts.html b/src/api/coverage/lcov-report/src/resolvers/comment/comment.model.ts.html deleted file mode 100644 index ef33699..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/comment/comment.model.ts.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - Code coverage report for src/resolvers/comment/comment.model.ts - - - - - - - - - -
-
-

All files / src/resolvers/comment comment.model.ts

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -55x -5x -  -5x - 
import { getModelForClass } from '@typegoose/typegoose'
-import { Comment } from '../../shared/comment/Comment'
- 
-export const CommentModel = getModelForClass(Comment, { schemaOptions: { timestamps: true } })
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/comment/getComment/getComment.ts.html b/src/api/coverage/lcov-report/src/resolvers/comment/getComment/getComment.ts.html deleted file mode 100644 index 5a288ff..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/comment/getComment/getComment.ts.html +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - Code coverage report for src/resolvers/comment/getComment/getComment.ts - - - - - - - - -
-
-

All files / src/resolvers/comment/getComment getComment.ts

-
- -
- 100% - Statements - 22/22 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 20/20 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -361x -1x -  -  -1x -1x -1x -1x -  -1x -1x -  -1x -3x -  -  -3x -3x -  -3x -3x -  -2x -  -  -  -2x -  -1x -  -1x -1x -  -1x -  - 
import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { firstError } from '../../../helpers/firstError'
-import { Comment, CommentModel } from '../../../shared/comment/Comment'
-import { GetCommentInputs, GetCommentOutputs } from '../../../shared/comment/GetComment'
-import { ResponseError } from '../../../shared/mongo/ResponseError'
-import { PublicUser } from '../../../shared/user/PublicUser'
-import { UserModel } from '../../../shared/user/User'
-import { PUBLIC_USER_MONGO_SELECTOR } from '../../user/getPublicUser/getPublicUser'
- 
-export const getComment = async (ctx: Context, next: Next): Promise<void> => {
-  const getCommentArgs = plainToClass(GetCommentInputs, ctx.request.body, {
-    excludeExtraneousValues: true,
-  })
-  await validateOrReject(getCommentArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { commentId } = getCommentArgs
- 
-  const comment = (await CommentModel.findOne({ _id: commentId }).lean()) as Comment
-  if (!comment) throw new ResponseError(404, 'Comment not found')
- 
-  const user: PublicUser = (await UserModel.findOne(
-    { _id: comment.userId },
-    PUBLIC_USER_MONGO_SELECTOR,
-  ).lean()) as PublicUser
-  if (!user) throw new ResponseError(404, 'User not found')
- 
-  const reponse: GetCommentOutputs = { comment, user }
- 
-  ctx.status = 200
-  ctx.body = reponse
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/comment/getComment/index.html b/src/api/coverage/lcov-report/src/resolvers/comment/getComment/index.html deleted file mode 100644 index abbd8f6..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/comment/getComment/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/resolvers/comment/getComment - - - - - - - - -
-
-

All files src/resolvers/comment/getComment

-
- -
- 100% - Statements - 22/22 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 20/20 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
getComment.ts -
-
100%22/22100%4/4100%1/1100%20/20
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/comment/getCommentWithPublicUser/getCommentWithPublicUser.ts.html b/src/api/coverage/lcov-report/src/resolvers/comment/getCommentWithPublicUser/getCommentWithPublicUser.ts.html deleted file mode 100644 index d45d760..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/comment/getCommentWithPublicUser/getCommentWithPublicUser.ts.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - Code coverage report for src/resolvers/comment/getCommentWithPublicUser/getCommentWithPublicUser.ts - - - - - - - - -
-
-

All files / src/resolvers/comment/getCommentWithPublicUser getCommentWithPublicUser.ts

-
- -
- 100% - Statements - 22/22 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 20/20 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -371x -1x -  -  -1x -1x -  -1x -1x -  -1x -1x -  -1x -3x -  -  -3x -3x -  -3x -3x -  -2x -  -  -  -2x -  -1x -  -1x -1x -  -1x -  - 
import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { firstError } from '../../../helpers/firstError'
-import { Comment, CommentModel } from '../../../shared/comment/Comment'
-import { CommentWithPublicUser } from '../../../shared/comment/CommentWithPublicUser'
-import { GetCommentWithPublicUserArgs } from '../../../shared/comment/GetCommentWithPublicUserArgs'
-import { ResponseError } from '../../../shared/mongo/ResponseError'
-import { PublicUser } from '../../../shared/user/PublicUser'
-import { UserModel } from '../../../shared/user/User'
-import { PUBLIC_USER_MONGO_SELECTOR } from '../../user/getPublicUser/getPublicUser'
- 
-export const getCommentWithPublicUser = async (ctx: Context, next: Next): Promise<void> => {
-  const getCommentWithPublicUserArgs = plainToClass(GetCommentWithPublicUserArgs, ctx.request.body, {
-    excludeExtraneousValues: true,
-  })
-  await validateOrReject(getCommentWithPublicUserArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { commentId } = getCommentWithPublicUserArgs
- 
-  const comment = (await CommentModel.findOne({ _id: commentId }).lean()) as Comment
-  if (!comment) throw new ResponseError(404, 'Comment not found')
- 
-  const publicUser: PublicUser = (await UserModel.findOne(
-    { _id: comment.userId },
-    PUBLIC_USER_MONGO_SELECTOR,
-  ).lean()) as PublicUser
-  if (!publicUser) throw new ResponseError(404, 'User not found')
- 
-  const commentWithPublicUser: CommentWithPublicUser = { comment, publicUser }
- 
-  ctx.status = 200
-  ctx.body = { commentWithPublicUser }
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/comment/getCommentWithPublicUser/index.html b/src/api/coverage/lcov-report/src/resolvers/comment/getCommentWithPublicUser/index.html deleted file mode 100644 index 2fe6d82..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/comment/getCommentWithPublicUser/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/resolvers/comment/getCommentWithPublicUser - - - - - - - - -
-
-

All files src/resolvers/comment/getCommentWithPublicUser

-
- -
- 100% - Statements - 22/22 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 20/20 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
getCommentWithPublicUser.ts -
-
100%22/22100%4/4100%1/1100%20/20
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/comment/getLatestComments/getLatestComments.ts.html b/src/api/coverage/lcov-report/src/resolvers/comment/getLatestComments/getLatestComments.ts.html deleted file mode 100644 index 9c8154c..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/comment/getLatestComments/getLatestComments.ts.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - Code coverage report for src/resolvers/comment/getLatestComments/getLatestComments.ts - - - - - - - - -
-
-

All files / src/resolvers/comment/getLatestComments getLatestComments.ts

-
- -
- 100% - Statements - 26/26 -
- - -
- 100% - Branches - 10/10 -
- - -
- 100% - Functions - 2/2 -
- - -
- 100% - Lines - 22/22 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -401x -1x -  -  -1x -1x -1x -  -1x -1x -  -1x -2x -  -  -2x -2x -  -2x -2x -2x -  -  -  -  -  -2x -  -2x -2x -2x -  -2x -  -2x -2x -  -2x -  - 
import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { firstError } from '../../../helpers/firstError'
-import { Comment, CommentModel } from '../../../shared/comment/Comment'
-import { GetLatestCommentsInputs, GetLatestCommentsOutputs } from '../../../shared/comment/GetLatestComments'
-import { PublicUser } from '../../../shared/user/PublicUser'
-import { UserModel } from '../../../shared/user/User'
-import { PUBLIC_USER_MONGO_SELECTOR } from '../../user/getPublicUser/getPublicUser'
- 
-export const getLatestComments = async (ctx: Context, next: Next): Promise<void> => {
-  const getLatestCommentsArgs = plainToClass(GetLatestCommentsInputs, ctx.request.body, {
-    excludeExtraneousValues: true,
-  })
-  await validateOrReject(getLatestCommentsArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { cursorId } = getLatestCommentsArgs
- 
-  let selector = {}
-  if (cursorId) selector = { _id: { $lt: cursorId } }
-  let comments: Comment[] = await CommentModel.find(selector, null, {
-    limit: 20,
-    // sort: { createdAt: -1 },
-  })
-    .lean()
-    .exec()
-  if (!comments || comments.length === 0) comments = []
- 
-  const userIds = comments.map((comment) => comment.userId)
-  let users: PublicUser[] = await UserModel.find({ _id: { $in: userIds } }, PUBLIC_USER_MONGO_SELECTOR).lean()
-  if (!users || users.length === 0) users = []
- 
-  const response: GetLatestCommentsOutputs = { comments, users }
- 
-  ctx.status = 200
-  ctx.body = response
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/comment/getLatestComments/index.html b/src/api/coverage/lcov-report/src/resolvers/comment/getLatestComments/index.html deleted file mode 100644 index 58a9d2e..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/comment/getLatestComments/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/resolvers/comment/getLatestComments - - - - - - - - -
-
-

All files src/resolvers/comment/getLatestComments

-
- -
- 100% - Statements - 26/26 -
- - -
- 100% - Branches - 10/10 -
- - -
- 100% - Functions - 2/2 -
- - -
- 100% - Lines - 22/22 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
getLatestComments.ts -
-
100%26/26100%10/10100%2/2100%22/22
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/comment/getLatestCommentsWithPublicUsers/getLatestCommentsWithPublicUsers.ts.html b/src/api/coverage/lcov-report/src/resolvers/comment/getLatestCommentsWithPublicUsers/getLatestCommentsWithPublicUsers.ts.html deleted file mode 100644 index ef7c318..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/comment/getLatestCommentsWithPublicUsers/getLatestCommentsWithPublicUsers.ts.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - Code coverage report for src/resolvers/comment/getLatestCommentsWithPublicUsers/getLatestCommentsWithPublicUsers.ts - - - - - - - - -
-
-

All files / src/resolvers/comment/getLatestCommentsWithPublicUsers getLatestCommentsWithPublicUsers.ts

-
- -
- 100% - Statements - 24/24 -
- - -
- 100% - Branches - 6/6 -
- - -
- 100% - Functions - 2/2 -
- - -
- 100% - Lines - 21/21 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -401x -1x -  -  -1x -1x -  -1x -  -1x -1x -  -1x -2x -  -  -2x -2x -  -2x -2x -2x -  -  -  -  -  -2x -  -2x -2x -  -2x -  -2x -2x -  -2x -  - 
import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { firstError } from '../../../helpers/firstError'
-import { Comment, CommentModel } from '../../../shared/comment/Comment'
-import { CommentsWithPublicUsers } from '../../../shared/comment/CommentsWithPublicUsers'
-import { GetLatestCommentsWithPublicUsersArgs } from '../../../shared/comment/GetLatestCommentsWithPublicUsersArgs'
-import { PublicUser } from '../../../shared/user/PublicUser'
-import { UserModel } from '../../../shared/user/User'
-import { PUBLIC_USER_MONGO_SELECTOR } from '../../user/getPublicUser/getPublicUser'
- 
-export const getLatestCommentsWithPublicUsers = async (ctx: Context, next: Next): Promise<void> => {
-  const getLatestCommentsWithPublicUsersArgs = plainToClass(GetLatestCommentsWithPublicUsersArgs, ctx.request.body, {
-    excludeExtraneousValues: true,
-  })
-  await validateOrReject(getLatestCommentsWithPublicUsersArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { cursorId } = getLatestCommentsWithPublicUsersArgs
- 
-  let selector = {}
-  if (cursorId) selector = { _id: { $lt: cursorId } }
-  let comments: Comment[] = await CommentModel.find(selector, null, {
-    limit: 20,
-    // sort: { createdAt: -1 },
-  })
-    .lean()
-    .exec()
-  if (!comments || comments.length === 0) comments = []
- 
-  const userIds = comments.map((comment) => comment.userId)
-  const publicUsers: PublicUser[] = await UserModel.find({ _id: { $in: userIds } }, PUBLIC_USER_MONGO_SELECTOR).lean()
- 
-  const commentsWithPublicUsers: CommentsWithPublicUsers = { comments, publicUsers }
- 
-  ctx.status = 200
-  ctx.body = { commentsWithPublicUsers }
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/comment/getLatestCommentsWithPublicUsers/index.html b/src/api/coverage/lcov-report/src/resolvers/comment/getLatestCommentsWithPublicUsers/index.html deleted file mode 100644 index d0709f7..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/comment/getLatestCommentsWithPublicUsers/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/resolvers/comment/getLatestCommentsWithPublicUsers - - - - - - - - -
-
-

All files src/resolvers/comment/getLatestCommentsWithPublicUsers

-
- -
- 100% - Statements - 24/24 -
- - -
- 100% - Branches - 6/6 -
- - -
- 100% - Functions - 2/2 -
- - -
- 100% - Lines - 21/21 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
getLatestCommentsWithPublicUsers.ts -
-
100%24/24100%6/6100%2/2100%21/21
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/comment/index.html b/src/api/coverage/lcov-report/src/resolvers/comment/index.html deleted file mode 100644 index 31a320b..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/comment/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/resolvers/comment - - - - - - - - - -
-
-

All files src/resolvers/comment

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
comment.model.ts -
-
100%3/3100%0/0100%0/0100%3/3
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/comment/newComment/index.html b/src/api/coverage/lcov-report/src/resolvers/comment/newComment/index.html deleted file mode 100644 index 62ab923..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/comment/newComment/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/resolvers/comment/newComment - - - - - - - - -
-
-

All files src/resolvers/comment/newComment

-
- -
- 100% - Statements - 23/23 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 23/23 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
newComment.ts -
-
100%23/23100%2/2100%1/1100%23/23
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/comment/newComment/newComment.ts.html b/src/api/coverage/lcov-report/src/resolvers/comment/newComment/newComment.ts.html deleted file mode 100644 index e237424..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/comment/newComment/newComment.ts.html +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - Code coverage report for src/resolvers/comment/newComment/newComment.ts - - - - - - - - -
-
-

All files / src/resolvers/comment/newComment newComment.ts

-
- -
- 100% - Statements - 23/23 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 23/23 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -571x -1x -  -1x -  -1x -1x -  -  -1x -1x -1x -1x -1x -  -1x -2x -2x -2x -  -2x -  -2x -  -2x -  -  -  -  -  -  -  -  -  -  -2x -  -  -  -  -  -2x -  -  -  -  -  -  -  -2x -  -2x -2x -  -2x -  - 
import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
-import * as getSlug from 'speakingurl'
- 
-import { firstError } from '../../../helpers/firstError'
-import { Comment, CommentModel } from '../../../shared/comment/Comment'
-import { PublicUser } from '../../../shared/user/PublicUser'
-import { User } from '../../../shared/user/User'
-import { VoteModel } from '../../../shared/vote/Vote'
-import { VoteDirection } from '../../../shared/vote/VoteDirection'
-import { rateLimit } from '../../quota/rateLimit/rateLimit'
-import { authenticate } from '../../user/helpers/authenticate'
-import { NewCommentInputs, NewCommentOutputs } from '../../../shared/comment/NewComment'
- 
-export const newComment = async (ctx: Context, next: Next): Promise<void> => {
-  const newCommentArgs = plainToClass(NewCommentInputs, ctx.request.body, { excludeExtraneousValues: true })
-  await validateOrReject(newCommentArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { title, content, category, image, commentType } = newCommentArgs
- 
-  const user: User = await authenticate(ctx)
- 
-  await rateLimit(user._id)
- 
-  const comment: Comment = (await new CommentModel({
-    userId: user._id,
-    title,
-    slug: title ? getSlug(title) : undefined,
-    content,
-    category,
-    image,
-    commentType: commentType,
-    upCount: 1,
-  }).save()) as Comment
- 
-  await new VoteModel({
-    userId: user._id,
-    commentId: comment._id,
-    voteDirection: VoteDirection.UP,
-  }).save()
- 
-  const publicUser: PublicUser = {
-    _id: user._id,
-    username: user.username,
-    emailVerified: user.emailVerified,
-    userRole: user.userRole,
-    createdAt: user.createdAt,
-  }
- 
-  const reponse: NewCommentOutputs = { comment, user: publicUser }
- 
-  ctx.status = 200
-  ctx.body = reponse
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/limit/rateLimit/index.html b/src/api/coverage/lcov-report/src/resolvers/limit/rateLimit/index.html deleted file mode 100644 index 98919f2..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/limit/rateLimit/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/resolvers/limit/rateLimit - - - - - - - - -
-
-

All files src/resolvers/limit/rateLimit

-
- -
- 100% - Statements - 9/9 -
- - -
- 100% - Branches - 7/7 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 8/8 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
rateLimit.ts -
-
100%9/9100%7/7100%1/1100%8/8
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/limit/rateLimit/rateLimit.ts.html b/src/api/coverage/lcov-report/src/resolvers/limit/rateLimit/rateLimit.ts.html deleted file mode 100644 index e278c4d..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/limit/rateLimit/rateLimit.ts.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - Code coverage report for src/resolvers/limit/rateLimit/rateLimit.ts - - - - - - - - -
-
-

All files / src/resolvers/limit/rateLimit rateLimit.ts

-
- -
- 100% - Statements - 9/9 -
- - -
- 100% - Branches - 7/7 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 8/8 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25  -  -9x -9x -9x -  -  -  -  -  -9x -52x -  -31x -  -  -  -  -  -  -  -31x -1x -  - 
import { ObjectId } from 'mongodb'
- 
-import { ResponseError } from '../../../shared/mongo/ResponseError'
-import { LimitModel, Limit } from '../../../shared/limit/Limit'
-import { TEST } from '../../../constants'
- 
-interface RateLimit {
-  (userId: ObjectId): Promise<void>
-}
- 
-export const rateLimit: RateLimit = async (userId) => {
-  if (process.env.NODE_ENV === TEST) return
- 
-  const limitBefore: Limit | null = await LimitModel.findOneAndUpdate(
-    { userId },
-    {
-      $inc: { count: 1 },
-    },
-    { upsert: true, setDefaultsOnInsert: true },
-  ).exec()
- 
-  if (limitBefore && limitBefore.count && limitBefore.count >= 30)
-    throw new ResponseError(429, 'Querying too fast. Please wait and retry.')
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/notification/getLatestNotifications/getLatestNotifications.ts.html b/src/api/coverage/lcov-report/src/resolvers/notification/getLatestNotifications/getLatestNotifications.ts.html deleted file mode 100644 index 2703d40..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/notification/getLatestNotifications/getLatestNotifications.ts.html +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - Code coverage report for src/resolvers/notification/getLatestNotifications/getLatestNotifications.ts - - - - - - - - -
-
-

All files / src/resolvers/notification/getLatestNotifications getLatestNotifications.ts

-
- -
- 100% - Statements - 8/8 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 8/8 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22  -  -1x -  -1x -  -1x -1x -  -1x -  -  -  -  -  -  -1x -1x -  -1x -  - 
import { Context, Next } from 'koa'
- 
-import { Notification, NotificationModel } from '../../../shared/notification/Notification'
-import { User } from '../../../shared/user/User'
-import { authenticate } from '../../user/helpers/authenticate'
- 
-export const getLatestNotifications = async (ctx: Context, next: Next): Promise<void> => {
-  const user: User = await authenticate(ctx)
- 
-  const notifications: Notification[] = await NotificationModel.find({ userId: user._id }, null, {
-    limit: 50,
-    sort: { updatedAt: -1 },
-  })
-    .lean()
-    .exec()
- 
-  ctx.status = 200
-  ctx.body = { notifications }
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/notification/getLatestNotifications/index.html b/src/api/coverage/lcov-report/src/resolvers/notification/getLatestNotifications/index.html deleted file mode 100644 index ca27cb2..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/notification/getLatestNotifications/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/resolvers/notification/getLatestNotifications - - - - - - - - -
-
-

All files src/resolvers/notification/getLatestNotifications

-
- -
- 100% - Statements - 8/8 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 8/8 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
getLatestNotifications.ts -
-
100%8/8100%0/0100%1/1100%8/8
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/notification/index.html b/src/api/coverage/lcov-report/src/resolvers/notification/index.html deleted file mode 100644 index 931af17..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/notification/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/resolvers/notification - - - - - - - - - -
-
-

All files src/resolvers/notification

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
notification.model.ts -
-
100%3/3100%0/0100%0/0100%3/3
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/notification/notification.model.ts.html b/src/api/coverage/lcov-report/src/resolvers/notification/notification.model.ts.html deleted file mode 100644 index 837ab4b..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/notification/notification.model.ts.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - Code coverage report for src/resolvers/notification/notification.model.ts - - - - - - - - - -
-
-

All files / src/resolvers/notification notification.model.ts

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -52x -2x -  -2x - 
import { getModelForClass } from '@typegoose/typegoose'
-import { Notification } from '../../shared/notification/Notification'
- 
-export const NotificationModel = getModelForClass(Notification, { schemaOptions: { timestamps: true } })
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/quota/rateLimit/index.html b/src/api/coverage/lcov-report/src/resolvers/quota/rateLimit/index.html deleted file mode 100644 index 5a02cc5..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/quota/rateLimit/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/resolvers/quota/rateLimit - - - - - - - - -
-
-

All files src/resolvers/quota/rateLimit

-
- -
- 100% - Statements - 10/10 -
- - -
- 100% - Branches - 7/7 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 9/9 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
rateLimit.ts -
-
100%10/10100%7/7100%1/1100%9/9
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/quota/rateLimit/rateLimit.ts.html b/src/api/coverage/lcov-report/src/resolvers/quota/rateLimit/rateLimit.ts.html deleted file mode 100644 index 0dd20c7..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/quota/rateLimit/rateLimit.ts.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - Code coverage report for src/resolvers/quota/rateLimit/rateLimit.ts - - - - - - - - -
-
-

All files / src/resolvers/quota/rateLimit rateLimit.ts

-
- -
- 100% - Statements - 10/10 -
- - -
- 100% - Branches - 7/7 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 9/9 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26  -  -9x -9x -9x -9x -  -  -  -  -  -9x -52x -  -31x -  -  -  -  -  -  -  -31x -1x -  - 
import { ObjectId } from 'mongodb'
- 
-import { ResponseError } from '../../../shared/mongo/ResponseError'
-import { QuotaModel, Quota } from '../../../shared/quota/Quota'
-import { TEST } from '../../../constants'
-import { QuotaType } from '../../../shared/quota/QuotaType'
- 
-interface RateLimit {
-  (userId: ObjectId): Promise<void>
-}
- 
-export const rateLimit: RateLimit = async (userId) => {
-  if (process.env.NODE_ENV === TEST) return
- 
-  const limitBefore: Quota | null = await QuotaModel.findOneAndUpdate(
-    { userId, quotaType: QuotaType.RATE_LIMIT },
-    {
-      $inc: { count: 1 },
-    },
-    { upsert: true, setDefaultsOnInsert: true },
-  ).exec()
- 
-  if (limitBefore && limitBefore.count && limitBefore.count >= 30)
-    throw new ResponseError(429, 'Querying too fast. Please wait and retry.')
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/changePassword/changePassword.ts.html b/src/api/coverage/lcov-report/src/resolvers/user/changePassword/changePassword.ts.html deleted file mode 100644 index eaf0b82..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/changePassword/changePassword.ts.html +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/changePassword/changePassword.ts - - - - - - - - -
-
-

All files / src/resolvers/user/changePassword changePassword.ts

-
- -
- 100% - Statements - 21/21 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 21/21 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -341x -1x -1x -  -  -1x -1x -1x -1x -1x -1x -  -1x -2x -  -  -2x -2x -  -2x -  -2x -  -2x -  -1x -1x -  -1x -1x -  -1x -  - 
import { hash } from 'bcryptjs'
-import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { firstError } from '../../../helpers/firstError'
-import { ChangePasswordInputs } from '../../../shared/user/ChangePassword'
-import { User, UserModel } from '../../../shared/user/User'
-import { authenticate } from '../helpers/authenticate'
-import { matchPassword } from '../helpers/matchPassword'
-import { rateLimit } from '../../quota/rateLimit/rateLimit'
- 
-export const changePassword = async (ctx: Context, next: Next): Promise<void> => {
-  const changePasswordArgs = plainToClass(ChangePasswordInputs, ctx.request.body, {
-    excludeExtraneousValues: true,
-  })
-  await validateOrReject(changePasswordArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { password, newPassword } = changePasswordArgs
- 
-  const user: User = await authenticate(ctx)
- 
-  await rateLimit(user._id)
- 
-  await matchPassword(password, user.hashedPassword)
- 
-  const hashedPassword = await hash(newPassword, 12)
-  await UserModel.updateOne({ _id: user._id }, { password: hashedPassword }).exec()
- 
-  ctx.status = 200
-  ctx.body = {}
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/changePassword/index.html b/src/api/coverage/lcov-report/src/resolvers/user/changePassword/index.html deleted file mode 100644 index 54f4987..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/changePassword/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/changePassword - - - - - - - - -
-
-

All files src/resolvers/user/changePassword

-
- -
- 100% - Statements - 21/21 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 21/21 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
changePassword.ts -
-
100%21/21100%0/0100%1/1100%21/21
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/forgotPassword/forgotPassword.ts.html b/src/api/coverage/lcov-report/src/resolvers/user/forgotPassword/forgotPassword.ts.html deleted file mode 100644 index f695a80..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/forgotPassword/forgotPassword.ts.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/forgotPassword/forgotPassword.ts - - - - - - - - -
-
-

All files / src/resolvers/user/forgotPassword forgotPassword.ts

-
- -
- 100% - Statements - 27/27 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 26/26 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -401x -1x -  -  -1x -  -1x -1x -1x -1x -1x -1x -1x -1x -  -1x -3x -3x -3x -  -3x -  -3x -3x -2x -  -3x -  -2x -  -2x -  -2x -  -2x -2x -  -2x -  - 
import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { firstError } from '../../../helpers/firstError'
-import { Captcha } from '../../../shared/captcha/Captcha'
-import { CaptchaFor } from '../../../shared/captcha/CaptchaFor'
-import { ResponseError } from '../../../shared/mongo/ResponseError'
-import { ForgotPasswordInputs } from '../../../shared/user/ForgotPassword'
-import { User, UserModel } from '../../../shared/user/User'
-import { createCaptcha } from '../../captcha/helpers/createCaptcha'
-import { sendEmailForgotPassword } from '../helpers/sendEmailForgotPassword'
-import { verifyRecaptchaToken } from '../helpers/verifyRecaptchaToken'
-import { rateLimit } from '../../quota/rateLimit/rateLimit'
- 
-export const forgotPassword = async (ctx: Context, next: Next): Promise<void> => {
-  const forgotPasswordArgs = plainToClass(ForgotPasswordInputs, ctx.request.body, { excludeExtraneousValues: true })
-  await validateOrReject(forgotPasswordArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { usernameOrEmail, recaptchaToken } = forgotPasswordArgs
- 
-  await verifyRecaptchaToken(recaptchaToken)
- 
-  let user: User | null = await UserModel.findOne({ email: usernameOrEmail }).lean()
-  if (!user) {
-    user = await UserModel.findOne({ username: usernameOrEmail }).lean()
-  }
-  if (!user) throw new ResponseError(401, 'Wrong username or password')
- 
-  await rateLimit(user._id)
- 
-  const captcha: Captcha = await createCaptcha(user._id, CaptchaFor.CAPTCHA_FOR_RESET_PASSWORD)
- 
-  await sendEmailForgotPassword(user.email, captcha.index, captcha.token)
- 
-  ctx.status = 200
-  ctx.body = {}
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/forgotPassword/index.html b/src/api/coverage/lcov-report/src/resolvers/user/forgotPassword/index.html deleted file mode 100644 index e8789cf..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/forgotPassword/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/forgotPassword - - - - - - - - -
-
-

All files src/resolvers/user/forgotPassword

-
- -
- 100% - Statements - 27/27 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 26/26 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
forgotPassword.ts -
-
100%27/27100%4/4100%1/1100%26/26
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/getPublicUser/getPublicUser.ts.html b/src/api/coverage/lcov-report/src/resolvers/user/getPublicUser/getPublicUser.ts.html deleted file mode 100644 index be7f5aa..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/getPublicUser/getPublicUser.ts.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/getPublicUser/getPublicUser.ts - - - - - - - - -
-
-

All files / src/resolvers/user/getPublicUser getPublicUser.ts

-
- -
- 100% - Statements - 18/18 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 17/17 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -283x -3x -  -  -3x -3x -3x -  -3x -  -3x -  -3x -2x -2x -2x -  -2x -2x -  -1x -  -1x -1x -  -1x -  - 
import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { firstError } from '../../../helpers/firstError'
-import { ResponseError } from '../../../shared/mongo/ResponseError'
-import { GetPublicUserInputs, GetPublicUserOutputs } from '../../../shared/user/GetPublicUser'
-import { PublicUser } from '../../../shared/user/PublicUser'
-import { UserModel } from '../../../shared/user/User'
- 
-export const PUBLIC_USER_MONGO_SELECTOR = '_id username emailVerified userRole createdAt'
- 
-export const getPublicUser = async (ctx: Context, next: Next): Promise<void> => {
-  const getPublicUserArgs = plainToClass(GetPublicUserInputs, ctx.request.body, { excludeExtraneousValues: true })
-  await validateOrReject(getPublicUserArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { userId } = getPublicUserArgs
- 
-  const user: PublicUser = (await UserModel.findOne({ _id: userId }, PUBLIC_USER_MONGO_SELECTOR).lean()) as PublicUser
-  if (!user) throw new ResponseError(404, 'User not found')
- 
-  const response: GetPublicUserOutputs = { user }
- 
-  ctx.status = 200
-  ctx.body = response
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/getPublicUser/index.html b/src/api/coverage/lcov-report/src/resolvers/user/getPublicUser/index.html deleted file mode 100644 index 2c72ce4..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/getPublicUser/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/getPublicUser - - - - - - - - -
-
-

All files src/resolvers/user/getPublicUser

-
- -
- 100% - Statements - 18/18 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 17/17 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
getPublicUser.ts -
-
100%18/18100%2/2100%1/1100%17/17
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/helpers/authenticate.ts.html b/src/api/coverage/lcov-report/src/resolvers/user/helpers/authenticate.ts.html deleted file mode 100644 index 6085a65..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/helpers/authenticate.ts.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/helpers/authenticate.ts - - - - - - - - -
-
-

All files / src/resolvers/user/helpers authenticate.ts

-
- -
- 100% - Statements - 13/13 -
- - -
- 100% - Branches - 6/6 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 11/11 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26  -  -7x -  -  -7x -7x -  -  -  -  -  -7x -20x -20x -  -19x -  -19x -  -18x -18x -  -17x -  - 
import { Context } from 'koa'
- 
-import { ResponseError } from '../../../shared/mongo/ResponseError'
-import { Jwt } from '../../../shared/user/Jwt'
-import { JwtPayload } from '../../../shared/user/JwtPayload'
-import { User, UserModel } from '../../../shared/user/User'
-import { verifySignedJwt } from './verifySignedJwt'
- 
-interface Authenticate {
-  (ctx: Context): Promise<User>
-}
- 
-export const authenticate: Authenticate = async (ctx) => {
-  const bearerToken = ctx.request.headers ? ctx.request.headers.authorization : undefined
-  if (!bearerToken) throw new ResponseError(401, 'No bearer token present in request')
- 
-  const jwt: Jwt = bearerToken.replace('Bearer ', '')
- 
-  const jwtPayload: JwtPayload = verifySignedJwt(jwt)
- 
-  const user: User = (await UserModel.findOne({ _id: jwtPayload._id }).lean()) as User
-  if (!user) throw new ResponseError(404, 'User not found')
- 
-  return user
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/helpers/getSignedJwt.ts.html b/src/api/coverage/lcov-report/src/resolvers/user/helpers/getSignedJwt.ts.html deleted file mode 100644 index b30a7c3..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/helpers/getSignedJwt.ts.html +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/helpers/getSignedJwt.ts - - - - - - - - -
-
-

All files / src/resolvers/user/helpers getSignedJwt.ts

-
- -
- 100% - Statements - 8/8 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 8/8 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -3519x -19x -  -  -  -  -  -  -  -  -  -  -19x -22x -  -22x -  -  -  -  -  -  -22x -  -  -  -  -  -  -  -22x -  -22x -  - 
import * as dayjs from 'dayjs'
-import * as jsonwebtoken from 'jsonwebtoken'
-import { Secret, SignOptions } from 'jsonwebtoken'
- 
-import { Jwt } from '../../../shared/user/Jwt'
-import { JwtPayload } from '../../../shared/user/JwtPayload'
-import { UserRole } from '../../../shared/user/UserRole'
- 
-interface GetSignedJwt {
-  (_id: string, username: string, userRole?: UserRole): Jwt
-}
- 
-export const getSignedJwt: GetSignedJwt = (_id, username, userRole) => {
-  const expiresAt: Date = dayjs().add(30, 'day').toDate()
- 
-  const payload: JwtPayload = {
-    _id,
-    username,
-    userRole,
-    expiresAt,
-  }
- 
-  const signOptions: SignOptions = {
-    issuer: 'Entire Stack',
-    subject: username + '',
-    audience: 'https://entirestack.com',
-    expiresIn: '30d',
-    algorithm: 'RS256',
-  }
- 
-  const jwt: Jwt = jsonwebtoken.sign(payload, process.env.JWT_PRIVATE_KEY as Secret, signOptions)
- 
-  return jwt
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/helpers/index.html b/src/api/coverage/lcov-report/src/resolvers/user/helpers/index.html deleted file mode 100644 index 028b6c5..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/helpers/index.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/helpers - - - - - - - - -
-
-

All files src/resolvers/user/helpers

-
- -
- 100% - Statements - 64/64 -
- - -
- 100% - Branches - 27/27 -
- - -
- 100% - Functions - 8/8 -
- - -
- 100% - Lines - 57/57 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
authenticate.ts -
-
100%13/13100%6/6100%1/1100%11/11
getSignedJwt.ts -
-
100%8/8100%0/0100%1/1100%8/8
matchPassword.ts -
-
100%6/6100%2/2100%1/1100%5/5
sendEmailForgotPassword.ts -
-
100%5/5100%0/0100%1/1100%5/5
sendEmailVerifyEmail.ts -
-
100%5/5100%0/0100%1/1100%5/5
verifyCaptcha.ts -
-
100%12/12100%8/8100%1/1100%10/10
verifyRecaptchaToken.ts -
-
100%9/9100%9/9100%1/1100%7/7
verifySignedJwt.ts -
-
100%6/6100%2/2100%1/1100%6/6
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/helpers/matchPassword.ts.html b/src/api/coverage/lcov-report/src/resolvers/user/helpers/matchPassword.ts.html deleted file mode 100644 index 93f55fb..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/helpers/matchPassword.ts.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/helpers/matchPassword.ts - - - - - - - - -
-
-

All files / src/resolvers/user/helpers matchPassword.ts

-
- -
- 100% - Statements - 6/6 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 5/5 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -133x -  -3x -  -  -  -  -  -3x -7x -7x -  - 
import { compare } from 'bcryptjs'
- 
-import { ResponseError } from '../../../shared/mongo/ResponseError'
- 
-interface MatchPassword {
-  (proposedPassword: string, hashedPassword: string): Promise<void>
-}
- 
-export const matchPassword: MatchPassword = async (proposedPassword, hashedPassword) => {
-  const isMatch: boolean = await compare(proposedPassword, hashedPassword)
-  if (!isMatch) throw new ResponseError(401, 'Wrong username or password')
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/helpers/rateLimit.ts.html b/src/api/coverage/lcov-report/src/resolvers/user/helpers/rateLimit.ts.html deleted file mode 100644 index e28dfb4..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/helpers/rateLimit.ts.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/helpers/rateLimit.ts - - - - - - - - -
-
-

All files / src/resolvers/user/helpers rateLimit.ts

-
- -
- 100% - Statements - 11/11 -
- - -
- 100% - Branches - 13/13 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 10/10 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -299x -  -9x -  -9x -  -  -  -  -  -9x -25x -  -4x -1x -  -3x -  -  -  -  -  -  -  -  -3x -1x -  - 
import * as dayjs from 'dayjs'
- 
-import { TEST } from '../../../constants'
-import { UpdateRes } from '../../../shared/mongo/UpdateRes'
-import { User, UserModel } from '../../../shared/user/User'
- 
-interface RateLimit {
-  (user: User, waitTime?: number, actionName?: 'latestCommonAction' | 'latestLoginAttempt'): Promise<void>
-}
- 
-export const rateLimit: RateLimit = async (user, waitTime = 1, actionName = 'latestCommonAction') => {
-  if (process.env.NODE_ENV === TEST) return
- 
-  if (user[actionName] && dayjs().diff(dayjs(user[actionName]).add(waitTime, 'second')) <= 0)
-    throw new Error(`Querying too fast. Please wait ${waitTime}s and retry.`)
- 
-  const updateActionDate: UpdateRes = await UserModel.updateOne(
-    { _id: user._id },
-    {
-      $set: {
-        [actionName]: dayjs().toDate(),
-      },
-    },
-  ).exec()
- 
-  if (!(updateActionDate && updateActionDate.nModified && updateActionDate.nModified >= 1))
-    throw new Error('Rate limit action date not updated')
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/helpers/sendEmailForgotPassword.ts.html b/src/api/coverage/lcov-report/src/resolvers/user/helpers/sendEmailForgotPassword.ts.html deleted file mode 100644 index 017227b..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/helpers/sendEmailForgotPassword.ts.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/helpers/sendEmailForgotPassword.ts - - - - - - - - -
-
-

All files / src/resolvers/user/helpers sendEmailForgotPassword.ts

-
- -
- 100% - Statements - 5/5 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 5/5 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21  -2x -  -  -  -  -  -2x -1x -  -1x -  -  -  -  -  -  -  -1x -  - 
import { MailDataRequired } from '@sendgrid/helpers/classes/mail'
-import * as sendgrid from '@sendgrid/mail'
- 
-interface SendEmailForgotPassword {
-  (email: string, captchaIndex: number, token: string): Promise<void>
-}
- 
-export const sendEmailForgotPassword: SendEmailForgotPassword = async (email, captchaIndex, token) => {
-  sendgrid.setApiKey(process.env.SENDGRID_API_KEY as string)
- 
-  const message: MailDataRequired = {
-    to: email,
-    from: { name: 'Entire Stack', email: process.env.FROM_EMAIL as string },
-    subject: 'Password reset',
-    text: `Please enter the following captcha https://entirestack.com/captchas/${captchaIndex}.png on https://entirestack.com/reset-password?key=${token}`,
-    html: `Please enter the following captcha <br /><img alt="captcha" src="https://entirestack.com/captchas/${captchaIndex}.png" /> <br />on <a href="https://entirestack.com/reset-password?key=${token}">https://entirestack.com/reset-password?key=${token}</a>`,
-  }
- 
-  await sendgrid.send(message)
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/helpers/sendEmailVerifyEmail.ts.html b/src/api/coverage/lcov-report/src/resolvers/user/helpers/sendEmailVerifyEmail.ts.html deleted file mode 100644 index 04ab0d6..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/helpers/sendEmailVerifyEmail.ts.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/helpers/sendEmailVerifyEmail.ts - - - - - - - - -
-
-

All files / src/resolvers/user/helpers sendEmailVerifyEmail.ts

-
- -
- 100% - Statements - 5/5 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 5/5 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21  -18x -  -  -  -  -  -18x -1x -  -1x -  -  -  -  -  -  -  -1x -  - 
import { MailDataRequired } from '@sendgrid/helpers/classes/mail'
-import * as sendgrid from '@sendgrid/mail'
- 
-interface SendEmailVerifyEmail {
-  (email: string, captchaIndex: number): Promise<void>
-}
- 
-export const sendEmailVerifyEmail: SendEmailVerifyEmail = async (email, captchaIndex) => {
-  sendgrid.setApiKey(process.env.SENDGRID_API_KEY as string)
- 
-  const message: MailDataRequired = {
-    to: email,
-    from: { name: 'Entire Stack', email: process.env.FROM_EMAIL as string },
-    subject: 'Please verify your email',
-    text: `Please enter the following captcha https://entirestack.com/captchas/${captchaIndex}.png on https://entirestack.com/verify-email`,
-    html: `Please enter the following captcha <br /><img alt="captcha" src="https://entirestack.com/captchas/${captchaIndex}.png" /> <br />on <a href="https://entirestack.com/verify-email">https://entirestack.com/verify-email</a>`,
-  }
- 
-  await sendgrid.send(message)
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/helpers/verifyCaptcha.ts.html b/src/api/coverage/lcov-report/src/resolvers/user/helpers/verifyCaptcha.ts.html deleted file mode 100644 index 8d7d0e0..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/helpers/verifyCaptcha.ts.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/helpers/verifyCaptcha.ts - - - - - - - - -
-
-

All files / src/resolvers/user/helpers verifyCaptcha.ts

-
- -
- 100% - Statements - 12/12 -
- - -
- 100% - Branches - 8/8 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 10/10 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25  -  -3x -  -3x -  -  -  -  -  -3x -8x -  -8x -  -7x -1x -  -6x -  -3x -  -3x -  - 
import { ObjectId } from 'mongodb'
- 
-import { Captcha, CaptchaModel } from '../../../shared/captcha/Captcha'
-import { CaptchaFor } from '../../../shared/captcha/CaptchaFor'
-import { ResponseError } from '../../../shared/mongo/ResponseError'
- 
-interface VerifyCaptcha {
-  (userId: ObjectId, proposedSolution: string, captchaFor: CaptchaFor): Promise<void>
-}
- 
-export const verifyCaptcha: VerifyCaptcha = async (userId, proposedSolution, captchaFor) => {
-  const captcha: Captcha = (await CaptchaModel.findOne({ userId, captchaFor }).lean()) as Captcha
- 
-  if (!captcha) throw new ResponseError(400, 'Captcha expired - Please send another one')
- 
-  if (captcha.attempts && captcha.attempts >= 3)
-    throw new ResponseError(401, 'Maximum attemps reached - Account blocked for 1h')
- 
-  if (captcha.solution === proposedSolution) return
- 
-  await CaptchaModel.updateOne({ _id: captcha._id }, { $inc: { attempts: 1 } }).exec()
- 
-  throw new ResponseError(400, 'Wrong captcha entered')
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/helpers/verifyRecaptchaToken.ts.html b/src/api/coverage/lcov-report/src/resolvers/user/helpers/verifyRecaptchaToken.ts.html deleted file mode 100644 index e020bc1..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/helpers/verifyRecaptchaToken.ts.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/helpers/verifyRecaptchaToken.ts - - - - - - - - -
-
-

All files / src/resolvers/user/helpers verifyRecaptchaToken.ts

-
- -
- 100% - Statements - 9/9 -
- - -
- 100% - Branches - 9/9 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 7/7 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -2518x -  -18x -18x -  -  -  -  -  -18x -24x -  -2x -  -  -  -  -  -  -  -  -  -2x -  - 
import axios from 'axios'
- 
-import { DEVELOPMENT, TEST } from '../../../constants'
-import { ResponseError } from '../../../shared/mongo/ResponseError'
- 
-interface VerifyRecaptchaToken {
-  (recaptchaToken: string): Promise<void>
-}
- 
-export const verifyRecaptchaToken: VerifyRecaptchaToken = async (recaptchaToken) => {
-  if (process.env.NODE_ENV === DEVELOPMENT || process.env.NODE_ENV === TEST) return
- 
-  const response = await axios({
-    method: 'post',
-    url: 'https://www.google.com/recaptcha/api/siteverify',
-    params: {
-      secret: process.env.RECAPTCHA_SECRET_KEY,
-      response: recaptchaToken,
-      // TODO: Add remoteip
-    },
-  })
- 
-  if (!(response && response.data && response.data.success)) throw new ResponseError(401, 'Wrong re-captcha token')
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/helpers/verifySignedJwt.ts.html b/src/api/coverage/lcov-report/src/resolvers/user/helpers/verifySignedJwt.ts.html deleted file mode 100644 index 16d17cf..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/helpers/verifySignedJwt.ts.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/helpers/verifySignedJwt.ts - - - - - - - - -
-
-

All files / src/resolvers/user/helpers verifySignedJwt.ts

-
- -
- 100% - Statements - 6/6 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 6/6 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -318x -  -  -  -  -  -  -  -  -  -  -8x -21x -  -21x -  -  -  -  -  -  -  -21x -  -  -  -  -  -19x -  - 
import * as jsonwebtoken from 'jsonwebtoken'
-import { Secret } from 'jsonwebtoken'
- 
-import { Jwt } from '../../../shared/user/Jwt'
-import { JwtDecoded } from '../../../shared/user/JwtDecoded'
-import { JwtPayload } from '../../../shared/user/JwtPayload'
- 
-interface VerifySignedJwt {
-  (jwt: Jwt): JwtPayload
-}
- 
-export const verifySignedJwt: VerifySignedJwt = (jwt) => {
-  const jwtDecoded: JwtDecoded = jsonwebtoken.decode(jwt) as JwtDecoded
- 
-  const verifyOptions = {
-    issuer: 'Entire Stack',
-    subject: jwtDecoded ? jwtDecoded.username : undefined,
-    audience: 'https://entirestack.com',
-    expiresIn: '30d',
-    algorithm: ['RS256'],
-  }
- 
-  const jwtPayload: JwtPayload = jsonwebtoken.verify(
-    jwt,
-    process.env.JWT_PUBLIC_KEY as Secret,
-    verifyOptions,
-  ) as JwtPayload
- 
-  return jwtPayload
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/index.html b/src/api/coverage/lcov-report/src/resolvers/user/index.html deleted file mode 100644 index 9554852..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user - - - - - - - - - -
-
-

All files src/resolvers/user

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
user.model.ts -
-
100%3/3100%0/0100%0/0100%3/3
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/login/index.html b/src/api/coverage/lcov-report/src/resolvers/user/login/index.html deleted file mode 100644 index 968355e..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/login/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/login - - - - - - - - -
-
-

All files src/resolvers/user/login

-
- -
- 100% - Statements - 28/28 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 27/27 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
login.ts -
-
100%28/28100%4/4100%1/1100%27/27
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/login/login.ts.html b/src/api/coverage/lcov-report/src/resolvers/user/login/login.ts.html deleted file mode 100644 index d4693dd..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/login/login.ts.html +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/login/login.ts - - - - - - - - -
-
-

All files / src/resolvers/user/login login.ts

-
- -
- 100% - Statements - 28/28 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 27/27 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -431x -1x -  -  -1x -1x -1x -1x -1x -1x -1x -1x -  -  -1x -4x -4x -4x -  -4x -  -4x -  -4x -4x -2x -  -4x -  -3x -  -3x -  -2x -  -2x -  -2x -2x -  -2x -  - 
import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { firstError } from '../../../helpers/firstError'
-import { ResponseError } from '../../../shared/mongo/ResponseError'
-import { LoginInputs, LoginOutputs } from '../../../shared/user/Login'
-import { User, UserModel } from '../../../shared/user/User'
-import { getSignedJwt } from '../helpers/getSignedJwt'
-import { matchPassword } from '../helpers/matchPassword'
-import { verifyRecaptchaToken } from '../helpers/verifyRecaptchaToken'
-import { rateLimit } from '../../quota/rateLimit/rateLimit'
-import { Jwt } from '../../../shared/user/Jwt'
- 
-export const login = async (ctx: Context, next: Next): Promise<void> => {
-  const loginArgs = plainToClass(LoginInputs, ctx.request.body, { excludeExtraneousValues: true })
-  await validateOrReject(loginArgs, { forbidUnknownValues: true }).catch(firstError)
-  let { usernameOrEmail, password, recaptchaToken } = loginArgs
- 
-  usernameOrEmail = usernameOrEmail.toLowerCase()
- 
-  await verifyRecaptchaToken(recaptchaToken)
- 
-  let user: User | null = await UserModel.findOne({ email: usernameOrEmail }).lean()
-  if (!user) {
-    user = await UserModel.findOne({ username: usernameOrEmail }).lean()
-  }
-  if (!user) throw new ResponseError(401, 'Wrong username or password')
- 
-  await rateLimit(user._id)
- 
-  await matchPassword(password, user.hashedPassword)
- 
-  const jwt: Jwt = getSignedJwt(user._id.toHexString(), user.username)
- 
-  const response: LoginOutputs = { jwt }
- 
-  ctx.status = 200
-  ctx.body = response
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/resendEmailVerification/index.html b/src/api/coverage/lcov-report/src/resolvers/user/resendEmailVerification/index.html deleted file mode 100644 index c71bbde..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/resendEmailVerification/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/resendEmailVerification - - - - - - - - -
-
-

All files src/resolvers/user/resendEmailVerification

-
- -
- 100% - Statements - 16/16 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 15/15 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
resendEmailVerification.ts -
-
100%16/16100%2/2100%1/1100%15/15
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/resendEmailVerification/resendEmailVerification.ts.html b/src/api/coverage/lcov-report/src/resolvers/user/resendEmailVerification/resendEmailVerification.ts.html deleted file mode 100644 index 54428e2..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/resendEmailVerification/resendEmailVerification.ts.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/resendEmailVerification/resendEmailVerification.ts - - - - - - - - -
-
-

All files / src/resolvers/user/resendEmailVerification resendEmailVerification.ts

-
- -
- 100% - Statements - 16/16 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 15/15 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30  -  -1x -1x -  -1x -1x -1x -1x -  -1x -2x -  -2x -  -2x -  -  -  -  -2x -  -2x -  -2x -2x -  -2x -  - 
import { Context, Next } from 'koa'
- 
-import { Captcha, CaptchaModel } from '../../../shared/captcha/Captcha'
-import { CaptchaFor } from '../../../shared/captcha/CaptchaFor'
-import { User } from '../../../shared/user/User'
-import { createCaptcha } from '../../captcha/helpers/createCaptcha'
-import { authenticate } from '../helpers/authenticate'
-import { sendEmailVerifyEmail } from '../helpers/sendEmailVerifyEmail'
-import { rateLimit } from '../../quota/rateLimit/rateLimit'
- 
-export const resendEmailVerification = async (ctx: Context, next: Next): Promise<void> => {
-  const user: User = await authenticate(ctx)
- 
-  await rateLimit(user._id)
- 
-  let captcha: Captcha | null = await CaptchaModel.findOne({
-    userId: user._id,
-    captchaFor: CaptchaFor.CAPTCHA_FOR_VERIFY_EMAIL,
-  }).lean()
- 
-  if (!captcha) captcha = await createCaptcha(user._id, CaptchaFor.CAPTCHA_FOR_VERIFY_EMAIL)
- 
-  await sendEmailVerifyEmail(user.email, captcha.index)
- 
-  ctx.status = 200
-  ctx.body = { status: true }
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/resetPassword/index.html b/src/api/coverage/lcov-report/src/resolvers/user/resetPassword/index.html deleted file mode 100644 index b851532..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/resetPassword/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/resetPassword - - - - - - - - -
-
-

All files src/resolvers/user/resetPassword

-
- -
- 100% - Statements - 29/29 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 27/27 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
resetPassword.ts -
-
100%29/29100%4/4100%1/1100%27/27
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/resetPassword/resetPassword.ts.html b/src/api/coverage/lcov-report/src/resolvers/user/resetPassword/resetPassword.ts.html deleted file mode 100644 index c8f4c92..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/resetPassword/resetPassword.ts.html +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/resetPassword/resetPassword.ts - - - - - - - - -
-
-

All files / src/resolvers/user/resetPassword resetPassword.ts

-
- -
- 100% - Statements - 29/29 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 27/27 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -441x -1x -1x -  -  -1x -1x -1x -1x -1x -1x -1x -1x -  -1x -3x -3x -3x -  -3x -  -  -  -3x -  -2x -2x -  -1x -  -1x -  -1x -  -1x -  -1x -  -1x -1x -  -1x -  - 
import { hash } from 'bcryptjs'
-import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { firstError } from '../../../helpers/firstError'
-import { Captcha, CaptchaModel } from '../../../shared/captcha/Captcha'
-import { CaptchaFor } from '../../../shared/captcha/CaptchaFor'
-import { ResponseError } from '../../../shared/mongo/ResponseError'
-import { ResetPasswordInputs } from '../../../shared/user/ResetPassword'
-import { User, UserModel } from '../../../shared/user/User'
-import { verifyCaptcha } from '../helpers/verifyCaptcha'
-import { rateLimit } from '../../quota/rateLimit/rateLimit'
- 
-export const resetPassword = async (ctx: Context, next: Next): Promise<void> => {
-  const resetPasswordArgs = plainToClass(ResetPasswordInputs, ctx.request.body, { excludeExtraneousValues: true })
-  await validateOrReject(resetPasswordArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { solution, token, newPassword } = resetPasswordArgs
- 
-  const captcha: Captcha = (await CaptchaModel.findOne({
-    token,
-    captchaFor: CaptchaFor.CAPTCHA_FOR_RESET_PASSWORD,
-  }).lean()) as Captcha
-  if (!captcha) throw new ResponseError(401, 'Wrong token key')
- 
-  const user: User = (await UserModel.findOne({ _id: captcha.userId }).lean()) as User
-  if (!user) throw new ResponseError(404, 'User not found')
- 
-  await rateLimit(user._id)
- 
-  await verifyCaptcha(user._id, solution, CaptchaFor.CAPTCHA_FOR_RESET_PASSWORD)
- 
-  const hashedPassword: string = await hash(newPassword, 12)
- 
-  await UserModel.updateOne({ _id: user._id }, { password: hashedPassword }).exec()
- 
-  await CaptchaModel.deleteOne({ _id: captcha._id }).exec()
- 
-  ctx.status = 200
-  ctx.body = {}
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/signUp/index.html b/src/api/coverage/lcov-report/src/resolvers/user/signUp/index.html deleted file mode 100644 index 8176102..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/signUp/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/signUp - - - - - - - - -
-
-

All files src/resolvers/user/signUp

-
- -
- 100% - Statements - 34/34 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 32/32 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
signUp.ts -
-
100%34/34100%4/4100%1/1100%32/32
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/signUp/signUp.ts.html b/src/api/coverage/lcov-report/src/resolvers/user/signUp/signUp.ts.html deleted file mode 100644 index 665e000..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/signUp/signUp.ts.html +++ /dev/null @@ -1,226 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/signUp/signUp.ts - - - - - - - - -
-
-

All files / src/resolvers/user/signUp signUp.ts

-
- -
- 100% - Statements - 34/34 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 32/32 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -5017x -17x -17x -  -  -17x -  -17x -17x -  -17x -17x -17x -17x -17x -17x -  -17x -21x -21x -20x -  -20x -20x -  -20x -  -20x -20x -  -19x -19x -  -18x -18x -  -18x -  -18x -  -18x -  -18x -  -18x -18x -  -18x -  - 
import { hash } from 'bcryptjs'
-import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { firstError } from '../../../helpers/firstError'
-import { Captcha } from '../../../shared/captcha/Captcha'
-import { CaptchaFor } from '../../../shared/captcha/CaptchaFor'
-import { ResponseError } from '../../../shared/mongo/ResponseError'
-import { Jwt } from '../../../shared/user/Jwt'
-import { SignUpInputs, SignUpOutputs } from '../../../shared/user/SignUp'
-import { User, UserModel } from '../../../shared/user/User'
-import { createCaptcha } from '../../captcha/helpers/createCaptcha'
-import { getSignedJwt } from '../helpers/getSignedJwt'
-import { sendEmailVerifyEmail } from '../helpers/sendEmailVerifyEmail'
-import { verifyRecaptchaToken } from '../helpers/verifyRecaptchaToken'
- 
-export const signUp = async (ctx: Context, next: Next): Promise<void> => {
-  const signUpArgs = plainToClass(SignUpInputs, ctx.request.body, { excludeExtraneousValues: true })
-  await validateOrReject(signUpArgs, { forbidUnknownValues: true }).catch(firstError)
-  let { username, email, password, recaptchaToken } = signUpArgs
- 
-  username = username.toLowerCase()
-  email = email.toLowerCase()
- 
-  await verifyRecaptchaToken(recaptchaToken)
- 
-  const emailAlreadyTaken: User | null = await UserModel.findOne({ email }).lean()
-  if (emailAlreadyTaken) throw new ResponseError(400, 'Email is already taken')
- 
-  const usernameAlreadyTaken: User | null = await UserModel.findOne({ username }).lean()
-  if (usernameAlreadyTaken) throw new ResponseError(400, 'Username is already taken')
- 
-  const hashedPassword = await hash(password, 12)
-  const user: User = await new UserModel({ email, username, hashedPassword }).save()
- 
-  const jwt: Jwt = getSignedJwt(user._id.toHexString(), user.username)
- 
-  const captcha: Captcha = await createCaptcha(user._id, CaptchaFor.CAPTCHA_FOR_VERIFY_EMAIL)
- 
-  await sendEmailVerifyEmail(user.email, captcha.index)
- 
-  const response: SignUpOutputs = { jwt }
- 
-  ctx.status = 200
-  ctx.body = response
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/user.model.ts.html b/src/api/coverage/lcov-report/src/resolvers/user/user.model.ts.html deleted file mode 100644 index eb62d0c..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/user.model.ts.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/user.model.ts - - - - - - - - - -
-
-

All files / src/resolvers/user user.model.ts

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -617x -  -17x -  -17x - 
import { getModelForClass } from '@typegoose/typegoose'
- 
-import { User } from '../../shared/user/User'
- 
-export const UserModel = getModelForClass(User, { schemaOptions: { timestamps: true } })
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/verifyEmail/index.html b/src/api/coverage/lcov-report/src/resolvers/user/verifyEmail/index.html deleted file mode 100644 index 33fd3cb..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/verifyEmail/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/verifyEmail - - - - - - - - -
-
-

All files src/resolvers/user/verifyEmail

-
- -
- 100% - Statements - 22/22 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 22/22 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
verifyEmail.ts -
-
100%22/22100%0/0100%1/1100%22/22
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/user/verifyEmail/verifyEmail.ts.html b/src/api/coverage/lcov-report/src/resolvers/user/verifyEmail/verifyEmail.ts.html deleted file mode 100644 index f0e8639..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/user/verifyEmail/verifyEmail.ts.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - Code coverage report for src/resolvers/user/verifyEmail/verifyEmail.ts - - - - - - - - -
-
-

All files / src/resolvers/user/verifyEmail verifyEmail.ts

-
- -
- 100% - Statements - 22/22 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 22/22 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -371x -1x -  -  -1x -1x -1x -1x -1x -1x -1x -1x -  -1x -1x -1x -1x -  -1x -  -1x -  -1x -  -1x -  -1x -  -  -  -  -1x -1x -  -1x -  - 
import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { firstError } from '../../../helpers/firstError'
-import { CaptchaModel } from '../../../shared/captcha/Captcha'
-import { CaptchaFor } from '../../../shared/captcha/CaptchaFor'
-import { User, UserModel } from '../../../shared/user/User'
-import { VerifyEmailInputs } from '../../../shared/user/VerifyEmail'
-import { authenticate } from '../helpers/authenticate'
-import { verifyCaptcha } from '../helpers/verifyCaptcha'
-import { rateLimit } from '../../quota/rateLimit/rateLimit'
- 
-export const verifyEmail = async (ctx: Context, next: Next): Promise<void> => {
-  const verifyEmailArgs = plainToClass(VerifyEmailInputs, ctx.request.body, { excludeExtraneousValues: true })
-  await validateOrReject(verifyEmailArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { solution } = verifyEmailArgs
- 
-  const user: User = await authenticate(ctx)
- 
-  await rateLimit(user._id)
- 
-  await verifyCaptcha(user._id, solution, CaptchaFor.CAPTCHA_FOR_VERIFY_EMAIL)
- 
-  await UserModel.updateOne({ _id: user._id }, { $set: { emailVerified: true } }).exec()
- 
-  await CaptchaModel.deleteOne({
-    userId: user._id,
-    captchaFor: CaptchaFor.CAPTCHA_FOR_VERIFY_EMAIL,
-  }).exec()
- 
-  ctx.status = 200
-  ctx.body = {}
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/vote/index.html b/src/api/coverage/lcov-report/src/resolvers/vote/index.html deleted file mode 100644 index b104f00..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/vote/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/resolvers/vote - - - - - - - - - -
-
-

All files src/resolvers/vote

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
vote.model.ts -
-
100%3/3100%0/0100%0/0100%3/3
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/vote/sendVote/index.html b/src/api/coverage/lcov-report/src/resolvers/vote/sendVote/index.html deleted file mode 100644 index c8e3d6c..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/vote/sendVote/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/resolvers/vote/sendVote - - - - - - - - -
-
-

All files src/resolvers/vote/sendVote

-
- -
- 100% - Statements - 44/44 -
- - -
- 100% - Branches - 25/25 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 39/39 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
sendVote.ts -
-
100%44/44100%25/25100%1/1100%39/39
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/vote/sendVote/sendVote.ts.html b/src/api/coverage/lcov-report/src/resolvers/vote/sendVote/sendVote.ts.html deleted file mode 100644 index 0c8260b..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/vote/sendVote/sendVote.ts.html +++ /dev/null @@ -1,331 +0,0 @@ - - - - - - Code coverage report for src/resolvers/vote/sendVote/sendVote.ts - - - - - - - - -
-
-

All files / src/resolvers/vote/sendVote sendVote.ts

-
- -
- 100% - Statements - 44/44 -
- - -
- 100% - Branches - 25/25 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 39/39 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -851x -1x -  -  -1x -1x -1x -  -1x -1x -1x -1x -1x -1x -1x -1x -  -1x -8x -8x -8x -  -8x -  -8x -  -  -8x -8x -  -  -7x -  -  -  -  -7x -  -  -6x -  -  -  -  -  -  -  -  -6x -6x -  -6x -6x -5x -4x -2x -  -6x -  -  -  -  -  -  -  -6x -  -6x -  -3x -3x -  -  -  -  -  -  -  -  -6x -6x -  -6x -  - 
import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { firstError } from '../../../helpers/firstError'
-import { Comment, CommentModel } from '../../../shared/comment/Comment'
-import { ResponseError } from '../../../shared/mongo/ResponseError'
-import { UpdateRes } from '../../../shared/mongo/UpdateRes'
-import { NotificationModel } from '../../../shared/notification/Notification'
-import { NotificationType } from '../../../shared/notification/NotificationType'
-import { User, UserModel } from '../../../shared/user/User'
-import { Vote, VoteModel } from '../../../shared/vote/Vote'
-import { VoteDirection } from '../../../shared/vote/VoteDirection'
-import { authenticate } from '../../user/helpers/authenticate'
-import { rateLimit } from '../../quota/rateLimit/rateLimit'
-import { SendVoteInputs } from '../../../shared/vote/SendVote'
- 
-export const sendVote = async (ctx: Context, next: Next): Promise<void> => {
-  const sendVoteArgs = plainToClass(SendVoteInputs, ctx.request.body, { excludeExtraneousValues: true })
-  await validateOrReject(sendVoteArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { commentId, voteDirection } = sendVoteArgs
- 
-  const user: User = await authenticate(ctx)
- 
-  await rateLimit(user._id)
- 
-  // Check if comment exists
-  const comment: Comment = (await CommentModel.findOne({ _id: commentId }).lean()) as Comment
-  if (!comment) throw new ResponseError(404, 'Comment not found')
- 
-  // Check if vote already exists
-  const vote: Vote | null = await VoteModel.findOne({
-    commentId: comment._id,
-    userId: user._id,
-    voteDirection,
-  }).lean()
-  if (vote) throw new ResponseError(400, 'Already voted')
- 
-  // Check if vote exists and update it or create it
-  const updateOrCreateVote: UpdateRes = await VoteModel.updateOne(
-    { commentId: comment._id, userId: user._id },
-    {
-      $set: { voteDirection },
-    },
-    { upsert: true, setDefaultsOnInsert: true },
-  ).exec()
- 
-  // Update comment vote counts
-  const isModified = updateOrCreateVote && updateOrCreateVote.nModified >= 1
-  const isInserted = updateOrCreateVote && updateOrCreateVote.upserted && updateOrCreateVote.upserted.length >= 1
- 
-  let modifier = {}
-  if (isInserted && voteDirection === VoteDirection.DOWN) modifier = { downCount: 1 }
-  else if (isInserted && voteDirection === VoteDirection.UP) modifier = { upCount: 1 }
-  else if (isModified && voteDirection === VoteDirection.DOWN) modifier = { downCount: 1, upCount: -1 }
-  else modifier = { upCount: 1, downCount: -1 } // isModified && voteDirection === VoteDirection.UP
- 
-  await CommentModel.updateOne(
-    { _id: commentId },
-    {
-      $inc: modifier,
-    },
-  ).exec()
- 
-  // Create notification
-  const author: User | null = await UserModel.findOne({ _id: comment.userId }).lean()
- 
-  if (author) {
-    const notificationType =
-      voteDirection === VoteDirection.DOWN ? NotificationType.COMMENT_DOWNVOTED : NotificationType.COMMENT_UPVOTED
-    await NotificationModel.updateOne(
-      { userId: author._id, targetId: comment._id, notificationType },
-      {
-        $inc: { count: 1 },
-      },
-      { upsert: true, setDefaultsOnInsert: true },
-    ).exec()
-  }
- 
-  ctx.status = 200
-  ctx.body = {}
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/resolvers/vote/vote.model.ts.html b/src/api/coverage/lcov-report/src/resolvers/vote/vote.model.ts.html deleted file mode 100644 index abf6ccc..0000000 --- a/src/api/coverage/lcov-report/src/resolvers/vote/vote.model.ts.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - Code coverage report for src/resolvers/vote/vote.model.ts - - - - - - - - - -
-
-

All files / src/resolvers/vote vote.model.ts

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -52x -2x -  -2x - 
import { getModelForClass } from '@typegoose/typegoose'
-import { Vote } from '../../shared/vote/Vote'
- 
-export const VoteModel = getModelForClass(Vote, { schemaOptions: { timestamps: true } })
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/captcha/Captcha.ts.html b/src/api/coverage/lcov-report/src/shared/captcha/Captcha.ts.html deleted file mode 100644 index 6984c00..0000000 --- a/src/api/coverage/lcov-report/src/shared/captcha/Captcha.ts.html +++ /dev/null @@ -1,250 +0,0 @@ - - - - - - Code coverage report for src/shared/captcha/Captcha.ts - - - - - - - - -
-
-

All files / src/shared/captcha Captcha.ts

-
- -
- 100% - Statements - 20/20 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 18/18 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -5818x -18x -  -18x -18x -18x -18x -  -  -18x -  -18x -  -  -  -18x -  -  -  -18x -  -  -  -18x -  -  -  -18x -  -  -  -  -18x -  -  -  -  -  -  -18x -  -  -  -  -  -  -  -18x -  -  -18x -  -  -18x -  -  -18x - 
import * as crypto from 'crypto'
-import { IsDate, IsEnum, IsMongoId, Length, IsInt, IsOptional } from 'class-validator'
- 
-import { ObjectId } from 'mongodb'
-import { DayJs } from '../../helpers/dayjs'
-import { Property, Index, getModel } from '../../helpers/typegoose'
-import { CaptchaFor } from './CaptchaFor'
- 
-@Index({ userId: 1, captchaFor: 1 }, { unique: true })
-export class Captcha {
-  @IsMongoId()
-  readonly _id!: ObjectId
- 
-  @Property({ required: true, ref: 'User' })
-  @IsMongoId()
-  userId!: ObjectId
- 
-  @Property({ required: true })
-  @IsInt()
-  index!: number
- 
-  @Property({ required: true })
-  @Length(4, 4)
-  solution!: string
- 
-  @Property({ required: true })
-  @IsEnum(CaptchaFor)
-  captchaFor!: CaptchaFor
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @IsInt()
-  attempts?: number
- 
-  @Property({
-    required: true,
-    default: crypto.randomBytes(16).toString('hex'),
-  })
-  @Length(16, 16)
-  token!: string
- 
-  @Property({
-    required: true,
-    default: DayJs().add(1, 'hour').toDate(),
-    expires: '1h',
-  })
-  @IsDate()
-  expiresAt!: Date
- 
-  @IsDate()
-  createdAt!: Date
- 
-  @IsDate()
-  updatedAt!: Date
-}
- 
-export const CaptchaModel = getModel(Captcha, { schemaOptions: { timestamps: true } })
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/captcha/CaptchaFor.ts.html b/src/api/coverage/lcov-report/src/shared/captcha/CaptchaFor.ts.html deleted file mode 100644 index 440e1d4..0000000 --- a/src/api/coverage/lcov-report/src/shared/captcha/CaptchaFor.ts.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - Code coverage report for src/shared/captcha/CaptchaFor.ts - - - - - - - - -
-
-

All files / src/shared/captcha CaptchaFor.ts

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -518x -18x -18x -  - 
export enum CaptchaFor {
-  CAPTCHA_FOR_RESET_PASSWORD = 'CAPTCHA_FOR_RESET_PASSWORD',
-  CAPTCHA_FOR_VERIFY_EMAIL = 'CAPTCHA_FOR_VERIFY_EMAIL'
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/captcha/index.html b/src/api/coverage/lcov-report/src/shared/captcha/index.html deleted file mode 100644 index 91691fe..0000000 --- a/src/api/coverage/lcov-report/src/shared/captcha/index.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - Code coverage report for src/shared/captcha - - - - - - - - -
-
-

All files src/shared/captcha

-
- -
- 100% - Statements - 23/23 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 21/21 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Captcha.ts -
-
100%20/20100%0/0100%0/0100%18/18
CaptchaFor.ts -
-
100%3/3100%2/2100%1/1100%3/3
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/comment/AddCommentView.ts.html b/src/api/coverage/lcov-report/src/shared/comment/AddCommentView.ts.html deleted file mode 100644 index 55c91a2..0000000 --- a/src/api/coverage/lcov-report/src/shared/comment/AddCommentView.ts.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - Code coverage report for src/shared/comment/AddCommentView.ts - - - - - - - - -
-
-

All files / src/shared/comment AddCommentView.ts

-
- -
- 100% - Statements - 6/6 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 6/6 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -121x -1x -1x -  -1x -  -  -1x -  -  -1x - 
import { IsMongoId } from 'class-validator'
-import { Expose } from 'class-transformer'
-import { ObjectId } from 'mongodb'
- 
-export class AddCommentViewInputs {
-  @Expose()
-  @IsMongoId()
-  commentId!: ObjectId
-}
- 
-export class AddCommentViewOutputs {}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/comment/AddCommentViewArgs.ts.html b/src/api/coverage/lcov-report/src/shared/comment/AddCommentViewArgs.ts.html deleted file mode 100644 index 804d688..0000000 --- a/src/api/coverage/lcov-report/src/shared/comment/AddCommentViewArgs.ts.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - Code coverage report for src/shared/comment/AddCommentViewArgs.ts - - - - - - - - -
-
-

All files / src/shared/comment AddCommentViewArgs.ts

-
- -
- 100% - Statements - 5/5 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 5/5 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -101x -1x -1x -  -1x -  -  -1x -  - 
import { IsMongoId } from 'class-validator'
-import { Expose } from 'class-transformer'
-import { ObjectId } from 'mongodb'
- 
-export class AddCommentViewArgs {
-  @Expose()
-  @IsMongoId()
-  commentId!: ObjectId
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/comment/Comment.ts.html b/src/api/coverage/lcov-report/src/shared/comment/Comment.ts.html deleted file mode 100644 index e28fbe5..0000000 --- a/src/api/coverage/lcov-report/src/shared/comment/Comment.ts.html +++ /dev/null @@ -1,367 +0,0 @@ - - - - - - Code coverage report for src/shared/comment/Comment.ts - - - - - - - - -
-
-

All files / src/shared/comment Comment.ts

-
- -
- 100% - Statements - 26/26 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 26/26 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -975x -5x -5x -5x -5x -  -5x -  -5x -  -  -  -5x -  -  -  -  -5x -  -  -  -  -5x -  -  -  -  -5x -  -  -  -  -5x -  -  -  -5x -  -  -  -  -5x -  -  -  -  -5x -  -  -  -  -5x -  -  -  -  -5x -  -  -  -  -5x -  -  -  -  -5x -  -  -  -  -5x -  -  -  -  -5x -  -  -  -  -5x -  -  -  -  -5x -  -  -5x -  -  -5x -  -  -5x - 
import { IsBoolean, IsDate, IsEnum, IsMongoId, Length, IsInt, IsOptional } from 'class-validator'
-import { ObjectId } from 'mongodb'
-import { Property, getModel } from '../../helpers/typegoose'
-import { CommentType } from './CommentType'
-import { CommentStatus } from './CommentStatus'
- 
-export class Comment {
-  @IsMongoId()
-  readonly _id!: ObjectId
- 
-  @Property({ required: true, ref: 'User' })
-  @IsMongoId()
-  userId!: ObjectId
- 
-  @Property({ nullable: true, optional: true, default: undefined })
-  @IsOptional()
-  @IsMongoId({ each: true })
-  replies?: ObjectId[]
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @IsEnum(CommentType)
-  commentType?: CommentType
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @Length(2, 100)
-  title?: string
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @Length(2, 100)
-  slug?: string
- 
-  @Property({ required: true })
-  @Length(2, 1000000)
-  content!: string
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @Length(2, 100)
-  category?: string
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @IsBoolean()
-  sticky?: boolean
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @Length(2, 100)
-  image?: string
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @IsInt()
-  viewCount?: number
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @IsInt()
-  replyCount?: number
- 
-  @Property({ nullable: true, default: 1 })
-  @IsOptional()
-  @IsInt()
-  upCount?: number
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @IsInt()
-  downCount?: number
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @IsEnum(CommentStatus)
-  commentStatus?: CommentStatus
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @IsBoolean()
-  isVisible?: boolean
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @IsDate()
-  lastReply?: Date
- 
-  @IsDate()
-  createdAt!: Date
- 
-  @IsDate()
-  updatedAt!: Date
-}
- 
-export const CommentModel = getModel(Comment, { schemaOptions: { timestamps: true } })
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/comment/CommentStatus.ts.html b/src/api/coverage/lcov-report/src/shared/comment/CommentStatus.ts.html deleted file mode 100644 index fea9106..0000000 --- a/src/api/coverage/lcov-report/src/shared/comment/CommentStatus.ts.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - Code coverage report for src/shared/comment/CommentStatus.ts - - - - - - - - -
-
-

All files / src/shared/comment CommentStatus.ts

-
- -
- 100% - Statements - 4/4 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 4/4 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -65x -5x -5x -5x -  - 
export enum CommentStatus {
-  ACCEPTED = 'ACCEPTED',
-  PENDING = 'PENDING',
-  REFUSED = 'REFUSED',
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/comment/CommentType.ts.html b/src/api/coverage/lcov-report/src/shared/comment/CommentType.ts.html deleted file mode 100644 index 5d3f72c..0000000 --- a/src/api/coverage/lcov-report/src/shared/comment/CommentType.ts.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - Code coverage report for src/shared/comment/CommentType.ts - - - - - - - - -
-
-

All files / src/shared/comment CommentType.ts

-
- -
- 100% - Statements - 4/4 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 4/4 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -65x -5x -5x -5x -  - 
export enum CommentType {
-  POST = 'POST',
-  MESSAGE = 'MESSAGE',
-  COMMENT = 'COMMENT',
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/comment/GetComment.ts.html b/src/api/coverage/lcov-report/src/shared/comment/GetComment.ts.html deleted file mode 100644 index ad2c646..0000000 --- a/src/api/coverage/lcov-report/src/shared/comment/GetComment.ts.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - Code coverage report for src/shared/comment/GetComment.ts - - - - - - - - -
-
-

All files / src/shared/comment GetComment.ts

-
- -
- 100% - Statements - 10/10 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 10/10 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -201x -1x -1x -1x -1x -  -1x -  -  -1x -  -  -1x -  -1x -  -  -1x -  - 
import { IsMongoId } from 'class-validator'
-import { Expose } from 'class-transformer'
-import { ObjectId } from 'mongodb'
-import { PublicUser } from '../user/PublicUser'
-import { Comment } from './Comment'
- 
-export class GetCommentInputs {
-  @Expose()
-  @IsMongoId()
-  commentId!: ObjectId
-}
- 
-export class GetCommentOutputs {
-  @Expose()
-  comment!: Comment
- 
-  @Expose()
-  user!: PublicUser
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/comment/GetCommentWithPublicUserArgs.ts.html b/src/api/coverage/lcov-report/src/shared/comment/GetCommentWithPublicUserArgs.ts.html deleted file mode 100644 index 5772129..0000000 --- a/src/api/coverage/lcov-report/src/shared/comment/GetCommentWithPublicUserArgs.ts.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - Code coverage report for src/shared/comment/GetCommentWithPublicUserArgs.ts - - - - - - - - -
-
-

All files / src/shared/comment GetCommentWithPublicUserArgs.ts

-
- -
- 100% - Statements - 5/5 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 5/5 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -101x -1x -1x -  -1x -  -  -1x -  - 
import { IsMongoId } from 'class-validator'
-import { Expose } from 'class-transformer'
-import { ObjectId } from 'mongodb'
- 
-export class GetCommentWithPublicUserArgs {
-  @Expose()
-  @IsMongoId()
-  commentId!: ObjectId
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/comment/GetLatestComments.ts.html b/src/api/coverage/lcov-report/src/shared/comment/GetLatestComments.ts.html deleted file mode 100644 index 652d49d..0000000 --- a/src/api/coverage/lcov-report/src/shared/comment/GetLatestComments.ts.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - Code coverage report for src/shared/comment/GetLatestComments.ts - - - - - - - - -
-
-

All files / src/shared/comment GetLatestComments.ts

-
- -
- 100% - Statements - 8/8 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 8/8 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -231x -1x -1x -  -  -  -1x -  -  -  -1x -  -  -1x -  -  -1x -  -  -  -1x -  - 
import { IsMongoId, IsOptional, IsArray } from 'class-validator'
-import { Expose } from 'class-transformer'
-import { ObjectId } from 'mongodb'
-import { PublicUser } from '../user/PublicUser'
-import { Comment } from './Comment'
- 
-export class GetLatestCommentsInputs {
-  @Expose()
-  @IsOptional()
-  @IsMongoId()
-  cursorId?: ObjectId
-}
- 
-export class GetLatestCommentsOutputs {
-  @Expose()
-  @IsArray()
-  comments!: Comment[]
- 
-  @Expose()
-  @IsArray()
-  users!: PublicUser[]
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/comment/GetLatestCommentsWithPublicUsersArgs.ts.html b/src/api/coverage/lcov-report/src/shared/comment/GetLatestCommentsWithPublicUsersArgs.ts.html deleted file mode 100644 index d08a37d..0000000 --- a/src/api/coverage/lcov-report/src/shared/comment/GetLatestCommentsWithPublicUsersArgs.ts.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - Code coverage report for src/shared/comment/GetLatestCommentsWithPublicUsersArgs.ts - - - - - - - - -
-
-

All files / src/shared/comment GetLatestCommentsWithPublicUsersArgs.ts

-
- -
- 100% - Statements - 5/5 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 5/5 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -111x -1x -1x -  -1x -  -  -  -1x -  - 
import { IsMongoId, IsOptional } from 'class-validator'
-import { Expose } from 'class-transformer'
-import { ObjectId } from 'mongodb'
- 
-export class GetLatestCommentsWithPublicUsersArgs {
-  @Expose()
-  @IsOptional()
-  @IsMongoId()
-  cursorId?: ObjectId
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/comment/ModerationStatus.ts.html b/src/api/coverage/lcov-report/src/shared/comment/ModerationStatus.ts.html deleted file mode 100644 index e8082d9..0000000 --- a/src/api/coverage/lcov-report/src/shared/comment/ModerationStatus.ts.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - Code coverage report for src/shared/comment/ModerationStatus.ts - - - - - - - - -
-
-

All files / src/shared/comment ModerationStatus.ts

-
- -
- 100% - Statements - 4/4 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 4/4 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -65x -5x -5x -5x -  - 
export enum ModerationStatus {
-  ACCEPTED = 'ACCEPTED',
-  PENDING = 'PENDING',
-  REFUSED = 'REFUSED',
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/comment/NewComment.ts.html b/src/api/coverage/lcov-report/src/shared/comment/NewComment.ts.html deleted file mode 100644 index 80a90e6..0000000 --- a/src/api/coverage/lcov-report/src/shared/comment/NewComment.ts.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - Code coverage report for src/shared/comment/NewComment.ts - - - - - - - - -
-
-

All files / src/shared/comment NewComment.ts

-
- -
- 100% - Statements - 14/14 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 14/14 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -401x -1x -1x -1x -1x -  -1x -  -  -  -1x -  -  -  -1x -  -  -  -  -1x -  -  -  -  -1x -  -  -  -  -1x -  -  -1x -  -1x -  -  -1x -  - 
import { Length, IsOptional, IsEnum } from 'class-validator'
-import { Expose } from 'class-transformer'
-import { PublicUser } from '../user/PublicUser'
-import { CommentType } from './CommentType'
-import { Comment } from './Comment'
- 
-export class NewCommentInputs {
-  @Expose()
-  @IsOptional()
-  @Length(2, 100)
-  title?: string
- 
-  @Expose()
-  @Length(2, 1000000)
-  content!: string
- 
-  @Expose()
-  @IsOptional()
-  @Length(2, 100)
-  category?: string
- 
-  @Expose()
-  @IsOptional()
-  @Length(2, 100)
-  image?: string
- 
-  @Expose()
-  @IsOptional()
-  @IsEnum(CommentType)
-  commentType?: CommentType
-}
- 
-export class NewCommentOutputs {
-  @Expose()
-  comment!: Comment
- 
-  @Expose()
-  user!: PublicUser
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/comment/NewCommentArgs.ts.html b/src/api/coverage/lcov-report/src/shared/comment/NewCommentArgs.ts.html deleted file mode 100644 index 8bb7df3..0000000 --- a/src/api/coverage/lcov-report/src/shared/comment/NewCommentArgs.ts.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - Code coverage report for src/shared/comment/NewCommentArgs.ts - - - - - - - - -
-
-

All files / src/shared/comment NewCommentArgs.ts

-
- -
- 100% - Statements - 9/9 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 9/9 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -301x -1x -1x -  -1x -  -  -  -1x -  -  -  -1x -  -  -  -  -1x -  -  -  -  -1x -  -  -  -  -1x -  - 
import { Length, IsOptional, IsEnum } from 'class-validator'
-import { Expose } from 'class-transformer'
-import { CommentType } from './CommentType'
- 
-export class NewCommentArgs {
-  @Expose()
-  @IsOptional()
-  @Length(2, 100)
-  title?: string
- 
-  @Expose()
-  @Length(2, 1000000)
-  content!: string
- 
-  @Expose()
-  @IsOptional()
-  @Length(2, 100)
-  category?: string
- 
-  @Expose()
-  @IsOptional()
-  @Length(2, 100)
-  image?: string
- 
-  @Expose()
-  @IsOptional()
-  @IsEnum(CommentType)
-  commentType?: CommentType
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/comment/index.html b/src/api/coverage/lcov-report/src/shared/comment/index.html deleted file mode 100644 index a34f78a..0000000 --- a/src/api/coverage/lcov-report/src/shared/comment/index.html +++ /dev/null @@ -1,200 +0,0 @@ - - - - - - Code coverage report for src/shared/comment - - - - - - - - -
-
-

All files src/shared/comment

-
- -
- 100% - Statements - 72/72 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 2/2 -
- - -
- 100% - Lines - 72/72 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
AddCommentView.ts -
-
100%6/6100%0/0100%0/0100%6/6
Comment.ts -
-
100%26/26100%0/0100%0/0100%26/26
CommentStatus.ts -
-
100%4/4100%2/2100%1/1100%4/4
CommentType.ts -
-
100%4/4100%2/2100%1/1100%4/4
GetComment.ts -
-
100%10/10100%0/0100%0/0100%10/10
GetLatestComments.ts -
-
100%8/8100%0/0100%0/0100%8/8
NewComment.ts -
-
100%14/14100%0/0100%0/0100%14/14
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/limit/Limit.ts.html b/src/api/coverage/lcov-report/src/shared/limit/Limit.ts.html deleted file mode 100644 index 4937290..0000000 --- a/src/api/coverage/lcov-report/src/shared/limit/Limit.ts.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - Code coverage report for src/shared/limit/Limit.ts - - - - - - - - -
-
-

All files / src/shared/limit Limit.ts

-
- -
- 100% - Statements - 12/12 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 10/10 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -319x -  -9x -9x -9x -  -  -9x -  -9x -  -  -  -9x -  -  -  -  -9x -  -  -  -  -  -  -  -9x -  -  -9x - 
import { IsDate, IsMongoId, IsInt, IsOptional } from 'class-validator'
- 
-import { ObjectId } from 'mongodb'
-import { DayJs } from '../../helpers/dayjs'
-import { Property, Index, getModel } from '../../helpers/typegoose'
- 
-@Index({ userId: 1 }, { unique: true })
-export class Limit {
-  @IsMongoId()
-  readonly _id!: ObjectId
- 
-  @Property({ required: true, ref: 'User' })
-  @IsMongoId()
-  userId!: ObjectId
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @IsInt()
-  count?: number
- 
-  @Property({
-    required: true,
-    default: DayJs().add(60, 'second').toDate(),
-    expires: '60s',
-  })
-  @IsDate()
-  expiresAt!: Date
-}
- 
-export const LimitModel = getModel(Limit, { schemaOptions: { timestamps: false } })
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/limit/index.html b/src/api/coverage/lcov-report/src/shared/limit/index.html deleted file mode 100644 index 1f0e6e3..0000000 --- a/src/api/coverage/lcov-report/src/shared/limit/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/shared/limit - - - - - - - - -
-
-

All files src/shared/limit

-
- -
- 100% - Statements - 12/12 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 10/10 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Limit.ts -
-
100%12/12100%0/0100%0/0100%10/10
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/mongo/ResponseError.ts.html b/src/api/coverage/lcov-report/src/shared/mongo/ResponseError.ts.html deleted file mode 100644 index ab706f2..0000000 --- a/src/api/coverage/lcov-report/src/shared/mongo/ResponseError.ts.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - Code coverage report for src/shared/mongo/ResponseError.ts - - - - - - - - -
-
-

All files / src/shared/mongo ResponseError.ts

-
- -
- 100% - Statements - 5/5 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 5/5 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -1320x -  -  -  -  -26x -26x -26x -  -26x -  -  - 
export class ResponseError extends Error {
-  status: number
-  expose: boolean
- 
-  constructor(status: number, m: string) {
-    super(m)
-    this.status = status
-    this.expose = status < 500
- 
-    Object.setPrototypeOf(this, ResponseError.prototype)
-  }
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/mongo/index.html b/src/api/coverage/lcov-report/src/shared/mongo/index.html deleted file mode 100644 index c705731..0000000 --- a/src/api/coverage/lcov-report/src/shared/mongo/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/shared/mongo - - - - - - - - -
-
-

All files src/shared/mongo

-
- -
- 100% - Statements - 5/5 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 5/5 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
ResponseError.ts -
-
100%5/5100%0/0100%1/1100%5/5
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/notification/Notification.ts.html b/src/api/coverage/lcov-report/src/shared/notification/Notification.ts.html deleted file mode 100644 index 15190aa..0000000 --- a/src/api/coverage/lcov-report/src/shared/notification/Notification.ts.html +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - Code coverage report for src/shared/notification/Notification.ts - - - - - - - - -
-
-

All files / src/shared/notification Notification.ts

-
- -
- 100% - Statements - 18/18 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 18/18 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -572x -2x -2x -2x -2x -  -2x -  -2x -  -  -  -2x -  -  -  -  -2x -  -  -  -  -2x -  -  -  -  -2x -  -  -  -  -2x -  -  -  -  -2x -  -  -  -  -2x -  -  -  -2x -  -  -2x -  -  -2x -  -  -2x - 
import { IsDate, IsInt, IsEnum, Length, IsMongoId, IsOptional } from 'class-validator'
-import { ObjectId } from 'mongodb'
-import { Property, getModel } from '../../helpers/typegoose'
-import { TargetType } from './TargetType'
-import { NotificationType } from './NotificationType'
- 
-export class Notification {
-  @IsMongoId()
-  readonly _id!: ObjectId
- 
-  @Property({ required: true, ref: 'User' })
-  @IsMongoId()
-  userId!: ObjectId
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @Length(2, 100)
-  data?: string
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @IsMongoId()
-  targetId?: ObjectId
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @IsEnum(TargetType)
-  targetType?: TargetType
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @Length(2, 100)
-  targetName?: string
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @Length(2, 100)
-  targetUrl?: string
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @IsInt()
-  count?: number
- 
-  @Property({ required: true })
-  @IsEnum(NotificationType)
-  notificationType!: NotificationType
- 
-  @IsDate()
-  createdAt!: Date
- 
-  @IsDate()
-  updatedAt!: Date
-}
- 
-export const NotificationModel = getModel(Notification, { schemaOptions: { timestamps: true } })
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/notification/NotificationType.ts.html b/src/api/coverage/lcov-report/src/shared/notification/NotificationType.ts.html deleted file mode 100644 index 215614e..0000000 --- a/src/api/coverage/lcov-report/src/shared/notification/NotificationType.ts.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - Code coverage report for src/shared/notification/NotificationType.ts - - - - - - - - -
-
-

All files / src/shared/notification NotificationType.ts

-
- -
- 100% - Statements - 6/6 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 6/6 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -82x -2x -2x -2x -2x -2x -  - 
export enum NotificationType {
-  WELCOME = 'WELCOME',
-  COMMENT_UPVOTED = 'COMMENT_UPVOTED',
-  COMMENT_DOWNVOTED = 'COMMENT_DOWNVOTED',
-  COMMENT_REPLIED = 'COMMENT_REPLIED',
-  AT_REFERENCE = 'AT_REFERENCE',
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/notification/TargetType.ts.html b/src/api/coverage/lcov-report/src/shared/notification/TargetType.ts.html deleted file mode 100644 index c064b9a..0000000 --- a/src/api/coverage/lcov-report/src/shared/notification/TargetType.ts.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - Code coverage report for src/shared/notification/TargetType.ts - - - - - - - - -
-
-

All files / src/shared/notification TargetType.ts

-
- -
- 100% - Statements - 5/5 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 5/5 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -72x -2x -2x -2x -2x -  - 
export enum TargetType {
-  WELCOME = 'WELCOME',
-  COMMENT = 'COMMENT',
-  POST = 'POST',
-  AT_REFERENCE = 'AT_REFERENCE',
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/notification/index.html b/src/api/coverage/lcov-report/src/shared/notification/index.html deleted file mode 100644 index 04219da..0000000 --- a/src/api/coverage/lcov-report/src/shared/notification/index.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - Code coverage report for src/shared/notification - - - - - - - - -
-
-

All files src/shared/notification

-
- -
- 100% - Statements - 29/29 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 2/2 -
- - -
- 100% - Lines - 29/29 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Notification.ts -
-
100%18/18100%0/0100%0/0100%18/18
NotificationType.ts -
-
100%6/6100%2/2100%1/1100%6/6
TargetType.ts -
-
100%5/5100%2/2100%1/1100%5/5
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/quota/Quota.ts.html b/src/api/coverage/lcov-report/src/shared/quota/Quota.ts.html deleted file mode 100644 index 147e6f0..0000000 --- a/src/api/coverage/lcov-report/src/shared/quota/Quota.ts.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - Code coverage report for src/shared/quota/Quota.ts - - - - - - - - -
-
-

All files / src/shared/quota Quota.ts

-
- -
- 100% - Statements - 14/14 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 12/12 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -379x -  -9x -9x -9x -9x -  -  -9x -  -9x -  -  -  -9x -  -  -  -  -9x -  -  -  -  -9x -  -  -  -  -  -  -  -9x -  -  -9x - 
import { IsDate, IsMongoId, IsInt, IsOptional, IsEnum } from 'class-validator'
- 
-import { ObjectId } from 'mongodb'
-import { DayJs } from '../../helpers/dayjs'
-import { Property, Index, getModel } from '../../helpers/typegoose'
-import { QuotaType } from './QuotaType'
- 
-@Index({ userId: 1, commentType: 1 }, { unique: true })
-export class Quota {
-  @IsMongoId()
-  readonly _id!: ObjectId
- 
-  @Property({ required: true, ref: 'User' })
-  @IsMongoId()
-  userId!: ObjectId
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @IsEnum(QuotaType)
-  quotaType?: QuotaType
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @IsInt()
-  count?: number
- 
-  @Property({
-    required: true,
-    default: DayJs().add(60, 'second').toDate(),
-    expires: '60s',
-  })
-  @IsDate()
-  expiresAt!: Date
-}
- 
-export const QuotaModel = getModel(Quota, { schemaOptions: { timestamps: false } })
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/quota/QuotaType.ts.html b/src/api/coverage/lcov-report/src/shared/quota/QuotaType.ts.html deleted file mode 100644 index e988a55..0000000 --- a/src/api/coverage/lcov-report/src/shared/quota/QuotaType.ts.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - Code coverage report for src/shared/quota/QuotaType.ts - - - - - - - - -
-
-

All files / src/shared/quota QuotaType.ts

-
- -
- 100% - Statements - 4/4 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 4/4 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -69x -9x -9x -9x -  - 
export enum QuotaType {
-  RATE_LIMIT = 'RATE_LIMIT',
-  COMMENT = 'COMMENT',
-  VOTE = 'VOTE',
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/quota/index.html b/src/api/coverage/lcov-report/src/shared/quota/index.html deleted file mode 100644 index 6e72f02..0000000 --- a/src/api/coverage/lcov-report/src/shared/quota/index.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - Code coverage report for src/shared/quota - - - - - - - - -
-
-

All files src/shared/quota

-
- -
- 100% - Statements - 18/18 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 16/16 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Quota.ts -
-
100%14/14100%0/0100%0/0100%12/12
QuotaType.ts -
-
100%4/4100%2/2100%1/1100%4/4
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/user/ChangePassword.ts.html b/src/api/coverage/lcov-report/src/shared/user/ChangePassword.ts.html deleted file mode 100644 index db228b1..0000000 --- a/src/api/coverage/lcov-report/src/shared/user/ChangePassword.ts.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - Code coverage report for src/shared/user/ChangePassword.ts - - - - - - - - -
-
-

All files / src/shared/user ChangePassword.ts

-
- -
- 100% - Statements - 6/6 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 6/6 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -171x -1x -  -1x -  -  -  -1x -  -  -  -  -1x -  -  -1x - 
import { Length, Matches } from 'class-validator'
-import { Expose } from 'class-transformer'
- 
-export class ChangePasswordInputs {
-  @Expose()
-  @Length(8, 50)
-  @Matches(/^(?=.*[0-9])(?=.*[a-zA-Z])(.+)$/)
-  password!: string
- 
-  @Expose()
-  @Length(8, 50)
-  @Matches(/^(?=.*[0-9])(?=.*[a-zA-Z])(.+)$/)
-  newPassword!: string
-}
- 
-export class ChangePasswordOutputs {}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/user/ChangePasswordArgs.ts.html b/src/api/coverage/lcov-report/src/shared/user/ChangePasswordArgs.ts.html deleted file mode 100644 index 39990f6..0000000 --- a/src/api/coverage/lcov-report/src/shared/user/ChangePasswordArgs.ts.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - Code coverage report for src/shared/user/ChangePasswordArgs.ts - - - - - - - - -
-
-

All files / src/shared/user ChangePasswordArgs.ts

-
- -
- 100% - Statements - 5/5 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 5/5 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -151x -1x -  -1x -  -  -  -1x -  -  -  -  -1x -  - 
import { Length, Matches } from 'class-validator'
-import { Expose } from 'class-transformer'
- 
-export class ChangePasswordArgs {
-  @Expose()
-  @Length(8, 50)
-  @Matches(/^(?=.*[0-9])(?=.*[a-zA-Z])(.+)$/)
-  password!: string
- 
-  @Expose()
-  @Length(8, 50)
-  @Matches(/^(?=.*[0-9])(?=.*[a-zA-Z])(.+)$/)
-  newPassword!: string
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/user/ForgotPassword.ts.html b/src/api/coverage/lcov-report/src/shared/user/ForgotPassword.ts.html deleted file mode 100644 index ce9dd81..0000000 --- a/src/api/coverage/lcov-report/src/shared/user/ForgotPassword.ts.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - Code coverage report for src/shared/user/ForgotPassword.ts - - - - - - - - -
-
-

All files / src/shared/user ForgotPassword.ts

-
- -
- 100% - Statements - 6/6 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 6/6 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -151x -1x -  -1x -  -  -1x -  -  -  -1x -  -  -1x - 
import { Length } from 'class-validator'
-import { Expose } from 'class-transformer'
- 
-export class ForgotPasswordInputs {
-  @Expose()
-  @Length(2, 50)
-  usernameOrEmail!: string
- 
-  @Expose()
-  @Length(100, 1000)
-  recaptchaToken!: string
-}
- 
-export class ForgotPasswordOutputs {}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/user/ForgotPasswordArgs.ts.html b/src/api/coverage/lcov-report/src/shared/user/ForgotPasswordArgs.ts.html deleted file mode 100644 index 6bcb41e..0000000 --- a/src/api/coverage/lcov-report/src/shared/user/ForgotPasswordArgs.ts.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - Code coverage report for src/shared/user/ForgotPasswordArgs.ts - - - - - - - - -
-
-

All files / src/shared/user ForgotPasswordArgs.ts

-
- -
- 100% - Statements - 5/5 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 5/5 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -131x -1x -  -1x -  -  -1x -  -  -  -1x -  - 
import { Length } from 'class-validator'
-import { Expose } from 'class-transformer'
- 
-export class ForgotPasswordArgs {
-  @Expose()
-  @Length(2, 50)
-  usernameOrEmail!: string
- 
-  @Expose()
-  @Length(100, 1000)
-  recaptchaToken!: string
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/user/GetPublicUser.ts.html b/src/api/coverage/lcov-report/src/shared/user/GetPublicUser.ts.html deleted file mode 100644 index bae2ac2..0000000 --- a/src/api/coverage/lcov-report/src/shared/user/GetPublicUser.ts.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - Code coverage report for src/shared/user/GetPublicUser.ts - - - - - - - - -
-
-

All files / src/shared/user GetPublicUser.ts

-
- -
- 100% - Statements - 6/6 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 6/6 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -153x -3x -3x -  -  -3x -  -  -3x -  -  -3x -  -  - 
import { IsMongoId } from 'class-validator'
-import { Expose } from 'class-transformer'
-import { ObjectId } from 'mongodb'
-import { PublicUser } from './PublicUser'
- 
-export class GetPublicUserInputs {
-  @Expose()
-  @IsMongoId()
-  userId!: ObjectId
-}
- 
-export class GetPublicUserOutputs {
-  user!: PublicUser
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/user/GetPublicUserArgs.ts.html b/src/api/coverage/lcov-report/src/shared/user/GetPublicUserArgs.ts.html deleted file mode 100644 index 778738c..0000000 --- a/src/api/coverage/lcov-report/src/shared/user/GetPublicUserArgs.ts.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - Code coverage report for src/shared/user/GetPublicUserArgs.ts - - - - - - - - -
-
-

All files / src/shared/user GetPublicUserArgs.ts

-
- -
- 100% - Statements - 4/4 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 4/4 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -93x -3x -  -3x -  -  -3x -  - 
import { IsMongoId } from 'class-validator'
-import { Expose } from 'class-transformer'
- 
-export class GetPublicUserArgs {
-  @Expose()
-  @IsMongoId()
-  userId!: string
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/user/IsEqualTo.ts.html b/src/api/coverage/lcov-report/src/shared/user/IsEqualTo.ts.html deleted file mode 100644 index 2fa9082..0000000 --- a/src/api/coverage/lcov-report/src/shared/user/IsEqualTo.ts.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - Code coverage report for src/shared/user/IsEqualTo.ts - - - - - - - - -
-
-

All files / src/shared/user IsEqualTo.ts

-
- -
- 77.78% - Statements - 7/9 -
- - -
- 100% - Branches - 0/0 -
- - -
- 75% - Functions - 3/4 -
- - -
- 77.78% - Lines - 7/9 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -2617x -  -17x -17x -17x -  -  -  -  -  -  -  -21x -21x -21x -  -  -  -  -  -  -  -  -  -  - 
import { registerDecorator, ValidationArguments, ValidationOptions } from 'class-validator'
- 
-export function IsEqualTo(property: string, validationOptions?: ValidationOptions) {
-  return (object: any, propertyName: string): any => {
-    registerDecorator({
-      name: 'isEqualTo',
-      target: object.constructor,
-      propertyName,
-      constraints: [property],
-      options: validationOptions,
-      validator: {
-        validate(value: any, args: ValidationArguments): boolean {
-          const [relatedPropertyName] = args.constraints
-          const relatedValue = (args.object as any)[relatedPropertyName]
-          return value === relatedValue
-        },
- 
-        defaultMessage(args: ValidationArguments): string {
-          const [relatedPropertyName] = args.constraints
-          return `$property must match ${relatedPropertyName} exactly`
-        },
-      },
-    })
-  }
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/user/Login.ts.html b/src/api/coverage/lcov-report/src/shared/user/Login.ts.html deleted file mode 100644 index 4005a85..0000000 --- a/src/api/coverage/lcov-report/src/shared/user/Login.ts.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - Code coverage report for src/shared/user/Login.ts - - - - - - - - -
-
-

All files / src/shared/user Login.ts

-
- -
- 100% - Statements - 8/8 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 8/8 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -251x -1x -  -  -1x -  -  -1x -  -  -  -  -1x -  -  -  -1x -  -  -1x -  -  -1x -  - 
import { Length, Matches, IsJWT } from 'class-validator'
-import { Expose } from 'class-transformer'
-import { Jwt } from './Jwt'
- 
-export class LoginInputs {
-  @Expose()
-  @Length(2, 50)
-  usernameOrEmail!: string
- 
-  @Expose()
-  @Length(8, 50)
-  @Matches(/^(?=.*[0-9])(?=.*[a-zA-Z])(.+)$/, { message: 'Password must have at least one letter and one digit' })
-  password!: string
- 
-  @Expose()
-  @Length(100, 1000)
-  recaptchaToken!: string
-}
- 
-export class LoginOutputs {
-  @Expose()
-  @IsJWT()
-  jwt!: Jwt
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/user/LoginArgs.ts.html b/src/api/coverage/lcov-report/src/shared/user/LoginArgs.ts.html deleted file mode 100644 index d2f5c10..0000000 --- a/src/api/coverage/lcov-report/src/shared/user/LoginArgs.ts.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - Code coverage report for src/shared/user/LoginArgs.ts - - - - - - - - -
-
-

All files / src/shared/user LoginArgs.ts

-
- -
- 100% - Statements - 6/6 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 6/6 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -181x -1x -  -1x -  -  -1x -  -  -  -  -1x -  -  -  -1x -  - 
import { Length, Matches } from 'class-validator'
-import { Expose } from 'class-transformer'
- 
-export class LoginArgs {
-  @Expose()
-  @Length(2, 50)
-  usernameOrEmail!: string
- 
-  @Expose()
-  @Length(8, 50)
-  @Matches(/^(?=.*[0-9])(?=.*[a-zA-Z])(.+)$/, { message: 'Password must have at least one letter and one digit' })
-  password!: string
- 
-  @Expose()
-  @Length(100, 1000)
-  recaptchaToken!: string
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/user/PublicUser.ts.html b/src/api/coverage/lcov-report/src/shared/user/PublicUser.ts.html deleted file mode 100644 index 96f9341..0000000 --- a/src/api/coverage/lcov-report/src/shared/user/PublicUser.ts.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - Code coverage report for src/shared/user/PublicUser.ts - - - - - - - - -
-
-

All files / src/shared/user PublicUser.ts

-
- -
- 100% - Statements - 9/9 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 9/9 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -232x -2x -  -2x -  -2x -  -2x -  -  -  -2x -  -  -2x -  -  -2x -  -  -2x -  - 
import { IsDate, IsEmail, IsEnum, IsMongoId, Length, Matches } from 'class-validator'
-import { ObjectId } from 'mongodb'
- 
-import { UserRole } from './UserRole'
- 
-export class PublicUser {
-  @IsMongoId()
-  readonly _id!: ObjectId
- 
-  @Length(2, 20)
-  @Matches(/^[a-zA-Z0-9_]*$/, { message: 'Username can only contain letters, numbers and underscores' })
-  username!: string
- 
-  @IsEmail()
-  emailVerified?: boolean
- 
-  @IsEnum(UserRole)
-  userRole?: UserRole
- 
-  @IsDate()
-  createdAt!: Date
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/user/ResetPassword.ts.html b/src/api/coverage/lcov-report/src/shared/user/ResetPassword.ts.html deleted file mode 100644 index 80b186c..0000000 --- a/src/api/coverage/lcov-report/src/shared/user/ResetPassword.ts.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - Code coverage report for src/shared/user/ResetPassword.ts - - - - - - - - -
-
-

All files / src/shared/user ResetPassword.ts

-
- -
- 100% - Statements - 7/7 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 7/7 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -201x -1x -  -1x -  -  -1x -  -  -  -1x -  -  -  -  -1x -  -  -1x - 
import { Length, Matches } from 'class-validator'
-import { Expose } from 'class-transformer'
- 
-export class ResetPasswordInputs {
-  @Expose()
-  @Length(4, 4)
-  solution!: string
- 
-  @Expose()
-  @Length(16, 32)
-  token!: string
- 
-  @Expose()
-  @Length(8, 50)
-  @Matches(/^(?=.*[0-9])(?=.*[a-zA-Z])(.+)$/)
-  newPassword!: string
-}
- 
-export class ResetPasswordOutputs {}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/user/ResetPasswordArgs.ts.html b/src/api/coverage/lcov-report/src/shared/user/ResetPasswordArgs.ts.html deleted file mode 100644 index c19446a..0000000 --- a/src/api/coverage/lcov-report/src/shared/user/ResetPasswordArgs.ts.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - Code coverage report for src/shared/user/ResetPasswordArgs.ts - - - - - - - - -
-
-

All files / src/shared/user ResetPasswordArgs.ts

-
- -
- 100% - Statements - 6/6 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 6/6 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -181x -1x -  -1x -  -  -1x -  -  -  -1x -  -  -  -  -1x -  - 
import { Length, Matches } from 'class-validator'
-import { Expose } from 'class-transformer'
- 
-export class ResetPasswordArgs {
-  @Expose()
-  @Length(4, 4)
-  solution!: string
- 
-  @Expose()
-  @Length(16, 32)
-  token!: string
- 
-  @Expose()
-  @Length(8, 50)
-  @Matches(/^(?=.*[0-9])(?=.*[a-zA-Z])(.+)$/)
-  newPassword!: string
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/user/Role.ts.html b/src/api/coverage/lcov-report/src/shared/user/Role.ts.html deleted file mode 100644 index 0aca7ee..0000000 --- a/src/api/coverage/lcov-report/src/shared/user/Role.ts.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - Code coverage report for src/shared/user/Role.ts - - - - - - - - -
-
-

All files / src/shared/user Role.ts

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -52x -2x -2x -  - 
export enum Role {
-  MODERATOR = 'MODERATOR',
-  ADMIN = 'ADMIN'
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/user/SignUp.ts.html b/src/api/coverage/lcov-report/src/shared/user/SignUp.ts.html deleted file mode 100644 index e5b65da..0000000 --- a/src/api/coverage/lcov-report/src/shared/user/SignUp.ts.html +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - Code coverage report for src/shared/user/SignUp.ts - - - - - - - - -
-
-

All files / src/shared/user SignUp.ts

-
- -
- 100% - Statements - 11/11 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 11/11 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -3617x -17x -  -17x -  -17x -  -  -  -17x -  -  -  -17x -  -  -  -  -17x -  -  -  -  -17x -  -  -  -17x -  -  -17x -  -  -17x -  - 
import { IsEmail, Length, Matches, IsJWT } from 'class-validator'
-import { Expose } from 'class-transformer'
-import { Jwt } from './Jwt'
-import { IsEqualTo } from './IsEqualTo'
- 
-export class SignUpInputs {
-  @Expose()
-  @Length(2, 20)
-  @Matches(/^[a-zA-Z0-9_]*$/, { message: 'Username can only contain letters, numbers and underscores' })
-  username!: string
- 
-  @Expose()
-  @IsEmail()
-  email!: string
- 
-  @Expose()
-  @Length(8, 50)
-  @Matches(/^(?=.*[0-9])(?=.*[a-zA-Z])(.+)$/, { message: 'Password must have at least one letter and one digit' })
-  password!: string
- 
-  @Expose()
-  @Length(8, 50)
-  @IsEqualTo('password')
-  confirmPassword!: string
- 
-  @Expose()
-  @Length(100, 1000)
-  recaptchaToken!: string
-}
- 
-export class SignUpOutputs {
-  @Expose()
-  @IsJWT()
-  jwt!: Jwt
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/user/SignUpArgs.ts.html b/src/api/coverage/lcov-report/src/shared/user/SignUpArgs.ts.html deleted file mode 100644 index f8f9c17..0000000 --- a/src/api/coverage/lcov-report/src/shared/user/SignUpArgs.ts.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - Code coverage report for src/shared/user/SignUpArgs.ts - - - - - - - - -
-
-

All files / src/shared/user SignUpArgs.ts

-
- -
- 100% - Statements - 7/7 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 7/7 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -2317x -17x -  -17x -  -  -  -17x -  -  -  -17x -  -  -  -  -17x -  -  -  -17x -  - 
import { IsEmail, Length, Matches } from 'class-validator'
-import { Expose } from 'class-transformer'
- 
-export class SignUpArgs {
-  @Expose()
-  @Length(2, 20)
-  @Matches(/^[a-zA-Z0-9_]*$/, { message: 'Username can only contain letters, numbers and underscores' })
-  username!: string
- 
-  @Expose()
-  @IsEmail()
-  email!: string
- 
-  @Expose()
-  @Length(8, 50)
-  @Matches(/^(?=.*[0-9])(?=.*[a-zA-Z])(.+)$/, { message: 'Password must have at least one letter and one digit' })
-  password!: string
- 
-  @Expose()
-  @Length(100, 1000)
-  recaptchaToken!: string
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/user/User.ts.html b/src/api/coverage/lcov-report/src/shared/user/User.ts.html deleted file mode 100644 index 1d27bd6..0000000 --- a/src/api/coverage/lcov-report/src/shared/user/User.ts.html +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - Code coverage report for src/shared/user/User.ts - - - - - - - - -
-
-

All files / src/shared/user User.ts

-
- -
- 100% - Statements - 15/15 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 15/15 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -4717x -17x -  -17x -17x -  -  -17x -  -17x -  -  -  -  -17x -  -  -  -17x -  -  -  -  -17x -  -  -17x -  -  -  -  -17x -  -  -  -  -17x -  -  -17x -  -  -17x -  -  -17x - 
import { IsBoolean, IsDate, IsEmail, IsEnum, IsMongoId, IsOptional, Length, Matches } from 'class-validator'
-import { ObjectId } from 'mongodb'
- 
-import { getModel, Property } from '../../helpers/typegoose'
-import { UserRole } from './UserRole'
- 
-// @ModelOptions({ options: { customName: 'Users' } })
-export class User {
-  @IsMongoId()
-  readonly _id!: ObjectId
- 
-  @Property({ required: true, unique: true, index: true })
-  @Length(2, 20)
-  @Matches(/^[a-zA-Z0-9_]*$/, { message: 'Username can only contain letters, numbers and underscores' })
-  username!: string
- 
-  @Property({ required: true, unique: true, index: true })
-  @IsEmail()
-  email!: string
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @IsBoolean()
-  emailVerified?: boolean
- 
-  @Property({ required: true })
-  hashedPassword!: string
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @IsEnum(UserRole)
-  userRole?: UserRole
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @IsDate()
-  latestLoginAttempt?: Date
- 
-  @IsDate()
-  createdAt!: Date
- 
-  @IsDate()
-  updatedAt!: Date
-}
- 
-export const UserModel = getModel(User, { schemaOptions: { timestamps: true } })
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/user/UserRole.ts.html b/src/api/coverage/lcov-report/src/shared/user/UserRole.ts.html deleted file mode 100644 index 846d9d1..0000000 --- a/src/api/coverage/lcov-report/src/shared/user/UserRole.ts.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - Code coverage report for src/shared/user/UserRole.ts - - - - - - - - -
-
-

All files / src/shared/user UserRole.ts

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -518x -18x -18x -  - 
export enum UserRole {
-  MODERATOR = 'MODERATOR',
-  ADMIN = 'ADMIN',
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/user/VerifyEmail.ts.html b/src/api/coverage/lcov-report/src/shared/user/VerifyEmail.ts.html deleted file mode 100644 index 385a883..0000000 --- a/src/api/coverage/lcov-report/src/shared/user/VerifyEmail.ts.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - Code coverage report for src/shared/user/VerifyEmail.ts - - - - - - - - -
-
-

All files / src/shared/user VerifyEmail.ts

-
- -
- 100% - Statements - 5/5 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 5/5 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -111x -1x -  -1x -  -  -1x -  -  -1x - 
import { Length } from 'class-validator'
-import { Expose } from 'class-transformer'
- 
-export class VerifyEmailInputs {
-  @Expose()
-  @Length(4, 4)
-  solution!: string
-}
- 
-export class VerifyEmailOutputs {}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/user/VerifyEmailArgs.ts.html b/src/api/coverage/lcov-report/src/shared/user/VerifyEmailArgs.ts.html deleted file mode 100644 index 4880263..0000000 --- a/src/api/coverage/lcov-report/src/shared/user/VerifyEmailArgs.ts.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - Code coverage report for src/shared/user/VerifyEmailArgs.ts - - - - - - - - -
-
-

All files / src/shared/user VerifyEmailArgs.ts

-
- -
- 100% - Statements - 4/4 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 4/4 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -91x -1x -  -1x -  -  -1x -  - 
import { Length } from 'class-validator'
-import { Expose } from 'class-transformer'
- 
-export class VerifyEmailArgs {
-  @Expose()
-  @Length(4, 4)
-  solution!: string
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/user/index.html b/src/api/coverage/lcov-report/src/shared/user/index.html deleted file mode 100644 index fa09a60..0000000 --- a/src/api/coverage/lcov-report/src/shared/user/index.html +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - Code coverage report for src/shared/user - - - - - - - - -
-
-

All files src/shared/user

-
- -
- 97.65% - Statements - 83/85 -
- - -
- 100% - Branches - 2/2 -
- - -
- 80% - Functions - 4/5 -
- - -
- 97.65% - Lines - 83/85 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
ChangePassword.ts -
-
100%6/6100%0/0100%0/0100%6/6
ForgotPassword.ts -
-
100%6/6100%0/0100%0/0100%6/6
GetPublicUser.ts -
-
100%6/6100%0/0100%0/0100%6/6
IsEqualTo.ts -
-
77.78%7/9100%0/075%3/477.78%7/9
Login.ts -
-
100%8/8100%0/0100%0/0100%8/8
PublicUser.ts -
-
100%9/9100%0/0100%0/0100%9/9
ResetPassword.ts -
-
100%7/7100%0/0100%0/0100%7/7
SignUp.ts -
-
100%11/11100%0/0100%0/0100%11/11
User.ts -
-
100%15/15100%0/0100%0/0100%15/15
UserRole.ts -
-
100%3/3100%2/2100%1/1100%3/3
VerifyEmail.ts -
-
100%5/5100%0/0100%0/0100%5/5
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/vote/SendVote.ts.html b/src/api/coverage/lcov-report/src/shared/vote/SendVote.ts.html deleted file mode 100644 index 83b7fcc..0000000 --- a/src/api/coverage/lcov-report/src/shared/vote/SendVote.ts.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - Code coverage report for src/shared/vote/SendVote.ts - - - - - - - - -
-
-

All files / src/shared/vote SendVote.ts

-
- -
- 100% - Statements - 8/8 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 8/8 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -171x -1x -1x -1x -  -1x -  -  -1x -  -  -  -1x -  -  -1x - 
import { IsMongoId, IsEnum } from 'class-validator'
-import { Expose } from 'class-transformer'
-import { ObjectId } from 'mongodb'
-import { VoteDirection } from './VoteDirection'
- 
-export class SendVoteInputs {
-  @Expose()
-  @IsMongoId()
-  commentId!: ObjectId
- 
-  @Expose()
-  @IsEnum(VoteDirection)
-  voteDirection!: VoteDirection
-}
- 
-export class SendVoteOutputs {}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/vote/Vote.ts.html b/src/api/coverage/lcov-report/src/shared/vote/Vote.ts.html deleted file mode 100644 index 88c6cb8..0000000 --- a/src/api/coverage/lcov-report/src/shared/vote/Vote.ts.html +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - Code coverage report for src/shared/vote/Vote.ts - - - - - - - - -
-
-

All files / src/shared/vote Vote.ts

-
- -
- 100% - Statements - 14/14 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 12/12 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -342x -2x -  -2x -2x -  -  -  -2x -  -2x -  -  -  -2x -  -  -  -2x -  -  -  -  -2x -  -  -2x -  -  -2x -  -  -2x - 
import { IsDate, IsEnum, IsMongoId, IsOptional } from 'class-validator'
-import { ObjectId } from 'mongodb'
- 
-import { getModel, Index, Property } from '../../helpers/typegoose'
-import { VoteDirection } from './VoteDirection'
- 
-@Index({ userId: 1, commentId: 1 }, { unique: true })
-@Index({ userId: 1, commentId: 1, voteDirection: 1 }, { unique: true })
-export class Vote {
-  @IsMongoId()
-  readonly _id!: ObjectId
- 
-  @Property({ required: true, ref: 'User' })
-  @IsMongoId()
-  userId!: ObjectId
- 
-  @Property({ required: true, ref: 'Comment' })
-  @IsMongoId()
-  commentId!: ObjectId
- 
-  @Property({ nullable: true, optional: true })
-  @IsOptional()
-  @IsEnum(VoteDirection)
-  voteDirection?: VoteDirection
- 
-  @IsDate()
-  createdAt!: Date
- 
-  @IsDate()
-  updatedAt!: Date
-}
- 
-export const VoteModel = getModel(Vote, { schemaOptions: { timestamps: true } })
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/vote/VoteDirection.ts.html b/src/api/coverage/lcov-report/src/shared/vote/VoteDirection.ts.html deleted file mode 100644 index 416b584..0000000 --- a/src/api/coverage/lcov-report/src/shared/vote/VoteDirection.ts.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - Code coverage report for src/shared/vote/VoteDirection.ts - - - - - - - - -
-
-

All files / src/shared/vote VoteDirection.ts

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -52x -2x -2x -  - 
export enum VoteDirection {
-  UP = 'UP',
-  DOWN = 'DOWN',
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/vote/VoteUpArgs.ts.html b/src/api/coverage/lcov-report/src/shared/vote/VoteUpArgs.ts.html deleted file mode 100644 index 52157c0..0000000 --- a/src/api/coverage/lcov-report/src/shared/vote/VoteUpArgs.ts.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - Code coverage report for src/shared/vote/VoteUpArgs.ts - - - - - - - - -
-
-

All files / src/shared/vote VoteUpArgs.ts

-
- -
- 100% - Statements - 7/7 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 7/7 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -151x -1x -1x -1x -  -1x -  -  -1x -  -  -  -1x -  - 
import { IsMongoId, IsEnum } from 'class-validator'
-import { Expose } from 'class-transformer'
-import { ObjectId } from 'mongodb'
-import { VoteDirection } from './VoteDirection'
- 
-export class SendVoteArgs {
-  @Expose()
-  @IsMongoId()
-  commentId!: ObjectId
- 
-  @Expose()
-  @IsEnum(VoteDirection)
-  direction!: VoteDirection
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/shared/vote/index.html b/src/api/coverage/lcov-report/src/shared/vote/index.html deleted file mode 100644 index 953b01c..0000000 --- a/src/api/coverage/lcov-report/src/shared/vote/index.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - Code coverage report for src/shared/vote - - - - - - - - -
-
-

All files src/shared/vote

-
- -
- 100% - Statements - 25/25 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 23/23 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
SendVote.ts -
-
100%8/8100%0/0100%0/0100%8/8
Vote.ts -
-
100%14/14100%0/0100%0/0100%12/12
VoteDirection.ts -
-
100%3/3100%2/2100%1/1100%3/3
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/test/createTestUser.ts.html b/src/api/coverage/lcov-report/src/test/createTestUser.ts.html deleted file mode 100644 index b13f76c..0000000 --- a/src/api/coverage/lcov-report/src/test/createTestUser.ts.html +++ /dev/null @@ -1,250 +0,0 @@ - - - - - - Code coverage report for src/test/createTestUser.ts - - - - - - - - -
-
-

All files / src/test createTestUser.ts

-
- -
- 100% - Statements - 21/21 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 3/3 -
- - -
- 100% - Lines - 19/19 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58  -  -16x -16x -16x -  -  -16x -16x -  -  -  -  -  -  -  -  -  -  -  -16x -17x -  -17x -  -17x -  -17x -17x -  -17x -19x -  -17x -  -  -  -  -  -  -  -  -  -  -  -  -  -40x -  -17x -  -17x -  -17x -  -17x -  - 
import { Context, Next } from 'koa'
- 
-import * as getRandomCaptchaPairObject from '../resolvers/captcha/helpers/getRandomCaptchaPair'
-import * as sendEmailVerifyEmailObject from '../resolvers/user/helpers/sendEmailVerifyEmail'
-import { signUp } from '../resolvers/user/signUp/signUp'
-import { CaptchaSolution } from '../shared/captcha/CaptchaSolution'
-import { Jwt } from '../shared/user/Jwt'
-import { User, UserModel } from '../shared/user/User'
-import { mockConnect } from './mockConnect'
- 
-interface UserContextNext {
-  user: User
-  jwt: Jwt
-  next: Next
-}
- 
-interface CreateTestUser {
-  (email: string, username: string, password: string): Promise<UserContextNext>
-}
- 
-export const createTestUser: CreateTestUser = async (email, username, password) => {
-  process.env.JWT_PRIVATE_KEY =
-    '-----BEGIN RSA PRIVATE KEY-----\nMIIBOAIBAAJAdbl2XgrYP6biZBeaWDm0ejnmDipjNXG5qLXNQe5uxqXZDr3zvJP6\n9t9F0DttXWKqerb05LmwWYgnOOVPrmBN0wIDAQABAkAMyMg27DyRpQDe18VWIWYd\nA96c2TOO4TvFO4D/0PHMtp0AxQLC7gS6gMYXSG25gyBGl8ywhjYYKp4zdecxW5UB\nAiEA4RgFBMtaL2p6uNnJqa/kc5k4pGPUMii81Gig03S54IECIQCF43EeIykLl7SQ\nIEJRwx3SY+H6TqZOlqLhN3+PkVqEUwIga6lDbUGeRyOUwylX7VN131yf3PDqo3sc\npjPNCJbB+QECICNydvVaq7hE/uoVkFljRhb4mNCTWBaAbTkhX2VcP1G/AiBeEpLY\nsU90PIZjVhgSVgi+eA6gPAyZJzRoPB+3XyZ3ZQ==\n-----END RSA PRIVATE KEY-----'
-  process.env.JWT_PUBLIC_KEY =
-    '-----BEGIN PUBLIC KEY-----\nMFswDQYJKoZIhvcNAQEBBQADSgAwRwJAdbl2XgrYP6biZBeaWDm0ejnmDipjNXG5\nqLXNQe5uxqXZDr3zvJP69t9F0DttXWKqerb05LmwWYgnOOVPrmBN0wIDAQAB\n-----END PUBLIC KEY-----'
-  await mockConnect()
- 
-  const captchaIndex = 0
-  const captchaSolution: CaptchaSolution = '0000'
- 
-  jest.spyOn(getRandomCaptchaPairObject, 'getRandomCaptchaPair').mockReturnValue({ captchaIndex, captchaSolution })
-  jest.spyOn(sendEmailVerifyEmailObject, 'sendEmailVerifyEmail').mockImplementation(async () => Promise.resolve())
- 
-  const signUpContext: Context = {
-    request: {
-      headers: {},
-      body: {
-        email,
-        username,
-        password,
-        confirmPassword: password,
-        recaptchaToken:
-          'mockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockTokenmockToken',
-      },
-    },
-  } as Context
- 
-  const next: Next = (async () => Promise.resolve()) as Next
- 
-  await signUp(signUpContext, next)
- 
-  const user: User = (await UserModel.findOne({ username: username }).lean()) as User
- 
-  const jwt: Jwt = signUpContext.body.jwt
- 
-  return { user, jwt, next }
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/test/deleteTestUser.ts.html b/src/api/coverage/lcov-report/src/test/deleteTestUser.ts.html deleted file mode 100644 index 608b825..0000000 --- a/src/api/coverage/lcov-report/src/test/deleteTestUser.ts.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - Code coverage report for src/test/deleteTestUser.ts - - - - - - - - -
-
-

All files / src/test deleteTestUser.ts

-
- -
- 100% - Statements - 6/6 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 6/6 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15  -  -16x -16x -16x -  -  -  -  -  -16x -16x -16x -  - 
import { ObjectId } from 'mongodb'
- 
-import { CaptchaModel } from '../shared/captcha/Captcha'
-import { CaptchaFor } from '../shared/captcha/CaptchaFor'
-import { UserModel } from '../shared/user/User'
- 
-interface DeleteTestUser {
-  (userId: ObjectId): Promise<void>
-}
- 
-export const deleteTestUser: DeleteTestUser = async (userId) => {
-  await CaptchaModel.deleteOne({ userId, captchaFor: CaptchaFor.CAPTCHA_FOR_VERIFY_EMAIL })
-  await UserModel.deleteOne({ _id: userId })
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/test/index.html b/src/api/coverage/lcov-report/src/test/index.html deleted file mode 100644 index 0dbea72..0000000 --- a/src/api/coverage/lcov-report/src/test/index.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - Code coverage report for src/test - - - - - - - - -
-
-

All files src/test

-
- -
- 100% - Statements - 30/30 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 5/5 -
- - -
- 100% - Lines - 28/28 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
createTestUser.ts -
-
100%21/21100%0/0100%3/3100%19/19
deleteTestUser.ts -
-
100%6/6100%0/0100%1/1100%6/6
mockConnect.ts -
-
100%3/3100%0/0100%1/1100%3/3
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/test/mockConnect.ts.html b/src/api/coverage/lcov-report/src/test/mockConnect.ts.html deleted file mode 100644 index 7cd5cc3..0000000 --- a/src/api/coverage/lcov-report/src/test/mockConnect.ts.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - Code coverage report for src/test/mockConnect.ts - - - - - - - - -
-
-

All files / src/test mockConnect.ts

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -1118x -  -18x -34x -  -  -  -  -  -  - 
import * as mongoose from 'mongoose'
- 
-export const mockConnect = async (): Promise<void> => {
-  await mongoose.connect(process.env.MONGO_URL as string, {
-    useNewUrlParser: true,
-    useUnifiedTopology: true,
-    bufferCommands: false,
-    bufferMaxEntries: 0,
-  })
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/test/sleep.ts.html b/src/api/coverage/lcov-report/src/test/sleep.ts.html deleted file mode 100644 index b472ac8..0000000 --- a/src/api/coverage/lcov-report/src/test/sleep.ts.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - Code coverage report for src/test/sleep.ts - - - - - - - - -
-
-

All files / src/test sleep.ts

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 2/2 -
- - -
- 100% - Lines - 2/2 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -41x -2x -  - 
export const sleep = async (ms: number): Promise<void> => {
-  return new Promise((resolve) => setTimeout(resolve, ms))
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/changePassword/changePassword.ts.html b/src/api/coverage/lcov-report/src/user/changePassword/changePassword.ts.html deleted file mode 100644 index 58bed80..0000000 --- a/src/api/coverage/lcov-report/src/user/changePassword/changePassword.ts.html +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - Code coverage report for src/user/changePassword/changePassword.ts - - - - - - - - - -
-
-

All files / src/user/changePassword changePassword.ts

-
- -
- 100% - Statements - 22/22 -
- - -
- 100% - Branches - 3/3 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 22/22 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -381x -1x -1x -  -  -1x -  -1x -  -1x -1x -1x -1x -  -1x -2x -  -  -2x -2x -  -2x -  -2x -  -2x -  -1x -1x -  -1x -  -1x -1x -  -1x -  - 
import { hash } from 'bcryptjs'
-import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { firstError } from '../../helpers/firstError'
-import { UpdateRes } from '../../shared/mongo/UpdateRes'
-import { ChangePasswordArgs } from '../../shared/user/ChangePasswordArgs'
-import { User } from '../../shared/user/User'
-import { authenticate } from '../helpers/authenticate'
-import { matchPassword } from '../helpers/matchPassword'
-import { rateLimit } from '../helpers/rateLimit'
-import { UserModel } from '../user.model'
- 
-export const changePassword = async (ctx: Context, next: Next): Promise<void> => {
-  const changePasswordArgs = plainToClass(ChangePasswordArgs, ctx.request.body, {
-    excludeExtraneousValues: true,
-  })
-  await validateOrReject(changePasswordArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { password, newPassword } = changePasswordArgs
- 
-  const user: User = await authenticate(ctx)
- 
-  await rateLimit(user, 5)
- 
-  await matchPassword(password, user.hashedPassword)
- 
-  const hashedPassword = await hash(newPassword, 12)
-  const updatePassword: UpdateRes = await UserModel.updateOne({ _id: user._id }, { password: hashedPassword }).exec()
- 
-  const status = updatePassword && updatePassword.nModified && updatePassword.nModified >= 1
- 
-  ctx.status = 200
-  ctx.body = { status }
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/changePassword/index.html b/src/api/coverage/lcov-report/src/user/changePassword/index.html deleted file mode 100644 index 1b3a089..0000000 --- a/src/api/coverage/lcov-report/src/user/changePassword/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/user/changePassword - - - - - - - - - -
-
-

All files src/user/changePassword

-
- -
- 100% - Statements - 22/22 -
- - -
- 100% - Branches - 3/3 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 22/22 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
changePassword.ts -
-
100%22/22100%3/3100%1/1100%22/22
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/forgotPassword/forgotPassword.ts.html b/src/api/coverage/lcov-report/src/user/forgotPassword/forgotPassword.ts.html deleted file mode 100644 index 25410d7..0000000 --- a/src/api/coverage/lcov-report/src/user/forgotPassword/forgotPassword.ts.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Code coverage report for src/user/forgotPassword/forgotPassword.ts - - - - - - - - - -
-
-

All files / src/user/forgotPassword forgotPassword.ts

-
- -
- 100% - Statements - 26/26 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 25/25 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -401x -1x -  -  -1x -1x -  -1x -1x -  -1x -1x -1x -1x -  -1x -3x -3x -3x -  -3x -  -3x -3x -2x -  -3x -  -2x -  -2x -  -2x -  -2x -2x -  -2x -  - 
import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { createCaptcha } from '../../captcha/helpers/createCaptcha'
-import { firstError } from '../../helpers/firstError'
-import { Captcha } from '../../shared/captcha/Captcha'
-import { CaptchaFor } from '../../shared/captcha/CaptchaFor'
-import { ForgotPasswordArgs } from '../../shared/user/ForgotPasswordArgs'
-import { User } from '../../shared/user/User'
-import { rateLimit } from '../helpers/rateLimit'
-import { sendEmailForgotPassword } from '../helpers/sendEmailForgotPassword'
-import { verifyRecaptchaToken } from '../helpers/verifyRecaptchaToken'
-import { UserModel } from '../user.model'
- 
-export const forgotPassword = async (ctx: Context, next: Next): Promise<void> => {
-  const forgotPasswordArgs = plainToClass(ForgotPasswordArgs, ctx.request.body, { excludeExtraneousValues: true })
-  await validateOrReject(forgotPasswordArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { usernameOrEmail, recaptchaToken } = forgotPasswordArgs
- 
-  await verifyRecaptchaToken(recaptchaToken)
- 
-  let user: User | null = await UserModel.findOne({ email: usernameOrEmail }).lean()
-  if (!user) {
-    user = await UserModel.findOne({ username: usernameOrEmail }).lean()
-  }
-  if (!user) throw new Error('Wrong username or password')
- 
-  await rateLimit(user, 5)
- 
-  const captcha: Captcha = await createCaptcha(user._id, CaptchaFor.CAPTCHA_FOR_RESET_PASSWORD)
- 
-  await sendEmailForgotPassword(user.email, captcha.index, captcha.token)
- 
-  ctx.status = 200
-  ctx.body = { status: true }
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/forgotPassword/index.html b/src/api/coverage/lcov-report/src/user/forgotPassword/index.html deleted file mode 100644 index 7153bb7..0000000 --- a/src/api/coverage/lcov-report/src/user/forgotPassword/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/user/forgotPassword - - - - - - - - - -
-
-

All files src/user/forgotPassword

-
- -
- 100% - Statements - 26/26 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 25/25 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
forgotPassword.ts -
-
100%26/26100%4/4100%1/1100%25/25
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/getPublicUser/getPublicUser.ts.html b/src/api/coverage/lcov-report/src/user/getPublicUser/getPublicUser.ts.html deleted file mode 100644 index cd11175..0000000 --- a/src/api/coverage/lcov-report/src/user/getPublicUser/getPublicUser.ts.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - Code coverage report for src/user/getPublicUser/getPublicUser.ts - - - - - - - - - -
-
-

All files / src/user/getPublicUser getPublicUser.ts

-
- -
- 100% - Statements - 16/16 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 15/15 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -284x -4x -  -  -4x -4x -  -4x -  -4x -  -4x -2x -2x -2x -  -2x -  -  -  -2x -  -1x -1x -  -1x -  - 
import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { firstError } from '../../helpers/firstError'
-import { GetPublicUserArgs } from '../../shared/user/GetPublicUserArgs'
-import { PublicUser } from '../../shared/user/PublicUser'
-import { UserModel } from '../user.model'
- 
-export const PUBLIC_USER_MONGO_SELECTOR = '_id username emailVerified userRole createdAt'
- 
-export const getPublicUser = async (ctx: Context, next: Next): Promise<void> => {
-  const getPublicUserArgs = plainToClass(GetPublicUserArgs, ctx.request.body, { excludeExtraneousValues: true })
-  await validateOrReject(getPublicUserArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { userId } = getPublicUserArgs
- 
-  const publicUser: PublicUser = (await UserModel.findOne(
-    { _id: userId },
-    PUBLIC_USER_MONGO_SELECTOR,
-  ).lean()) as PublicUser
-  if (!publicUser) throw new Error('User not found')
- 
-  ctx.status = 200
-  ctx.body = { publicUser }
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/getPublicUser/index.html b/src/api/coverage/lcov-report/src/user/getPublicUser/index.html deleted file mode 100644 index d501747..0000000 --- a/src/api/coverage/lcov-report/src/user/getPublicUser/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/user/getPublicUser - - - - - - - - - -
-
-

All files src/user/getPublicUser

-
- -
- 100% - Statements - 16/16 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 15/15 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
getPublicUser.ts -
-
100%16/16100%2/2100%1/1100%15/15
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/helpers/authenticate.ts.html b/src/api/coverage/lcov-report/src/user/helpers/authenticate.ts.html deleted file mode 100644 index f4a4d4e..0000000 --- a/src/api/coverage/lcov-report/src/user/helpers/authenticate.ts.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - Code coverage report for src/user/helpers/authenticate.ts - - - - - - - - - -
-
-

All files / src/user/helpers authenticate.ts

-
- -
- 100% - Statements - 12/12 -
- - -
- 100% - Branches - 6/6 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 10/10 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26  -  -  -  -  -7x -7x -  -  -  -  -  -7x -15x -15x -  -14x -  -14x -  -13x -13x -  -12x -  - 
import { Context } from 'koa'
- 
-import { Jwt } from '../../shared/user/Jwt'
-import { JwtPayload } from '../../shared/user/JwtPayload'
-import { User } from '../../shared/user/User'
-import { UserModel } from '../user.model'
-import { verifySignedJwt } from './verifySignedJwt'
- 
-interface Authenticate {
-  (ctx: Context): Promise<User>
-}
- 
-export const authenticate: Authenticate = async (ctx) => {
-  const bearerToken = ctx.request.headers ? ctx.request.headers.authorization : undefined
-  if (!bearerToken) throw new Error('No bearer token present in request')
- 
-  const jwt: Jwt = bearerToken.replace('Bearer ', '')
- 
-  const jwtPayload: JwtPayload = verifySignedJwt(jwt)
- 
-  const user: User = (await UserModel.findOne({ _id: jwtPayload._id }).lean()) as User
-  if (!user) throw new Error('User not found')
- 
-  return user
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/helpers/getSignedJwt.ts.html b/src/api/coverage/lcov-report/src/user/helpers/getSignedJwt.ts.html deleted file mode 100644 index 5030c9a..0000000 --- a/src/api/coverage/lcov-report/src/user/helpers/getSignedJwt.ts.html +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - Code coverage report for src/user/helpers/getSignedJwt.ts - - - - - - - - - -
-
-

All files / src/user/helpers getSignedJwt.ts

-
- -
- 100% - Statements - 8/8 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 8/8 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -3619x -19x -  -  -  -  -  -  -  -  -  -19x -21x -  -  -  -21x -  -  -  -  -  -  -21x -  -  -  -  -  -  -  -21x -  -21x -  - 
import * as dayjs from 'dayjs'
-import * as jsonwebtoken from 'jsonwebtoken'
-import { Secret, SignOptions } from 'jsonwebtoken'
-import { UserRole } from '../../shared/user/UserRole'
-import { Jwt } from '../../shared/user/Jwt'
-import { JwtPayload } from '../../shared/user/JwtPayload'
- 
-interface GetSignedJwt {
-  (_id: string, username: string, userRole?: UserRole): Jwt
-}
- 
-export const getSignedJwt: GetSignedJwt = (_id, username, userRole) => {
-  const expiresAt: Date = dayjs()
-    .add(30, 'day')
-    .toDate()
- 
-  const payload: JwtPayload = {
-    _id,
-    username,
-    userRole,
-    expiresAt,
-  }
- 
-  const signOptions: SignOptions = {
-    issuer: 'Entire Stack',
-    subject: username + '',
-    audience: 'https://entirestack.com',
-    expiresIn: '30d',
-    algorithm: 'RS256',
-  }
- 
-  const jwt: Jwt = jsonwebtoken.sign(payload, process.env.JWT_PRIVATE_KEY as Secret, signOptions)
- 
-  return jwt
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/helpers/index.html b/src/api/coverage/lcov-report/src/user/helpers/index.html deleted file mode 100644 index 6ef41a0..0000000 --- a/src/api/coverage/lcov-report/src/user/helpers/index.html +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - Code coverage report for src/user/helpers - - - - - - - - - -
-
-

All files src/user/helpers

-
- -
- 100% - Statements - 71/71 -
- - -
- 100% - Branches - 40/40 -
- - -
- 100% - Functions - 9/9 -
- - -
- 100% - Lines - 62/62 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
authenticate.ts -
-
100%12/12100%6/6100%1/1100%10/10
getSignedJwt.ts -
-
100%8/8100%0/0100%1/1100%8/8
matchPassword.ts -
-
100%5/5100%2/2100%1/1100%4/4
rateLimit.ts -
-
100%11/11100%13/13100%1/1100%10/10
sendEmailForgotPassword.ts -
-
100%5/5100%0/0100%1/1100%5/5
sendEmailVerifyEmail.ts -
-
100%5/5100%0/0100%1/1100%5/5
verifyCaptcha.ts -
-
100%11/11100%8/8100%1/1100%8/8
verifyRecaptchaToken.ts -
-
100%8/8100%9/9100%1/1100%6/6
verifySignedJwt.ts -
-
100%6/6100%2/2100%1/1100%6/6
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/helpers/matchPassword.ts.html b/src/api/coverage/lcov-report/src/user/helpers/matchPassword.ts.html deleted file mode 100644 index 72c72a7..0000000 --- a/src/api/coverage/lcov-report/src/user/helpers/matchPassword.ts.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Code coverage report for src/user/helpers/matchPassword.ts - - - - - - - - - -
-
-

All files / src/user/helpers matchPassword.ts

-
- -
- 100% - Statements - 5/5 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 4/4 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -113x -  -  -  -  -  -3x -7x -7x -  - 
import { compare } from 'bcryptjs'
- 
-interface MatchPassword {
-  (proposedPassword: string, hashedPassword: string): Promise<void>
-}
- 
-export const matchPassword: MatchPassword = async (proposedPassword, hashedPassword) => {
-  const isMatch: boolean = await compare(proposedPassword, hashedPassword)
-  if (!isMatch) throw new Error('Wrong username or password')
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/helpers/rateLimit.ts.html b/src/api/coverage/lcov-report/src/user/helpers/rateLimit.ts.html deleted file mode 100644 index b3540ae..0000000 --- a/src/api/coverage/lcov-report/src/user/helpers/rateLimit.ts.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - Code coverage report for src/user/helpers/rateLimit.ts - - - - - - - - - -
-
-

All files / src/user/helpers rateLimit.ts

-
- -
- 100% - Statements - 11/11 -
- - -
- 100% - Branches - 13/13 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 10/10 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -309x -  -9x -  -  -9x -  -  -  -  -  -9x -20x -  -4x -1x -  -3x -  -  -  -  -  -  -  -  -3x -1x -  - 
import * as dayjs from 'dayjs'
- 
-import { TEST } from '../../constants'
-import { UpdateRes } from '../../shared/mongo/UpdateRes'
-import { User } from '../../shared/user/User'
-import { UserModel } from '../user.model'
- 
-interface RateLimit {
-  (user: User, waitTime?: number, actionName?: 'latestCommonAction' | 'latestLoginAttempt'): Promise<void>
-}
- 
-export const rateLimit: RateLimit = async (user, waitTime = 1, actionName = 'latestCommonAction') => {
-  if (process.env.NODE_ENV === TEST) return
- 
-  if (user[actionName] && dayjs().diff(dayjs(user[actionName]).add(waitTime, 'second')) <= 0)
-    throw new Error(`Querying too fast. Please wait ${waitTime}s and retry.`)
- 
-  const updateActionDate: UpdateRes = await UserModel.updateOne(
-    { _id: user._id },
-    {
-      $set: {
-        [actionName]: dayjs().toDate(),
-      },
-    },
-  ).exec()
- 
-  if (!(updateActionDate && updateActionDate.nModified && updateActionDate.nModified >= 1))
-    throw new Error('Rate limit action date not updated')
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/helpers/sendEmailForgotPassword.ts.html b/src/api/coverage/lcov-report/src/user/helpers/sendEmailForgotPassword.ts.html deleted file mode 100644 index c5a18fe..0000000 --- a/src/api/coverage/lcov-report/src/user/helpers/sendEmailForgotPassword.ts.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - Code coverage report for src/user/helpers/sendEmailForgotPassword.ts - - - - - - - - - -
-
-

All files / src/user/helpers sendEmailForgotPassword.ts

-
- -
- 100% - Statements - 5/5 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 5/5 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21  -2x -  -  -  -  -  -2x -1x -  -1x -  -  -  -  -  -  -  -1x -  - 
import { MailDataRequired } from '@sendgrid/helpers/classes/mail'
-import * as sendgrid from '@sendgrid/mail'
- 
-interface SendEmailForgotPassword {
-  (email: string, captchaIndex: number, token: string): Promise<void>
-}
- 
-export const sendEmailForgotPassword: SendEmailForgotPassword = async (email, captchaIndex, token) => {
-  sendgrid.setApiKey(process.env.SENDGRID_API_KEY as string)
- 
-  const message: MailDataRequired = {
-    to: email,
-    from: { name: 'Entire Stack', email: process.env.FROM_EMAIL as string },
-    subject: 'Password reset',
-    text: `Please enter the following captcha https://entirestack.com/captchas/${captchaIndex}.png on https://entirestack.com/reset-password?key=${token}`,
-    html: `Please enter the following captcha <br /><img alt="captcha" src="https://entirestack.com/captchas/${captchaIndex}.png" /> <br />on <a href="https://entirestack.com/reset-password?key=${token}">https://entirestack.com/reset-password?key=${token}</a>`,
-  }
- 
-  await sendgrid.send(message)
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/helpers/sendEmailVerifyEmail.ts.html b/src/api/coverage/lcov-report/src/user/helpers/sendEmailVerifyEmail.ts.html deleted file mode 100644 index aa8eab9..0000000 --- a/src/api/coverage/lcov-report/src/user/helpers/sendEmailVerifyEmail.ts.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - Code coverage report for src/user/helpers/sendEmailVerifyEmail.ts - - - - - - - - - -
-
-

All files / src/user/helpers sendEmailVerifyEmail.ts

-
- -
- 100% - Statements - 5/5 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 5/5 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21  -18x -  -  -  -  -  -18x -1x -  -1x -  -  -  -  -  -  -  -1x -  - 
import { MailDataRequired } from '@sendgrid/helpers/classes/mail'
-import * as sendgrid from '@sendgrid/mail'
- 
-interface SendEmailVerifyEmail {
-  (email: string, captchaIndex: number): Promise<void>
-}
- 
-export const sendEmailVerifyEmail: SendEmailVerifyEmail = async (email, captchaIndex) => {
-  sendgrid.setApiKey(process.env.SENDGRID_API_KEY as string)
- 
-  const message: MailDataRequired = {
-    to: email,
-    from: { name: 'Entire Stack', email: process.env.FROM_EMAIL as string },
-    subject: 'Please verify your email',
-    text: `Please enter the following captcha https://entirestack.com/captchas/${captchaIndex}.png on https://entirestack.com/verify-email`,
-    html: `Please enter the following captcha <br /><img alt="captcha" src="https://entirestack.com/captchas/${captchaIndex}.png" /> <br />on <a href="https://entirestack.com/verify-email">https://entirestack.com/verify-email</a>`,
-  }
- 
-  await sendgrid.send(message)
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/helpers/verifyCaptcha.ts.html b/src/api/coverage/lcov-report/src/user/helpers/verifyCaptcha.ts.html deleted file mode 100644 index 58a74af..0000000 --- a/src/api/coverage/lcov-report/src/user/helpers/verifyCaptcha.ts.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - Code coverage report for src/user/helpers/verifyCaptcha.ts - - - - - - - - - -
-
-

All files / src/user/helpers verifyCaptcha.ts

-
- -
- 100% - Statements - 11/11 -
- - -
- 100% - Branches - 8/8 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 8/8 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23  -  -  -3x -  -  -  -  -  -3x -8x -  -8x -  -7x -  -6x -  -3x -  -3x -  - 
import { ObjectId } from 'mongodb'
-import { CaptchaFor } from '../../shared/captcha/CaptchaFor'
-import { Captcha } from '../../shared/captcha/Captcha'
-import { CaptchaModel } from '../../captcha/captcha.model'
- 
-interface VerifyCaptcha {
-  (userId: ObjectId, proposedSolution: string, captchaFor: CaptchaFor): Promise<void>
-}
- 
-export const verifyCaptcha: VerifyCaptcha = async (userId, proposedSolution, captchaFor) => {
-  const captcha: Captcha = (await CaptchaModel.findOne({ userId, captchaFor }).lean()) as Captcha
- 
-  if (!captcha) throw new Error('Captcha expired - Please send another one')
- 
-  if (captcha.attempts && captcha.attempts >= 3) throw new Error('Maximum attemps reached - Account blocked for 1h')
- 
-  if (captcha.solution === proposedSolution) return
- 
-  await CaptchaModel.updateOne({ _id: captcha._id }, { $inc: { attempts: 1 } }).exec()
- 
-  throw new Error('Wrong captcha entered')
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/helpers/verifyRecaptchaToken.ts.html b/src/api/coverage/lcov-report/src/user/helpers/verifyRecaptchaToken.ts.html deleted file mode 100644 index ed4e0a1..0000000 --- a/src/api/coverage/lcov-report/src/user/helpers/verifyRecaptchaToken.ts.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - Code coverage report for src/user/helpers/verifyRecaptchaToken.ts - - - - - - - - - -
-
-

All files / src/user/helpers verifyRecaptchaToken.ts

-
- -
- 100% - Statements - 8/8 -
- - -
- 100% - Branches - 9/9 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 6/6 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -2318x -18x -  -  -  -  -  -18x -23x -  -2x -  -  -  -  -  -  -  -  -  -2x -  - 
import axios from 'axios'
-import { DEVELOPMENT, TEST } from '../../constants'
- 
-interface VerifyRecaptchaToken {
-  (recaptchaToken: string): Promise<void>
-}
- 
-export const verifyRecaptchaToken: VerifyRecaptchaToken = async (recaptchaToken) => {
-  if (process.env.NODE_ENV === DEVELOPMENT || process.env.NODE_ENV === TEST) return
- 
-  const response = await axios({
-    method: 'post',
-    url: 'https://www.google.com/recaptcha/api/siteverify',
-    params: {
-      secret: process.env.RECAPTCHA_SECRET_KEY,
-      response: recaptchaToken,
-      // TODO: Add remoteip
-    },
-  })
- 
-  if (!(response && response.data && response.data.success)) throw new Error('Wrong re-captcha token')
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/helpers/verifySignedJwt.ts.html b/src/api/coverage/lcov-report/src/user/helpers/verifySignedJwt.ts.html deleted file mode 100644 index ca0dda3..0000000 --- a/src/api/coverage/lcov-report/src/user/helpers/verifySignedJwt.ts.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - Code coverage report for src/user/helpers/verifySignedJwt.ts - - - - - - - - - -
-
-

All files / src/user/helpers verifySignedJwt.ts

-
- -
- 100% - Statements - 6/6 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 6/6 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -308x -  -  -  -  -  -  -  -  -  -8x -16x -  -16x -  -  -  -  -  -  -  -16x -  -  -  -  -  -14x -  - 
import * as jsonwebtoken from 'jsonwebtoken'
-import { Secret } from 'jsonwebtoken'
-import { JwtDecoded } from '../../shared/user/JwtDecoded'
-import { JwtPayload } from '../../shared/user/JwtPayload'
-import { Jwt } from '../../shared/user/Jwt'
- 
-interface VerifySignedJwt {
-  (jwt: Jwt): JwtPayload
-}
- 
-export const verifySignedJwt: VerifySignedJwt = (jwt) => {
-  const jwtDecoded: JwtDecoded = jsonwebtoken.decode(jwt) as JwtDecoded
- 
-  const verifyOptions = {
-    issuer: 'Entire Stack',
-    subject: jwtDecoded ? jwtDecoded.username : undefined,
-    audience: 'https://entirestack.com',
-    expiresIn: '30d',
-    algorithm: ['RS256'],
-  }
- 
-  const jwtPayload: JwtPayload = jsonwebtoken.verify(
-    jwt,
-    process.env.JWT_PUBLIC_KEY as Secret,
-    verifyOptions,
-  ) as JwtPayload
- 
-  return jwtPayload
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/index.html b/src/api/coverage/lcov-report/src/user/index.html deleted file mode 100644 index d99df0b..0000000 --- a/src/api/coverage/lcov-report/src/user/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/user - - - - - - - - - -
-
-

All files src/user

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
user.model.ts -
-
100%3/3100%0/0100%0/0100%3/3
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/login/index.html b/src/api/coverage/lcov-report/src/user/login/index.html deleted file mode 100644 index d686387..0000000 --- a/src/api/coverage/lcov-report/src/user/login/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/user/login - - - - - - - - - -
-
-

All files src/user/login

-
- -
- 100% - Statements - 26/26 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 25/25 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
login.ts -
-
100%26/26100%4/4100%1/1100%25/25
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/login/login.ts.html b/src/api/coverage/lcov-report/src/user/login/login.ts.html deleted file mode 100644 index e20ecdc..0000000 --- a/src/api/coverage/lcov-report/src/user/login/login.ts.html +++ /dev/null @@ -1,200 +0,0 @@ - - - - - - Code coverage report for src/user/login/login.ts - - - - - - - - - -
-
-

All files / src/user/login login.ts

-
- -
- 100% - Statements - 26/26 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 25/25 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -411x -1x -  -  -1x -  -1x -  -1x -1x -1x -1x -1x -  -1x -4x -4x -4x -  -4x -  -4x -  -4x -4x -2x -  -4x -  -3x -  -3x -  -2x -  -2x -2x -  -2x -  - 
import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { firstError } from '../../helpers/firstError'
-import { Jwt } from '../../shared/user/Jwt'
-import { LoginArgs } from '../../shared/user/LoginArgs'
-import { User } from '../../shared/user/User'
-import { getSignedJwt } from '../helpers/getSignedJwt'
-import { matchPassword } from '../helpers/matchPassword'
-import { rateLimit } from '../helpers/rateLimit'
-import { verifyRecaptchaToken } from '../helpers/verifyRecaptchaToken'
-import { UserModel } from '../user.model'
- 
-export const login = async (ctx: Context, next: Next): Promise<void> => {
-  const loginArgs = plainToClass(LoginArgs, ctx.request.body, { excludeExtraneousValues: true })
-  await validateOrReject(loginArgs, { forbidUnknownValues: true }).catch(firstError)
-  let { usernameOrEmail, password, recaptchaToken } = loginArgs
- 
-  usernameOrEmail = usernameOrEmail.toLowerCase()
- 
-  await verifyRecaptchaToken(recaptchaToken)
- 
-  let user: User | null = await UserModel.findOne({ email: usernameOrEmail }).lean()
-  if (!user) {
-    user = await UserModel.findOne({ username: usernameOrEmail }).lean()
-  }
-  if (!user) throw new Error('Wrong username or password')
- 
-  await rateLimit(user, 10, 'latestLoginAttempt')
- 
-  await matchPassword(password, user.hashedPassword)
- 
-  const jwt: Jwt = getSignedJwt(user._id.toHexString(), user.username)
- 
-  ctx.status = 200
-  ctx.body = { jwt }
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/resendEmailVerification/index.html b/src/api/coverage/lcov-report/src/user/resendEmailVerification/index.html deleted file mode 100644 index 30208cc..0000000 --- a/src/api/coverage/lcov-report/src/user/resendEmailVerification/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/user/resendEmailVerification - - - - - - - - - -
-
-

All files src/user/resendEmailVerification

-
- -
- 100% - Statements - 16/16 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 15/15 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
resendEmailVerification.ts -
-
100%16/16100%2/2100%1/1100%15/15
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/resendEmailVerification/resendEmailVerification.ts.html b/src/api/coverage/lcov-report/src/user/resendEmailVerification/resendEmailVerification.ts.html deleted file mode 100644 index 0ce5d62..0000000 --- a/src/api/coverage/lcov-report/src/user/resendEmailVerification/resendEmailVerification.ts.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - Code coverage report for src/user/resendEmailVerification/resendEmailVerification.ts - - - - - - - - - -
-
-

All files / src/user/resendEmailVerification resendEmailVerification.ts

-
- -
- 100% - Statements - 16/16 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 15/15 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30  -  -1x -1x -1x -1x -1x -1x -  -  -1x -2x -  -2x -  -2x -  -  -  -  -2x -  -2x -  -2x -2x -  -2x -  - 
import { Context, Next } from 'koa'
-import { User } from '../../shared/user/User'
-import { rateLimit } from '../helpers/rateLimit'
-import { authenticate } from '../helpers/authenticate'
-import { CaptchaFor } from '../../shared/captcha/CaptchaFor'
-import { CaptchaModel } from '../../captcha/captcha.model'
-import { sendEmailVerifyEmail } from '../helpers/sendEmailVerifyEmail'
-import { createCaptcha } from '../../captcha/helpers/createCaptcha'
-import { Captcha } from '../../shared/captcha/Captcha'
- 
-export const resendEmailVerification = async (ctx: Context, next: Next): Promise<void> => {
-  const user: User = await authenticate(ctx)
- 
-  await rateLimit(user, 30)
- 
-  let captcha: Captcha | null = await CaptchaModel.findOne({
-    userId: user._id,
-    captchaFor: CaptchaFor.CAPTCHA_FOR_VERIFY_EMAIL,
-  }).lean()
- 
-  if (!captcha) captcha = await createCaptcha(user._id, CaptchaFor.CAPTCHA_FOR_VERIFY_EMAIL)
- 
-  await sendEmailVerifyEmail(user.email, captcha.index)
- 
-  ctx.status = 200
-  ctx.body = { status: true }
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/resetPassword/index.html b/src/api/coverage/lcov-report/src/user/resetPassword/index.html deleted file mode 100644 index 795c20e..0000000 --- a/src/api/coverage/lcov-report/src/user/resetPassword/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/user/resetPassword - - - - - - - - - -
-
-

All files src/user/resetPassword

-
- -
- 100% - Statements - 28/28 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 26/26 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
resetPassword.ts -
-
100%28/28100%4/4100%1/1100%26/26
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/resetPassword/resetPassword.ts.html b/src/api/coverage/lcov-report/src/user/resetPassword/resetPassword.ts.html deleted file mode 100644 index 0273bb3..0000000 --- a/src/api/coverage/lcov-report/src/user/resetPassword/resetPassword.ts.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - Code coverage report for src/user/resetPassword/resetPassword.ts - - - - - - - - - -
-
-

All files / src/user/resetPassword resetPassword.ts

-
- -
- 100% - Statements - 28/28 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 26/26 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -451x -1x -1x -  -  -1x -1x -  -1x -1x -  -1x -1x -1x -  -1x -3x -3x -3x -  -3x -  -  -  -3x -  -2x -2x -  -1x -  -1x -  -1x -  -1x -  -1x -  -1x -1x -  -1x -  - 
import { hash } from 'bcryptjs'
-import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { CaptchaModel } from '../../captcha/captcha.model'
-import { firstError } from '../../helpers/firstError'
-import { Captcha } from '../../shared/captcha/Captcha'
-import { CaptchaFor } from '../../shared/captcha/CaptchaFor'
-import { ResetPasswordArgs } from '../../shared/user/ResetPasswordArgs'
-import { User } from '../../shared/user/User'
-import { rateLimit } from '../helpers/rateLimit'
-import { verifyCaptcha } from '../helpers/verifyCaptcha'
-import { UserModel } from '../user.model'
- 
-export const resetPassword = async (ctx: Context, next: Next): Promise<void> => {
-  const resetPasswordArgs = plainToClass(ResetPasswordArgs, ctx.request.body, { excludeExtraneousValues: true })
-  await validateOrReject(resetPasswordArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { solution, token, newPassword } = resetPasswordArgs
- 
-  const captcha: Captcha = (await CaptchaModel.findOne({
-    token,
-    captchaFor: CaptchaFor.CAPTCHA_FOR_RESET_PASSWORD,
-  }).lean()) as Captcha
-  if (!captcha) throw new Error('Wrong token key')
- 
-  const user: User = (await UserModel.findOne({ _id: captcha.userId }).lean()) as User
-  if (!user) throw new Error('User not found')
- 
-  await rateLimit(user, 1)
- 
-  await verifyCaptcha(user._id, solution, CaptchaFor.CAPTCHA_FOR_RESET_PASSWORD)
- 
-  const hashedPassword: string = await hash(newPassword, 12)
- 
-  await UserModel.updateOne({ _id: user._id }, { password: hashedPassword }).exec()
- 
-  await CaptchaModel.deleteOne({ _id: captcha._id }).exec()
- 
-  ctx.status = 200
-  ctx.body = { status: true }
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/signUp/index.html b/src/api/coverage/lcov-report/src/user/signUp/index.html deleted file mode 100644 index ff910a9..0000000 --- a/src/api/coverage/lcov-report/src/user/signUp/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/user/signUp - - - - - - - - - -
-
-

All files src/user/signUp

-
- -
- 100% - Statements - 32/32 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 30/30 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
signUp.ts -
-
100%32/32100%4/4100%1/1100%30/30
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/signUp/signUp.ts.html b/src/api/coverage/lcov-report/src/user/signUp/signUp.ts.html deleted file mode 100644 index 6018fc9..0000000 --- a/src/api/coverage/lcov-report/src/user/signUp/signUp.ts.html +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - Code coverage report for src/user/signUp/signUp.ts - - - - - - - - - -
-
-

All files / src/user/signUp signUp.ts

-
- -
- 100% - Statements - 32/32 -
- - -
- 100% - Branches - 4/4 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 30/30 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -4817x -17x -17x -  -  -17x -17x -  -17x -  -17x -  -17x -17x -17x -17x -  -17x -20x -20x -19x -  -19x -19x -  -19x -  -19x -19x -  -18x -18x -  -17x -17x -  -17x -  -17x -  -17x -  -17x -17x -  -17x -  - 
import { hash } from 'bcryptjs'
-import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { createCaptcha } from '../../captcha/helpers/createCaptcha'
-import { firstError } from '../../helpers/firstError'
-import { Captcha } from '../../shared/captcha/Captcha'
-import { CaptchaFor } from '../../shared/captcha/CaptchaFor'
-import { Jwt } from '../../shared/user/Jwt'
-import { SignUpArgs } from '../../shared/user/SignUpArgs'
-import { User } from '../../shared/user/User'
-import { getSignedJwt } from '../helpers/getSignedJwt'
-import { sendEmailVerifyEmail } from '../helpers/sendEmailVerifyEmail'
-import { verifyRecaptchaToken } from '../helpers/verifyRecaptchaToken'
-import { UserModel } from '../user.model'
- 
-export const signUp = async (ctx: Context, next: Next): Promise<void> => {
-  const signUpArgs = plainToClass(SignUpArgs, ctx.request.body, { excludeExtraneousValues: true })
-  await validateOrReject(signUpArgs, { forbidUnknownValues: true }).catch(firstError)
-  let { username, email, password, recaptchaToken } = signUpArgs
- 
-  username = username.toLowerCase()
-  email = email.toLowerCase()
- 
-  await verifyRecaptchaToken(recaptchaToken)
- 
-  const emailAlreadyTaken: User | null = await UserModel.findOne({ email }).lean()
-  if (emailAlreadyTaken) throw new Error('Email is already taken')
- 
-  const usernameAlreadyTaken: User | null = await UserModel.findOne({ username }).lean()
-  if (usernameAlreadyTaken) throw new Error('Username is already taken')
- 
-  const hashedPassword = await hash(password, 12)
-  const user: User = await new UserModel({ email, username, hashedPassword }).save()
- 
-  const jwt: Jwt = getSignedJwt(user._id.toHexString(), user.username)
- 
-  const captcha: Captcha = await createCaptcha(user._id, CaptchaFor.CAPTCHA_FOR_VERIFY_EMAIL)
- 
-  await sendEmailVerifyEmail(user.email, captcha.index)
- 
-  ctx.status = 200
-  ctx.body = { jwt }
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/user.model.ts.html b/src/api/coverage/lcov-report/src/user/user.model.ts.html deleted file mode 100644 index 32ebf5c..0000000 --- a/src/api/coverage/lcov-report/src/user/user.model.ts.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - Code coverage report for src/user/user.model.ts - - - - - - - - - -
-
-

All files / src/user user.model.ts

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -617x -  -17x -  -17x - 
import { getModelForClass } from '@typegoose/typegoose'
- 
-import { User } from '../shared/user/User'
- 
-export const UserModel = getModelForClass(User, { schemaOptions: { timestamps: true } })
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/verifyEmail/index.html b/src/api/coverage/lcov-report/src/user/verifyEmail/index.html deleted file mode 100644 index 3cf146e..0000000 --- a/src/api/coverage/lcov-report/src/user/verifyEmail/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/user/verifyEmail - - - - - - - - - -
-
-

All files src/user/verifyEmail

-
- -
- 100% - Statements - 23/23 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 23/23 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
verifyEmail.ts -
-
100%23/23100%2/2100%1/1100%23/23
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/user/verifyEmail/verifyEmail.ts.html b/src/api/coverage/lcov-report/src/user/verifyEmail/verifyEmail.ts.html deleted file mode 100644 index 95883aa..0000000 --- a/src/api/coverage/lcov-report/src/user/verifyEmail/verifyEmail.ts.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - Code coverage report for src/user/verifyEmail/verifyEmail.ts - - - - - - - - - -
-
-

All files / src/user/verifyEmail verifyEmail.ts

-
- -
- 100% - Statements - 23/23 -
- - -
- 100% - Branches - 2/2 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 23/23 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -421x -1x -  -  -1x -1x -1x -  -  -  -1x -1x -1x -1x -1x -  -1x -1x -1x -1x -  -1x -  -1x -  -1x -  -1x -  -1x -  -  -  -  -1x -  -1x -1x -  -1x -  - 
import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { Context, Next } from 'koa'
- 
-import { CaptchaModel } from '../../captcha/captcha.model'
-import { firstError } from '../../helpers/firstError'
-import { CaptchaFor } from '../../shared/captcha/CaptchaFor'
-import { DeleteRes } from '../../shared/mongo/DeleteRes'
-import { UpdateRes } from '../../shared/mongo/UpdateRes'
-import { User } from '../../shared/user/User'
-import { VerifyEmailArgs } from '../../shared/user/VerifyEmailArgs'
-import { authenticate } from '../helpers/authenticate'
-import { rateLimit } from '../helpers/rateLimit'
-import { verifyCaptcha } from '../helpers/verifyCaptcha'
-import { UserModel } from '../user.model'
- 
-export const verifyEmail = async (ctx: Context, next: Next): Promise<void> => {
-  const verifyEmailArgs = plainToClass(VerifyEmailArgs, ctx.request.body, { excludeExtraneousValues: true })
-  await validateOrReject(verifyEmailArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { solution } = verifyEmailArgs
- 
-  const user: User = await authenticate(ctx)
- 
-  await rateLimit(user, 1)
- 
-  await verifyCaptcha(user._id, solution, CaptchaFor.CAPTCHA_FOR_VERIFY_EMAIL)
- 
-  const updateUser: UpdateRes = await UserModel.updateOne({ _id: user._id }, { $set: { emailVerified: true } }).exec()
- 
-  const deleteCaptcha: DeleteRes = (await CaptchaModel.deleteOne({
-    userId: user._id,
-    captchaFor: CaptchaFor.CAPTCHA_FOR_VERIFY_EMAIL,
-  }).exec()) as DeleteRes
- 
-  const status = updateUser.ok >= 1 && deleteCaptcha.ok >= 1
- 
-  ctx.status = 200
-  ctx.body = { status }
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/vote/index.html b/src/api/coverage/lcov-report/src/vote/index.html deleted file mode 100644 index de2a357..0000000 --- a/src/api/coverage/lcov-report/src/vote/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/vote - - - - - - - - - -
-
-

All files src/vote

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
vote.model.ts -
-
100%3/3100%0/0100%0/0100%3/3
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/vote/sendVote/index.html b/src/api/coverage/lcov-report/src/vote/sendVote/index.html deleted file mode 100644 index a953af9..0000000 --- a/src/api/coverage/lcov-report/src/vote/sendVote/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Code coverage report for src/vote/sendVote - - - - - - - - - -
-
-

All files src/vote/sendVote

-
- -
- 97.62% - Statements - 41/42 -
- - -
- 87.1% - Branches - 27/31 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 37/37 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
sendVote.ts -
-
97.62%41/4287.1%27/31100%1/1100%37/37
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/vote/sendVote/sendVote.ts.html b/src/api/coverage/lcov-report/src/vote/sendVote/sendVote.ts.html deleted file mode 100644 index ce47f24..0000000 --- a/src/api/coverage/lcov-report/src/vote/sendVote/sendVote.ts.html +++ /dev/null @@ -1,317 +0,0 @@ - - - - - - Code coverage report for src/vote/sendVote/sendVote.ts - - - - - - - - - -
-
-

All files / src/vote/sendVote sendVote.ts

-
- -
- 97.62% - Statements - 41/42 -
- - -
- 87.1% - Branches - 27/31 -
- - -
- 100% - Functions - 1/1 -
- - -
- 100% - Lines - 37/37 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80  -  -1x -1x -1x -1x -  -  -1x -  -1x -1x -1x -1x -1x -1x -1x -  -1x -4x -4x -4x -  -4x -  -4x -  -  -4x -4x -  -  -3x -  -  -  -  -  -  -  -  -3x -3x -  -3x -3x -3x -3x -2x -1x -  -3x -  -  -  -  -  -  -  -3x -  -3x -  -3x -3x -  -  -  -  -  -  -  -  -  -3x -3x -  -3x -  - 
import { Context, Next } from 'koa'
- 
-import { plainToClass } from 'class-transformer'
-import { validateOrReject } from 'class-validator'
-import { CommentModel } from '../../comment/comment.model'
-import { NotificationModel } from '../../notification/notification.model'
-import { Comment } from '../../shared/comment/Comment'
-import { UpdateRes } from '../../shared/mongo/UpdateRes'
-import { NotificationType } from '../../shared/notification/NotificationType'
-import { User } from '../../shared/user/User'
-import { VoteDirection } from '../../shared/vote/VoteDirection'
-import { SendVoteArgs } from '../../shared/vote/VoteUpArgs'
-import { authenticate } from '../../user/helpers/authenticate'
-import { rateLimit } from '../../user/helpers/rateLimit'
-import { UserModel } from '../../user/user.model'
-import { VoteModel } from '../vote.model'
-import { firstError } from '../../helpers/firstError'
- 
-export const sendVote = async (ctx: Context, next: Next): Promise<void> => {
-  const sendVoteArgs = plainToClass(SendVoteArgs, ctx.request.body, { excludeExtraneousValues: true })
-  await validateOrReject(sendVoteArgs, { forbidUnknownValues: true }).catch(firstError)
-  const { commentId, direction } = sendVoteArgs
- 
-  const user: User = await authenticate(ctx)
- 
-  await rateLimit(user, 0.5)
- 
-  // Check if comment exists
-  const comment: Comment = (await CommentModel.findOne({ _id: commentId }).lean()) as Comment
-  if (!comment) throw new Error('Comment not found')
- 
-  // Check if vote exists and update it or create it
-  const updateOrCreateVote: UpdateRes = await VoteModel.updateOne(
-    { commentId: comment._id, userId: user._id },
-    {
-      $set: { direction },
-    },
-    { upsert: true, setDefaultsOnInsert: true },
-  ).exec()
- 
-  // Update comment vote counts
-  const isModified = updateOrCreateVote && updateOrCreateVote.nModified >= 1
-  const isInserted = updateOrCreateVote && updateOrCreateVote.upserted && updateOrCreateVote.upserted.length >= 1
- 
-  Eif (isModified || isInserted) {
-    let modifier = {}
-    Iif (isInserted && direction === VoteDirection.DOWN) modifier = { downCount: 1 }
-    else if (isInserted && direction === VoteDirection.UP) modifier = { upCount: 1 }
-    else if (isModified && direction === VoteDirection.DOWN) modifier = { downCount: 1, upCount: -1 }
-    else Eif (isModified && direction === VoteDirection.UP) modifier = { upCount: 1, downCount: -1 }
- 
-    await CommentModel.updateOne(
-      { _id: commentId },
-      {
-        $inc: modifier,
-      },
-    ).exec()
- 
-    // Create notification
-    const author: User = (await UserModel.findOne({ _id: comment.userId }).lean()) as User
- 
-    Eif (author) {
-      const notificationType =
-        direction === VoteDirection.DOWN ? NotificationType.COMMENT_DOWNVOTED : NotificationType.COMMENT_UPVOTED
-      await NotificationModel.updateOne(
-        { userId: author._id, targetId: comment._id, notificationType },
-        {
-          $inc: { count: 1 },
-        },
-        { upsert: true, setDefaultsOnInsert: true },
-      ).exec()
-    }
-  }
- 
-  ctx.status = 200
-  ctx.body = { status: true }
- 
-  await next()
-}
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov-report/src/vote/vote.model.ts.html b/src/api/coverage/lcov-report/src/vote/vote.model.ts.html deleted file mode 100644 index 2103bd0..0000000 --- a/src/api/coverage/lcov-report/src/vote/vote.model.ts.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - Code coverage report for src/vote/vote.model.ts - - - - - - - - - -
-
-

All files / src/vote vote.model.ts

-
- -
- 100% - Statements - 3/3 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 3/3 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
1 -2 -3 -4 -52x -2x -  -2x - 
import { getModelForClass } from '@typegoose/typegoose'
-import { Vote } from '../shared/vote/Vote'
- 
-export const VoteModel = getModelForClass(Vote, { schemaOptions: { timestamps: true } })
- 
- -
-
- - - - - - - - - \ No newline at end of file diff --git a/src/api/coverage/lcov.info b/src/api/coverage/lcov.info deleted file mode 100644 index dc0bf13..0000000 --- a/src/api/coverage/lcov.info +++ /dev/null @@ -1,1469 +0,0 @@ -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/constants.ts -FNF:0 -FNH:0 -DA:1,18 -DA:2,18 -DA:3,18 -LF:3 -LH:3 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/helpers/clone.ts -FN:3,(anonymous_0) -FNF:1 -FNH:1 -FNDA:4,(anonymous_0) -DA:3,1 -DA:4,4 -LF:2 -LH:2 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/helpers/dayjs.ts -FNF:0 -FNH:0 -DA:1,18 -DA:3,18 -LF:2 -LH:2 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/helpers/firstError.ts -FN:4,(anonymous_0) -FNF:1 -FNH:1 -FNDA:3,(anonymous_0) -DA:2,18 -DA:4,18 -DA:5,3 -DA:6,3 -LF:4 -LH:4 -BRDA:5,0,0,3 -BRDA:5,0,1,2 -BRDA:6,1,0,2 -BRDA:6,1,1,1 -BRF:4 -BRH:4 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/helpers/typegoose.ts -FNF:0 -FNH:0 -DA:1,18 -DA:3,18 -DA:4,18 -DA:5,18 -DA:6,18 -LF:5 -LH:5 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/captcha/helpers/captchaSolutions.ts -FNF:0 -FNH:0 -DA:3,19 -LF:1 -LH:1 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/captcha/helpers/createCaptcha.ts -FN:12,(anonymous_0) -FNF:1 -FNH:1 -FNDA:22,(anonymous_0) -DA:3,18 -DA:6,18 -DA:12,18 -DA:13,22 -DA:15,22 -DA:17,22 -DA:24,22 -LF:7 -LH:7 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/captcha/helpers/getRandomCaptchaPair.ts -FN:11,(anonymous_0) -FNF:1 -FNH:1 -FNDA:2,(anonymous_0) -DA:5,19 -DA:11,19 -DA:12,2 -DA:13,2 -DA:14,2 -DA:19,2 -LF:6 -LH:6 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/comment/addCommentView/addCommentView.ts -FN:11,(anonymous_0) -FNF:1 -FNH:1 -FNDA:2,(anonymous_0) -DA:1,1 -DA:2,1 -DA:5,1 -DA:6,1 -DA:7,1 -DA:8,1 -DA:11,1 -DA:12,2 -DA:13,2 -DA:14,2 -DA:16,2 -DA:21,2 -DA:22,2 -DA:24,1 -DA:25,1 -DA:27,1 -LF:16 -LH:16 -BRDA:21,0,0,2 -BRDA:21,0,1,2 -BRDA:21,0,2,1 -BRDA:22,1,0,1 -BRDA:22,1,1,1 -BRF:5 -BRH:5 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/comment/getComment/getComment.ts -FN:13,(anonymous_0) -FNF:1 -FNH:1 -FNDA:3,(anonymous_0) -DA:1,1 -DA:2,1 -DA:5,1 -DA:6,1 -DA:7,1 -DA:8,1 -DA:10,1 -DA:11,1 -DA:13,1 -DA:14,3 -DA:17,3 -DA:18,3 -DA:20,3 -DA:21,3 -DA:23,2 -DA:27,2 -DA:29,1 -DA:31,1 -DA:32,1 -DA:34,1 -LF:20 -LH:20 -BRDA:21,0,0,1 -BRDA:21,0,1,2 -BRDA:27,1,0,1 -BRDA:27,1,1,1 -BRF:4 -BRH:4 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/comment/getLatestComments/getLatestComments.ts -FN:12,(anonymous_0) -FN:29,(anonymous_1) -FNF:2 -FNH:2 -FNDA:2,(anonymous_0) -FNDA:2,(anonymous_1) -DA:1,1 -DA:2,1 -DA:5,1 -DA:6,1 -DA:7,1 -DA:9,1 -DA:10,1 -DA:12,1 -DA:13,2 -DA:16,2 -DA:17,2 -DA:19,2 -DA:20,2 -DA:21,2 -DA:27,2 -DA:29,2 -DA:30,2 -DA:31,2 -DA:33,2 -DA:35,2 -DA:36,2 -DA:38,2 -LF:22 -LH:22 -BRDA:20,0,0,1 -BRDA:20,0,1,1 -BRDA:27,1,0,1 -BRDA:27,1,1,1 -BRDA:27,2,0,2 -BRDA:27,2,1,2 -BRDA:31,3,0,1 -BRDA:31,3,1,1 -BRDA:31,4,0,2 -BRDA:31,4,1,2 -BRF:10 -BRH:10 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/comment/newComment/newComment.ts -FN:16,(anonymous_0) -FNF:1 -FNH:1 -FNDA:2,(anonymous_0) -DA:1,1 -DA:2,1 -DA:4,1 -DA:6,1 -DA:7,1 -DA:10,1 -DA:11,1 -DA:12,1 -DA:13,1 -DA:14,1 -DA:16,1 -DA:17,2 -DA:18,2 -DA:19,2 -DA:21,2 -DA:23,2 -DA:25,2 -DA:36,2 -DA:42,2 -DA:50,2 -DA:52,2 -DA:53,2 -DA:55,2 -LF:23 -LH:23 -BRDA:28,0,0,1 -BRDA:28,0,1,1 -BRF:2 -BRH:2 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/notification/getLatestNotifications/getLatestNotifications.ts -FN:7,(anonymous_0) -FNF:1 -FNH:1 -FNDA:1,(anonymous_0) -DA:3,1 -DA:5,1 -DA:7,1 -DA:8,1 -DA:10,1 -DA:17,1 -DA:18,1 -DA:20,1 -LF:8 -LH:8 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/quota/rateLimit/rateLimit.ts -FN:12,(anonymous_0) -FNF:1 -FNH:1 -FNDA:52,(anonymous_0) -DA:3,9 -DA:4,9 -DA:5,9 -DA:6,9 -DA:12,9 -DA:13,52 -DA:15,31 -DA:23,31 -DA:24,1 -LF:9 -LH:9 -BRDA:13,0,0,21 -BRDA:13,0,1,31 -BRDA:23,1,0,1 -BRDA:23,1,1,30 -BRDA:23,2,0,31 -BRDA:23,2,1,30 -BRDA:23,2,2,30 -BRF:7 -BRH:7 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/changePassword/changePassword.ts -FN:13,(anonymous_0) -FNF:1 -FNH:1 -FNDA:2,(anonymous_0) -DA:1,1 -DA:2,1 -DA:3,1 -DA:6,1 -DA:7,1 -DA:8,1 -DA:9,1 -DA:10,1 -DA:11,1 -DA:13,1 -DA:14,2 -DA:17,2 -DA:18,2 -DA:20,2 -DA:22,2 -DA:24,2 -DA:26,1 -DA:27,1 -DA:29,1 -DA:30,1 -DA:32,1 -LF:21 -LH:21 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/forgotPassword/forgotPassword.ts -FN:16,(anonymous_0) -FNF:1 -FNH:1 -FNDA:3,(anonymous_0) -DA:1,1 -DA:2,1 -DA:5,1 -DA:7,1 -DA:8,1 -DA:9,1 -DA:10,1 -DA:11,1 -DA:12,1 -DA:13,1 -DA:14,1 -DA:16,1 -DA:17,3 -DA:18,3 -DA:19,3 -DA:21,3 -DA:23,3 -DA:24,3 -DA:25,2 -DA:27,3 -DA:29,2 -DA:31,2 -DA:33,2 -DA:35,2 -DA:36,2 -DA:38,2 -LF:26 -LH:26 -BRDA:24,0,0,2 -BRDA:24,0,1,1 -BRDA:27,1,0,1 -BRDA:27,1,1,2 -BRF:4 -BRH:4 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/getPublicUser/getPublicUser.ts -FN:13,(anonymous_0) -FNF:1 -FNH:1 -FNDA:2,(anonymous_0) -DA:1,3 -DA:2,3 -DA:5,3 -DA:6,3 -DA:7,3 -DA:9,3 -DA:11,3 -DA:13,3 -DA:14,2 -DA:15,2 -DA:16,2 -DA:18,2 -DA:19,2 -DA:21,1 -DA:23,1 -DA:24,1 -DA:26,1 -LF:17 -LH:17 -BRDA:19,0,0,1 -BRDA:19,0,1,1 -BRF:2 -BRH:2 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/authenticate.ts -FN:13,(anonymous_0) -FNF:1 -FNH:1 -FNDA:20,(anonymous_0) -DA:3,7 -DA:6,7 -DA:7,7 -DA:13,7 -DA:14,20 -DA:15,20 -DA:17,19 -DA:19,19 -DA:21,18 -DA:22,18 -DA:24,17 -LF:11 -LH:11 -BRDA:14,0,0,19 -BRDA:14,0,1,1 -BRDA:15,1,0,1 -BRDA:15,1,1,19 -BRDA:22,2,0,1 -BRDA:22,2,1,17 -BRF:6 -BRH:6 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/getSignedJwt.ts -FN:13,(anonymous_0) -FNF:1 -FNH:1 -FNDA:22,(anonymous_0) -DA:1,19 -DA:2,19 -DA:13,19 -DA:14,22 -DA:16,22 -DA:23,22 -DA:31,22 -DA:33,22 -LF:8 -LH:8 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/matchPassword.ts -FN:9,(anonymous_0) -FNF:1 -FNH:1 -FNDA:7,(anonymous_0) -DA:1,3 -DA:3,3 -DA:9,3 -DA:10,7 -DA:11,7 -LF:5 -LH:5 -BRDA:11,0,0,3 -BRDA:11,0,1,4 -BRF:2 -BRH:2 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/sendEmailForgotPassword.ts -FN:8,(anonymous_0) -FNF:1 -FNH:1 -FNDA:1,(anonymous_0) -DA:2,2 -DA:8,2 -DA:9,1 -DA:11,1 -DA:19,1 -LF:5 -LH:5 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/sendEmailVerifyEmail.ts -FN:8,(anonymous_0) -FNF:1 -FNH:1 -FNDA:1,(anonymous_0) -DA:2,18 -DA:8,18 -DA:9,1 -DA:11,1 -DA:19,1 -LF:5 -LH:5 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/verifyCaptcha.ts -FN:11,(anonymous_0) -FNF:1 -FNH:1 -FNDA:8,(anonymous_0) -DA:3,3 -DA:5,3 -DA:11,3 -DA:12,8 -DA:14,8 -DA:16,7 -DA:17,1 -DA:19,6 -DA:21,3 -DA:23,3 -LF:10 -LH:10 -BRDA:14,0,0,1 -BRDA:14,0,1,7 -BRDA:16,1,0,1 -BRDA:16,1,1,6 -BRDA:16,2,0,7 -BRDA:16,2,1,3 -BRDA:19,3,0,3 -BRDA:19,3,1,3 -BRF:8 -BRH:8 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/verifyRecaptchaToken.ts -FN:10,(anonymous_0) -FNF:1 -FNH:1 -FNDA:24,(anonymous_0) -DA:1,18 -DA:3,18 -DA:4,18 -DA:10,18 -DA:11,24 -DA:13,2 -DA:23,2 -LF:7 -LH:7 -BRDA:11,0,0,22 -BRDA:11,0,1,2 -BRDA:11,1,0,24 -BRDA:11,1,1,23 -BRDA:23,2,0,1 -BRDA:23,2,1,1 -BRDA:23,3,0,2 -BRDA:23,3,1,2 -BRDA:23,3,2,2 -BRF:9 -BRH:9 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/helpers/verifySignedJwt.ts -FN:12,(anonymous_0) -FNF:1 -FNH:1 -FNDA:21,(anonymous_0) -DA:1,8 -DA:12,8 -DA:13,21 -DA:15,21 -DA:23,21 -DA:29,19 -LF:6 -LH:6 -BRDA:17,0,0,20 -BRDA:17,0,1,1 -BRF:2 -BRH:2 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/login/login.ts -FN:15,(anonymous_0) -FNF:1 -FNH:1 -FNDA:4,(anonymous_0) -DA:1,1 -DA:2,1 -DA:5,1 -DA:6,1 -DA:7,1 -DA:8,1 -DA:9,1 -DA:10,1 -DA:11,1 -DA:12,1 -DA:15,1 -DA:16,4 -DA:17,4 -DA:18,4 -DA:20,4 -DA:22,4 -DA:24,4 -DA:25,4 -DA:26,2 -DA:28,4 -DA:30,3 -DA:32,3 -DA:34,2 -DA:36,2 -DA:38,2 -DA:39,2 -DA:41,2 -LF:27 -LH:27 -BRDA:25,0,0,2 -BRDA:25,0,1,2 -BRDA:28,1,0,1 -BRDA:28,1,1,3 -BRF:4 -BRH:4 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/resendEmailVerification/resendEmailVerification.ts -FN:11,(anonymous_0) -FNF:1 -FNH:1 -FNDA:2,(anonymous_0) -DA:3,1 -DA:4,1 -DA:6,1 -DA:7,1 -DA:8,1 -DA:9,1 -DA:11,1 -DA:12,2 -DA:14,2 -DA:16,2 -DA:21,2 -DA:23,2 -DA:25,2 -DA:26,2 -DA:28,2 -LF:15 -LH:15 -BRDA:21,0,0,1 -BRDA:21,0,1,1 -BRF:2 -BRH:2 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/resetPassword/resetPassword.ts -FN:15,(anonymous_0) -FNF:1 -FNH:1 -FNDA:3,(anonymous_0) -DA:1,1 -DA:2,1 -DA:3,1 -DA:6,1 -DA:7,1 -DA:8,1 -DA:9,1 -DA:10,1 -DA:11,1 -DA:12,1 -DA:13,1 -DA:15,1 -DA:16,3 -DA:17,3 -DA:18,3 -DA:20,3 -DA:24,3 -DA:26,2 -DA:27,2 -DA:29,1 -DA:31,1 -DA:33,1 -DA:35,1 -DA:37,1 -DA:39,1 -DA:40,1 -DA:42,1 -LF:27 -LH:27 -BRDA:24,0,0,1 -BRDA:24,0,1,2 -BRDA:27,1,0,1 -BRDA:27,1,1,1 -BRF:4 -BRH:4 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/signUp/signUp.ts -FN:18,(anonymous_0) -FNF:1 -FNH:1 -FNDA:21,(anonymous_0) -DA:1,17 -DA:2,17 -DA:3,17 -DA:6,17 -DA:8,17 -DA:9,17 -DA:11,17 -DA:12,17 -DA:13,17 -DA:14,17 -DA:15,17 -DA:16,17 -DA:18,17 -DA:19,21 -DA:20,21 -DA:21,20 -DA:23,20 -DA:24,20 -DA:26,20 -DA:28,20 -DA:29,20 -DA:31,19 -DA:32,19 -DA:34,18 -DA:35,18 -DA:37,18 -DA:39,18 -DA:41,18 -DA:43,18 -DA:45,18 -DA:46,18 -DA:48,18 -LF:32 -LH:32 -BRDA:29,0,0,1 -BRDA:29,0,1,19 -BRDA:32,1,0,1 -BRDA:32,1,1,18 -BRF:4 -BRH:4 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/user/verifyEmail/verifyEmail.ts -FN:14,(anonymous_0) -FNF:1 -FNH:1 -FNDA:1,(anonymous_0) -DA:1,1 -DA:2,1 -DA:5,1 -DA:6,1 -DA:7,1 -DA:8,1 -DA:9,1 -DA:10,1 -DA:11,1 -DA:12,1 -DA:14,1 -DA:15,1 -DA:16,1 -DA:17,1 -DA:19,1 -DA:21,1 -DA:23,1 -DA:25,1 -DA:27,1 -DA:32,1 -DA:33,1 -DA:35,1 -LF:22 -LH:22 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/resolvers/vote/sendVote/sendVote.ts -FN:18,(anonymous_0) -FNF:1 -FNH:1 -FNDA:8,(anonymous_0) -DA:1,1 -DA:2,1 -DA:5,1 -DA:6,1 -DA:7,1 -DA:9,1 -DA:10,1 -DA:11,1 -DA:12,1 -DA:13,1 -DA:14,1 -DA:15,1 -DA:16,1 -DA:18,1 -DA:19,8 -DA:20,8 -DA:21,8 -DA:23,8 -DA:25,8 -DA:28,8 -DA:29,8 -DA:32,7 -DA:37,7 -DA:40,6 -DA:49,6 -DA:50,6 -DA:52,6 -DA:53,6 -DA:54,5 -DA:55,4 -DA:56,2 -DA:58,6 -DA:66,6 -DA:68,6 -DA:70,3 -DA:71,3 -DA:80,6 -DA:81,6 -DA:83,6 -LF:39 -LH:39 -BRDA:29,0,0,1 -BRDA:29,0,1,7 -BRDA:37,1,0,1 -BRDA:37,1,1,6 -BRDA:49,2,0,6 -BRDA:49,2,1,6 -BRDA:50,3,0,6 -BRDA:50,3,1,6 -BRDA:50,3,2,2 -BRDA:53,4,0,1 -BRDA:53,4,1,5 -BRDA:53,5,0,6 -BRDA:53,5,1,2 -BRDA:54,6,0,1 -BRDA:54,6,1,4 -BRDA:54,7,0,5 -BRDA:54,7,1,1 -BRDA:55,8,0,2 -BRDA:55,8,1,2 -BRDA:55,9,0,4 -BRDA:55,9,1,4 -BRDA:68,10,0,3 -BRDA:68,10,1,3 -BRDA:70,11,0,1 -BRDA:70,11,1,2 -BRF:25 -BRH:25 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/captcha/Captcha.ts -FNF:0 -FNH:0 -DA:1,18 -DA:2,18 -DA:4,18 -DA:5,18 -DA:6,18 -DA:7,18 -DA:10,18 -DA:12,18 -DA:16,18 -DA:20,18 -DA:24,18 -DA:28,18 -DA:33,18 -DA:40,18 -DA:48,18 -DA:51,18 -DA:54,18 -DA:57,18 -LF:18 -LH:18 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/captcha/CaptchaFor.ts -FN:1,(anonymous_0) -FNF:1 -FNH:1 -FNDA:18,(anonymous_0) -DA:1,18 -DA:2,18 -DA:3,18 -LF:3 -LH:3 -BRDA:1,0,0,18 -BRDA:1,0,1,18 -BRF:2 -BRH:2 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/AddCommentView.ts -FNF:0 -FNH:0 -DA:1,1 -DA:2,1 -DA:3,1 -DA:5,1 -DA:8,1 -DA:11,1 -LF:6 -LH:6 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/Comment.ts -FNF:0 -FNH:0 -DA:1,5 -DA:2,5 -DA:3,5 -DA:4,5 -DA:5,5 -DA:7,5 -DA:9,5 -DA:13,5 -DA:18,5 -DA:23,5 -DA:28,5 -DA:33,5 -DA:37,5 -DA:42,5 -DA:47,5 -DA:52,5 -DA:57,5 -DA:62,5 -DA:67,5 -DA:72,5 -DA:77,5 -DA:82,5 -DA:87,5 -DA:90,5 -DA:93,5 -DA:96,5 -LF:26 -LH:26 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/CommentStatus.ts -FN:1,(anonymous_0) -FNF:1 -FNH:1 -FNDA:5,(anonymous_0) -DA:1,5 -DA:2,5 -DA:3,5 -DA:4,5 -LF:4 -LH:4 -BRDA:1,0,0,5 -BRDA:1,0,1,5 -BRF:2 -BRH:2 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/CommentType.ts -FN:1,(anonymous_0) -FNF:1 -FNH:1 -FNDA:5,(anonymous_0) -DA:1,5 -DA:2,5 -DA:3,5 -DA:4,5 -LF:4 -LH:4 -BRDA:1,0,0,5 -BRDA:1,0,1,5 -BRF:2 -BRH:2 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/GetComment.ts -FNF:0 -FNH:0 -DA:1,1 -DA:2,1 -DA:3,1 -DA:4,1 -DA:5,1 -DA:7,1 -DA:10,1 -DA:13,1 -DA:15,1 -DA:18,1 -LF:10 -LH:10 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/GetLatestComments.ts -FNF:0 -FNH:0 -DA:1,1 -DA:2,1 -DA:3,1 -DA:7,1 -DA:11,1 -DA:14,1 -DA:17,1 -DA:21,1 -LF:8 -LH:8 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/comment/NewComment.ts -FNF:0 -FNH:0 -DA:1,1 -DA:2,1 -DA:3,1 -DA:4,1 -DA:5,1 -DA:7,1 -DA:11,1 -DA:15,1 -DA:20,1 -DA:25,1 -DA:30,1 -DA:33,1 -DA:35,1 -DA:38,1 -LF:14 -LH:14 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/mongo/ResponseError.ts -FN:5,(anonymous_0) -FNF:1 -FNH:1 -FNDA:26,(anonymous_0) -DA:1,20 -DA:6,26 -DA:7,26 -DA:8,26 -DA:10,26 -LF:5 -LH:5 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/notification/Notification.ts -FNF:0 -FNH:0 -DA:1,2 -DA:2,2 -DA:3,2 -DA:4,2 -DA:5,2 -DA:7,2 -DA:9,2 -DA:13,2 -DA:18,2 -DA:23,2 -DA:28,2 -DA:33,2 -DA:38,2 -DA:43,2 -DA:47,2 -DA:50,2 -DA:53,2 -DA:56,2 -LF:18 -LH:18 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/notification/NotificationType.ts -FN:1,(anonymous_0) -FNF:1 -FNH:1 -FNDA:2,(anonymous_0) -DA:1,2 -DA:2,2 -DA:3,2 -DA:4,2 -DA:5,2 -DA:6,2 -LF:6 -LH:6 -BRDA:1,0,0,2 -BRDA:1,0,1,2 -BRF:2 -BRH:2 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/notification/TargetType.ts -FN:1,(anonymous_0) -FNF:1 -FNH:1 -FNDA:2,(anonymous_0) -DA:1,2 -DA:2,2 -DA:3,2 -DA:4,2 -DA:5,2 -LF:5 -LH:5 -BRDA:1,0,0,2 -BRDA:1,0,1,2 -BRF:2 -BRH:2 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/quota/Quota.ts -FNF:0 -FNH:0 -DA:1,9 -DA:3,9 -DA:4,9 -DA:5,9 -DA:6,9 -DA:9,9 -DA:11,9 -DA:15,9 -DA:20,9 -DA:25,9 -DA:33,9 -DA:36,9 -LF:12 -LH:12 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/quota/QuotaType.ts -FN:1,(anonymous_0) -FNF:1 -FNH:1 -FNDA:9,(anonymous_0) -DA:1,9 -DA:2,9 -DA:3,9 -DA:4,9 -LF:4 -LH:4 -BRDA:1,0,0,9 -BRDA:1,0,1,9 -BRF:2 -BRH:2 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/ChangePassword.ts -FNF:0 -FNH:0 -DA:1,1 -DA:2,1 -DA:4,1 -DA:8,1 -DA:13,1 -DA:16,1 -LF:6 -LH:6 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/ForgotPassword.ts -FNF:0 -FNH:0 -DA:1,1 -DA:2,1 -DA:4,1 -DA:7,1 -DA:11,1 -DA:14,1 -LF:6 -LH:6 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/GetPublicUser.ts -FNF:0 -FNH:0 -DA:1,3 -DA:2,3 -DA:3,3 -DA:6,3 -DA:9,3 -DA:12,3 -LF:6 -LH:6 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/IsEqualTo.ts -FN:3,IsEqualTo -FN:4,(anonymous_1) -FN:12,(anonymous_2) -FN:18,(anonymous_3) -FNF:4 -FNH:3 -FNDA:17,IsEqualTo -FNDA:17,(anonymous_1) -FNDA:21,(anonymous_2) -FNDA:0,(anonymous_3) -DA:1,17 -DA:3,17 -DA:4,17 -DA:5,17 -DA:13,21 -DA:14,21 -DA:15,21 -DA:19,0 -DA:20,0 -LF:9 -LH:7 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/Login.ts -FNF:0 -FNH:0 -DA:1,1 -DA:2,1 -DA:5,1 -DA:8,1 -DA:13,1 -DA:17,1 -DA:20,1 -DA:23,1 -LF:8 -LH:8 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/PublicUser.ts -FNF:0 -FNH:0 -DA:1,2 -DA:2,2 -DA:4,2 -DA:6,2 -DA:8,2 -DA:12,2 -DA:15,2 -DA:18,2 -DA:21,2 -LF:9 -LH:9 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/ResetPassword.ts -FNF:0 -FNH:0 -DA:1,1 -DA:2,1 -DA:4,1 -DA:7,1 -DA:11,1 -DA:16,1 -DA:19,1 -LF:7 -LH:7 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/SignUp.ts -FNF:0 -FNH:0 -DA:1,17 -DA:2,17 -DA:4,17 -DA:6,17 -DA:10,17 -DA:14,17 -DA:19,17 -DA:24,17 -DA:28,17 -DA:31,17 -DA:34,17 -LF:11 -LH:11 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/User.ts -FNF:0 -FNH:0 -DA:1,17 -DA:2,17 -DA:4,17 -DA:5,17 -DA:8,17 -DA:10,17 -DA:15,17 -DA:19,17 -DA:24,17 -DA:27,17 -DA:32,17 -DA:37,17 -DA:40,17 -DA:43,17 -DA:46,17 -LF:15 -LH:15 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/UserRole.ts -FN:1,(anonymous_0) -FNF:1 -FNH:1 -FNDA:18,(anonymous_0) -DA:1,18 -DA:2,18 -DA:3,18 -LF:3 -LH:3 -BRDA:1,0,0,18 -BRDA:1,0,1,18 -BRF:2 -BRH:2 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/user/VerifyEmail.ts -FNF:0 -FNH:0 -DA:1,1 -DA:2,1 -DA:4,1 -DA:7,1 -DA:10,1 -LF:5 -LH:5 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/vote/SendVote.ts -FNF:0 -FNH:0 -DA:1,1 -DA:2,1 -DA:3,1 -DA:4,1 -DA:6,1 -DA:9,1 -DA:13,1 -DA:16,1 -LF:8 -LH:8 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/vote/Vote.ts -FNF:0 -FNH:0 -DA:1,2 -DA:2,2 -DA:4,2 -DA:5,2 -DA:9,2 -DA:11,2 -DA:15,2 -DA:19,2 -DA:24,2 -DA:27,2 -DA:30,2 -DA:33,2 -LF:12 -LH:12 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/shared/vote/VoteDirection.ts -FN:1,(anonymous_0) -FNF:1 -FNH:1 -FNDA:2,(anonymous_0) -DA:1,2 -DA:2,2 -DA:3,2 -LF:3 -LH:3 -BRDA:1,0,0,2 -BRDA:1,0,1,2 -BRF:2 -BRH:2 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/test/createTestUser.ts -FN:21,(anonymous_0) -FN:32,(anonymous_1) -FN:48,(anonymous_2) -FNF:3 -FNH:3 -FNDA:17,(anonymous_0) -FNDA:19,(anonymous_1) -FNDA:40,(anonymous_2) -DA:3,16 -DA:4,16 -DA:5,16 -DA:8,16 -DA:9,16 -DA:21,16 -DA:22,17 -DA:24,17 -DA:26,17 -DA:28,17 -DA:29,17 -DA:31,17 -DA:32,19 -DA:34,17 -DA:48,40 -DA:50,17 -DA:52,17 -DA:54,17 -DA:56,17 -LF:19 -LH:19 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/test/deleteTestUser.ts -FN:11,(anonymous_0) -FNF:1 -FNH:1 -FNDA:16,(anonymous_0) -DA:3,16 -DA:4,16 -DA:5,16 -DA:11,16 -DA:12,16 -DA:13,16 -LF:6 -LH:6 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/aymeric.bethencourt/apps/boilerplate/src/app-server/src/test/mockConnect.ts -FN:3,(anonymous_0) -FNF:1 -FNH:1 -FNDA:34,(anonymous_0) -DA:1,18 -DA:3,18 -DA:4,34 -LF:3 -LH:3 -BRF:0 -BRH:0 -end_of_record diff --git a/src/api/kubernetesDeployment.json b/src/api/kubernetesDeployment.json index a801d09..05d219e 100644 --- a/src/api/kubernetesDeployment.json +++ b/src/api/kubernetesDeployment.json @@ -12,7 +12,7 @@ "containers": [ { "name": "tezosacademy-api", - "image": "registry.digitalocean.com/neutrino/tezosacademy-api", + "image": "registry.digitalocean.com/octo/tezosacademy-api", "imagePullPolicy": "Always", "env": [ { diff --git a/src/api/package.json b/src/api/package.json index fb897c4..f03d1e3 100644 --- a/src/api/package.json +++ b/src/api/package.json @@ -6,17 +6,18 @@ "start": "PORT=8080 NODE_ENV=development nodemon --watch src -e ts,tsx --exec ts-node src/index.ts", "build": "PORT=3000 NODE_ENV=production tsc", "analyze": "PORT=3000 NODE_ENV=production tsc && npx source-map-explorer 'build/static/js/*.js'", - "docker-create": "doctl k8s cluster create --region fra1 tezosacademy-api --wait && doctl kubernetes cluster kubeconfig save tezosacademy-api", - "docker-build": "docker build -t neutrino/tezosacademy-api . --no-cache", - "docker-run": "docker run --rm -it -p 3000:3000 neutrino/tezosacademy-api", - "docker-push": "doctl registry login && docker tag neutrino/tezosacademy-api registry.digitalocean.com/neutrino/tezosacademy-api && docker push registry.digitalocean.com/neutrino/tezosacademy-api", - "docker-patch": "doctl registry kubernetes-manifest | kubectl --context do-fra1-tezosacademy-api apply -f - && kubectl --context do-fra1-tezosacademy-api patch serviceaccount default -p '{\"imagePullSecrets\": [{\"name\": \"registry-neutrino\"}]}'", + "docker-create": "doctl k8s cluster create --region fra1 --node-pool \"name=tezosacademy-api;size=s-1vcpu-2gb;count=1;auto-scale=true;min-nodes=1;max-nodes=3\" tezosacademy-api --wait && doctl kubernetes cluster kubeconfig save tezosacademy-api", + "docker-build": "docker build -t octo/tezosacademy-api . --no-cache", + "docker-run": "docker run --rm -it -p 3000:3000 octo/tezosacademy-api", + "docker-push": "doctl registry login && docker tag octo/tezosacademy-api registry.digitalocean.com/octo/tezosacademy-api && docker push registry.digitalocean.com/octo/tezosacademy-api", + "docker-patch": "doctl registry kubernetes-manifest | kubectl --context do-fra1-tezosacademy-api apply -f - && kubectl --context do-fra1-tezosacademy-api patch serviceaccount default -p '{\"imagePullSecrets\": [{\"name\": \"registry-octo\"}]}'", "docker-secrets": "kubectl --context do-fra1-tezosacademy-api create secret generic person --from-env-file=.testenv", "docker-deploy": "kubectl --context do-fra1-tezosacademy-api apply -f kubernetesDeployment.json", "docker-serve": "kubectl --context do-fra1-tezosacademy-api apply -f kubernetesService.json", "docker-restart": "kubectl --context do-fra1-tezosacademy-api delete pods -l app=tezosacademy-api", "docker-logs": "kubectl --context do-fra1-tezosacademy-api logs --timestamps -l app=tezosacademy-api", "docker-update": "yarn run docker-build && yarn run docker-push && yarn run docker-restart", + "docker-install": "yarn run docker-build && yarn run docker-push && yarn run docker-patch && yarn run docker-deploy && yarn run docker-serve", "test": "jest --runInBand --verbose", "coverage": "jest --runInBand --collectCoverage" }, diff --git a/src/api/src/kubernetes.json b/src/api/src/kubernetes.json index 3ceba63..010ea3e 100644 --- a/src/api/src/kubernetes.json +++ b/src/api/src/kubernetes.json @@ -12,7 +12,7 @@ "containers": [ { "name": "tezosacademy-api", - "image": "registry.digitalocean.com/neutrino/tezosacademy-api", + "image": "registry.digitalocean.com/octo/tezosacademy-api", "imagePullPolicy": "Always" } ], diff --git a/src/api/src/resolvers/user/forgotPassword/forgotPassword.ts b/src/api/src/resolvers/user/forgotPassword/forgotPassword.ts index b81247c..308795b 100644 --- a/src/api/src/resolvers/user/forgotPassword/forgotPassword.ts +++ b/src/api/src/resolvers/user/forgotPassword/forgotPassword.ts @@ -31,7 +31,7 @@ export const forgotPassword = async (ctx: Context, next: Next): Promise => const captcha: Captcha = await createCaptcha(user._id, CaptchaFor.CAPTCHA_FOR_RESET_PASSWORD) - await sendEmailForgotPassword(user.email, captcha.index, captcha.token) + await sendEmailForgotPassword(user.email, captcha.solution, captcha.token) const response: ForgotPasswordOutputs = { token: captcha.token } diff --git a/src/api/src/resolvers/user/helpers/sendEmailForgotPassword.ts b/src/api/src/resolvers/user/helpers/sendEmailForgotPassword.ts index 03706ee..dbc6593 100644 --- a/src/api/src/resolvers/user/helpers/sendEmailForgotPassword.ts +++ b/src/api/src/resolvers/user/helpers/sendEmailForgotPassword.ts @@ -2,7 +2,7 @@ import { MailDataRequired } from '@sendgrid/helpers/classes/mail' import * as sendgrid from '@sendgrid/mail' interface SendEmailForgotPassword { - (email: string, captchaIndex: number, token: string): Promise + (email: string, captchaIndex: string, token: string): Promise } export const sendEmailForgotPassword: SendEmailForgotPassword = async (email, captchaIndex, token) => { @@ -12,8 +12,8 @@ export const sendEmailForgotPassword: SendEmailForgotPassword = async (email, ca to: email, from: { name: 'TezosAcademy', email: process.env.FROM_EMAIL as string }, subject: 'Password reset', - text: `Please enter the following captcha https://b2.tezosacademy.io/file/tezosacademy/captchas/${captchaIndex}.png on https://tezosacademy.io/reset-password?key=${token}`, - html: `Please enter the following captcha
captcha
on https://tezosacademy.io/reset-password?key=${token}`, + text: `Please enter the following : ${captchaIndex} on https://tezosacademy.io/reset-password?key=${token}`, + html: `Please enter the following : ${captchaIndex} on https://tezosacademy.io/reset-password?key=${token}`, } await sendgrid.send(message) diff --git a/src/api/src/resolvers/user/resendEmailVerification/resendEmailVerification.spec.ts b/src/api/src/resolvers/user/resendEmailVerification/resendEmailVerification.spec.ts deleted file mode 100644 index 4916140..0000000 --- a/src/api/src/resolvers/user/resendEmailVerification/resendEmailVerification.spec.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { Context, Next } from 'koa' -import { mockConnect } from '../../../test/mockConnect' -import { createTestUser } from '../../../test/createTestUser' -import { User } from '../../../shared/user/User' -import { Jwt } from '../../../shared/user/Jwt' -import { deleteTestUser } from '../../../test/deleteTestUser' -import { CaptchaFor } from '../../../shared/captcha/CaptchaFor' -import { CaptchaModel } from '../../../shared/captcha/Captcha' -import { resendEmailVerification } from './resendEmailVerification' - -let user: User -let jwt: Jwt -let next: Next - -describe('User', () => { - beforeAll(async () => { - await mockConnect() - const created = await createTestUser('bob@test.com', 'bob', 'Bob1234#') - user = created.user - jwt = created.jwt - next = created.next - }) - - it('can resend email verification token using existing captcha', async (done) => { - const ctx: Context = { - request: { - headers: { - authorization: 'Bearer ' + jwt, - }, - body: {}, - }, - } as Context - - await resendEmailVerification(ctx, next) - - expect(ctx.status).toEqual(200) - done() - }) - - it('can resend email verification token using new captcha', async (done) => { - const ctx: Context = { - request: { - headers: { - authorization: 'Bearer ' + jwt, - }, - body: {}, - }, - } as Context - - await CaptchaModel.deleteOne({ userId: user._id, captchaFor: CaptchaFor.CAPTCHA_FOR_VERIFY_EMAIL }) - - await resendEmailVerification(ctx, next) - - expect(ctx.status).toEqual(200) - done() - }) - - afterAll(async () => { - await deleteTestUser(user._id) - }) -}) diff --git a/src/api/src/resolvers/user/resendEmailVerification/resendEmailVerification.ts b/src/api/src/resolvers/user/resendEmailVerification/resendEmailVerification.ts deleted file mode 100644 index 57ba5c2..0000000 --- a/src/api/src/resolvers/user/resendEmailVerification/resendEmailVerification.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { Context, Next } from 'koa' - -import { Captcha, CaptchaModel } from '../../../shared/captcha/Captcha' -import { CaptchaFor } from '../../../shared/captcha/CaptchaFor' -import { User } from '../../../shared/user/User' -import { createCaptcha } from '../../captcha/helpers/createCaptcha' -import { authenticate } from '../helpers/authenticate' -import { sendEmailVerifyEmail } from '../helpers/sendEmailVerifyEmail' -import { rateLimit } from '../../quota/rateLimit/rateLimit' -import { QuotaType } from '../../../shared/quota/QuotaType' - -export const resendEmailVerification = async (ctx: Context, next: Next): Promise => { - const user: User = await authenticate(ctx) - - await rateLimit(user._id, QuotaType.NEW_CAPTCHA) - - await CaptchaModel.deleteMany({ - userId: user._id, - captchaFor: CaptchaFor.CAPTCHA_FOR_VERIFY_EMAIL, - }).exec() - - const captcha: Captcha = await createCaptcha(user._id, CaptchaFor.CAPTCHA_FOR_VERIFY_EMAIL) - - await sendEmailVerifyEmail(user.email, captcha.index) - - ctx.status = 200 - ctx.body = { status: true } - - await next() -} diff --git a/src/api/src/resolvers/user/signUp/signUp.ts b/src/api/src/resolvers/user/signUp/signUp.ts index c751b68..80c0e00 100644 --- a/src/api/src/resolvers/user/signUp/signUp.ts +++ b/src/api/src/resolvers/user/signUp/signUp.ts @@ -5,16 +5,12 @@ import { Context, Next } from 'koa' import { firstError } from '../../../helpers/firstError' import { toPublicUser } from '../../../helpers/toPublicUser' -import { Captcha } from '../../../shared/captcha/Captcha' -import { CaptchaFor } from '../../../shared/captcha/CaptchaFor' import { ResponseError } from '../../../shared/mongo/ResponseError' import { Jwt } from '../../../shared/user/Jwt' import { PublicUser } from '../../../shared/user/PublicUser' import { SignUpInputs, SignUpOutputs } from '../../../shared/user/SignUp' import { User, UserModel } from '../../../shared/user/User' -import { createCaptcha } from '../../captcha/helpers/createCaptcha' import { getSignedJwt } from '../helpers/getSignedJwt' -import { sendEmailVerifyEmail } from '../helpers/sendEmailVerifyEmail' import { verifyRecaptchaToken } from '../helpers/verifyRecaptchaToken' export const signUp = async (ctx: Context, next: Next): Promise => { @@ -39,10 +35,6 @@ export const signUp = async (ctx: Context, next: Next): Promise => { const jwt: Jwt = getSignedJwt(user._id.toHexString(), user.username) - const captcha: Captcha = await createCaptcha(user._id, CaptchaFor.CAPTCHA_FOR_VERIFY_EMAIL) - - await sendEmailVerifyEmail(user.email, captcha.index) - const response: SignUpOutputs = { jwt, user: publicUser } ctx.status = 200 diff --git a/src/api/src/resolvers/user/verifyEmail/verifyEmail.spec.ts b/src/api/src/resolvers/user/verifyEmail/verifyEmail.spec.ts deleted file mode 100644 index b6dd151..0000000 --- a/src/api/src/resolvers/user/verifyEmail/verifyEmail.spec.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { Context, Next } from 'koa' - -import { Captcha, CaptchaModel } from '../../../shared/captcha/Captcha' -import { CaptchaSolution } from '../../../shared/captcha/CaptchaSolution' -import { Jwt } from '../../../shared/user/Jwt' -import { User } from '../../../shared/user/User' -import { createTestUser } from '../../../test/createTestUser' -import { deleteTestUser } from '../../../test/deleteTestUser' -import { mockConnect } from '../../../test/mockConnect' -import { verifyEmail } from './verifyEmail' - -let user: User -let jwt: Jwt -let next: Next -let solution: CaptchaSolution - -describe('User', () => { - beforeAll(async () => { - await mockConnect() - const created = await createTestUser('bob@test.com', 'bob', 'Bob1234#') - user = created.user - jwt = created.jwt - next = created.next - - const captcha: Captcha = (await CaptchaModel.findOne({ userId: user._id }).exec()) as Captcha - solution = captcha.solution - }) - - it('can verify his email', async (done) => { - const ctx: Context = { - request: { - headers: { - authorization: 'Bearer ' + jwt, - }, - body: { - solution, - }, - }, - } as Context - - await verifyEmail(ctx, next) - - expect(ctx.status).toEqual(200) - done() - }) - - afterAll(async () => { - await deleteTestUser(user._id) - }) -}) diff --git a/src/api/src/resolvers/user/verifyEmail/verifyEmail.ts b/src/api/src/resolvers/user/verifyEmail/verifyEmail.ts deleted file mode 100644 index 4524053..0000000 --- a/src/api/src/resolvers/user/verifyEmail/verifyEmail.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { plainToClass } from 'class-transformer' -import { validateOrReject } from 'class-validator' -import { Context, Next } from 'koa' - -import { firstError } from '../../../helpers/firstError' -import { CaptchaModel } from '../../../shared/captcha/Captcha' -import { CaptchaFor } from '../../../shared/captcha/CaptchaFor' -import { User, UserModel } from '../../../shared/user/User' -import { VerifyEmailInputs } from '../../../shared/user/VerifyEmail' -import { authenticate } from '../helpers/authenticate' -import { verifyCaptcha } from '../helpers/verifyCaptcha' -import { rateLimit } from '../../quota/rateLimit/rateLimit' - -export const verifyEmail = async (ctx: Context, next: Next): Promise => { - const verifyEmailArgs = plainToClass(VerifyEmailInputs, ctx.request.body, { excludeExtraneousValues: true }) - await validateOrReject(verifyEmailArgs, { forbidUnknownValues: true }).catch(firstError) - const { solution } = verifyEmailArgs - - const user: User = await authenticate(ctx) - - await rateLimit(user._id) - - await verifyCaptcha(user._id, solution, CaptchaFor.CAPTCHA_FOR_VERIFY_EMAIL) - - await UserModel.updateOne({ _id: user._id }, { $set: { emailVerified: true } }).exec() - - await CaptchaModel.deleteOne({ - userId: user._id, - captchaFor: CaptchaFor.CAPTCHA_FOR_VERIFY_EMAIL, - }).exec() - - ctx.status = 200 - ctx.body = {} - - await next() -} diff --git a/src/api/src/router.ts b/src/api/src/router.ts index e5eb1fa..c1c11c5 100644 --- a/src/api/src/router.ts +++ b/src/api/src/router.ts @@ -6,10 +6,8 @@ import { addProgress } from './resolvers/user/addProgress/addProgress' import { changePassword } from './resolvers/user/changePassword/changePassword' import { forgotPassword } from './resolvers/user/forgotPassword/forgotPassword' import { login } from './resolvers/user/login/login' -import { resendEmailVerification } from './resolvers/user/resendEmailVerification/resendEmailVerification' import { resetPassword } from './resolvers/user/resetPassword/resetPassword' import { signUp } from './resolvers/user/signUp/signUp' -import { verifyEmail } from './resolvers/user/verifyEmail/verifyEmail' const router = new Router() @@ -20,8 +18,6 @@ router.get('/', async (ctx: Context) => { router.post('/user/sign-up', signUp) router.post('/user/login', login) -router.post('/user/verify-email', verifyEmail) -router.post('/user/resend-email-verification', resendEmailVerification) router.post('/user/add-progress', addProgress) router.post('/user/reset-password', resetPassword) router.post('/user/forgot-password', forgotPassword) diff --git a/src/frontend/kubernetesDeployment.json b/src/frontend/kubernetesDeployment.json index 3dd1d07..a014496 100644 --- a/src/frontend/kubernetesDeployment.json +++ b/src/frontend/kubernetesDeployment.json @@ -12,7 +12,7 @@ "containers": [ { "name": "tezosacademy-frontend", - "image": "registry.digitalocean.com/neutrino/tezosacademy-frontend", + "image": "registry.digitalocean.com/octo/tezosacademy-frontend", "imagePullPolicy": "Always" } ] diff --git a/src/frontend/package.json b/src/frontend/package.json index 5d01029..8dcc4ae 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -4,17 +4,18 @@ "scripts": { "start": "PORT=3000 NODE_ENV=development REACT_APP_BACKEND_URL=http://localhost:8080 react-scripts -r @cypress/instrument-cra start && open http://localhost:3000", "build": "INLINE_RUNTIME_CHUNK=false react-scripts build && cra-append-sw -s ./src/custom-sw.js", - "docker-create": "doctl k8s cluster create --region fra1 tezosacademy-frontend --wait && doctl kubernetes cluster kubeconfig save tezosacademy-frontend", - "docker-build": "yarn build && docker build -t neutrino/tezosacademy-frontend . --no-cache", - "docker-run": "docker run --rm -it -p 80:80 neutrino/tezosacademy-frontend", - "docker-push": "doctl registry login && docker tag neutrino/tezosacademy-frontend registry.digitalocean.com/neutrino/tezosacademy-frontend && docker push registry.digitalocean.com/neutrino/tezosacademy-frontend", - "docker-patch": "doctl registry kubernetes-manifest | kubectl --context do-fra1-tezosacademy-frontend apply -f - && kubectl --context do-fra1-tezosacademy-frontend patch serviceaccount default -p '{\"imagePullSecrets\": [{\"name\": \"registry-neutrino\"}]}'", + "docker-create": "doctl k8s cluster create --region fra1 --node-pool \"name=tezosacademy-frontend;size=s-1vcpu-2gb;count=1;auto-scale=true;min-nodes=1;max-nodes=3\" tezosacademy-frontend --wait && doctl kubernetes cluster kubeconfig save tezosacademy-frontend", + "docker-build": "yarn build && docker build -t octo/tezosacademy-frontend . --no-cache", + "docker-run": "docker run --rm -it -p 80:80 octo/tezosacademy-frontend", + "docker-push": "doctl registry login && docker tag octo/tezosacademy-frontend registry.digitalocean.com/octo/tezosacademy-frontend && docker push registry.digitalocean.com/octo/tezosacademy-frontend", + "docker-patch": "doctl registry kubernetes-manifest | kubectl --context do-fra1-tezosacademy-frontend apply -f - && kubectl --context do-fra1-tezosacademy-frontend patch serviceaccount default -p '{\"imagePullSecrets\": [{\"name\": \"registry-octo\"}]}'", "docker-secrets": "kubectl --context do-fra1-tezosacademy-frontend create secret generic person --from-env-file=.env", "docker-deploy": "kubectl --context do-fra1-tezosacademy-frontend apply -f kubernetesDeployment.json", "docker-serve": "kubectl --context do-fra1-tezosacademy-frontend apply -f kubernetesService.json", "docker-restart": "kubectl --context do-fra1-tezosacademy-frontend delete pods -l app=tezosacademy-frontend", "docker-logs": "kubectl --context do-fra1-tezosacademy-frontend logs --timestamps -l app=tezosacademy-frontend", "docker-update": "yarn run docker-build && yarn run docker-push && yarn run docker-restart", + "docker-install": "yarn run docker-build && yarn run docker-push && yarn run docker-patch && yarn run docker-deploy && yarn run docker-serve", "test": "react-scripts test", "analyze": "react-scripts build && source-map-explorer 'build/static/js/*.js'", "cypress:open": "cypress open", diff --git a/src/frontend/public/captchas/0.png b/src/frontend/public/captchas/0.png deleted file mode 100644 index 9d95671..0000000 Binary files a/src/frontend/public/captchas/0.png and /dev/null differ diff --git a/src/frontend/public/captchas/1.png b/src/frontend/public/captchas/1.png deleted file mode 100644 index 0cc31f3..0000000 Binary files a/src/frontend/public/captchas/1.png and /dev/null differ diff --git a/src/frontend/public/captchas/10.png b/src/frontend/public/captchas/10.png deleted file mode 100644 index adecd04..0000000 Binary files a/src/frontend/public/captchas/10.png and /dev/null differ diff --git a/src/frontend/public/captchas/11.png b/src/frontend/public/captchas/11.png deleted file mode 100644 index 8302c5a..0000000 Binary files a/src/frontend/public/captchas/11.png and /dev/null differ diff --git a/src/frontend/public/captchas/12.png b/src/frontend/public/captchas/12.png deleted file mode 100644 index 0c9df94..0000000 Binary files a/src/frontend/public/captchas/12.png and /dev/null differ diff --git a/src/frontend/public/captchas/13.png b/src/frontend/public/captchas/13.png deleted file mode 100644 index a7dd31b..0000000 Binary files a/src/frontend/public/captchas/13.png and /dev/null differ diff --git a/src/frontend/public/captchas/14.png b/src/frontend/public/captchas/14.png deleted file mode 100644 index 00fc8eb..0000000 Binary files a/src/frontend/public/captchas/14.png and /dev/null differ diff --git a/src/frontend/public/captchas/15.png b/src/frontend/public/captchas/15.png deleted file mode 100644 index 6c52c0c..0000000 Binary files a/src/frontend/public/captchas/15.png and /dev/null differ diff --git a/src/frontend/public/captchas/16.png b/src/frontend/public/captchas/16.png deleted file mode 100644 index ec8fd3d..0000000 Binary files a/src/frontend/public/captchas/16.png and /dev/null differ diff --git a/src/frontend/public/captchas/17.png b/src/frontend/public/captchas/17.png deleted file mode 100644 index 1f865f0..0000000 Binary files a/src/frontend/public/captchas/17.png and /dev/null differ diff --git a/src/frontend/public/captchas/18.png b/src/frontend/public/captchas/18.png deleted file mode 100644 index 6a22ff0..0000000 Binary files a/src/frontend/public/captchas/18.png and /dev/null differ diff --git a/src/frontend/public/captchas/19.png b/src/frontend/public/captchas/19.png deleted file mode 100644 index 6b9c014..0000000 Binary files a/src/frontend/public/captchas/19.png and /dev/null differ diff --git a/src/frontend/public/captchas/2.png b/src/frontend/public/captchas/2.png deleted file mode 100644 index 6776d49..0000000 Binary files a/src/frontend/public/captchas/2.png and /dev/null differ diff --git a/src/frontend/public/captchas/20.png b/src/frontend/public/captchas/20.png deleted file mode 100644 index 697d516..0000000 Binary files a/src/frontend/public/captchas/20.png and /dev/null differ diff --git a/src/frontend/public/captchas/21.png b/src/frontend/public/captchas/21.png deleted file mode 100644 index d5aac89..0000000 Binary files a/src/frontend/public/captchas/21.png and /dev/null differ diff --git a/src/frontend/public/captchas/22.png b/src/frontend/public/captchas/22.png deleted file mode 100644 index b9d7309..0000000 Binary files a/src/frontend/public/captchas/22.png and /dev/null differ diff --git a/src/frontend/public/captchas/23.png b/src/frontend/public/captchas/23.png deleted file mode 100644 index 9d6e797..0000000 Binary files a/src/frontend/public/captchas/23.png and /dev/null differ diff --git a/src/frontend/public/captchas/24.png b/src/frontend/public/captchas/24.png deleted file mode 100644 index 461b7d2..0000000 Binary files a/src/frontend/public/captchas/24.png and /dev/null differ diff --git a/src/frontend/public/captchas/25.png b/src/frontend/public/captchas/25.png deleted file mode 100644 index adedb24..0000000 Binary files a/src/frontend/public/captchas/25.png and /dev/null differ diff --git a/src/frontend/public/captchas/26.png b/src/frontend/public/captchas/26.png deleted file mode 100644 index 3cf377e..0000000 Binary files a/src/frontend/public/captchas/26.png and /dev/null differ diff --git a/src/frontend/public/captchas/27.png b/src/frontend/public/captchas/27.png deleted file mode 100644 index 61db10e..0000000 Binary files a/src/frontend/public/captchas/27.png and /dev/null differ diff --git a/src/frontend/public/captchas/28.png b/src/frontend/public/captchas/28.png deleted file mode 100644 index 7aa9a43..0000000 Binary files a/src/frontend/public/captchas/28.png and /dev/null differ diff --git a/src/frontend/public/captchas/29.png b/src/frontend/public/captchas/29.png deleted file mode 100644 index a16db45..0000000 Binary files a/src/frontend/public/captchas/29.png and /dev/null differ diff --git a/src/frontend/public/captchas/3.png b/src/frontend/public/captchas/3.png deleted file mode 100644 index 85cfe42..0000000 Binary files a/src/frontend/public/captchas/3.png and /dev/null differ diff --git a/src/frontend/public/captchas/30.png b/src/frontend/public/captchas/30.png deleted file mode 100644 index c9537f2..0000000 Binary files a/src/frontend/public/captchas/30.png and /dev/null differ diff --git a/src/frontend/public/captchas/31.png b/src/frontend/public/captchas/31.png deleted file mode 100644 index 2f5caa2..0000000 Binary files a/src/frontend/public/captchas/31.png and /dev/null differ diff --git a/src/frontend/public/captchas/32.png b/src/frontend/public/captchas/32.png deleted file mode 100644 index 1d0c5b5..0000000 Binary files a/src/frontend/public/captchas/32.png and /dev/null differ diff --git a/src/frontend/public/captchas/33.png b/src/frontend/public/captchas/33.png deleted file mode 100644 index b6ae730..0000000 Binary files a/src/frontend/public/captchas/33.png and /dev/null differ diff --git a/src/frontend/public/captchas/34.png b/src/frontend/public/captchas/34.png deleted file mode 100644 index 34569bd..0000000 Binary files a/src/frontend/public/captchas/34.png and /dev/null differ diff --git a/src/frontend/public/captchas/35.png b/src/frontend/public/captchas/35.png deleted file mode 100644 index 71be3c7..0000000 Binary files a/src/frontend/public/captchas/35.png and /dev/null differ diff --git a/src/frontend/public/captchas/36.png b/src/frontend/public/captchas/36.png deleted file mode 100644 index cfeb232..0000000 Binary files a/src/frontend/public/captchas/36.png and /dev/null differ diff --git a/src/frontend/public/captchas/37.png b/src/frontend/public/captchas/37.png deleted file mode 100644 index 40fa042..0000000 Binary files a/src/frontend/public/captchas/37.png and /dev/null differ diff --git a/src/frontend/public/captchas/38.png b/src/frontend/public/captchas/38.png deleted file mode 100644 index 4b801bf..0000000 Binary files a/src/frontend/public/captchas/38.png and /dev/null differ diff --git a/src/frontend/public/captchas/39.png b/src/frontend/public/captchas/39.png deleted file mode 100644 index 77d4dcb..0000000 Binary files a/src/frontend/public/captchas/39.png and /dev/null differ diff --git a/src/frontend/public/captchas/4.png b/src/frontend/public/captchas/4.png deleted file mode 100644 index c573db3..0000000 Binary files a/src/frontend/public/captchas/4.png and /dev/null differ diff --git a/src/frontend/public/captchas/40.png b/src/frontend/public/captchas/40.png deleted file mode 100644 index f1b19a8..0000000 Binary files a/src/frontend/public/captchas/40.png and /dev/null differ diff --git a/src/frontend/public/captchas/41.png b/src/frontend/public/captchas/41.png deleted file mode 100644 index fa9550e..0000000 Binary files a/src/frontend/public/captchas/41.png and /dev/null differ diff --git a/src/frontend/public/captchas/42.png b/src/frontend/public/captchas/42.png deleted file mode 100644 index ef1408d..0000000 Binary files a/src/frontend/public/captchas/42.png and /dev/null differ diff --git a/src/frontend/public/captchas/43.png b/src/frontend/public/captchas/43.png deleted file mode 100644 index ef364e6..0000000 Binary files a/src/frontend/public/captchas/43.png and /dev/null differ diff --git a/src/frontend/public/captchas/44.png b/src/frontend/public/captchas/44.png deleted file mode 100644 index 4f78318..0000000 Binary files a/src/frontend/public/captchas/44.png and /dev/null differ diff --git a/src/frontend/public/captchas/45.png b/src/frontend/public/captchas/45.png deleted file mode 100644 index 2b5baa3..0000000 Binary files a/src/frontend/public/captchas/45.png and /dev/null differ diff --git a/src/frontend/public/captchas/46.png b/src/frontend/public/captchas/46.png deleted file mode 100644 index 58ea37b..0000000 Binary files a/src/frontend/public/captchas/46.png and /dev/null differ diff --git a/src/frontend/public/captchas/47.png b/src/frontend/public/captchas/47.png deleted file mode 100644 index 44b00a4..0000000 Binary files a/src/frontend/public/captchas/47.png and /dev/null differ diff --git a/src/frontend/public/captchas/48.png b/src/frontend/public/captchas/48.png deleted file mode 100644 index 9423f04..0000000 Binary files a/src/frontend/public/captchas/48.png and /dev/null differ diff --git a/src/frontend/public/captchas/49.png b/src/frontend/public/captchas/49.png deleted file mode 100644 index c0af1e8..0000000 Binary files a/src/frontend/public/captchas/49.png and /dev/null differ diff --git a/src/frontend/public/captchas/5.png b/src/frontend/public/captchas/5.png deleted file mode 100644 index 90a7034..0000000 Binary files a/src/frontend/public/captchas/5.png and /dev/null differ diff --git a/src/frontend/public/captchas/50.png b/src/frontend/public/captchas/50.png deleted file mode 100644 index 7992586..0000000 Binary files a/src/frontend/public/captchas/50.png and /dev/null differ diff --git a/src/frontend/public/captchas/51.png b/src/frontend/public/captchas/51.png deleted file mode 100644 index 12375b9..0000000 Binary files a/src/frontend/public/captchas/51.png and /dev/null differ diff --git a/src/frontend/public/captchas/52.png b/src/frontend/public/captchas/52.png deleted file mode 100644 index 78c6ae5..0000000 Binary files a/src/frontend/public/captchas/52.png and /dev/null differ diff --git a/src/frontend/public/captchas/53.png b/src/frontend/public/captchas/53.png deleted file mode 100644 index 92cfee0..0000000 Binary files a/src/frontend/public/captchas/53.png and /dev/null differ diff --git a/src/frontend/public/captchas/54.png b/src/frontend/public/captchas/54.png deleted file mode 100644 index 9da4cda..0000000 Binary files a/src/frontend/public/captchas/54.png and /dev/null differ diff --git a/src/frontend/public/captchas/55.png b/src/frontend/public/captchas/55.png deleted file mode 100644 index 1a7956e..0000000 Binary files a/src/frontend/public/captchas/55.png and /dev/null differ diff --git a/src/frontend/public/captchas/56.png b/src/frontend/public/captchas/56.png deleted file mode 100644 index 1164c9d..0000000 Binary files a/src/frontend/public/captchas/56.png and /dev/null differ diff --git a/src/frontend/public/captchas/57.png b/src/frontend/public/captchas/57.png deleted file mode 100644 index fd0bf3e..0000000 Binary files a/src/frontend/public/captchas/57.png and /dev/null differ diff --git a/src/frontend/public/captchas/58.png b/src/frontend/public/captchas/58.png deleted file mode 100644 index 0121d3a..0000000 Binary files a/src/frontend/public/captchas/58.png and /dev/null differ diff --git a/src/frontend/public/captchas/59.png b/src/frontend/public/captchas/59.png deleted file mode 100644 index 5a140db..0000000 Binary files a/src/frontend/public/captchas/59.png and /dev/null differ diff --git a/src/frontend/public/captchas/6.png b/src/frontend/public/captchas/6.png deleted file mode 100644 index 59f736d..0000000 Binary files a/src/frontend/public/captchas/6.png and /dev/null differ diff --git a/src/frontend/public/captchas/60.png b/src/frontend/public/captchas/60.png deleted file mode 100644 index 85bc4ed..0000000 Binary files a/src/frontend/public/captchas/60.png and /dev/null differ diff --git a/src/frontend/public/captchas/61.png b/src/frontend/public/captchas/61.png deleted file mode 100644 index b69618a..0000000 Binary files a/src/frontend/public/captchas/61.png and /dev/null differ diff --git a/src/frontend/public/captchas/62.png b/src/frontend/public/captchas/62.png deleted file mode 100644 index 2e472df..0000000 Binary files a/src/frontend/public/captchas/62.png and /dev/null differ diff --git a/src/frontend/public/captchas/63.png b/src/frontend/public/captchas/63.png deleted file mode 100644 index 10d730b..0000000 Binary files a/src/frontend/public/captchas/63.png and /dev/null differ diff --git a/src/frontend/public/captchas/64.png b/src/frontend/public/captchas/64.png deleted file mode 100644 index 331e129..0000000 Binary files a/src/frontend/public/captchas/64.png and /dev/null differ diff --git a/src/frontend/public/captchas/65.png b/src/frontend/public/captchas/65.png deleted file mode 100644 index 3871a37..0000000 Binary files a/src/frontend/public/captchas/65.png and /dev/null differ diff --git a/src/frontend/public/captchas/66.png b/src/frontend/public/captchas/66.png deleted file mode 100644 index 6d7a6ee..0000000 Binary files a/src/frontend/public/captchas/66.png and /dev/null differ diff --git a/src/frontend/public/captchas/67.png b/src/frontend/public/captchas/67.png deleted file mode 100644 index 90d1ec9..0000000 Binary files a/src/frontend/public/captchas/67.png and /dev/null differ diff --git a/src/frontend/public/captchas/68.png b/src/frontend/public/captchas/68.png deleted file mode 100644 index d26f117..0000000 Binary files a/src/frontend/public/captchas/68.png and /dev/null differ diff --git a/src/frontend/public/captchas/69.png b/src/frontend/public/captchas/69.png deleted file mode 100644 index b79be25..0000000 Binary files a/src/frontend/public/captchas/69.png and /dev/null differ diff --git a/src/frontend/public/captchas/7.png b/src/frontend/public/captchas/7.png deleted file mode 100644 index 5182763..0000000 Binary files a/src/frontend/public/captchas/7.png and /dev/null differ diff --git a/src/frontend/public/captchas/70.png b/src/frontend/public/captchas/70.png deleted file mode 100644 index 53765c6..0000000 Binary files a/src/frontend/public/captchas/70.png and /dev/null differ diff --git a/src/frontend/public/captchas/71.png b/src/frontend/public/captchas/71.png deleted file mode 100644 index a683f9d..0000000 Binary files a/src/frontend/public/captchas/71.png and /dev/null differ diff --git a/src/frontend/public/captchas/72.png b/src/frontend/public/captchas/72.png deleted file mode 100644 index 5cf94ad..0000000 Binary files a/src/frontend/public/captchas/72.png and /dev/null differ diff --git a/src/frontend/public/captchas/73.png b/src/frontend/public/captchas/73.png deleted file mode 100644 index e3447a7..0000000 Binary files a/src/frontend/public/captchas/73.png and /dev/null differ diff --git a/src/frontend/public/captchas/74.png b/src/frontend/public/captchas/74.png deleted file mode 100644 index 64ef876..0000000 Binary files a/src/frontend/public/captchas/74.png and /dev/null differ diff --git a/src/frontend/public/captchas/75.png b/src/frontend/public/captchas/75.png deleted file mode 100644 index d6d95ec..0000000 Binary files a/src/frontend/public/captchas/75.png and /dev/null differ diff --git a/src/frontend/public/captchas/76.png b/src/frontend/public/captchas/76.png deleted file mode 100644 index 272276e..0000000 Binary files a/src/frontend/public/captchas/76.png and /dev/null differ diff --git a/src/frontend/public/captchas/77.png b/src/frontend/public/captchas/77.png deleted file mode 100644 index ea0f234..0000000 Binary files a/src/frontend/public/captchas/77.png and /dev/null differ diff --git a/src/frontend/public/captchas/78.png b/src/frontend/public/captchas/78.png deleted file mode 100644 index 003b88f..0000000 Binary files a/src/frontend/public/captchas/78.png and /dev/null differ diff --git a/src/frontend/public/captchas/79.png b/src/frontend/public/captchas/79.png deleted file mode 100644 index 50dfb6b..0000000 Binary files a/src/frontend/public/captchas/79.png and /dev/null differ diff --git a/src/frontend/public/captchas/8.png b/src/frontend/public/captchas/8.png deleted file mode 100644 index 2d536ea..0000000 Binary files a/src/frontend/public/captchas/8.png and /dev/null differ diff --git a/src/frontend/public/captchas/80.png b/src/frontend/public/captchas/80.png deleted file mode 100644 index 25688a5..0000000 Binary files a/src/frontend/public/captchas/80.png and /dev/null differ diff --git a/src/frontend/public/captchas/81.png b/src/frontend/public/captchas/81.png deleted file mode 100644 index 1675ca7..0000000 Binary files a/src/frontend/public/captchas/81.png and /dev/null differ diff --git a/src/frontend/public/captchas/82.png b/src/frontend/public/captchas/82.png deleted file mode 100644 index 43ccdf3..0000000 Binary files a/src/frontend/public/captchas/82.png and /dev/null differ diff --git a/src/frontend/public/captchas/83.png b/src/frontend/public/captchas/83.png deleted file mode 100644 index 78dcc27..0000000 Binary files a/src/frontend/public/captchas/83.png and /dev/null differ diff --git a/src/frontend/public/captchas/84.png b/src/frontend/public/captchas/84.png deleted file mode 100644 index 3ffcbf6..0000000 Binary files a/src/frontend/public/captchas/84.png and /dev/null differ diff --git a/src/frontend/public/captchas/85.png b/src/frontend/public/captchas/85.png deleted file mode 100644 index a63d37c..0000000 Binary files a/src/frontend/public/captchas/85.png and /dev/null differ diff --git a/src/frontend/public/captchas/86.png b/src/frontend/public/captchas/86.png deleted file mode 100644 index 5689be0..0000000 Binary files a/src/frontend/public/captchas/86.png and /dev/null differ diff --git a/src/frontend/public/captchas/87.png b/src/frontend/public/captchas/87.png deleted file mode 100644 index 56299cc..0000000 Binary files a/src/frontend/public/captchas/87.png and /dev/null differ diff --git a/src/frontend/public/captchas/88.png b/src/frontend/public/captchas/88.png deleted file mode 100644 index 3f3659a..0000000 Binary files a/src/frontend/public/captchas/88.png and /dev/null differ diff --git a/src/frontend/public/captchas/89.png b/src/frontend/public/captchas/89.png deleted file mode 100644 index 119b150..0000000 Binary files a/src/frontend/public/captchas/89.png and /dev/null differ diff --git a/src/frontend/public/captchas/9.png b/src/frontend/public/captchas/9.png deleted file mode 100644 index 8beccac..0000000 Binary files a/src/frontend/public/captchas/9.png and /dev/null differ diff --git a/src/frontend/public/captchas/90.png b/src/frontend/public/captchas/90.png deleted file mode 100644 index 442a4a3..0000000 Binary files a/src/frontend/public/captchas/90.png and /dev/null differ diff --git a/src/frontend/public/captchas/91.png b/src/frontend/public/captchas/91.png deleted file mode 100644 index 1118351..0000000 Binary files a/src/frontend/public/captchas/91.png and /dev/null differ diff --git a/src/frontend/public/captchas/92.png b/src/frontend/public/captchas/92.png deleted file mode 100644 index d44ad17..0000000 Binary files a/src/frontend/public/captchas/92.png and /dev/null differ diff --git a/src/frontend/public/captchas/93.png b/src/frontend/public/captchas/93.png deleted file mode 100644 index 12f173a..0000000 Binary files a/src/frontend/public/captchas/93.png and /dev/null differ diff --git a/src/frontend/public/captchas/94.png b/src/frontend/public/captchas/94.png deleted file mode 100644 index 55b39b0..0000000 Binary files a/src/frontend/public/captchas/94.png and /dev/null differ diff --git a/src/frontend/public/captchas/95.png b/src/frontend/public/captchas/95.png deleted file mode 100644 index e2f957b..0000000 Binary files a/src/frontend/public/captchas/95.png and /dev/null differ diff --git a/src/frontend/public/captchas/96.png b/src/frontend/public/captchas/96.png deleted file mode 100644 index 4907ad6..0000000 Binary files a/src/frontend/public/captchas/96.png and /dev/null differ diff --git a/src/frontend/public/captchas/97.png b/src/frontend/public/captchas/97.png deleted file mode 100644 index 3526df6..0000000 Binary files a/src/frontend/public/captchas/97.png and /dev/null differ diff --git a/src/frontend/public/captchas/98.png b/src/frontend/public/captchas/98.png deleted file mode 100644 index 3efa22c..0000000 Binary files a/src/frontend/public/captchas/98.png and /dev/null differ diff --git a/src/frontend/public/captchas/99.png b/src/frontend/public/captchas/99.png deleted file mode 100644 index 0d68b18..0000000 Binary files a/src/frontend/public/captchas/99.png and /dev/null differ diff --git a/src/frontend/src/app/App.routes.tsx b/src/frontend/src/app/App.routes.tsx index dac628b..ac4fa09 100644 --- a/src/frontend/src/app/App.routes.tsx +++ b/src/frontend/src/app/App.routes.tsx @@ -8,7 +8,6 @@ import { Login } from 'pages/Login/Login.controller' import { ResetPassword } from 'pages/ResetPassword/ResetPassword.controller' import { SignUp } from 'pages/SignUp/SignUp.controller' import { User } from 'pages/User/User.controller' -import { VerifyEmail } from 'pages/VerifyEmail/VerifyEmail.controller' import React from 'react' import { Route, Switch } from 'react-router-dom' @@ -23,9 +22,6 @@ export const AppRoutes = ({ location }: any) => ( - - - diff --git a/src/frontend/src/pages/Chapter/Chapter.components/Footer/Footer.view.tsx b/src/frontend/src/pages/Chapter/Chapter.components/Footer/Footer.view.tsx index 378f2d0..9bd8633 100644 --- a/src/frontend/src/pages/Chapter/Chapter.components/Footer/Footer.view.tsx +++ b/src/frontend/src/pages/Chapter/Chapter.components/Footer/Footer.view.tsx @@ -25,16 +25,6 @@ export const FooterView = () => { Next Chapter - - MADE WITH ♡ BY{' '} - - AYMERIC BETHENCOURT - {' '} - AND{' '} - - OCTO TECHNOLOGY - - ) } diff --git a/src/frontend/src/pages/ChapterAbout/ChapterAbout.data.tsx b/src/frontend/src/pages/ChapterAbout/ChapterAbout.data.tsx index 9dfb83d..5cad4c8 100644 --- a/src/frontend/src/pages/ChapterAbout/ChapterAbout.data.tsx +++ b/src/frontend/src/pages/ChapterAbout/ChapterAbout.data.tsx @@ -2,7 +2,7 @@ export const data = `#Chapter 1 : Tezos Academy Hello rookie! I'm admiral Adama. I hope you are ready for a fight. The Xenomorphs have been attacking our colonies for days now. We are throwing everything we’ve got at them, that means even you rookie, so you better learn and fast! You have been assigned to ship 020433, go ahead and board your ship. -Tezos Academy is a fun interactive tutorial developed by OCTO Technology on how to code smart contracts for Tezos. You are about to create spaceship battles smart contracts! +Tezos Academy is a fun interactive tutorial on how to code smart contracts for Tezos. You are about to create spaceship battles smart contracts! By default, Tezos smart contracts are written in Michelson, but it is an hard to learn low level formal language. For this tutorial, we will use LIGO instead. The syntax is high level and transpiles to Michelson. diff --git a/src/frontend/src/pages/Home/Home.view.tsx b/src/frontend/src/pages/Home/Home.view.tsx index b46139f..e0b7331 100644 --- a/src/frontend/src/pages/Home/Home.view.tsx +++ b/src/frontend/src/pages/Home/Home.view.tsx @@ -106,9 +106,6 @@ export const HomeView = () => { )} - - octo - @@ -204,54 +201,6 @@ export const HomeView = () => { - - - - - -
-

About Tezos Link

- - Support - - - Reddit - -
- - - octo -
-
) } diff --git a/src/frontend/src/pages/SignUp/SignUp.actions.tsx b/src/frontend/src/pages/SignUp/SignUp.actions.tsx index 34952c6..ef31d19 100644 --- a/src/frontend/src/pages/SignUp/SignUp.actions.tsx +++ b/src/frontend/src/pages/SignUp/SignUp.actions.tsx @@ -22,7 +22,7 @@ export const signUp = ({ email, password, confirmPassword, username, recaptchaTo commit: { type: SIGN_UP_COMMIT, meta: { - thunks: [showToaster(SUCCESS, `Welcome ${username}!`, 'Happy to see you'), redirect('/verify-email')], + thunks: [showToaster(SUCCESS, `Welcome ${username}!`, 'Happy to see you'), redirect('/')], }, }, rollback: { type: SIGN_UP_ROLLBACK }, diff --git a/src/frontend/src/pages/VerifyEmail/VerifyEmail.actions.tsx b/src/frontend/src/pages/VerifyEmail/VerifyEmail.actions.tsx deleted file mode 100644 index d8ed130..0000000 --- a/src/frontend/src/pages/VerifyEmail/VerifyEmail.actions.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { redirect } from 'app/App.actions' -import { showToaster } from 'app/App.components/Toaster/Toaster.actions' -import { SUCCESS } from 'app/App.components/Toaster/Toaster.constants' -import { State } from 'reducers' -import { VerifyEmailInputs } from 'shared/user/VerifyEmail' - -export const VERIFY_EMAIL_REQUEST = 'VERIFY_EMAIL_REQUEST' -export const VERIFY_EMAIL_COMMIT = 'VERIFY_EMAIL_COMMIT' -export const VERIFY_EMAIL_ROLLBACK = 'VERIFY_EMAIL_ROLLBACK' -export const verifyEmail = ({ solution }: VerifyEmailInputs) => (dispatch: any, getState: any) => { - const state: State = getState() - dispatch({ - type: VERIFY_EMAIL_REQUEST, - payload: {}, - meta: { - offline: { - effect: { - url: `${process.env.REACT_APP_BACKEND_URL}/user/verify-email`, - method: 'POST', - json: { solution }, - headers: { Authorization: `Bearer ${state.auth.jwt}` }, - }, - commit: { - type: VERIFY_EMAIL_COMMIT, - meta: { - thunks: [showToaster(SUCCESS, 'Email verified!', 'Thanks'), redirect('/')], - }, - }, - rollback: { type: VERIFY_EMAIL_ROLLBACK }, - }, - }, - }) -} diff --git a/src/frontend/src/pages/VerifyEmail/VerifyEmail.components/VerifyEmailResend/VerifyEmailResend.actions.tsx b/src/frontend/src/pages/VerifyEmail/VerifyEmail.components/VerifyEmailResend/VerifyEmailResend.actions.tsx deleted file mode 100644 index d772770..0000000 --- a/src/frontend/src/pages/VerifyEmail/VerifyEmail.components/VerifyEmailResend/VerifyEmailResend.actions.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { showToaster } from 'app/App.components/Toaster/Toaster.actions' -import { SUCCESS } from 'app/App.components/Toaster/Toaster.constants' -import { State } from 'reducers' - -export const GET_VERIFY_EMAIL_RESEND_REQUEST = 'GET_VERIFY_EMAIL_RESEND_REQUEST' -export const GET_VERIFY_EMAIL_RESEND_COMMIT = 'GET_VERIFY_EMAIL_RESEND_COMMIT' -export const GET_VERIFY_EMAIL_RESEND_ROLLBACK = 'GET_VERIFY_EMAIL_RESEND_ROLLBACK' - -export const resendVerifyEmail = () => (dispatch: any, getState: any) => { - const state: State = getState() - dispatch({ - type: GET_VERIFY_EMAIL_RESEND_REQUEST, - payload: {}, - meta: { - offline: { - effect: { - url: `${process.env.REACT_APP_BACKEND_URL}/user/resend-email-verification`, - method: 'POST', - headers: { Authorization: `Bearer ${state.auth.jwt}` }, - }, - commit: { - type: GET_VERIFY_EMAIL_RESEND_COMMIT, - meta: { - thunks: [showToaster(SUCCESS, 'Email sent!', 'Go check')], - }, - }, - rollback: { type: GET_VERIFY_EMAIL_RESEND_ROLLBACK }, - }, - }, - }) -} diff --git a/src/frontend/src/pages/VerifyEmail/VerifyEmail.components/VerifyEmailResend/VerifyEmailResend.controller.tsx b/src/frontend/src/pages/VerifyEmail/VerifyEmail.components/VerifyEmailResend/VerifyEmailResend.controller.tsx deleted file mode 100644 index 7807398..0000000 --- a/src/frontend/src/pages/VerifyEmail/VerifyEmail.components/VerifyEmailResend/VerifyEmailResend.controller.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import * as React from 'react' -import { useDispatch, useSelector } from 'react-redux' -import { State } from 'reducers' - -import { resendVerifyEmail } from './VerifyEmailResend.actions' -import { VerifyEmailResendView } from './VerifyEmailResend.view' - -export const VerifyEmailResend = () => { - const dispatch = useDispatch() - const loading = useSelector((state: State) => state.loading) - - const resendEmailCallback = () => { - dispatch(resendVerifyEmail()) - } - - return -} diff --git a/src/frontend/src/pages/VerifyEmail/VerifyEmail.components/VerifyEmailResend/VerifyEmailResend.style.tsx b/src/frontend/src/pages/VerifyEmail/VerifyEmail.components/VerifyEmailResend/VerifyEmailResend.style.tsx deleted file mode 100644 index 24d6021..0000000 --- a/src/frontend/src/pages/VerifyEmail/VerifyEmail.components/VerifyEmailResend/VerifyEmailResend.style.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import styled from 'styled-components/macro' -import { primaryColor, backgroundTextColor } from 'styles' - -export const VerifyEmailResendStyled = styled.div` - margin-top: 10px; - text-align: center; - color: ${primaryColor}; -` - -export const VerifyEmailResendActive = styled.div` - color: ${primaryColor}; - cursor: pointer; -` - -export const VerifyEmailResendInactive = styled.div` - color: ${backgroundTextColor}; -` diff --git a/src/frontend/src/pages/VerifyEmail/VerifyEmail.components/VerifyEmailResend/VerifyEmailResend.view.tsx b/src/frontend/src/pages/VerifyEmail/VerifyEmail.components/VerifyEmailResend/VerifyEmailResend.view.tsx deleted file mode 100644 index 7cacdc4..0000000 --- a/src/frontend/src/pages/VerifyEmail/VerifyEmail.components/VerifyEmailResend/VerifyEmailResend.view.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import * as PropTypes from 'prop-types' -import * as React from 'react' - -import { VerifyEmailResendStyled, VerifyEmailResendInactive, VerifyEmailResendActive } from './VerifyEmailResend.style' - -type VerifyEmailResendViewProps = { - loading: boolean - resendEmailCallback: () => void -} - -export const VerifyEmailResendView = ({ loading, resendEmailCallback }: VerifyEmailResendViewProps) => { - return ( - - {loading ? ( - Loading... - ) : ( - resendEmailCallback()}>Or send email again - )} - - ) -} - -VerifyEmailResendView.propTypes = { - loading: PropTypes.bool, - resendEmailCallback: PropTypes.func.isRequired, -} - -VerifyEmailResendView.defaultProps = { - loading: false, -} diff --git a/src/frontend/src/pages/VerifyEmail/VerifyEmail.controller.tsx b/src/frontend/src/pages/VerifyEmail/VerifyEmail.controller.tsx deleted file mode 100644 index 42cfb8f..0000000 --- a/src/frontend/src/pages/VerifyEmail/VerifyEmail.controller.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import * as React from 'react' -import { useState } from 'react' -import { useDispatch, useSelector } from 'react-redux' -import { VerifyEmailInputs } from 'shared/user/VerifyEmail' - -import { State } from '../../reducers' -import { verifyEmail } from './VerifyEmail.actions' -import { VerifyEmailView } from './VerifyEmail.view' - -export const VerifyEmail = () => { - const dispatch = useDispatch() - const loading = useSelector((state: State) => state.loading) - const [autoSubmitted, setAutoSubmitted] = useState(false) - - const verifyEmailCallback = async (verifyEmailInputs: VerifyEmailInputs) => { - setAutoSubmitted(true) - dispatch(verifyEmail({ ...verifyEmailInputs })) - } - - return -} diff --git a/src/frontend/src/pages/VerifyEmail/VerifyEmail.style.tsx b/src/frontend/src/pages/VerifyEmail/VerifyEmail.style.tsx deleted file mode 100644 index 2ec9d2d..0000000 --- a/src/frontend/src/pages/VerifyEmail/VerifyEmail.style.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import styled from 'styled-components/macro' - -import { backgroundColor, Card, CardPage, FadeInFromTop, primaryColor, borderColor } from '../../styles' - -export const VerifyEmailStyled = styled(CardPage)`` - -export const VerifyEmailCard = styled(Card)` - padding: 20px; -` - -export const VerifyEmailSeparator = styled.div` - height: 15px; -` - -export const VerifyEmailTitle = styled(FadeInFromTop)`` - -export const VerifyEmailFieldsContainer = styled.div` - display: flex; - align-items: center; - justify-content: space-between; -` - -export const VerifyEmailInput = styled.input` - width: 80px; - display: inline-block; - position: relative; - height: 50px; - font-size: 28px; - line-height: 28px; - text-align: center; - border-width: 1px; - border-style: solid; - border-color: ${borderColor}; - border-radius: 4px; - transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out; - will-change: border-color, box-shadow; - background-color: ${backgroundColor}; - - ::placeholder { - font-size: 28px; - } - - &::-webkit-inner-spin-button, - &::-webkit-outer-spin-button { - -webkit-appearance: none; - -moz-appearance: textfield; - margin: 0; - } - - &:hover { - border-color: ${primaryColor}7F; - } - - &:focus { - box-shadow: 0 0 0 2px ${primaryColor}19; - border-color: ${primaryColor}7F; - } -` diff --git a/src/frontend/src/pages/VerifyEmail/VerifyEmail.view.tsx b/src/frontend/src/pages/VerifyEmail/VerifyEmail.view.tsx deleted file mode 100644 index c722fee..0000000 --- a/src/frontend/src/pages/VerifyEmail/VerifyEmail.view.tsx +++ /dev/null @@ -1,148 +0,0 @@ -import { Button } from 'app/App.components/Button/Button.controller' -import * as PropTypes from 'prop-types' -import * as React from 'react' -import { SyntheticEvent, useState } from 'react' -import { useEffect, useRef } from 'react' -//prettier-ignore -import { VerifyEmailCard, VerifyEmailFieldsContainer, VerifyEmailInput, VerifyEmailSeparator, VerifyEmailStyled, VerifyEmailTitle } from './VerifyEmail.style' -import { VerifyEmailResend } from './VerifyEmail.components/VerifyEmailResend/VerifyEmailResend.controller' - -type VerifyEmailViewProps = { - verifyEmailCallback: (values: any) => void - loading: boolean - autoSubmitted: boolean -} - -export const VerifyEmailView = ({ verifyEmailCallback, loading, autoSubmitted }: VerifyEmailViewProps) => { - const [inputSolution, setInputSolution] = useState(['', '', '', '']) - - const firstRef = useRef(null) - const secondRef = useRef(null) - const thirdRef = useRef(null) - const fourthRef = useRef(null) - - useEffect(() => { - if ((!inputSolution[0] || inputSolution[0] === '') && firstRef && firstRef.current) { - setTimeout(() => { - firstRef?.current?.focus() - }, 1000) - } - if (inputSolution[0] && inputSolution[0] !== '' && secondRef && secondRef.current) { - secondRef.current.focus() - } - if (inputSolution[1] && inputSolution[1] !== '' && thirdRef && thirdRef.current) { - thirdRef.current.focus() - } - if (inputSolution[2] && inputSolution[2] !== '' && fourthRef && fourthRef.current) { - fourthRef.current.focus() - } - if ( - inputSolution[0] !== '' && - inputSolution[1] !== '' && - inputSolution[2] !== '' && - inputSolution[3] !== '' && - !autoSubmitted - ) { - verifyEmailCallback({ - solution: inputSolution.join(''), - }) - } - }, [inputSolution, verifyEmailCallback, autoSubmitted]) - - const handleSubmit = (event: SyntheticEvent) => { - event.preventDefault() - verifyEmailCallback({ - solution: inputSolution.join(''), - }) - } - - const setVal = (index: number, value: string): void => { - const inputSolutionTemp = inputSolution.slice(0, 4) - inputSolutionTemp[index] = value - setInputSolution(inputSolutionTemp) - } - - return ( - - -

Verify Email

-
- -
- - setVal(0, e.target.value)} - maxLength={1} - size={1} - autoComplete="off" - min="0" - max="9" - required - pattern="\d{1}" - ref={firstRef} - autoFocus={true} - /> - setVal(1, e.target.value)} - maxLength={1} - size={1} - autoComplete="off" - min="0" - max="9" - required - pattern="\d{1}" - ref={secondRef} - /> - setVal(2, e.target.value)} - maxLength={1} - size={1} - autoComplete="off" - min="0" - max="9" - required - pattern="\d{1}" - ref={thirdRef} - /> - setVal(3, e.target.value)} - maxLength={1} - size={1} - autoComplete="off" - min="0" - max="9" - required - pattern="\d{1}" - ref={fourthRef} - /> - - -