From 9b8cef48692c77f54a8be0e9414108d8ec0dafbe Mon Sep 17 00:00:00 2001 From: Kosta <68782786+KostaD02@users.noreply.github.com> Date: Tue, 12 Sep 2023 17:54:20 +0400 Subject: [PATCH] feat(qrcode): added qrcode generator endpoints with text/images (#33) * feat(qrcode): init basic module parts for qrcode * feat(qrcode): change lib * feat(qrcode): added generate qrcode * feat(qrcode): added generate with image * docs: update endpoints list * docs(insomnia): updated workspace * chore(release): 0.0.9 * refactor: updated insomnia format & swagger api version --- CHANGELOG.md | 69 ++++ docs/insomnia/Insomnia.json | 312 ++++++++++++------ docs/insomnia/Insomnia.yaml | 307 +++++++++++------ endpoints.md | 10 +- package-lock.json | 263 +++++++++++++-- package.json | 6 +- src/app.controller.ts | 2 + src/app.module.ts | 3 +- src/enums/exceptions.enum.ts | 5 + src/main.ts | 2 +- src/modules/index.ts | 1 + .../qrcode/dtos/generate-qr-image.dto.ts | 10 + src/modules/qrcode/dtos/generate-qr.dto.ts | 7 + src/modules/qrcode/dtos/index.ts | 2 + src/modules/qrcode/index.ts | 3 + src/modules/qrcode/qrcode.controller.ts | 28 ++ src/modules/qrcode/qrcode.module.ts | 10 + src/modules/qrcode/qrcode.service.ts | 64 ++++ 18 files changed, 888 insertions(+), 216 deletions(-) create mode 100644 src/modules/qrcode/dtos/generate-qr-image.dto.ts create mode 100644 src/modules/qrcode/dtos/generate-qr.dto.ts create mode 100644 src/modules/qrcode/dtos/index.ts create mode 100644 src/modules/qrcode/index.ts create mode 100644 src/modules/qrcode/qrcode.controller.ts create mode 100644 src/modules/qrcode/qrcode.module.ts create mode 100644 src/modules/qrcode/qrcode.service.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index f01e066..89bfd09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,75 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### 0.0.9 (2023-09-12) + + +### Features + +* add dto validation for shop and user ([#7](https://github.com/educata/everrest/issues/7)) ([cc53c0b](https://github.com/educata/everrest/commit/cc53c0b1cc566442749d031696feb73a9d869e79)) +* add dummy phones data ([5cc77b5](https://github.com/educata/everrest/commit/5cc77b54da5cf8e7d778d7cf63269af816a271f4)) +* add exceptions handling ([929360d](https://github.com/educata/everrest/commit/929360d7fb5725064fab3b5234734848a023da8b)) +* add full support for swagger ([#12](https://github.com/educata/everrest/issues/12)) ([c88d1bb](https://github.com/educata/everrest/commit/c88d1bb02881b0803f26cebdfb15cbf724706f53)) +* add initial swagger docs ([#8](https://github.com/educata/everrest/issues/8)) ([ba54833](https://github.com/educata/everrest/commit/ba54833dc72a4df52a3caff08216c11637d77de9)) +* add logo ([5cf915d](https://github.com/educata/everrest/commit/5cf915d99e3d80a7a66d7b42c1c6ea717c139ccb)) +* add mongoose id validation service and custom decorator ([7285507](https://github.com/educata/everrest/commit/7285507d4f06ded2e002d8159b2201420ee75365)) +* add mongoose id validation service and decorator ([b00a60b](https://github.com/educata/everrest/commit/b00a60bd1a68221ca8d44dd11dba07f19098f2eb)) +* add products modules ([691381b](https://github.com/educata/everrest/commit/691381bc2e0aaa41263966a4ad1fe906fb8586c8)) +* added insomnia work environment ([#11](https://github.com/educata/everrest/issues/11)) ([50283b4](https://github.com/educata/everrest/commit/50283b4d9ac4d448d5b7cfc8bd6db93183458679)) +* added product uploader page and fixed cors for any origin ([#24](https://github.com/educata/everrest/issues/24)) ([bbc778f](https://github.com/educata/everrest/commit/bbc778f1e45b795648e0d88e5aba9b5a7a6d7bfa)) +* added role based guard and refactored shared folder ([#9](https://github.com/educata/everrest/issues/9)) ([57cb224](https://github.com/educata/everrest/commit/57cb224e8a3bb8ad1a3cfcec1559ae6d76bd0cc5)) +* added user/cart/products interfaces and dummy data ([c741fc9](https://github.com/educata/everrest/commit/c741fc9022a1f46cb0cdfce9967df36b041b98b3)) +* allow cors from any origin, WIP solution ([#23](https://github.com/educata/everrest/issues/23)) ([0283e7d](https://github.com/educata/everrest/commit/0283e7d2d4e8b3d49602021474ea64333da25c7e)) +* **auth:** create user schema and base controller/service ([b3b42db](https://github.com/educata/everrest/commit/b3b42db24ff67a2dc2a151c07d4fd6e538205c83)) +* **cart:** add checkout endpoint ([57e33bc](https://github.com/educata/everrest/commit/57e33bc07ef28c03bcad4dd6f4307b0fd1a7e8fa)) +* **cart:** added boilerplate for cart service/controller ([a1c2eb2](https://github.com/educata/everrest/commit/a1c2eb2cbf44fb3d28954510fe94efc8009ef139)) +* **cart:** added cart schema ([bea9143](https://github.com/educata/everrest/commit/bea9143522f970558ed03755649484a9463e02dc)) +* **cart:** added clear cart endpoint ([f06774b](https://github.com/educata/everrest/commit/f06774bc3868d78410963735a1eff422f1765362)) +* **cart:** added delete endpoint for single cart item ([62b1c16](https://github.com/educata/everrest/commit/62b1c162bdd5c0dca68b9247191212aecaa0399a)) +* **cart:** added functional to get cart and init cart ([c91a006](https://github.com/educata/everrest/commit/c91a0069a38b64b341c04945fbf5bb8e9e9b4f17)) +* **cart:** added updateCart ([b4ec443](https://github.com/educata/everrest/commit/b4ec44323cabc665d5a541a48c3ed1270f76adad)) +* **cart:** added validation if quantity is more than stock ([c13f39a](https://github.com/educata/everrest/commit/c13f39a7084dc4b4503965c46d806730976dc91d)) +* Create LICENSE ([#22](https://github.com/educata/everrest/issues/22)) ([2e9b2c6](https://github.com/educata/everrest/commit/2e9b2c6e7d04d48ac6349ee6303bc09c18a64dd7)) +* internationalization ([#21](https://github.com/educata/everrest/issues/21)) ([fb16566](https://github.com/educata/everrest/commit/fb16566ed1f4a4fe94ea3f55907ab225ae8ce402)) +* modified error handling with new catch error, added some dto and enums ([7763ac6](https://github.com/educata/everrest/commit/7763ac65ea1acf8d712309cda07c4df691f61994)) +* **qrcode:** added generate qrcode ([4b3587d](https://github.com/educata/everrest/commit/4b3587d12e54bac84553b7930eea1b367f54cff6)) +* **qrcode:** added generate with image ([6a8b0b1](https://github.com/educata/everrest/commit/6a8b0b1693210236c93d1e75a5a4ae14d2c28655)) +* **qrcode:** change lib ([c691179](https://github.com/educata/everrest/commit/c691179d29a139fb0d5009863cb8082303e1500a)) +* **qrcode:** init basic module parts for qrcode ([c5da138](https://github.com/educata/everrest/commit/c5da138435fe809c3c9f075a5061a463d3f1b90b)) +* **shared:** added custom decorator to decode jwt data ([af2331f](https://github.com/educata/everrest/commit/af2331fd02646efdda182288e239b4ea8f78d2cf)) +* **shop:** add getProductById and updateProduct endpoints ([3eb62b9](https://github.com/educata/everrest/commit/3eb62b999a5ffc4873739a760e0c7f21c4916db1)) +* **shop:** add pagination to some endpoints ([3c76eda](https://github.com/educata/everrest/commit/3c76eda482ca7f44d6aec2ed32d7cbc952e7615f)) +* **shop:** add some data with modified get all endpoint ([22c16e4](https://github.com/educata/everrest/commit/22c16e473a3dc157a8ff3f7d0a0d4a9972f37d22)) +* **shop:** added delete endpoint ([e26f64a](https://github.com/educata/everrest/commit/e26f64a4ef33e8d67cbb973534ae4cffbdc0f3b9)) +* **shop:** added pagination to all product endpoint ([210ceab](https://github.com/educata/everrest/commit/210ceabb68c053ed8825dac8b1976489ef061812)) +* **shop:** added search endpoint ([84e4ae8](https://github.com/educata/everrest/commit/84e4ae84ab8df26ffc7bb3f4142b24184b3194e2)) +* **shop:** added search endpoint with pagination ([d10b34d](https://github.com/educata/everrest/commit/d10b34d501745576204800b56e5c75017c42817a)) +* **shop:** added updateProductRating endpoint ([90c7251](https://github.com/educata/everrest/commit/90c725164c7bcffc9cba8f13bf7853db6f3cccee)) +* **shop:** exclude ratings from products response ([62673cf](https://github.com/educata/everrest/commit/62673cf5d577ba524b3d9dbbe934a56d0b4c735b)) +* **shop:** mark id params for future middleware implementation ([e751dea](https://github.com/educata/everrest/commit/e751deac9023b280f28413e3b7f88fa6b4655967)) +* **shop:** mark new rating feature for future implementation ([b254b6f](https://github.com/educata/everrest/commit/b254b6f1145482a88f668744153ab68e64da8fc7)) +* **user:** add sign up endpoint ([415b335](https://github.com/educata/everrest/commit/415b3356899c04b4daf9bd62dd222c4593c67124)) +* **user:** added user endpoints ([#5](https://github.com/educata/everrest/issues/5)) ([10c9fb9](https://github.com/educata/everrest/commit/10c9fb96216801deea41b515e5c8920d4d505b36)) +* **user:** new user endpoints ([#18](https://github.com/educata/everrest/issues/18)) ([ac8a5a0](https://github.com/educata/everrest/commit/ac8a5a0b8e971bd2227e5dff18c2a1dde709b358)) +* **user:** updated jwt guard ([#6](https://github.com/educata/everrest/issues/6)) ([c7b949c](https://github.com/educata/everrest/commit/c7b949c8e53b55c8cb34486120b1799b2ebf332f)) +* **user:** WIP user jwt auth ([b32aa8d](https://github.com/educata/everrest/commit/b32aa8dca2cbce729bd5fd0bce8414a65f1234c1)) + + +### Bug Fixes + +* **auth:** added sameSite attribute ([#25](https://github.com/educata/everrest/issues/25)) ([d1ef296](https://github.com/educata/everrest/commit/d1ef296a030e016737fcd9b04ddb53e8d88c2797)) +* **auth:** process env reading in other module & refactored jwt guard ([3b57162](https://github.com/educata/everrest/commit/3b571620bdeb38a744f21c839be5a86e069a744c)) +* **cart:** fixed total object values ([5de7f43](https://github.com/educata/everrest/commit/5de7f4395d5ecccba4d52f84e4a59b4ff538b2db)) +* **cart:** handled beforeDiscount price ([102ec87](https://github.com/educata/everrest/commit/102ec87576dd6363957ad41808f8cae4a36e4ee1)) +* file name typo ([168299e](https://github.com/educata/everrest/commit/168299ee890427fe989112c73280b84f059341d9)) +* heroku using wrong deploy script ([#19](https://github.com/educata/everrest/issues/19)) ([0909911](https://github.com/educata/everrest/commit/09099115e9f21e56188c97fa17b1fe20fd06e494)) +* **products:** categories using name ([e7fed08](https://github.com/educata/everrest/commit/e7fed0899cfe08889ffc26fdcdf20269dff1e2fc)) +* **products:** isNumber validator causing error ([#26](https://github.com/educata/everrest/issues/26)) ([6ea7307](https://github.com/educata/everrest/commit/6ea7307f3e343596655477737c983ce60c0a9f7d)) +* **products:** modified product builder & cookie samesite ([#27](https://github.com/educata/everrest/issues/27)) ([f674bff](https://github.com/educata/everrest/commit/f674bff8c91bf2f03bf94e5e02110920d79edcf3)) +* **shop:** add handle for search case (min,max) ([d46ce7f](https://github.com/educata/everrest/commit/d46ce7fe0bb9800cbf9444ae95489314d755d0d4)) +* **shop:** getCategoryById and getCategories endpoints ([874d3f8](https://github.com/educata/everrest/commit/874d3f83f10a00835987f4427c14aa71faee8a7b)) +* **user:** correct user interface and added user schema ([8072894](https://github.com/educata/everrest/commit/807289409ce393c7fa892d141773f3845adef4e9)) + ### 0.0.8 (2023-09-12) diff --git a/docs/insomnia/Insomnia.json b/docs/insomnia/Insomnia.json index ec0fe61..1e59d44 100644 --- a/docs/insomnia/Insomnia.json +++ b/docs/insomnia/Insomnia.json @@ -1,12 +1,12 @@ { "_type": "export", "__export_format": 4, - "__export_date": "2023-09-07T19:03:34.958Z", + "__export_date": "2023-09-12T13:47:58.976Z", "__export_source": "insomnia.desktop.app:v2023.5.8", "resources": [ { - "_id": "req_f503108e57d848f692d0b89a321b7064", - "parentId": "fld_203fe6a1cd5e4274bc641ea44cee03b6", + "_id": "req_4a83524bc8f8464f910b4b8121875f29", + "parentId": "fld_c44fd0258a0543379ca3c9d6981bd45a", "modified": 1694109977169, "created": 1694104757818, "url": "http://localhost:3000", @@ -28,8 +28,8 @@ "_type": "request" }, { - "_id": "fld_203fe6a1cd5e4274bc641ea44cee03b6", - "parentId": "wrk_4ef933ea915748d5897746f14b654671", + "_id": "fld_c44fd0258a0543379ca3c9d6981bd45a", + "parentId": "wrk_cddddeca853e4720a57929758bac0eb7", "modified": 1694104747369, "created": 1694104741476, "name": "root", @@ -40,19 +40,19 @@ "_type": "request_group" }, { - "_id": "wrk_4ef933ea915748d5897746f14b654671", + "_id": "wrk_cddddeca853e4720a57929758bac0eb7", "parentId": null, - "modified": 1692100035449, - "created": 1692100035449, + "modified": 1694113474968, + "created": 1694113474968, "name": "Everest", "description": "", "scope": "collection", "_type": "workspace" }, { - "_id": "req_d6543bdd53f446a89a010f9544ac9582", - "parentId": "fld_203fe6a1cd5e4274bc641ea44cee03b6", - "modified": 1694109973086, + "_id": "req_cd91052f7dfc44aa9aa798894d5c9d14", + "parentId": "fld_c44fd0258a0543379ca3c9d6981bd45a", + "modified": 1694264487911, "created": 1694104795324, "url": "http://localhost:3000/lang/errors", "name": "Errors", @@ -73,8 +73,8 @@ "_type": "request" }, { - "_id": "req_b17d5cbd6caf4dbcb2e0ee562600eb23", - "parentId": "fld_65c3b123e07542fba2c48d82d1566011", + "_id": "req_2e11fa0e6cb543e5b69ce28733c9973c", + "parentId": "fld_c5bba1b12a0f4675aab19c87c59951f1", "modified": 1693918319125, "created": 1693918297856, "url": "http://localhost:3000/shop/cart", @@ -96,8 +96,8 @@ "_type": "request" }, { - "_id": "fld_65c3b123e07542fba2c48d82d1566011", - "parentId": "fld_6c3081c4b7a14864a3e68de8f0c0fd09", + "_id": "fld_c5bba1b12a0f4675aab19c87c59951f1", + "parentId": "fld_ce89bf973c7049df95949e65662e24e0", "modified": 1693916555938, "created": 1693908862581, "name": "cart", @@ -108,8 +108,8 @@ "_type": "request_group" }, { - "_id": "fld_6c3081c4b7a14864a3e68de8f0c0fd09", - "parentId": "wrk_4ef933ea915748d5897746f14b654671", + "_id": "fld_ce89bf973c7049df95949e65662e24e0", + "parentId": "wrk_cddddeca853e4720a57929758bac0eb7", "modified": 1693908839779, "created": 1693908839779, "name": "shop", @@ -120,8 +120,8 @@ "_type": "request_group" }, { - "_id": "req_cf783a77f1754dbe8fa4645af1de82c9", - "parentId": "fld_65c3b123e07542fba2c48d82d1566011", + "_id": "req_73287d6cd71a41d1824389c717cf3c43", + "parentId": "fld_c5bba1b12a0f4675aab19c87c59951f1", "modified": 1693919005385, "created": 1693918293668, "url": "http://localhost:3000/shop/cart/product", @@ -146,8 +146,8 @@ "_type": "request" }, { - "_id": "req_ce8bf261e61442f39c163a7c79ccc223", - "parentId": "fld_65c3b123e07542fba2c48d82d1566011", + "_id": "req_8ba7281b071e4aa9b97a8076c1302bb5", + "parentId": "fld_c5bba1b12a0f4675aab19c87c59951f1", "modified": 1693918605591, "created": 1693918592075, "url": "http://localhost:3000/shop/cart/checkout", @@ -172,8 +172,8 @@ "_type": "request" }, { - "_id": "req_fd71e2fc98bc41e18755c8bf9529da3b", - "parentId": "fld_65c3b123e07542fba2c48d82d1566011", + "_id": "req_eb42dcbf9f7a4b5aa907265aefa75ede", + "parentId": "fld_c5bba1b12a0f4675aab19c87c59951f1", "modified": 1693919009738, "created": 1693918494445, "url": "http://localhost:3000/shop/cart/product", @@ -198,8 +198,8 @@ "_type": "request" }, { - "_id": "req_e001d3a61fce49938e5f73ace9e6bc46", - "parentId": "fld_65c3b123e07542fba2c48d82d1566011", + "_id": "req_1e9640498f784a89807a05a8d0eb43aa", + "parentId": "fld_c5bba1b12a0f4675aab19c87c59951f1", "modified": 1693919012384, "created": 1693918569988, "url": "http://localhost:3000/shop/cart/product", @@ -224,8 +224,8 @@ "_type": "request" }, { - "_id": "req_23a40ef7a1fe4e0fb318329fc45994bb", - "parentId": "fld_65c3b123e07542fba2c48d82d1566011", + "_id": "req_821dc0d67da5499793d3b94056edc4fb", + "parentId": "fld_c5bba1b12a0f4675aab19c87c59951f1", "modified": 1693918655016, "created": 1693918647735, "url": "http://localhost:3000/shop/cart", @@ -250,8 +250,8 @@ "_type": "request" }, { - "_id": "req_500fa5c538bb438e8cde6b31a4be3ca1", - "parentId": "fld_2a99708adfcd4776b298ab2d0ba39b2a", + "_id": "req_2929c98febf54e4eab263a7ca4440149", + "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", "modified": 1693916681936, "created": 1693916564393, "url": "http://localhost:3000/shop/products/all", @@ -273,8 +273,8 @@ "_type": "request" }, { - "_id": "fld_2a99708adfcd4776b298ab2d0ba39b2a", - "parentId": "fld_6c3081c4b7a14864a3e68de8f0c0fd09", + "_id": "fld_cb4d1dbcafb64d61b5bae6a11982232e", + "parentId": "fld_ce89bf973c7049df95949e65662e24e0", "modified": 1693916554582, "created": 1693908857002, "name": "products", @@ -285,8 +285,8 @@ "_type": "request_group" }, { - "_id": "req_c3d9da746066412f9405cf98aab1457b", - "parentId": "fld_2a99708adfcd4776b298ab2d0ba39b2a", + "_id": "req_7506d5fbf8114be68fe2d743e5849cd4", + "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", "modified": 1693917409614, "created": 1693917344514, "url": "http://localhost:3000/shop/products/id/64edc5b96ad1cbae75d30260", @@ -308,8 +308,8 @@ "_type": "request" }, { - "_id": "req_52593de30ebf412f8df0789718dd8019", - "parentId": "fld_2a99708adfcd4776b298ab2d0ba39b2a", + "_id": "req_3f8a9b2ff0e14e1eb609bf21b9de602a", + "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", "modified": 1693916684919, "created": 1693916659552, "url": "http://localhost:3000/shop/products/categories", @@ -331,8 +331,8 @@ "_type": "request" }, { - "_id": "req_f92fd40b9a2b4cc5adc6bc2214975955", - "parentId": "fld_2a99708adfcd4776b298ab2d0ba39b2a", + "_id": "req_cc38765b67eb42cbba4b47186850ae58", + "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", "modified": 1693916714272, "created": 1693916710925, "url": "http://localhost:3000/shop/products/category/1", @@ -354,8 +354,8 @@ "_type": "request" }, { - "_id": "req_09ac22c2f2474be48b41480b938c3725", - "parentId": "fld_2a99708adfcd4776b298ab2d0ba39b2a", + "_id": "req_68ea4263b0c8469da85712276cd12b22", + "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", "modified": 1693916696386, "created": 1693916693438, "url": "http://localhost:3000/shop/products/brands", @@ -377,8 +377,8 @@ "_type": "request" }, { - "_id": "req_c78e1497b0e74b4dae3698c037c1bd40", - "parentId": "fld_2a99708adfcd4776b298ab2d0ba39b2a", + "_id": "req_82c97ac1dee1405993863057764e1236", + "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", "modified": 1693916738478, "created": 1693916726612, "url": "http://localhost:3000/shop/products/brand/apple", @@ -400,8 +400,8 @@ "_type": "request" }, { - "_id": "req_0e1f92cf487c4f67b315507fff9347eb", - "parentId": "fld_2a99708adfcd4776b298ab2d0ba39b2a", + "_id": "req_b0fcc13d78a649038a1c5a665b9b06db", + "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", "modified": 1693916793547, "created": 1693916631453, "url": "http://localhost:3000/shop/products/search?keywords=black", @@ -423,17 +423,20 @@ "_type": "request" }, { - "_id": "req_6b2c93235ad84b47b254f6029b8ba0a0", - "parentId": "fld_2a99708adfcd4776b298ab2d0ba39b2a", - "modified": 1693916848333, + "_id": "req_026ecafb94c14a1182f92c577468eb7c", + "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", + "modified": 1694519020765, "created": 1693916800785, "url": "http://localhost:3000/shop/products", "name": "Create product", "description": "", "method": "POST", - "body": {}, + "body": { "mimeType": "application/json", "text": "" }, "parameters": [], - "headers": [{ "name": "User-Agent", "value": "Insomnia/2023.5.7" }], + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "User-Agent", "value": "Insomnia/2023.5.7" } + ], "authentication": {}, "metaSortKey": -1693916631353, "isPrivate": false, @@ -446,8 +449,8 @@ "_type": "request" }, { - "_id": "req_4ecb9f1cb0bb42fab64d551c6238d679", - "parentId": "fld_2a99708adfcd4776b298ab2d0ba39b2a", + "_id": "req_77ca664feb014ab6a6a2ef47166442c4", + "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", "modified": 1693919082609, "created": 1693917220539, "url": "http://localhost:3000/shop/products/rate", @@ -472,8 +475,8 @@ "_type": "request" }, { - "_id": "req_7d0376b16505482b9f404f1ffa612808", - "parentId": "fld_2a99708adfcd4776b298ab2d0ba39b2a", + "_id": "req_31884a6232e240e0a620bea14b4c3570", + "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", "modified": 1693919085922, "created": 1693918026891, "url": "http://localhost:3000/shop/products/id/64edc5b96ad1cbae75d30260", @@ -498,8 +501,8 @@ "_type": "request" }, { - "_id": "req_c4405577661f4790812da96b66b96c62", - "parentId": "fld_2a99708adfcd4776b298ab2d0ba39b2a", + "_id": "req_1485f544fbe64c77bc42a94e20fedb57", + "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", "modified": 1693918172675, "created": 1693918133911, "url": "http://localhost:3000/shop/products/all", @@ -521,8 +524,8 @@ "_type": "request" }, { - "_id": "req_260aacb485ef4990bd8f08e58c71ec61", - "parentId": "fld_f2c783d75dfc4221af51c7cf20194a0d", + "_id": "req_69de4f6120fa4c57930cf90f60ec9da7", + "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", "modified": 1694110863418, "created": 1694110844080, "url": "http://localhost:3000/auth", @@ -544,20 +547,20 @@ "_type": "request" }, { - "_id": "fld_f2c783d75dfc4221af51c7cf20194a0d", - "parentId": "wrk_4ef933ea915748d5897746f14b654671", - "modified": 1693908848425, + "_id": "fld_bd44438b98614c7bb2a3fadc48379eeb", + "parentId": "wrk_cddddeca853e4720a57929758bac0eb7", + "modified": 1694519054447, "created": 1693902097619, "name": "auth", "description": "", "environment": {}, "environmentPropertyOrder": null, - "metaSortKey": -1693902097619, + "metaSortKey": -1693907154239, "_type": "request_group" }, { - "_id": "req_14752877265c4a77a8fd76a80687ede8", - "parentId": "fld_f2c783d75dfc4221af51c7cf20194a0d", + "_id": "req_59a01316973744e28eb22457d5d5f21d", + "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", "modified": 1694112971558, "created": 1694112676180, "url": "http://localhost:3000/auth/all", @@ -579,8 +582,8 @@ "_type": "request" }, { - "_id": "req_8a8f9e383e53460ab26c752a8f00e136", - "parentId": "fld_f2c783d75dfc4221af51c7cf20194a0d", + "_id": "req_038c9a88d14f4a4fbf0bffc695938838", + "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", "modified": 1694112682156, "created": 1694112030613, "url": "http://localhost:3000/auth/id/64eccb55fe7b573c1ec5aaae", @@ -602,8 +605,8 @@ "_type": "request" }, { - "_id": "req_afc930dd75d84f81b0987a21908967f8", - "parentId": "fld_f2c783d75dfc4221af51c7cf20194a0d", + "_id": "req_ae5188830fa9444798adac44abf30e0f", + "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", "modified": 1693919050169, "created": 1693902140340, "url": "http://localhost:3000/auth/sign_up", @@ -628,9 +631,9 @@ "_type": "request" }, { - "_id": "req_62f91e6a1c834b76b89d8c0b74c399a0", - "parentId": "fld_f2c783d75dfc4221af51c7cf20194a0d", - "modified": 1694113322234, + "_id": "req_b46715ede6564a6abcff1279ec27cd35", + "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", + "modified": 1694526382230, "created": 1693902632304, "url": "http://localhost:3000/auth/sign_in", "name": "Sign in", @@ -654,8 +657,8 @@ "_type": "request" }, { - "_id": "req_e74f13361635473892668587443eec66", - "parentId": "fld_f2c783d75dfc4221af51c7cf20194a0d", + "_id": "req_27ed77ca0690403a8e9965cef031b138", + "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", "modified": 1694113234872, "created": 1694113127974, "url": "http://localhost:3000/auth/logout", @@ -677,8 +680,8 @@ "_type": "request" }, { - "_id": "req_1a00c93bc972469faf49ea0ca57320be", - "parentId": "fld_f2c783d75dfc4221af51c7cf20194a0d", + "_id": "req_0f9cc4a65df844ec92ab03806cd2a0c5", + "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", "modified": 1693919058744, "created": 1693907088975, "url": "http://localhost:3000/auth/verify_email", @@ -703,8 +706,8 @@ "_type": "request" }, { - "_id": "req_57daa0dce4f547acb497ce23567f0db9", - "parentId": "fld_f2c783d75dfc4221af51c7cf20194a0d", + "_id": "req_f0b895cbe291453e89fb2422744d5654", + "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", "modified": 1693909612531, "created": 1693902735328, "url": "http://localhost:3000/auth/refresh", @@ -729,9 +732,9 @@ "_type": "request" }, { - "_id": "req_9384ca725b9246159bb1fd179b42586e", - "parentId": "fld_f2c783d75dfc4221af51c7cf20194a0d", - "modified": 1694113334002, + "_id": "req_17d8eca8e26d4f4ab4647da88e8addab", + "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", + "modified": 1694267399035, "created": 1693908748910, "url": "http://localhost:3000/auth/recovery", "name": "Reset password", @@ -755,8 +758,8 @@ "_type": "request" }, { - "_id": "req_b6eb70b43f92455497c48b4a85e69316", - "parentId": "fld_f2c783d75dfc4221af51c7cf20194a0d", + "_id": "req_baceb3788dc64b058663c8ca11e4267f", + "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", "modified": 1693909607505, "created": 1693908814193, "url": "http://localhost:3000/auth/update", @@ -781,8 +784,8 @@ "_type": "request" }, { - "_id": "req_70eda4705daf43e69b5247dfde9e6aba", - "parentId": "fld_f2c783d75dfc4221af51c7cf20194a0d", + "_id": "req_59a4462113734804bcca8b2773c5436a", + "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", "modified": 1693919069232, "created": 1693909251050, "url": "http://localhost:3000/auth/change_password", @@ -807,8 +810,8 @@ "_type": "request" }, { - "_id": "req_6cdec9c383e144aaa1e0d01b3365907c", - "parentId": "fld_f2c783d75dfc4221af51c7cf20194a0d", + "_id": "req_047706c9a5774d899b9d3a6afb84d507", + "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", "modified": 1693909599282, "created": 1693909567503, "url": "http://localhost:3000/auth/delete", @@ -830,8 +833,95 @@ "_type": "request" }, { - "_id": "env_28f2258bffa6f7493658e64d84b2d4646d8cc2a4", - "parentId": "wrk_4ef933ea915748d5897746f14b654671", + "_id": "req_9125e9b68cb94b56829697cbb56831ed", + "parentId": "fld_e840d8e2358f430bb4502f131024b985", + "modified": 1694519092775, + "created": 1694519059173, + "url": "http://localhost:3000/qrcode", + "name": "Default qrcode", + "description": "", + "method": "GET", + "body": {}, + "parameters": [], + "headers": [{ "name": "User-Agent", "value": "insomnia/2023.5.8" }], + "authentication": {}, + "metaSortKey": -1694519065597, + "isPrivate": false, + "settingStoreCookies": true, + "settingSendCookies": true, + "settingDisableRenderRequestBody": false, + "settingEncodeUrl": true, + "settingRebuildPath": true, + "settingFollowRedirects": "global", + "_type": "request" + }, + { + "_id": "fld_e840d8e2358f430bb4502f131024b985", + "parentId": "wrk_cddddeca853e4720a57929758bac0eb7", + "modified": 1694519052587, + "created": 1694519034267, + "name": "qrcode", + "description": "", + "environment": {}, + "environmentPropertyOrder": null, + "metaSortKey": -1693905468699, + "_type": "request_group" + }, + { + "_id": "req_929fcc495f8b4351a2b7c212d50ba230", + "parentId": "fld_e840d8e2358f430bb4502f131024b985", + "modified": 1694526371787, + "created": 1694524067494, + "url": "http://localhost:3000/qrcode/generate", + "name": "Generate", + "description": "", + "method": "POST", + "body": { "mimeType": "application/json", "text": "" }, + "parameters": [], + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "User-Agent", "value": "insomnia/2023.5.8" } + ], + "authentication": {}, + "metaSortKey": -1694519065497, + "isPrivate": false, + "settingStoreCookies": true, + "settingSendCookies": true, + "settingDisableRenderRequestBody": false, + "settingEncodeUrl": true, + "settingRebuildPath": true, + "settingFollowRedirects": "global", + "_type": "request" + }, + { + "_id": "req_67b7a53736b749eba07cc245eeba245f", + "parentId": "fld_e840d8e2358f430bb4502f131024b985", + "modified": 1694526373478, + "created": 1694524409029, + "url": "http://localhost:3000/qrcode/generate_with_image", + "name": "Generate with image", + "description": "", + "method": "POST", + "body": { "mimeType": "application/json", "text": "" }, + "parameters": [], + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "User-Agent", "value": "insomnia/2023.5.8" } + ], + "authentication": {}, + "metaSortKey": -1694519065397, + "isPrivate": false, + "settingStoreCookies": true, + "settingSendCookies": true, + "settingDisableRenderRequestBody": false, + "settingEncodeUrl": true, + "settingRebuildPath": true, + "settingFollowRedirects": "global", + "_type": "request" + }, + { + "_id": "env_d70e108a1bfe41ca8ff251cef1c1e9a5", + "parentId": "wrk_cddddeca853e4720a57929758bac0eb7", "modified": 1694104754476, "created": 1692100035451, "name": "Base Environment", @@ -843,37 +933,65 @@ "_type": "environment" }, { - "_id": "jar_28f2258bffa6f7493658e64d84b2d4646d8cc2a4", - "parentId": "wrk_4ef933ea915748d5897746f14b654671", - "modified": 1694110836275, + "_id": "jar_c4342b88e8714f248bb999416a49cd31", + "parentId": "wrk_cddddeca853e4720a57929758bac0eb7", + "modified": 1694509539570, "created": 1692100035452, "name": "Default Jar", "cookies": [ { "key": "access_token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMiwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTQxMTA4MzYsImV4cCI6MTY5NDExNDQzNn0.RLtPP5uFJvcFFkdm1OqDuUSX187g2A33GfzEQaI0qUM", - "expires": "2023-09-07T19:20:36.000Z", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMiwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTQ1MDk1MzksImV4cCI6MTY5NDUxMzEzOX0.cIaNnI48Lk7IKxWzoGhhg5jG2FbguOEfaJJwVmzU4dc", + "expires": "2023-09-12T10:05:39.000Z", "domain": "localhost", "path": "/", "secure": true, "httpOnly": true, "hostOnly": true, "creation": "2023-09-07T18:20:36.274Z", - "lastAccessed": "2023-09-07T18:20:36.274Z", - "id": "5133907119479373" + "lastAccessed": "2023-09-12T09:05:39.569Z", + "sameSite": "none", + "id": "4593084215682077" }, { "key": "refresh_token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMiwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTQxMTA4MzYsImV4cCI6MTY5NDcxNTYzNn0.3T3r1_jpTIpDsRZdmnG0Vt1udEHzjPZNF45Gv5Ed6oc", - "expires": "2023-09-14T18:20:36.000Z", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMiwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTQ1MDk1MzksImV4cCI6MTY5NTExNDMzOX0.9pJqeWCPQWT6wU5KCH_CaDnU1_hMQxf4yftNS8FsVvg", + "expires": "2023-09-19T09:05:39.000Z", "domain": "localhost", "path": "/", "secure": true, "httpOnly": true, "hostOnly": true, "creation": "2023-09-07T18:20:36.275Z", - "lastAccessed": "2023-09-07T18:20:36.275Z", - "id": "4113064954182799" + "lastAccessed": "2023-09-12T09:05:39.569Z", + "sameSite": "none", + "id": "5622771899700447" + }, + { + "key": "access_token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMiwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTQ1MDczMjcsImV4cCI6MTY5NDUxMDkyN30.iR63xf4QdoSNlYD6qE80y5hnQrgIXANVQxebEQ8I4f0", + "expires": "2023-09-12T09:28:47.000Z", + "domain": "everrest.educata.dev", + "path": "/", + "secure": true, + "httpOnly": true, + "hostOnly": true, + "creation": "2023-09-09T13:50:08.036Z", + "lastAccessed": "2023-09-12T08:28:48.272Z", + "id": "35108049377650064" + }, + { + "key": "refresh_token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMiwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTQ1MDczMjcsImV4cCI6MTY5NTExMjEyN30.ELrOkR8SRYd818_jl8m7xzG3MhhVNac-AhuG5_xOCig", + "expires": "2023-09-19T08:28:47.000Z", + "domain": "everrest.educata.dev", + "path": "/", + "secure": true, + "httpOnly": true, + "hostOnly": true, + "creation": "2023-09-09T13:50:08.037Z", + "lastAccessed": "2023-09-12T08:28:48.272Z", + "id": "1657699330217104" } ], "_type": "cookie_jar" diff --git a/docs/insomnia/Insomnia.yaml b/docs/insomnia/Insomnia.yaml index abc961a..1854fc8 100644 --- a/docs/insomnia/Insomnia.yaml +++ b/docs/insomnia/Insomnia.yaml @@ -1,10 +1,10 @@ _type: export __export_format: 4 -__export_date: 2023-09-07T19:03:46.227Z +__export_date: 2023-09-12T13:48:08.487Z __export_source: insomnia.desktop.app:v2023.5.8 resources: - - _id: req_f503108e57d848f692d0b89a321b7064 - parentId: fld_203fe6a1cd5e4274bc641ea44cee03b6 + - _id: req_4a83524bc8f8464f910b4b8121875f29 + parentId: fld_c44fd0258a0543379ca3c9d6981bd45a modified: 1694109977169 created: 1694104757818 url: http://localhost:3000 @@ -26,8 +26,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: fld_203fe6a1cd5e4274bc641ea44cee03b6 - parentId: wrk_4ef933ea915748d5897746f14b654671 + - _id: fld_c44fd0258a0543379ca3c9d6981bd45a + parentId: wrk_cddddeca853e4720a57929758bac0eb7 modified: 1694104747369 created: 1694104741476 name: root @@ -36,17 +36,17 @@ resources: environmentPropertyOrder: null metaSortKey: -1694104741476 _type: request_group - - _id: wrk_4ef933ea915748d5897746f14b654671 + - _id: wrk_cddddeca853e4720a57929758bac0eb7 parentId: null - modified: 1692100035449 - created: 1692100035449 + modified: 1694113474968 + created: 1694113474968 name: Everest description: "" scope: collection _type: workspace - - _id: req_d6543bdd53f446a89a010f9544ac9582 - parentId: fld_203fe6a1cd5e4274bc641ea44cee03b6 - modified: 1694109973086 + - _id: req_cd91052f7dfc44aa9aa798894d5c9d14 + parentId: fld_c44fd0258a0543379ca3c9d6981bd45a + modified: 1694264487911 created: 1694104795324 url: http://localhost:3000/lang/errors name: Errors @@ -67,8 +67,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_b17d5cbd6caf4dbcb2e0ee562600eb23 - parentId: fld_65c3b123e07542fba2c48d82d1566011 + - _id: req_2e11fa0e6cb543e5b69ce28733c9973c + parentId: fld_c5bba1b12a0f4675aab19c87c59951f1 modified: 1693918319125 created: 1693918297856 url: http://localhost:3000/shop/cart @@ -90,8 +90,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: fld_65c3b123e07542fba2c48d82d1566011 - parentId: fld_6c3081c4b7a14864a3e68de8f0c0fd09 + - _id: fld_c5bba1b12a0f4675aab19c87c59951f1 + parentId: fld_ce89bf973c7049df95949e65662e24e0 modified: 1693916555938 created: 1693908862581 name: cart @@ -100,8 +100,8 @@ resources: environmentPropertyOrder: null metaSortKey: -1693908857302 _type: request_group - - _id: fld_6c3081c4b7a14864a3e68de8f0c0fd09 - parentId: wrk_4ef933ea915748d5897746f14b654671 + - _id: fld_ce89bf973c7049df95949e65662e24e0 + parentId: wrk_cddddeca853e4720a57929758bac0eb7 modified: 1693908839779 created: 1693908839779 name: shop @@ -110,8 +110,8 @@ resources: environmentPropertyOrder: null metaSortKey: -1693908839779 _type: request_group - - _id: req_cf783a77f1754dbe8fa4645af1de82c9 - parentId: fld_65c3b123e07542fba2c48d82d1566011 + - _id: req_73287d6cd71a41d1824389c717cf3c43 + parentId: fld_c5bba1b12a0f4675aab19c87c59951f1 modified: 1693919005385 created: 1693918293668 url: http://localhost:3000/shop/cart/product @@ -137,8 +137,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_ce8bf261e61442f39c163a7c79ccc223 - parentId: fld_65c3b123e07542fba2c48d82d1566011 + - _id: req_8ba7281b071e4aa9b97a8076c1302bb5 + parentId: fld_c5bba1b12a0f4675aab19c87c59951f1 modified: 1693918605591 created: 1693918592075 url: http://localhost:3000/shop/cart/checkout @@ -164,8 +164,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_fd71e2fc98bc41e18755c8bf9529da3b - parentId: fld_65c3b123e07542fba2c48d82d1566011 + - _id: req_eb42dcbf9f7a4b5aa907265aefa75ede + parentId: fld_c5bba1b12a0f4675aab19c87c59951f1 modified: 1693919009738 created: 1693918494445 url: http://localhost:3000/shop/cart/product @@ -191,8 +191,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_e001d3a61fce49938e5f73ace9e6bc46 - parentId: fld_65c3b123e07542fba2c48d82d1566011 + - _id: req_1e9640498f784a89807a05a8d0eb43aa + parentId: fld_c5bba1b12a0f4675aab19c87c59951f1 modified: 1693919012384 created: 1693918569988 url: http://localhost:3000/shop/cart/product @@ -218,8 +218,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_23a40ef7a1fe4e0fb318329fc45994bb - parentId: fld_65c3b123e07542fba2c48d82d1566011 + - _id: req_821dc0d67da5499793d3b94056edc4fb + parentId: fld_c5bba1b12a0f4675aab19c87c59951f1 modified: 1693918655016 created: 1693918647735 url: http://localhost:3000/shop/cart @@ -245,8 +245,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_500fa5c538bb438e8cde6b31a4be3ca1 - parentId: fld_2a99708adfcd4776b298ab2d0ba39b2a + - _id: req_2929c98febf54e4eab263a7ca4440149 + parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e modified: 1693916681936 created: 1693916564393 url: http://localhost:3000/shop/products/all @@ -268,8 +268,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: fld_2a99708adfcd4776b298ab2d0ba39b2a - parentId: fld_6c3081c4b7a14864a3e68de8f0c0fd09 + - _id: fld_cb4d1dbcafb64d61b5bae6a11982232e + parentId: fld_ce89bf973c7049df95949e65662e24e0 modified: 1693916554582 created: 1693908857002 name: products @@ -278,8 +278,8 @@ resources: environmentPropertyOrder: null metaSortKey: -1693908857202 _type: request_group - - _id: req_c3d9da746066412f9405cf98aab1457b - parentId: fld_2a99708adfcd4776b298ab2d0ba39b2a + - _id: req_7506d5fbf8114be68fe2d743e5849cd4 + parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e modified: 1693917409614 created: 1693917344514 url: http://localhost:3000/shop/products/id/64edc5b96ad1cbae75d30260 @@ -301,8 +301,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_52593de30ebf412f8df0789718dd8019 - parentId: fld_2a99708adfcd4776b298ab2d0ba39b2a + - _id: req_3f8a9b2ff0e14e1eb609bf21b9de602a + parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e modified: 1693916684919 created: 1693916659552 url: http://localhost:3000/shop/products/categories @@ -324,8 +324,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_f92fd40b9a2b4cc5adc6bc2214975955 - parentId: fld_2a99708adfcd4776b298ab2d0ba39b2a + - _id: req_cc38765b67eb42cbba4b47186850ae58 + parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e modified: 1693916714272 created: 1693916710925 url: http://localhost:3000/shop/products/category/1 @@ -347,8 +347,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_09ac22c2f2474be48b41480b938c3725 - parentId: fld_2a99708adfcd4776b298ab2d0ba39b2a + - _id: req_68ea4263b0c8469da85712276cd12b22 + parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e modified: 1693916696386 created: 1693916693438 url: http://localhost:3000/shop/products/brands @@ -370,8 +370,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_c78e1497b0e74b4dae3698c037c1bd40 - parentId: fld_2a99708adfcd4776b298ab2d0ba39b2a + - _id: req_82c97ac1dee1405993863057764e1236 + parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e modified: 1693916738478 created: 1693916726612 url: http://localhost:3000/shop/products/brand/apple @@ -393,8 +393,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_0e1f92cf487c4f67b315507fff9347eb - parentId: fld_2a99708adfcd4776b298ab2d0ba39b2a + - _id: req_b0fcc13d78a649038a1c5a665b9b06db + parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e modified: 1693916793547 created: 1693916631453 url: http://localhost:3000/shop/products/search?keywords=black @@ -416,17 +416,21 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_6b2c93235ad84b47b254f6029b8ba0a0 - parentId: fld_2a99708adfcd4776b298ab2d0ba39b2a - modified: 1693916848333 + - _id: req_026ecafb94c14a1182f92c577468eb7c + parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e + modified: 1694519020765 created: 1693916800785 url: http://localhost:3000/shop/products name: Create product description: "" method: POST - body: {} + body: + mimeType: application/json + text: "" parameters: [] headers: + - name: Content-Type + value: application/json - name: User-Agent value: Insomnia/2023.5.7 authentication: {} @@ -439,8 +443,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_4ecb9f1cb0bb42fab64d551c6238d679 - parentId: fld_2a99708adfcd4776b298ab2d0ba39b2a + - _id: req_77ca664feb014ab6a6a2ef47166442c4 + parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e modified: 1693919082609 created: 1693917220539 url: http://localhost:3000/shop/products/rate @@ -466,8 +470,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_7d0376b16505482b9f404f1ffa612808 - parentId: fld_2a99708adfcd4776b298ab2d0ba39b2a + - _id: req_31884a6232e240e0a620bea14b4c3570 + parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e modified: 1693919085922 created: 1693918026891 url: http://localhost:3000/shop/products/id/64edc5b96ad1cbae75d30260 @@ -493,8 +497,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_c4405577661f4790812da96b66b96c62 - parentId: fld_2a99708adfcd4776b298ab2d0ba39b2a + - _id: req_1485f544fbe64c77bc42a94e20fedb57 + parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e modified: 1693918172675 created: 1693918133911 url: http://localhost:3000/shop/products/all @@ -516,8 +520,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_260aacb485ef4990bd8f08e58c71ec61 - parentId: fld_f2c783d75dfc4221af51c7cf20194a0d + - _id: req_69de4f6120fa4c57930cf90f60ec9da7 + parentId: fld_bd44438b98614c7bb2a3fadc48379eeb modified: 1694110863418 created: 1694110844080 url: http://localhost:3000/auth @@ -539,18 +543,18 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: fld_f2c783d75dfc4221af51c7cf20194a0d - parentId: wrk_4ef933ea915748d5897746f14b654671 - modified: 1693908848425 + - _id: fld_bd44438b98614c7bb2a3fadc48379eeb + parentId: wrk_cddddeca853e4720a57929758bac0eb7 + modified: 1694519054447 created: 1693902097619 name: auth description: "" environment: {} environmentPropertyOrder: null - metaSortKey: -1693902097619 + metaSortKey: -1693907154239 _type: request_group - - _id: req_14752877265c4a77a8fd76a80687ede8 - parentId: fld_f2c783d75dfc4221af51c7cf20194a0d + - _id: req_59a01316973744e28eb22457d5d5f21d + parentId: fld_bd44438b98614c7bb2a3fadc48379eeb modified: 1694112971558 created: 1694112676180 url: http://localhost:3000/auth/all @@ -572,8 +576,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_8a8f9e383e53460ab26c752a8f00e136 - parentId: fld_f2c783d75dfc4221af51c7cf20194a0d + - _id: req_038c9a88d14f4a4fbf0bffc695938838 + parentId: fld_bd44438b98614c7bb2a3fadc48379eeb modified: 1694112682156 created: 1694112030613 url: http://localhost:3000/auth/id/64eccb55fe7b573c1ec5aaae @@ -595,8 +599,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_afc930dd75d84f81b0987a21908967f8 - parentId: fld_f2c783d75dfc4221af51c7cf20194a0d + - _id: req_ae5188830fa9444798adac44abf30e0f + parentId: fld_bd44438b98614c7bb2a3fadc48379eeb modified: 1693919050169 created: 1693902140340 url: http://localhost:3000/auth/sign_up @@ -622,9 +626,9 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_62f91e6a1c834b76b89d8c0b74c399a0 - parentId: fld_f2c783d75dfc4221af51c7cf20194a0d - modified: 1694113322234 + - _id: req_b46715ede6564a6abcff1279ec27cd35 + parentId: fld_bd44438b98614c7bb2a3fadc48379eeb + modified: 1694526382230 created: 1693902632304 url: http://localhost:3000/auth/sign_in name: Sign in @@ -649,8 +653,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_e74f13361635473892668587443eec66 - parentId: fld_f2c783d75dfc4221af51c7cf20194a0d + - _id: req_27ed77ca0690403a8e9965cef031b138 + parentId: fld_bd44438b98614c7bb2a3fadc48379eeb modified: 1694113234872 created: 1694113127974 url: http://localhost:3000/auth/logout @@ -672,8 +676,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_1a00c93bc972469faf49ea0ca57320be - parentId: fld_f2c783d75dfc4221af51c7cf20194a0d + - _id: req_0f9cc4a65df844ec92ab03806cd2a0c5 + parentId: fld_bd44438b98614c7bb2a3fadc48379eeb modified: 1693919058744 created: 1693907088975 url: http://localhost:3000/auth/verify_email @@ -699,8 +703,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_57daa0dce4f547acb497ce23567f0db9 - parentId: fld_f2c783d75dfc4221af51c7cf20194a0d + - _id: req_f0b895cbe291453e89fb2422744d5654 + parentId: fld_bd44438b98614c7bb2a3fadc48379eeb modified: 1693909612531 created: 1693902735328 url: http://localhost:3000/auth/refresh @@ -726,9 +730,9 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_9384ca725b9246159bb1fd179b42586e - parentId: fld_f2c783d75dfc4221af51c7cf20194a0d - modified: 1694113334002 + - _id: req_17d8eca8e26d4f4ab4647da88e8addab + parentId: fld_bd44438b98614c7bb2a3fadc48379eeb + modified: 1694267399035 created: 1693908748910 url: http://localhost:3000/auth/recovery name: Reset password @@ -753,8 +757,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_b6eb70b43f92455497c48b4a85e69316 - parentId: fld_f2c783d75dfc4221af51c7cf20194a0d + - _id: req_baceb3788dc64b058663c8ca11e4267f + parentId: fld_bd44438b98614c7bb2a3fadc48379eeb modified: 1693909607505 created: 1693908814193 url: http://localhost:3000/auth/update @@ -780,8 +784,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_70eda4705daf43e69b5247dfde9e6aba - parentId: fld_f2c783d75dfc4221af51c7cf20194a0d + - _id: req_59a4462113734804bcca8b2773c5436a + parentId: fld_bd44438b98614c7bb2a3fadc48379eeb modified: 1693919069232 created: 1693909251050 url: http://localhost:3000/auth/change_password @@ -807,8 +811,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_6cdec9c383e144aaa1e0d01b3365907c - parentId: fld_f2c783d75dfc4221af51c7cf20194a0d + - _id: req_047706c9a5774d899b9d3a6afb84d507 + parentId: fld_bd44438b98614c7bb2a3fadc48379eeb modified: 1693909599282 created: 1693909567503 url: http://localhost:3000/auth/delete @@ -830,8 +834,95 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: env_28f2258bffa6f7493658e64d84b2d4646d8cc2a4 - parentId: wrk_4ef933ea915748d5897746f14b654671 + - _id: req_9125e9b68cb94b56829697cbb56831ed + parentId: fld_e840d8e2358f430bb4502f131024b985 + modified: 1694519092775 + created: 1694519059173 + url: http://localhost:3000/qrcode + name: Default qrcode + description: "" + method: GET + body: {} + parameters: [] + headers: + - name: User-Agent + value: insomnia/2023.5.8 + authentication: {} + metaSortKey: -1694519065597 + isPrivate: false + settingStoreCookies: true + settingSendCookies: true + settingDisableRenderRequestBody: false + settingEncodeUrl: true + settingRebuildPath: true + settingFollowRedirects: global + _type: request + - _id: fld_e840d8e2358f430bb4502f131024b985 + parentId: wrk_cddddeca853e4720a57929758bac0eb7 + modified: 1694519052587 + created: 1694519034267 + name: qrcode + description: "" + environment: {} + environmentPropertyOrder: null + metaSortKey: -1693905468699 + _type: request_group + - _id: req_929fcc495f8b4351a2b7c212d50ba230 + parentId: fld_e840d8e2358f430bb4502f131024b985 + modified: 1694526371787 + created: 1694524067494 + url: http://localhost:3000/qrcode/generate + name: Generate + description: "" + method: POST + body: + mimeType: application/json + text: "" + parameters: [] + headers: + - name: Content-Type + value: application/json + - name: User-Agent + value: insomnia/2023.5.8 + authentication: {} + metaSortKey: -1694519065497 + isPrivate: false + settingStoreCookies: true + settingSendCookies: true + settingDisableRenderRequestBody: false + settingEncodeUrl: true + settingRebuildPath: true + settingFollowRedirects: global + _type: request + - _id: req_67b7a53736b749eba07cc245eeba245f + parentId: fld_e840d8e2358f430bb4502f131024b985 + modified: 1694526373478 + created: 1694524409029 + url: http://localhost:3000/qrcode/generate_with_image + name: Generate with image + description: "" + method: POST + body: + mimeType: application/json + text: "" + parameters: [] + headers: + - name: Content-Type + value: application/json + - name: User-Agent + value: insomnia/2023.5.8 + authentication: {} + metaSortKey: -1694519065397 + isPrivate: false + settingStoreCookies: true + settingSendCookies: true + settingDisableRenderRequestBody: false + settingEncodeUrl: true + settingRebuildPath: true + settingFollowRedirects: global + _type: request + - _id: env_d70e108a1bfe41ca8ff251cef1c1e9a5 + parentId: wrk_cddddeca853e4720a57929758bac0eb7 modified: 1694104754476 created: 1692100035451 name: Base Environment @@ -841,32 +932,56 @@ resources: isPrivate: false metaSortKey: 1692100035451 _type: environment - - _id: jar_28f2258bffa6f7493658e64d84b2d4646d8cc2a4 - parentId: wrk_4ef933ea915748d5897746f14b654671 - modified: 1694110836275 + - _id: jar_c4342b88e8714f248bb999416a49cd31 + parentId: wrk_cddddeca853e4720a57929758bac0eb7 + modified: 1694509539570 created: 1692100035452 name: Default Jar cookies: - key: access_token - value: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMiwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTQxMTA4MzYsImV4cCI6MTY5NDExNDQzNn0.RLtPP5uFJvcFFkdm1OqDuUSX187g2A33GfzEQaI0qUM - expires: 2023-09-07T19:20:36.000Z + value: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMiwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTQ1MDk1MzksImV4cCI6MTY5NDUxMzEzOX0.cIaNnI48Lk7IKxWzoGhhg5jG2FbguOEfaJJwVmzU4dc + expires: 2023-09-12T10:05:39.000Z domain: localhost path: / secure: true httpOnly: true hostOnly: true creation: 2023-09-07T18:20:36.274Z - lastAccessed: 2023-09-07T18:20:36.274Z - id: "5133907119479373" + lastAccessed: 2023-09-12T09:05:39.569Z + sameSite: none + id: "4593084215682077" - key: refresh_token - value: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMiwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTQxMTA4MzYsImV4cCI6MTY5NDcxNTYzNn0.3T3r1_jpTIpDsRZdmnG0Vt1udEHzjPZNF45Gv5Ed6oc - expires: 2023-09-14T18:20:36.000Z + value: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMiwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTQ1MDk1MzksImV4cCI6MTY5NTExNDMzOX0.9pJqeWCPQWT6wU5KCH_CaDnU1_hMQxf4yftNS8FsVvg + expires: 2023-09-19T09:05:39.000Z domain: localhost path: / secure: true httpOnly: true hostOnly: true creation: 2023-09-07T18:20:36.275Z - lastAccessed: 2023-09-07T18:20:36.275Z - id: "4113064954182799" + lastAccessed: 2023-09-12T09:05:39.569Z + sameSite: none + id: "5622771899700447" + - key: access_token + value: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMiwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTQ1MDczMjcsImV4cCI6MTY5NDUxMDkyN30.iR63xf4QdoSNlYD6qE80y5hnQrgIXANVQxebEQ8I4f0 + expires: 2023-09-12T09:28:47.000Z + domain: everrest.educata.dev + path: / + secure: true + httpOnly: true + hostOnly: true + creation: 2023-09-09T13:50:08.036Z + lastAccessed: 2023-09-12T08:28:48.272Z + id: "35108049377650064" + - key: refresh_token + value: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMiwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTQ1MDczMjcsImV4cCI6MTY5NTExMjEyN30.ELrOkR8SRYd818_jl8m7xzG3MhhVNac-AhuG5_xOCig + expires: 2023-09-19T08:28:47.000Z + domain: everrest.educata.dev + path: / + secure: true + httpOnly: true + hostOnly: true + creation: 2023-09-09T13:50:08.037Z + lastAccessed: 2023-09-12T08:28:48.272Z + id: "1657699330217104" _type: cookie_jar diff --git a/endpoints.md b/endpoints.md index eac09fd..946a4d8 100644 --- a/endpoints.md +++ b/endpoints.md @@ -44,4 +44,12 @@ prefix - /`shop`/`...` - `POST` cart/checkout | jwt - `PATCH` cart/product | { id, quantity } | jwt - `DELETE` cart/product | { id } | jwt -- `DELETE` cart | (clear current cart) | jwt \ No newline at end of file +- `DELETE` cart | (clear current cart) | jwt + +## QrCode + +prefix - /`qrcode` + +- `GET` qrcode +- `POST` qrcode/generate +- `POST` qrcode/generate_with_image \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 78b2e94..487cae4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "everrest", - "version": "0.0.8", + "version": "0.0.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "everrest", - "version": "0.0.8", + "version": "0.0.9", "license": "UNLICENSED", "dependencies": { "@nestjs-modules/mailer": "^1.9.1", @@ -20,9 +20,11 @@ "@nestjs/platform-express": "^10.0.0", "@nestjs/swagger": "^7.1.10", "bcrypt": "^5.1.1", + "canvas": "^2.11.2", "class-transformer": "^0.5.1", "class-validator": "^0.14.0", "cookie-parser": "^1.4.6", + "easyqrcodejs": "^4.4.13", "handlebars": "^4.7.8", "mongoose": "^7.4.2", "nodemailer": "^6.9.4", @@ -30,6 +32,7 @@ "passport-jwt": "^4.0.1", "passport-local": "^1.0.0", "passport-strategy": "^1.0.0", + "qrcode": "^1.5.3", "reflect-metadata": "^0.1.13", "rxjs": "^7.8.1" }, @@ -47,6 +50,7 @@ "@types/nodemailer": "^6.4.9", "@types/passport-jwt": "^3.0.9", "@types/passport-local": "^1.0.35", + "@types/qrcode": "^1.5.2", "@types/supertest": "^2.0.12", "@typescript-eslint/eslint-plugin": "^5.59.11", "@typescript-eslint/parser": "^5.59.11", @@ -2759,6 +2763,15 @@ "integrity": "sha512-SnHmG9wN1UVmagJOnyo/qkk0Z7gejYxOYYmaAwr5u2yFYfsupN3sg10kyzN8Hep/2zbHxCnsumxOoRIRMBwKCg==", "optional": true }, + "node_modules/@types/qrcode": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@types/qrcode/-/qrcode-1.5.2.tgz", + "integrity": "sha512-W4KDz75m7rJjFbyCctzCtRzZUj+PrUHV+YjqDp50sSRezTbrtEAIq2iTzC6lISARl3qw+8IlcCyljdcVJE0Wug==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/qs": { "version": "6.9.7", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", @@ -3908,7 +3921,6 @@ "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true, "engines": { "node": ">=6" } @@ -3950,6 +3962,20 @@ } ] }, + "node_modules/canvas": { + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.11.2.tgz", + "integrity": "sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==", + "hasInstallScript": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.0", + "nan": "^2.17.0", + "simple-get": "^3.0.3" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -4835,7 +4861,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -4865,6 +4890,17 @@ "node": ">=0.10.0" } }, + "node_modules/decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "dependencies": { + "mimic-response": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/dedent": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", @@ -5012,6 +5048,11 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/dijkstrajs": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz", + "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==" + }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -5214,6 +5255,11 @@ "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, + "node_modules/easyqrcodejs": { + "version": "4.4.13", + "resolved": "https://registry.npmjs.org/easyqrcodejs/-/easyqrcodejs-4.4.13.tgz", + "integrity": "sha512-NulfMl+bhx/gAjZcBjgNd99jqPE5wEho1Z3nZwnKNISu0STnVq0xFQ28SVhcnOwt+47BJ80dULVNzpGIwYi66A==" + }, "node_modules/ecdsa-sig-formatter": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", @@ -5312,6 +5358,11 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, + "node_modules/encode-utf8": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/encode-utf8/-/encode-utf8-1.0.3.tgz", + "integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==" + }, "node_modules/encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -6356,19 +6407,6 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/ftp": { "version": "0.3.10", "resolved": "https://registry.npmjs.org/ftp/-/ftp-0.3.10.tgz", @@ -9122,6 +9160,17 @@ "node": ">=6" } }, + "node_modules/mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", @@ -9822,6 +9871,11 @@ "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true }, + "node_modules/nan": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz", + "integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==" + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -10195,7 +10249,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, "engines": { "node": ">=6" } @@ -10381,7 +10434,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, "engines": { "node": ">=8" } @@ -10581,6 +10633,14 @@ "node": ">=4" } }, + "node_modules/pngjs": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz", + "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==", + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -10886,6 +10946,132 @@ "teleport": ">=0.2.0" } }, + "node_modules/qrcode": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.3.tgz", + "integrity": "sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg==", + "dependencies": { + "dijkstrajs": "^1.0.1", + "encode-utf8": "^1.0.3", + "pngjs": "^5.0.0", + "yargs": "^15.3.1" + }, + "bin": { + "qrcode": "bin/qrcode" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/qrcode/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/qrcode/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qrcode/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qrcode/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/qrcode/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qrcode/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qrcode/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "node_modules/qrcode/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qrcode/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/qs": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", @@ -11239,6 +11425,11 @@ "node": ">=0.10.0" } }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, "node_modules/resolve": { "version": "1.22.4", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz", @@ -11804,6 +11995,35 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/simple-get": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", + "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", + "dependencies": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "node_modules/sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", @@ -13333,6 +13553,11 @@ "node": ">= 8" } }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==" + }, "node_modules/wide-align": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", diff --git a/package.json b/package.json index b81272e..6bc51be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "everrest", - "version": "0.0.8", + "version": "0.0.9", "description": "", "author": "", "private": true, @@ -35,9 +35,11 @@ "@nestjs/platform-express": "^10.0.0", "@nestjs/swagger": "^7.1.10", "bcrypt": "^5.1.1", + "canvas": "^2.11.2", "class-transformer": "^0.5.1", "class-validator": "^0.14.0", "cookie-parser": "^1.4.6", + "easyqrcodejs": "^4.4.13", "handlebars": "^4.7.8", "mongoose": "^7.4.2", "nodemailer": "^6.9.4", @@ -45,6 +47,7 @@ "passport-jwt": "^4.0.1", "passport-local": "^1.0.0", "passport-strategy": "^1.0.0", + "qrcode": "^1.5.3", "reflect-metadata": "^0.1.13", "rxjs": "^7.8.1" }, @@ -62,6 +65,7 @@ "@types/nodemailer": "^6.4.9", "@types/passport-jwt": "^3.0.9", "@types/passport-local": "^1.0.35", + "@types/qrcode": "^1.5.2", "@types/supertest": "^2.0.12", "@typescript-eslint/eslint-plugin": "^5.59.11", "@typescript-eslint/parser": "^5.59.11", diff --git a/src/app.controller.ts b/src/app.controller.ts index 276042c..72ea104 100644 --- a/src/app.controller.ts +++ b/src/app.controller.ts @@ -8,6 +8,7 @@ import { GlobalExceptionKeys, ProductExceptionKeys, ExceptionStatusKeys, + QRCodeExpectionKeys, } from 'src/enums'; @ApiTags('root') @@ -31,6 +32,7 @@ export class AppController { ...ProductExceptionKeys, ...AuthExpectionKeys, ...CartExpectionKeys, + ...QRCodeExpectionKeys, }); } } diff --git a/src/app.module.ts b/src/app.module.ts index de0f044..9365e9b 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -4,7 +4,7 @@ import { MongooseModule } from '@nestjs/mongoose'; import { AppController } from './app.controller'; import { AppService } from './app.service'; -import { ShopModule, UserModule, MailModule } from './modules'; +import { ShopModule, UserModule, MailModule, QrCodeModule } from './modules'; import { ExceptionService, EncryptionService } from './shared'; @Module({ imports: [ @@ -13,6 +13,7 @@ import { ExceptionService, EncryptionService } from './shared'; ShopModule, UserModule, MailModule, + QrCodeModule, ], controllers: [AppController], providers: [AppService, ExceptionService, EncryptionService], diff --git a/src/enums/exceptions.enum.ts b/src/enums/exceptions.enum.ts index 2f6740a..0c8392d 100644 --- a/src/enums/exceptions.enum.ts +++ b/src/enums/exceptions.enum.ts @@ -104,3 +104,8 @@ export enum CartExpectionKeys { CartDontHaveThisItem = 'errors.cart_do_not_have_this_item', CartAlreadyDeleted = 'errors.cart_already_deleted', } + +export enum QRCodeExpectionKeys { + TextShouldNotBeEmpty = 'errors.text_should_not_be_empty', + ImageUrlShouldNotBeEmpty = 'errors.image_url_should_not_be_empty', +} diff --git a/src/main.ts b/src/main.ts index 35e2084..d852c81 100644 --- a/src/main.ts +++ b/src/main.ts @@ -28,7 +28,7 @@ async function bootstrap() { const config = new DocumentBuilder() .setTitle('EverREST') .setDescription('EverREST API description') - .setVersion('0.0.0') + .setVersion('0.0.9') .build(); const document = SwaggerModule.createDocument(app, config); diff --git a/src/modules/index.ts b/src/modules/index.ts index 3a1c781..a9f345f 100644 --- a/src/modules/index.ts +++ b/src/modules/index.ts @@ -1,3 +1,4 @@ export * from './shop'; export * from './user'; export * from './mail'; +export * from './qrcode'; diff --git a/src/modules/qrcode/dtos/generate-qr-image.dto.ts b/src/modules/qrcode/dtos/generate-qr-image.dto.ts new file mode 100644 index 0000000..2517c08 --- /dev/null +++ b/src/modules/qrcode/dtos/generate-qr-image.dto.ts @@ -0,0 +1,10 @@ +import { IsString } from 'class-validator'; +import { QRCodeExpectionKeys } from 'src/enums'; + +export class GenerateQrCodeWithImageDto { + @IsString({ message: QRCodeExpectionKeys.TextShouldNotBeEmpty }) + text: string; + + @IsString({ message: QRCodeExpectionKeys.ImageUrlShouldNotBeEmpty }) + imageURL: string; +} diff --git a/src/modules/qrcode/dtos/generate-qr.dto.ts b/src/modules/qrcode/dtos/generate-qr.dto.ts new file mode 100644 index 0000000..df70324 --- /dev/null +++ b/src/modules/qrcode/dtos/generate-qr.dto.ts @@ -0,0 +1,7 @@ +import { IsString } from 'class-validator'; +import { QRCodeExpectionKeys } from 'src/enums'; + +export class GenerateQrCodeDto { + @IsString({ message: QRCodeExpectionKeys.TextShouldNotBeEmpty }) + text: string; +} diff --git a/src/modules/qrcode/dtos/index.ts b/src/modules/qrcode/dtos/index.ts new file mode 100644 index 0000000..0ec4a68 --- /dev/null +++ b/src/modules/qrcode/dtos/index.ts @@ -0,0 +1,2 @@ +export * from './generate-qr.dto'; +export * from './generate-qr-image.dto'; diff --git a/src/modules/qrcode/index.ts b/src/modules/qrcode/index.ts new file mode 100644 index 0000000..e50354e --- /dev/null +++ b/src/modules/qrcode/index.ts @@ -0,0 +1,3 @@ +export * from './qrcode.module'; +export * from './qrcode.controller'; +export * from './qrcode.service'; diff --git a/src/modules/qrcode/qrcode.controller.ts b/src/modules/qrcode/qrcode.controller.ts new file mode 100644 index 0000000..05d74e4 --- /dev/null +++ b/src/modules/qrcode/qrcode.controller.ts @@ -0,0 +1,28 @@ +import { Body, Controller, Get, Post } from '@nestjs/common'; +import { ApiTags } from '@nestjs/swagger'; +import { QrCodeService } from './qrcode.service'; +import { GenerateQrCodeDto, GenerateQrCodeWithImageDto } from './dtos'; + +@ApiTags('qrcode') +@Controller('qrcode') +export class QrCodeController { + constructor(private qrCodeService: QrCodeService) {} + + @Get() + generateDefaultQrCode() { + return this.qrCodeService.generateQRCodeWithImage( + 'https://everrest.educata.dev', + this.qrCodeService.basePath, + ); + } + + @Post('generate') + generateWithText(@Body() body: GenerateQrCodeDto) { + return this.qrCodeService.generateQrCode(body.text); + } + + @Post('generate_with_image') + generateWithImage(@Body() body: GenerateQrCodeWithImageDto) { + return this.qrCodeService.generateQRCodeWithImage(body.text, body.imageURL); + } +} diff --git a/src/modules/qrcode/qrcode.module.ts b/src/modules/qrcode/qrcode.module.ts new file mode 100644 index 0000000..f70ed97 --- /dev/null +++ b/src/modules/qrcode/qrcode.module.ts @@ -0,0 +1,10 @@ +import { Module } from '@nestjs/common'; +import { QrCodeController } from './qrcode.controller'; +import { QrCodeService } from './qrcode.service'; + +@Module({ + imports: [], + providers: [QrCodeService], + controllers: [QrCodeController], +}) +export class QrCodeModule {} diff --git a/src/modules/qrcode/qrcode.service.ts b/src/modules/qrcode/qrcode.service.ts new file mode 100644 index 0000000..2a8afd7 --- /dev/null +++ b/src/modules/qrcode/qrcode.service.ts @@ -0,0 +1,64 @@ +import { Injectable } from '@nestjs/common'; +import { createCanvas, loadImage } from 'canvas'; +import * as QRCode from 'qrcode'; + +@Injectable() +export class QrCodeService { + readonly basePath = 'assets/images/educata-bg-white.png'; + + generateQrCode(text: string): Promise { + return new Promise((resolve, reject) => { + QRCode.toDataURL(text, (err, url) => { + if (err) { + reject(err); + } + resolve(url); + }); + }); + } + + async generateQRCodeWithImage( + value: string, + imageSrc: string, + ): Promise { + const qrCode = QRCode.create(value, { errorCorrectionLevel: 'H' }); + const canvas = createCanvas( + qrCode.modules.size * 8, + qrCode.modules.size * 8, + ); + const ctx = canvas.getContext('2d'); + QRCode.toCanvas( + canvas, + value, + { errorCorrectionLevel: 'H', margin: 0 }, + (error) => error ?? '', + ); + + const center = canvas.width / 2; + const imageWidth = canvas.width / 4; + const imageHeight = canvas.height / 4; + + ctx.beginPath(); + ctx.arc(center, center, imageWidth / 2 + 5, 0, 2 * Math.PI); + ctx.strokeStyle = '#fff'; + ctx.lineWidth = 10; + ctx.stroke(); + ctx.closePath(); + ctx.clip(); + + ctx.fillStyle = '#fff'; + ctx.fill(); + + const image = await loadImage(imageSrc); + + ctx.drawImage( + image, + center - imageWidth / 2, + center - imageHeight / 2, + imageWidth, + imageHeight, + ); + + return canvas.toDataURL(); + } +}