From 38d06429f03fe9731881dc6d3a793f6d5d3ca90b Mon Sep 17 00:00:00 2001 From: Kosta <68782786+KostaD02@users.noreply.github.com> Date: Sat, 30 Sep 2023 19:18:53 +0400 Subject: [PATCH] feat: quote module (#63) * docs: added quote endpoint specification * refactor: scroll behavior * feat: added boilerplate for module * feat: add endpoint for creating quote * feat: added get random quote * feat: added get all quote * feat: added update/delete endpoint for quotes * docs: updated workspae * docs: added quote in doc webiste * chore(release): 1.10.0 --- CHANGELOG.md | 78 +++++ docs/.vitepress/config.mts | 3 +- docs/index.md | 4 + docs/quote.md | 3 + endpoints.md | 12 +- package-lock.json | 4 +- package.json | 2 +- src/app.controller.ts | 2 + src/app.module.ts | 2 + src/enums/exceptions.enum.ts | 9 + src/modules/quote/dtos/all-quote.dto.ts | 13 + src/modules/quote/dtos/index.ts | 3 + src/modules/quote/dtos/quote.dto.ts | 10 + src/modules/quote/dtos/update-quote.dto.ts | 12 + src/modules/quote/index.ts | 4 + src/modules/quote/quote.controller.ts | 63 ++++ src/modules/quote/quote.module.ts | 25 ++ src/modules/quote/quote.service.ts | 111 +++++++ src/schemas/index.ts | 1 + src/schemas/quote/index.ts | 1 + src/schemas/quote/quote.schema.ts | 12 + src/schemas/shop/cart.schema.ts | 76 ++--- src/schemas/shop/product.schema.ts | 2 +- src/schemas/user/user.schema.ts | 2 +- workspace/insomnia/Insomnia.json | 350 ++++++++++++++------- workspace/insomnia/Insomnia.yaml | 349 +++++++++++++------- 26 files changed, 888 insertions(+), 265 deletions(-) create mode 100644 docs/quote.md create mode 100644 src/modules/quote/dtos/all-quote.dto.ts create mode 100644 src/modules/quote/dtos/index.ts create mode 100644 src/modules/quote/dtos/quote.dto.ts create mode 100644 src/modules/quote/dtos/update-quote.dto.ts create mode 100644 src/modules/quote/index.ts create mode 100644 src/modules/quote/quote.controller.ts create mode 100644 src/modules/quote/quote.module.ts create mode 100644 src/modules/quote/quote.service.ts create mode 100644 src/schemas/quote/index.ts create mode 100644 src/schemas/quote/quote.schema.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 68dbada..3d4b2a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,84 @@ 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. +## 1.10.0 (2023-09-30) + + +### 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 endpoint for creating quote ([a82f609](https://github.com/educata/everrest/commit/a82f609fe85f6013e7eed102a37946920f9ead4a)) +* 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 boilerplate for module ([b713199](https://github.com/educata/everrest/commit/b71319987095b33dc4b5fb48fae3b920561f6513)) +* added get all quote ([85e031c](https://github.com/educata/everrest/commit/85e031ce5c37b7a857b2697c93f753dc62d55012)) +* added get random quote ([ef8fa85](https://github.com/educata/everrest/commit/ef8fa85e344004114d1253d4ddbad04e98be00bd)) +* 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 update/delete endpoint for quotes ([3b79b71](https://github.com/educata/everrest/commit/3b79b71fe4b5c1d04eb1ddce8a39a9735a740a6d)) +* 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)) +* error-response update ([#62](https://github.com/educata/everrest/issues/62)) ([e9c9cf7](https://github.com/educata/everrest/commit/e9c9cf7f17cb5a35ce7aae8c72ab55e26e10b15d)) +* 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 qrcode generator endpoints with text/images ([#33](https://github.com/educata/everrest/issues/33)) ([9b8cef4](https://github.com/educata/everrest/commit/9b8cef48692c77f54a8be0e9414108d8ec0dafbe)) +* **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 endpoint ([#52](https://github.com/educata/everrest/issues/52)) ([192bd4f](https://github.com/educata/everrest/commit/192bd4ffa5e003964fd018b718f566ca332475d4)) +* **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)) +* failing documentation build ([#42](https://github.com/educata/everrest/issues/42)) ([4703adc](https://github.com/educata/everrest/commit/4703adc35ed62750a72eeb96dea2ff8965ffa5cd)) +* file name typo ([168299e](https://github.com/educata/everrest/commit/168299ee890427fe989112c73280b84f059341d9)) +* handling os commands differently for windows and linux ([#37](https://github.com/educata/everrest/issues/37)) ([e85670c](https://github.com/educata/everrest/commit/e85670c949318102c1ff70a03eb828b1029c784c)) +* 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)) +* serialize user at update ([#53](https://github.com/educata/everrest/issues/53)) ([953c711](https://github.com/educata/everrest/commit/953c7111df4f419618dbbbeae947d15caba17ee9)) +* **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)) +* todos and implemented title check ([#40](https://github.com/educata/everrest/issues/40)) ([6e18590](https://github.com/educata/everrest/commit/6e185907b681fdc1312aa7752398ed3ee76ed458)) +* **user:** correct user interface and added user schema ([8072894](https://github.com/educata/everrest/commit/807289409ce393c7fa892d141773f3845adef4e9)) +* wrong heroku worker name ([#43](https://github.com/educata/everrest/issues/43)) ([8280721](https://github.com/educata/everrest/commit/8280721bc849c64499b1eeff7b23164d1781ee51)) + ## 1.9.0 (2023-09-27) diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 023e162..a934050 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -6,7 +6,7 @@ export default defineConfig({ title: 'EverREST', description: 'Build real CRUD applications with EverREST API', lang: 'en-US', - head: [...Metadata, ['style', {}, 'html { scroll-behavior: smooth; }']], + head: [...Metadata, ['style', {}, 'html { scroll-behavior: smooth; @media (prefers-reduced-motion) { html { scroll-behavior: initial; } }']], themeConfig: { // https://vitepress.dev/reference/default-theme-config nav: [ @@ -29,6 +29,7 @@ export default defineConfig({ ], }, { text: 'QR', link: '/qr' }, + { text: 'Quote', link: '/quote'}, { text: 'Errors', link: '/errors' }, { text: 'Team Members', link: '/team' }, ], diff --git a/docs/index.md b/docs/index.md index 3ff6db8..e73f12f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -30,6 +30,10 @@ features: details: Generate a QR code with or without image icon: link: /qr + - title: Quote + details: Get quotes from games, movies, series, and general topics + icon: + link: /quote - title: Chat details: Coming soon... icon: 🗨️ diff --git a/docs/quote.md b/docs/quote.md new file mode 100644 index 0000000..6ff5ae5 --- /dev/null +++ b/docs/quote.md @@ -0,0 +1,3 @@ +# Quote + +Coming soon... \ No newline at end of file diff --git a/endpoints.md b/endpoints.md index 946a4d8..f1c7a69 100644 --- a/endpoints.md +++ b/endpoints.md @@ -52,4 +52,14 @@ prefix - /`qrcode` - `GET` qrcode - `POST` qrcode/generate -- `POST` qrcode/generate_with_image \ No newline at end of file +- `POST` qrcode/generate_with_image + +## Quote + +prefix - /`quote` + +- `GET` quote?q (author/keyword) +- `GET` quote/random (1) +- `POST` quote { quote, author } +- `PATCH` quote/id { quote, author } +- `DELETE` quote/id \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 58f0f44..a89464b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "everrest", - "version": "1.9.0", + "version": "1.10.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "everrest", - "version": "1.9.0", + "version": "1.10.0", "license": "MIT", "dependencies": { "@nestjs-modules/mailer": "^1.9.1", diff --git a/package.json b/package.json index f798a78..5eb187e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "everrest", - "version": "1.9.0", + "version": "1.10.0", "description": "EverREST backend service for educational purposes", "author": "Educata Authors", "private": true, diff --git a/src/app.controller.ts b/src/app.controller.ts index b95a5e5..2fd1671 100644 --- a/src/app.controller.ts +++ b/src/app.controller.ts @@ -7,6 +7,7 @@ import { ProductExceptionKeys, ExceptionStatusKeys, QRCodeExpectionKeys, + QuoteExpectionKeys, } from 'src/enums'; @ApiTags('root') @@ -27,6 +28,7 @@ export class AppController { ...AuthExpectionKeys, ...CartExpectionKeys, ...QRCodeExpectionKeys, + ...QuoteExpectionKeys, }); } } diff --git a/src/app.module.ts b/src/app.module.ts index 9365e9b..51c839e 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -6,6 +6,7 @@ import { AppController } from './app.controller'; import { AppService } from './app.service'; import { ShopModule, UserModule, MailModule, QrCodeModule } from './modules'; import { ExceptionService, EncryptionService } from './shared'; +import { QuoteModule } from './modules/quote'; @Module({ imports: [ ConfigModule.forRoot(), @@ -14,6 +15,7 @@ import { ExceptionService, EncryptionService } from './shared'; UserModule, MailModule, QrCodeModule, + QuoteModule, ], controllers: [AppController], providers: [AppService, ExceptionService, EncryptionService], diff --git a/src/enums/exceptions.enum.ts b/src/enums/exceptions.enum.ts index 5be4267..505273a 100644 --- a/src/enums/exceptions.enum.ts +++ b/src/enums/exceptions.enum.ts @@ -110,3 +110,12 @@ export enum QRCodeExpectionKeys { TextShouldNotBeEmpty = 'errors.text_should_not_be_empty', ImageUrlShouldNotBeEmpty = 'errors.image_url_should_not_be_empty', } + +export enum QuoteExpectionKeys { + AuthorNameShouldBeString = 'errors.author_name_should_be_string', + QuoteShouldBeString = 'errors.quote_should_be_string', + DuplicatedQuote = 'errors.duplicated_quote', + QuoteKeywordShouldBeString = 'errors.quote_keyword_should_be_string', + QuoteNotFound = 'errors.quote_not_found', + QuoteShouldHaveNewData = 'errors.quote_should_have_new_data', +} diff --git a/src/modules/quote/dtos/all-quote.dto.ts b/src/modules/quote/dtos/all-quote.dto.ts new file mode 100644 index 0000000..4366a3d --- /dev/null +++ b/src/modules/quote/dtos/all-quote.dto.ts @@ -0,0 +1,13 @@ +import { IsOptional, IsString } from 'class-validator'; +import { QuoteExpectionKeys } from 'src/enums'; +import { PaginationQueryDto } from 'src/shared'; + +export class AllQuoteDto extends PaginationQueryDto { + @IsOptional() + @IsString({ message: QuoteExpectionKeys.AuthorNameShouldBeString }) + author: string; + + @IsOptional() + @IsString({ message: QuoteExpectionKeys.QuoteKeywordShouldBeString }) + keywords: string; +} diff --git a/src/modules/quote/dtos/index.ts b/src/modules/quote/dtos/index.ts new file mode 100644 index 0000000..fe76b53 --- /dev/null +++ b/src/modules/quote/dtos/index.ts @@ -0,0 +1,3 @@ +export * from './quote.dto'; +export * from './all-quote.dto'; +export * from './update-quote.dto'; diff --git a/src/modules/quote/dtos/quote.dto.ts b/src/modules/quote/dtos/quote.dto.ts new file mode 100644 index 0000000..ff8347d --- /dev/null +++ b/src/modules/quote/dtos/quote.dto.ts @@ -0,0 +1,10 @@ +import { IsString } from 'class-validator'; +import { QuoteExpectionKeys } from 'src/enums'; + +export class QuoteDto { + @IsString({ message: QuoteExpectionKeys.AuthorNameShouldBeString }) + author: string; + + @IsString({ message: QuoteExpectionKeys.QuoteShouldBeString }) + quote: string; +} diff --git a/src/modules/quote/dtos/update-quote.dto.ts b/src/modules/quote/dtos/update-quote.dto.ts new file mode 100644 index 0000000..5821d49 --- /dev/null +++ b/src/modules/quote/dtos/update-quote.dto.ts @@ -0,0 +1,12 @@ +import { IsOptional, IsString } from 'class-validator'; +import { QuoteExpectionKeys } from 'src/enums'; + +export class UpdateQuoteDto { + @IsOptional() + @IsString({ message: QuoteExpectionKeys.AuthorNameShouldBeString }) + author: string; + + @IsOptional() + @IsString({ message: QuoteExpectionKeys.QuoteShouldBeString }) + quote: string; +} diff --git a/src/modules/quote/index.ts b/src/modules/quote/index.ts new file mode 100644 index 0000000..56e02f7 --- /dev/null +++ b/src/modules/quote/index.ts @@ -0,0 +1,4 @@ +export * from './dtos'; +export * from './quote.controller'; +export * from './quote.module'; +export * from './quote.service'; diff --git a/src/modules/quote/quote.controller.ts b/src/modules/quote/quote.controller.ts new file mode 100644 index 0000000..c770eb6 --- /dev/null +++ b/src/modules/quote/quote.controller.ts @@ -0,0 +1,63 @@ +import { + Body, + Controller, + Delete, + Get, + Param, + Patch, + Post, + Query, + UseGuards, +} from '@nestjs/common'; +import { ApiTags } from '@nestjs/swagger'; +import { UserRole } from 'src/enums'; +import { + JwtGuard, + MongooseValidatorService, + Roles, + RolesGuard, +} from 'src/shared'; +import { QuoteService } from './quote.service'; +import { QuoteDto, AllQuoteDto, UpdateQuoteDto } from './dtos'; + +@ApiTags('quote') +@Controller('quote') +export class QuoteController { + constructor( + private quoteService: QuoteService, + private readonly mongooseValidator: MongooseValidatorService, + ) {} + + @Get() + getAllQuote(@Query() query: AllQuoteDto) { + return this.quoteService.getAllQuote(query); + } + + @Get('random') + getRandomQuote() { + return this.quoteService.getRandomQuote(); + } + + @Post() + @UseGuards(JwtGuard, RolesGuard) + @Roles(UserRole.Admin) + addQuote(@Body() body: QuoteDto) { + return this.quoteService.addQuote(body); + } + + @Patch('id/:id') + @UseGuards(JwtGuard, RolesGuard) + @Roles(UserRole.Admin) + updateQuote(@Param('id') id: string, @Body() body: UpdateQuoteDto) { + this.mongooseValidator.isValidObjectId(id); + return this.quoteService.updateQuoteById(id, body); + } + + @Delete('id/:id') + @UseGuards(JwtGuard, RolesGuard) + @Roles(UserRole.Admin) + deleteQuote(@Param('id') id: string) { + this.mongooseValidator.isValidObjectId(id); + return this.quoteService.deleteQuoteById(id); + } +} diff --git a/src/modules/quote/quote.module.ts b/src/modules/quote/quote.module.ts new file mode 100644 index 0000000..d406e15 --- /dev/null +++ b/src/modules/quote/quote.module.ts @@ -0,0 +1,25 @@ +import { Module } from '@nestjs/common'; +import { MongooseModule } from '@nestjs/mongoose'; +import { ConfigModule } from '@nestjs/config'; +import { JwtModule } from '@nestjs/jwt'; +import { Quote, QuoteSchema, User, UserSchema } from 'src/schemas'; +import { QuoteService } from './quote.service'; +import { QuoteController } from './quote.controller'; +import { ExceptionService, MongooseValidatorService } from 'src/shared'; + +@Module({ + imports: [ + ConfigModule.forRoot(), + MongooseModule.forFeature([ + { name: Quote.name, schema: QuoteSchema }, + { name: User.name, schema: UserSchema }, + ]), + JwtModule.register({ + secret: `${process.env.JWT_SECRET}`, + signOptions: { expiresIn: `${process.env.JWT_EXPIRES_IN || '1'}h` }, + }), + ], + providers: [QuoteService, ExceptionService, MongooseValidatorService], + controllers: [QuoteController], +}) +export class QuoteModule {} diff --git a/src/modules/quote/quote.service.ts b/src/modules/quote/quote.service.ts new file mode 100644 index 0000000..77d699a --- /dev/null +++ b/src/modules/quote/quote.service.ts @@ -0,0 +1,111 @@ +import { Injectable } from '@nestjs/common'; +import { InjectModel } from '@nestjs/mongoose'; +import { Model } from 'mongoose'; +import { Quote, QuoteDocument } from 'src/schemas'; +import { AllQuoteDto, QuoteDto, UpdateQuoteDto } from './dtos'; +import { ExceptionService } from 'src/shared'; +import { ExceptionStatusKeys, QuoteExpectionKeys } from 'src/enums'; +import { API_CONFIG } from 'src/consts'; + +@Injectable() +export class QuoteService { + constructor( + @InjectModel(Quote.name) private quoteModel: Model, + private exceptionService: ExceptionService, + ) {} + + async addQuote(quoteDto: QuoteDto) { + const oldQuote = await this.quoteModel.findOne({ quote: quoteDto.quote }); + + if (oldQuote) { + this.exceptionService.throwError( + ExceptionStatusKeys.Conflict, + 'Quote already exists', + QuoteExpectionKeys.DuplicatedQuote, + ); + } + + return this.quoteModel.create(quoteDto); + } + + async getRandomQuote() { + const allQuote = await this.quoteModel.find({}); + const randomIndex = Math.floor(Math.random() * allQuote.length); + return ( + allQuote[randomIndex] ?? { + author: 'educata', + quote: 'Sorry we are out of quotes', + } + ); + } + + async getAllQuote(query: AllQuoteDto) { + const currentPage = query.page_index || API_CONFIG.MINIMUM_PAGE_INDEX; + const responsePerPage = query.page_size || API_CONFIG.RESPONSE_PER_PAGE; + const skip = responsePerPage * (Math.floor(currentPage) - 1); + + const queryObject: { author?: object; quote?: object } = {}; + + if (query.keywords) { + queryObject.quote = { $regex: query.keywords, $options: 'i' }; + } + + if (query.author) { + queryObject.author = { $regex: query.author, $options: 'i' }; + } + + const quotes = await this.quoteModel + .find({ ...queryObject }) + .sort() + .limit(responsePerPage) + .skip(skip); + + const quotesCount = await this.quoteModel.countDocuments({ + ...queryObject, + }); + + return { + total: quotesCount, + limit: responsePerPage, + page: currentPage, + skip, + quotes, + }; + } + + async updateQuoteById(id: string, body: UpdateQuoteDto) { + const quote = await this.quoteModel.findOne({ _id: id }); + + if (!quote) { + this.exceptionService.throwError( + ExceptionStatusKeys.NotFound, + 'Quote not found', + QuoteExpectionKeys.QuoteNotFound, + ); + } + + if (!body.author && !body.quote) { + this.exceptionService.throwError( + ExceptionStatusKeys.BadRequest, + 'Quote should have at least one following data: author, quote', + QuoteExpectionKeys.QuoteShouldHaveNewData, + ); + } + + return this.quoteModel.findOneAndUpdate({ _id: id }, body); + } + + async deleteQuoteById(id: string) { + const quote = await this.quoteModel.findOne({ _id: id }); + + if (!quote) { + this.exceptionService.throwError( + ExceptionStatusKeys.NotFound, + 'Quote not found', + QuoteExpectionKeys.QuoteNotFound, + ); + } + + return this.quoteModel.findOneAndDelete({ _id: id }); + } +} diff --git a/src/schemas/index.ts b/src/schemas/index.ts index bd313f5..b8523b4 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -1,2 +1,3 @@ export * from './shop'; export * from './user'; +export * from './quote'; diff --git a/src/schemas/quote/index.ts b/src/schemas/quote/index.ts new file mode 100644 index 0000000..a204165 --- /dev/null +++ b/src/schemas/quote/index.ts @@ -0,0 +1 @@ +export * from './quote.schema'; diff --git a/src/schemas/quote/quote.schema.ts b/src/schemas/quote/quote.schema.ts new file mode 100644 index 0000000..35d45bc --- /dev/null +++ b/src/schemas/quote/quote.schema.ts @@ -0,0 +1,12 @@ +import { Schema, Prop, SchemaFactory } from '@nestjs/mongoose'; +import { HydratedDocument } from 'mongoose'; + +export type QuoteDocument = HydratedDocument; + +@Schema({ versionKey: false }) +export class Quote { + @Prop() author: string; + @Prop() quote: string; +} + +export const QuoteSchema = SchemaFactory.createForClass(Quote); diff --git a/src/schemas/shop/cart.schema.ts b/src/schemas/shop/cart.schema.ts index d641e01..d924ac1 100644 --- a/src/schemas/shop/cart.schema.ts +++ b/src/schemas/shop/cart.schema.ts @@ -1,38 +1,38 @@ -import { Schema, Prop, raw, SchemaFactory } from '@nestjs/mongoose'; -import { HydratedDocument } from 'mongoose'; -import { CartProduct, CartTotal } from 'src/interfaces'; - -export type CartDocument = HydratedDocument; - -@Schema() -export class Cart { - @Prop() userId: string; - @Prop() createdAt: string; - - @Prop( - raw({ - price: raw({ - current: { type: Number }, - beforeDiscount: { type: Number }, - }), - quantity: { type: Number }, - products: { type: Number }, - }), - ) - total: CartTotal; - - @Prop({ - type: [ - { - _id: false, - quantity: { type: Number }, - pricePerQuantity: { type: Number }, - beforeDiscountPrice: { type: Number }, - productId: { type: String }, - }, - ], - }) - products: CartProduct[]; -} - -export const CartSchema = SchemaFactory.createForClass(Cart); +import { Schema, Prop, raw, SchemaFactory } from '@nestjs/mongoose'; +import { HydratedDocument } from 'mongoose'; +import { CartProduct, CartTotal } from 'src/interfaces'; + +export type CartDocument = HydratedDocument; + +@Schema({ versionKey: false }) +export class Cart { + @Prop() userId: string; + @Prop() createdAt: string; + + @Prop( + raw({ + price: raw({ + current: { type: Number }, + beforeDiscount: { type: Number }, + }), + quantity: { type: Number }, + products: { type: Number }, + }), + ) + total: CartTotal; + + @Prop({ + type: [ + { + _id: false, + quantity: { type: Number }, + pricePerQuantity: { type: Number }, + beforeDiscountPrice: { type: Number }, + productId: { type: String }, + }, + ], + }) + products: CartProduct[]; +} + +export const CartSchema = SchemaFactory.createForClass(Cart); diff --git a/src/schemas/shop/product.schema.ts b/src/schemas/shop/product.schema.ts index 2d198ab..21fc765 100644 --- a/src/schemas/shop/product.schema.ts +++ b/src/schemas/shop/product.schema.ts @@ -4,7 +4,7 @@ import { ProductPrice, ProductCategory, ProductRating } from 'src/interfaces'; export type ProductDocument = HydratedDocument; -@Schema() +@Schema({ versionKey: false }) export class Product { @Prop() title: string; @Prop() description: string; diff --git a/src/schemas/user/user.schema.ts b/src/schemas/user/user.schema.ts index 857bc0a..9a920d1 100644 --- a/src/schemas/user/user.schema.ts +++ b/src/schemas/user/user.schema.ts @@ -4,7 +4,7 @@ import { Gender, UserRole } from 'src/enums'; export type UserDocument = HydratedDocument; -@Schema() +@Schema({ versionKey: false }) export class User { @Prop() firstName: string; @Prop() lastName: string; diff --git a/workspace/insomnia/Insomnia.json b/workspace/insomnia/Insomnia.json index 1e59d44..b0d44cf 100644 --- a/workspace/insomnia/Insomnia.json +++ b/workspace/insomnia/Insomnia.json @@ -1,13 +1,13 @@ { "_type": "export", "__export_format": 4, - "__export_date": "2023-09-12T13:47:58.976Z", + "__export_date": "2023-09-30T15:06:11.025Z", "__export_source": "insomnia.desktop.app:v2023.5.8", "resources": [ { - "_id": "req_4a83524bc8f8464f910b4b8121875f29", - "parentId": "fld_c44fd0258a0543379ca3c9d6981bd45a", - "modified": 1694109977169, + "_id": "req_049c1a14396442eb8e72baf158aa7c5a", + "parentId": "fld_838eb9f5da194025be37c25ffba58b33", + "modified": 1694619527763, "created": 1694104757818, "url": "http://localhost:3000", "name": "Base", @@ -28,8 +28,8 @@ "_type": "request" }, { - "_id": "fld_c44fd0258a0543379ca3c9d6981bd45a", - "parentId": "wrk_cddddeca853e4720a57929758bac0eb7", + "_id": "fld_838eb9f5da194025be37c25ffba58b33", + "parentId": "wrk_ece68cec0bc84cf8875451b86942519a", "modified": 1694104747369, "created": 1694104741476, "name": "root", @@ -40,18 +40,18 @@ "_type": "request_group" }, { - "_id": "wrk_cddddeca853e4720a57929758bac0eb7", + "_id": "wrk_ece68cec0bc84cf8875451b86942519a", "parentId": null, - "modified": 1694113474968, - "created": 1694113474968, + "modified": 1694618609917, + "created": 1694618609917, "name": "Everest", "description": "", "scope": "collection", "_type": "workspace" }, { - "_id": "req_cd91052f7dfc44aa9aa798894d5c9d14", - "parentId": "fld_c44fd0258a0543379ca3c9d6981bd45a", + "_id": "req_84731147c45d42c1a89dcf0382516218", + "parentId": "fld_838eb9f5da194025be37c25ffba58b33", "modified": 1694264487911, "created": 1694104795324, "url": "http://localhost:3000/lang/errors", @@ -73,8 +73,8 @@ "_type": "request" }, { - "_id": "req_2e11fa0e6cb543e5b69ce28733c9973c", - "parentId": "fld_c5bba1b12a0f4675aab19c87c59951f1", + "_id": "req_8e03eaeed735455c84ef653893dc0d6f", + "parentId": "fld_814488d63a0640048d64c20d320b5400", "modified": 1693918319125, "created": 1693918297856, "url": "http://localhost:3000/shop/cart", @@ -96,8 +96,8 @@ "_type": "request" }, { - "_id": "fld_c5bba1b12a0f4675aab19c87c59951f1", - "parentId": "fld_ce89bf973c7049df95949e65662e24e0", + "_id": "fld_814488d63a0640048d64c20d320b5400", + "parentId": "fld_0926b542999e4dba9d2e3ad88820be48", "modified": 1693916555938, "created": 1693908862581, "name": "cart", @@ -108,8 +108,8 @@ "_type": "request_group" }, { - "_id": "fld_ce89bf973c7049df95949e65662e24e0", - "parentId": "wrk_cddddeca853e4720a57929758bac0eb7", + "_id": "fld_0926b542999e4dba9d2e3ad88820be48", + "parentId": "wrk_ece68cec0bc84cf8875451b86942519a", "modified": 1693908839779, "created": 1693908839779, "name": "shop", @@ -120,8 +120,8 @@ "_type": "request_group" }, { - "_id": "req_73287d6cd71a41d1824389c717cf3c43", - "parentId": "fld_c5bba1b12a0f4675aab19c87c59951f1", + "_id": "req_33da3474b9c8408da831762ca0ef704f", + "parentId": "fld_814488d63a0640048d64c20d320b5400", "modified": 1693919005385, "created": 1693918293668, "url": "http://localhost:3000/shop/cart/product", @@ -146,8 +146,8 @@ "_type": "request" }, { - "_id": "req_8ba7281b071e4aa9b97a8076c1302bb5", - "parentId": "fld_c5bba1b12a0f4675aab19c87c59951f1", + "_id": "req_1604dbb869534bf295e2b8564e51e07a", + "parentId": "fld_814488d63a0640048d64c20d320b5400", "modified": 1693918605591, "created": 1693918592075, "url": "http://localhost:3000/shop/cart/checkout", @@ -172,8 +172,8 @@ "_type": "request" }, { - "_id": "req_eb42dcbf9f7a4b5aa907265aefa75ede", - "parentId": "fld_c5bba1b12a0f4675aab19c87c59951f1", + "_id": "req_f85445f8b7fb4cd6801d938f12ad7552", + "parentId": "fld_814488d63a0640048d64c20d320b5400", "modified": 1693919009738, "created": 1693918494445, "url": "http://localhost:3000/shop/cart/product", @@ -198,8 +198,8 @@ "_type": "request" }, { - "_id": "req_1e9640498f784a89807a05a8d0eb43aa", - "parentId": "fld_c5bba1b12a0f4675aab19c87c59951f1", + "_id": "req_648bbb88eb92412c807b5a1d1527a42a", + "parentId": "fld_814488d63a0640048d64c20d320b5400", "modified": 1693919012384, "created": 1693918569988, "url": "http://localhost:3000/shop/cart/product", @@ -224,8 +224,8 @@ "_type": "request" }, { - "_id": "req_821dc0d67da5499793d3b94056edc4fb", - "parentId": "fld_c5bba1b12a0f4675aab19c87c59951f1", + "_id": "req_a8d2660b9b0344458e5a7489900e7a43", + "parentId": "fld_814488d63a0640048d64c20d320b5400", "modified": 1693918655016, "created": 1693918647735, "url": "http://localhost:3000/shop/cart", @@ -250,8 +250,8 @@ "_type": "request" }, { - "_id": "req_2929c98febf54e4eab263a7ca4440149", - "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", + "_id": "req_fb3abf4c30f549f79223993c9527b3dd", + "parentId": "fld_929df3967ba34a3ca4a9fc8584e31fe3", "modified": 1693916681936, "created": 1693916564393, "url": "http://localhost:3000/shop/products/all", @@ -273,8 +273,8 @@ "_type": "request" }, { - "_id": "fld_cb4d1dbcafb64d61b5bae6a11982232e", - "parentId": "fld_ce89bf973c7049df95949e65662e24e0", + "_id": "fld_929df3967ba34a3ca4a9fc8584e31fe3", + "parentId": "fld_0926b542999e4dba9d2e3ad88820be48", "modified": 1693916554582, "created": 1693908857002, "name": "products", @@ -285,8 +285,8 @@ "_type": "request_group" }, { - "_id": "req_7506d5fbf8114be68fe2d743e5849cd4", - "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", + "_id": "req_86f0c7171e414569a5de48695dbfa01a", + "parentId": "fld_929df3967ba34a3ca4a9fc8584e31fe3", "modified": 1693917409614, "created": 1693917344514, "url": "http://localhost:3000/shop/products/id/64edc5b96ad1cbae75d30260", @@ -308,8 +308,8 @@ "_type": "request" }, { - "_id": "req_3f8a9b2ff0e14e1eb609bf21b9de602a", - "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", + "_id": "req_ddf2cff132884196a062f3decf2c4832", + "parentId": "fld_929df3967ba34a3ca4a9fc8584e31fe3", "modified": 1693916684919, "created": 1693916659552, "url": "http://localhost:3000/shop/products/categories", @@ -331,8 +331,8 @@ "_type": "request" }, { - "_id": "req_cc38765b67eb42cbba4b47186850ae58", - "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", + "_id": "req_aab9511805b145c3bc11cb578a69a038", + "parentId": "fld_929df3967ba34a3ca4a9fc8584e31fe3", "modified": 1693916714272, "created": 1693916710925, "url": "http://localhost:3000/shop/products/category/1", @@ -354,8 +354,8 @@ "_type": "request" }, { - "_id": "req_68ea4263b0c8469da85712276cd12b22", - "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", + "_id": "req_7bc7fbc93cf8488a9560ef0b9aeedc0b", + "parentId": "fld_929df3967ba34a3ca4a9fc8584e31fe3", "modified": 1693916696386, "created": 1693916693438, "url": "http://localhost:3000/shop/products/brands", @@ -377,8 +377,8 @@ "_type": "request" }, { - "_id": "req_82c97ac1dee1405993863057764e1236", - "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", + "_id": "req_66d43012acd441bfb195735659873d6c", + "parentId": "fld_929df3967ba34a3ca4a9fc8584e31fe3", "modified": 1693916738478, "created": 1693916726612, "url": "http://localhost:3000/shop/products/brand/apple", @@ -400,8 +400,8 @@ "_type": "request" }, { - "_id": "req_b0fcc13d78a649038a1c5a665b9b06db", - "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", + "_id": "req_2582b25069124d51b8e7b340436aab65", + "parentId": "fld_929df3967ba34a3ca4a9fc8584e31fe3", "modified": 1693916793547, "created": 1693916631453, "url": "http://localhost:3000/shop/products/search?keywords=black", @@ -423,8 +423,8 @@ "_type": "request" }, { - "_id": "req_026ecafb94c14a1182f92c577468eb7c", - "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", + "_id": "req_78113bda23044c65ba6d297762cb8626", + "parentId": "fld_929df3967ba34a3ca4a9fc8584e31fe3", "modified": 1694519020765, "created": 1693916800785, "url": "http://localhost:3000/shop/products", @@ -449,8 +449,8 @@ "_type": "request" }, { - "_id": "req_77ca664feb014ab6a6a2ef47166442c4", - "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", + "_id": "req_2f5bfe7877664f2caae8154428620833", + "parentId": "fld_929df3967ba34a3ca4a9fc8584e31fe3", "modified": 1693919082609, "created": 1693917220539, "url": "http://localhost:3000/shop/products/rate", @@ -475,8 +475,8 @@ "_type": "request" }, { - "_id": "req_31884a6232e240e0a620bea14b4c3570", - "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", + "_id": "req_8b4cd9cfebd84473b9bbe2fabe121e14", + "parentId": "fld_929df3967ba34a3ca4a9fc8584e31fe3", "modified": 1693919085922, "created": 1693918026891, "url": "http://localhost:3000/shop/products/id/64edc5b96ad1cbae75d30260", @@ -501,8 +501,8 @@ "_type": "request" }, { - "_id": "req_1485f544fbe64c77bc42a94e20fedb57", - "parentId": "fld_cb4d1dbcafb64d61b5bae6a11982232e", + "_id": "req_5bc9f877d89f40de9b52ea64691e6881", + "parentId": "fld_929df3967ba34a3ca4a9fc8584e31fe3", "modified": 1693918172675, "created": 1693918133911, "url": "http://localhost:3000/shop/products/all", @@ -524,11 +524,11 @@ "_type": "request" }, { - "_id": "req_69de4f6120fa4c57930cf90f60ec9da7", - "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", - "modified": 1694110863418, + "_id": "req_ccfd794187e84d718330ddaa83eb6cde", + "parentId": "fld_7488ac74441c411b85b16627cd396ea0", + "modified": 1695373306777, "created": 1694110844080, - "url": "http://localhost:3000/auth", + "url": "http://localhost:3000/auth/id/64eccb55fe7b573c1ec5aaae", "name": "User", "description": "", "method": "GET", @@ -547,8 +547,8 @@ "_type": "request" }, { - "_id": "fld_bd44438b98614c7bb2a3fadc48379eeb", - "parentId": "wrk_cddddeca853e4720a57929758bac0eb7", + "_id": "fld_7488ac74441c411b85b16627cd396ea0", + "parentId": "wrk_ece68cec0bc84cf8875451b86942519a", "modified": 1694519054447, "created": 1693902097619, "name": "auth", @@ -559,8 +559,8 @@ "_type": "request_group" }, { - "_id": "req_59a01316973744e28eb22457d5d5f21d", - "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", + "_id": "req_d45fb2b855a1461b973a599d662e012f", + "parentId": "fld_7488ac74441c411b85b16627cd396ea0", "modified": 1694112971558, "created": 1694112676180, "url": "http://localhost:3000/auth/all", @@ -582,8 +582,8 @@ "_type": "request" }, { - "_id": "req_038c9a88d14f4a4fbf0bffc695938838", - "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", + "_id": "req_2fdbd304fc59479da8d15103db45d045", + "parentId": "fld_7488ac74441c411b85b16627cd396ea0", "modified": 1694112682156, "created": 1694112030613, "url": "http://localhost:3000/auth/id/64eccb55fe7b573c1ec5aaae", @@ -605,8 +605,8 @@ "_type": "request" }, { - "_id": "req_ae5188830fa9444798adac44abf30e0f", - "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", + "_id": "req_ee2159b8430c4d869c0628b7dd5eb5c1", + "parentId": "fld_7488ac74441c411b85b16627cd396ea0", "modified": 1693919050169, "created": 1693902140340, "url": "http://localhost:3000/auth/sign_up", @@ -631,9 +631,9 @@ "_type": "request" }, { - "_id": "req_b46715ede6564a6abcff1279ec27cd35", - "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", - "modified": 1694526382230, + "_id": "req_e7ce599a076b4c0c910f45cd8c1dcb03", + "parentId": "fld_7488ac74441c411b85b16627cd396ea0", + "modified": 1696086200329, "created": 1693902632304, "url": "http://localhost:3000/auth/sign_in", "name": "Sign in", @@ -657,8 +657,8 @@ "_type": "request" }, { - "_id": "req_27ed77ca0690403a8e9965cef031b138", - "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", + "_id": "req_e4adc3b7d95a4072b0d203a2bafd6973", + "parentId": "fld_7488ac74441c411b85b16627cd396ea0", "modified": 1694113234872, "created": 1694113127974, "url": "http://localhost:3000/auth/logout", @@ -680,8 +680,8 @@ "_type": "request" }, { - "_id": "req_0f9cc4a65df844ec92ab03806cd2a0c5", - "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", + "_id": "req_3da462b3b6cf4ef88328ac755a7f9518", + "parentId": "fld_7488ac74441c411b85b16627cd396ea0", "modified": 1693919058744, "created": 1693907088975, "url": "http://localhost:3000/auth/verify_email", @@ -706,8 +706,8 @@ "_type": "request" }, { - "_id": "req_f0b895cbe291453e89fb2422744d5654", - "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", + "_id": "req_9c8cee150caf4f149eb1249110cfff9e", + "parentId": "fld_7488ac74441c411b85b16627cd396ea0", "modified": 1693909612531, "created": 1693902735328, "url": "http://localhost:3000/auth/refresh", @@ -732,9 +732,9 @@ "_type": "request" }, { - "_id": "req_17d8eca8e26d4f4ab4647da88e8addab", - "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", - "modified": 1694267399035, + "_id": "req_9130bc2817374a609b4fe2220e330615", + "parentId": "fld_7488ac74441c411b85b16627cd396ea0", + "modified": 1696086194654, "created": 1693908748910, "url": "http://localhost:3000/auth/recovery", "name": "Reset password", @@ -758,9 +758,9 @@ "_type": "request" }, { - "_id": "req_baceb3788dc64b058663c8ca11e4267f", - "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", - "modified": 1693909607505, + "_id": "req_a9e630b4fc404735a072d4a29ad88fae", + "parentId": "fld_7488ac74441c411b85b16627cd396ea0", + "modified": 1696086192669, "created": 1693908814193, "url": "http://localhost:3000/auth/update", "name": "Update", @@ -784,9 +784,9 @@ "_type": "request" }, { - "_id": "req_59a4462113734804bcca8b2773c5436a", - "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", - "modified": 1693919069232, + "_id": "req_5ff664deed824233a6a4479419980462", + "parentId": "fld_7488ac74441c411b85b16627cd396ea0", + "modified": 1696086188214, "created": 1693909251050, "url": "http://localhost:3000/auth/change_password", "name": "Change password", @@ -810,8 +810,8 @@ "_type": "request" }, { - "_id": "req_047706c9a5774d899b9d3a6afb84d507", - "parentId": "fld_bd44438b98614c7bb2a3fadc48379eeb", + "_id": "req_8e5ce69f39ae44c3a91adf48c0b7318e", + "parentId": "fld_7488ac74441c411b85b16627cd396ea0", "modified": 1693909599282, "created": 1693909567503, "url": "http://localhost:3000/auth/delete", @@ -833,8 +833,8 @@ "_type": "request" }, { - "_id": "req_9125e9b68cb94b56829697cbb56831ed", - "parentId": "fld_e840d8e2358f430bb4502f131024b985", + "_id": "req_a232d7ab005d4c2d8e9feee321cb8a78", + "parentId": "fld_3b8ca2a77b97480a89daf466b7a9b323", "modified": 1694519092775, "created": 1694519059173, "url": "http://localhost:3000/qrcode", @@ -856,20 +856,20 @@ "_type": "request" }, { - "_id": "fld_e840d8e2358f430bb4502f131024b985", - "parentId": "wrk_cddddeca853e4720a57929758bac0eb7", - "modified": 1694519052587, + "_id": "fld_3b8ca2a77b97480a89daf466b7a9b323", + "parentId": "wrk_ece68cec0bc84cf8875451b86942519a", + "modified": 1696073256445, "created": 1694519034267, "name": "qrcode", "description": "", "environment": {}, "environmentPropertyOrder": null, - "metaSortKey": -1693905468699, + "metaSortKey": -1693906732854, "_type": "request_group" }, { - "_id": "req_929fcc495f8b4351a2b7c212d50ba230", - "parentId": "fld_e840d8e2358f430bb4502f131024b985", + "_id": "req_86589de4d1924859b1dcb14f0afba6e0", + "parentId": "fld_3b8ca2a77b97480a89daf466b7a9b323", "modified": 1694526371787, "created": 1694524067494, "url": "http://localhost:3000/qrcode/generate", @@ -894,8 +894,8 @@ "_type": "request" }, { - "_id": "req_67b7a53736b749eba07cc245eeba245f", - "parentId": "fld_e840d8e2358f430bb4502f131024b985", + "_id": "req_a2480d9e6299405f92a8d7b41de1933d", + "parentId": "fld_3b8ca2a77b97480a89daf466b7a9b323", "modified": 1694526373478, "created": 1694524409029, "url": "http://localhost:3000/qrcode/generate_with_image", @@ -920,8 +920,138 @@ "_type": "request" }, { - "_id": "env_d70e108a1bfe41ca8ff251cef1c1e9a5", - "parentId": "wrk_cddddeca853e4720a57929758bac0eb7", + "_id": "req_798cebdcc6894780b53d3aed803d6b69", + "parentId": "fld_4a96623a2d714f899d689ae010d7573c", + "modified": 1696086129352, + "created": 1696076496546, + "url": "http://localhost:3000/quote?keywords=life", + "name": "All quote", + "description": "", + "method": "GET", + "body": {}, + "parameters": [], + "headers": [{ "name": "User-Agent", "value": "insomnia/2023.5.8" }], + "authentication": {}, + "metaSortKey": -1696073262529, + "isPrivate": false, + "settingStoreCookies": true, + "settingSendCookies": true, + "settingDisableRenderRequestBody": false, + "settingEncodeUrl": true, + "settingRebuildPath": true, + "settingFollowRedirects": "global", + "_type": "request" + }, + { + "_id": "fld_4a96623a2d714f899d689ae010d7573c", + "parentId": "wrk_ece68cec0bc84cf8875451b86942519a", + "modified": 1696073255054, + "created": 1696073242179, + "name": "quote", + "description": "", + "environment": {}, + "environmentPropertyOrder": null, + "metaSortKey": -1693906311469, + "_type": "request_group" + }, + { + "_id": "req_58fa459d5f5f466185f557e09aa3f47f", + "parentId": "fld_4a96623a2d714f899d689ae010d7573c", + "modified": 1696076004326, + "created": 1696073260618, + "url": "http://localhost:3000/quote/random", + "name": "Random quote", + "description": "", + "method": "GET", + "body": {}, + "parameters": [], + "headers": [{ "name": "User-Agent", "value": "insomnia/2023.5.8" }], + "authentication": {}, + "metaSortKey": -1696073262429, + "isPrivate": false, + "settingStoreCookies": true, + "settingSendCookies": true, + "settingDisableRenderRequestBody": false, + "settingEncodeUrl": true, + "settingRebuildPath": true, + "settingFollowRedirects": "global", + "_type": "request" + }, + { + "_id": "req_0783f55b3b4b4936b21006aeff0629dc", + "parentId": "fld_4a96623a2d714f899d689ae010d7573c", + "modified": 1696086176812, + "created": 1696074393623, + "url": "http://localhost:3000/quote", + "name": "Create quote", + "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": -1696073262329, + "isPrivate": false, + "settingStoreCookies": true, + "settingSendCookies": true, + "settingDisableRenderRequestBody": false, + "settingEncodeUrl": true, + "settingRebuildPath": true, + "settingFollowRedirects": "global", + "_type": "request" + }, + { + "_id": "req_35535f9de4bd47289ffa8ec8be04c027", + "parentId": "fld_4a96623a2d714f899d689ae010d7573c", + "modified": 1696079647349, + "created": 1696079608157, + "url": "http://localhost:3000/quote/id/65180f268d204f0129adcdb3", + "name": "Update by Id", + "description": "", + "method": "PATCH", + "body": {}, + "parameters": [], + "headers": [{ "name": "User-Agent", "value": "insomnia/2023.5.8" }], + "authentication": {}, + "metaSortKey": -1696073262279, + "isPrivate": false, + "settingStoreCookies": true, + "settingSendCookies": true, + "settingDisableRenderRequestBody": false, + "settingEncodeUrl": true, + "settingRebuildPath": true, + "settingFollowRedirects": "global", + "_type": "request" + }, + { + "_id": "req_d5dfd678bd4142e2906726231485b4fa", + "parentId": "fld_4a96623a2d714f899d689ae010d7573c", + "modified": 1696081654855, + "created": 1696079392908, + "url": "http://localhost:3000/quote/id/651826dc2824a3cf87e153af", + "name": "Delete by Id", + "description": "", + "method": "DELETE", + "body": {}, + "parameters": [], + "headers": [{ "name": "User-Agent", "value": "insomnia/2023.5.8" }], + "authentication": {}, + "metaSortKey": -1696073262229, + "isPrivate": false, + "settingStoreCookies": true, + "settingSendCookies": true, + "settingDisableRenderRequestBody": false, + "settingEncodeUrl": true, + "settingRebuildPath": true, + "settingFollowRedirects": "global", + "_type": "request" + }, + { + "_id": "env_93b56583b6fe45c9ab7f5526b689bb6d", + "parentId": "wrk_ece68cec0bc84cf8875451b86942519a", "modified": 1694104754476, "created": 1692100035451, "name": "Base Environment", @@ -933,39 +1063,39 @@ "_type": "environment" }, { - "_id": "jar_c4342b88e8714f248bb999416a49cd31", - "parentId": "wrk_cddddeca853e4720a57929758bac0eb7", - "modified": 1694509539570, + "_id": "jar_37c08f22f4e44dda8fd755899a8a7eed", + "parentId": "wrk_ece68cec0bc84cf8875451b86942519a", + "modified": 1696083319553, "created": 1692100035452, "name": "Default Jar", "cookies": [ { "key": "access_token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMiwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTQ1MDk1MzksImV4cCI6MTY5NDUxMzEzOX0.cIaNnI48Lk7IKxWzoGhhg5jG2FbguOEfaJJwVmzU4dc", - "expires": "2023-09-12T10:05:39.000Z", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMSwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTYwODMzMTksImV4cCI6MTY5NjA4NjkxOX0._c_7cNWB7Su-evpTh2WQ_JPV6X3zMofdxE08_Ex0JpM", + "expires": "2023-09-30T15:15:19.000Z", "domain": "localhost", "path": "/", "secure": true, "httpOnly": true, "hostOnly": true, "creation": "2023-09-07T18:20:36.274Z", - "lastAccessed": "2023-09-12T09:05:39.569Z", - "sameSite": "none", - "id": "4593084215682077" + "lastAccessed": "2023-09-30T14:15:19.551Z", + "sameSite": "lax", + "id": "27659898728757226" }, { "key": "refresh_token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMiwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTQ1MDk1MzksImV4cCI6MTY5NTExNDMzOX0.9pJqeWCPQWT6wU5KCH_CaDnU1_hMQxf4yftNS8FsVvg", - "expires": "2023-09-19T09:05:39.000Z", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMSwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTYwODMzMTksImV4cCI6MTY5NjY4ODExOX0.svbevo1x-Owv1Uaq0krCmAcMwnr0W9ivTUB30yAWRC8", + "expires": "2023-10-07T14:15:19.000Z", "domain": "localhost", "path": "/", "secure": true, "httpOnly": true, "hostOnly": true, "creation": "2023-09-07T18:20:36.275Z", - "lastAccessed": "2023-09-12T09:05:39.569Z", - "sameSite": "none", - "id": "5622771899700447" + "lastAccessed": "2023-09-30T14:15:19.552Z", + "sameSite": "lax", + "id": "4291863071365083" }, { "key": "access_token", @@ -978,7 +1108,7 @@ "hostOnly": true, "creation": "2023-09-09T13:50:08.036Z", "lastAccessed": "2023-09-12T08:28:48.272Z", - "id": "35108049377650064" + "id": "8355473275122447" }, { "key": "refresh_token", @@ -991,7 +1121,7 @@ "hostOnly": true, "creation": "2023-09-09T13:50:08.037Z", "lastAccessed": "2023-09-12T08:28:48.272Z", - "id": "1657699330217104" + "id": "16450423847326734" } ], "_type": "cookie_jar" diff --git a/workspace/insomnia/Insomnia.yaml b/workspace/insomnia/Insomnia.yaml index 1854fc8..bd2c508 100644 --- a/workspace/insomnia/Insomnia.yaml +++ b/workspace/insomnia/Insomnia.yaml @@ -1,11 +1,11 @@ _type: export __export_format: 4 -__export_date: 2023-09-12T13:48:08.487Z +__export_date: 2023-09-30T15:05:54.592Z __export_source: insomnia.desktop.app:v2023.5.8 resources: - - _id: req_4a83524bc8f8464f910b4b8121875f29 - parentId: fld_c44fd0258a0543379ca3c9d6981bd45a - modified: 1694109977169 + - _id: req_049c1a14396442eb8e72baf158aa7c5a + parentId: fld_838eb9f5da194025be37c25ffba58b33 + modified: 1694619527763 created: 1694104757818 url: http://localhost:3000 name: Base @@ -26,8 +26,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: fld_c44fd0258a0543379ca3c9d6981bd45a - parentId: wrk_cddddeca853e4720a57929758bac0eb7 + - _id: fld_838eb9f5da194025be37c25ffba58b33 + parentId: wrk_ece68cec0bc84cf8875451b86942519a modified: 1694104747369 created: 1694104741476 name: root @@ -36,16 +36,16 @@ resources: environmentPropertyOrder: null metaSortKey: -1694104741476 _type: request_group - - _id: wrk_cddddeca853e4720a57929758bac0eb7 + - _id: wrk_ece68cec0bc84cf8875451b86942519a parentId: null - modified: 1694113474968 - created: 1694113474968 + modified: 1694618609917 + created: 1694618609917 name: Everest description: "" scope: collection _type: workspace - - _id: req_cd91052f7dfc44aa9aa798894d5c9d14 - parentId: fld_c44fd0258a0543379ca3c9d6981bd45a + - _id: req_84731147c45d42c1a89dcf0382516218 + parentId: fld_838eb9f5da194025be37c25ffba58b33 modified: 1694264487911 created: 1694104795324 url: http://localhost:3000/lang/errors @@ -67,8 +67,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_2e11fa0e6cb543e5b69ce28733c9973c - parentId: fld_c5bba1b12a0f4675aab19c87c59951f1 + - _id: req_8e03eaeed735455c84ef653893dc0d6f + parentId: fld_814488d63a0640048d64c20d320b5400 modified: 1693918319125 created: 1693918297856 url: http://localhost:3000/shop/cart @@ -90,8 +90,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: fld_c5bba1b12a0f4675aab19c87c59951f1 - parentId: fld_ce89bf973c7049df95949e65662e24e0 + - _id: fld_814488d63a0640048d64c20d320b5400 + parentId: fld_0926b542999e4dba9d2e3ad88820be48 modified: 1693916555938 created: 1693908862581 name: cart @@ -100,8 +100,8 @@ resources: environmentPropertyOrder: null metaSortKey: -1693908857302 _type: request_group - - _id: fld_ce89bf973c7049df95949e65662e24e0 - parentId: wrk_cddddeca853e4720a57929758bac0eb7 + - _id: fld_0926b542999e4dba9d2e3ad88820be48 + parentId: wrk_ece68cec0bc84cf8875451b86942519a modified: 1693908839779 created: 1693908839779 name: shop @@ -110,8 +110,8 @@ resources: environmentPropertyOrder: null metaSortKey: -1693908839779 _type: request_group - - _id: req_73287d6cd71a41d1824389c717cf3c43 - parentId: fld_c5bba1b12a0f4675aab19c87c59951f1 + - _id: req_33da3474b9c8408da831762ca0ef704f + parentId: fld_814488d63a0640048d64c20d320b5400 modified: 1693919005385 created: 1693918293668 url: http://localhost:3000/shop/cart/product @@ -137,8 +137,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_8ba7281b071e4aa9b97a8076c1302bb5 - parentId: fld_c5bba1b12a0f4675aab19c87c59951f1 + - _id: req_1604dbb869534bf295e2b8564e51e07a + parentId: fld_814488d63a0640048d64c20d320b5400 modified: 1693918605591 created: 1693918592075 url: http://localhost:3000/shop/cart/checkout @@ -164,8 +164,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_eb42dcbf9f7a4b5aa907265aefa75ede - parentId: fld_c5bba1b12a0f4675aab19c87c59951f1 + - _id: req_f85445f8b7fb4cd6801d938f12ad7552 + parentId: fld_814488d63a0640048d64c20d320b5400 modified: 1693919009738 created: 1693918494445 url: http://localhost:3000/shop/cart/product @@ -191,8 +191,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_1e9640498f784a89807a05a8d0eb43aa - parentId: fld_c5bba1b12a0f4675aab19c87c59951f1 + - _id: req_648bbb88eb92412c807b5a1d1527a42a + parentId: fld_814488d63a0640048d64c20d320b5400 modified: 1693919012384 created: 1693918569988 url: http://localhost:3000/shop/cart/product @@ -218,8 +218,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_821dc0d67da5499793d3b94056edc4fb - parentId: fld_c5bba1b12a0f4675aab19c87c59951f1 + - _id: req_a8d2660b9b0344458e5a7489900e7a43 + parentId: fld_814488d63a0640048d64c20d320b5400 modified: 1693918655016 created: 1693918647735 url: http://localhost:3000/shop/cart @@ -245,8 +245,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_2929c98febf54e4eab263a7ca4440149 - parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e + - _id: req_fb3abf4c30f549f79223993c9527b3dd + parentId: fld_929df3967ba34a3ca4a9fc8584e31fe3 modified: 1693916681936 created: 1693916564393 url: http://localhost:3000/shop/products/all @@ -268,8 +268,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: fld_cb4d1dbcafb64d61b5bae6a11982232e - parentId: fld_ce89bf973c7049df95949e65662e24e0 + - _id: fld_929df3967ba34a3ca4a9fc8584e31fe3 + parentId: fld_0926b542999e4dba9d2e3ad88820be48 modified: 1693916554582 created: 1693908857002 name: products @@ -278,8 +278,8 @@ resources: environmentPropertyOrder: null metaSortKey: -1693908857202 _type: request_group - - _id: req_7506d5fbf8114be68fe2d743e5849cd4 - parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e + - _id: req_86f0c7171e414569a5de48695dbfa01a + parentId: fld_929df3967ba34a3ca4a9fc8584e31fe3 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_3f8a9b2ff0e14e1eb609bf21b9de602a - parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e + - _id: req_ddf2cff132884196a062f3decf2c4832 + parentId: fld_929df3967ba34a3ca4a9fc8584e31fe3 modified: 1693916684919 created: 1693916659552 url: http://localhost:3000/shop/products/categories @@ -324,8 +324,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_cc38765b67eb42cbba4b47186850ae58 - parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e + - _id: req_aab9511805b145c3bc11cb578a69a038 + parentId: fld_929df3967ba34a3ca4a9fc8584e31fe3 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_68ea4263b0c8469da85712276cd12b22 - parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e + - _id: req_7bc7fbc93cf8488a9560ef0b9aeedc0b + parentId: fld_929df3967ba34a3ca4a9fc8584e31fe3 modified: 1693916696386 created: 1693916693438 url: http://localhost:3000/shop/products/brands @@ -370,8 +370,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_82c97ac1dee1405993863057764e1236 - parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e + - _id: req_66d43012acd441bfb195735659873d6c + parentId: fld_929df3967ba34a3ca4a9fc8584e31fe3 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_b0fcc13d78a649038a1c5a665b9b06db - parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e + - _id: req_2582b25069124d51b8e7b340436aab65 + parentId: fld_929df3967ba34a3ca4a9fc8584e31fe3 modified: 1693916793547 created: 1693916631453 url: http://localhost:3000/shop/products/search?keywords=black @@ -416,8 +416,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_026ecafb94c14a1182f92c577468eb7c - parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e + - _id: req_78113bda23044c65ba6d297762cb8626 + parentId: fld_929df3967ba34a3ca4a9fc8584e31fe3 modified: 1694519020765 created: 1693916800785 url: http://localhost:3000/shop/products @@ -443,8 +443,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_77ca664feb014ab6a6a2ef47166442c4 - parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e + - _id: req_2f5bfe7877664f2caae8154428620833 + parentId: fld_929df3967ba34a3ca4a9fc8584e31fe3 modified: 1693919082609 created: 1693917220539 url: http://localhost:3000/shop/products/rate @@ -470,8 +470,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_31884a6232e240e0a620bea14b4c3570 - parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e + - _id: req_8b4cd9cfebd84473b9bbe2fabe121e14 + parentId: fld_929df3967ba34a3ca4a9fc8584e31fe3 modified: 1693919085922 created: 1693918026891 url: http://localhost:3000/shop/products/id/64edc5b96ad1cbae75d30260 @@ -497,8 +497,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_1485f544fbe64c77bc42a94e20fedb57 - parentId: fld_cb4d1dbcafb64d61b5bae6a11982232e + - _id: req_5bc9f877d89f40de9b52ea64691e6881 + parentId: fld_929df3967ba34a3ca4a9fc8584e31fe3 modified: 1693918172675 created: 1693918133911 url: http://localhost:3000/shop/products/all @@ -520,11 +520,11 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_69de4f6120fa4c57930cf90f60ec9da7 - parentId: fld_bd44438b98614c7bb2a3fadc48379eeb - modified: 1694110863418 + - _id: req_ccfd794187e84d718330ddaa83eb6cde + parentId: fld_7488ac74441c411b85b16627cd396ea0 + modified: 1695373306777 created: 1694110844080 - url: http://localhost:3000/auth + url: http://localhost:3000/auth/id/64eccb55fe7b573c1ec5aaae name: User description: "" method: GET @@ -543,8 +543,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: fld_bd44438b98614c7bb2a3fadc48379eeb - parentId: wrk_cddddeca853e4720a57929758bac0eb7 + - _id: fld_7488ac74441c411b85b16627cd396ea0 + parentId: wrk_ece68cec0bc84cf8875451b86942519a modified: 1694519054447 created: 1693902097619 name: auth @@ -553,8 +553,8 @@ resources: environmentPropertyOrder: null metaSortKey: -1693907154239 _type: request_group - - _id: req_59a01316973744e28eb22457d5d5f21d - parentId: fld_bd44438b98614c7bb2a3fadc48379eeb + - _id: req_d45fb2b855a1461b973a599d662e012f + parentId: fld_7488ac74441c411b85b16627cd396ea0 modified: 1694112971558 created: 1694112676180 url: http://localhost:3000/auth/all @@ -576,8 +576,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_038c9a88d14f4a4fbf0bffc695938838 - parentId: fld_bd44438b98614c7bb2a3fadc48379eeb + - _id: req_2fdbd304fc59479da8d15103db45d045 + parentId: fld_7488ac74441c411b85b16627cd396ea0 modified: 1694112682156 created: 1694112030613 url: http://localhost:3000/auth/id/64eccb55fe7b573c1ec5aaae @@ -599,8 +599,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_ae5188830fa9444798adac44abf30e0f - parentId: fld_bd44438b98614c7bb2a3fadc48379eeb + - _id: req_ee2159b8430c4d869c0628b7dd5eb5c1 + parentId: fld_7488ac74441c411b85b16627cd396ea0 modified: 1693919050169 created: 1693902140340 url: http://localhost:3000/auth/sign_up @@ -626,9 +626,9 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_b46715ede6564a6abcff1279ec27cd35 - parentId: fld_bd44438b98614c7bb2a3fadc48379eeb - modified: 1694526382230 + - _id: req_e7ce599a076b4c0c910f45cd8c1dcb03 + parentId: fld_7488ac74441c411b85b16627cd396ea0 + modified: 1696086200329 created: 1693902632304 url: http://localhost:3000/auth/sign_in name: Sign in @@ -653,8 +653,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_27ed77ca0690403a8e9965cef031b138 - parentId: fld_bd44438b98614c7bb2a3fadc48379eeb + - _id: req_e4adc3b7d95a4072b0d203a2bafd6973 + parentId: fld_7488ac74441c411b85b16627cd396ea0 modified: 1694113234872 created: 1694113127974 url: http://localhost:3000/auth/logout @@ -676,8 +676,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_0f9cc4a65df844ec92ab03806cd2a0c5 - parentId: fld_bd44438b98614c7bb2a3fadc48379eeb + - _id: req_3da462b3b6cf4ef88328ac755a7f9518 + parentId: fld_7488ac74441c411b85b16627cd396ea0 modified: 1693919058744 created: 1693907088975 url: http://localhost:3000/auth/verify_email @@ -703,8 +703,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_f0b895cbe291453e89fb2422744d5654 - parentId: fld_bd44438b98614c7bb2a3fadc48379eeb + - _id: req_9c8cee150caf4f149eb1249110cfff9e + parentId: fld_7488ac74441c411b85b16627cd396ea0 modified: 1693909612531 created: 1693902735328 url: http://localhost:3000/auth/refresh @@ -730,9 +730,9 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_17d8eca8e26d4f4ab4647da88e8addab - parentId: fld_bd44438b98614c7bb2a3fadc48379eeb - modified: 1694267399035 + - _id: req_9130bc2817374a609b4fe2220e330615 + parentId: fld_7488ac74441c411b85b16627cd396ea0 + modified: 1696086194654 created: 1693908748910 url: http://localhost:3000/auth/recovery name: Reset password @@ -757,9 +757,9 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_baceb3788dc64b058663c8ca11e4267f - parentId: fld_bd44438b98614c7bb2a3fadc48379eeb - modified: 1693909607505 + - _id: req_a9e630b4fc404735a072d4a29ad88fae + parentId: fld_7488ac74441c411b85b16627cd396ea0 + modified: 1696086192669 created: 1693908814193 url: http://localhost:3000/auth/update name: Update @@ -784,9 +784,9 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_59a4462113734804bcca8b2773c5436a - parentId: fld_bd44438b98614c7bb2a3fadc48379eeb - modified: 1693919069232 + - _id: req_5ff664deed824233a6a4479419980462 + parentId: fld_7488ac74441c411b85b16627cd396ea0 + modified: 1696086188214 created: 1693909251050 url: http://localhost:3000/auth/change_password name: Change password @@ -811,8 +811,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_047706c9a5774d899b9d3a6afb84d507 - parentId: fld_bd44438b98614c7bb2a3fadc48379eeb + - _id: req_8e5ce69f39ae44c3a91adf48c0b7318e + parentId: fld_7488ac74441c411b85b16627cd396ea0 modified: 1693909599282 created: 1693909567503 url: http://localhost:3000/auth/delete @@ -834,8 +834,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_9125e9b68cb94b56829697cbb56831ed - parentId: fld_e840d8e2358f430bb4502f131024b985 + - _id: req_a232d7ab005d4c2d8e9feee321cb8a78 + parentId: fld_3b8ca2a77b97480a89daf466b7a9b323 modified: 1694519092775 created: 1694519059173 url: http://localhost:3000/qrcode @@ -857,18 +857,18 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: fld_e840d8e2358f430bb4502f131024b985 - parentId: wrk_cddddeca853e4720a57929758bac0eb7 - modified: 1694519052587 + - _id: fld_3b8ca2a77b97480a89daf466b7a9b323 + parentId: wrk_ece68cec0bc84cf8875451b86942519a + modified: 1696073256445 created: 1694519034267 name: qrcode description: "" environment: {} environmentPropertyOrder: null - metaSortKey: -1693905468699 + metaSortKey: -1693906732854 _type: request_group - - _id: req_929fcc495f8b4351a2b7c212d50ba230 - parentId: fld_e840d8e2358f430bb4502f131024b985 + - _id: req_86589de4d1924859b1dcb14f0afba6e0 + parentId: fld_3b8ca2a77b97480a89daf466b7a9b323 modified: 1694526371787 created: 1694524067494 url: http://localhost:3000/qrcode/generate @@ -894,8 +894,8 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: req_67b7a53736b749eba07cc245eeba245f - parentId: fld_e840d8e2358f430bb4502f131024b985 + - _id: req_a2480d9e6299405f92a8d7b41de1933d + parentId: fld_3b8ca2a77b97480a89daf466b7a9b323 modified: 1694526373478 created: 1694524409029 url: http://localhost:3000/qrcode/generate_with_image @@ -921,8 +921,137 @@ resources: settingRebuildPath: true settingFollowRedirects: global _type: request - - _id: env_d70e108a1bfe41ca8ff251cef1c1e9a5 - parentId: wrk_cddddeca853e4720a57929758bac0eb7 + - _id: req_798cebdcc6894780b53d3aed803d6b69 + parentId: fld_4a96623a2d714f899d689ae010d7573c + modified: 1696086129352 + created: 1696076496546 + url: http://localhost:3000/quote?keywords=life + name: All quote + description: "" + method: GET + body: {} + parameters: [] + headers: + - name: User-Agent + value: insomnia/2023.5.8 + authentication: {} + metaSortKey: -1696073262529 + isPrivate: false + settingStoreCookies: true + settingSendCookies: true + settingDisableRenderRequestBody: false + settingEncodeUrl: true + settingRebuildPath: true + settingFollowRedirects: global + _type: request + - _id: fld_4a96623a2d714f899d689ae010d7573c + parentId: wrk_ece68cec0bc84cf8875451b86942519a + modified: 1696073255054 + created: 1696073242179 + name: quote + description: "" + environment: {} + environmentPropertyOrder: null + metaSortKey: -1693906311469 + _type: request_group + - _id: req_58fa459d5f5f466185f557e09aa3f47f + parentId: fld_4a96623a2d714f899d689ae010d7573c + modified: 1696076004326 + created: 1696073260618 + url: http://localhost:3000/quote/random + name: Random quote + description: "" + method: GET + body: {} + parameters: [] + headers: + - name: User-Agent + value: insomnia/2023.5.8 + authentication: {} + metaSortKey: -1696073262429 + isPrivate: false + settingStoreCookies: true + settingSendCookies: true + settingDisableRenderRequestBody: false + settingEncodeUrl: true + settingRebuildPath: true + settingFollowRedirects: global + _type: request + - _id: req_0783f55b3b4b4936b21006aeff0629dc + parentId: fld_4a96623a2d714f899d689ae010d7573c + modified: 1696086176812 + created: 1696074393623 + url: http://localhost:3000/quote + name: Create quote + 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: -1696073262329 + isPrivate: false + settingStoreCookies: true + settingSendCookies: true + settingDisableRenderRequestBody: false + settingEncodeUrl: true + settingRebuildPath: true + settingFollowRedirects: global + _type: request + - _id: req_35535f9de4bd47289ffa8ec8be04c027 + parentId: fld_4a96623a2d714f899d689ae010d7573c + modified: 1696079647349 + created: 1696079608157 + url: http://localhost:3000/quote/id/65180f268d204f0129adcdb3 + name: Update by Id + description: "" + method: PATCH + body: {} + parameters: [] + headers: + - name: User-Agent + value: insomnia/2023.5.8 + authentication: {} + metaSortKey: -1696073262279 + isPrivate: false + settingStoreCookies: true + settingSendCookies: true + settingDisableRenderRequestBody: false + settingEncodeUrl: true + settingRebuildPath: true + settingFollowRedirects: global + _type: request + - _id: req_d5dfd678bd4142e2906726231485b4fa + parentId: fld_4a96623a2d714f899d689ae010d7573c + modified: 1696081654855 + created: 1696079392908 + url: http://localhost:3000/quote/id/651826dc2824a3cf87e153af + name: Delete by Id + description: "" + method: DELETE + body: {} + parameters: [] + headers: + - name: User-Agent + value: insomnia/2023.5.8 + authentication: {} + metaSortKey: -1696073262229 + isPrivate: false + settingStoreCookies: true + settingSendCookies: true + settingDisableRenderRequestBody: false + settingEncodeUrl: true + settingRebuildPath: true + settingFollowRedirects: global + _type: request + - _id: env_93b56583b6fe45c9ab7f5526b689bb6d + parentId: wrk_ece68cec0bc84cf8875451b86942519a modified: 1694104754476 created: 1692100035451 name: Base Environment @@ -932,36 +1061,36 @@ resources: isPrivate: false metaSortKey: 1692100035451 _type: environment - - _id: jar_c4342b88e8714f248bb999416a49cd31 - parentId: wrk_cddddeca853e4720a57929758bac0eb7 - modified: 1694509539570 + - _id: jar_37c08f22f4e44dda8fd755899a8a7eed + parentId: wrk_ece68cec0bc84cf8875451b86942519a + modified: 1696083319553 created: 1692100035452 name: Default Jar cookies: - key: access_token - value: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMiwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTQ1MDk1MzksImV4cCI6MTY5NDUxMzEzOX0.cIaNnI48Lk7IKxWzoGhhg5jG2FbguOEfaJJwVmzU4dc - expires: 2023-09-12T10:05:39.000Z + value: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMSwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTYwODMzMTksImV4cCI6MTY5NjA4NjkxOX0._c_7cNWB7Su-evpTh2WQ_JPV6X3zMofdxE08_Ex0JpM + expires: 2023-09-30T15:15:19.000Z domain: localhost path: / secure: true httpOnly: true hostOnly: true creation: 2023-09-07T18:20:36.274Z - lastAccessed: 2023-09-12T09:05:39.569Z - sameSite: none - id: "4593084215682077" + lastAccessed: 2023-09-30T14:15:19.551Z + sameSite: lax + id: "27659898728757226" - key: refresh_token - value: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMiwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTQ1MDk1MzksImV4cCI6MTY5NTExNDMzOX0.9pJqeWCPQWT6wU5KCH_CaDnU1_hMQxf4yftNS8FsVvg - expires: 2023-09-19T09:05:39.000Z + value: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMSwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTYwODMzMTksImV4cCI6MTY5NjY4ODExOX0.svbevo1x-Owv1Uaq0krCmAcMwnr0W9ivTUB30yAWRC8 + expires: 2023-10-07T14:15:19.000Z domain: localhost path: / secure: true httpOnly: true hostOnly: true creation: 2023-09-07T18:20:36.275Z - lastAccessed: 2023-09-12T09:05:39.569Z - sameSite: none - id: "5622771899700447" + lastAccessed: 2023-09-30T14:15:19.552Z + sameSite: lax + id: "4291863071365083" - key: access_token value: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMiwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTQ1MDczMjcsImV4cCI6MTY5NDUxMDkyN30.iR63xf4QdoSNlYD6qE80y5hnQrgIXANVQxebEQ8I4f0 expires: 2023-09-12T09:28:47.000Z @@ -972,7 +1101,7 @@ resources: hostOnly: true creation: 2023-09-09T13:50:08.036Z lastAccessed: 2023-09-12T08:28:48.272Z - id: "35108049377650064" + id: "8355473275122447" - key: refresh_token value: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGVjY2I1NWZlN2I1NzNjMWVjNWFhYWUiLCJmaXJzdE5hbWUiOiJrb25zdGFudGluZSIsImxhc3ROYW1lIjoiZGF0dW5pc2h2aWxpIiwiYWdlIjoyMiwiZW1haWwiOiJrZGF1dGluaXNodmlsaUBnbWFpbC5jb20iLCJhZGRyZXNzIjoiYmF0dW1pIiwicm9sZSI6ImFkbWluIiwiemlwY29kZSI6IjYwMDAiLCJhdmF0YXIiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvNjg3ODI3ODY_dj00IiwiZ2VuZGVyIjoiTUFMRSIsInBob25lIjoiKzk5NTU1NTU1NTU1NSIsInZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTQ1MDczMjcsImV4cCI6MTY5NTExMjEyN30.ELrOkR8SRYd818_jl8m7xzG3MhhVNac-AhuG5_xOCig expires: 2023-09-19T08:28:47.000Z @@ -983,5 +1112,5 @@ resources: hostOnly: true creation: 2023-09-09T13:50:08.037Z lastAccessed: 2023-09-12T08:28:48.272Z - id: "1657699330217104" + id: "16450423847326734" _type: cookie_jar