├── .astro
└── types.d.ts
├── .gitignore
├── .npmrc
├── .prettierrc.mjs
├── README.md
├── astro.config.mjs
├── package-lock.json
├── package.json
├── public
├── assets
│ └── fonts
│ │ └── Roboto
│ │ └── Roboto.css
├── banner.png
├── cover-tw.png
├── cover.png
├── fake-api.png
├── favicon.png
├── icon.png
├── insomnia.png
├── json
│ ├── insomnia.json
│ └── postman.json
├── make-scrollable-code-focusable.js
└── postman.png
├── src
├── assets
│ ├── banner.png
│ ├── fake-api.png
│ ├── icon.png
│ └── logo.png
├── components
│ └── PreviewAPI
│ │ ├── CategoriesAPI.astro
│ │ ├── ProductsAPI.astro
│ │ └── UsersAPI.astro
├── constants
│ └── showcase.ts
├── content
│ ├── config.ts
│ ├── docs
│ │ ├── en
│ │ │ ├── about
│ │ │ │ ├── introduction.md
│ │ │ │ └── showcase.mdx
│ │ │ ├── gql
│ │ │ │ ├── auth-jwt.md
│ │ │ │ ├── categories.md
│ │ │ │ ├── files.md
│ │ │ │ ├── playground.md
│ │ │ │ ├── products-filter.md
│ │ │ │ ├── products.md
│ │ │ │ └── users.md
│ │ │ ├── index.mdx
│ │ │ ├── resources
│ │ │ │ ├── insomnia.md
│ │ │ │ └── postman.md
│ │ │ └── rest
│ │ │ │ ├── auth-jwt.md
│ │ │ │ ├── categories.md
│ │ │ │ ├── files.md
│ │ │ │ ├── locations.md
│ │ │ │ ├── products-filter.md
│ │ │ │ ├── products.md
│ │ │ │ ├── swagger.md
│ │ │ │ └── users.md
│ │ └── index.mdx
│ └── i18n
│ │ ├── en.json
│ │ └── es.json
├── env.d.ts
├── models
│ ├── category.model.ts
│ ├── index.ts
│ ├── product.model.ts
│ └── user.model.ts
├── pages
│ └── robots.txt.ts
└── styles
│ └── custom.css
├── tsconfig.json
└── vercel.json
/.astro/types.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # build output
2 | dist
3 |
4 | # dependencies
5 | node_modules/
6 |
7 | # logs
8 | npm-debug.log*
9 | yarn-debug.log*
10 | yarn-error.log*
11 |
12 | # environment variables
13 | .env
14 | .env.production
15 |
16 | # macOS-specific files
17 | .DS_Store
18 | .vercel
19 | .astro
20 | .vscode
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | # Expose Astro dependencies for `pnpm` users
2 | shamefully-hoist=true
3 |
--------------------------------------------------------------------------------
/.prettierrc.mjs:
--------------------------------------------------------------------------------
1 | /** @type {import("prettier").Config} */
2 | export default {
3 | plugins: ["prettier-plugin-astro"],
4 | overrides: [
5 | {
6 | files: "*.astro",
7 | options: {
8 | parser: "astro",
9 | },
10 | },
11 | ],
12 | };
13 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Starlight Starter Kit: Basics
2 |
3 | [](https://starlight.astro.build)
4 |
5 | ```
6 | npm create astro@latest -- --template starlight
7 | ```
8 |
9 | [](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics)
10 | [](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics)
11 |
12 | > 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun!
13 |
14 | ## 🚀 Project Structure
15 |
16 | Inside of your Astro + Starlight project, you'll see the following folders and files:
17 |
18 | ```
19 | .
20 | ├── public/
21 | ├── src/
22 | │ ├── assets/
23 | │ ├── content/
24 | │ │ ├── docs/
25 | │ │ └── config.ts
26 | │ └── env.d.ts
27 | ├── astro.config.mjs
28 | ├── package.json
29 | └── tsconfig.json
30 | ```
31 |
32 | Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.
33 |
34 | Images can be added to `src/assets/` and embedded in Markdown with a relative link.
35 |
36 | Static assets, like favicons, can be placed in the `public/` directory.
37 |
38 | ## 🧞 Commands
39 |
40 | All commands are run from the root of the project, from a terminal:
41 |
42 | | Command | Action |
43 | | :------------------------ | :----------------------------------------------- |
44 | | `npm install` | Installs dependencies |
45 | | `npm run dev` | Starts local dev server at `localhost:4321` |
46 | | `npm run build` | Build your production site to `./dist/` |
47 | | `npm run preview` | Preview your build locally, before deploying |
48 | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
49 | | `npm run astro -- --help` | Get help using the Astro CLI |
50 |
51 | ## 👀 Want to learn more?
52 |
53 | Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).
54 |
--------------------------------------------------------------------------------
/astro.config.mjs:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "astro/config";
2 | import starlight from "@astrojs/starlight";
3 |
4 | const site = "https://fakeapi.platzi.com";
5 |
6 | // https://astro.build/config
7 | export default defineConfig({
8 | site,
9 | integrations: [
10 | starlight({
11 | title: "Platzi Fake Store API",
12 | favicon: "/icon.png",
13 | head: [
14 | {
15 | tag: "meta",
16 | attrs: { property: "og:image", content: `${site}/cover.png?v=1` },
17 | },
18 | {
19 | tag: "meta",
20 | attrs: {
21 | property: "twitter:image",
22 | content: `${site}/cover-tw.png?v=1`,
23 | },
24 | },
25 | {
26 | tag: "link",
27 | attrs: { rel: "preconnect", href: "https://fonts.googleapis.com" },
28 | },
29 | {
30 | tag: "link",
31 | attrs: {
32 | rel: "preconnect",
33 | href: "https://fonts.gstatic.com",
34 | crossorigin: true,
35 | },
36 | },
37 | {
38 | tag: "link",
39 | attrs: {
40 | rel: "stylesheet",
41 | href: "https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;500&display=swap",
42 | },
43 | },
44 | {
45 | tag: "script",
46 | attrs: {
47 | src: "https://www.googletagmanager.com/gtag/js?id=G-TS6JSW87G9",
48 | async: true,
49 | },
50 | },
51 | {
52 | tag: "script",
53 | content: `window.dataLayer = window.dataLayer || [];
54 | function gtag(){dataLayer.push(arguments);}
55 | gtag('js', new Date());
56 | gtag('config', 'G-TS6JSW87G9');`,
57 | },
58 | ],
59 | logo: {
60 | src: "./src/assets/icon.png",
61 | },
62 | social: {
63 | github: "https://github.com/PlatziLabs/fake-api-backend",
64 | },
65 | defaultLocale: "en",
66 | locales: {
67 | en: {
68 | label: "English",
69 | },
70 | },
71 | sidebar: [
72 | {
73 | label: "About",
74 | items: [
75 | { label: "Introduction", link: "about/introduction/" },
76 | { label: "Showcase", link: "about/showcase/" },
77 | ],
78 | },
79 | {
80 | label: "REST API",
81 | items: [
82 | { label: "Products", link: "rest/products/" },
83 | { label: "Filter products", link: "rest/products-filter/" },
84 | { label: "Categories", link: "rest/categories/" },
85 | { label: "Users", link: "rest/users/" },
86 | { label: "Auth JWT", link: "rest/auth-jwt/" },
87 | { label: "Locations", link: "rest/locations/" },
88 | { label: "Files", link: "rest/files/" },
89 | { label: "Swagger Docs", link: "rest/swagger/" },
90 | ],
91 | },
92 | {
93 | label: "GraphQL",
94 | items: [
95 | { label: "Products", link: "gql/products/" },
96 | { label: "Filter products", link: "gql/products-filter/" },
97 | { label: "Categories", link: "gql/categories/" },
98 | { label: "Users", link: "gql/users/" },
99 | { label: "Auth JWT", link: "gql/auth-jwt/" },
100 | { label: "Playground", link: "gql/playground/" },
101 | ],
102 | },
103 | {
104 | label: "Resources",
105 | items: [
106 | { label: "Postman", link: "resources/postman/" },
107 | { label: "Insomnia", link: "resources/insomnia/" },
108 | ],
109 | },
110 | ],
111 | customCss: [
112 | "@fontsource/ibm-plex-serif/400.css",
113 | "@fontsource/ibm-plex-serif/600.css",
114 | "./src/styles/custom.css",
115 | ],
116 | }),
117 | ],
118 | });
119 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "radiant-ring",
3 | "type": "module",
4 | "version": "0.0.1",
5 | "scripts": {
6 | "dev": "astro dev",
7 | "start": "astro dev",
8 | "build": "astro check && astro build",
9 | "preview": "astro preview",
10 | "astro": "astro",
11 | "format": "prettier --write ."
12 | },
13 | "dependencies": {
14 | "@astrojs/check": "^0.9.4",
15 | "@astrojs/starlight": "^0.32.1",
16 | "@fontsource/ibm-plex-serif": "^5.0.8",
17 | "astro": "^5.3.1",
18 | "sharp": "^0.32.5",
19 | "typescript": "^5.2.2"
20 | },
21 | "devDependencies": {
22 | "prettier": "^3.5.2",
23 | "prettier-plugin-astro": "^0.14.1"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/public/assets/fonts/Roboto/Roboto.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: "Roboto";
3 | font-style: normal;
4 | font-weight: 400;
5 | src: url(https://fonts.gstatic.com/s/roboto/v29/KFOmCnqEu92Fr1Mu4mxK.woff2)
6 | format("woff2");
7 | unicode-range:
8 | U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
9 | U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
10 | U+FFFD;
11 | }
12 | @font-face {
13 | font-family: "Roboto";
14 | font-style: normal;
15 | font-weight: 500;
16 | src: url(https://fonts.gstatic.com/s/roboto/v29/KFOlCnqEu92Fr1MmEU9fBBc4.woff2)
17 | format("woff2");
18 | unicode-range:
19 | U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
20 | U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
21 | U+FFFD;
22 | }
23 | @font-face {
24 | font-family: "Roboto";
25 | font-style: normal;
26 | font-weight: 700;
27 | src: url(https://fonts.gstatic.com/s/roboto/v29/KFOlCnqEu92Fr1MmWUlfBBc4.woff2)
28 | format("woff2");
29 | unicode-range:
30 | U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
31 | U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
32 | U+FFFD;
33 | }
34 | @font-face {
35 | font-family: "Roboto";
36 | font-style: normal;
37 | font-weight: 900;
38 | src: url(https://fonts.gstatic.com/s/roboto/v29/KFOlCnqEu92Fr1MmYUtfBBc4.woff2)
39 | format("woff2");
40 | unicode-range:
41 | U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
42 | U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
43 | U+FFFD;
44 | }
45 |
--------------------------------------------------------------------------------
/public/banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlatziLabs/fake-api-docs/5a7517d5798f94130707968e966b0ec6da3102ad/public/banner.png
--------------------------------------------------------------------------------
/public/cover-tw.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlatziLabs/fake-api-docs/5a7517d5798f94130707968e966b0ec6da3102ad/public/cover-tw.png
--------------------------------------------------------------------------------
/public/cover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlatziLabs/fake-api-docs/5a7517d5798f94130707968e966b0ec6da3102ad/public/cover.png
--------------------------------------------------------------------------------
/public/fake-api.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlatziLabs/fake-api-docs/5a7517d5798f94130707968e966b0ec6da3102ad/public/fake-api.png
--------------------------------------------------------------------------------
/public/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlatziLabs/fake-api-docs/5a7517d5798f94130707968e966b0ec6da3102ad/public/favicon.png
--------------------------------------------------------------------------------
/public/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlatziLabs/fake-api-docs/5a7517d5798f94130707968e966b0ec6da3102ad/public/icon.png
--------------------------------------------------------------------------------
/public/insomnia.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlatziLabs/fake-api-docs/5a7517d5798f94130707968e966b0ec6da3102ad/public/insomnia.png
--------------------------------------------------------------------------------
/public/json/insomnia.json:
--------------------------------------------------------------------------------
1 | {
2 | "_type": "export",
3 | "__export_format": 4,
4 | "__export_date": "2023-01-03T20:51:27.271Z",
5 | "__export_source": "insomnia.desktop.app:v2022.7.0",
6 | "resources": [
7 | {
8 | "_id": "req_c776b17b2b13487dbf68fff9e0474c16",
9 | "parentId": "fld_27c44746f18f47d0924fa3a77f6657dc",
10 | "modified": 1672327424701,
11 | "created": 1672171348274,
12 | "url": "{{ _.API_URL }}/api/v1/products/",
13 | "name": "getAll",
14 | "description": "",
15 | "method": "GET",
16 | "body": {},
17 | "parameters": [],
18 | "headers": [],
19 | "authentication": {},
20 | "metaSortKey": -1634932093112,
21 | "isPrivate": false,
22 | "settingStoreCookies": true,
23 | "settingSendCookies": true,
24 | "settingDisableRenderRequestBody": false,
25 | "settingEncodeUrl": true,
26 | "settingRebuildPath": true,
27 | "settingFollowRedirects": "global",
28 | "_type": "request"
29 | },
30 | {
31 | "_id": "fld_27c44746f18f47d0924fa3a77f6657dc",
32 | "parentId": "fld_4614e74157bb41e28dcab468d55330d0",
33 | "modified": 1672171348272,
34 | "created": 1672171348272,
35 | "name": "products",
36 | "description": "",
37 | "environment": {},
38 | "environmentPropertyOrder": null,
39 | "metaSortKey": -1672089277353,
40 | "_type": "request_group"
41 | },
42 | {
43 | "_id": "fld_4614e74157bb41e28dcab468d55330d0",
44 | "parentId": "wrk_1e7b6afabe3f4aa5813985de4ec6b13b",
45 | "modified": 1672171348270,
46 | "created": 1672171348270,
47 | "name": "REST API",
48 | "description": "",
49 | "environment": {},
50 | "environmentPropertyOrder": null,
51 | "metaSortKey": -1672089375127,
52 | "_type": "request_group"
53 | },
54 | {
55 | "_id": "wrk_1e7b6afabe3f4aa5813985de4ec6b13b",
56 | "parentId": null,
57 | "modified": 1672329606037,
58 | "created": 1672171348240,
59 | "name": "Platzi Fake Store API",
60 | "description": "",
61 | "scope": "collection",
62 | "_type": "workspace"
63 | },
64 | {
65 | "_id": "req_b86a90751cdd459597a6a109b67714d0",
66 | "parentId": "fld_27c44746f18f47d0924fa3a77f6657dc",
67 | "modified": 1672417605441,
68 | "created": 1672171348279,
69 | "url": "{{ _.API_URL }}/api/v1/products/120",
70 | "name": "getOne",
71 | "description": "",
72 | "method": "GET",
73 | "body": {},
74 | "parameters": [],
75 | "headers": [],
76 | "authentication": {},
77 | "metaSortKey": -1634590219855.75,
78 | "isPrivate": false,
79 | "settingStoreCookies": true,
80 | "settingSendCookies": true,
81 | "settingDisableRenderRequestBody": false,
82 | "settingEncodeUrl": true,
83 | "settingRebuildPath": true,
84 | "settingFollowRedirects": "global",
85 | "_type": "request"
86 | },
87 | {
88 | "_id": "req_6ebd174997064476bbcf18bad9eea92f",
89 | "parentId": "fld_27c44746f18f47d0924fa3a77f6657dc",
90 | "modified": 1672761841599,
91 | "created": 1672171348286,
92 | "url": "{{ _.API_URL }}/api/v1/products/",
93 | "name": "create",
94 | "description": "",
95 | "method": "POST",
96 | "body": {
97 | "mimeType": "application/json",
98 | "text": "{\n\t\"title\": \"New Product\",\n\t\"price\": 10,\n\t\"description\": \"A description\",\n\t\"categoryId\": 1,\n\t\"images\": [\n\t\t\"https://placeimg.com/640/480/any\"\n\t]\n}"
99 | },
100 | "parameters": [],
101 | "headers": [
102 | {
103 | "name": "Content-Type",
104 | "value": "application/json",
105 | "id": "pair_0df83e19008842feb0a4366fe1624462"
106 | }
107 | ],
108 | "authentication": {},
109 | "metaSortKey": -1634547485698.7188,
110 | "isPrivate": false,
111 | "settingStoreCookies": true,
112 | "settingSendCookies": true,
113 | "settingDisableRenderRequestBody": false,
114 | "settingEncodeUrl": true,
115 | "settingRebuildPath": true,
116 | "settingFollowRedirects": "global",
117 | "_type": "request"
118 | },
119 | {
120 | "_id": "req_b1a61ebd331642118fc7dc482de05fea",
121 | "parentId": "fld_27c44746f18f47d0924fa3a77f6657dc",
122 | "modified": 1672764842438,
123 | "created": 1672171348284,
124 | "url": "{{ _.API_URL }}/api/v1/products/1",
125 | "name": "update",
126 | "description": "",
127 | "method": "PUT",
128 | "body": {
129 | "mimeType": "application/json",
130 | "text": "{\n \"title\": \"Change title\",\n \"price\": 100,\n\t\"images\": [\"https://placeimg.com/640/480/any\"]\n}"
131 | },
132 | "parameters": [],
133 | "headers": [
134 | {
135 | "name": "Content-Type",
136 | "value": "application/json",
137 | "id": "pair_0df83e19008842feb0a4366fe1624462"
138 | }
139 | ],
140 | "authentication": {},
141 | "metaSortKey": -1634526118620.2031,
142 | "isPrivate": false,
143 | "settingStoreCookies": true,
144 | "settingSendCookies": true,
145 | "settingDisableRenderRequestBody": false,
146 | "settingEncodeUrl": true,
147 | "settingRebuildPath": true,
148 | "settingFollowRedirects": "global",
149 | "_type": "request"
150 | },
151 | {
152 | "_id": "req_f78b63c34a75497ead89fb2dedbd78e3",
153 | "parentId": "fld_27c44746f18f47d0924fa3a77f6657dc",
154 | "modified": 1672417623812,
155 | "created": 1672171348303,
156 | "url": "{{ _.API_URL }}/api/v1/products/132",
157 | "name": "delete",
158 | "description": "",
159 | "method": "DELETE",
160 | "body": {},
161 | "parameters": [],
162 | "headers": [],
163 | "authentication": {},
164 | "metaSortKey": -1634504751541.6875,
165 | "isPrivate": false,
166 | "settingStoreCookies": true,
167 | "settingSendCookies": true,
168 | "settingDisableRenderRequestBody": false,
169 | "settingEncodeUrl": true,
170 | "settingRebuildPath": true,
171 | "settingFollowRedirects": "global",
172 | "_type": "request"
173 | },
174 | {
175 | "_id": "req_9f9b61ef9dfb49f6baa80c6bd8b3f89d",
176 | "parentId": "fld_27c44746f18f47d0924fa3a77f6657dc",
177 | "modified": 1672171348290,
178 | "created": 1672171348290,
179 | "url": "{{ _.API_URL }}/api/v1/products/",
180 | "name": "pagination",
181 | "description": "",
182 | "method": "GET",
183 | "body": {},
184 | "parameters": [
185 | {
186 | "id": "pair_3ba9be553276479d83f2e6330c75f661",
187 | "name": "offset",
188 | "value": "2",
189 | "description": "",
190 | "disabled": false
191 | },
192 | {
193 | "id": "pair_3d77edb2679c4116b410b920fc75a9c5",
194 | "name": "limit",
195 | "value": "2",
196 | "description": ""
197 | }
198 | ],
199 | "headers": [],
200 | "authentication": {},
201 | "metaSortKey": -1633991941607.3125,
202 | "isPrivate": false,
203 | "settingStoreCookies": true,
204 | "settingSendCookies": true,
205 | "settingDisableRenderRequestBody": false,
206 | "settingEncodeUrl": true,
207 | "settingRebuildPath": true,
208 | "settingFollowRedirects": "global",
209 | "_type": "request"
210 | },
211 | {
212 | "_id": "req_f175b158fee4473abd29a2eaa0b778da",
213 | "parentId": "fld_27c44746f18f47d0924fa3a77f6657dc",
214 | "modified": 1672171348296,
215 | "created": 1672171348296,
216 | "url": "{{ _.API_URL }}/api/v1/products/",
217 | "name": "by title",
218 | "description": "",
219 | "method": "GET",
220 | "body": {},
221 | "parameters": [
222 | {
223 | "id": "pair_3ba9be553276479d83f2e6330c75f661",
224 | "name": "title",
225 | "value": "Generic",
226 | "description": "",
227 | "disabled": false
228 | }
229 | ],
230 | "headers": [],
231 | "authentication": {},
232 | "metaSortKey": -1633991941557.3125,
233 | "isPrivate": false,
234 | "settingStoreCookies": true,
235 | "settingSendCookies": true,
236 | "settingDisableRenderRequestBody": false,
237 | "settingEncodeUrl": true,
238 | "settingRebuildPath": true,
239 | "settingFollowRedirects": "global",
240 | "_type": "request"
241 | },
242 | {
243 | "_id": "req_c3f520c7bbf64b42989580a354cc58ff",
244 | "parentId": "fld_27c44746f18f47d0924fa3a77f6657dc",
245 | "modified": 1672171348300,
246 | "created": 1672171348300,
247 | "url": "{{ _.API_URL }}/api/v1/products/",
248 | "name": "by prices",
249 | "description": "",
250 | "method": "GET",
251 | "body": {},
252 | "parameters": [
253 | {
254 | "id": "pair_3ba9be553276479d83f2e6330c75f661",
255 | "name": "price_min",
256 | "value": "900",
257 | "description": "",
258 | "disabled": false
259 | },
260 | {
261 | "id": "pair_077ac84162ce4f2bae5ea999e65df440",
262 | "name": "price_max",
263 | "value": "1000",
264 | "description": "",
265 | "disabled": false
266 | }
267 | ],
268 | "headers": [],
269 | "authentication": {},
270 | "metaSortKey": -1633991941507.3125,
271 | "isPrivate": false,
272 | "settingStoreCookies": true,
273 | "settingSendCookies": true,
274 | "settingDisableRenderRequestBody": false,
275 | "settingEncodeUrl": true,
276 | "settingRebuildPath": true,
277 | "settingFollowRedirects": "global",
278 | "_type": "request"
279 | },
280 | {
281 | "_id": "req_b495d704abd54ad8b6817495e7177b82",
282 | "parentId": "fld_27c44746f18f47d0924fa3a77f6657dc",
283 | "modified": 1672171348307,
284 | "created": 1672171348307,
285 | "url": "{{ _.API_URL }}/api/v1/products/",
286 | "name": "by category",
287 | "description": "",
288 | "method": "GET",
289 | "body": {},
290 | "parameters": [
291 | {
292 | "id": "pair_3ba9be553276479d83f2e6330c75f661",
293 | "name": "categoryId",
294 | "value": "1",
295 | "description": "",
296 | "disabled": false
297 | }
298 | ],
299 | "headers": [],
300 | "authentication": {},
301 | "metaSortKey": -1633778270797.1562,
302 | "isPrivate": false,
303 | "settingStoreCookies": true,
304 | "settingSendCookies": true,
305 | "settingDisableRenderRequestBody": false,
306 | "settingEncodeUrl": true,
307 | "settingRebuildPath": true,
308 | "settingFollowRedirects": "global",
309 | "_type": "request"
310 | },
311 | {
312 | "_id": "req_82c750fe2bb54708adbe118e0d0f483b",
313 | "parentId": "fld_fc5bd36a7d9a484f89bfee1b28b00a86",
314 | "modified": 1672171348317,
315 | "created": 1672171348317,
316 | "url": "{{ _.API_URL }}/api/v1/categories/",
317 | "name": "getAll",
318 | "description": "",
319 | "method": "GET",
320 | "body": {},
321 | "parameters": [],
322 | "headers": [],
323 | "authentication": {},
324 | "metaSortKey": -1634932093112,
325 | "isPrivate": false,
326 | "settingStoreCookies": true,
327 | "settingSendCookies": true,
328 | "settingDisableRenderRequestBody": false,
329 | "settingEncodeUrl": true,
330 | "settingRebuildPath": true,
331 | "settingFollowRedirects": "global",
332 | "_type": "request"
333 | },
334 | {
335 | "_id": "fld_fc5bd36a7d9a484f89bfee1b28b00a86",
336 | "parentId": "fld_4614e74157bb41e28dcab468d55330d0",
337 | "modified": 1672171348315,
338 | "created": 1672171348315,
339 | "name": "categories",
340 | "description": "",
341 | "environment": {},
342 | "environmentPropertyOrder": null,
343 | "metaSortKey": -1672089277203,
344 | "_type": "request_group"
345 | },
346 | {
347 | "_id": "req_0557bd4127aa43438411ff0c4c283405",
348 | "parentId": "fld_fc5bd36a7d9a484f89bfee1b28b00a86",
349 | "modified": 1672171348321,
350 | "created": 1672171348321,
351 | "url": "{{ _.API_URL }}/api/v1/categories/1",
352 | "name": "getOne",
353 | "description": "",
354 | "method": "GET",
355 | "body": {},
356 | "parameters": [],
357 | "headers": [],
358 | "authentication": {},
359 | "metaSortKey": -1634900042494.2266,
360 | "isPrivate": false,
361 | "settingStoreCookies": true,
362 | "settingSendCookies": true,
363 | "settingDisableRenderRequestBody": false,
364 | "settingEncodeUrl": true,
365 | "settingRebuildPath": true,
366 | "settingFollowRedirects": "global",
367 | "_type": "request"
368 | },
369 | {
370 | "_id": "req_c22513d5222f42bd8fa28ec57ee6ec72",
371 | "parentId": "fld_fc5bd36a7d9a484f89bfee1b28b00a86",
372 | "modified": 1672171348330,
373 | "created": 1672171348330,
374 | "url": "{{ _.API_URL }}/api/v1/categories/",
375 | "name": "create",
376 | "description": "",
377 | "method": "POST",
378 | "body": {
379 | "mimeType": "application/json",
380 | "text": "{\n \"name\": \"New Category\",\n \"image\": \"https://placeimg.com/640/480/any\"\n}"
381 | },
382 | "parameters": [],
383 | "headers": [
384 | {
385 | "name": "Content-Type",
386 | "value": "application/json",
387 | "id": "pair_7461a0646fad4c75a737345770f9cf0f"
388 | }
389 | ],
390 | "authentication": {},
391 | "metaSortKey": -1634547485698.7188,
392 | "isPrivate": false,
393 | "settingStoreCookies": true,
394 | "settingSendCookies": true,
395 | "settingDisableRenderRequestBody": false,
396 | "settingEncodeUrl": true,
397 | "settingRebuildPath": true,
398 | "settingFollowRedirects": "global",
399 | "_type": "request"
400 | },
401 | {
402 | "_id": "req_93859a3ce83344ca87c78fbce970ce0e",
403 | "parentId": "fld_fc5bd36a7d9a484f89bfee1b28b00a86",
404 | "modified": 1672765487841,
405 | "created": 1672171348325,
406 | "url": "{{ _.API_URL }}/api/v1/categories/3",
407 | "name": "update",
408 | "description": "",
409 | "method": "PUT",
410 | "body": {
411 | "mimeType": "application/json",
412 | "text": "{\n\t\"name\": \"Change title\"\n}"
413 | },
414 | "parameters": [],
415 | "headers": [
416 | {
417 | "name": "Content-Type",
418 | "value": "application/json",
419 | "id": "pair_7461a0646fad4c75a737345770f9cf0f"
420 | }
421 | ],
422 | "authentication": {},
423 | "metaSortKey": -1634419283227.625,
424 | "isPrivate": false,
425 | "settingStoreCookies": true,
426 | "settingSendCookies": true,
427 | "settingDisableRenderRequestBody": false,
428 | "settingEncodeUrl": true,
429 | "settingRebuildPath": true,
430 | "settingFollowRedirects": "global",
431 | "_type": "request"
432 | },
433 | {
434 | "_id": "req_070d11d7702f4eb28324e85ed2960dce",
435 | "parentId": "fld_fc5bd36a7d9a484f89bfee1b28b00a86",
436 | "modified": 1672171348339,
437 | "created": 1672171348339,
438 | "url": "{{ _.API_URL }}/api/v1/categories/1",
439 | "name": "delete",
440 | "description": "",
441 | "method": "DELETE",
442 | "body": {},
443 | "parameters": [],
444 | "headers": [],
445 | "authentication": {},
446 | "metaSortKey": -1634392574379.4805,
447 | "isPrivate": false,
448 | "settingStoreCookies": true,
449 | "settingSendCookies": true,
450 | "settingDisableRenderRequestBody": false,
451 | "settingEncodeUrl": true,
452 | "settingRebuildPath": true,
453 | "settingFollowRedirects": "global",
454 | "_type": "request"
455 | },
456 | {
457 | "_id": "req_ed0a11df5c2d44e1baae587fc5fbadb6",
458 | "parentId": "fld_fc5bd36a7d9a484f89bfee1b28b00a86",
459 | "modified": 1672171348333,
460 | "created": 1672171348333,
461 | "url": "{{ _.API_URL }}/api/v1/categories/1/products",
462 | "name": "products by category",
463 | "description": "",
464 | "method": "GET",
465 | "body": {},
466 | "parameters": [],
467 | "headers": [],
468 | "authentication": {},
469 | "metaSortKey": -1634392574329.4805,
470 | "isPrivate": false,
471 | "settingStoreCookies": true,
472 | "settingSendCookies": true,
473 | "settingDisableRenderRequestBody": false,
474 | "settingEncodeUrl": true,
475 | "settingRebuildPath": true,
476 | "settingFollowRedirects": "global",
477 | "_type": "request"
478 | },
479 | {
480 | "_id": "req_65064a2c2393411b9f5481de31f32441",
481 | "parentId": "fld_78339a787ce24506a8e3dc5d1826bbe7",
482 | "modified": 1672171348355,
483 | "created": 1672171348355,
484 | "url": "{{ _.API_URL }}/api/v1/users/",
485 | "name": "getAll",
486 | "description": "",
487 | "method": "GET",
488 | "body": {},
489 | "parameters": [
490 | {
491 | "id": "pair_3b6b774e4f7c4d9192086e6bf6064e94",
492 | "name": "limit",
493 | "value": "3",
494 | "description": ""
495 | }
496 | ],
497 | "headers": [],
498 | "authentication": {},
499 | "metaSortKey": -1645014463273,
500 | "isPrivate": false,
501 | "settingStoreCookies": true,
502 | "settingSendCookies": true,
503 | "settingDisableRenderRequestBody": false,
504 | "settingEncodeUrl": true,
505 | "settingRebuildPath": true,
506 | "settingFollowRedirects": "global",
507 | "_type": "request"
508 | },
509 | {
510 | "_id": "fld_78339a787ce24506a8e3dc5d1826bbe7",
511 | "parentId": "fld_4614e74157bb41e28dcab468d55330d0",
512 | "modified": 1672171348345,
513 | "created": 1672171348345,
514 | "name": "users",
515 | "description": "",
516 | "environment": {},
517 | "environmentPropertyOrder": null,
518 | "metaSortKey": -1672089277103,
519 | "_type": "request_group"
520 | },
521 | {
522 | "_id": "req_a3c60edd34624afa81c48700461092c2",
523 | "parentId": "fld_78339a787ce24506a8e3dc5d1826bbe7",
524 | "modified": 1672171348359,
525 | "created": 1672171348359,
526 | "url": "{{ _.API_URL }}/api/v1/users/3",
527 | "name": "getOne",
528 | "description": "",
529 | "method": "GET",
530 | "body": {},
531 | "parameters": [],
532 | "headers": [],
533 | "authentication": {},
534 | "metaSortKey": -1645014463248,
535 | "isPrivate": false,
536 | "settingStoreCookies": true,
537 | "settingSendCookies": true,
538 | "settingDisableRenderRequestBody": false,
539 | "settingEncodeUrl": true,
540 | "settingRebuildPath": true,
541 | "settingFollowRedirects": "global",
542 | "_type": "request"
543 | },
544 | {
545 | "_id": "req_b61b1f7d53a3489eab89f3c3da230158",
546 | "parentId": "fld_78339a787ce24506a8e3dc5d1826bbe7",
547 | "modified": 1672765730676,
548 | "created": 1672171348346,
549 | "url": "{{ _.API_URL }}/api/v1/users/",
550 | "name": "create",
551 | "description": "",
552 | "method": "POST",
553 | "body": {
554 | "mimeType": "application/json",
555 | "text": "{\n\t\"name\": \"Nicolas\",\n\t\"email\": \"nico@gmail.com\",\n\t\"password\": \"1234\",\n\t\"avatar\": \"https://api.lorem.space/image/movie?w=150&h=220\"\n}"
556 | },
557 | "parameters": [],
558 | "headers": [
559 | {
560 | "name": "Content-Type",
561 | "value": "application/json",
562 | "id": "pair_6c4adef091164c07b597fc1c8415ff6a"
563 | }
564 | ],
565 | "authentication": {},
566 | "metaSortKey": -1645014463223,
567 | "isPrivate": false,
568 | "settingStoreCookies": true,
569 | "settingSendCookies": true,
570 | "settingDisableRenderRequestBody": false,
571 | "settingEncodeUrl": true,
572 | "settingRebuildPath": true,
573 | "settingFollowRedirects": "global",
574 | "_type": "request"
575 | },
576 | {
577 | "_id": "req_75133b2109d14724a1bf422c13733f20",
578 | "parentId": "fld_78339a787ce24506a8e3dc5d1826bbe7",
579 | "modified": 1672171348361,
580 | "created": 1672171348361,
581 | "url": "{{ _.API_URL }}/api/v1/users/4",
582 | "name": "update",
583 | "description": "",
584 | "method": "PUT",
585 | "body": {
586 | "mimeType": "application/json",
587 | "text": "{\n\t\"name\": \"nicasa\",\n\t\"role\": \"admin\"\n}"
588 | },
589 | "parameters": [],
590 | "headers": [
591 | {
592 | "name": "Content-Type",
593 | "value": "application/json",
594 | "id": "pair_6c4adef091164c07b597fc1c8415ff6a"
595 | }
596 | ],
597 | "authentication": {},
598 | "metaSortKey": -1643635451067,
599 | "isPrivate": false,
600 | "settingStoreCookies": true,
601 | "settingSendCookies": true,
602 | "settingDisableRenderRequestBody": false,
603 | "settingEncodeUrl": true,
604 | "settingRebuildPath": true,
605 | "settingFollowRedirects": "global",
606 | "_type": "request"
607 | },
608 | {
609 | "_id": "req_33cd3599324e4502beac2540b7590230",
610 | "parentId": "fld_78339a787ce24506a8e3dc5d1826bbe7",
611 | "modified": 1672171348349,
612 | "created": 1672171348349,
613 | "url": "{{ _.API_URL }}/api/v1/users/is-available",
614 | "name": "isAvailable",
615 | "description": "",
616 | "method": "POST",
617 | "body": {
618 | "mimeType": "application/json",
619 | "text": "{\n\t\"email\": \"maria@mail.com\"\n}"
620 | },
621 | "parameters": [],
622 | "headers": [
623 | {
624 | "name": "Content-Type",
625 | "value": "application/json",
626 | "id": "pair_6c4adef091164c07b597fc1c8415ff6a"
627 | }
628 | ],
629 | "authentication": {},
630 | "metaSortKey": -1642256438911,
631 | "isPrivate": false,
632 | "settingStoreCookies": true,
633 | "settingSendCookies": true,
634 | "settingDisableRenderRequestBody": false,
635 | "settingEncodeUrl": true,
636 | "settingRebuildPath": true,
637 | "settingFollowRedirects": "global",
638 | "_type": "request"
639 | },
640 | {
641 | "_id": "req_0107b23ad490485baad518b238ab6532",
642 | "parentId": "fld_78339a787ce24506a8e3dc5d1826bbe7",
643 | "modified": 1672171348364,
644 | "created": 1672171348364,
645 | "url": "{{ _.API_URL }}/api/v1/users/3",
646 | "name": "delete",
647 | "description": "",
648 | "method": "DELETE",
649 | "body": {
650 | "mimeType": "application/json",
651 | "text": "{\n\t\"name\": \"nicasa\",\n\t\"role\": \"admin\"\n}"
652 | },
653 | "parameters": [],
654 | "headers": [
655 | {
656 | "name": "Content-Type",
657 | "value": "application/json",
658 | "id": "pair_6c4adef091164c07b597fc1c8415ff6a"
659 | }
660 | ],
661 | "authentication": {},
662 | "metaSortKey": -1642256438861,
663 | "isPrivate": false,
664 | "settingStoreCookies": true,
665 | "settingSendCookies": true,
666 | "settingDisableRenderRequestBody": false,
667 | "settingEncodeUrl": true,
668 | "settingRebuildPath": true,
669 | "settingFollowRedirects": "global",
670 | "_type": "request"
671 | },
672 | {
673 | "_id": "req_7b1b4a55a90c4120a7b74763dc4dd5e9",
674 | "parentId": "fld_3910c73eeda546788296cb5480d2503a",
675 | "modified": 1672171348371,
676 | "created": 1672171348371,
677 | "url": "{{ _.API_URL }}/api/v1/auth/login",
678 | "name": "login",
679 | "description": "",
680 | "method": "POST",
681 | "body": {
682 | "mimeType": "application/json",
683 | "text": "{\n\t\"email\": \"john@mail.com\",\n\t\"password\": \"changeme\"\n}"
684 | },
685 | "parameters": [],
686 | "headers": [
687 | {
688 | "name": "Content-Type",
689 | "value": "application/json",
690 | "id": "pair_6c4adef091164c07b597fc1c8415ff6a"
691 | }
692 | ],
693 | "authentication": {},
694 | "metaSortKey": -1671814786929,
695 | "isPrivate": false,
696 | "settingStoreCookies": true,
697 | "settingSendCookies": true,
698 | "settingDisableRenderRequestBody": false,
699 | "settingEncodeUrl": true,
700 | "settingRebuildPath": true,
701 | "settingFollowRedirects": "global",
702 | "_type": "request"
703 | },
704 | {
705 | "_id": "fld_3910c73eeda546788296cb5480d2503a",
706 | "parentId": "fld_4614e74157bb41e28dcab468d55330d0",
707 | "modified": 1672171348370,
708 | "created": 1672171348370,
709 | "name": "auth",
710 | "description": "",
711 | "environment": {},
712 | "environmentPropertyOrder": null,
713 | "metaSortKey": -1672089277078,
714 | "_type": "request_group"
715 | },
716 | {
717 | "_id": "req_b44dca5d3e864d1f86ef108b9dd64483",
718 | "parentId": "fld_3910c73eeda546788296cb5480d2503a",
719 | "modified": 1672171348376,
720 | "created": 1672171348376,
721 | "url": "{{ _.API_URL }}/api/v1/auth/profile",
722 | "name": "profile",
723 | "description": "",
724 | "method": "GET",
725 | "body": {},
726 | "parameters": [],
727 | "headers": [],
728 | "authentication": {
729 | "type": "bearer",
730 | "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEsImlhdCI6MTY3MTgxNDM0MCwiZXhwIjoxNjczNTQyMzQwfQ.962CqEYlZ1cb_nSoGLk4Gy26u0aEzvnPa4kPsfPWeVw",
731 | "disabled": false
732 | },
733 | "metaSortKey": -1671814786904,
734 | "isPrivate": false,
735 | "settingStoreCookies": true,
736 | "settingSendCookies": true,
737 | "settingDisableRenderRequestBody": false,
738 | "settingEncodeUrl": true,
739 | "settingRebuildPath": true,
740 | "settingFollowRedirects": "global",
741 | "_type": "request"
742 | },
743 | {
744 | "_id": "req_e8317f6967964cfcadf510ae2d5529c6",
745 | "parentId": "fld_3910c73eeda546788296cb5480d2503a",
746 | "modified": 1672766316454,
747 | "created": 1672171348379,
748 | "url": "{{ _.API_URL }}/api/v1/auth/refresh-token",
749 | "name": "refresh-token",
750 | "description": "",
751 | "method": "POST",
752 | "body": {
753 | "mimeType": "application/json",
754 | "text": "{\n\t\"refreshToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEsImlhdCI6MTY3Mjc2NjMxMCwiZXhwIjoxNjcyODAyMzEwfQ.-jEoN2jOLUme9Pj139n6IJ5k0CZyL4SedzMa4PK8ew\"\n}"
755 | },
756 | "parameters": [],
757 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
758 | "authentication": {},
759 | "metaSortKey": -1671814786879,
760 | "isPrivate": false,
761 | "settingStoreCookies": true,
762 | "settingSendCookies": true,
763 | "settingDisableRenderRequestBody": false,
764 | "settingEncodeUrl": true,
765 | "settingRebuildPath": true,
766 | "settingFollowRedirects": "global",
767 | "_type": "request"
768 | },
769 | {
770 | "_id": "req_2ff1825c04194602b9755c8540d7d6d5",
771 | "parentId": "fld_65d614d0be9940af9ec6e781a369aff2",
772 | "modified": 1672171348384,
773 | "created": 1672171348384,
774 | "url": "{{ _.API_URL }}/api/v1/files/upload",
775 | "name": "upload",
776 | "description": "",
777 | "method": "POST",
778 | "body": {
779 | "mimeType": "multipart/form-data",
780 | "params": [
781 | {
782 | "id": "pair_a72c7416c64645f49d9b492fd0824e29",
783 | "name": "file",
784 | "value": "",
785 | "description": "",
786 | "type": "file",
787 | "fileName": "C:\\Users\\nicob\\Downloads\\svgviewer-png-output (18).png"
788 | }
789 | ]
790 | },
791 | "parameters": [],
792 | "headers": [
793 | {
794 | "name": "Content-Type",
795 | "value": "multipart/form-data",
796 | "id": "pair_b27e283f8d0646f8885ce5160382d3ce"
797 | }
798 | ],
799 | "authentication": {},
800 | "metaSortKey": -1641566932833,
801 | "isPrivate": false,
802 | "settingStoreCookies": true,
803 | "settingSendCookies": true,
804 | "settingDisableRenderRequestBody": false,
805 | "settingEncodeUrl": true,
806 | "settingRebuildPath": true,
807 | "settingFollowRedirects": "global",
808 | "_type": "request"
809 | },
810 | {
811 | "_id": "fld_65d614d0be9940af9ec6e781a369aff2",
812 | "parentId": "fld_4614e74157bb41e28dcab468d55330d0",
813 | "modified": 1672171348383,
814 | "created": 1672171348383,
815 | "name": "files",
816 | "description": "",
817 | "environment": {},
818 | "environmentPropertyOrder": null,
819 | "metaSortKey": -1672089277053,
820 | "_type": "request_group"
821 | },
822 | {
823 | "_id": "req_12b5b2a22f93493d90f3bbf5eb115ac2",
824 | "parentId": "fld_65d614d0be9940af9ec6e781a369aff2",
825 | "modified": 1672171348390,
826 | "created": 1672171348390,
827 | "url": "{{ _.API_URL }}/api/v1/files/8e27.png",
828 | "name": "file",
829 | "description": "",
830 | "method": "GET",
831 | "body": {},
832 | "parameters": [],
833 | "headers": [],
834 | "authentication": {
835 | "type": "bearer",
836 | "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImpvaG5AbWFpbC5jb20iLCJzdWIiOjEsImlhdCI6MTY0ODc4ODAyNCwiZXhwIjoxNjQ4NzkxNjI0fQ.nBXfbX3JLTxp1yMNQk9YhHVAhuratlupTiru6ZPxrh0"
837 | },
838 | "metaSortKey": -1641222179794,
839 | "isPrivate": false,
840 | "settingStoreCookies": true,
841 | "settingSendCookies": true,
842 | "settingDisableRenderRequestBody": false,
843 | "settingEncodeUrl": true,
844 | "settingRebuildPath": true,
845 | "settingFollowRedirects": "global",
846 | "_type": "request"
847 | },
848 | {
849 | "_id": "req_9f37741c6f5a41f08d8bfa1141f8280e",
850 | "parentId": "fld_6afcac783cae46c68822ba3e7e3b8792",
851 | "modified": 1672171348401,
852 | "created": 1672171348401,
853 | "url": "{{ _.API_URL }}/graphql",
854 | "name": "getAll",
855 | "description": "",
856 | "method": "POST",
857 | "body": {
858 | "mimeType": "application/graphql",
859 | "text": "{\"query\":\"{\\n products{\\n\\t\\tid\\n title\\n price\\n\\t\\tdescription\\n\\t\\timages\\n\\t\\tcategory {\\n\\t\\t\\tid\\n\\t\\t\\tname\\n\\t\\t\\timage\\n\\t\\t}\\n }\\n}\"}"
860 | },
861 | "parameters": [],
862 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
863 | "authentication": {},
864 | "metaSortKey": -1672089377244,
865 | "isPrivate": false,
866 | "settingStoreCookies": true,
867 | "settingSendCookies": true,
868 | "settingDisableRenderRequestBody": false,
869 | "settingEncodeUrl": true,
870 | "settingRebuildPath": true,
871 | "settingFollowRedirects": "global",
872 | "_type": "request"
873 | },
874 | {
875 | "_id": "fld_6afcac783cae46c68822ba3e7e3b8792",
876 | "parentId": "fld_b2675aeece5848a18b12dd6702cc95d4",
877 | "modified": 1672171348399,
878 | "created": 1672171348399,
879 | "name": "products",
880 | "description": "",
881 | "environment": {},
882 | "environmentPropertyOrder": null,
883 | "metaSortKey": -1672089953636,
884 | "_type": "request_group"
885 | },
886 | {
887 | "_id": "fld_b2675aeece5848a18b12dd6702cc95d4",
888 | "parentId": "wrk_1e7b6afabe3f4aa5813985de4ec6b13b",
889 | "modified": 1672171348397,
890 | "created": 1672171348397,
891 | "name": "GraphQL",
892 | "description": "",
893 | "environment": {},
894 | "environmentPropertyOrder": null,
895 | "metaSortKey": -1672089375102,
896 | "_type": "request_group"
897 | },
898 | {
899 | "_id": "req_99b5469743954ab0a851bd9c05704909",
900 | "parentId": "fld_6afcac783cae46c68822ba3e7e3b8792",
901 | "modified": 1672171348416,
902 | "created": 1672171348416,
903 | "url": "{{ _.API_URL }}/graphql",
904 | "name": "getOne",
905 | "description": "",
906 | "method": "POST",
907 | "body": {
908 | "mimeType": "application/graphql",
909 | "text": "{\"query\":\"{\\n\\tproduct(id: \\\"1\\\") {\\n\\t\\ttitle\\n\\t\\tprice\\n\\t\\timages\\n\\t\\tcategory {\\n\\t\\t\\tid\\n\\t\\t\\tname\\n\\t\\t\\timage\\n\\t\\t}\\n\\t}\\n}\\n\"}"
910 | },
911 | "parameters": [],
912 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
913 | "authentication": {},
914 | "metaSortKey": -1672089375282.75,
915 | "isPrivate": false,
916 | "settingStoreCookies": true,
917 | "settingSendCookies": true,
918 | "settingDisableRenderRequestBody": false,
919 | "settingEncodeUrl": true,
920 | "settingRebuildPath": true,
921 | "settingFollowRedirects": "global",
922 | "_type": "request"
923 | },
924 | {
925 | "_id": "req_282acd15809b43f6bb47ec85b3a38f64",
926 | "parentId": "fld_6afcac783cae46c68822ba3e7e3b8792",
927 | "modified": 1672171348424,
928 | "created": 1672171348424,
929 | "url": "{{ _.API_URL }}/graphql",
930 | "name": "create",
931 | "description": "",
932 | "method": "POST",
933 | "body": {
934 | "mimeType": "application/graphql",
935 | "text": "{\"query\":\"mutation {\\n\\taddProduct(\\n\\t\\tdata: {\\n\\t\\t\\ttitle: \\\"New Product\\\"\\n\\t\\t\\tprice: 10\\n\\t\\t\\tdescription: \\\"A description\\\"\\n\\t\\t\\tcategoryId: 1\\n\\t\\t\\timages: [\\\"https://placeimg.com/640/480/any\\\"]\\n\\t\\t}\\n\\t) {\\n\\t\\ttitle\\n\\t\\tprice\\n\\t\\timages\\n\\t\\tcategory {\\n\\t\\t\\tid\\n\\t\\t\\tname\\n\\t\\t\\timage\\n\\t\\t}\\n\\t}\\n}\\n\",\"variables\":null}"
936 | },
937 | "parameters": [],
938 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
939 | "authentication": {},
940 | "metaSortKey": -1672089375250.0625,
941 | "isPrivate": false,
942 | "settingStoreCookies": true,
943 | "settingSendCookies": true,
944 | "settingDisableRenderRequestBody": false,
945 | "settingEncodeUrl": true,
946 | "settingRebuildPath": true,
947 | "settingFollowRedirects": "global",
948 | "_type": "request"
949 | },
950 | {
951 | "_id": "req_baa0fb36a0b04f958d5614dfbaecef4c",
952 | "parentId": "fld_6afcac783cae46c68822ba3e7e3b8792",
953 | "modified": 1672171348419,
954 | "created": 1672171348419,
955 | "url": "{{ _.API_URL }}/graphql",
956 | "name": "update",
957 | "description": "",
958 | "method": "POST",
959 | "body": {
960 | "mimeType": "application/graphql",
961 | "text": "{\"query\":\"mutation {\\n\\tupdateProduct(id: \\\"1\\\", changes: { title: \\\"udpate\\\" }) {\\n\\t\\ttitle\\n\\t\\tprice\\n\\t\\timages\\n\\t}\\n}\\n\"}"
962 | },
963 | "parameters": [],
964 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
965 | "authentication": {},
966 | "metaSortKey": -1672089375217.375,
967 | "isPrivate": false,
968 | "settingStoreCookies": true,
969 | "settingSendCookies": true,
970 | "settingDisableRenderRequestBody": false,
971 | "settingEncodeUrl": true,
972 | "settingRebuildPath": true,
973 | "settingFollowRedirects": "global",
974 | "_type": "request"
975 | },
976 | {
977 | "_id": "req_35714f2ee8db4d0dbe2d34342a6ec5db",
978 | "parentId": "fld_6afcac783cae46c68822ba3e7e3b8792",
979 | "modified": 1672770161541,
980 | "created": 1672171348421,
981 | "url": "{{ _.API_URL }}/graphql",
982 | "name": "delete",
983 | "description": "",
984 | "method": "POST",
985 | "body": {
986 | "mimeType": "application/graphql",
987 | "text": "{\"query\":\"mutation {\\n\\tdeleteProduct(id: 111)\\n}\\n\"}"
988 | },
989 | "parameters": [],
990 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
991 | "authentication": {},
992 | "metaSortKey": -1672089375184.6875,
993 | "isPrivate": false,
994 | "settingStoreCookies": true,
995 | "settingSendCookies": true,
996 | "settingDisableRenderRequestBody": false,
997 | "settingEncodeUrl": true,
998 | "settingRebuildPath": true,
999 | "settingFollowRedirects": "global",
1000 | "_type": "request"
1001 | },
1002 | {
1003 | "_id": "req_26a9035e1b404abea72b1166b620462c",
1004 | "parentId": "fld_6afcac783cae46c68822ba3e7e3b8792",
1005 | "modified": 1672770217043,
1006 | "created": 1672171348406,
1007 | "url": "{{ _.API_URL }}/graphql",
1008 | "name": "pagination",
1009 | "description": "",
1010 | "method": "POST",
1011 | "body": {
1012 | "mimeType": "application/graphql",
1013 | "text": "{\"query\":\"{\\n products(limit: 2, offset: 0){\\n title\\n price\\n }\\n}\"}"
1014 | },
1015 | "parameters": [],
1016 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
1017 | "authentication": {},
1018 | "metaSortKey": -1672089375134.6875,
1019 | "isPrivate": false,
1020 | "settingStoreCookies": true,
1021 | "settingSendCookies": true,
1022 | "settingDisableRenderRequestBody": false,
1023 | "settingEncodeUrl": true,
1024 | "settingRebuildPath": true,
1025 | "settingFollowRedirects": "global",
1026 | "_type": "request"
1027 | },
1028 | {
1029 | "_id": "req_c142473455a74ed08453f008311fe692",
1030 | "parentId": "fld_6afcac783cae46c68822ba3e7e3b8792",
1031 | "modified": 1672770523796,
1032 | "created": 1672171348409,
1033 | "url": "{{ _.API_URL }}/graphql",
1034 | "name": "by query",
1035 | "description": "",
1036 | "method": "POST",
1037 | "body": {
1038 | "mimeType": "application/graphql",
1039 | "text": "{\"query\":\"{\\n products(title: \\\"Generic\\\"){\\n title\\n price\\n }\\n}\"}"
1040 | },
1041 | "parameters": [],
1042 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
1043 | "authentication": {},
1044 | "metaSortKey": -1672089375084.6875,
1045 | "isPrivate": false,
1046 | "settingStoreCookies": true,
1047 | "settingSendCookies": true,
1048 | "settingDisableRenderRequestBody": false,
1049 | "settingEncodeUrl": true,
1050 | "settingRebuildPath": true,
1051 | "settingFollowRedirects": "global",
1052 | "_type": "request"
1053 | },
1054 | {
1055 | "_id": "req_394ffe6880e345b0a7e12a72dfab9572",
1056 | "parentId": "fld_6afcac783cae46c68822ba3e7e3b8792",
1057 | "modified": 1672171348413,
1058 | "created": 1672171348413,
1059 | "url": "{{ _.API_URL }}/graphql",
1060 | "name": "by prices",
1061 | "description": "",
1062 | "method": "POST",
1063 | "body": {
1064 | "mimeType": "application/graphql",
1065 | "text": "{\"query\":\"{\\n\\tproducts(price_min: 100, price_max: 200) {\\n\\t\\ttitle\\n\\t\\tprice\\n\\t}\\n}\\n\"}"
1066 | },
1067 | "parameters": [],
1068 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
1069 | "authentication": {},
1070 | "metaSortKey": -1672089375034.6875,
1071 | "isPrivate": false,
1072 | "settingStoreCookies": true,
1073 | "settingSendCookies": true,
1074 | "settingDisableRenderRequestBody": false,
1075 | "settingEncodeUrl": true,
1076 | "settingRebuildPath": true,
1077 | "settingFollowRedirects": "global",
1078 | "_type": "request"
1079 | },
1080 | {
1081 | "_id": "req_33601ebd816d483cbfe51b0b10a75ab8",
1082 | "parentId": "fld_6afcac783cae46c68822ba3e7e3b8792",
1083 | "modified": 1672770702152,
1084 | "created": 1672171348427,
1085 | "url": "{{ _.API_URL }}/graphql",
1086 | "name": "by category",
1087 | "description": "",
1088 | "method": "POST",
1089 | "body": {
1090 | "mimeType": "application/graphql",
1091 | "text": "{\"query\":\"{\\n\\tproducts(title: \\\"Generic\\\", categoryId: 1, price_min: 100, price_max: 1000) {\\n\\t\\ttitle\\n\\t\\tprice\\n\\t\\tcategory {\\n\\t\\t\\tid\\n\\t\\t\\tname\\n\\t\\t}\\n\\t}\\n}\\n\",\"variables\":null}"
1092 | },
1093 | "parameters": [],
1094 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
1095 | "authentication": {},
1096 | "metaSortKey": -1671952080956.8438,
1097 | "isPrivate": false,
1098 | "settingStoreCookies": true,
1099 | "settingSendCookies": true,
1100 | "settingDisableRenderRequestBody": false,
1101 | "settingEncodeUrl": true,
1102 | "settingRebuildPath": true,
1103 | "settingFollowRedirects": "global",
1104 | "_type": "request"
1105 | },
1106 | {
1107 | "_id": "req_e01b0500b4124b209f94d23052ac181d",
1108 | "parentId": "fld_1636402e55344683983ded1b182a53b3",
1109 | "modified": 1672171348436,
1110 | "created": 1672171348436,
1111 | "url": "{{ _.API_URL }}/graphql",
1112 | "name": "getAll",
1113 | "description": "",
1114 | "method": "POST",
1115 | "body": {
1116 | "mimeType": "application/graphql",
1117 | "text": "{\"query\":\"{\\n categories{\\n\\t\\tid\\n\\t\\tname\\n\\t\\timage\\n }\\n}\"}"
1118 | },
1119 | "parameters": [],
1120 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
1121 | "authentication": {},
1122 | "metaSortKey": -1672089963670,
1123 | "isPrivate": false,
1124 | "settingStoreCookies": true,
1125 | "settingSendCookies": true,
1126 | "settingDisableRenderRequestBody": false,
1127 | "settingEncodeUrl": true,
1128 | "settingRebuildPath": true,
1129 | "settingFollowRedirects": "global",
1130 | "_type": "request"
1131 | },
1132 | {
1133 | "_id": "fld_1636402e55344683983ded1b182a53b3",
1134 | "parentId": "fld_b2675aeece5848a18b12dd6702cc95d4",
1135 | "modified": 1672171348434,
1136 | "created": 1672171348434,
1137 | "name": "categories",
1138 | "description": "",
1139 | "environment": {},
1140 | "environmentPropertyOrder": null,
1141 | "metaSortKey": -1672089953586,
1142 | "_type": "request_group"
1143 | },
1144 | {
1145 | "_id": "req_b8cff2764a784cb2afa47a24d10b65e9",
1146 | "parentId": "fld_1636402e55344683983ded1b182a53b3",
1147 | "modified": 1672171348439,
1148 | "created": 1672171348439,
1149 | "url": "{{ _.API_URL }}/graphql",
1150 | "name": "getOne",
1151 | "description": "",
1152 | "method": "POST",
1153 | "body": {
1154 | "mimeType": "application/graphql",
1155 | "text": "{\"query\":\"{\\n category(id: 1){\\n\\t\\tid\\n\\t\\tname\\n\\t\\timage\\n }\\n}\"}"
1156 | },
1157 | "parameters": [],
1158 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
1159 | "authentication": {},
1160 | "metaSortKey": -1672089853715.125,
1161 | "isPrivate": false,
1162 | "settingStoreCookies": true,
1163 | "settingSendCookies": true,
1164 | "settingDisableRenderRequestBody": false,
1165 | "settingEncodeUrl": true,
1166 | "settingRebuildPath": true,
1167 | "settingFollowRedirects": "global",
1168 | "_type": "request"
1169 | },
1170 | {
1171 | "_id": "req_2c950103c6bb4785b817254b0f9c9e45",
1172 | "parentId": "fld_1636402e55344683983ded1b182a53b3",
1173 | "modified": 1672171348450,
1174 | "created": 1672171348450,
1175 | "url": "{{ _.API_URL }}/graphql",
1176 | "name": "create",
1177 | "description": "",
1178 | "method": "POST",
1179 | "body": {
1180 | "mimeType": "application/graphql",
1181 | "text": "{\"query\":\"mutation {\\n\\taddCategory(\\n\\t\\tdata: { name: \\\"New Category\\\", image: \\\"https://placeimg.com/640/480/any\\\" }\\n\\t) {\\n\\t\\tid\\n\\t\\tname\\n\\t\\timage\\n\\t}\\n}\\n\"}"
1182 | },
1183 | "parameters": [],
1184 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
1185 | "authentication": {},
1186 | "metaSortKey": -1672089798737.6875,
1187 | "isPrivate": false,
1188 | "settingStoreCookies": true,
1189 | "settingSendCookies": true,
1190 | "settingDisableRenderRequestBody": false,
1191 | "settingEncodeUrl": true,
1192 | "settingRebuildPath": true,
1193 | "settingFollowRedirects": "global",
1194 | "_type": "request"
1195 | },
1196 | {
1197 | "_id": "req_20964850d6d54df1a5c26b01b46319f1",
1198 | "parentId": "fld_1636402e55344683983ded1b182a53b3",
1199 | "modified": 1672171348443,
1200 | "created": 1672171348443,
1201 | "url": "{{ _.API_URL }}/graphql",
1202 | "name": "update",
1203 | "description": "",
1204 | "method": "POST",
1205 | "body": {
1206 | "mimeType": "application/graphql",
1207 | "text": "{\"query\":\"mutation {\\n\\tupdateCategory(id: 1, changes: { name: \\\"change\\\" }) {\\n\\t\\tid\\n\\t\\tname\\n\\t\\timage\\n\\t}\\n}\\n\"}"
1208 | },
1209 | "parameters": [],
1210 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
1211 | "authentication": {},
1212 | "metaSortKey": -1672089771248.9688,
1213 | "isPrivate": false,
1214 | "settingStoreCookies": true,
1215 | "settingSendCookies": true,
1216 | "settingDisableRenderRequestBody": false,
1217 | "settingEncodeUrl": true,
1218 | "settingRebuildPath": true,
1219 | "settingFollowRedirects": "global",
1220 | "_type": "request"
1221 | },
1222 | {
1223 | "_id": "req_5b4fae03514a40d8a8b4ce4989cab19d",
1224 | "parentId": "fld_1636402e55344683983ded1b182a53b3",
1225 | "modified": 1672771618554,
1226 | "created": 1672171348445,
1227 | "url": "{{ _.API_URL }}/graphql",
1228 | "name": "delete",
1229 | "description": "",
1230 | "method": "POST",
1231 | "body": {
1232 | "mimeType": "application/graphql",
1233 | "text": "{\"query\":\"mutation {\\n\\tdeleteCategory(id: 6)\\n}\\n\"}"
1234 | },
1235 | "parameters": [],
1236 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
1237 | "authentication": {},
1238 | "metaSortKey": -1672089757504.6094,
1239 | "isPrivate": false,
1240 | "settingStoreCookies": true,
1241 | "settingSendCookies": true,
1242 | "settingDisableRenderRequestBody": false,
1243 | "settingEncodeUrl": true,
1244 | "settingRebuildPath": true,
1245 | "settingFollowRedirects": "global",
1246 | "_type": "request"
1247 | },
1248 | {
1249 | "_id": "req_6d5ed894ece648ee80120d4722a33370",
1250 | "parentId": "fld_18c8c9902e134afdb86751456ac4b1f5",
1251 | "modified": 1672171348457,
1252 | "created": 1672171348457,
1253 | "url": "{{ _.API_URL }}/graphql",
1254 | "name": "getAll",
1255 | "description": "",
1256 | "method": "POST",
1257 | "body": {
1258 | "mimeType": "application/graphql",
1259 | "text": "{\"query\":\"{\\n users{\\n\\t\\tid\\n\\t\\tname\\n\\t\\temail\\n }\\n}\"}"
1260 | },
1261 | "parameters": [],
1262 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
1263 | "authentication": {},
1264 | "metaSortKey": -1672089963670,
1265 | "isPrivate": false,
1266 | "settingStoreCookies": true,
1267 | "settingSendCookies": true,
1268 | "settingDisableRenderRequestBody": false,
1269 | "settingEncodeUrl": true,
1270 | "settingRebuildPath": true,
1271 | "settingFollowRedirects": "global",
1272 | "_type": "request"
1273 | },
1274 | {
1275 | "_id": "fld_18c8c9902e134afdb86751456ac4b1f5",
1276 | "parentId": "fld_b2675aeece5848a18b12dd6702cc95d4",
1277 | "modified": 1672171348454,
1278 | "created": 1672171348454,
1279 | "name": "users",
1280 | "description": "",
1281 | "environment": {},
1282 | "environmentPropertyOrder": null,
1283 | "metaSortKey": -1672089664356.5,
1284 | "_type": "request_group"
1285 | },
1286 | {
1287 | "_id": "req_caf4a6e4c4f54e3c883041fc29356c33",
1288 | "parentId": "fld_18c8c9902e134afdb86751456ac4b1f5",
1289 | "modified": 1672777741553,
1290 | "created": 1672171348460,
1291 | "url": "{{ _.API_URL }}/graphql",
1292 | "name": "getOne",
1293 | "description": "",
1294 | "method": "POST",
1295 | "body": {
1296 | "mimeType": "application/graphql",
1297 | "text": "{\"query\":\"query {\\n user(id: 1){\\n\\t\\tid\\n\\t\\tname\\n\\t\\tavatar\\n }\\n}\"}"
1298 | },
1299 | "parameters": [],
1300 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
1301 | "authentication": {},
1302 | "metaSortKey": -1672089853715.125,
1303 | "isPrivate": false,
1304 | "settingStoreCookies": true,
1305 | "settingSendCookies": true,
1306 | "settingDisableRenderRequestBody": false,
1307 | "settingEncodeUrl": true,
1308 | "settingRebuildPath": true,
1309 | "settingFollowRedirects": "global",
1310 | "_type": "request"
1311 | },
1312 | {
1313 | "_id": "req_761a646a80e8423c9bc583f79848537f",
1314 | "parentId": "fld_18c8c9902e134afdb86751456ac4b1f5",
1315 | "modified": 1672777839353,
1316 | "created": 1672171348469,
1317 | "url": "{{ _.API_URL }}/graphql",
1318 | "name": "create",
1319 | "description": "",
1320 | "method": "POST",
1321 | "body": {
1322 | "mimeType": "application/graphql",
1323 | "text": "{\"query\":\"mutation {\\n\\taddUser(\\n\\t\\tdata: {\\n\\t\\t\\tname: \\\"Nicolas\\\"\\n\\t\\t\\temail: \\\"nico@gmail.com\\\"\\n\\t\\t\\tpassword: \\\"1234\\\"\\n\\t\\t\\tavatar: \\\"https://api.lorem.space/image/face?w=150&h=220\\\"\\n\\t\\t}\\n\\t) {\\n\\t\\tid\\n\\t\\tname\\n\\t\\tavatar\\n\\t}\\n}\\n\",\"variables\":null}"
1324 | },
1325 | "parameters": [],
1326 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
1327 | "authentication": {},
1328 | "metaSortKey": -1672089798737.6875,
1329 | "isPrivate": false,
1330 | "settingStoreCookies": true,
1331 | "settingSendCookies": true,
1332 | "settingDisableRenderRequestBody": false,
1333 | "settingEncodeUrl": true,
1334 | "settingRebuildPath": true,
1335 | "settingFollowRedirects": "global",
1336 | "_type": "request"
1337 | },
1338 | {
1339 | "_id": "req_579438a4ae544d4db92ff601666464ee",
1340 | "parentId": "fld_18c8c9902e134afdb86751456ac4b1f5",
1341 | "modified": 1672171348464,
1342 | "created": 1672171348464,
1343 | "url": "{{ _.API_URL }}/graphql",
1344 | "name": "update",
1345 | "description": "",
1346 | "method": "POST",
1347 | "body": {
1348 | "mimeType": "application/graphql",
1349 | "text": "{\"query\":\"mutation {\\n\\tupdateUser(id: 1, changes: { name: \\\"change\\\" }) {\\n\\t\\tid\\n\\t\\tname\\n\\t\\tavatar\\n\\t}\\n}\\n\"}"
1350 | },
1351 | "parameters": [],
1352 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
1353 | "authentication": {},
1354 | "metaSortKey": -1672089771248.9688,
1355 | "isPrivate": false,
1356 | "settingStoreCookies": true,
1357 | "settingSendCookies": true,
1358 | "settingDisableRenderRequestBody": false,
1359 | "settingEncodeUrl": true,
1360 | "settingRebuildPath": true,
1361 | "settingFollowRedirects": "global",
1362 | "_type": "request"
1363 | },
1364 | {
1365 | "_id": "req_6d780c4c5f874722850f09a8e79f385d",
1366 | "parentId": "fld_18c8c9902e134afdb86751456ac4b1f5",
1367 | "modified": 1672778377576,
1368 | "created": 1672778091151,
1369 | "url": "{{ _.API_URL }}/graphql",
1370 | "name": "isAvailable",
1371 | "description": "",
1372 | "method": "POST",
1373 | "body": {
1374 | "mimeType": "application/graphql",
1375 | "text": "{\"query\":\"query {\\n\\tisAvailable(email: \\\"john@mail.com\\\")\\n}\\n\"}"
1376 | },
1377 | "parameters": [],
1378 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
1379 | "authentication": {},
1380 | "metaSortKey": -1672089764376.789,
1381 | "isPrivate": false,
1382 | "settingStoreCookies": true,
1383 | "settingSendCookies": true,
1384 | "settingDisableRenderRequestBody": false,
1385 | "settingEncodeUrl": true,
1386 | "settingRebuildPath": true,
1387 | "settingFollowRedirects": "global",
1388 | "_type": "request"
1389 | },
1390 | {
1391 | "_id": "req_d778f8ad778544c28f827b1c08a16517",
1392 | "parentId": "fld_18c8c9902e134afdb86751456ac4b1f5",
1393 | "modified": 1672171348467,
1394 | "created": 1672171348467,
1395 | "url": "{{ _.API_URL }}/graphql",
1396 | "name": "delete",
1397 | "description": "",
1398 | "method": "POST",
1399 | "body": {
1400 | "mimeType": "application/graphql",
1401 | "text": "{\"query\":\"mutation {\\n\\tdeleteUser(id: 1)\\n}\\n\"}"
1402 | },
1403 | "parameters": [],
1404 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
1405 | "authentication": {},
1406 | "metaSortKey": -1672089757504.6094,
1407 | "isPrivate": false,
1408 | "settingStoreCookies": true,
1409 | "settingSendCookies": true,
1410 | "settingDisableRenderRequestBody": false,
1411 | "settingEncodeUrl": true,
1412 | "settingRebuildPath": true,
1413 | "settingFollowRedirects": "global",
1414 | "_type": "request"
1415 | },
1416 | {
1417 | "_id": "req_6c6c6fec6c4b4b22a4615fa421852154",
1418 | "parentId": "fld_48613a62aef54dc5a4300751b50c037f",
1419 | "modified": 1672171348477,
1420 | "created": 1672171348477,
1421 | "url": "{{ _.API_URL }}/graphql",
1422 | "name": "login",
1423 | "description": "",
1424 | "method": "POST",
1425 | "body": {
1426 | "mimeType": "application/graphql",
1427 | "text": "{\"query\":\"mutation {\\n\\tlogin(email: \\\"john@mail.com\\\", password: \\\"changeme\\\") {\\n\\t\\taccess_token\\n\\t\\trefresh_token\\n\\t}\\n}\\n\"}"
1428 | },
1429 | "parameters": [],
1430 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
1431 | "authentication": {},
1432 | "metaSortKey": -1672089963670,
1433 | "isPrivate": false,
1434 | "settingStoreCookies": true,
1435 | "settingSendCookies": true,
1436 | "settingDisableRenderRequestBody": false,
1437 | "settingEncodeUrl": true,
1438 | "settingRebuildPath": true,
1439 | "settingFollowRedirects": "global",
1440 | "_type": "request"
1441 | },
1442 | {
1443 | "_id": "fld_48613a62aef54dc5a4300751b50c037f",
1444 | "parentId": "fld_b2675aeece5848a18b12dd6702cc95d4",
1445 | "modified": 1672171348475,
1446 | "created": 1672171348475,
1447 | "name": "auth",
1448 | "description": "",
1449 | "environment": {},
1450 | "environmentPropertyOrder": null,
1451 | "metaSortKey": -1672089519741.75,
1452 | "_type": "request_group"
1453 | },
1454 | {
1455 | "_id": "req_4b8ff21b0bdc40b68d7daf00376445fd",
1456 | "parentId": "fld_48613a62aef54dc5a4300751b50c037f",
1457 | "modified": 1672171348480,
1458 | "created": 1672171348480,
1459 | "url": "{{ _.API_URL }}/graphql",
1460 | "name": "myProfile",
1461 | "description": "",
1462 | "method": "POST",
1463 | "body": {
1464 | "mimeType": "application/graphql",
1465 | "text": "{\"query\":\"{\\n\\tmyProfile {\\n\\t\\tid\\n\\t\\tname\\n\\t\\tavatar\\n\\t}\\n}\\n\"}"
1466 | },
1467 | "parameters": [],
1468 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
1469 | "authentication": {
1470 | "type": "bearer",
1471 | "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEsImlhdCI6MTY3MjE2MDcwNywiZXhwIjoxNjczODg4NzA3fQ.uo5EG0rBCO7qnVe7TtC6WxuwBbICcwnkqclMSgR4L7Y"
1472 | },
1473 | "metaSortKey": -1672089853715.125,
1474 | "isPrivate": false,
1475 | "settingStoreCookies": true,
1476 | "settingSendCookies": true,
1477 | "settingDisableRenderRequestBody": false,
1478 | "settingEncodeUrl": true,
1479 | "settingRebuildPath": true,
1480 | "settingFollowRedirects": "global",
1481 | "_type": "request"
1482 | },
1483 | {
1484 | "_id": "req_8665d9606ef74600a1d46724af7d3216",
1485 | "parentId": "fld_48613a62aef54dc5a4300751b50c037f",
1486 | "modified": 1672778801362,
1487 | "created": 1672171348482,
1488 | "url": "{{ _.API_URL }}/graphql",
1489 | "name": "refreshToken",
1490 | "description": "",
1491 | "method": "POST",
1492 | "body": {
1493 | "mimeType": "application/graphql",
1494 | "text": "{\"query\":\"mutation {\\n\\trefreshToken(\\n\\t\\trefreshToken: \\\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEsImlhdCI6MTY3Mjc3ODY4MywiZXhwIjoxNjcyODE0NjgzfQ.XMjQQ6tTHAvy2ELrsYN0enWcQTo0PTeqb46-OrhUK7o\\\"\\n\\t) {\\n\\t\\taccess_token\\n\\t\\trefresh_token\\n\\t}\\n}\\n\",\"variables\":null}"
1495 | },
1496 | "parameters": [],
1497 | "headers": [{ "name": "Content-Type", "value": "application/json" }],
1498 | "authentication": {},
1499 | "metaSortKey": -1672089798737.6875,
1500 | "isPrivate": false,
1501 | "settingStoreCookies": true,
1502 | "settingSendCookies": true,
1503 | "settingDisableRenderRequestBody": false,
1504 | "settingEncodeUrl": true,
1505 | "settingRebuildPath": true,
1506 | "settingFollowRedirects": "global",
1507 | "_type": "request"
1508 | },
1509 | {
1510 | "_id": "env_7197aa4129484ee0adfde3036cc8bd6d",
1511 | "parentId": "wrk_1e7b6afabe3f4aa5813985de4ec6b13b",
1512 | "modified": 1672171348242,
1513 | "created": 1672171348242,
1514 | "name": "Base Environment",
1515 | "data": {},
1516 | "dataPropertyOrder": {},
1517 | "color": null,
1518 | "isPrivate": false,
1519 | "metaSortKey": 1634932084267,
1520 | "_type": "environment"
1521 | },
1522 | {
1523 | "_id": "jar_72d97e99144842f9b2e6d6b4c811c66c",
1524 | "parentId": "wrk_1e7b6afabe3f4aa5813985de4ec6b13b",
1525 | "modified": 1672171348258,
1526 | "created": 1672171348258,
1527 | "name": "Default Jar",
1528 | "cookies": [
1529 | {
1530 | "key": "_mcid",
1531 | "value": "1.0e909ed12c0a970f1d20fb728a2c8d1e.82d987a5c3e3505a224dc90f166c56edb9b6eca7e38592ff4bc074503da74a51",
1532 | "expires": "2023-01-15T00:16:14.000Z",
1533 | "maxAge": 31536000,
1534 | "domain": "nicobytes.us20.list-manage.com",
1535 | "path": "/",
1536 | "hostOnly": true,
1537 | "creation": "2022-01-14T23:08:37.926Z",
1538 | "lastAccessed": "2022-01-15T00:16:13.975Z",
1539 | "id": "20978535593938807"
1540 | },
1541 | {
1542 | "key": "_abck",
1543 | "value": "B0563B8DEF26B459BF90EC433C93A1A4~-1~YAAQ16NivnP/9KB9AQAA7p3ZWgfu5i0ETaJ1lOfOq4U/G0rh0ICBFjd4Xevexuipa8+9Z3r21fMfC6JKPA0/aHUII+wTRMwd9+q5S51iymoX1UBy1GySJbo4+YurOLTYA11FF3Wa6kSr1+uJxtgkLQDqBtODWegti02W1SuGAuIAA9lU3RR2p/GXSnAtIn1UWvASlD8EoxVPUrjTTd/lu2tgUFMBVnoQmRFOZuS5gArCRIARrHHzQ4DxPFGF5sVmdjFgKTXrsTgUxSly5mh9umlB5FPAFfGWKixtUA7iRvUR2d8KFmrNJp5nlXIlVNPSQhbIuT6gLmytf022q+UI58sWESyRO0cirHBoaMmwUdtHkVsk3k3cBbDlN/WlBg==~-1~-1~-1",
1544 | "expires": "2023-01-14T23:08:38.000Z",
1545 | "maxAge": 31536000,
1546 | "domain": "list-manage.com",
1547 | "path": "/",
1548 | "secure": true,
1549 | "extensions": ["SameSite=None"],
1550 | "hostOnly": false,
1551 | "creation": "2022-01-14T23:08:37.926Z",
1552 | "lastAccessed": "2022-01-14T23:08:37.926Z",
1553 | "id": "9567220843806037"
1554 | },
1555 | {
1556 | "key": "ak_bmsc",
1557 | "value": "46BC42567BB834EF71243EF8295206A0~000000000000000000000000000000~YAAQ16NivnT/9KB9AQAA7p3ZWg6lrjHZ+whpQIXYWPa5fEm6BbN8VTTEumPpwKzMdvgRfJrirKuNpSL/owZ8F4nEyRQhvceLv4wFhRbcFL53QYMNUKjyHQqi/C3SL+3n/6ldoBKPyrua9XmOE5Fl4sWA0Ya7vG54Wu8abdn7W7OHLCSJW90bQ3XNuifvdqIezryA+hAPYI+HiUKpY4jozORnxRSV5Q4SvdAWIXNsSApP6B0PUnhrCuSDNLeTMTrRknCpS5hEIcFfiST74EVNpl4oW5deOYNFoXiqPth4liWnaY5fkhv9f5fqsQrjlQdGO0sTgG9eRHjscWxnweGAVEauYDui+TJ9rDtwE9VENifOUlpUkdWjKi/ZUS/PAJlvrYlsFF6CP4l9YpUJQrHU6fJG5A+Eig==",
1558 | "expires": "2022-01-15T01:08:37.000Z",
1559 | "maxAge": 7199,
1560 | "domain": "us20.list-manage.com",
1561 | "path": "/",
1562 | "secure": true,
1563 | "httpOnly": true,
1564 | "extensions": ["SameSite=None"],
1565 | "hostOnly": false,
1566 | "creation": "2022-01-14T23:08:37.927Z",
1567 | "lastAccessed": "2022-01-14T23:08:37.927Z",
1568 | "id": "9202008446698922"
1569 | },
1570 | {
1571 | "key": "bm_sz",
1572 | "value": "4CA2EDCDBBC258ACD6AB5F47B7327AE7~YAAQ16NivnX/9KB9AQAA7p3ZWg5wOtk5Qwlq/K9g0z2BtEUbkubSNrXG91WLeLOLeKIjIeT93Afy0mz8I9zK3ccXYF4rNba9hQVDpGjoRsAh0JhineoatQZgoqHcdDHOPZF+Wdpi6QF4FQmc+5sjb3hjH+qXW7APB7DORJeUHSgSluyLrJ/0kiHaR5bbsAyID8YqXmR4Z1uugZqzaikcmeYftSFFv6qXHXRh29l9GNIGu/faH2g36PRjNi3sTaQjspybPggAP4RXopuWIq1/Hv3PCuV7vO4MTsLvgphfEavApyWQSONn8w==~4534325~3290677",
1573 | "expires": "2022-01-15T03:08:37.000Z",
1574 | "maxAge": 14399,
1575 | "domain": "list-manage.com",
1576 | "path": "/",
1577 | "secure": true,
1578 | "extensions": ["SameSite=None"],
1579 | "hostOnly": false,
1580 | "creation": "2022-01-14T23:08:37.927Z",
1581 | "lastAccessed": "2022-01-14T23:08:37.927Z",
1582 | "id": "6638779298120716"
1583 | },
1584 | {
1585 | "key": "bm_sv",
1586 | "value": "8B663F95A9F98C36431D10D1E2E91AA8~BKANYTsmHB3XKPV8rZenHtcybBfJdB11roU9NnvyeXSIZ8XCECzDw3NEEZ11j/daHQ9vNNb9i7z3mTinLBroAE5EKIiIs7gRGckJJjuvDfhbtQvyJa1m9MiYjGmjaEmKsAwDQYw5E+t8p0Bc3J6zJWrm+duArTHeZFxgcDa35X0=",
1587 | "maxAge": 3153,
1588 | "domain": "us20.list-manage.com",
1589 | "path": "/",
1590 | "httpOnly": true,
1591 | "hostOnly": false,
1592 | "creation": "2022-01-14T23:08:47.771Z",
1593 | "lastAccessed": "2022-01-15T00:16:13.975Z",
1594 | "id": "26026988064497036"
1595 | }
1596 | ],
1597 | "_type": "cookie_jar"
1598 | },
1599 | {
1600 | "_id": "spc_f6f37a8644c94c82bfb82766d14abcee",
1601 | "parentId": "wrk_1e7b6afabe3f4aa5813985de4ec6b13b",
1602 | "modified": 1672171348497,
1603 | "created": 1672171348264,
1604 | "fileName": "Prod Platzi Fake Store API",
1605 | "contents": "",
1606 | "contentType": "yaml",
1607 | "_type": "api_spec"
1608 | },
1609 | {
1610 | "_id": "env_9cd7e90da1614a6094a07e510e376483",
1611 | "parentId": "env_7197aa4129484ee0adfde3036cc8bd6d",
1612 | "modified": 1672171348244,
1613 | "created": 1672171348244,
1614 | "name": "Dev",
1615 | "data": { "API_URL": "http://localhost:3001" },
1616 | "dataPropertyOrder": { "&": ["API_URL"] },
1617 | "color": "#7d69cb",
1618 | "isPrivate": false,
1619 | "metaSortKey": 1638539837263,
1620 | "_type": "environment"
1621 | },
1622 | {
1623 | "_id": "env_647857968166480f9ee2575809f4b52d",
1624 | "parentId": "env_7197aa4129484ee0adfde3036cc8bd6d",
1625 | "modified": 1672172855954,
1626 | "created": 1672171348251,
1627 | "name": "Prod",
1628 | "data": { "API_URL": "https://api.escuelajs.co" },
1629 | "dataPropertyOrder": { "&": ["API_URL"] },
1630 | "color": "#ff0000",
1631 | "isPrivate": false,
1632 | "metaSortKey": 1638539845480,
1633 | "_type": "environment"
1634 | }
1635 | ]
1636 | }
1637 |
--------------------------------------------------------------------------------
/public/json/postman.json:
--------------------------------------------------------------------------------
1 | {
2 | "info": {
3 | "_postman_id": "00eb26cc-7d00-425b-9d14-370c7632c157",
4 | "name": "Platzi Fake Store API",
5 | "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
6 | "_exporter_id": "10183598"
7 | },
8 | "item": [
9 | {
10 | "name": "Rest API",
11 | "item": [
12 | {
13 | "name": "products",
14 | "item": [
15 | {
16 | "name": "getAll",
17 | "request": {
18 | "method": "GET",
19 | "header": [],
20 | "url": {
21 | "raw": "{{API_URL}}/api/v1/products/",
22 | "host": ["{{API_URL}}"],
23 | "path": ["api", "v1", "products", ""]
24 | }
25 | },
26 | "response": []
27 | },
28 | {
29 | "name": "getOne",
30 | "request": {
31 | "method": "GET",
32 | "header": [],
33 | "url": {
34 | "raw": "{{API_URL}}/api/v1/products/2",
35 | "host": ["{{API_URL}}"],
36 | "path": ["api", "v1", "products", "2"]
37 | }
38 | },
39 | "response": []
40 | },
41 | {
42 | "name": "getOne by Slug",
43 | "request": {
44 | "method": "GET",
45 | "header": [],
46 | "url": {
47 | "raw": "{{API_URL}}/api/v1/products/slug/classic-red-pullover-hoodie",
48 | "host": ["{{API_URL}}"],
49 | "path": [
50 | "api",
51 | "v1",
52 | "products",
53 | "slug",
54 | "classic-red-pullover-hoodie"
55 | ]
56 | }
57 | },
58 | "response": []
59 | },
60 | {
61 | "name": "create",
62 | "request": {
63 | "method": "POST",
64 | "header": [],
65 | "body": {
66 | "mode": "raw",
67 | "raw": "{\r\n \"title\": \"New Product\",\r\n \"price\": 10,\r\n \"description\": \"A description\",\r\n \"categoryId\": 1,\r\n \"images\": [\r\n \"https://placehold.co/600x400\"\r\n ]\r\n}",
68 | "options": {
69 | "raw": {
70 | "language": "json"
71 | }
72 | }
73 | },
74 | "url": {
75 | "raw": "{{API_URL}}/api/v1/products/",
76 | "host": ["{{API_URL}}"],
77 | "path": ["api", "v1", "products", ""]
78 | }
79 | },
80 | "response": []
81 | },
82 | {
83 | "name": "update",
84 | "request": {
85 | "method": "PUT",
86 | "header": [],
87 | "body": {
88 | "mode": "raw",
89 | "raw": "{\r\n \"title\": \"Chage title\",\r\n \"price\": 100,\r\n \"images\": [\r\n \"https://placehold.co/600x400\"\r\n ]\r\n}",
90 | "options": {
91 | "raw": {
92 | "language": "json"
93 | }
94 | }
95 | },
96 | "url": {
97 | "raw": "{{API_URL}}/api/v1/products/2",
98 | "host": ["{{API_URL}}"],
99 | "path": ["api", "v1", "products", "2"]
100 | }
101 | },
102 | "response": []
103 | },
104 | {
105 | "name": "pagination",
106 | "request": {
107 | "method": "GET",
108 | "header": [],
109 | "url": {
110 | "raw": "{{API_URL}}/api/v1/products/?offset=0&limit=10",
111 | "host": ["{{API_URL}}"],
112 | "path": ["api", "v1", "products", ""],
113 | "query": [
114 | {
115 | "key": "offset",
116 | "value": "0"
117 | },
118 | {
119 | "key": "limit",
120 | "value": "10"
121 | }
122 | ]
123 | }
124 | },
125 | "response": []
126 | }
127 | ]
128 | },
129 | {
130 | "name": "categories",
131 | "item": [
132 | {
133 | "name": "getAll",
134 | "request": {
135 | "method": "GET",
136 | "header": [],
137 | "url": {
138 | "raw": "{{API_URL}}/api/v1/categories/",
139 | "host": ["{{API_URL}}"],
140 | "path": ["api", "v1", "categories", ""]
141 | }
142 | },
143 | "response": []
144 | },
145 | {
146 | "name": "getOne",
147 | "request": {
148 | "method": "GET",
149 | "header": [],
150 | "url": {
151 | "raw": "{{API_URL}}/api/v1/categories/2",
152 | "host": ["{{API_URL}}"],
153 | "path": ["api", "v1", "categories", "2"]
154 | }
155 | },
156 | "response": []
157 | },
158 | {
159 | "name": "update",
160 | "request": {
161 | "method": "PUT",
162 | "header": [],
163 | "body": {
164 | "mode": "raw",
165 | "raw": "{\r\n\t\"name\": \"nuevo\"\r\n}",
166 | "options": {
167 | "raw": {
168 | "language": "json"
169 | }
170 | }
171 | },
172 | "url": {
173 | "raw": "{{API_URL}}/api/v1/categories/2",
174 | "host": ["{{API_URL}}"],
175 | "path": ["api", "v1", "categories", "2"]
176 | }
177 | },
178 | "response": []
179 | },
180 | {
181 | "name": "create",
182 | "request": {
183 | "method": "POST",
184 | "header": [],
185 | "body": {
186 | "mode": "raw",
187 | "raw": "{\r\n \"name\": \"New category\",\r\n \"image\": \"https://placehold.co/600x400\"\r\n}",
188 | "options": {
189 | "raw": {
190 | "language": "json"
191 | }
192 | }
193 | },
194 | "url": {
195 | "raw": "{{API_URL}}/api/v1/categories/",
196 | "host": ["{{API_URL}}"],
197 | "path": ["api", "v1", "categories", ""]
198 | }
199 | },
200 | "response": []
201 | }
202 | ]
203 | },
204 | {
205 | "name": "users",
206 | "item": [
207 | {
208 | "name": "getAll",
209 | "request": {
210 | "method": "GET",
211 | "header": [],
212 | "url": {
213 | "raw": "{{API_URL}}/api/v1/users/",
214 | "host": ["{{API_URL}}"],
215 | "path": ["api", "v1", "users", ""]
216 | }
217 | },
218 | "response": []
219 | },
220 | {
221 | "name": "getOne",
222 | "request": {
223 | "method": "GET",
224 | "header": [],
225 | "url": {
226 | "raw": "{{API_URL}}/api/v1/users/1",
227 | "host": ["{{API_URL}}"],
228 | "path": ["api", "v1", "users", "1"]
229 | }
230 | },
231 | "response": []
232 | },
233 | {
234 | "name": "update",
235 | "request": {
236 | "method": "PUT",
237 | "header": [],
238 | "body": {
239 | "mode": "raw",
240 | "raw": "{\r\n\t\"name\": \"Nicolas\"\r\n}",
241 | "options": {
242 | "raw": {
243 | "language": "json"
244 | }
245 | }
246 | },
247 | "url": {
248 | "raw": "{{API_URL}}/api/v1/users/1",
249 | "host": ["{{API_URL}}"],
250 | "path": ["api", "v1", "users", "1"]
251 | }
252 | },
253 | "response": []
254 | },
255 | {
256 | "name": "create",
257 | "request": {
258 | "method": "POST",
259 | "header": [],
260 | "body": {
261 | "mode": "raw",
262 | "raw": "{\r\n\t\"name\": \"Nicolas\",\r\n\t\"email\": \"nico@gmail.com\",\r\n\t\"password\": \"123\",\r\n \"avatar\": \"https://api.lorem.space/image/face?w=640&h=480\"\r\n}",
263 | "options": {
264 | "raw": {
265 | "language": "json"
266 | }
267 | }
268 | },
269 | "url": {
270 | "raw": "{{API_URL}}/api/v1/users/",
271 | "host": ["{{API_URL}}"],
272 | "path": ["api", "v1", "users", ""]
273 | }
274 | },
275 | "response": []
276 | },
277 | {
278 | "name": "isAvailable",
279 | "request": {
280 | "method": "POST",
281 | "header": [],
282 | "body": {
283 | "mode": "raw",
284 | "raw": "{\r\n\t\"email\": \"maasasriaa@mail.com\"\r\n}",
285 | "options": {
286 | "raw": {
287 | "language": "json"
288 | }
289 | }
290 | },
291 | "url": {
292 | "raw": "{{API_URL}}/api/v1/users/is-available",
293 | "host": ["{{API_URL}}"],
294 | "path": ["api", "v1", "users", "is-available"]
295 | }
296 | },
297 | "response": []
298 | }
299 | ]
300 | },
301 | {
302 | "name": "auth",
303 | "item": [
304 | {
305 | "name": "login",
306 | "request": {
307 | "method": "POST",
308 | "header": [],
309 | "body": {
310 | "mode": "raw",
311 | "raw": "{\r\n\t\"email\": \"john@mail.com\",\r\n\t\"password\": \"changeme\"\r\n}",
312 | "options": {
313 | "raw": {
314 | "language": "json"
315 | }
316 | }
317 | },
318 | "url": {
319 | "raw": "{{API_URL}}/api/v1/auth/login",
320 | "host": ["{{API_URL}}"],
321 | "path": ["api", "v1", "auth", "login"]
322 | }
323 | },
324 | "response": []
325 | },
326 | {
327 | "name": "profile",
328 | "request": {
329 | "auth": {
330 | "type": "bearer",
331 | "bearer": [
332 | {
333 | "key": "token",
334 | "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEsImlhdCI6MTc0MDU3NTcwOSwiZXhwIjoxNzQyMzAzNzA5fQ.68tGq1B_hDsxgjVQscsteZfVZEcL5prqQw8aZcuqGno",
335 | "type": "string"
336 | }
337 | ]
338 | },
339 | "method": "GET",
340 | "header": [],
341 | "url": {
342 | "raw": "{{API_URL}}/api/v1/auth/profile",
343 | "host": ["{{API_URL}}"],
344 | "path": ["api", "v1", "auth", "profile"]
345 | }
346 | },
347 | "response": []
348 | }
349 | ]
350 | },
351 | {
352 | "name": "files",
353 | "item": [
354 | {
355 | "name": "upload",
356 | "request": {
357 | "method": "POST",
358 | "header": [],
359 | "body": {
360 | "mode": "formdata",
361 | "formdata": [
362 | {
363 | "key": "file",
364 | "type": "file",
365 | "src": "/Users/nicobytes1/Documents/Frame 1.png"
366 | }
367 | ]
368 | },
369 | "url": {
370 | "raw": "{{API_URL}}/api/v1/files/upload",
371 | "host": ["{{API_URL}}"],
372 | "path": ["api", "v1", "files", "upload"]
373 | }
374 | },
375 | "response": []
376 | },
377 | {
378 | "name": "file",
379 | "protocolProfileBehavior": {
380 | "disableBodyPruning": true
381 | },
382 | "request": {
383 | "method": "GET",
384 | "header": [],
385 | "body": {
386 | "mode": "formdata",
387 | "formdata": [
388 | {
389 | "key": "file",
390 | "type": "file",
391 | "src": "/C:/Users/nicob/Downloads/Step3-graphic-1.png"
392 | }
393 | ]
394 | },
395 | "url": {
396 | "raw": "{{API_URL}}/api/v1/files/39a5.png",
397 | "host": ["{{API_URL}}"],
398 | "path": ["api", "v1", "files", "39a5.png"]
399 | }
400 | },
401 | "response": []
402 | }
403 | ]
404 | },
405 | {
406 | "name": "locations",
407 | "item": [
408 | {
409 | "name": "all locations",
410 | "request": {
411 | "method": "GET",
412 | "header": [],
413 | "url": {
414 | "raw": "{{API_URL}}/api/v1/locations",
415 | "host": ["{{API_URL}}"],
416 | "path": ["api", "v1", "locations"]
417 | }
418 | },
419 | "response": []
420 | },
421 | {
422 | "name": "byLatLng",
423 | "request": {
424 | "method": "GET",
425 | "header": [],
426 | "url": {
427 | "raw": "{{API_URL}}/api/v1/locations?origin=6.2071641,-75.5720321",
428 | "host": ["{{API_URL}}"],
429 | "path": ["api", "v1", "locations"],
430 | "query": [
431 | {
432 | "key": "origin",
433 | "value": "6.2071641,-75.5720321"
434 | }
435 | ]
436 | }
437 | },
438 | "response": []
439 | }
440 | ]
441 | }
442 | ]
443 | },
444 | {
445 | "name": "GraphQL",
446 | "item": [
447 | {
448 | "name": "products",
449 | "item": [
450 | {
451 | "name": "getAll",
452 | "request": {
453 | "method": "POST",
454 | "header": [],
455 | "body": {
456 | "mode": "graphql",
457 | "graphql": {
458 | "query": "{\r\n products{\r\n\t\tid\r\n title\r\n price\r\n\t\tdescription\r\n\t\timages\r\n\t\tcategory {\r\n\t\t\tid\r\n\t\t\tname\r\n\t\t\timage\r\n\t\t}\r\n }\r\n}",
459 | "variables": ""
460 | }
461 | },
462 | "url": {
463 | "raw": "{{API_URL}}/graphql",
464 | "host": ["{{API_URL}}"],
465 | "path": ["graphql"]
466 | }
467 | },
468 | "response": []
469 | },
470 | {
471 | "name": "getOne",
472 | "request": {
473 | "method": "POST",
474 | "header": [],
475 | "body": {
476 | "mode": "graphql",
477 | "graphql": {
478 | "query": "{\r\n\tproduct(id: \"120\") {\r\n\t\ttitle\r\n\t\tprice\r\n\t\timages\r\n\t\tcategory {\r\n\t\t\tid\r\n\t\t\tname\r\n\t\t\timage\r\n\t\t}\r\n\t}\r\n}\r\n",
479 | "variables": ""
480 | }
481 | },
482 | "url": {
483 | "raw": "https://api.escuelajs.co/graphql",
484 | "protocol": "https",
485 | "host": ["api", "escuelajs", "co"],
486 | "path": ["graphql"]
487 | }
488 | },
489 | "response": []
490 | },
491 | {
492 | "name": "create",
493 | "request": {
494 | "method": "POST",
495 | "header": [],
496 | "body": {
497 | "mode": "graphql",
498 | "graphql": {
499 | "query": "mutation {\r\n\taddProduct(\r\n\t\tdata: {\r\n\t\t\ttitle: \"New Product\"\r\n\t\t\tprice: 10\r\n\t\t\tdescription: \"A description\"\r\n\t\t\tcategoryId: 1\r\n\t\t\timages: [\"https://placeimg.com/640/480/any\"]\r\n\t\t}\r\n\t) {\r\n\t\ttitle\r\n\t\tprice\r\n\t\timages\r\n\t\tcategory {\r\n\t\t\tid\r\n\t\t\tname\r\n\t\t\timage\r\n\t\t}\r\n\t}\r\n}\r\n",
500 | "variables": ""
501 | }
502 | },
503 | "url": {
504 | "raw": "https://api.escuelajs.co/graphql",
505 | "protocol": "https",
506 | "host": ["api", "escuelajs", "co"],
507 | "path": ["graphql"]
508 | }
509 | },
510 | "response": []
511 | },
512 | {
513 | "name": "update",
514 | "request": {
515 | "method": "POST",
516 | "header": [],
517 | "body": {
518 | "mode": "graphql",
519 | "graphql": {
520 | "query": "mutation {\r\n\tupdateProduct(id: \"120\", changes: { title: \"udpate\" }) {\r\n\t\ttitle\r\n\t\tprice\r\n\t\timages\r\n\t}\r\n}\r\n",
521 | "variables": ""
522 | }
523 | },
524 | "url": {
525 | "raw": "https://api.escuelajs.co/graphql",
526 | "protocol": "https",
527 | "host": ["api", "escuelajs", "co"],
528 | "path": ["graphql"]
529 | }
530 | },
531 | "response": []
532 | },
533 | {
534 | "name": "delete",
535 | "request": {
536 | "method": "POST",
537 | "header": [],
538 | "body": {
539 | "mode": "graphql",
540 | "graphql": {
541 | "query": "mutation {\r\n\tdeleteProduct(id: 112)\r\n}\r\n",
542 | "variables": ""
543 | }
544 | },
545 | "url": {
546 | "raw": "https://api.escuelajs.co/graphql",
547 | "protocol": "https",
548 | "host": ["api", "escuelajs", "co"],
549 | "path": ["graphql"]
550 | }
551 | },
552 | "response": []
553 | },
554 | {
555 | "name": "pagination",
556 | "request": {
557 | "method": "POST",
558 | "header": [],
559 | "body": {
560 | "mode": "graphql",
561 | "graphql": {
562 | "query": "{\r\n products(limit: 2, offset: 0){\r\n title\r\n price\r\n }\r\n}",
563 | "variables": ""
564 | }
565 | },
566 | "url": {
567 | "raw": "https://api.escuelajs.co/graphql",
568 | "protocol": "https",
569 | "host": ["api", "escuelajs", "co"],
570 | "path": ["graphql"]
571 | }
572 | },
573 | "response": []
574 | },
575 | {
576 | "name": "by title",
577 | "request": {
578 | "method": "POST",
579 | "header": [],
580 | "body": {
581 | "mode": "graphql",
582 | "graphql": {
583 | "query": "{\r\n products(title: \"Generic\"){\r\n title\r\n price\r\n }\r\n}",
584 | "variables": ""
585 | }
586 | },
587 | "url": {
588 | "raw": "https://api.escuelajs.co/graphql",
589 | "protocol": "https",
590 | "host": ["api", "escuelajs", "co"],
591 | "path": ["graphql"]
592 | }
593 | },
594 | "response": []
595 | },
596 | {
597 | "name": "by range price",
598 | "request": {
599 | "method": "POST",
600 | "header": [],
601 | "body": {
602 | "mode": "graphql",
603 | "graphql": {
604 | "query": "{\r\n\tproducts(price_min: 100, price_max: 200) {\r\n\t\ttitle\r\n\t\tprice\r\n\t}\r\n}\r\n",
605 | "variables": ""
606 | }
607 | },
608 | "url": {
609 | "raw": "https://api.escuelajs.co/graphql",
610 | "protocol": "https",
611 | "host": ["api", "escuelajs", "co"],
612 | "path": ["graphql"]
613 | }
614 | },
615 | "response": []
616 | },
617 | {
618 | "name": "by category",
619 | "request": {
620 | "method": "POST",
621 | "header": [],
622 | "body": {
623 | "mode": "graphql",
624 | "graphql": {
625 | "query": "{\r\n\tproducts(title: \"Generic\", categoryId: 1, price_min: 100, price_max: 1000) {\r\n\t\ttitle\r\n\t\tprice\r\n\t\tcategory {\r\n\t\t\tid\r\n\t\t\tname\r\n\t\t}\r\n\t}\r\n}\r\n",
626 | "variables": ""
627 | }
628 | },
629 | "url": {
630 | "raw": "https://api.escuelajs.co/graphql",
631 | "protocol": "https",
632 | "host": ["api", "escuelajs", "co"],
633 | "path": ["graphql"]
634 | }
635 | },
636 | "response": []
637 | }
638 | ]
639 | },
640 | {
641 | "name": "categories",
642 | "item": [
643 | {
644 | "name": "getAll",
645 | "request": {
646 | "method": "POST",
647 | "header": [],
648 | "body": {
649 | "mode": "graphql",
650 | "graphql": {
651 | "query": "{\r\n categories{\r\n\t\tid\r\n\t\tname\r\n\t\timage\r\n }\r\n}",
652 | "variables": ""
653 | }
654 | },
655 | "url": {
656 | "raw": "https://api.escuelajs.co/graphql",
657 | "protocol": "https",
658 | "host": ["api", "escuelajs", "co"],
659 | "path": ["graphql"]
660 | }
661 | },
662 | "response": []
663 | },
664 | {
665 | "name": "getOne",
666 | "request": {
667 | "method": "POST",
668 | "header": [],
669 | "body": {
670 | "mode": "graphql",
671 | "graphql": {
672 | "query": "{\r\n category(id: 1){\r\n\t\tid\r\n\t\tname\r\n\t\timage\r\n }\r\n}",
673 | "variables": ""
674 | }
675 | },
676 | "url": {
677 | "raw": "https://api.escuelajs.co/graphql",
678 | "protocol": "https",
679 | "host": ["api", "escuelajs", "co"],
680 | "path": ["graphql"]
681 | }
682 | },
683 | "response": []
684 | },
685 | {
686 | "name": "create",
687 | "request": {
688 | "method": "POST",
689 | "header": [],
690 | "body": {
691 | "mode": "graphql",
692 | "graphql": {
693 | "query": "mutation {\r\n\taddCategory(\r\n\t\tdata: { name: \"New Category\", image: \"https://placeimg.com/640/480/any\" }\r\n\t) {\r\n\t\tid\r\n\t\tname\r\n\t\timage\r\n\t}\r\n}\r\n",
694 | "variables": ""
695 | }
696 | },
697 | "url": {
698 | "raw": "https://api.escuelajs.co/graphql",
699 | "protocol": "https",
700 | "host": ["api", "escuelajs", "co"],
701 | "path": ["graphql"]
702 | }
703 | },
704 | "response": []
705 | },
706 | {
707 | "name": "update",
708 | "request": {
709 | "method": "POST",
710 | "header": [],
711 | "body": {
712 | "mode": "graphql",
713 | "graphql": {
714 | "query": "mutation {\r\n\tupdateCategory(id: 1, changes: { name: \"change\" }) {\r\n\t\tid\r\n\t\tname\r\n\t\timage\r\n\t}\r\n}\r\n",
715 | "variables": ""
716 | }
717 | },
718 | "url": {
719 | "raw": "https://api.escuelajs.co/graphql",
720 | "protocol": "https",
721 | "host": ["api", "escuelajs", "co"],
722 | "path": ["graphql"]
723 | }
724 | },
725 | "response": []
726 | },
727 | {
728 | "name": "delete",
729 | "request": {
730 | "method": "POST",
731 | "header": [],
732 | "body": {
733 | "mode": "graphql",
734 | "graphql": {
735 | "query": "mutation {\r\n\tdeleteCategory(id: 14)\r\n}\r\n",
736 | "variables": ""
737 | }
738 | },
739 | "url": {
740 | "raw": "https://api.escuelajs.co/graphql",
741 | "protocol": "https",
742 | "host": ["api", "escuelajs", "co"],
743 | "path": ["graphql"]
744 | }
745 | },
746 | "response": []
747 | }
748 | ]
749 | },
750 | {
751 | "name": "users",
752 | "item": [
753 | {
754 | "name": "getAll",
755 | "request": {
756 | "method": "POST",
757 | "header": [],
758 | "body": {
759 | "mode": "graphql",
760 | "graphql": {
761 | "query": "{\r\n users{\r\n\t\tid\r\n\t\tname\r\n\t\temail\r\n }\r\n}",
762 | "variables": ""
763 | }
764 | },
765 | "url": {
766 | "raw": "https://api.escuelajs.co/graphql",
767 | "protocol": "https",
768 | "host": ["api", "escuelajs", "co"],
769 | "path": ["graphql"]
770 | }
771 | },
772 | "response": []
773 | },
774 | {
775 | "name": "getOne",
776 | "request": {
777 | "method": "POST",
778 | "header": [],
779 | "body": {
780 | "mode": "graphql",
781 | "graphql": {
782 | "query": "query {\r\n user(id: 1){\r\n\t\tid\r\n\t\tname\r\n\t\tavatar\r\n }\r\n}",
783 | "variables": ""
784 | }
785 | },
786 | "url": {
787 | "raw": "https://api.escuelajs.co/graphql",
788 | "protocol": "https",
789 | "host": ["api", "escuelajs", "co"],
790 | "path": ["graphql"]
791 | }
792 | },
793 | "response": []
794 | },
795 | {
796 | "name": "create",
797 | "request": {
798 | "method": "POST",
799 | "header": [],
800 | "body": {
801 | "mode": "graphql",
802 | "graphql": {
803 | "query": "mutation {\r\n\taddUser(\r\n\t\tdata: {\r\n\t\t\tname: \"Nicolas\"\r\n\t\t\temail: \"nico@gmail.com\"\r\n\t\t\tpassword: \"1234\"\r\n\t\t\tavatar: \"https://api.lorem.space/image/face?w=150&h=220\"\r\n\t\t}\r\n\t) {\r\n\t\tid\r\n\t\tname\r\n\t\tavatar\r\n\t}\r\n}",
804 | "variables": ""
805 | }
806 | },
807 | "url": {
808 | "raw": "https://api.escuelajs.co/graphql",
809 | "protocol": "https",
810 | "host": ["api", "escuelajs", "co"],
811 | "path": ["graphql"]
812 | }
813 | },
814 | "response": []
815 | },
816 | {
817 | "name": "update",
818 | "request": {
819 | "method": "POST",
820 | "header": [],
821 | "body": {
822 | "mode": "graphql",
823 | "graphql": {
824 | "query": "mutation {\r\n\tupdateUser(id: 1, changes: { name: \"change\" }) {\r\n\t\tid\r\n\t\tname\r\n\t\tavatar\r\n\t}\r\n}\r\n",
825 | "variables": ""
826 | }
827 | },
828 | "url": {
829 | "raw": "https://api.escuelajs.co/graphql",
830 | "protocol": "https",
831 | "host": ["api", "escuelajs", "co"],
832 | "path": ["graphql"]
833 | }
834 | },
835 | "response": []
836 | },
837 | {
838 | "name": "isAvailable",
839 | "request": {
840 | "method": "POST",
841 | "header": [],
842 | "body": {
843 | "mode": "graphql",
844 | "graphql": {
845 | "query": "query {\r\n\tisAvailable(email: \"john@mail.com\")\r\n}\r\n",
846 | "variables": ""
847 | }
848 | },
849 | "url": {
850 | "raw": "https://api.escuelajs.co/graphql",
851 | "protocol": "https",
852 | "host": ["api", "escuelajs", "co"],
853 | "path": ["graphql"]
854 | }
855 | },
856 | "response": []
857 | },
858 | {
859 | "name": "delete",
860 | "request": {
861 | "method": "POST",
862 | "header": [],
863 | "body": {
864 | "mode": "graphql",
865 | "graphql": {
866 | "query": "mutation {\r\n\tdeleteUser(id: 1)\r\n}\r\n",
867 | "variables": ""
868 | }
869 | },
870 | "url": {
871 | "raw": "https://api.escuelajs.co/graphql",
872 | "protocol": "https",
873 | "host": ["api", "escuelajs", "co"],
874 | "path": ["graphql"]
875 | }
876 | },
877 | "response": []
878 | }
879 | ]
880 | },
881 | {
882 | "name": "auth",
883 | "item": [
884 | {
885 | "name": "login",
886 | "request": {
887 | "method": "POST",
888 | "header": [],
889 | "body": {
890 | "mode": "graphql",
891 | "graphql": {
892 | "query": "mutation {\r\n\tlogin(email: \"john@mail.com\", password: \"changeme\") {\r\n\t\taccess_token\r\n\t\trefresh_token\r\n\t}\r\n}\r\n",
893 | "variables": ""
894 | }
895 | },
896 | "url": {
897 | "raw": "https://api.escuelajs.co/graphql",
898 | "protocol": "https",
899 | "host": ["api", "escuelajs", "co"],
900 | "path": ["graphql"]
901 | }
902 | },
903 | "response": []
904 | },
905 | {
906 | "name": "myProfile",
907 | "request": {
908 | "method": "POST",
909 | "header": [
910 | {
911 | "key": "Authorization",
912 | "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEsImlhdCI6MTY3Mjc4MDE1OCwiZXhwIjoxNjc0NTA4MTU4fQ._UdU1WdRNaLW1sow633WEhKdxmdiFsJen-J2pjKgqu8",
913 | "type": "text"
914 | }
915 | ],
916 | "body": {
917 | "mode": "graphql",
918 | "graphql": {
919 | "query": "{\r\n\tmyProfile {\r\n\t\tid\r\n\t\tname\r\n\t\tavatar\r\n\t}\r\n}\r\n",
920 | "variables": ""
921 | }
922 | },
923 | "url": {
924 | "raw": "https://api.escuelajs.co/graphql",
925 | "protocol": "https",
926 | "host": ["api", "escuelajs", "co"],
927 | "path": ["graphql"]
928 | }
929 | },
930 | "response": []
931 | },
932 | {
933 | "name": "refreshToken",
934 | "request": {
935 | "method": "POST",
936 | "header": [],
937 | "body": {
938 | "mode": "graphql",
939 | "graphql": {
940 | "query": "mutation {\r\n\trefreshToken(\r\n\t\trefreshToken: \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEsImlhdCI6MTY3Mjc3ODY4MywiZXhwIjoxNjcyODE0NjgzfQ.XMjQQ6tTHAvy2ELrsYN0enWcQTo0PTeqb46-OrhUK7o\"\r\n\t) {\r\n\t\taccess_token\r\n\t\trefresh_token\r\n\t}\r\n}\r\n",
941 | "variables": ""
942 | }
943 | },
944 | "url": {
945 | "raw": "https://api.escuelajs.co/graphql",
946 | "protocol": "https",
947 | "host": ["api", "escuelajs", "co"],
948 | "path": ["graphql"]
949 | }
950 | },
951 | "response": []
952 | }
953 | ]
954 | }
955 | ]
956 | }
957 | ]
958 | }
959 |
--------------------------------------------------------------------------------
/public/make-scrollable-code-focusable.js:
--------------------------------------------------------------------------------
1 | Array.from(document.getElementsByTagName("pre")).forEach((element) => {
2 | element.setAttribute("tabindex", "0");
3 | });
4 |
--------------------------------------------------------------------------------
/public/postman.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlatziLabs/fake-api-docs/5a7517d5798f94130707968e966b0ec6da3102ad/public/postman.png
--------------------------------------------------------------------------------
/src/assets/banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlatziLabs/fake-api-docs/5a7517d5798f94130707968e966b0ec6da3102ad/src/assets/banner.png
--------------------------------------------------------------------------------
/src/assets/fake-api.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlatziLabs/fake-api-docs/5a7517d5798f94130707968e966b0ec6da3102ad/src/assets/fake-api.png
--------------------------------------------------------------------------------
/src/assets/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlatziLabs/fake-api-docs/5a7517d5798f94130707968e966b0ec6da3102ad/src/assets/icon.png
--------------------------------------------------------------------------------
/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlatziLabs/fake-api-docs/5a7517d5798f94130707968e966b0ec6da3102ad/src/assets/logo.png
--------------------------------------------------------------------------------
/src/components/PreviewAPI/CategoriesAPI.astro:
--------------------------------------------------------------------------------
1 | ---
2 | import type { Category } from "@models/index";
3 | const API = "https://api.escuelajs.co/api/v1/categories?limit=5";
4 | const response = await fetch(API);
5 | const data = (await response.json()) as Category[];
6 | ---
7 |
8 |
9 | {
10 | data.map((item) => (
11 |
12 |
13 | {item.name}
14 |
15 | ))
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/src/components/PreviewAPI/ProductsAPI.astro:
--------------------------------------------------------------------------------
1 | ---
2 | import type { Product } from "@models/index";
3 | const API = "https://api.escuelajs.co/api/v1/products?offset=0&limit=10";
4 | const response = await fetch(API);
5 | const data = (await response.json()) as Product[];
6 | ---
7 |
8 |
9 | {
10 | data.map((item) => (
11 |
12 |
13 | ${item.price}
14 | {item.title}
15 |
16 | ))
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/src/components/PreviewAPI/UsersAPI.astro:
--------------------------------------------------------------------------------
1 | ---
2 | import type { User } from "@models/index";
3 | const API = "https://api.escuelajs.co/api/v1/users?limit=3";
4 | const response = await fetch(API);
5 | const data = (await response.json()) as User[];
6 | ---
7 |
8 |
9 | {
10 | data.map((item) => (
11 |
12 |
13 | {item.email}
14 |
15 | ))
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/src/constants/showcase.ts:
--------------------------------------------------------------------------------
1 | export const SHOWCASES = [
2 | {
3 | title: "React SPA Shop",
4 | image: "https://i.imgur.com/HTEvA9R.png",
5 | link: "https://react-shop-siza.vercel.app/products",
6 | },
7 | {
8 | title: "ViteJS Ecommerce",
9 | image: "https://i.imgur.com/LhsTsQO.png",
10 | link: "https://edcenten0.github.io/Vite-E-commerce/",
11 | },
12 | {
13 | title: "Angular CMS",
14 | image: "https://i.imgur.com/bKcogMW.png",
15 | link: "https://ng-ecommerce-admin.web.app",
16 | },
17 | {
18 | title: "Angular Ecommerce",
19 | image: "https://i.imgur.com/frYbBxG.png",
20 | link: "https://store-peach-ten.vercel.app",
21 | },
22 | {
23 | title: "no-clipped",
24 | image: "https://i.imgur.com/XkgENBe.png",
25 | link: "https://no-clipped.vercel.app/category/2",
26 | },
27 | {
28 | title: "Yard Store",
29 | image: "https://i.imgur.com/CKtE0oF.png",
30 | link: "https://angular-yardstore.netlify.app/website/category/4",
31 | },
32 | {
33 | title: "NextJS PWA Dashboard",
34 | image: "https://i.imgur.com/5dDTWNz.png",
35 | link: "https://next-js-git-pwa-misael-gc.vercel.app/dashboard/",
36 | },
37 | {
38 | title: "Yard Sale Store",
39 | image: "https://i.imgur.com/9BM1VKm.png",
40 | link: "https://yard-sale-store.vercel.app/",
41 | },
42 | {
43 | title: "Admin Panel",
44 | image: "https://i.imgur.com/LgXIbhc.png",
45 | link: "https://next-admin-panel-ionuser13.vercel.app/dashboard",
46 | },
47 | {
48 | title: "Emirs Shop",
49 | image: "https://i.imgur.com/aCtfpcm.png",
50 | link: "https://emirs-shop.vercel.app",
51 | },
52 | {
53 | title: "Trending Shop",
54 | image: "https://i.imgur.com/lN216wP.png",
55 | link: "https://trending-shop.netlify.app/",
56 | },
57 | {
58 | title: "Nextjs Ecommerce",
59 | image: "https://i.imgur.com/7lT5qDt.png",
60 | link: "https://calis-store.vercel.app/",
61 | },
62 | ];
63 |
--------------------------------------------------------------------------------
/src/content/config.ts:
--------------------------------------------------------------------------------
1 | import { defineCollection } from "astro:content";
2 | import { docsSchema, i18nSchema } from "@astrojs/starlight/schema";
3 |
4 | export const collections = {
5 | docs: defineCollection({ schema: docsSchema() }),
6 | i18n: defineCollection({ type: "data", schema: i18nSchema() }),
7 | };
8 |
--------------------------------------------------------------------------------
/src/content/docs/en/about/introduction.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Introduction
3 | description: Welcome to the Platzi Fake Store API
4 | ---
5 |
6 | The Platzi Fake Store API is a comprehensive development resource designed for projects requiring e-commerce data in JSON format. Whether you're building a prototype, learning API integration, or testing frontend applications, this API provides all the essential components: products, users, categories, and authentication systems.
7 |
8 | ## Why Choose This API?
9 |
10 | This API serves as an ideal learning tool for developers looking to master API integration using industry best practices. It offers a realistic e-commerce data environment without the complexity of connecting to a production system.
11 |
12 | ## Key Features
13 |
14 | The Platzi Fake Store API offers a robust set of capabilities:
15 |
16 | - ✅ **Complete CRUD Operations** - Create, read, update, and delete resources
17 | - ✅ **REST API** - Standard RESTful endpoints for all resources
18 | - ✅ **GraphQL Support** - Modern API query language for flexible data retrieval
19 | - ✅ **Pagination** - Efficiently handle large data sets
20 | - ✅ **JWT Authentication** - Secure your application with JSON Web Tokens
21 | - ✅ **File Upload Functionality** - Test file upload operations
22 | - ✅ **Advanced Filtering** - Filter products by category, title, and price range
23 | - ✅ **User Management** - Create users with duplicate checking
24 | - ✅ **Ready-to-use Client Files** - Postman and Insomnia collections included
25 | - ✅ **AI-Generated Product Images** - Realistic product visuals
26 |
--------------------------------------------------------------------------------
/src/content/docs/en/about/showcase.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Project Showcase
3 | description: Discover amazing projects built with the Platzi Fake Store API
4 | ---
5 |
6 | :::tip[Showcase Your Project]
7 | Have you built something awesome using the Platzi Fake Store API?
8 | We'd love to feature your work! Open a PR to add your project to this showcase.
9 | :::
10 |
11 | ## Community Projects
12 |
13 | The Platzi Fake Store API powers a diverse range of e-commerce applications created by our talented community. Browse through these inspiring projects to see what's possible:
14 |
15 | import { SHOWCASES } from "../../../../constants/showcase.ts";
16 |
17 |
18 | {SHOWCASES.map((item) => (
19 |
20 |
21 | {item.title}
22 |
23 | ))}
24 |
25 |
--------------------------------------------------------------------------------
/src/content/docs/en/gql/auth-jwt.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Auth with JWT
3 | description: Endpoints for Auth with JWT
4 | ---
5 |
6 | ## Authentication
7 |
8 | You can do login by sending an object like the following to the `login` mutation.
9 |
10 | Mutation:
11 |
12 | ```graphql
13 | mutation {
14 | login(email: "john@mail.com", password: "changeme") {
15 | access_token
16 | refresh_token
17 | }
18 | }
19 | ```
20 |
21 | The response is an access and refresh JWT tokens, like this:
22 |
23 | ```json
24 | {
25 | "data": {
26 | "login": {
27 | "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEsImlhdCI6MTY3Mjc3ODY4MywiZXhwIjoxNjc0NTA2NjgzfQ.kq-NxeQb-IT5SRKNV1BYEiYwFih2jhXXjJZMKsN5ziU",
28 | "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEsImlhdCI6MTY3Mjc3ODY4MywiZXhwIjoxNjcyODE0NjgzfQ.XMjQQ6tTHAvy2ELrsYN0enWcQTo0PTeqb46-OrhUK7o"
29 | }
30 | }
31 | }
32 | ```
33 |
34 | > Note: The access token is valid for 20 days, and the refresh token is valid for 10 hours.
35 |
36 | ## Get user with session
37 |
38 | You can get the profile the current user with session if in the headers include the `Authorization` key with the value `Bearer {your access token}` to `/auth/profile`
39 |
40 | Request:
41 |
42 | ```graphql
43 | # Headers
44 | {
45 | "Authorization": "Bearer {your access token}"
46 | }
47 | query {
48 | myProfile {
49 | id
50 | name
51 | avatar
52 | }
53 | }
54 | ```
55 |
56 | Response:
57 |
58 | ```json
59 | {
60 | "data": {
61 | "myProfile": {
62 | "id": "1",
63 | "name": "Jhon",
64 | "avatar": "https://api.lorem.space/image/face?w=640&h=480&r=1229"
65 | }
66 | }
67 | }
68 | ```
69 |
70 | ## Get a new Access Token with a Refresh Token
71 |
72 | Request:
73 |
74 | ```graphql
75 | mutation {
76 | refreshToken(
77 | refreshToken: {your refresh token}
78 | ) {
79 | access_token
80 | refresh_token
81 | }
82 | }
83 | ```
84 |
85 | The response is a new access and refresh JWT tokens, like this:
86 |
87 | ```json
88 | {
89 | "data": {
90 | "refreshToken": {
91 | "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEsImlhdCI6MTY3Mjc3ODgwMiwiZXhwIjoxNjc0NTA2ODAyfQ.HjsfDRBlSu1W5jBTUmfk_sS3SfrZGppjarrVGOt2IuI",
92 | "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEsImlhdCI6MTY3Mjc3ODgwMiwiZXhwIjoxNjcyODE0ODAyfQ.vVBGJYyxlTaI5k_pseGAOKHhuACIFo1wOzHI20oRF6M"
93 | }
94 | }
95 | }
96 | ```
97 |
98 | > Note: The access token is valid for 20 days, and the refresh token is valid for 10 hours.
99 |
--------------------------------------------------------------------------------
/src/content/docs/en/gql/categories.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Categories
3 | description: Endpoints for Categories
4 | ---
5 |
6 | ## Get all categories
7 |
8 | You can access the list of 5 categories by using the `categories` query.
9 |
10 | Query:
11 |
12 | ```graphql
13 | query {
14 | categories {
15 | id
16 | name
17 | image
18 | }
19 | }
20 | ```
21 |
22 | Response:
23 |
24 | ```json
25 | {
26 | "data": {
27 | "categories": [
28 | {
29 | "id": "1",
30 | "name": "Clothes",
31 | "image": "https://api.lorem.space/image/fashion?w=640&h=480&r=7943"
32 | },
33 | ...
34 | ]
35 | }
36 | }
37 | ```
38 |
39 | ## Get a single category
40 |
41 | You can get a single category by adding the `id` as a parameter to `category` query.
42 |
43 | Query:
44 |
45 | ```graphql
46 | query {
47 | category(id: 1) {
48 | id
49 | name
50 | image
51 | }
52 | }
53 | ```
54 |
55 | Response:
56 |
57 | ```json
58 | {
59 | "data": {
60 | "category": {
61 | "id": "1",
62 | "name": "Clothes",
63 | "image": "https://api.lorem.space/image/fashion?w=640&h=480&r=7943"
64 | }
65 | }
66 | }
67 | ```
68 |
69 | ## Create a category
70 |
71 | You can create a new category by sending an object like the following to the `addCategory` mutation.
72 |
73 | Mutation:
74 |
75 | ```graphql
76 | mutation {
77 | addCategory(
78 | data: { name: "New Category", image: "https://placeimg.com/640/480/any" }
79 | ) {
80 | id
81 | name
82 | image
83 | }
84 | }
85 | ```
86 |
87 | Response:
88 |
89 | ```json
90 | {
91 | "data": {
92 | "addCategory": {
93 | "id": "6",
94 | "name": "New Category",
95 | "image": "https://placeimg.com/640/480/any"
96 | }
97 | }
98 | }
99 | ```
100 |
101 | > Note that the image is an URLs.
102 |
103 | ## Update a category
104 |
105 | You can update a category exists by sending an object like the following and adding the `id` as a parameter to the `updateCategory` mutation.
106 |
107 | Mutation:
108 |
109 | ```graphql
110 | mutation {
111 | updateCategory(id: 1, changes: { name: "change" }) {
112 | id
113 | name
114 | image
115 | }
116 | }
117 | ```
118 |
119 | Response:
120 |
121 | ```json
122 | {
123 | "data": {
124 | "updateCategory": {
125 | "id": "1",
126 | "name": "change",
127 | "image": "https://api.lorem.space/image/fashion?w=640&h=480&r=7943"
128 | }
129 | }
130 | }
131 | ```
132 |
133 | > Note that it is not necessary to send all product attributes, just send the attributes that want to update.
134 |
135 | ## Delete a category
136 |
137 | You can delete a category exists by adding the `id` as a parameter to the `deleteCategory` mutation.
138 |
139 | Mutation:
140 |
141 | ```graphql
142 | mutation {
143 | deleteCategory(id: 12)
144 | }
145 | ```
146 |
147 | Response:
148 |
149 | ```json
150 | {
151 | "data": {
152 | "deleteCategory": true
153 | }
154 | }
155 | ```
156 |
157 | ## Schema Category
158 |
159 | | Attribute | Type | Description |
160 | | --------- | ------ | ------------------------------ |
161 | | id | number | The id of the category. |
162 | | name | string | Name of the category. |
163 | | image | string | The string with URL to a image |
164 |
--------------------------------------------------------------------------------
/src/content/docs/en/gql/files.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Files
3 | description: Endpoints for Categories
4 | ---
5 |
6 | ## Upload File
7 |
8 | You can upload file by using the `/files/upload` endpoint but in header the `Content-Type` should be `multipart/form-data`.
9 |
10 | Request:
11 |
12 | ```sh
13 | [POST] https://api.escuelajs.co/api/v1/files/upload
14 | # Body
15 | {
16 | "file": ""
17 | }
18 | ```
19 |
20 | The response is like this:
21 |
22 | ```json
23 | {
24 | "originalname": "Djhv7NO - Imgur.png",
25 | "filename": "f3a5.png",
26 | "location": "https://api.escuelajs.co/api/v1/files/f3a5.png"
27 | }
28 | ```
29 |
30 | ## Get a file
31 |
32 | You can get a single file by adding the `fileName` as a parameter: `/files/{fileName}`
33 |
34 | ```sh
35 | [GET] https://api.escuelajs.co/api/v1/files/f3a5.png
36 | ```
37 |
--------------------------------------------------------------------------------
/src/content/docs/en/gql/playground.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: GraphQL Playground
3 | description: GraphQL Playground
4 | ---
5 |
6 | GraphQL Playground is a graphical, interactive, in-browser GraphQL IDE, created by Prisma and based on GraphiQL.
7 |
8 | 
9 |
10 |
11 | Go to
12 | GraphQL Playground.
13 |
14 |
--------------------------------------------------------------------------------
/src/content/docs/en/gql/products-filter.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Filter Products
3 | description: Endpoints to filter products
4 | ---
5 |
6 | ## Filter by title
7 |
8 | By using the `products` query and passing `title` as a query parameter, you can filter for products by title.
9 |
10 | Query:
11 |
12 | ```graphql
13 | query {
14 | products(title: "Generic") {
15 | title
16 | price
17 | }
18 | }
19 | ```
20 |
21 | ## Filter by price
22 |
23 | By using the `products` query and passing `price` as a query parameter, you can filter for products by price.
24 |
25 | Query:
26 |
27 | ```graphql
28 | query {
29 | products(price: 100) {
30 | title
31 | price
32 | }
33 | }
34 | ```
35 |
36 | ## Filter by price range
37 |
38 | By using the `products` query and passing `price_min` and `price_max` as a query parameter, you can filter for products by price range.
39 |
40 | Query:
41 |
42 | ```graphql
43 | query {
44 | products(price_min: 100, price_max: 200) {
45 | title
46 | price
47 | }
48 | }
49 | ```
50 |
51 | ## Filter by category
52 |
53 | By using the `products` query and passing `categoryId` as a query parameter, you can filter for products by category.
54 |
55 | Query:
56 |
57 | ```graphql
58 | query {
59 | products(categoryId: 1) {
60 | title
61 | price
62 | category {
63 | id
64 | name
65 | }
66 | }
67 | }
68 | ```
69 |
70 | ## Join filters
71 |
72 | You can filter products using all query parameters and merge them all.
73 |
74 | Example: All products with a price between `900` and `1000`, with the title `"Generic"` and category id `1`.
75 |
76 | Query:
77 |
78 | ```graphql
79 | query {
80 | products(title: "Generic", categoryId: 1, price_min: 100, price_max: 1000) {
81 | title
82 | price
83 | category {
84 | id
85 | name
86 | }
87 | }
88 | }
89 | ```
90 |
91 | Example: All products with a price between `900` and `1000`, and category id `1`, with a limit of `10` products and an offset of `10`.
92 |
93 | ```graphql
94 | query {
95 | products(categoryId: 1, price_min: 900, price_max: 1000) {
96 | title
97 | price
98 | category {
99 | id
100 | name
101 | }
102 | }
103 | }
104 | ```
105 |
106 | Example: All products with a price between `100` and `1000`, and with a limit of `10` products and an offset of `10`.
107 |
108 | ```graphql
109 | query {
110 | products(offset: 10, limit: 10, price_min: 900, price_max: 1000) {
111 | title
112 | price
113 | category {
114 | id
115 | name
116 | }
117 | }
118 | }
119 | ```
120 |
--------------------------------------------------------------------------------
/src/content/docs/en/gql/products.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Products
3 | description: Endpoints for products
4 | ---
5 |
6 | ## Get all products
7 |
8 | You can access the list of 200 products by using the `products` query.
9 |
10 | Query:
11 |
12 | ```graphql
13 | query {
14 | products {
15 | id
16 | title
17 | price
18 | description
19 | images
20 | category {
21 | id
22 | name
23 | image
24 | }
25 | }
26 | }
27 | ```
28 |
29 | Response:
30 |
31 | ```json
32 | [
33 | {
34 | "id": 4,
35 | "title": "Handmade Fresh Table",
36 | "price": 687,
37 | "description": "Andy shoes are designed to keeping in...",
38 | "category": {
39 | "id": 5,
40 | "name": "Others",
41 | "image": "https://placeimg.com/640/480/any?r=0.591926261873231"
42 | },
43 | "images": [
44 | "https://placeimg.com/640/480/any?r=0.9178516507833767",
45 | "https://placeimg.com/640/480/any?r=0.9300320592588625",
46 | "https://placeimg.com/640/480/any?r=0.8807778235430017"
47 | ]
48 | }
49 | // ...
50 | ]
51 | ```
52 |
53 | ## Get a single product
54 |
55 | You can get a single product by adding the `id` as a parameter using `product` query.
56 |
57 | Query:
58 |
59 | ```graphql
60 | {
61 | product(id: "4") {
62 | title
63 | price
64 | }
65 | }
66 | ```
67 |
68 | Response:
69 |
70 | ```json
71 | {
72 | "data": {
73 | "product": {
74 | "id": "1",
75 | "title": "Fantastic Rubber Towels",
76 | "price": 800,
77 | "images": [
78 | "https://api.lorem.space/image/furniture?w=640&h=480&r=5902",
79 | "https://api.lorem.space/image/furniture?w=640&h=480&r=164",
80 | "https://api.lorem.space/image/furniture?w=640&h=480&r=8528"
81 | ],
82 | "description": "The Football Is Good For Training And Recreational Purposes"
83 | }
84 | }
85 | }
86 | ```
87 |
88 | You can use aliases to get different products in the same request, for example:
89 |
90 | Query:
91 |
92 | ```graphql
93 | {
94 | ProductA: product(id: "1") {
95 | title
96 | price
97 | }
98 | ProductB: product(id: "2") {
99 | title
100 | price
101 | }
102 | }
103 | ```
104 |
105 | Response:
106 |
107 | ```json
108 | {
109 | "data": {
110 | "ProductA": {
111 | "title": "Fantastic Rubber Towels",
112 | "price": 800
113 | },
114 | "ProductB": {
115 | "title": "Rustic Plastic Soap",
116 | "price": 682
117 | }
118 | }
119 | }
120 | ```
121 |
122 | ## Create a product
123 |
124 | You can create a new product by sending an object like a parameter to the `addProduct` mutation.
125 |
126 | Mutation:
127 |
128 | ```graphql
129 | mutation {
130 | addProduct(
131 | data: {
132 | title: "New Product"
133 | price: 10
134 | description: "A description"
135 | categoryId: 1
136 | images: ["https://placeimg.com/640/480/any"]
137 | }
138 | ) {
139 | title
140 | price
141 | images
142 | category {
143 | id
144 | name
145 | image
146 | }
147 | }
148 | }
149 | ```
150 |
151 | Response:
152 |
153 | ```json
154 | {
155 | "title": "New Product",
156 | "price": 10,
157 | "description": "A description",
158 | "images": ["https://placeimg.com/640/480/any"],
159 | "category": {
160 | "id": 1,
161 | "name": "Clothes",
162 | "image": "https://api.lorem.space/image/fashion?w=640&h=480&r=4278"
163 | },
164 | "id": 210
165 | }
166 | ```
167 |
168 | > Note that the `categoryId` should be an ID that exists in `categories` and the images are an array with URLs.
169 |
170 | ## Update a product
171 |
172 | You can update a product by sending an object like the following and adding the `id` as a parameter to the `updateProduct` mutation.
173 |
174 | Mutation:
175 |
176 | ```graphql
177 | mutation {
178 | updateProduct(id: "1", changes: { title: "udpate" }) {
179 | title
180 | price
181 | images
182 | }
183 | }
184 | ```
185 |
186 | Response:
187 |
188 | ```json
189 | {
190 | "data": {
191 | "updateProduct": {
192 | "title": "udpate",
193 | "price": 800,
194 | "images": [
195 | "https://api.lorem.space/image/furniture?w=640&h=480&r=5902",
196 | "https://api.lorem.space/image/furniture?w=640&h=480&r=164",
197 | "https://api.lorem.space/image/furniture?w=640&h=480&r=8528"
198 | ]
199 | }
200 | }
201 | }
202 | ```
203 |
204 | > Note that it is not necessary to send all product attributes, just send the ones you want to update.
205 |
206 | ## Delete a product
207 |
208 | You can delete a product by adding the `id` as a parameter to the `deleteProduct` mutation.
209 |
210 | Mutation:
211 |
212 | ```graphql
213 | mutation {
214 | deleteProduct(id: 1)
215 | }
216 | ```
217 |
218 | Response:
219 |
220 | ```json
221 | {
222 | "data": {
223 | "deleteProduct": true
224 | }
225 | }
226 | ```
227 |
228 | ## Pagination
229 |
230 | APIs that use offset-based paging use the offset and limit query parameters to paginate through items in a collection.
231 |
232 | Offset-based pagination is often used where the list of items is of a fixed and predetermined length.
233 |
234 | To fetch the first page of entries in a collection, the API needs to be called with the `offset` set to 0 and the `limit` the products that you want in the response.
235 |
236 | Query:
237 |
238 | ```graphql
239 | query {
240 | products(limit: 2, offset: 0) {
241 | title
242 | price
243 | }
244 | }
245 | ```
246 |
247 | Response:
248 |
249 | ```json
250 | {
251 | "data": {
252 | "products": [
253 | {
254 | "title": "udpate",
255 | "price": 800
256 | },
257 | {
258 | "title": "Rustic Plastic Soap",
259 | "price": 682
260 | }
261 | ]
262 | }
263 | }
264 | ```
265 |
266 | To fetch the **next page** of entries, the API needs to be called with an offset parameter that equals the sum of the previous offset value and limit returned to the previous result,
267 |
268 | To get the **next page** of entries, use an offset parameter equal to the sum of the previous offset value and the limit returned to the previous result, `previous_offset + previous_limit`.
269 |
270 | > Note that the offset should be increased by the previous limit and not by the size of the entries in the response array, as this may be less than the limit. Generally, we advise using the value of the limit in the response object to increase the offset value.
271 |
272 | For example, for a pagination with 10 items per page, it looks like this:
273 |
274 | | Query | Description |
275 | | ------------------------------- | ----------------------------- |
276 | | products(limit: 10, offset: 0) | Return the first 10 products. |
277 | | products(limit: 10, offset: 10) | Return products from 10 to 20 |
278 | | products(limit: 10, offset: 20) | Return products from 20 to 30 |
279 |
280 | Or for a pagination with 20 items per page, it looks like this:
281 |
282 | | Query | Description |
283 | | ------------------------------- | ----------------------------- |
284 | | products(limit: 20, offset: 0) | Return the first 20 products. |
285 | | products(limit: 20, offset: 20) | Return products from 20 to 40 |
286 | | products(limit: 20, offset: 40) | Return products from 40 to 60 |
287 |
288 | ## Schema Product
289 |
290 | | Attribute | Type | Description |
291 | | ----------- | -------- | ------------------------- |
292 | | id | number | The id of the product. |
293 | | title | string | The name of the product. |
294 | | price | number | Price the product. |
295 | | description | string | Description the product. |
296 | | category | number | Object of category. |
297 | | images | string[] | List of images like URLs. |
298 |
--------------------------------------------------------------------------------
/src/content/docs/en/gql/users.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Users
3 | description: Endpoints for Users
4 | ---
5 |
6 | ## Get all users
7 |
8 | You can access the list of users by using the `users` query.
9 |
10 | Query:
11 |
12 | ```graphql
13 | query {
14 | users {
15 | id
16 | name
17 | email
18 | }
19 | }
20 | ```
21 |
22 | Response:
23 |
24 | ```json
25 | {
26 | "data": {
27 | "users": [
28 | {
29 | "id": "1",
30 | "name": "Jhon",
31 | "email": "john@mail.com"
32 | },
33 | ...
34 | ]
35 | }
36 | }
37 | ```
38 |
39 | ## Get a single user
40 |
41 | You can get a single user by adding the `id` as a parameter to the `user` query.
42 |
43 | Query:
44 |
45 | ```graphql
46 | query {
47 | user(id: 1) {
48 | id
49 | name
50 | avatar
51 | }
52 | }
53 | ```
54 |
55 | Response:
56 |
57 | ```json
58 | {
59 | "data": {
60 | "user": {
61 | "id": "1",
62 | "name": "Jhon",
63 | "avatar": "https://api.lorem.space/image/face?w=640&h=480&r=6355"
64 | }
65 | }
66 | }
67 | ```
68 |
69 | ## Create a user
70 |
71 | You can create a new user by sending an object like the following to the `addUser` mutation.
72 |
73 | Mutation:
74 |
75 | ```graphql
76 | mutation {
77 | addUser(
78 | data: {
79 | name: "Nicolas"
80 | email: "nico@gmail.com"
81 | password: "123"
82 | avatar: "https://api.lorem.space/image/face?w=150&h=220"
83 | }
84 | ) {
85 | id
86 | name
87 | avatar
88 | }
89 | }
90 | ```
91 |
92 | Response:
93 |
94 | ```json
95 | {
96 | "data": {
97 | "addUser": {
98 | "id": "10",
99 | "name": "Nicolas",
100 | "avatar": "https://api.lorem.space/image/face?w=150&h=220"
101 | }
102 | }
103 | }
104 | ```
105 |
106 | > Note that the password is not encrypted.
107 |
108 | ## Update a user
109 |
110 | You can update a user by sending an object like the following and adding the `id` as a parameter to `updateUser` mutation.
111 |
112 | Mutation:
113 |
114 | ```graphql
115 | mutation {
116 | updateUser(id: 1, changes: { name: "change" }) {
117 | id
118 | name
119 | avatar
120 | }
121 | }
122 | ```
123 |
124 | Response:
125 |
126 | ```json
127 | {
128 | "data": {
129 | "updateUser": {
130 | "id": "1",
131 | "name": "change",
132 | "avatar": "https://api.lorem.space/image/face?w=640&h=480&r=6355"
133 | }
134 | }
135 | }
136 | ```
137 |
138 | > Note that it is not necessary to send all user attributes, just send the attributes that want to update.
139 |
140 | ## Check the email
141 |
142 | You can verify if an email is already registered in the API.
143 |
144 | Request:
145 |
146 | ```graphql
147 | query {
148 | isAvailable(email: "john@mail.com")
149 | }
150 | ```
151 |
152 | Response:
153 |
154 | ```json
155 | {
156 | "data": {
157 | "isAvailable": false
158 | }
159 | }
160 | ```
161 |
162 | This feature is so useful for features like showing a message in a form and verifying the email before creating a user. For example:
163 |
164 | 
165 |
166 | ## Schema User
167 |
168 | | Attribute | Type | Description |
169 | | --------- | ------ | ----------------------------------------- |
170 | | id | number | The id of the user. |
171 | | name | string | The name of the user. |
172 | | role | string | The role of the user is customer or admin |
173 | | email | string | The email of the user. |
174 | | password | string | The password of the user. |
175 |
--------------------------------------------------------------------------------
/src/content/docs/en/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Platzi Fake Store API
3 | description: A comprehensive REST API for your e-commerce or shopping website prototype.
4 | template: splash
5 | hero:
6 | tagline: The perfect API solution for your e-commerce or shopping website prototype.
7 | image:
8 | file: ../../../assets/banner.png
9 | actions:
10 | - text: View Docs
11 | link: /en/about/introduction/
12 | icon: right-arrow
13 | variant: primary
14 | ---
15 |
16 | import { Code } from "astro/components";
17 | import { Card, CardGrid } from "@astrojs/starlight/components";
18 | import CategoriesAPI from "../../../components/PreviewAPI/CategoriesAPI.astro";
19 | import ProductsAPI from "../../../components/PreviewAPI/ProductsAPI.astro";
20 | import UsersAPI from "../../../components/PreviewAPI/UsersAPI.astro";
21 |
22 |
23 | Get Products
24 |
25 |
26 |
27 |
28 |
29 |
30 |
Get Categories
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
Get Users
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | ## Features
49 |
50 |
51 |
52 | Our API supports all CRUD operations (Create, Read, Update, and Delete) with
53 | no limitations, giving you full flexibility for your projects.
54 |
55 |
56 | Implement features like infinite scroll with our built-in pagination support
57 | through 'limit' and 'offset' parameters.
58 |
59 |
60 | Secure your application with JWT for access and refresh tokens, and easily
61 | test protected endpoints with this industry-standard authentication method.
62 |
63 |
64 | Create sophisticated user interfaces by filtering products by price, title,
65 | and category using our comprehensive filtering options.
66 |
67 |
68 | Built on REST API principles, the most widely adopted architectural style in
69 | the industry, ensuring compatibility and ease of use.
70 |
71 |
72 | Take advantage of GraphQL to request exactly the data you need, with a
73 | runtime that executes queries against your existing data.
74 |
75 |
76 | Easily upload files using `multipart/form-data` for a complete e-commerce
77 | experience.
78 |
79 |
80 | Get started quickly with our ready-to-use configuration files for both
81 | Postman and Insomnia, making endpoint testing seamless.
82 |
83 |
84 | Enhance your projects with professionally crafted AI-generated images that
85 | add visual appeal and realism to your prototypes.
86 |
87 |
88 |
--------------------------------------------------------------------------------
/src/content/docs/en/resources/insomnia.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Insomnia
3 | description: File for Insomnia
4 | ---
5 |
6 | Insomnia is a great app to organize your requests to reflect your workflow or your API data-model. Group and order your API requests to your heart's desire.
7 |
8 | 
9 |
10 |
11 | Download the
12 | Insomnia JSON File, for import in Insomnia App.
13 |
14 |
--------------------------------------------------------------------------------
/src/content/docs/en/resources/postman.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Postman
3 | description: Using Postman with our API
4 | ---
5 |
6 | ## Overview
7 |
8 | Postman is a powerful API client that simplifies the process of testing, documenting, and sharing APIs. It provides an intuitive interface for sending requests, viewing responses, and automating workflows through collections.
9 |
10 | ## Using Our Postman Collection
11 |
12 | We've prepared a comprehensive Postman collection that includes all available endpoints in our API, properly organized and documented. This collection will help you:
13 |
14 | 1. Explore our API capabilities
15 | 2. Test different endpoints with pre-configured requests
16 | 3. Understand request parameters and response formats
17 | 4. Quickly integrate our API into your applications
18 |
19 | 
20 |
21 | ## Getting Started
22 |
23 | 1. Download and install [Postman](https://www.postman.com/downloads/) if you haven't already
24 | 2. Download our Postman collection by clicking the link below
25 | 3. In Postman, click "Import" and select the downloaded JSON file
26 | 4. In API_URL change the url to https://api.escuelajs.co
27 | 5. Start exploring our API endpoints!
28 |
29 |
30 | Download Postman Collection
31 |
32 |
--------------------------------------------------------------------------------
/src/content/docs/en/rest/auth-jwt.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Authentication with JWT
3 | description: API endpoints for JWT-based authentication and authorization
4 | ---
5 |
6 | This API uses JSON Web Tokens (JWT) for secure authentication. The authentication flow consists of three main operations:
7 |
8 | 1. Obtaining access and refresh tokens via login
9 | 2. Accessing protected resources using the access token
10 | 3. Refreshing expired access tokens using the refresh token
11 |
12 | ## Login
13 |
14 | To authenticate a user and obtain JWT tokens, send a POST request with email and password credentials.
15 |
16 | ### Request
17 |
18 | ```sh
19 | POST https://api.escuelajs.co/api/v1/auth/login
20 | Content-Type: application/json
21 |
22 | {
23 | "email": "john@mail.com",
24 | "password": "changeme"
25 | }
26 | ```
27 |
28 | ### Response
29 |
30 | Upon successful authentication, the server returns both access and refresh tokens:
31 |
32 | ```json
33 | {
34 | "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEsImlhdCI6MTY3Mjc2NjAyOCwiZXhwIjoxNjc0NDk0MDI4fQ.kCak9sLJr74frSRVQp0_27BY4iBCgQSmoT3vQVWKzJg",
35 | "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEsImlhdCI6MTY3Mjc2NjAyOCwiZXhwIjoxNjcyODAyMDI4fQ.P1_rB3hJ5afwiG4TWXLq6jOAcVJkvQZ2Z-ZZOnQ1dZw"
36 | }
37 | ```
38 |
39 | > **Note:** The access token is valid for 20 days, and the refresh token is valid for 10 hours.
40 |
41 | ## Retrieving User Profile
42 |
43 | To access the authenticated user's profile, include the access token in the Authorization header using the Bearer scheme.
44 |
45 | ### Request
46 |
47 | ```sh
48 | GET https://api.escuelajs.co/api/v1/auth/profile
49 | Authorization: Bearer {your_access_token}
50 | ```
51 |
52 | ### Response
53 |
54 | ```json
55 | {
56 | "id": 1,
57 | "email": "john@mail.com",
58 | "password": "changeme",
59 | "name": "Jhon",
60 | "role": "customer",
61 | "avatar": "https://api.lorem.space/image/face?w=640&h=480&r=867"
62 | }
63 | ```
64 |
65 | ## Refreshing Access Token
66 |
67 | When an access token expires, you can obtain a new pair of tokens by using the refresh token.
68 |
69 | ### Request
70 |
71 | ```sh
72 | POST https://api.escuelajs.co/api/v1/auth/refresh-token
73 | Content-Type: application/json
74 |
75 | {
76 | "refreshToken": "{your_refresh_token}"
77 | }
78 | ```
79 |
80 | ### Response
81 |
82 | ```json
83 | {
84 | "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEsImlhdCI6MTY3Mjc2NjAyOCwiZXhwIjoxNjc0NDk0MDI4fQ.kCak9sLJr74frSRVQp0_27BY4iBCgQSmoT3vQVWKzJg",
85 | "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEsImlhdCI6MTY3Mjc2NjAyOCwiZXhwIjoxNjcyODAyMDI4fQ.P1_rB3hJ5afwiG4TWXLq6jOAcVJkvQZ2Z-ZZOnQ1dZw"
86 | }
87 | ```
88 |
89 | > **Note:** The access token is valid for 20 days, and the refresh token is valid for 10 hours.
90 |
91 | ## Error Handling
92 |
93 | Common authentication errors include:
94 |
95 | - **401 Unauthorized**: Invalid credentials or expired tokens
96 | - **403 Forbidden**: Valid authentication but insufficient permissions
97 | - **400 Bad Request**: Malformed request body or headers
98 |
99 | Always ensure your application properly handles token expiration by implementing automatic token refresh when needed.
100 |
--------------------------------------------------------------------------------
/src/content/docs/en/rest/categories.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Categories
3 | description: API endpoints for managing product categories
4 | ---
5 |
6 | Retrieve a list of all available categories.
7 |
8 | ##### Request
9 |
10 | ```sh
11 | [GET] https://api.escuelajs.co/api/v1/categories
12 | ```
13 |
14 | ##### Response
15 |
16 | ```json
17 | [
18 | {
19 | "id": 1,
20 | "name": "Clothes",
21 | "slug": "clothes",
22 | "image": "https://placehold.co/600x400"
23 | }
24 | // Additional categories...
25 | ]
26 | ```
27 |
28 | ## Get a single category by ID
29 |
30 | Retrieve detailed information about a specific category by its ID.
31 |
32 | ##### Request
33 |
34 | ```sh
35 | [GET] https://api.escuelajs.co/api/v1/categories/{id}
36 | ```
37 |
38 | ##### Response
39 |
40 | ```json
41 | {
42 | "id": 1,
43 | "name": "Clothes",
44 | "slug": "clothes",
45 | "image": "https://placehold.co/600x400"
46 | }
47 | ```
48 |
49 | ## Get a single category by slug
50 |
51 | Retrieve detailed information about a specific category by its slug.
52 |
53 | ##### Request
54 |
55 | ```sh
56 | [GET] https://api.escuelajs.co/api/v1/categories/slug/{slug}
57 | ```
58 |
59 | ##### Response
60 |
61 | ```json
62 | {
63 | "id": 1,
64 | "name": "Clothes",
65 | "slug": "clothes",
66 | "image": "https://placehold.co/600x400"
67 | }
68 | ```
69 |
70 | ##### Response
71 |
72 | ```json
73 |
74 | ```
75 |
76 | ## Create a category
77 |
78 | Create a new category by providing the required information.
79 |
80 | ##### Request
81 |
82 | ```sh
83 | [POST] https://api.escuelajs.co/api/v1/categories/
84 |
85 | #Body
86 | {
87 | "name": "New Category",
88 | "image": "https://placeimg.com/640/480/any"
89 | }
90 | ```
91 |
92 | ##### Response
93 |
94 | ```json
95 | {
96 | "name": "New Category",
97 | "slug": "new-category",
98 | "image": "https://placeimg.com/640/480/any",
99 | "id": 6
100 | }
101 | ```
102 |
103 | > **Note:** The image field must be a valid URL to an image resource.
104 |
105 | ## Update a category
106 |
107 | Update an existing category's information by its ID.
108 |
109 | ##### Request
110 |
111 | ```sh
112 | [PUT] https://api.escuelajs.co/api/v1/categories/{id}
113 |
114 | #Body
115 | {
116 | "name": "Updated Category Name",
117 | "image": "https://placeimg.com/640/480/any"
118 | }
119 | ```
120 |
121 | ##### Response
122 |
123 | ```json
124 | {
125 | "id": 3,
126 | "name": "Updated Category Name",
127 | "slug": "updated-category-name",
128 | "image": "https://placehold.co/600x400"
129 | }
130 | ```
131 |
132 | ## Delete a category
133 |
134 | Remove a category from the system by its ID.
135 |
136 | ##### Request
137 |
138 | ```sh
139 | [DELETE] https://api.escuelajs.co/api/v1/categories/{id}
140 | ```
141 |
142 | ##### Response
143 |
144 | ```json
145 | true
146 | ```
147 |
148 | ## Get all products by category
149 |
150 | Retrieve all products that belong to a specific category with pagination support.
151 |
152 | ##### Request
153 |
154 | ```sh
155 | [GET] https://api.escuelajs.co/api/v1/categories/{id}/products
156 | ```
157 |
158 | ##### Response
159 |
160 | ```json
161 | [
162 | {
163 | "id": 4,
164 | "title": "Handmade Fresh Table",
165 | "slug": "handmade-fresh-table",
166 | "price": 687,
167 | "description": "Andy shoes are designed to keeping in...",
168 | "category": {
169 | "id": 1,
170 | "name": "Others",
171 | "slug": "others",
172 | "image": "https://placehold.co/600x400"
173 | },
174 | "images": [
175 | "https://placehold.co/600x400",
176 | "https://placehold.co/600x400",
177 | "https://placehold.co/600x400"
178 | ]
179 | }
180 | // Additional products...
181 | ]
182 | ```
183 |
184 | ## Category Schema
185 |
186 | | Attribute | Type | Description |
187 | | --------- | ------ | ------------------------------------- |
188 | | id | number | The unique identifier of the category |
189 | | name | string | Name of the category |
190 | | image | string | URL to the category's image |
191 | | slug | string | URL-friendly version of the name |
192 |
--------------------------------------------------------------------------------
/src/content/docs/en/rest/files.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Upload File
3 | description: Endpoints for file uploads and retrieval
4 | ---
5 |
6 | This endpoint allows you to upload files to the server. The uploaded files can later be referenced in other resources such as product images.
7 |
8 | ##### Request
9 |
10 | To upload a file, send a POST request to the `/files/upload` endpoint. The request must use the `multipart/form-data` content type in the header.
11 |
12 | ```sh
13 | [POST] https://api.escuelajs.co/api/v1/files/upload
14 | Content-Type: multipart/form-data
15 | #Body
16 | {
17 | "file": ""
18 | }
19 | ```
20 |
21 | ##### Response
22 |
23 | A successful upload will return a JSON object containing information about the uploaded file:
24 |
25 | ```json
26 | {
27 | "originalname": "Djhv7NO - Imgur.png",
28 | "filename": "f3a5.png",
29 | "location": "https://api.escuelajs.co/api/v1/files/f3a5.png"
30 | }
31 | ```
32 |
33 | ## Get a File
34 |
35 | You can retrieve a file by using its filename as a parameter in the URL path.
36 |
37 | ##### Request
38 |
39 | ```sh
40 | [GET] https://api.escuelajs.co/api/v1/files/{fileName}
41 | ```
42 |
43 | Where `{fileName}` is the name of the file you want to retrieve (the `filename` value returned from the upload endpoint).
44 |
45 | Example:
46 |
47 | ```sh
48 | [GET] https://api.escuelajs.co/api/v1/files/f3a5.png
49 | ```
50 |
51 | ##### Response
52 |
53 | The response will be the requested file with the appropriate content type.
54 |
--------------------------------------------------------------------------------
/src/content/docs/en/rest/locations.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Locations
3 | description: Endpoints for locations API
4 | ---
5 |
6 | The Locations API provides access to geographical location data. Use these endpoints to retrieve location information with various filtering options.
7 |
8 | ## Get all locations
9 |
10 | Retrieve a list of 10 locations randomly.
11 |
12 | ##### Request
13 |
14 | ```sh
15 | [GET] https://api.escuelajs.co/api/v1/locations
16 | ```
17 |
18 | ##### Response
19 |
20 | ```json
21 | [
22 | {
23 | "id": 3456024234637667,
24 | "name": "2063 Bath Street",
25 | "description": "Urbanus illum aspernatur.",
26 | "latitude": 4.647499671477389,
27 | "longitude": -74.27320830941972
28 | }
29 | // Additional locations...
30 | ]
31 | ```
32 |
33 | ## Get locations by origin
34 |
35 | Retrieve locations sorted by distance from a specified origin point.
36 |
37 | ##### Request
38 |
39 | ```sh
40 | [GET] https://api.escuelajs.co/api/v1/locations?origin=6.2071641,-75.5720321
41 | ```
42 |
43 | ##### Response
44 |
45 | ```json
46 | [
47 | {
48 | "id": 3456024234637667,
49 | "name": "2063 Bath Street",
50 | "description": "Urbanus illum aspernatur.",
51 | "latitude": 4.647499671477389,
52 | "longitude": -74.27320830941972
53 | }
54 | // Additional locations...
55 | ]
56 | ```
57 |
58 | ## Get locations with a limit
59 |
60 | Retrieve a specific number of locations.
61 |
62 | ##### Request
63 |
64 | ```sh
65 | [GET] https://api.escuelajs.co/api/v1/locations?size=10
66 | ```
67 |
68 | ##### Response
69 |
70 | ```json
71 | [
72 | {
73 | "id": 3456024234637667,
74 | "name": "2063 Bath Street",
75 | "description": "Urbanus illum aspernatur.",
76 | "latitude": 4.647499671477389,
77 | "longitude": -74.27320830941972
78 | }
79 | // Additional locations...
80 | ]
81 | ```
82 |
83 | ## Get locations within a radius
84 |
85 | Retrieve locations within a specified radius (in kilometers) from an origin point.
86 |
87 | ##### Request
88 |
89 | ```sh
90 | [GET] https://api.escuelajs.co/api/v1/locations?origin=6.2071641,-75.5720321&radius=10
91 | ```
92 |
93 | ##### Response
94 |
95 | ```json
96 | [
97 | {
98 | "id": 3456024234637667,
99 | "name": "2063 Bath Street",
100 | "description": "Urbanus illum aspernatur.",
101 | "latitude": 4.647499671477389,
102 | "longitude": -74.27320830941972
103 | }
104 | // Additional locations...
105 | ]
106 | ```
107 |
108 | ## Inspiration
109 |
110 | This endpoint allows you to retrieve store locations for an e-commerce platform and display them on a map, enabling you to create interfaces similar to "Starbucks stores near you" that help users find nearby physical locations.
111 |
112 | 
113 |
--------------------------------------------------------------------------------
/src/content/docs/en/rest/products-filter.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Filter Products
3 | description: Endpoints to filter products by various criteria
4 | ---
5 |
6 | The API provides several ways to filter products using query parameters. All filter requests should be made to the base endpoint:
7 |
8 | ```sh
9 | [GET] https://api.escuelajs.co/api/v1/products
10 | ```
11 |
12 | ## Filter by Title
13 |
14 | Filter products by their title using the `title` query parameter.
15 |
16 | ```sh
17 | [GET] https://api.escuelajs.co/api/v1/products/?title=Generic
18 | ```
19 |
20 | ## Filter by Price
21 |
22 | Filter products by their exact price using the `price` query parameter.
23 |
24 | ```sh
25 | [GET] https://api.escuelajs.co/api/v1/products/?price=100
26 | ```
27 |
28 | ## Filter by Price Range
29 |
30 | Filter products within a price range using the `price_min` and `price_max` query parameters.
31 |
32 | ```sh
33 | [GET] https://api.escuelajs.co/api/v1/products/?price_min=900&price_max=1000
34 | ```
35 |
36 | ## Filter by Category
37 |
38 | Filter products by their category using the `categoryId` or `categorySlug` query parameter.
39 |
40 | ```sh
41 | [GET] https://api.escuelajs.co/api/v1/products/?categoryId=1
42 | ```
43 |
44 | ```sh
45 | [GET] https://api.escuelajs.co/api/v1/products/?categorySlug=clothes
46 | ```
47 |
48 | ## Combining Filters
49 |
50 | You can combine multiple filters by adding multiple query parameters to create more specific queries.
51 |
52 | #### Example 1: Title, Price Range, and Category
53 |
54 | Get all products with the title "Generic", price between 900 and 1000, and category ID 1:
55 |
56 | ```sh
57 | [GET] https://api.escuelajs.co/api/v1/products/?title=Generic&price_min=900&price_max=1000&categoryId=1
58 | ```
59 |
60 | #### Example 2: Price Range and Category with Pagination
61 |
62 | Get products with price between 900 and 1000, category ID 1, with pagination (10 products per page, starting from the 10th product):
63 |
64 | ```sh
65 | [GET] https://api.escuelajs.co/api/v1/products/?price_min=900&price_max=1000&categoryId=1&limit=10&offset=10
66 | ```
67 |
68 | #### Example 3: Price Range with Pagination
69 |
70 | Get products with price between 100 and 1000, with pagination (10 products per page, starting from the 10th product):
71 |
72 | ```sh
73 | [GET] https://api.escuelajs.co/api/v1/products/?price_min=100&price_max=1000&limit=10&offset=10
74 | ```
75 |
76 | ## Response Format
77 |
78 | The API returns an array of product objects that match the specified filters. Each product includes details such as ID, title, price, description, category, and images.
79 |
--------------------------------------------------------------------------------
/src/content/docs/en/rest/products.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Products
3 | description: Endpoints for products
4 | ---
5 |
6 | You can access the list of 50 products by using the `/products` endpoint.
7 |
8 | ##### Request
9 |
10 | ```sh
11 | [GET] https://api.escuelajs.co/api/v1/products
12 | ```
13 |
14 | ##### Response
15 |
16 | ```json
17 | [
18 | {
19 | "id": 4,
20 | "title": "Handmade Fresh Table",
21 | "slug": "handmade-fresh-table",
22 | "price": 687,
23 | "description": "Andy shoes are designed to keeping in...",
24 | "category": {
25 | "id": 5,
26 | "name": "Others",
27 | "image": "https://placehold.co/600x400",
28 | "slug": "others"
29 | },
30 | "images": [
31 | "https://placehold.co/600x400",
32 | "https://placehold.co/600x400",
33 | "https://placehold.co/600x400"
34 | ]
35 | }
36 | // ...
37 | ]
38 | ```
39 |
40 | ## Get a single product by id
41 |
42 | You can get a single product by adding the `id` as a parameter: `/products/`
43 |
44 | ##### Request
45 |
46 | ```sh
47 | [GET] https://api.escuelajs.co/api/v1/products/4
48 | ```
49 |
50 | ##### Response
51 |
52 | ```json
53 | {
54 | "id": 4,
55 | "title": "Handmade Fresh Table",
56 | "slug": "handmade-fresh-table",
57 | "price": 687,
58 | "description": "Andy shoes are designed to keeping in...",
59 | "category": {
60 | "id": 5,
61 | "name": "Others",
62 | "image": "https://placehold.co/600x400",
63 | "slug": "others"
64 | },
65 | "images": [
66 | "https://placehold.co/600x400",
67 | "https://placehold.co/600x400",
68 | "https://placehold.co/600x400"
69 | ]
70 | }
71 | ```
72 |
73 | ## Get a single product by slug
74 |
75 | You can get a single product by its slug using the endpoint: `/products/slug/`
76 |
77 | ##### Request
78 |
79 | ```sh
80 | [GET] https://api.escuelajs.co/api/v1/products/slug/handmade-fresh-table
81 | ```
82 |
83 | ##### Response
84 |
85 | ```json
86 | {
87 | "id": 4,
88 | "title": "Handmade Fresh Table",
89 | "slug": "handmade-fresh-table",
90 | "price": 687,
91 | "description": "Andy shoes are designed to keeping in...",
92 | "category": {
93 | "id": 5,
94 | "name": "Others",
95 | "image": "https://placehold.co/600x400",
96 | "slug": "others"
97 | },
98 | "images": [
99 | "https://placehold.co/600x400",
100 | "https://placehold.co/600x400",
101 | "https://placehold.co/600x400"
102 | ]
103 | }
104 | ```
105 |
106 | ## Create a product
107 |
108 | You can create a new product by sending an object like the following to `/products/`
109 |
110 | ##### Request
111 |
112 | ```sh
113 | [POST] https://api.escuelajs.co/api/v1/products/
114 | # Body
115 | {
116 | "title": "New Product",
117 | "price": 10,
118 | "description": "A description",
119 | "categoryId": 1,
120 | "images": ["https://placehold.co/600x400"]
121 | }
122 | ```
123 |
124 | ##### Response
125 |
126 | ```json
127 | {
128 | "title": "New Product",
129 | "slug": "new-product",
130 | "price": 10,
131 | "description": "A description",
132 | "images": ["https://placehold.co/600x400"],
133 | "category": {
134 | "id": 1,
135 | "name": "Clothes",
136 | "image": "https://placehold.co/600x400",
137 | "slug": "clothes"
138 | },
139 | "id": 210,
140 | "creationAt": "2023-01-03T16:51:33.000Z",
141 | "updatedAt": "2023-01-03T16:51:33.000Z"
142 | }
143 | ```
144 |
145 | > Note that the `categoryId` should be an ID that exists in `/categories` and the images are an array with URLs.
146 |
147 | ## Update a product
148 |
149 | You can update a product by sending an object like the following and adding the `id` as a parameter: `/products/`
150 |
151 | ##### Request
152 |
153 | ```sh
154 | [PUT] https://api.escuelajs.co/api/v1/products/1
155 | # Body
156 | {
157 | "title": "Change title",
158 | "price": 100
159 | }
160 | ```
161 |
162 | ##### Response
163 |
164 | ```json
165 | {
166 | "id": 1,
167 | "title": "Change title",
168 | "slug": "change-title",
169 | "price": 100,
170 | "description": "The automobile layout consists of a front-engine design, with transaxle-type transmissions mounted at the rear of the engine and four wheel drive",
171 | "images": ["https://placehold.co/600x400"],
172 | "category": {
173 | "id": 4,
174 | "name": "Shoes",
175 | "image": "https://placehold.co/600x400",
176 | "slug": "shoes"
177 | }
178 | }
179 | ```
180 |
181 | > Note that it is not necessary to send all product attributes, just send the ones you want to update.
182 |
183 | ## Delete a product
184 |
185 | You can delete a product by adding the `id` as a parameter: `/products/`
186 |
187 | ##### Request
188 |
189 | ```sh
190 | [DELETE] https://api.escuelajs.co/api/v1/products/1
191 | ```
192 |
193 | ##### Response
194 |
195 | ```json
196 | true
197 | ```
198 |
199 | ## Pagination
200 |
201 | The API supports offset-based pagination for retrieving products in manageable chunks. Use the `offset` and `limit` query parameters to control which products are returned.
202 |
203 | ##### Request
204 |
205 | ```sh
206 | [GET] https://api.escuelajs.co/api/v1/products?offset=0&limit=10
207 | ```
208 |
209 | ##### Response
210 |
211 | ```json
212 | [
213 | {
214 | "id": 1,
215 | "title": "Handmade Fresh Table",
216 | "slug": "handmade-fresh-table",
217 | "price": 687,
218 | "description": "Andy shoes are designed to keeping in...",
219 | "category": {
220 | "id": 5,
221 | "name": "Others",
222 | "slug": "others",
223 | "image": "https://placehold.co/600x400"
224 | },
225 | "images": [
226 | "https://placehold.co/600x400",
227 | "https://placehold.co/600x400",
228 | "https://placehold.co/600x400"
229 | ]
230 | }
231 | // ... and 9 items more
232 | ]
233 | ```
234 |
235 | ##### How pagination works
236 |
237 | - `offset`: The number of items to skip before starting to collect the result set
238 | - `limit`: The maximum number of items to return
239 |
240 | To navigate through pages, increase the offset by the value of the limit:
241 |
242 | | Request | Description |
243 | | -------------------------------- | ----------------------------- |
244 | | /products?**offset=0&limit=10** | Return the first 10 products |
245 | | /products?**offset=10&limit=10** | Return products from 11 to 20 |
246 | | /products?**offset=20&limit=10** | Return products from 21 to 30 |
247 |
248 | For a pagination with 20 items per page:
249 |
250 | | Request | Description |
251 | | -------------------------------- | ----------------------------- |
252 | | /products?**offset=0&limit=20** | Return the first 20 products |
253 | | /products?**offset=20&limit=20** | Return products from 21 to 40 |
254 | | /products?**offset=40&limit=20** | Return products from 41 to 60 |
255 |
256 | ## Get products related by id
257 |
258 | You can access the list of related products by using the `/products//related` endpoint.
259 |
260 | ##### Request
261 |
262 | ```sh
263 | [GET] https://api.escuelajs.co/api/v1/products/1/related
264 | ```
265 |
266 | ##### Response
267 |
268 | ```json
269 | [
270 | {
271 | "id": 4,
272 | "title": "Handmade Fresh Table",
273 | "slug": "handmade-fresh-table",
274 | "price": 687,
275 | "description": "Andy shoes are designed to keeping in...",
276 | "category": {
277 | "id": 5,
278 | "name": "Others",
279 | "image": "https://placehold.co/600x400",
280 | "slug": "others"
281 | },
282 | "images": [
283 | "https://placehold.co/600x400",
284 | "https://placehold.co/600x400",
285 | "https://placehold.co/600x400"
286 | ]
287 | }
288 | // ...
289 | ]
290 | ```
291 |
292 | ## Get products related by slug
293 |
294 | You can get the list of related products by using the `/products/slug//related` endpoint.
295 |
296 | ##### Request
297 |
298 | ```sh
299 | [GET] https://api.escuelajs.co/api/v1/products/slug/handmade-fresh-table/related
300 | ```
301 |
302 | ##### Response
303 |
304 | ```json
305 | [
306 | {
307 | "id": 4,
308 | "title": "Handmade Fresh Table",
309 | "slug": "handmade-fresh-table",
310 | "price": 687,
311 | "description": "Andy shoes are designed to keeping in...",
312 | "category": {
313 | "id": 5,
314 | "name": "Others",
315 | "image": "https://placehold.co/600x400",
316 | "slug": "others"
317 | },
318 | "images": [
319 | "https://placehold.co/600x400",
320 | "https://placehold.co/600x400",
321 | "https://placehold.co/600x400"
322 | ]
323 | }
324 | // ...
325 | ]
326 | ```
327 |
328 | ## Product Schema
329 |
330 | | Attribute | Type | Description | Required for Create |
331 | | ----------- | -------- | -------------------------------------- | ------------------- |
332 | | id | number | The unique identifier of the product | No (auto-generated) |
333 | | title | string | The name of the product | Yes |
334 | | price | number | Price of the product | Yes |
335 | | description | string | Description of the product | Yes |
336 | | categoryId | number | ID of the category (for create/update) | Yes |
337 | | category | object | Object containing category information | No (auto-populated) |
338 | | images | string[] | List of image URLs | Yes |
339 | | slug | string | URL-friendly version of the title | No (auto-generated) |
340 | | creationAt | string | Creation timestamp | No (auto-generated) |
341 | | updatedAt | string | Last update timestamp | No (auto-generated) |
342 |
--------------------------------------------------------------------------------
/src/content/docs/en/rest/swagger.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Swagger Documentation
3 | description: Interactive API documentation with Swagger UI
4 | ---
5 |
6 | Swagger UI provides interactive API documentation that allows developers to explore and test API endpoints directly in the browser. Our Swagger documentation offers a comprehensive interface for understanding and interacting with all available API resources.
7 |
8 | 
9 |
10 | ## Features
11 |
12 | - **Interactive Documentation**: Test API calls directly from your browser without additional tools
13 | - **Request Builder**: Automatically builds requests based on your input parameters
14 | - **Response Visualization**: See formatted responses with syntax highlighting
15 | - **Authentication Support**: Test authenticated endpoints with JWT tokens
16 | - **Schema Models**: Explore data models and response structures
17 |
18 | ## How to Use
19 |
20 | 1. Navigate to the [Swagger Documentation](https://api.escuelajs.co/docs)
21 | 2. Browse available endpoints organized by resource categories
22 | 3. Click on any endpoint to expand its details
23 | 4. Fill in required parameters for the endpoint
24 | 5. Click "Execute" to send the request
25 | 6. View the response, status code, and headers
26 |
27 | ## Access Swagger Documentation
28 |
29 |
30 | Open Swagger Documentation
31 |
32 |
--------------------------------------------------------------------------------
/src/content/docs/en/rest/users.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Users
3 | description: API Endpoints for User Management
4 | ---
5 |
6 | Retrieve a list of all users by using the `/users` endpoint.
7 |
8 | ##### Request
9 |
10 | ```sh
11 | GET https://api.escuelajs.co/api/v1/users
12 | ```
13 |
14 | ##### Response
15 |
16 | ```json
17 | [
18 | {
19 | "id": 1,
20 | "email": "john@mail.com",
21 | "password": "changeme",
22 | "name": "Jhon",
23 | "role": "customer",
24 | "avatar": "https://i.imgur.com/LDOO4Qs.jpg"
25 | }
26 | // ... additional users
27 | ]
28 | ```
29 |
30 | ## Get a Single User
31 |
32 | Retrieve a specific user by providing the user's `id` as a path parameter: `/users/{id}`
33 |
34 | ##### Request
35 |
36 | ```sh
37 | GET https://api.escuelajs.co/api/v1/users/1
38 | ```
39 |
40 | ##### Response
41 |
42 | ```json
43 | {
44 | "id": 1,
45 | "email": "john@mail.com",
46 | "password": "changeme",
47 | "name": "Jhon",
48 | "role": "customer",
49 | "avatar": "https://i.imgur.com/LDOO4Qs.jpg"
50 | }
51 | ```
52 |
53 | ## Create a User
54 |
55 | Create a new user by sending a POST request with the required user data to the `/users/` endpoint.
56 |
57 | ##### Request
58 |
59 | ```sh
60 | POST https://api.escuelajs.co/api/v1/users/
61 |
62 | # Request Body
63 | {
64 | "name": "Nicolas",
65 | "email": "nico@gmail.com",
66 | "password": "1234",
67 | "avatar": "https://picsum.photos/800"
68 | }
69 | ```
70 |
71 | ##### Response
72 |
73 | ```json
74 | {
75 | "email": "nico@gmail.com",
76 | "password": "1234",
77 | "name": "Nicolas",
78 | "avatar": "https://i.imgur.com/yhW6Yw1.jpg",
79 | "role": "customer",
80 | "id": 24
81 | }
82 | ```
83 |
84 | > **Note:** For demonstration purposes, passwords are stored as plain text. In a production environment, always implement proper password encryption.
85 |
86 | ## Update a User
87 |
88 | Update an existing user by sending a PUT request with the updated data and specifying the user's `id` as a path parameter: `/users/{id}`
89 |
90 | ##### Request
91 |
92 | ```sh
93 | PUT https://api.escuelajs.co/api/v1/users/1
94 |
95 | # Request Body
96 | {
97 | "email": "john@mail.com",
98 | "name": "Change name"
99 | }
100 | ```
101 |
102 | ##### Response
103 |
104 | ```json
105 | {
106 | "id": 4,
107 | "email": "john@mail.com",
108 | "password": "1234",
109 | "name": "Change name",
110 | "role": "admin",
111 | "avatar": "https://i.imgur.com/yhW6Yw1.jpg"
112 | }
113 | ```
114 |
115 | > **Note:** You only need to include the attributes you want to update in the request body. Other attributes will remain unchanged.
116 |
117 | ## Check Email Availability
118 |
119 | Verify if an email address is already registered in the system.
120 |
121 | ##### Request
122 |
123 | ```sh
124 | POST https://api.escuelajs.co/api/v1/users/is-available
125 |
126 | # Request Body
127 | {
128 | "email": "john@mail.com"
129 | }
130 | ```
131 |
132 | ##### Response
133 |
134 | ```json
135 | {
136 | "isAvailable": false
137 | }
138 | ```
139 |
140 | This endpoint is particularly useful for implementing real-time email validation in registration forms, allowing you to show immediate feedback to users about email availability.
141 |
142 | 
143 |
144 | ## User Schema
145 |
146 | | Attribute | Type | Description |
147 | | --------- | ------ | ------------------------------------------ |
148 | | id | number | Unique identifier for the user |
149 | | name | string | User's full name |
150 | | role | string | User's role (either "customer" or "admin") |
151 | | email | string | User's email address |
152 | | password | string | User's password |
153 | | avatar | string | URL to the user's profile image |
154 |
--------------------------------------------------------------------------------
/src/content/docs/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Platzi Fake Store API
3 | description: A comprehensive REST API for your e-commerce or shopping website prototype.
4 | template: splash
5 | hero:
6 | tagline: The perfect API solution for your e-commerce or shopping website prototype.
7 | image:
8 | file: ../../assets/banner.png
9 | actions:
10 | - text: View Docs
11 | link: /en/about/introduction/
12 | icon: right-arrow
13 | variant: primary
14 | ---
15 |
16 | import { Code } from "astro/components";
17 | import { Card, CardGrid } from "@astrojs/starlight/components";
18 | import CategoriesAPI from "../../components/PreviewAPI/CategoriesAPI.astro";
19 | import ProductsAPI from "../../components/PreviewAPI/ProductsAPI.astro";
20 | import UsersAPI from "../../components/PreviewAPI/UsersAPI.astro";
21 |
22 |
23 | Get Products
24 |
25 |
26 |
27 |
28 |
29 |
30 |
Get Categories
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
Get Users
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | ## Features
49 |
50 |
51 |
52 | Our API supports all CRUD operations (Create, Read, Update, and Delete) with
53 | no limitations, giving you full flexibility for your projects.
54 |
55 |
56 | Implement features like infinite scroll with our built-in pagination support
57 | through 'limit' and 'offset' parameters.
58 |
59 |
60 | Secure your application with JWT for access and refresh tokens, and easily
61 | test protected endpoints with this industry-standard authentication method.
62 |
63 |
64 | Create sophisticated user interfaces by filtering products by price, title,
65 | and category using our comprehensive filtering options.
66 |
67 |
68 | Built on REST API principles, the most widely adopted architectural style in
69 | the industry, ensuring compatibility and ease of use.
70 |
71 |
72 | Take advantage of GraphQL to request exactly the data you need, with a
73 | runtime that executes queries against your existing data.
74 |
75 |
76 | Easily upload files using `multipart/form-data` for a complete e-commerce
77 | experience.
78 |
79 |
80 | Get started quickly with our ready-to-use configuration files for both
81 | Postman and Insomnia, making endpoint testing seamless.
82 |
83 |
84 | Enhance your projects with professionally crafted AI-generated images that
85 | add visual appeal and realism to your prototypes.
86 |
87 |
88 |
--------------------------------------------------------------------------------
/src/content/i18n/en.json:
--------------------------------------------------------------------------------
1 | {
2 | "skipLink.label": "Skip to content",
3 | "search.label": "Search",
4 | "search.shortcutLabel": "(Press / to Search)",
5 | "search.cancelLabel": "Cancel",
6 | "search.devWarning": "Search is only available in production builds. \nTry building and previewing the site to test it out locally.",
7 | "themeSelect.accessibleLabel": "Select theme",
8 | "themeSelect.dark": "Dark",
9 | "themeSelect.light": "Light",
10 | "themeSelect.auto": "Auto",
11 | "languageSelect.accessibleLabel": "Select language",
12 | "menuButton.accessibleLabel": "Menu",
13 | "sidebarNav.accessibleLabel": "Main",
14 | "tableOfContents.onThisPage": "On this page",
15 | "tableOfContents.overview": "Overview",
16 | "i18n.untranslatedContent": "This content is not available in your language yet.",
17 | "page.editLink": "Edit page",
18 | "page.lastUpdated": "Last updated:",
19 | "page.previousLink": "Next",
20 | "page.nextLink": "Previous",
21 | "404.text": "Page not found. Check the URL or try using the search bar."
22 | }
23 |
--------------------------------------------------------------------------------
/src/content/i18n/es.json:
--------------------------------------------------------------------------------
1 | {
2 | "skipLink.label": "Skip to content",
3 | "search.label": "Search",
4 | "search.shortcutLabel": "(Press / to Search)",
5 | "search.cancelLabel": "Cancel",
6 | "search.devWarning": "Search is only available in production builds. \nTry building and previewing the site to test it out locally.",
7 | "themeSelect.accessibleLabel": "Select theme",
8 | "themeSelect.dark": "Dark",
9 | "themeSelect.light": "Light",
10 | "themeSelect.auto": "Auto",
11 | "languageSelect.accessibleLabel": "Select language",
12 | "menuButton.accessibleLabel": "Menu",
13 | "sidebarNav.accessibleLabel": "Main",
14 | "tableOfContents.onThisPage": "On this page",
15 | "tableOfContents.overview": "Overview",
16 | "i18n.untranslatedContent": "This content is not available in your language yet.",
17 | "page.editLink": "Edit page",
18 | "page.lastUpdated": "Last updated:",
19 | "page.previousLink": "Next",
20 | "page.nextLink": "Previous",
21 | "404.text": "Page not found. Check the URL or try using the search bar."
22 | }
23 |
--------------------------------------------------------------------------------
/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
--------------------------------------------------------------------------------
/src/models/category.model.ts:
--------------------------------------------------------------------------------
1 | export interface Category {
2 | id: number;
3 | name: string;
4 | image: string;
5 | }
6 |
--------------------------------------------------------------------------------
/src/models/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./product.model";
2 | export * from "./category.model";
3 | export * from "./user.model";
4 |
--------------------------------------------------------------------------------
/src/models/product.model.ts:
--------------------------------------------------------------------------------
1 | export interface Product {
2 | id: number;
3 | title: string;
4 | images: string[];
5 | price: number;
6 | }
7 |
--------------------------------------------------------------------------------
/src/models/user.model.ts:
--------------------------------------------------------------------------------
1 | export interface User {
2 | id: number;
3 | name: string;
4 | avatar: string;
5 | email: string;
6 | }
7 |
--------------------------------------------------------------------------------
/src/pages/robots.txt.ts:
--------------------------------------------------------------------------------
1 | import type { APIRoute } from "astro";
2 |
3 | const getRobotsTxt = (sitemapURL: URL) => `
4 | User-agent: *
5 | Allow: /
6 |
7 | Sitemap: ${sitemapURL.href}
8 | `;
9 |
10 | export const GET: APIRoute = ({ site }) => {
11 | const sitemapURL = new URL("sitemap-index.xml", site);
12 | return new Response(getRobotsTxt(sitemapURL));
13 | };
14 |
--------------------------------------------------------------------------------
/src/styles/custom.css:
--------------------------------------------------------------------------------
1 | :root {
2 | --sl-font: "IBM Plex Sans", sans-serif;
3 | }
4 | .grid {
5 | display: flex;
6 | flex-direction: column;
7 | }
8 | .grid article img {
9 | max-width: 100%;
10 | }
11 | .grid a img {
12 | max-width: 100%;
13 | }
14 |
15 | @media screen and (min-width: 768px) {
16 | .grid {
17 | display: grid;
18 | grid-gap: 1rem;
19 | }
20 | .grid-5 {
21 | grid-template-columns: repeat(5, 1fr);
22 | }
23 | .grid-3 {
24 | grid-template-columns: repeat(3, 1fr);
25 | }
26 | .grid a,
27 | .grid article {
28 | margin: 0;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "astro/tsconfigs/strict",
3 | "compilerOptions": {
4 | "baseUrl": ".",
5 | "paths": {
6 | "@components/*": ["src/components/*"],
7 | "@models/*": ["src/models/*"]
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/vercel.json:
--------------------------------------------------------------------------------
1 | {
2 | "rewrites": [
3 | {
4 | "source": "/docs",
5 | "destination": "/en/rest/introduction"
6 | },
7 | {
8 | "source": "/docs/:path*",
9 | "destination": "/en/rest/:path*"
10 | },
11 | {
12 | "source": "/doc",
13 | "destination": "/en/rest/introduction"
14 | },
15 | {
16 | "source": "/doc/:path*",
17 | "destination": "/en/rest/:path*"
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------