diff --git a/.env.example b/.env.example
index 5aa3b0b..68d2f53 100644
--- a/.env.example
+++ b/.env.example
@@ -1,4 +1,4 @@
PORT = 3000
DB_CONNECTION = "" --> TODO: put your own connection string here
TEST_DB = ""-->TODO: put your own testing database connection string here
-JWT_SECRET = ""-->TODO: put your own jsonwebtoken scret here
\ No newline at end of file
+JWT_SECRET = ""-->TODO: put your own jsonwebtoken scret here
diff --git a/.gitignore b/.gitignore
index 4b7dd0e..ea47b69 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
/node_modules
/.env
/package-lock.json
-/coverage
\ No newline at end of file
+/coverage
+/uploads
diff --git a/__test__/user.test.ts b/__test__/user.test.ts
index dac0f6e..4667375 100644
--- a/__test__/user.test.ts
+++ b/__test__/user.test.ts
@@ -14,9 +14,9 @@ const userData: any = {
};
const dummySeller = {
- name: "dummy1234",
- username: "username1234",
- email: "soleilcyber00@gmail.com",
+ name: "dummy",
+ username: "username",
+ email: "niyonkurubertin50@gmail.com",
password: "1234567890",
role: "seller",
};
@@ -94,7 +94,7 @@ describe("Testing user Routes", () => {
spyonOne.mockRestore();
}, 20000);
- test("Should send otp verification code", async () => {
+ test.skip("Should send otp verification code", async () => {
const spy = jest.spyOn(mailServices, "sendEmailService");
const response = await request(app).post("/api/v1/users/login").send({
email: dummySeller.email,
@@ -104,7 +104,6 @@ describe("Testing user Routes", () => {
expect(response.body.message).toBe("OTP verification code has been sent ,please use it to verify that it was you");
// expect(spy).toHaveBeenCalled();
}, 40000);
-
test("should log a user in to retrieve a token", async () => {
const response = await request(app).post("/api/v1/users/login").send({
email: userData.email,
diff --git a/coverage/clover.xml b/coverage/clover.xml
new file mode 100644
index 0000000..328491b
--- /dev/null
+++ b/coverage/clover.xml
@@ -0,0 +1,401 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/coverage/coverage-final.json b/coverage/coverage-final.json
new file mode 100644
index 0000000..af9bf4b
--- /dev/null
+++ b/coverage/coverage-final.json
@@ -0,0 +1,25 @@
+{"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\types.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\types.ts","statementMap":{"0":{"start":{"line":12,"column":0},"end":{"line":12,"column":null}},"1":{"start":{"line":13,"column":2},"end":{"line":13,"column":null}},"2":{"start":{"line":14,"column":2},"end":{"line":14,"column":null}},"3":{"start":{"line":15,"column":2},"end":{"line":15,"column":null}},"4":{"start":{"line":16,"column":2},"end":{"line":16,"column":null}},"5":{"start":{"line":19,"column":0},"end":{"line":19,"column":null}},"6":{"start":{"line":20,"column":2},"end":{"line":20,"column":null}},"7":{"start":{"line":21,"column":2},"end":{"line":21,"column":null}},"8":{"start":{"line":22,"column":2},"end":{"line":22,"column":null}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":12,"column":0},"end":{"line":12,"column":12}},"loc":{"start":{"line":12,"column":20},"end":{"line":17,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":19,"column":0},"end":{"line":19,"column":12}},"loc":{"start":{"line":19,"column":18},"end":{"line":23,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":12,"column":12},"end":{"line":12,"column":null}},"type":"binary-expr","locations":[{"start":{"line":12,"column":12},"end":{"line":12,"column":20}},{"start":{"line":12,"column":20},"end":{"line":12,"column":null}}]},"1":{"loc":{"start":{"line":19,"column":12},"end":{"line":19,"column":null}},"type":"binary-expr","locations":[{"start":{"line":19,"column":12},"end":{"line":19,"column":18}},{"start":{"line":19,"column":18},"end":{"line":19,"column":null}}]}},"s":{"0":2,"1":2,"2":2,"3":2,"4":2,"5":2,"6":2,"7":2,"8":2},"f":{"0":2,"1":2},"b":{"0":[2,2],"1":[2,2]}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\config\\dbConnection.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\config\\dbConnection.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":38}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":35}},"2":{"start":{"line":4,"column":13},"end":{"line":4,"column":33}},"3":{"start":{"line":6,"column":18},"end":{"line":8,"column":2}},"4":{"start":{"line":10,"column":23},"end":{"line":18,"column":2}},"5":{"start":{"line":10,"column":34},"end":{"line":18,"column":2}},"6":{"start":{"line":11,"column":2},"end":{"line":17,"column":3}},"7":{"start":{"line":12,"column":4},"end":{"line":12,"column":35}},"8":{"start":{"line":13,"column":4},"end":{"line":13,"column":49}},"9":{"start":{"line":15,"column":4},"end":{"line":15,"column":42}},"10":{"start":{"line":16,"column":4},"end":{"line":16,"column":11}},"11":{"start":{"line":10,"column":13},"end":{"line":10,"column":23}},"12":{"start":{"line":20,"column":0},"end":{"line":20,"column":25}}},"fnMap":{"0":{"name":"(anonymous_7)","decl":{"start":{"line":10,"column":23},"end":{"line":10,"column":32}},"loc":{"start":{"line":10,"column":34},"end":{"line":18,"column":2}}},"1":{"name":"(anonymous_8)","decl":{"start":{"line":10,"column":34},"end":{"line":10,"column":null}},"loc":{"start":{"line":10,"column":34},"end":{"line":18,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":6,"column":32},"end":{"line":6,"column":78}},"type":"cond-expr","locations":[{"start":{"line":6,"column":50},"end":{"line":6,"column":65}},{"start":{"line":6,"column":68},"end":{"line":6,"column":78}}]}},"s":{"0":2,"1":2,"2":2,"3":2,"4":2,"5":2,"6":2,"7":2,"8":2,"9":0,"10":0,"11":2,"12":2},"f":{"0":2,"1":2},"b":{"0":[2,0]}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\controllers\\userControllers.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\controllers\\userControllers.ts","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":2,"column":56}},"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":54}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":56}},"3":{"start":{"line":5,"column":0},"end":{"line":5,"column":51}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":60}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":56}},"6":{"start":{"line":8,"column":0},"end":{"line":8,"column":97}},"7":{"start":{"line":9,"column":0},"end":{"line":9,"column":55}},"8":{"start":{"line":10,"column":0},"end":{"line":10,"column":67}},"9":{"start":{"line":11,"column":0},"end":{"line":11,"column":45}},"10":{"start":{"line":12,"column":0},"end":{"line":12,"column":65}},"11":{"start":{"line":14,"column":29},"end":{"line":35,"column":2}},"12":{"start":{"line":14,"column":67},"end":{"line":35,"column":2}},"13":{"start":{"line":15,"column":2},"end":{"line":34,"column":3}},"14":{"start":{"line":16,"column":18},"end":{"line":16,"column":49}},"15":{"start":{"line":18,"column":4},"end":{"line":28,"column":5}},"16":{"start":{"line":19,"column":6},"end":{"line":21,"column":9}},"17":{"start":{"line":23,"column":6},"end":{"line":27,"column":9}},"18":{"start":{"line":30,"column":4},"end":{"line":33,"column":7}},"19":{"start":{"line":14,"column":13},"end":{"line":14,"column":29}},"20":{"start":{"line":37,"column":25},"end":{"line":73,"column":2}},"21":{"start":{"line":37,"column":63},"end":{"line":73,"column":2}},"22":{"start":{"line":38,"column":30},"end":{"line":38,"column":38}},"23":{"start":{"line":39,"column":22},"end":{"line":39,"column":47}},"24":{"start":{"line":41,"column":2},"end":{"line":72,"column":3}},"25":{"start":{"line":42,"column":4},"end":{"line":45,"column":7}},"26":{"start":{"line":47,"column":4},"end":{"line":47,"column":44}},"27":{"start":{"line":48,"column":18},"end":{"line":48,"column":65}},"28":{"start":{"line":49,"column":4},"end":{"line":71,"column":5}},"29":{"start":{"line":50,"column":6},"end":{"line":53,"column":9}},"30":{"start":{"line":55,"column":6},"end":{"line":70,"column":7}},"31":{"start":{"line":56,"column":22},"end":{"line":56,"column":63}},"32":{"start":{"line":58,"column":8},"end":{"line":58,"column":62}},"33":{"start":{"line":59,"column":8},"end":{"line":59,"column":104}},"34":{"start":{"line":60,"column":8},"end":{"line":63,"column":11}},"35":{"start":{"line":65,"column":8},"end":{"line":69,"column":11}},"36":{"start":{"line":37,"column":13},"end":{"line":37,"column":25}},"37":{"start":{"line":75,"column":36},"end":{"line":96,"column":2}},"38":{"start":{"line":75,"column":74},"end":{"line":96,"column":2}},"39":{"start":{"line":76,"column":2},"end":{"line":95,"column":3}},"40":{"start":{"line":77,"column":54},"end":{"line":77,"column":62}},"41":{"start":{"line":78,"column":17},"end":{"line":78,"column":79}},"42":{"start":{"line":79,"column":4},"end":{"line":84,"column":5}},"43":{"start":{"line":80,"column":6},"end":{"line":83,"column":9}},"44":{"start":{"line":85,"column":4},"end":{"line":89,"column":7}},"45":{"start":{"line":91,"column":4},"end":{"line":93,"column":5}},"46":{"start":{"line":92,"column":6},"end":{"line":92,"column":68}},"47":{"start":{"line":94,"column":4},"end":{"line":94,"column":48}},"48":{"start":{"line":75,"column":13},"end":{"line":75,"column":36}},"49":{"start":{"line":98,"column":30},"end":{"line":127,"column":2}},"50":{"start":{"line":98,"column":68},"end":{"line":127,"column":2}},"51":{"start":{"line":99,"column":56},"end":{"line":99,"column":64}},"52":{"start":{"line":100,"column":2},"end":{"line":126,"column":3}},"53":{"start":{"line":102,"column":17},"end":{"line":102,"column":53}},"54":{"start":{"line":103,"column":4},"end":{"line":105,"column":5}},"55":{"start":{"line":104,"column":6},"end":{"line":104,"column":65}},"56":{"start":{"line":106,"column":28},"end":{"line":106,"column":78}},"57":{"start":{"line":107,"column":4},"end":{"line":109,"column":5}},"58":{"start":{"line":108,"column":6},"end":{"line":108,"column":76}},"59":{"start":{"line":111,"column":4},"end":{"line":113,"column":5}},"60":{"start":{"line":112,"column":6},"end":{"line":112,"column":97}},"61":{"start":{"line":115,"column":4},"end":{"line":117,"column":5}},"62":{"start":{"line":116,"column":6},"end":{"line":116,"column":116}},"63":{"start":{"line":119,"column":21},"end":{"line":119,"column":54}},"64":{"start":{"line":120,"column":4},"end":{"line":120,"column":45}},"65":{"start":{"line":121,"column":4},"end":{"line":121,"column":78}},"66":{"start":{"line":123,"column":4},"end":{"line":125,"column":7}},"67":{"start":{"line":98,"column":13},"end":{"line":98,"column":30}},"68":{"start":{"line":129,"column":33},"end":{"line":166,"column":2}},"69":{"start":{"line":129,"column":67},"end":{"line":166,"column":2}},"70":{"start":{"line":130,"column":38},"end":{"line":130,"column":47}},"71":{"start":{"line":132,"column":2},"end":{"line":165,"column":3}},"72":{"start":{"line":133,"column":30},"end":{"line":133,"column":79}},"73":{"start":{"line":134,"column":24},"end":{"line":134,"column":44}},"74":{"start":{"line":135,"column":27},"end":{"line":135,"column":58}},"75":{"start":{"line":137,"column":4},"end":{"line":142,"column":5}},"76":{"start":{"line":138,"column":6},"end":{"line":138,"column":68}},"77":{"start":{"line":139,"column":6},"end":{"line":141,"column":9}},"78":{"start":{"line":144,"column":31},"end":{"line":144,"column":87}},"79":{"start":{"line":146,"column":4},"end":{"line":160,"column":5}},"80":{"start":{"line":147,"column":20},"end":{"line":147,"column":45}},"81":{"start":{"line":149,"column":6},"end":{"line":149,"column":68}},"82":{"start":{"line":151,"column":6},"end":{"line":155,"column":9}},"83":{"start":{"line":157,"column":6},"end":{"line":159,"column":9}},"84":{"start":{"line":162,"column":4},"end":{"line":164,"column":7}},"85":{"start":{"line":129,"column":13},"end":{"line":129,"column":33}}},"fnMap":{"0":{"name":"(anonymous_14)","decl":{"start":{"line":14,"column":29},"end":{"line":14,"column":36}},"loc":{"start":{"line":14,"column":67},"end":{"line":35,"column":2}}},"1":{"name":"(anonymous_15)","decl":{"start":{"line":14,"column":67},"end":{"line":14,"column":null}},"loc":{"start":{"line":14,"column":67},"end":{"line":35,"column":1}}},"2":{"name":"(anonymous_16)","decl":{"start":{"line":37,"column":25},"end":{"line":37,"column":32}},"loc":{"start":{"line":37,"column":63},"end":{"line":73,"column":2}}},"3":{"name":"(anonymous_17)","decl":{"start":{"line":37,"column":63},"end":{"line":37,"column":null}},"loc":{"start":{"line":37,"column":63},"end":{"line":73,"column":1}}},"4":{"name":"(anonymous_18)","decl":{"start":{"line":75,"column":36},"end":{"line":75,"column":43}},"loc":{"start":{"line":75,"column":74},"end":{"line":96,"column":2}}},"5":{"name":"(anonymous_19)","decl":{"start":{"line":75,"column":74},"end":{"line":75,"column":null}},"loc":{"start":{"line":75,"column":74},"end":{"line":96,"column":1}}},"6":{"name":"(anonymous_20)","decl":{"start":{"line":98,"column":30},"end":{"line":98,"column":37}},"loc":{"start":{"line":98,"column":68},"end":{"line":127,"column":2}}},"7":{"name":"(anonymous_21)","decl":{"start":{"line":98,"column":68},"end":{"line":98,"column":null}},"loc":{"start":{"line":98,"column":68},"end":{"line":127,"column":1}}},"8":{"name":"(anonymous_22)","decl":{"start":{"line":129,"column":33},"end":{"line":129,"column":40}},"loc":{"start":{"line":129,"column":67},"end":{"line":166,"column":2}}},"9":{"name":"(anonymous_23)","decl":{"start":{"line":129,"column":67},"end":{"line":129,"column":null}},"loc":{"start":{"line":129,"column":67},"end":{"line":166,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":18,"column":4},"end":{"line":28,"column":5}},"type":"if","locations":[{"start":{"line":18,"column":4},"end":{"line":28,"column":5}},{"start":{"line":22,"column":11},"end":{"line":28,"column":5}}]},"1":{"loc":{"start":{"line":41,"column":2},"end":{"line":72,"column":3}},"type":"if","locations":[{"start":{"line":41,"column":2},"end":{"line":72,"column":3}},{"start":{"line":46,"column":9},"end":{"line":72,"column":3}}]},"2":{"loc":{"start":{"line":41,"column":6},"end":{"line":41,"column":28}},"type":"binary-expr","locations":[{"start":{"line":41,"column":6},"end":{"line":41,"column":11}},{"start":{"line":41,"column":15},"end":{"line":41,"column":28}}]},"3":{"loc":{"start":{"line":49,"column":4},"end":{"line":71,"column":5}},"type":"if","locations":[{"start":{"line":49,"column":4},"end":{"line":71,"column":5}},{"start":{"line":54,"column":11},"end":{"line":71,"column":5}}]},"4":{"loc":{"start":{"line":55,"column":6},"end":{"line":70,"column":7}},"type":"if","locations":[{"start":{"line":55,"column":6},"end":{"line":70,"column":7}},{"start":{"line":64,"column":13},"end":{"line":70,"column":7}}]},"5":{"loc":{"start":{"line":79,"column":4},"end":{"line":84,"column":5}},"type":"if","locations":[{"start":{"line":79,"column":4},"end":{"line":84,"column":5}}]},"6":{"loc":{"start":{"line":79,"column":8},"end":{"line":79,"column":29}},"type":"binary-expr","locations":[{"start":{"line":79,"column":8},"end":{"line":79,"column":13}},{"start":{"line":79,"column":17},"end":{"line":79,"column":29}}]},"7":{"loc":{"start":{"line":91,"column":4},"end":{"line":93,"column":5}},"type":"if","locations":[{"start":{"line":91,"column":4},"end":{"line":93,"column":5}}]},"8":{"loc":{"start":{"line":91,"column":8},"end":{"line":91,"column":81}},"type":"binary-expr","locations":[{"start":{"line":91,"column":8},"end":{"line":91,"column":40}},{"start":{"line":91,"column":44},"end":{"line":91,"column":81}}]},"9":{"loc":{"start":{"line":103,"column":4},"end":{"line":105,"column":5}},"type":"if","locations":[{"start":{"line":103,"column":4},"end":{"line":105,"column":5}}]},"10":{"loc":{"start":{"line":107,"column":4},"end":{"line":109,"column":5}},"type":"if","locations":[{"start":{"line":107,"column":4},"end":{"line":109,"column":5}}]},"11":{"loc":{"start":{"line":111,"column":4},"end":{"line":113,"column":5}},"type":"if","locations":[{"start":{"line":111,"column":4},"end":{"line":113,"column":5}}]},"12":{"loc":{"start":{"line":115,"column":4},"end":{"line":117,"column":5}},"type":"if","locations":[{"start":{"line":115,"column":4},"end":{"line":117,"column":5}}]},"13":{"loc":{"start":{"line":133,"column":46},"end":{"line":133,"column":67}},"type":"cond-expr","locations":[{"start":{"line":133,"column":56},"end":{"line":133,"column":58}},{"start":{"line":133,"column":46},"end":{"line":133,"column":67}}]},"14":{"loc":{"start":{"line":133,"column":46},"end":{"line":133,"column":58}},"type":"binary-expr","locations":[{"start":{"line":133,"column":46},"end":{"line":133,"column":58}},{"start":{"line":133,"column":46},"end":{"line":133,"column":58}}]},"15":{"loc":{"start":{"line":137,"column":4},"end":{"line":142,"column":5}},"type":"if","locations":[{"start":{"line":137,"column":4},"end":{"line":142,"column":5}}]},"16":{"loc":{"start":{"line":146,"column":4},"end":{"line":160,"column":5}},"type":"if","locations":[{"start":{"line":146,"column":4},"end":{"line":160,"column":5}},{"start":{"line":156,"column":11},"end":{"line":160,"column":5}}]}},"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":1,"13":1,"14":1,"15":1,"16":0,"17":1,"18":0,"19":2,"20":2,"21":2,"22":2,"23":2,"24":2,"25":0,"26":2,"27":2,"28":2,"29":1,"30":1,"31":0,"32":0,"33":0,"34":0,"35":1,"36":2,"37":2,"38":3,"39":3,"40":3,"41":3,"42":3,"43":1,"44":2,"45":0,"46":0,"47":0,"48":2,"49":2,"50":3,"51":3,"52":3,"53":3,"54":3,"55":0,"56":3,"57":3,"58":1,"59":2,"60":1,"61":1,"62":0,"63":1,"64":1,"65":1,"66":0,"67":2,"68":2,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":2},"f":{"0":1,"1":1,"2":2,"3":2,"4":3,"5":3,"6":3,"7":3,"8":0,"9":0},"b":{"0":[0,1],"1":[0,2],"2":[2,2],"3":[1,1],"4":[0,1],"5":[1],"6":[3,2],"7":[0],"8":[0,0],"9":[0],"10":[1],"11":[1],"12":[0],"13":[0,0],"14":[0,0],"15":[0],"16":[0,0]}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\docs\\swagger.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\docs\\swagger.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":50}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":35}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":140}},"4":{"start":{"line":6,"column":18},"end":{"line":6,"column":34}},"5":{"start":{"line":8,"column":16},"end":{"line":70,"column":2}},"6":{"start":{"line":72,"column":0},"end":{"line":72,"column":42}},"7":{"start":{"line":74,"column":0},"end":{"line":74,"column":25}}},"fnMap":{},"branchMap":{},"s":{"0":2,"1":2,"2":2,"3":2,"4":2,"5":2,"6":2,"7":2},"f":{},"b":{}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\docs\\users.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\docs\\users.ts","statementMap":{"0":{"start":{"line":1,"column":13},"end":{"line":18,"column":2}},"1":{"start":{"line":20,"column":13},"end":{"line":33,"column":2}},"2":{"start":{"line":35,"column":13},"end":{"line":45,"column":2}},"3":{"start":{"line":47,"column":13},"end":{"line":65,"column":2}},"4":{"start":{"line":67,"column":13},"end":{"line":95,"column":2}},"5":{"start":{"line":97,"column":13},"end":{"line":127,"column":2}},"6":{"start":{"line":129,"column":13},"end":{"line":151,"column":2}},"7":{"start":{"line":152,"column":13},"end":{"line":180,"column":2}}},"fnMap":{},"branchMap":{},"s":{"0":2,"1":2,"2":2,"3":2,"4":2,"5":2,"6":2,"7":2},"f":{},"b":{}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\email-templates\\verifyotp.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\email-templates\\verifyotp.ts","statementMap":{"0":{"start":{"line":1,"column":33},"end":{"line":29,"column":1}},"1":{"start":{"line":2,"column":2},"end":{"line":28,"column":2}},"2":{"start":{"line":1,"column":13},"end":{"line":1,"column":33}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":1,"column":33},"end":{"line":1,"column":34}},"loc":{"start":{"line":1,"column":51},"end":{"line":29,"column":1}}}},"branchMap":{},"s":{"0":2,"1":0,"2":2},"f":{"0":0},"b":{}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\middleware\\validator.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\middleware\\validator.ts","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":2,"column":40}},"1":{"start":{"line":5,"column":31},"end":{"line":24,"column":1}},"2":{"start":{"line":6,"column":20},"end":{"line":6,"column":28}},"3":{"start":{"line":8,"column":2},"end":{"line":13,"column":3}},"4":{"start":{"line":9,"column":4},"end":{"line":12,"column":7}},"5":{"start":{"line":15,"column":18},"end":{"line":15,"column":43}},"6":{"start":{"line":16,"column":2},"end":{"line":23,"column":3}},"7":{"start":{"line":17,"column":4},"end":{"line":17,"column":11}},"8":{"start":{"line":19,"column":4},"end":{"line":22,"column":7}},"9":{"start":{"line":5,"column":13},"end":{"line":5,"column":31}},"10":{"start":{"line":26,"column":30},"end":{"line":34,"column":1}},"11":{"start":{"line":27,"column":2},"end":{"line":33,"column":4}},"12":{"start":{"line":28,"column":22},"end":{"line":28,"column":47}},"13":{"start":{"line":29,"column":4},"end":{"line":31,"column":5}},"14":{"start":{"line":30,"column":6},"end":{"line":30,"column":73}},"15":{"start":{"line":32,"column":4},"end":{"line":32,"column":11}},"16":{"start":{"line":26,"column":13},"end":{"line":26,"column":30}}},"fnMap":{"0":{"name":"(anonymous_1)","decl":{"start":{"line":5,"column":31},"end":{"line":5,"column":32}},"loc":{"start":{"line":5,"column":83},"end":{"line":24,"column":1}}},"1":{"name":"(anonymous_2)","decl":{"start":{"line":26,"column":30},"end":{"line":26,"column":31}},"loc":{"start":{"line":26,"column":49},"end":{"line":34,"column":1}}},"2":{"name":"(anonymous_3)","decl":{"start":{"line":27,"column":9},"end":{"line":27,"column":10}},"loc":{"start":{"line":27,"column":61},"end":{"line":33,"column":3}}}},"branchMap":{"0":{"loc":{"start":{"line":8,"column":2},"end":{"line":13,"column":3}},"type":"if","locations":[{"start":{"line":8,"column":2},"end":{"line":13,"column":3}}]},"1":{"loc":{"start":{"line":16,"column":2},"end":{"line":23,"column":3}},"type":"if","locations":[{"start":{"line":16,"column":2},"end":{"line":23,"column":3}},{"start":{"line":18,"column":9},"end":{"line":23,"column":3}}]},"2":{"loc":{"start":{"line":29,"column":4},"end":{"line":31,"column":5}},"type":"if","locations":[{"start":{"line":29,"column":4},"end":{"line":31,"column":5}}]}},"s":{"0":2,"1":2,"2":4,"3":4,"4":0,"5":4,"6":4,"7":4,"8":0,"9":2,"10":2,"11":4,"12":8,"13":8,"14":2,"15":6,"16":2},"f":{"0":4,"1":4,"2":8},"b":{"0":[0],"1":[4,0],"2":[2]}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\middlewares\\isLoggedIn.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\middlewares\\isLoggedIn.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}},"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":51}},"2":{"start":{"line":5,"column":26},"end":{"line":40,"column":null}},"3":{"start":{"line":5,"column":84},"end":{"line":40,"column":null}},"4":{"start":{"line":6,"column":36},"end":{"line":6,"column":45}},"5":{"start":{"line":7,"column":4},"end":{"line":39,"column":5}},"6":{"start":{"line":8,"column":8},"end":{"line":13,"column":9}},"7":{"start":{"line":12,"column":12},"end":{"line":12,"column":60}},"8":{"start":{"line":14,"column":8},"end":{"line":19,"column":9}},"9":{"start":{"line":15,"column":12},"end":{"line":18,"column":15}},"10":{"start":{"line":20,"column":8},"end":{"line":22,"column":9}},"11":{"start":{"line":21,"column":12},"end":{"line":21,"column":54}},"12":{"start":{"line":23,"column":29},"end":{"line":23,"column":53}},"13":{"start":{"line":24,"column":32},"end":{"line":24,"column":67}},"14":{"start":{"line":25,"column":8},"end":{"line":30,"column":9}},"15":{"start":{"line":26,"column":12},"end":{"line":29,"column":15}},"16":{"start":{"line":32,"column":8},"end":{"line":32,"column":30}},"17":{"start":{"line":33,"column":8},"end":{"line":33,"column":15}},"18":{"start":{"line":35,"column":8},"end":{"line":38,"column":11}},"19":{"start":{"line":5,"column":13},"end":{"line":5,"column":26}}},"fnMap":{"0":{"name":"(anonymous_7)","decl":{"start":{"line":5,"column":26},"end":{"line":5,"column":33}},"loc":{"start":{"line":5,"column":84},"end":{"line":40,"column":null}}},"1":{"name":"(anonymous_8)","decl":{"start":{"line":5,"column":84},"end":{"line":5,"column":null}},"loc":{"start":{"line":5,"column":84},"end":{"line":40,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":8,"column":8},"end":{"line":13,"column":9}},"type":"if","locations":[{"start":{"line":8,"column":8},"end":{"line":13,"column":9}}]},"1":{"loc":{"start":{"line":9,"column":12},"end":{"line":10,"column":59}},"type":"binary-expr","locations":[{"start":{"line":9,"column":12},"end":{"line":9,"column":37}},{"start":{"line":10,"column":12},"end":{"line":10,"column":59}}]},"2":{"loc":{"start":{"line":14,"column":8},"end":{"line":19,"column":9}},"type":"if","locations":[{"start":{"line":14,"column":8},"end":{"line":19,"column":9}}]},"3":{"loc":{"start":{"line":20,"column":8},"end":{"line":22,"column":9}},"type":"if","locations":[{"start":{"line":20,"column":8},"end":{"line":22,"column":9}}]},"4":{"loc":{"start":{"line":25,"column":8},"end":{"line":30,"column":9}},"type":"if","locations":[{"start":{"line":25,"column":8},"end":{"line":30,"column":9}}]}},"s":{"0":2,"1":2,"2":2,"3":5,"4":5,"5":5,"6":5,"7":4,"8":5,"9":1,"10":4,"11":0,"12":4,"13":4,"14":4,"15":0,"16":4,"17":4,"18":0,"19":2},"f":{"0":5,"1":5},"b":{"0":[4],"1":[5,4],"2":[1],"3":[0],"4":[0]}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\middlewares\\isTokenFound.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\middlewares\\isTokenFound.ts","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":2,"column":46}},"1":{"start":{"line":4,"column":28},"end":{"line":22,"column":2}},"2":{"start":{"line":4,"column":82},"end":{"line":22,"column":2}},"3":{"start":{"line":5,"column":20},"end":{"line":5,"column":28}},"4":{"start":{"line":6,"column":2},"end":{"line":21,"column":3}},"5":{"start":{"line":7,"column":23},"end":{"line":7,"column":71}},"6":{"start":{"line":9,"column":4},"end":{"line":16,"column":5}},"7":{"start":{"line":10,"column":6},"end":{"line":10,"column":29}},"8":{"start":{"line":11,"column":6},"end":{"line":11,"column":13}},"9":{"start":{"line":13,"column":6},"end":{"line":15,"column":9}},"10":{"start":{"line":18,"column":4},"end":{"line":20,"column":7}},"11":{"start":{"line":4,"column":13},"end":{"line":4,"column":28}}},"fnMap":{"0":{"name":"(anonymous_8)","decl":{"start":{"line":4,"column":28},"end":{"line":4,"column":35}},"loc":{"start":{"line":4,"column":82},"end":{"line":22,"column":2}}},"1":{"name":"(anonymous_9)","decl":{"start":{"line":4,"column":82},"end":{"line":4,"column":null}},"loc":{"start":{"line":4,"column":82},"end":{"line":22,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":9,"column":4},"end":{"line":16,"column":5}},"type":"if","locations":[{"start":{"line":9,"column":4},"end":{"line":16,"column":5}},{"start":{"line":12,"column":11},"end":{"line":16,"column":5}}]}},"s":{"0":2,"1":2,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":2},"f":{"0":0,"1":0},"b":{"0":[0,0]}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\routes\\homeRoutes.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\routes\\homeRoutes.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}},"1":{"start":{"line":4,"column":18},"end":{"line":4,"column":26}},"2":{"start":{"line":6,"column":0},"end":{"line":17,"column":3}},"3":{"start":{"line":7,"column":2},"end":{"line":16,"column":3}},"4":{"start":{"line":8,"column":4},"end":{"line":10,"column":7}},"5":{"start":{"line":12,"column":4},"end":{"line":15,"column":7}},"6":{"start":{"line":19,"column":0},"end":{"line":19,"column":25}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":6,"column":19},"end":{"line":6,"column":20}},"loc":{"start":{"line":6,"column":51},"end":{"line":17,"column":1}}}},"branchMap":{},"s":{"0":2,"1":2,"2":2,"3":1,"4":1,"5":0,"6":2},"f":{"0":1},"b":{}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\routes\\index.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\routes\\index.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":38}},"2":{"start":{"line":4,"column":18},"end":{"line":4,"column":26}},"3":{"start":{"line":6,"column":0},"end":{"line":6,"column":36}},"4":{"start":{"line":8,"column":0},"end":{"line":8,"column":25}}},"fnMap":{},"branchMap":{},"s":{"0":2,"1":2,"2":2,"3":2,"4":2},"f":{},"b":{}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\routes\\userRoutes.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\routes\\userRoutes.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":131}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":74}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":51}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":55}},"5":{"start":{"line":6,"column":0},"end":{"line":6,"column":65}},"6":{"start":{"line":7,"column":0},"end":{"line":7,"column":59}},"7":{"start":{"line":9,"column":19},"end":{"line":9,"column":27}},"8":{"start":{"line":11,"column":0},"end":{"line":11,"column":35}},"9":{"start":{"line":12,"column":0},"end":{"line":12,"column":37}},"10":{"start":{"line":13,"column":0},"end":{"line":13,"column":98}},"11":{"start":{"line":14,"column":0},"end":{"line":14,"column":100}},"12":{"start":{"line":15,"column":0},"end":{"line":15,"column":64}},"13":{"start":{"line":17,"column":0},"end":{"line":17,"column":26}}},"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":{}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\schemas\\passwordUpdate.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\schemas\\passwordUpdate.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}},"1":{"start":{"line":3,"column":13},"end":{"line":10,"column":null}}},"fnMap":{},"branchMap":{},"s":{"0":2,"1":2},"f":{},"b":{}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\schemas\\signUpSchema.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\schemas\\signUpSchema.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}},"1":{"start":{"line":3,"column":13},"end":{"line":9,"column":36}},"2":{"start":{"line":11,"column":0},"end":{"line":11,"column":28}}},"fnMap":{},"branchMap":{},"s":{"0":2,"1":2,"2":2},"f":{},"b":{}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\sequelize\\models\\Token.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\sequelize\\models\\Token.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":45}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":50}},"2":{"start":{"line":18,"column":0},"end":{"line":42,"column":2}},"3":{"start":{"line":44,"column":0},"end":{"line":44,"column":21}}},"fnMap":{},"branchMap":{},"s":{"0":2,"1":2,"2":2,"3":2},"f":{},"b":{}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\sequelize\\models\\users.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\sequelize\\models\\users.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":45}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":50}},"2":{"start":{"line":26,"column":0},"end":{"line":67,"column":2}},"3":{"start":{"line":69,"column":0},"end":{"line":69,"column":20}}},"fnMap":{},"branchMap":{},"s":{"0":2,"1":2,"2":2,"3":2},"f":{},"b":{}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\services\\mail.service.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\services\\mail.service.ts","statementMap":{"0":{"start":{"line":3,"column":0},"end":{"line":3,"column":35}},"1":{"start":{"line":5,"column":0},"end":{"line":5,"column":47}},"2":{"start":{"line":8,"column":32},"end":{"line":23,"column":2}},"3":{"start":{"line":8,"column":101},"end":{"line":23,"column":2}},"4":{"start":{"line":9,"column":2},"end":{"line":22,"column":3}},"5":{"start":{"line":10,"column":24},"end":{"line":15,"column":6}},"6":{"start":{"line":17,"column":17},"end":{"line":17,"column":56}},"7":{"start":{"line":19,"column":4},"end":{"line":19,"column":31}},"8":{"start":{"line":21,"column":4},"end":{"line":21,"column":35}},"9":{"start":{"line":8,"column":13},"end":{"line":8,"column":32}}},"fnMap":{"0":{"name":"(anonymous_8)","decl":{"start":{"line":8,"column":32},"end":{"line":8,"column":39}},"loc":{"start":{"line":8,"column":101},"end":{"line":23,"column":2}}},"1":{"name":"(anonymous_9)","decl":{"start":{"line":8,"column":101},"end":{"line":8,"column":null}},"loc":{"start":{"line":8,"column":101},"end":{"line":23,"column":1}}}},"branchMap":{},"s":{"0":2,"1":2,"2":2,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":2},"f":{"0":0,"1":0},"b":{}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\services\\user.service.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\services\\user.service.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":45}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":55}},"2":{"start":{"line":5,"column":27},"end":{"line":16,"column":2}},"3":{"start":{"line":5,"column":38},"end":{"line":16,"column":2}},"4":{"start":{"line":6,"column":2},"end":{"line":15,"column":3}},"5":{"start":{"line":7,"column":18},"end":{"line":7,"column":38}},"6":{"start":{"line":8,"column":4},"end":{"line":10,"column":5}},"7":{"start":{"line":9,"column":6},"end":{"line":9,"column":29}},"8":{"start":{"line":11,"column":4},"end":{"line":11,"column":17}},"9":{"start":{"line":13,"column":4},"end":{"line":13,"column":31}},"10":{"start":{"line":14,"column":4},"end":{"line":14,"column":35}},"11":{"start":{"line":5,"column":13},"end":{"line":5,"column":27}},"12":{"start":{"line":18,"column":28},"end":{"line":27,"column":2}},"13":{"start":{"line":18,"column":52},"end":{"line":27,"column":2}},"14":{"start":{"line":19,"column":2},"end":{"line":26,"column":3}},"15":{"start":{"line":20,"column":22},"end":{"line":22,"column":6}},"16":{"start":{"line":23,"column":4},"end":{"line":23,"column":16}},"17":{"start":{"line":25,"column":4},"end":{"line":25,"column":33}},"18":{"start":{"line":18,"column":13},"end":{"line":18,"column":28}},"19":{"start":{"line":28,"column":33},"end":{"line":54,"column":2}},"20":{"start":{"line":28,"column":143},"end":{"line":54,"column":2}},"21":{"start":{"line":29,"column":23},"end":{"line":29,"column":63}},"22":{"start":{"line":30,"column":2},"end":{"line":32,"column":3}},"23":{"start":{"line":31,"column":4},"end":{"line":31,"column":16}},"24":{"start":{"line":33,"column":23},"end":{"line":33,"column":53}},"25":{"start":{"line":36,"column":2},"end":{"line":53,"column":3}},"26":{"start":{"line":37,"column":4},"end":{"line":43,"column":7}},"27":{"start":{"line":44,"column":4},"end":{"line":44,"column":16}},"28":{"start":{"line":46,"column":4},"end":{"line":51,"column":7}},"29":{"start":{"line":52,"column":4},"end":{"line":52,"column":16}},"30":{"start":{"line":28,"column":13},"end":{"line":28,"column":33}},"31":{"start":{"line":56,"column":30},"end":{"line":61,"column":2}},"32":{"start":{"line":56,"column":76},"end":{"line":61,"column":2}},"33":{"start":{"line":57,"column":15},"end":{"line":59,"column":4}},"34":{"start":{"line":60,"column":2},"end":{"line":60,"column":14}},"35":{"start":{"line":56,"column":13},"end":{"line":56,"column":30}},"36":{"start":{"line":63,"column":28},"end":{"line":75,"column":2}},"37":{"start":{"line":63,"column":49},"end":{"line":75,"column":2}},"38":{"start":{"line":64,"column":2},"end":{"line":74,"column":3}},"39":{"start":{"line":65,"column":17},"end":{"line":65,"column":40}},"40":{"start":{"line":66,"column":4},"end":{"line":70,"column":5}},"41":{"start":{"line":67,"column":6},"end":{"line":67,"column":18}},"42":{"start":{"line":69,"column":6},"end":{"line":69,"column":18}},"43":{"start":{"line":72,"column":4},"end":{"line":72,"column":58}},"44":{"start":{"line":73,"column":4},"end":{"line":73,"column":35}},"45":{"start":{"line":63,"column":13},"end":{"line":63,"column":28}},"46":{"start":{"line":76,"column":34},"end":{"line":80,"column":2}},"47":{"start":{"line":76,"column":73},"end":{"line":80,"column":2}},"48":{"start":{"line":77,"column":2},"end":{"line":77,"column":27}},"49":{"start":{"line":78,"column":17},"end":{"line":78,"column":32}},"50":{"start":{"line":79,"column":2},"end":{"line":79,"column":16}},"51":{"start":{"line":76,"column":13},"end":{"line":76,"column":34}}},"fnMap":{"0":{"name":"(anonymous_8)","decl":{"start":{"line":5,"column":27},"end":{"line":5,"column":36}},"loc":{"start":{"line":5,"column":38},"end":{"line":16,"column":2}}},"1":{"name":"(anonymous_9)","decl":{"start":{"line":5,"column":38},"end":{"line":5,"column":null}},"loc":{"start":{"line":5,"column":38},"end":{"line":16,"column":1}}},"2":{"name":"(anonymous_10)","decl":{"start":{"line":18,"column":28},"end":{"line":18,"column":35}},"loc":{"start":{"line":18,"column":52},"end":{"line":27,"column":2}}},"3":{"name":"(anonymous_11)","decl":{"start":{"line":18,"column":52},"end":{"line":18,"column":null}},"loc":{"start":{"line":18,"column":52},"end":{"line":27,"column":1}}},"4":{"name":"(anonymous_12)","decl":{"start":{"line":28,"column":33},"end":{"line":28,"column":40}},"loc":{"start":{"line":28,"column":143},"end":{"line":54,"column":2}}},"5":{"name":"(anonymous_13)","decl":{"start":{"line":28,"column":143},"end":{"line":28,"column":null}},"loc":{"start":{"line":28,"column":143},"end":{"line":54,"column":1}}},"6":{"name":"(anonymous_14)","decl":{"start":{"line":56,"column":30},"end":{"line":56,"column":37}},"loc":{"start":{"line":56,"column":76},"end":{"line":61,"column":2}}},"7":{"name":"(anonymous_15)","decl":{"start":{"line":56,"column":76},"end":{"line":56,"column":null}},"loc":{"start":{"line":56,"column":76},"end":{"line":61,"column":1}}},"8":{"name":"(anonymous_16)","decl":{"start":{"line":63,"column":28},"end":{"line":63,"column":35}},"loc":{"start":{"line":63,"column":49},"end":{"line":75,"column":2}}},"9":{"name":"(anonymous_17)","decl":{"start":{"line":63,"column":49},"end":{"line":63,"column":null}},"loc":{"start":{"line":63,"column":49},"end":{"line":75,"column":1}}},"10":{"name":"(anonymous_18)","decl":{"start":{"line":76,"column":34},"end":{"line":76,"column":41}},"loc":{"start":{"line":76,"column":73},"end":{"line":80,"column":2}}},"11":{"name":"(anonymous_19)","decl":{"start":{"line":76,"column":73},"end":{"line":76,"column":null}},"loc":{"start":{"line":76,"column":73},"end":{"line":80,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":8,"column":4},"end":{"line":10,"column":5}},"type":"if","locations":[{"start":{"line":8,"column":4},"end":{"line":10,"column":5}}]},"1":{"loc":{"start":{"line":30,"column":2},"end":{"line":32,"column":3}},"type":"if","locations":[{"start":{"line":30,"column":2},"end":{"line":32,"column":3}}]},"2":{"loc":{"start":{"line":36,"column":2},"end":{"line":53,"column":3}},"type":"if","locations":[{"start":{"line":36,"column":2},"end":{"line":53,"column":3}},{"start":{"line":45,"column":9},"end":{"line":53,"column":3}}]},"3":{"loc":{"start":{"line":36,"column":6},"end":{"line":36,"column":34}},"type":"binary-expr","locations":[{"start":{"line":36,"column":6},"end":{"line":36,"column":17}},{"start":{"line":36,"column":21},"end":{"line":36,"column":34}}]},"4":{"loc":{"start":{"line":66,"column":4},"end":{"line":70,"column":5}},"type":"if","locations":[{"start":{"line":66,"column":4},"end":{"line":70,"column":5}},{"start":{"line":68,"column":11},"end":{"line":70,"column":5}}]}},"s":{"0":2,"1":2,"2":2,"3":1,"4":1,"5":1,"6":1,"7":0,"8":1,"9":0,"10":0,"11":2,"12":2,"13":2,"14":2,"15":2,"16":2,"17":0,"18":2,"19":2,"20":3,"21":3,"22":3,"23":1,"24":2,"25":2,"26":2,"27":2,"28":0,"29":0,"30":2,"31":2,"32":7,"33":7,"34":7,"35":2,"36":2,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":2,"46":2,"47":1,"48":1,"49":1,"50":1,"51":2},"f":{"0":1,"1":1,"2":2,"3":2,"4":3,"5":3,"6":7,"7":7,"8":0,"9":0,"10":1,"11":1},"b":{"0":[0],"1":[1],"2":[2,0],"3":[2,0],"4":[0,0]}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\utils\\comparePassword.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\utils\\comparePassword.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"1":{"start":{"line":2,"column":32},"end":{"line":4,"column":2}},"2":{"start":{"line":2,"column":106},"end":{"line":4,"column":2}},"3":{"start":{"line":3,"column":2},"end":{"line":3,"column":61}},"4":{"start":{"line":2,"column":13},"end":{"line":2,"column":32}}},"fnMap":{"0":{"name":"(anonymous_8)","decl":{"start":{"line":2,"column":32},"end":{"line":2,"column":39}},"loc":{"start":{"line":2,"column":106},"end":{"line":4,"column":2}}},"1":{"name":"(anonymous_9)","decl":{"start":{"line":2,"column":106},"end":{"line":2,"column":null}},"loc":{"start":{"line":2,"column":106},"end":{"line":4,"column":1}}}},"branchMap":{},"s":{"0":2,"1":2,"2":6,"3":6,"4":2},"f":{"0":6,"1":6},"b":{}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\utils\\env.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\utils\\env.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}},"2":{"start":{"line":4,"column":13},"end":{"line":13,"column":2}}},"fnMap":{},"branchMap":{"0":{"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":32}},"type":"binary-expr","locations":[{"start":{"line":5,"column":8},"end":{"line":5,"column":24}},{"start":{"line":5,"column":28},"end":{"line":5,"column":32}}]}},"s":{"0":2,"1":2,"2":2},"f":{},"b":{"0":[2,0]}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\utils\\hashPassword.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\utils\\hashPassword.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}},"1":{"start":{"line":3,"column":30},"end":{"line":6,"column":2}},"2":{"start":{"line":3,"column":57},"end":{"line":6,"column":2}},"3":{"start":{"line":4,"column":19},"end":{"line":4,"column":50}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":18}},"5":{"start":{"line":3,"column":13},"end":{"line":3,"column":30}}},"fnMap":{"0":{"name":"(anonymous_8)","decl":{"start":{"line":3,"column":30},"end":{"line":3,"column":37}},"loc":{"start":{"line":3,"column":57},"end":{"line":6,"column":2}}},"1":{"name":"(anonymous_9)","decl":{"start":{"line":3,"column":57},"end":{"line":3,"column":null}},"loc":{"start":{"line":3,"column":57},"end":{"line":6,"column":1}}}},"branchMap":{},"s":{"0":2,"1":2,"2":3,"3":3,"4":3,"5":2},"f":{"0":3,"1":3},"b":{}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\utils\\jsonwebtoken.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\utils\\jsonwebtoken.ts","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":2,"column":35}},"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":44}},"2":{"start":{"line":5,"column":29},"end":{"line":15,"column":2}},"3":{"start":{"line":5,"column":51},"end":{"line":15,"column":2}},"4":{"start":{"line":6,"column":22},"end":{"line":12,"column":null}},"5":{"start":{"line":14,"column":2},"end":{"line":14,"column":21}},"6":{"start":{"line":5,"column":13},"end":{"line":5,"column":29}},"7":{"start":{"line":17,"column":27},"end":{"line":20,"column":2}},"8":{"start":{"line":17,"column":51},"end":{"line":20,"column":2}},"9":{"start":{"line":18,"column":18},"end":{"line":18,"column":58}},"10":{"start":{"line":19,"column":2},"end":{"line":19,"column":17}},"11":{"start":{"line":17,"column":13},"end":{"line":17,"column":27}},"12":{"start":{"line":22,"column":38},"end":{"line":27,"column":2}},"13":{"start":{"line":22,"column":60},"end":{"line":27,"column":2}},"14":{"start":{"line":23,"column":16},"end":{"line":25,"column":4}},"15":{"start":{"line":26,"column":2},"end":{"line":26,"column":15}},"16":{"start":{"line":22,"column":13},"end":{"line":22,"column":38}},"17":{"start":{"line":29,"column":36},"end":{"line":36,"column":2}},"18":{"start":{"line":29,"column":60},"end":{"line":36,"column":2}},"19":{"start":{"line":30,"column":2},"end":{"line":35,"column":3}},"20":{"start":{"line":31,"column":20},"end":{"line":31,"column":54}},"21":{"start":{"line":32,"column":4},"end":{"line":32,"column":19}},"22":{"start":{"line":34,"column":4},"end":{"line":34,"column":35}},"23":{"start":{"line":29,"column":13},"end":{"line":29,"column":36}}},"fnMap":{"0":{"name":"(anonymous_7)","decl":{"start":{"line":5,"column":29},"end":{"line":5,"column":36}},"loc":{"start":{"line":5,"column":51},"end":{"line":15,"column":2}}},"1":{"name":"(anonymous_8)","decl":{"start":{"line":5,"column":51},"end":{"line":5,"column":null}},"loc":{"start":{"line":5,"column":51},"end":{"line":15,"column":1}}},"2":{"name":"(anonymous_9)","decl":{"start":{"line":17,"column":27},"end":{"line":17,"column":34}},"loc":{"start":{"line":17,"column":51},"end":{"line":20,"column":2}}},"3":{"name":"(anonymous_10)","decl":{"start":{"line":17,"column":51},"end":{"line":17,"column":null}},"loc":{"start":{"line":17,"column":51},"end":{"line":20,"column":1}}},"4":{"name":"(anonymous_11)","decl":{"start":{"line":22,"column":38},"end":{"line":22,"column":45}},"loc":{"start":{"line":22,"column":60},"end":{"line":27,"column":2}}},"5":{"name":"(anonymous_12)","decl":{"start":{"line":22,"column":60},"end":{"line":22,"column":null}},"loc":{"start":{"line":22,"column":60},"end":{"line":27,"column":1}}},"6":{"name":"(anonymous_13)","decl":{"start":{"line":29,"column":36},"end":{"line":29,"column":43}},"loc":{"start":{"line":29,"column":60},"end":{"line":36,"column":2}}},"7":{"name":"(anonymous_14)","decl":{"start":{"line":29,"column":60},"end":{"line":29,"column":null}},"loc":{"start":{"line":29,"column":60},"end":{"line":36,"column":1}}}},"branchMap":{},"s":{"0":2,"1":2,"2":2,"3":2,"4":2,"5":2,"6":2,"7":2,"8":4,"9":4,"10":4,"11":2,"12":2,"13":0,"14":0,"15":0,"16":2,"17":2,"18":0,"19":0,"20":0,"21":0,"22":0,"23":2},"f":{"0":2,"1":2,"2":4,"3":4,"4":0,"5":0,"6":0,"7":0},"b":{}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\utils\\server.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\utils\\server.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":24}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":34}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":45}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":40}},"5":{"start":{"line":7,"column":12},"end":{"line":7,"column":21}},"6":{"start":{"line":9,"column":0},"end":{"line":9,"column":24}},"7":{"start":{"line":10,"column":0},"end":{"line":10,"column":48}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":16}},"9":{"start":{"line":14,"column":0},"end":{"line":14,"column":24}},"10":{"start":{"line":15,"column":0},"end":{"line":15,"column":30}},"11":{"start":{"line":16,"column":0},"end":{"line":16,"column":28}},"12":{"start":{"line":18,"column":0},"end":{"line":18,"column":19}}},"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},"f":{},"b":{}}
+,"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\utils\\transporter.ts": {"path":"C:\\Users\\niyon\\Desktop\\eagles-ec-be-1\\src\\utils\\transporter.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":35}},"2":{"start":{"line":4,"column":20},"end":{"line":12,"column":2}},"3":{"start":{"line":14,"column":0},"end":{"line":14,"column":27}}},"fnMap":{},"branchMap":{},"s":{"0":2,"1":2,"2":2,"3":2},"f":{},"b":{}}
+}
diff --git a/coverage/lcov-report/base.css b/coverage/lcov-report/base.css
new file mode 100644
index 0000000..f418035
--- /dev/null
+++ b/coverage/lcov-report/base.css
@@ -0,0 +1,224 @@
+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/coverage/lcov-report/block-navigation.js b/coverage/lcov-report/block-navigation.js
new file mode 100644
index 0000000..cc12130
--- /dev/null
+++ b/coverage/lcov-report/block-navigation.js
@@ -0,0 +1,87 @@
+/* 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) {
+ if (
+ document.getElementById('fileSearch') === document.activeElement &&
+ document.activeElement != null
+ ) {
+ // if we're currently focused on the search input, we don't want to navigate
+ return;
+ }
+
+ 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/coverage/lcov-report/config/cloudinary.config.ts.html b/coverage/lcov-report/config/cloudinary.config.ts.html
new file mode 100644
index 0000000..8defcb6
--- /dev/null
+++ b/coverage/lcov-report/config/cloudinary.config.ts.html
@@ -0,0 +1,118 @@
+
+
+
+
+
+ Code coverage report for config/cloudinary.config.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.
+
+
+
+ Filter:
+
+
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12 | 3x
+3x
+
+3x
+
+
+
+
+
+
+
+ | import {v2 as cloudinary} from 'cloudinary';
+import { env } from "../utils/env";
+
+export const cloudinaryConfig = cloudinary.config({
+ cloud_name:env.cloud_name,
+ api_key:env.api_key,
+ api_secret:env.api_scret
+});
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/config/dbConnection.ts.html b/coverage/lcov-report/config/dbConnection.ts.html
new file mode 100644
index 0000000..5ded1f2
--- /dev/null
+++ b/coverage/lcov-report/config/dbConnection.ts.html
@@ -0,0 +1,145 @@
+
+
+
+
+
+ Code coverage report for config/dbConnection.ts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 84.61%
+ Statements
+ 11/13
+
+
+
+
+ 50%
+ Branches
+ 1/2
+
+
+
+
+ 100%
+ Functions
+ 2/2
+
+
+
+
+ 81.81%
+ Lines
+ 9/11
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21 | 3x
+3x
+
+3x
+
+3x
+
+
+
+3x
+3x
+3x
+3x
+
+
+
+
+
+
+3x
+ | import { Sequelize } from "sequelize";
+import { env } from "../utils/env";
+
+const envT = process.env.NODE_ENV;
+
+const sequelize = new Sequelize(envT === "test" ? env.test_db_url : env.db_url, {
+ dialect: "postgres",
+});
+
+export const connect = async () => {
+ try {
+ await sequelize.authenticate();
+ console.log("successfuly connected's to db");
+ } catch (error: any) {
+ console.log("error: ", error.message);
+ return;
+ }
+};
+
+export default sequelize;
+ |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/config/index.html b/coverage/lcov-report/config/index.html
new file mode 100644
index 0000000..90e0c0e
--- /dev/null
+++ b/coverage/lcov-report/config/index.html
@@ -0,0 +1,131 @@
+
+
+
+
+
+ Code coverage report for config
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 87.5%
+ Statements
+ 14/16
+
+
+
+
+ 50%
+ Branches
+ 1/2
+
+
+
+
+ 100%
+ Functions
+ 2/2
+
+
+
+
+ 85.71%
+ Lines
+ 12/14
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+
+
+
+ File |
+ |
+ Statements |
+ |
+ Branches |
+ |
+ Functions |
+ |
+ Lines |
+ |
+
+
+
+ cloudinary.config.ts |
+
+
+ |
+ 100% |
+ 3/3 |
+ 100% |
+ 0/0 |
+ 100% |
+ 0/0 |
+ 100% |
+ 3/3 |
+
+
+
+ dbConnection.ts |
+
+
+ |
+ 84.61% |
+ 11/13 |
+ 50% |
+ 1/2 |
+ 100% |
+ 2/2 |
+ 81.81% |
+ 9/11 |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/controllers/categoriesControllers.ts.html b/coverage/lcov-report/controllers/categoriesControllers.ts.html
new file mode 100644
index 0000000..b1ee4e7
--- /dev/null
+++ b/coverage/lcov-report/controllers/categoriesControllers.ts.html
@@ -0,0 +1,502 @@
+
+
+
+
+
+ Code coverage report for controllers/categoriesControllers.ts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 70.58%
+ Statements
+ 36/51
+
+
+
+
+ 40%
+ Branches
+ 4/10
+
+
+
+
+ 80%
+ Functions
+ 8/10
+
+
+
+
+ 65.85%
+ Lines
+ 27/41
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+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
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140 |
+3x
+
+3x
+
+
+
+
+
+
+
+3x
+1x
+1x
+1x
+
+
+
+
+
+
+1x
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+1x
+1x
+1x
+1x
+
+
+
+
+
+
+1x
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+1x
+1x
+1x
+1x
+
+
+
+
+
+
+1x
+1x
+1x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+1x
+1x
+1x
+1x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | import { Request,Response } from "express";
+import { uploadImage } from "../utils/uploadImages";
+import { CategoryType } from "../types";
+import {
+ getAllCategories,
+ createCategories,
+ getSingleCategory,
+ updateCategories,
+ deleteCategories
+ } from "../services/categoriesServices";
+
+ export const fetchCategories = async(req:Request,res:Response) =>{
+ try {
+ const categories = await getAllCategories();
+ Iif(categories.length <=0){
+ res.status(200)
+ .json({
+ status:200,
+ message:"categories list is empty"
+ });
+ }else{
+ res.status(200).json({
+ message: "categories fetched successfully",
+ count: categories.length,
+ categories: categories,
+ });
+ }
+ } catch (error:any) {
+ res.status(500).json({
+ message: "Internal server error",
+ error: error.message,
+ });
+ };
+ };
+
+ export const fetchSingleCategory = async(req:Request,res:Response) => {
+ try {
+ const id = req.params.id;
+ const category = await getSingleCategory(id);
+ Iif(category === null){
+ res.status(404)
+ .json({
+ status:404,
+ message:"category not found"
+ });
+ }else{
+ res.status(200)
+ .json({
+ status:200,
+ category:category
+ });
+ }
+ } catch (error:any) {
+ res.status(500).json({
+ message: "Internal server error",
+ error: error.message,
+ });
+ };
+};
+
+ export const addCategories = async(req:Request,res:Response) =>{
+ try {
+ const imageUrl:any = await uploadImage(req.file);
+ const {name,description}:CategoryType = req.body;
+ const category = {
+ name,
+ description,
+ image:imageUrl,
+ createdAt: new Date(),
+ updatedAt: new Date()
+ };
+ const isCreated = await createCategories(category);
+ if(isCreated){
+ res.status(201).json(
+ {
+ status:201,
+ message:"New category added"
+ });
+ }elseE{
+ res.status(409).json(
+ {
+ status:409,
+ message:`This category, ${category.name} already exist.`,
+ });
+ }
+ } catch (error:any) {
+ res.status(500).json({
+ status:500,
+ error: error.message,
+ });
+ };
+};
+
+export const categoriesUpdate = async(req:Request,res:Response) =>{
+ try {
+ const isUpdated = await updateCategories(req);
+ if(isUpdated){
+ res.status(201).json(
+ {
+ status:201,
+ message:"Category updated"
+ });
+ }else{
+ res.status(404)
+ .json({
+ status:404,
+ message:"Category not found"
+ });
+ }
+ } catch (error:any) {
+ res.status(500).json({
+ status:500,
+ error: error.message,
+ });
+ }
+}
+
+export const removeCategories = async(req:Request,res:Response) =>{
+ try {
+ const isDeleted = await deleteCategories(req);
+ if(isDeleted){
+ res.status(200).json(
+ {
+ status:200,
+ message:"Category removed"
+ });
+ }elseE{
+ res.status(404)
+ .json({
+ status:404,
+ message:"Category not found"
+ });
+ }
+ } catch (error:any) {
+ res.status(500).json({
+ status:500,
+ error: error.message,
+ });
+ }
+} |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/controllers/index.html b/coverage/lcov-report/controllers/index.html
new file mode 100644
index 0000000..6226cd6
--- /dev/null
+++ b/coverage/lcov-report/controllers/index.html
@@ -0,0 +1,146 @@
+
+
+
+
+
+ Code coverage report for controllers
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 76.19%
+ Statements
+ 128/168
+
+
+
+
+ 50%
+ Branches
+ 20/40
+
+
+
+
+ 85.71%
+ Functions
+ 24/28
+
+
+
+
+ 72.85%
+ Lines
+ 102/140
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+
+
+
+ File |
+ |
+ Statements |
+ |
+ Branches |
+ |
+ Functions |
+ |
+ Lines |
+ |
+
+
+
+ categoriesControllers.ts |
+
+
+ |
+ 70.58% |
+ 36/51 |
+ 40% |
+ 4/10 |
+ 80% |
+ 8/10 |
+ 65.85% |
+ 27/41 |
+
+
+
+ productControllers.ts |
+
+
+ |
+ 72.88% |
+ 43/59 |
+ 56.25% |
+ 9/16 |
+ 80% |
+ 8/10 |
+ 69.38% |
+ 34/49 |
+
+
+
+ userControllers.ts |
+
+
+ |
+ 84.48% |
+ 49/58 |
+ 50% |
+ 7/14 |
+ 100% |
+ 8/8 |
+ 82% |
+ 41/50 |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/controllers/productControllers.ts.html b/coverage/lcov-report/controllers/productControllers.ts.html
new file mode 100644
index 0000000..e328fcb
--- /dev/null
+++ b/coverage/lcov-report/controllers/productControllers.ts.html
@@ -0,0 +1,568 @@
+
+
+
+
+
+ Code coverage report for controllers/productControllers.ts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 72.88%
+ Statements
+ 43/59
+
+
+
+
+ 56.25%
+ Branches
+ 9/16
+
+
+
+
+ 80%
+ Functions
+ 8/10
+
+
+
+
+ 69.38%
+ Lines
+ 34/49
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+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
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162 |
+3x
+3x
+
+
+
+
+
+
+
+
+3x
+1x
+1x
+1x
+
+
+
+
+
+
+1x
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+2x
+2x
+2x
+2x
+1x
+
+
+
+
+
+1x
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+1x
+1x
+1x
+
+
+
+
+1x
+
+
+
+
+
+1x
+1x
+4x
+
+
+1x
+1x
+1x
+
+
+
+
+
+
+
+
+
+
+
+1x
+1x
+1x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+1x
+1x
+1x
+1x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | import { NextFunction, Request,Response } from "express";
+import { uploadMultipleImages } from "../utils/uploadImages";
+import {
+ getAllProducts,
+ createProducts,
+ getSingleProduct,
+ updateProducts,
+ deleteProduct
+} from "../services/product.service";
+import { ProductType } from "../types";
+
+export const fetchProducts = async(req:Request,res:Response) =>{
+ try {
+ const products = await getAllProducts();
+ Iif(products.length <=0){
+ res.status(200)
+ .json({
+ status:200,
+ message:"Products list is empty"
+ });
+ }else{
+ res.status(200).json({
+ message: "Products fetched successfully",
+ count: products.length,
+ products: products,
+ });
+ }
+ } catch (error:any) {
+ res.status(500).json({
+ message: "Internal server error",
+ error: error.message,
+ });
+ };
+};
+
+export const fetchSingleProduct = async(req:Request,res:Response) => {
+ try {
+ const id = req.params.id;
+ const product = await getSingleProduct(id);
+ if(product === null){
+ res.status(404)
+ .json({
+ status:404,
+ message:"Product not found"
+ });
+ }else{
+ res.status(200)
+ .json({
+ status:200,
+ product:product
+ });
+ }
+ } catch (error:any) {
+ res.status(500).json({
+ message: "Internal server error",
+ error: error.message,
+ });
+ };
+};
+
+export const addProducts = async(req:Request,res:Response) =>{
+ try {
+ const uploadedImages = await uploadMultipleImages(req.files);
+ Iif (uploadedImages.length > 0 && (uploadedImages.length < 4 || uploadedImages.length > 8)) {
+ return res.status(400).json({
+ status: 400,
+ message: "Upload at least 4 images and not longer than 8",
+ });
+ }else Iif(uploadedImages.length ===0){
+ return res.status(400).json({
+ status: 400,
+ message: "Images is required",
+ });
+ }
+ let ulr = [];
+ for (const imageUrl of uploadedImages) {
+ ulr.push(imageUrl);
+ }
+ //@ts-ignore
+ const loggedIn = req.user;
+ const {name,stockQuantity,price,discount,categoryID,expiryDate}:ProductType = req.body;
+ const product = {
+ name,
+ images:ulr,
+ stockQuantity,
+ price,
+ discount,
+ categoryID,
+ userId : loggedIn.id,
+ expiryDate,
+ createdAt: new Date(),
+ updatedAt: new Date()
+ };
+ const isCreated = await createProducts(product);
+ if(isCreated){
+ res.status(201).json(
+ {
+ status:201,
+ message:"New product added in stock"
+ });
+ }elseE{
+ res.status(409).json(
+ {
+ status:409,
+ message:`This product, ${product.name} already exist.`,
+ });
+ }
+ } catch (error:any) {
+ res.status(500).json({
+ status:500,
+ error: error.message,
+ });
+ };
+};
+
+export const productsUpdate = async(req:Request,res:Response) =>{
+ try {
+ const isUpdated = await updateProducts(req,res);
+ if(isUpdated){
+ res.status(201).json(
+ {
+ status:201,
+ message:"Product updated"
+ });
+ }else{
+ res.status(404)
+ .json({
+ status:404,
+ message:"Product not found"
+ });
+ }
+ } catch (error:any) {
+ res.status(500).json({
+ status:500,
+ error: error.message,
+ });
+ }
+}
+
+export const removeProducts = async(req:Request,res:Response) =>{
+ try {
+ const isDeleted = await deleteProduct(req);
+ if(isDeleted){
+ res.status(200).json(
+ {
+ status:200,
+ message:"Product removed"
+ });
+ }elseE{
+ res.status(404)
+ .json({
+ status:404,
+ message:"Product not found"
+ });
+ }
+ } catch (error:any) {
+ res.status(500).json({
+ status:500,
+ error: error.message,
+ });
+ }
+} |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/controllers/userControllers.ts.html b/coverage/lcov-report/controllers/userControllers.ts.html
new file mode 100644
index 0000000..3a0ddd3
--- /dev/null
+++ b/coverage/lcov-report/controllers/userControllers.ts.html
@@ -0,0 +1,427 @@
+
+
+
+
+
+ Code coverage report for controllers/userControllers.ts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 84.48%
+ Statements
+ 49/58
+
+
+
+
+ 50%
+ Branches
+ 7/14
+
+
+
+
+ 100%
+ Functions
+ 8/8
+
+
+
+
+ 82%
+ Lines
+ 41/50
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+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
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115 |
+3x
+3x
+3x
+3x
+3x
+3x
+
+3x
+1x
+
+
+1x
+
+1x
+
+
+
+
+1x
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+3x
+3x
+3x
+3x
+
+
+
+
+
+3x
+3x
+1x
+
+
+
+
+2x
+
+
+
+
+
+
+
+
+3x
+3x
+3x
+3x
+
+3x
+1x
+
+
+
+
+
+2x
+
+
+
+
+
+
+
+
+
+
+
+3x
+3x
+3x
+
+3x
+3x
+
+
+3x
+3x
+1x
+
+
+2x
+1x
+
+
+1x
+
+
+
+1x
+1x
+1x
+
+
+
+
+
+
+
+ | import { Request, Response } from "express";
+import * as userService from "../services/user.service";
+import { generateToken } from "../utils/jsonwebtoken";
+import { comparePasswords } from "../utils/comparePassword";
+import { loggedInUser} from "../services/user.service";
+import { createUserService, getUserByEmail, updateUserPassword } from "../services/user.service";
+import { hashedPassword } from "../utils/hashPassword";
+
+export const fetchAllUsers = async (req: Request, res: Response) => {
+ try {
+ // const users = await userService.getAllUsers();
+
+ const users = await userService.getAllUsers();
+
+ Iif (users.length <= 0) {
+ return res.status(404).json({
+ message: "No users found",
+ });
+ } else {
+ res.status(200).json({
+ message: "Users fetched successfully",
+ count: users.length,
+ users: users,
+ });
+ }
+ } catch (error: any) {
+ res.status(500).json({
+ message: "Internal server error",
+ error: error.message,
+ });
+ }
+};
+
+export const userLogin = async (req: Request, res: Response) => {
+ const { email, password } = req.body;
+ const user = await loggedInUser(email);
+ const accessToken = await generateToken(user);
+ Iif (!user) {
+ res.status(401).json({
+ status:401,
+ message:'Invalid credentials'
+ });
+ }else{
+ const match = await comparePasswords(password,user.password);
+ if(!match){
+ res.status(401).json({
+ status:401,
+ message:' Invalid credentials'
+ });
+ }else{
+ res.status(200).json({
+ status:200,
+ message:"Logged in",
+ token:accessToken
+ });
+ };
+ };
+};
+
+export const createUserController = async (req: Request, res: Response) => {
+ try {
+ const { name, email, username,role, password } = req.body;
+ const user = await createUserService(name, email, username,role, password);
+
+ if (!user) {
+ return res.status(409).json({
+ status: 409,
+ message: "Username or email already exists",
+ });
+ }
+
+ res.status(201).json({
+ status: 201,
+ message: "User successfully created.",
+ });
+ } catch (err: any) {
+ Iif (err.name === "UnauthorizedError" && err.message === "User already exists") {
+ return res.status(409).json({ error: "User already exists" });
+ }
+ res.status(500).json({ error: err });
+ }
+};
+
+export const updatePassword = async (req: Request, res: Response) => {
+ const { oldPassword, newPassword, confirmPassword } = req.body;
+ try {
+ // @ts-ignore
+ const user = await getUserByEmail(req.user.email);
+ Iif (!user) {
+ return res.status(404).json({ message: 'User not found' });
+ }
+ const isPasswordValid = await comparePasswords(oldPassword, user.password);
+ if (!isPasswordValid) {
+ return res.status(400).json({ message: 'Old password is incorrect' });
+ }
+
+ if (newPassword !== confirmPassword) {
+ return res.status(400).json({ message: 'New password and confirm password do not match' });
+ }
+
+ Iif(await comparePasswords(newPassword, user.password)){
+ return res.status(400).json({ message: 'New password is similar to the old one. Please use a new password'})
+ }
+
+ const password = await hashedPassword(newPassword);
+ await updateUserPassword(user, password)
+ return res.status(200).json({ message: 'Password updated successfully' });
+
+ } catch(err: any){
+ return res.status(500).json({
+ message: err.message
+ })
+ }
+}
+ |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/docs/categories.ts.html b/coverage/lcov-report/docs/categories.ts.html
new file mode 100644
index 0000000..c37aeab
--- /dev/null
+++ b/coverage/lcov-report/docs/categories.ts.html
@@ -0,0 +1,490 @@
+
+
+
+
+
+ Code coverage report for docs/categories.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.
+
+
+
+ Filter:
+
+
+
+
+
+
+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
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136 | 3x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+
+
+
+
+
+
+
+
+
+3x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | export const categorySchema = {
+ properties:{
+ type: "object",
+ name:{
+ type: "string",
+ example: ""
+ },
+ description:{
+ type: "string",
+ example: ""
+ },
+ image:{ type: "string", format: "binary" }
+ }
+}
+
+export const getCategories = {
+ tags: ["Categories"],
+ summary: "Get all Categories",
+ responses: {
+ 200: {
+ description: "OK"
+ },
+ },
+ }
+
+ export const getSingleCategory ={
+ tags: ["Categories"],
+ summary: "Get single category",
+ parameters: [
+ {
+ in: "path",
+ name: "id",
+ description: "ID of the category",
+ required: true,
+ schema: {
+ type: "string"
+ }
+ }
+ ],
+ responses: {
+ 200: {
+ description: "OK"
+ },
+ }
+ }
+
+ export const addCategories = {
+ tags: ["Categories"],
+ security: [{ bearerAuth: [] }],
+ summary: "Add new category",
+ requestBody: {
+ required: true,
+ content: {
+ "multipart/form-data": {
+ schema: {
+ type: "object",
+ properties: {
+ name: { type: "string" , example: ""},
+ description:{ type: "string" , example: ""},
+ image: { type: "string", format: "binary" }
+ }
+ }
+ }
+ }
+ },
+ responses: {
+ 201: {
+ description: "Created"
+ },
+ 400: {
+ description: "Bad request"
+ }
+ }
+ }
+
+ export const updateCategories = {
+ tags: ["Categories"],
+ security: [{ bearerAuth: [] }],
+ summary: " update category",
+ parameters: [
+ {
+ in: "path",
+ name: "id",
+ description: "ID of the category to update",
+ required: true,
+ schema: {
+ type: "string"
+ }
+ }
+ ],
+ requestBody: {
+ required: true,
+ content: {
+ "multipart/form-data": {
+ schema: {
+ type: "object",
+ properties: {
+ name: { type: "string" , example: ""},
+ description:{ type: "string" , example: ""},
+ images:{ type: "string", format: "binary" }
+ }
+ }
+ }
+ }
+ },
+ responses: {
+ 201: {
+ description: "Updated"
+ },
+ 400: {
+ description: "Bad request"
+ }
+ }
+ }
+ export const deleteCategories ={
+ tags: ["Categories"],
+ security: [{ bearerAuth: [] }],
+ summary: "Delete product",
+ parameters: [
+ {
+ in: "path",
+ name: "id",
+ description: "ID of the product to delete",
+ required: true,
+ schema: {
+ type: "string"
+ }
+ }
+ ],
+ responses: {
+ 200: {
+ description: "Deleted"
+ },
+ }
+ }
+ |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/docs/index.html b/coverage/lcov-report/docs/index.html
new file mode 100644
index 0000000..0a1bec4
--- /dev/null
+++ b/coverage/lcov-report/docs/index.html
@@ -0,0 +1,161 @@
+
+
+
+
+
+ Code coverage report for docs
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 100%
+ Statements
+ 29/29
+
+
+
+
+ 100%
+ Branches
+ 0/0
+
+
+
+
+ 100%
+ Functions
+ 0/0
+
+
+
+
+ 100%
+ Lines
+ 29/29
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+
+
+
+ File |
+ |
+ Statements |
+ |
+ Branches |
+ |
+ Functions |
+ |
+ Lines |
+ |
+
+
+
+ categories.ts |
+
+
+ |
+ 100% |
+ 6/6 |
+ 100% |
+ 0/0 |
+ 100% |
+ 0/0 |
+ 100% |
+ 6/6 |
+
+
+
+ products.ts |
+
+
+ |
+ 100% |
+ 6/6 |
+ 100% |
+ 0/0 |
+ 100% |
+ 0/0 |
+ 100% |
+ 6/6 |
+
+
+
+ swagger.ts |
+
+
+ |
+ 100% |
+ 10/10 |
+ 100% |
+ 0/0 |
+ 100% |
+ 0/0 |
+ 100% |
+ 10/10 |
+
+
+
+ users.ts |
+
+
+ |
+ 100% |
+ 7/7 |
+ 100% |
+ 0/0 |
+ 100% |
+ 0/0 |
+ 100% |
+ 7/7 |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/docs/products.ts.html b/coverage/lcov-report/docs/products.ts.html
new file mode 100644
index 0000000..f1744b4
--- /dev/null
+++ b/coverage/lcov-report/docs/products.ts.html
@@ -0,0 +1,595 @@
+
+
+
+
+
+ Code coverage report for docs/products.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.
+
+
+
+ Filter:
+
+
+
+
+
+
+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
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171 |
+3x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+
+
+
+
+
+
+
+
+
+3x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+export const productSchema = {
+ properties:{
+ type: "object",
+ name:{
+ type: "string",
+ },
+ stockQuantity:{
+ type: "number"
+ },
+ price:{
+ type: "float"
+ },
+ discount:{
+ type: "float"
+ },
+ categoryID:{
+ type: "string"
+ },
+ expiryDate:{
+ type: "date"
+ }
+ }
+}
+
+export const getProducts = {
+ tags: ["Products"],
+ summary: "Get all products",
+ responses: {
+ 200: {
+ description: "OK"
+ },
+ },
+ }
+
+ export const getSingleProducts ={
+ tags: ["Products"],
+ summary: "Get single product",
+ parameters: [
+ {
+ in: "path",
+ name: "id",
+ description: "ID of the product",
+ required: true,
+ schema: {
+ type: "string"
+ }
+ }
+ ],
+ responses: {
+ 200: {
+ description: "OK"
+ },
+ }
+ }
+
+ export const addProducts = {
+ tags: ["Products"],
+ security: [{ bearerAuth: [] }],
+ summary: "Add new product",
+ requestBody: {
+ required: true,
+ content: {
+ "multipart/form-data": {
+ schema: {
+ type: "object",
+ properties: {
+ name: { type: "string",
+ example: ""
+ },
+ images: {
+ type: "array",
+ items: { type: "string", format: "binary" }
+ },
+ stockQuantity: { type: "number",
+ example: ""
+ },
+ price: { type: "float" ,
+ example: ""
+ },
+ discount: { type: "float",
+ example: ""
+ },
+ categoryID: { type: "string",
+ example: ""
+ },
+ expiryDate: { type: "date",
+ example: ""
+ }
+ }
+ }
+ }
+ }
+ },
+ responses: {
+ 201: {
+ description: "Created"
+ },
+ 400: {
+ description: "Bad request"
+ }
+ }
+ }
+
+ export const updateProducts = {
+ tags: ["Products"],
+ security: [{ bearerAuth: [] }],
+ summary: " update product",
+ parameters: [
+ {
+ in: "path",
+ name: "id",
+ description: "ID of the product to update",
+ required: true,
+ schema: {
+ type: "string"
+ }
+ }
+ ],
+ requestBody: {
+ required: true,
+ content: {
+ "multipart/form-data": {
+ schema: {
+ type: "object",
+ properties: {
+ name: { type: "string" },
+ images: {
+ type: "array",
+ items: { type: "string", format: "binary" }
+ },
+ stockQuantity: { type: "number" },
+ price: { type: "float" },
+ discount: { type: "float" },
+ categoryID: { type: "string" },
+ expiryDate: { type: "date" }
+ }
+ }
+ }
+ }
+ },
+ responses: {
+ 201: {
+ description: "Updated"
+ },
+ 400: {
+ description: "Bad request"
+ }
+ }
+ }
+ export const deleteProducts ={
+ tags: ["Products"],
+ security: [{ bearerAuth: [] }],
+ summary: "Delete product",
+ parameters: [
+ {
+ in: "path",
+ name: "id",
+ description: "ID of the category to delete",
+ required: true,
+ schema: {
+ type: "string"
+ }
+ }
+ ],
+ responses: {
+ 200: {
+ description: "Deleted"
+ },
+ }
+ } |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/docs/swagger.ts.html b/coverage/lcov-report/docs/swagger.ts.html
new file mode 100644
index 0000000..f19bda5
--- /dev/null
+++ b/coverage/lcov-report/docs/swagger.ts.html
@@ -0,0 +1,469 @@
+
+
+
+
+
+ Code coverage report for docs/swagger.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.
+
+
+
+ Filter:
+
+
+
+
+
+
+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
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129 | 3x
+3x
+3x
+3x
+
+
+
+
+
+
+
+
+3x
+
+
+
+
+
+
+3x
+
+
+
+
+
+
+
+
+
+3x
+
+3x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+
+3x
+ | import express from "express";
+import { serve, setup } from "swagger-ui-express";
+import { env } from "../utils/env";
+import {
+ createUsers,
+ getUsers,
+ loginAsUser,
+ userSchema,
+ loginSchema,
+ updatePasswordSchema,
+ passwordUpdate
+ } from "./users";
+import {
+ getProducts,
+ addProducts,
+ updateProducts,
+ getSingleProducts,
+ deleteProducts
+ ,productSchema } from "./products";
+import {
+ getCategories,
+ addCategories,
+ getSingleCategory,
+ updateCategories,
+ deleteCategories,
+ categorySchema
+ } from "./categories";
+import Category from "../sequelize/models/categories";
+
+const docRouter = express.Router();
+
+const options = {
+ openapi: "3.0.1",
+ info: {
+ title: "Eagles E-commerce API",
+ version: "1.0.0",
+ description: "Documentation for Eagles E-commerce Backend",
+ },
+
+ servers: [
+ {
+ url: `http://localhost:${env.port}`,
+ description: 'Development server',
+ }, {
+ url: 'https://eagles-ec-be-development.onrender.com/',
+ description: 'Production server',
+ }],
+
+ basePath: "/",
+
+ tags: [
+ { name: "Users", description: "Endpoints related to users" },
+ { name: "Products", description: "Endpoints related to products" },
+ { name: "Categories", description: "Endpoints related categories" }
+ ],
+
+ paths: {
+ "/api/v1/users": {
+ get: getUsers
+ },
+ "/api/v1/users/register": {
+ post: createUsers
+ },
+ "/api/v1/users/login": {
+ post: loginAsUser
+ },
+ "/api/v1/products":{
+ get:getProducts,
+ post:addProducts
+ },
+ "/api/v1/products/{id}":{
+ get:getSingleProducts,
+ patch:updateProducts,
+ delete:deleteProducts
+ },
+ "/api/v1/categories":{
+ get:getCategories,
+ post:addCategories
+ },
+ "/api/v1/categories/{id}":{
+ get:getSingleCategory,
+ patch:updateCategories,
+ delete:deleteCategories
+ },
+ "/api/v1/users/passwordupdate": {
+ put: passwordUpdate
+ },
+ components: {
+ schemas: {
+ User: userSchema,
+ Login:loginSchema,
+ Product:productSchema,
+ Category:categorySchema
+ },
+ securitySchemes: {
+ bearerAuth: {
+ type: "http",
+ scheme: "bearer",
+ bearerFormat: "JWT",
+ in: "header",
+ name: "Authorization",
+ },
+ },
+ }
+ },
+
+ components: {
+ schemas: {
+ User: userSchema,
+ Login: loginSchema,
+ updatePassword: updatePasswordSchema
+ },
+ securitySchemes: {
+ bearerAuth: {
+ type: "http",
+ scheme: "bearer",
+ bearerFormat: "JWT",
+ in: "header",
+ name: "Authorization",
+ },
+ },
+ }
+
+}
+
+docRouter.use("/", serve, setup(options));
+
+export default docRouter;
+ |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/docs/users.ts.html b/coverage/lcov-report/docs/users.ts.html
new file mode 100644
index 0000000..2748e6b
--- /dev/null
+++ b/coverage/lcov-report/docs/users.ts.html
@@ -0,0 +1,517 @@
+
+
+
+
+
+ Code coverage report for docs/users.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.
+
+
+
+ Filter:
+
+
+
+
+
+
+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
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145 | 3x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+
+
+
+
+
+
+
+
+
+
+
+3x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | export const userSchema = {
+ type: "object",
+ properties: {
+ name: {
+ type: "string",
+ },
+ username: {
+ type: "string",
+ },
+ email: {
+ type: "string",
+ format: "email",
+ },
+ role:{
+ type: "string",
+ },
+ password: {
+ type: "string",
+ },
+ },
+};
+
+export const updatePasswordSchema = {
+ type: "object",
+ properties: {
+ oldPassword: {
+ type: "string",
+ },
+ newPassword: {
+ type: "string",
+ },
+ confirmPassword: {
+ type: "string",
+ }
+ }
+}
+
+export const loginSchema = {
+ properties: {
+ email: {
+ type: "string",
+ format: "email",
+ },
+ password: {
+ type: "string",
+ },
+ },
+};
+
+export const getUsers = {
+ tags: ["Users"],
+ summary: "Get all users",
+ responses: {
+ 200: {
+ description: "OK",
+ content: {
+ "application/json": {
+ schema: {
+ type: "array",
+ items: {
+ $ref: "#/components/schemas/User",
+ },
+ },
+ },
+ },
+ },
+ },
+};
+
+export const createUsers = {
+ tags: ["Users"],
+ summary: "Register a new user",
+ requestBody: {
+ required: true,
+ content: {
+ "application/json": {
+ schema: {
+ $ref: "#/components/schemas/User",
+ },
+ },
+ },
+ },
+ responses: {
+ 201: {
+ description: "Created",
+ content: {
+ "application/json": {
+ schema: {
+ $ref: "#/components/schemas/User",
+ },
+ },
+ },
+ },
+ 400: {
+ description: "Bad request",
+ },
+ },
+};
+
+export const loginAsUser = {
+ tags: ["Users"],
+ summary: "Login as user",
+ security: [{ bearerAuth: [] }],
+ requestBody: {
+ required: true,
+ content: {
+ "application/json": {
+ schema: {
+ $ref: "#/components/schemas/Login"
+ }
+ }
+ }
+ },
+ responses: {
+ 200: {
+ description: "OK",
+ }
+ }
+};
+
+export const passwordUpdate = {
+ tags: ["Users"],
+ security: [{ bearerAuth: [] }],
+ summary: "Update Password",
+ requestBody: {
+ required: true,
+ content: {
+ "application/json": {
+ schema: {
+ $ref: "#/components/schemas/updatePassword"
+ }
+ }
+ }
+ },
+ responses: {
+ 200: {
+ description: "OK",
+ },
+ 400: {
+ description: "Bad Request"
+ }
+ }
+}
+
+ |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/favicon.png b/coverage/lcov-report/favicon.png
new file mode 100644
index 0000000..c1525b8
Binary files /dev/null and b/coverage/lcov-report/favicon.png differ
diff --git a/coverage/lcov-report/helpers/comparePassword.ts.html b/coverage/lcov-report/helpers/comparePassword.ts.html
new file mode 100644
index 0000000..f97f274
--- /dev/null
+++ b/coverage/lcov-report/helpers/comparePassword.ts.html
@@ -0,0 +1,94 @@
+
+
+
+
+
+ Code coverage report for helpers/comparePassword.ts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 100%
+ Statements
+ 5/5
+
+
+
+
+ 100%
+ Branches
+ 0/0
+
+
+
+
+ 100%
+ Functions
+ 2/2
+
+
+
+
+ 100%
+ Lines
+ 3/3
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+1
+2
+3
+4 | 2x
+2x
+1x
+ | import bcrypt from 'bcrypt'
+export const comparePasswords = async(plainPassword: string, hashedPassword: string): Promise<boolean> => {
+ return await bcrypt.compare(plainPassword, hashedPassword);
+ } |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/helpers/hashPassword.ts.html b/coverage/lcov-report/helpers/hashPassword.ts.html
new file mode 100644
index 0000000..65e339f
--- /dev/null
+++ b/coverage/lcov-report/helpers/hashPassword.ts.html
@@ -0,0 +1,100 @@
+
+
+
+
+
+ Code coverage report for helpers/hashPassword.ts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 100%
+ Statements
+ 6/6
+
+
+
+
+ 100%
+ Branches
+ 0/0
+
+
+
+
+ 100%
+ Functions
+ 2/2
+
+
+
+
+ 100%
+ Lines
+ 4/4
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+1
+2
+3
+4
+5
+6 | 2x
+
+2x
+2x
+1x
+ | import bcrypt from 'bcryptjs'
+
+export const hashedPassword = async(password: string) => {
+ const hashpass = await bcrypt.hash(password, 10)
+ return hashpass;
+} |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/helpers/index.html b/coverage/lcov-report/helpers/index.html
new file mode 100644
index 0000000..c9e412f
--- /dev/null
+++ b/coverage/lcov-report/helpers/index.html
@@ -0,0 +1,116 @@
+
+
+
+
+
+ Code coverage report for helpers
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 100%
+ Statements
+ 5/5
+
+
+
+
+ 100%
+ Branches
+ 0/0
+
+
+
+
+ 100%
+ Functions
+ 2/2
+
+
+
+
+ 100%
+ Lines
+ 3/3
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+
+
+
+ File |
+ |
+ Statements |
+ |
+ Branches |
+ |
+ Functions |
+ |
+ Lines |
+ |
+
+
+
+ comparePassword.ts |
+
+
+ |
+ 100% |
+ 5/5 |
+ 100% |
+ 0/0 |
+ 100% |
+ 2/2 |
+ 100% |
+ 3/3 |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/helpers/validation.ts.html b/coverage/lcov-report/helpers/validation.ts.html
new file mode 100644
index 0000000..48da212
--- /dev/null
+++ b/coverage/lcov-report/helpers/validation.ts.html
@@ -0,0 +1,148 @@
+
+
+
+
+
+ Code coverage report for helpers/validation.ts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 84.61%
+ Statements
+ 11/13
+
+
+
+
+ 33.33%
+ Branches
+ 1/3
+
+
+
+
+ 100%
+ Functions
+ 3/3
+
+
+
+
+ 80%
+ Lines
+ 8/10
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22 |
+2x
+2x
+1x
+1x
+
+
+
+
+
+
+1x
+2x
+1x
+
+
+
+
+
+1x
+
+ | import { Request,Response,NextFunction } from "express";
+import { loginValidation } from "../middlewares/joiValidation";
+export const dataValidation = async(req:Request,res:Response,next:NextFunction) => {
+ const {error} = loginValidation.validate(req.body);
+ Iif(error){
+ return res.status(406)
+ .json({
+ status:406,
+ mesage:`Error in User Data : ${error.message}`
+ })
+ }
+ const allowedFields = Object.keys(loginValidation.describe().keys);
+ const unknownFields = Object.keys(req.body).filter(field => !allowedFields.includes(field));
+ Iif (unknownFields.length > 0) {
+ return res.status(406).json({
+ status: 406,
+ message: `Unknown fields: ${unknownFields.join(", ")}`
+ });
+ }else{
+ next();
+ }
+} |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html
new file mode 100644
index 0000000..13ae4b0
--- /dev/null
+++ b/coverage/lcov-report/index.html
@@ -0,0 +1,281 @@
+
+
+
+
+
+ Code coverage report for All files
+
+
+
+
+
+
+
+
+
+
+
+
All files
+
+
+
+ 77.4%
+ Statements
+ 257/332
+
+
+
+
+ 49.09%
+ Branches
+ 27/55
+
+
+
+
+ 73.46%
+ Functions
+ 36/49
+
+
+
+
+ 75.95%
+ Lines
+ 218/287
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+
+
+
+ File |
+ |
+ Statements |
+ |
+ Branches |
+ |
+ Functions |
+ |
+ Lines |
+ |
+
+
+
+ src |
+
+
+ |
+ 100% |
+ 9/9 |
+ 100% |
+ 4/4 |
+ 100% |
+ 2/2 |
+ 100% |
+ 9/9 |
+
+
+
+ src/config |
+
+
+ |
+ 84.61% |
+ 11/13 |
+ 50% |
+ 1/2 |
+ 100% |
+ 2/2 |
+ 81.81% |
+ 9/11 |
+
+
+
+ src/controllers |
+
+
+ |
+ 66.27% |
+ 57/86 |
+ 44.44% |
+ 12/27 |
+ 80% |
+ 8/10 |
+ 63.15% |
+ 48/76 |
+
+
+
+ src/docs |
+
+
+ |
+ 100% |
+ 16/16 |
+ 100% |
+ 0/0 |
+ 100% |
+ 0/0 |
+ 100% |
+ 16/16 |
+
+
+
+ src/email-templates |
+
+
+ |
+ 66.66% |
+ 2/3 |
+ 100% |
+ 0/0 |
+ 0% |
+ 0/1 |
+ 50% |
+ 1/2 |
+
+
+
+ src/middleware |
+
+
+ |
+ 88.23% |
+ 15/17 |
+ 50% |
+ 2/4 |
+ 100% |
+ 3/3 |
+ 86.66% |
+ 13/15 |
+
+
+
+ src/middlewares |
+
+
+ |
+ 62.5% |
+ 20/32 |
+ 50% |
+ 4/8 |
+ 50% |
+ 2/4 |
+ 60.71% |
+ 17/28 |
+
+
+
+ src/routes |
+
+
+ |
+ 96.15% |
+ 25/26 |
+ 100% |
+ 0/0 |
+ 100% |
+ 1/1 |
+ 96.15% |
+ 25/26 |
+
+
+
+ src/schemas |
+
+
+ |
+ 100% |
+ 5/5 |
+ 100% |
+ 0/0 |
+ 100% |
+ 0/0 |
+ 100% |
+ 5/5 |
+
+
+
+ src/sequelize/models |
+
+
+ |
+ 100% |
+ 8/8 |
+ 100% |
+ 0/0 |
+ 100% |
+ 0/0 |
+ 100% |
+ 8/8 |
+
+
+
+ src/services |
+
+
+ |
+ 67.74% |
+ 42/62 |
+ 37.5% |
+ 3/8 |
+ 71.42% |
+ 10/14 |
+ 62.5% |
+ 30/48 |
+
+
+
+ src/utils |
+
+
+ |
+ 85.45% |
+ 47/55 |
+ 50% |
+ 1/2 |
+ 66.66% |
+ 8/12 |
+ 86.04% |
+ 37/43 |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/middleware/index.html b/coverage/lcov-report/middleware/index.html
new file mode 100644
index 0000000..d7f5b94
--- /dev/null
+++ b/coverage/lcov-report/middleware/index.html
@@ -0,0 +1,116 @@
+
+
+
+
+
+ Code coverage report for middleware
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 88.23%
+ Statements
+ 15/17
+
+
+
+
+ 50%
+ Branches
+ 2/4
+
+
+
+
+ 100%
+ Functions
+ 3/3
+
+
+
+
+ 86.66%
+ Lines
+ 13/15
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+
+
+
+ File |
+ |
+ Statements |
+ |
+ Branches |
+ |
+ Functions |
+ |
+ Lines |
+ |
+
+
+
+ validator.ts |
+
+
+ |
+ 88.23% |
+ 15/17 |
+ 50% |
+ 2/4 |
+ 100% |
+ 3/3 |
+ 86.66% |
+ 13/15 |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/middleware/validator.ts.html b/coverage/lcov-report/middleware/validator.ts.html
new file mode 100644
index 0000000..4b4337f
--- /dev/null
+++ b/coverage/lcov-report/middleware/validator.ts.html
@@ -0,0 +1,187 @@
+
+
+
+
+
+ Code coverage report for middleware/validator.ts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 88.23%
+ Statements
+ 15/17
+
+
+
+
+ 50%
+ Branches
+ 2/4
+
+
+
+
+ 100%
+ Functions
+ 3/3
+
+
+
+
+ 86.66%
+ Lines
+ 13/15
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+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 |
+2x
+
+
+2x
+5x
+
+5x
+
+
+
+
+
+
+5x
+5x
+5x
+
+
+
+
+
+
+
+
+2x
+6x
+5x
+5x
+1x
+
+4x
+
+
+ | import { Request, Response, NextFunction } from "express";
+import validator from "email-validator";
+import { Schema } from "joi";
+
+export const emailValidation = (req: Request, res: Response, next: NextFunction) => {
+ const { email } = req.body;
+
+ Iif (!email) {
+ return res.status(400).json({
+ status: 400,
+ message: "Email is required",
+ });
+ }
+
+ const isValid = validator.validate(email);
+ if (isValid) {
+ next();
+ } else E{
+ return res.status(400).json({
+ status: 400,
+ message: "Email is not valid.",
+ });
+ }
+};
+
+export const validateSchema = (schema: Schema) => {
+ return (req: Request, res: Response, next: NextFunction) => {
+ const { error } = schema.validate(req.body);
+ if (error) {
+ return res.status(400).json({ message: error.details[0].message });
+ }
+ next();
+ };
+};
+ |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/middlewares/authentication.ts.html b/coverage/lcov-report/middlewares/authentication.ts.html
new file mode 100644
index 0000000..1634a5d
--- /dev/null
+++ b/coverage/lcov-report/middlewares/authentication.ts.html
@@ -0,0 +1,187 @@
+
+
+
+
+
+ Code coverage report for middlewares/authentication.ts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 23.8%
+ Statements
+ 5/21
+
+
+
+
+ 0%
+ Branches
+ 0/14
+
+
+
+
+ 0%
+ Functions
+ 0/4
+
+
+
+
+ 22.22%
+ Lines
+ 4/18
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+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 |
+3x
+3x
+3x
+
+3x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | import { Request,Response, NextFunction} from "express";
+import jwt,{ sign,verify } from "jsonwebtoken";
+import User from "../sequelize/models/users";
+import { env } from "../utils/env";
+
+export const isAseller = async(req:Request,res:Response,next:NextFunction) => {
+ const accessToken = req.headers.authorization?.split(' ')[1];
+ if(accessToken){
+ jwt.verify(accessToken,`${env.jwt_secret}`,async(err:any,user: any) =>{
+ if(err){
+ return res.status(401).json({ message: 'Unauthorized' });
+ }else{
+ //@ts-ignore
+ req.user = user;
+ //@ts-ignore
+ if(!user){
+ return res.status(401).json({ message: 'Unauthorized' })
+ }else{
+ const loggedInUser:any = await User.findOne({where:{email:user.email}});
+ if(loggedInUser.role === 'seller' || loggedInUser.role === "admin"){
+ //@ts-ignore
+ req.loggedInUser = loggedInUser;
+ next();
+ }else{
+ return res.status(401).json({ message: 'Unauthorized' })
+ }
+ }
+ }
+ })
+ }else{
+ res.status(401).json({ message: 'Unauthorized' });
+ }
+}
+export let loggedInUser: any;
+ |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/middlewares/existingCategory.ts.html b/coverage/lcov-report/middlewares/existingCategory.ts.html
new file mode 100644
index 0000000..bead701
--- /dev/null
+++ b/coverage/lcov-report/middlewares/existingCategory.ts.html
@@ -0,0 +1,124 @@
+
+
+
+
+
+ Code coverage report for middlewares/existingCategory.ts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 33.33%
+ Statements
+ 3/9
+
+
+
+
+ 0%
+ Branches
+ 0/2
+
+
+
+
+ 0%
+ Functions
+ 0/2
+
+
+
+
+ 28.57%
+ Lines
+ 2/7
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14 |
+3x
+3x
+
+
+
+
+
+
+
+
+
+
+ | import { NextFunction, Request,Response } from "express";
+import Category from "../sequelize/models/categories";
+export const isCategoryExist = async(req:Request,res:Response,next:NextFunction) => {
+ const {categoryID} = req.body;
+ const category = await Category.findOne({where:{id:categoryID}});
+ if(!category){
+ res.status(409).json({
+ status:409,
+ message:"Product not found "
+ })
+ }else{
+ next();
+ }
+} |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/middlewares/index.html b/coverage/lcov-report/middlewares/index.html
new file mode 100644
index 0000000..7b1dde7
--- /dev/null
+++ b/coverage/lcov-report/middlewares/index.html
@@ -0,0 +1,161 @@
+
+
+
+
+
+ Code coverage report for middlewares
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 86.2%
+ Statements
+ 50/58
+
+
+
+
+ 64.28%
+ Branches
+ 9/14
+
+
+
+
+ 100%
+ Functions
+ 10/10
+
+
+
+
+ 84%
+ Lines
+ 42/50
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+
+
+
+ File |
+ |
+ Statements |
+ |
+ Branches |
+ |
+ Functions |
+ |
+ Lines |
+ |
+
+
+
+ isCategoryExist.ts |
+
+
+ |
+ 100% |
+ 9/9 |
+ 100% |
+ 2/2 |
+ 100% |
+ 2/2 |
+ 100% |
+ 7/7 |
+
+
+
+ isLoggedIn.ts |
+
+
+ |
+ 85% |
+ 17/20 |
+ 66.66% |
+ 4/6 |
+ 100% |
+ 2/2 |
+ 83.33% |
+ 15/18 |
+
+
+
+ sellerAuth.ts |
+
+
+ |
+ 75% |
+ 9/12 |
+ 50% |
+ 1/2 |
+ 100% |
+ 3/3 |
+ 70% |
+ 7/10 |
+
+
+
+ validator.ts |
+
+
+ |
+ 88.23% |
+ 15/17 |
+ 50% |
+ 2/4 |
+ 100% |
+ 3/3 |
+ 86.66% |
+ 13/15 |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/middlewares/isCategoryExist.ts.html b/coverage/lcov-report/middlewares/isCategoryExist.ts.html
new file mode 100644
index 0000000..9900b6c
--- /dev/null
+++ b/coverage/lcov-report/middlewares/isCategoryExist.ts.html
@@ -0,0 +1,127 @@
+
+
+
+
+
+ Code coverage report for middlewares/isCategoryExist.ts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 100%
+ Statements
+ 9/9
+
+
+
+
+ 100%
+ Branches
+ 2/2
+
+
+
+
+ 100%
+ Functions
+ 2/2
+
+
+
+
+ 100%
+ Lines
+ 7/7
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15 |
+3x
+3x
+2x
+2x
+2x
+1x
+
+
+
+
+1x
+
+
+ | import { Request,Response,NextFunction} from "express";
+import Category from "../sequelize/models/categories";
+export const isCategoryExist = async(req:Request,res:Response,next:NextFunction) => {
+ const {categoryID} = req.body;
+ const category = await Category.findOne({where:{id:categoryID}});
+ if(!category){
+ res.status(409).json({
+ status:409,
+ message:"Product not found "
+ })
+ }else{
+ next();
+ }
+}
+ |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/middlewares/isLoggedIn.ts.html b/coverage/lcov-report/middlewares/isLoggedIn.ts.html
new file mode 100644
index 0000000..74148a7
--- /dev/null
+++ b/coverage/lcov-report/middlewares/isLoggedIn.ts.html
@@ -0,0 +1,205 @@
+
+
+
+
+
+ Code coverage report for middlewares/isLoggedIn.ts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 85%
+ Statements
+ 17/20
+
+
+
+
+ 66.66%
+ Branches
+ 4/6
+
+
+
+
+ 100%
+ Functions
+ 2/2
+
+
+
+
+ 83.33%
+ Lines
+ 15/18
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+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 | 3x
+
+3x
+
+15x
+15x
+15x
+15x
+
+
+
+13x
+
+15x
+2x
+
+
+
+
+13x
+
+
+13x
+13x
+13x
+
+
+
+
+
+
+13x
+13x
+
+
+
+
+
+
+
+ | import { getUserByEmail } from "../services/user.service";
+import { Request, Response, NextFunction } from "express";
+import { decodeToken } from "../utils/jsonwebtoken"
+
+export const isLoggedIn = async (req: Request, res: Response, next: NextFunction) => {
+ let token: string | undefined = undefined;
+ try{
+ if (
+ req.headers.authorization &&
+ req.headers.authorization.startsWith("Bearer ")
+ ) {
+ token = req.headers.authorization.split(" ")[1];
+ }
+ if (!token) {
+ return res.status(401).json({
+ status: "Unauthorized",
+ message: "You are not logged in. Please login to continue.",
+ });
+ }
+ Iif (typeof token !== "string") {
+ throw new Error("Token is not a string.");
+ }
+ const decoded: any = await decodeToken(token)
+ const loggedUser: any = await getUserByEmail(decoded.email);
+ Iif (!loggedUser) {
+ return res.status(401).json({
+ status: "Unauthorized",
+ message: "Token has expired. Please login again.",
+ });
+ }
+ // @ts-ignore
+ req.user = loggedUser;
+ next();
+ } catch (error: any) {
+ return res.status(500).json({
+ status: "failed",
+ error: error.message + " Token has expired. Please login again.",
+ });
+ }
+}
+ |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/middlewares/joiValidation.ts.html b/coverage/lcov-report/middlewares/joiValidation.ts.html
new file mode 100644
index 0000000..a97740d
--- /dev/null
+++ b/coverage/lcov-report/middlewares/joiValidation.ts.html
@@ -0,0 +1,103 @@
+
+
+
+
+
+ Code coverage report for middlewares/joiValidation.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.
+
+
+
+ Filter:
+
+
+
+
+
+
+1
+2
+3
+4
+5
+6
+7 | 2x
+2x
+
+
+
+
+ | import Joi from "joi";
+ export const loginValidation = Joi.object({
+ email:Joi.string().email().trim(true).required(),
+ password:Joi.string().min(8).trim(true).required(),
+ }).options({ abortEarly: false });
+
+ |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/middlewares/sellerAuth.ts.html b/coverage/lcov-report/middlewares/sellerAuth.ts.html
new file mode 100644
index 0000000..8c48a60
--- /dev/null
+++ b/coverage/lcov-report/middlewares/sellerAuth.ts.html
@@ -0,0 +1,136 @@
+
+
+
+
+
+ Code coverage report for middlewares/sellerAuth.ts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 75%
+ Statements
+ 9/12
+
+
+
+
+ 50%
+ Branches
+ 1/2
+
+
+
+
+ 100%
+ Functions
+ 3/3
+
+
+
+
+ 70%
+ Lines
+ 7/10
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 |
+3x
+5x
+5x
+5x
+
+5x
+5x
+5x
+
+
+
+
+
+
+
+
+ | import { Request,Response, NextFunction} from "express";
+import { isLoggedIn } from "./isLoggedIn";
+export const isAseller = async(req:Request,res:Response,next:NextFunction) => {
+ try {
+ await isLoggedIn(req,res,() => {});
+ //@ts-ignore
+ const loggedInUser = req.user
+ if(loggedInUser.role === 'seller'){
+ next();
+ }elseE{
+ res.status(403).json({message:"Forbidden"});
+ }
+ } catch (error:any) {
+ console.error("Error:", error);
+ res.status(500).json({ message: "Internal Server Error" });
+ }
+}
+ |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/middlewares/validator.ts.html b/coverage/lcov-report/middlewares/validator.ts.html
new file mode 100644
index 0000000..0bd7610
--- /dev/null
+++ b/coverage/lcov-report/middlewares/validator.ts.html
@@ -0,0 +1,190 @@
+
+
+
+
+
+ Code coverage report for middlewares/validator.ts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 88.23%
+ Statements
+ 15/17
+
+
+
+
+ 50%
+ Branches
+ 2/4
+
+
+
+
+ 100%
+ Functions
+ 3/3
+
+
+
+
+ 86.66%
+ Lines
+ 13/15
+
+
+
+
+
+ Press n or j to go to the next uncovered block, b, p or k for the previous block.
+
+
+
+ Filter:
+
+
+
+
+
+
+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 |
+3x
+
+
+
+3x
+4x
+
+4x
+
+
+
+
+
+
+4x
+4x
+4x
+
+
+
+
+
+
+
+
+3x
+12x
+11x
+11x
+2x
+
+9x
+
+
+ | import { Request, Response, NextFunction } from "express";
+import validator from "email-validator";
+import { Schema } from "joi";
+import exp from "constants";
+
+export const emailValidation = (req: Request, res: Response, next: NextFunction) => {
+ const { email } = req.body;
+
+ Iif (!email) {
+ return res.status(400).json({
+ status: 400,
+ message: "Email is required",
+ });
+ }
+
+ const isValid = validator.validate(email);
+ if (isValid) {
+ next();
+ } else E{
+ return res.status(400).json({
+ status: 400,
+ message: "Email is not valid.",
+ });
+ }
+};
+
+export const validateSchema = (schema: Schema) => {
+ return (req: Request, res: Response, next: NextFunction) => {
+ const { error } = schema.validate(req.body);
+ if (error) {
+ return res.status(400).json({ message: error.details[0].message });
+ }
+ next();
+ };
+};
+ |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/coverage/lcov-report/prettify.css b/coverage/lcov-report/prettify.css
new file mode 100644
index 0000000..b317a7c
--- /dev/null
+++ b/coverage/lcov-report/prettify.css
@@ -0,0 +1 @@
+.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/coverage/lcov-report/prettify.js b/coverage/lcov-report/prettify.js
new file mode 100644
index 0000000..b322523
--- /dev/null
+++ b/coverage/lcov-report/prettify.js
@@ -0,0 +1,2 @@
+/* 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",/^
+
+
+
+