{"info":{"_postman_id":"201db8d3-035f-4afa-801a-38674a954975","name":"bun-hono-ts-mongodb","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"32438779","collectionId":"201db8d3-035f-4afa-801a-38674a954975","publishedId":"2sA3QzYTbM","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-06-05T05:59:43.000Z"},"item":[{"name":"signup","event":[{"listen":"test","script":{"id":"fb6f0f4b-515a-4791-96fa-d06116862c18","exec":["// Update the request documentation to include the request URL and response as a JSON schema\r","pm.test(\"Status code is 201\", function () {\r","    pm.response.to.have.status(201);\r","});\r","\r","pm.test(\"Response is a JSON object with message and user properties\", function () {\r","    pm.expect(pm.response.json()).to.be.an('object').that.has.all.keys('message', 'user');\r","});\r","\r","// JSON schema for the response\r","pm.test(\"Response has a message property of type string\", function () {\r","    pm.expect(pm.response.json().message).to.be.a('string');\r","});\r","\r","pm.test(\"User object has specific properties\", function () {\r","    var user = pm.response.json().user;\r","    pm.expect(user).to.be.an('object').that.has.all.keys('_id', 'name', 'userName', 'email', 'createdAt', 'updatedAt', '__v');\r","    pm.expect(user._id).to.be.a('string');\r","    pm.expect(user.name).to.be.a('string');\r","    pm.expect(user.userName).to.be.a('string');\r","    pm.expect(user.email).to.be.a('string');\r","    pm.expect(user.createdAt).to.be.a('string');\r","    pm.expect(user.updatedAt).to.be.a('string');\r","    pm.expect(user.__v).to.be.a('number');\r","});\r",""],"type":"text/javascript","packages":{}}}],"id":"0ee95288-fca4-4726-a105-ad878acf45ad","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"userName\":\"Nitish\",\r\n    \"email\":\"Nitish@email.com\",\r\n    \"password\":\"password\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/auth/signup","description":"<p>The endpoint allows users to sign up by sending a POST request to the specified URL. The request should include the user's name, username, email, and password in the request body.</p>\n<h3 id=\"request-body\">Request Body</h3>\n<ul>\n<li><p>name (string, required): The name of the user.</p>\n</li>\n<li><p>userName (string, required): The username chosen by the user.</p>\n</li>\n<li><p>email (string, required): The email address of the user.</p>\n</li>\n<li><p>password (string, required): The password chosen by the user.</p>\n</li>\n</ul>\n<h3 id=\"response\">Response</h3>\n<p>The response to the request is in JSON format and includes the following schema:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"object\",\n    \"properties\": {\n        \"message\": {\n            \"type\": \"string\"\n        }\n    }\n}\n\n</code></pre>\n<p>The response status code is 409, indicating a conflict due to a duplicate entry or a violation of unique constraint.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","auth","signup"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"0ee95288-fca4-4726-a105-ad878acf45ad"},{"name":"signin","id":"01075d1b-b86c-42c8-88ac-435249b41e9f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    // \"userName\":\"Nitish\",\r\n    \"email\":\"Nitish@email.com\",\r\n    \"password\":\"password\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/auth/signin","description":"<p>This endpoint allows users to sign in with their credentials. The request should be sent as an HTTP POST to <a href=\"http://localhost:3000/api/v1/auth/signin\">http://localhost:3000/api/v1/auth/signin</a> with the user's email and password provided in the request body.</p>\n<h3 id=\"request-body\">Request Body</h3>\n<ul>\n<li><p>email (string, required): The email of the user.</p>\n</li>\n<li><p>password (string, required): The password of the user.</p>\n</li>\n</ul>\n<h3 id=\"response\">Response</h3>\n<p>The response will be in JSON format with the following schema:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"object\",\n    \"properties\": {\n        \"message\": {\n            \"type\": \"string\"\n        },\n        \"accessToken\": {\n            \"type\": \"string\"\n        }\n    }\n}\n\n</code></pre>\n<p>The response will have a status code of 200 and a content type of application/json. The response will include a message, which may contain additional information, and an accessToken, which can be used for further authenticated requests.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","auth","signin"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"01075d1b-b86c-42c8-88ac-435249b41e9f"},{"name":"signin Copy","id":"b0316d6f-6453-459c-8797-7e952bbab0a4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":"{\r\n    // \"userName\":\"Nitish\",\r\n    \"email\":\"Nitish@email.com\",\r\n    \"password\":\"password\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/user/profile","description":"<p>This endpoint allows users to sign in with their credentials. The request should be sent as an HTTP POST to <a href=\"http://localhost:3000/api/v1/auth/signin\">http://localhost:3000/api/v1/auth/signin</a> with the user's email and password provided in the request body.</p>\n<h3 id=\"request-body\">Request Body</h3>\n<ul>\n<li><p>email (string, required): The email of the user.</p>\n</li>\n<li><p>password (string, required): The password of the user.</p>\n</li>\n</ul>\n<h3 id=\"response\">Response</h3>\n<p>The response will be in JSON format with the following schema:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"object\",\n    \"properties\": {\n        \"message\": {\n            \"type\": \"string\"\n        },\n        \"accessToken\": {\n            \"type\": \"string\"\n        }\n    }\n}\n\n</code></pre>\n<p>The response will have a status code of 200 and a content type of application/json. The response will include a message, which may contain additional information, and an accessToken, which can be used for further authenticated requests.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","user","profile"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"b0316d6f-6453-459c-8797-7e952bbab0a4"},{"name":"signout","id":"45dd5e4e-a516-43f0-a98a-c5f54b41dbef","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"http://localhost:3000/api/v1/auth/signout","description":"<h3 id=\"sign-out\">Sign Out</h3>\n<p>This endpoint is used to sign out the user from the application.</p>\n<h4 id=\"response\">Response</h4>\n<p>The response for this request is a JSON object with the following schema:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"object\",\n    \"properties\": {\n        \"message\": {\n            \"type\": \"string\"\n        }\n    }\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","auth","signout"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"45dd5e4e-a516-43f0-a98a-c5f54b41dbef"},{"name":"refreshToken","id":"5f9bec09-c878-4c3c-8471-7013e1e943f8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"refreshToken\":\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NjVmZmMzMzNkYjE1NGIzNDBiYzM5MzUifQ.TYw3BIeHG63ED_OcgCM8BEqvJL9pYlbJCkyLjvSPlvU\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/auth/refreshToken","urlObject":{"protocol":"http","port":"3000","path":["api","v1","auth","refreshToken"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"5f9bec09-c878-4c3c-8471-7013e1e943f8"}]}