|
| 1 | +{ |
| 2 | + "info": { |
| 3 | + "_postman_id": "537f31f6-9cc8-4f30-93e9-7252cf66b172", |
| 4 | + "name": "Fastify Prisma", |
| 5 | + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", |
| 6 | + "_exporter_id": "29865378" |
| 7 | + }, |
| 8 | + "item": [ |
| 9 | + { |
| 10 | + "name": "Customer", |
| 11 | + "item": [ |
| 12 | + { |
| 13 | + "name": "Create customer", |
| 14 | + "event": [ |
| 15 | + { |
| 16 | + "listen": "prerequest", |
| 17 | + "script": { |
| 18 | + "exec": [ |
| 19 | + "let firstName = pm.variables.replaceIn(\"{{$randomFirstName}}\")", |
| 20 | + "let lastName = pm.variables.replaceIn(\"{{$randomFirstName}}\")", |
| 21 | + "", |
| 22 | + "pm.environment.set(\"name\", `${firstName} ${lastName}`)", |
| 23 | + "pm.environment.set(\"password\", pm.variables.replaceIn('{{$randomPassword}}'))", |
| 24 | + "pm.environment.set(\"email\", `${firstName.toLowerCase()}.${lastName.toLowerCase()}@example.com`)", |
| 25 | + "" |
| 26 | + ], |
| 27 | + "type": "text/javascript" |
| 28 | + } |
| 29 | + } |
| 30 | + ], |
| 31 | + "request": { |
| 32 | + "method": "POST", |
| 33 | + "header": [], |
| 34 | + "body": { |
| 35 | + "mode": "raw", |
| 36 | + "raw": "{\n \"email\": \"{{email}}\",\n \"name\": \"{{name}}\",\n \"password\": \"{{password}}\"\n}", |
| 37 | + "options": { |
| 38 | + "raw": { |
| 39 | + "language": "json" |
| 40 | + } |
| 41 | + } |
| 42 | + }, |
| 43 | + "url": { |
| 44 | + "raw": "{{host}}/api/customers", |
| 45 | + "host": ["{{host}}"], |
| 46 | + "path": ["api", "customers"] |
| 47 | + } |
| 48 | + }, |
| 49 | + "response": [] |
| 50 | + }, |
| 51 | + { |
| 52 | + "name": "Get customers", |
| 53 | + "request": { |
| 54 | + "auth": { |
| 55 | + "type": "bearer", |
| 56 | + "bearer": [ |
| 57 | + { |
| 58 | + "key": "token", |
| 59 | + "value": "{{accessToken}}", |
| 60 | + "type": "string" |
| 61 | + } |
| 62 | + ] |
| 63 | + }, |
| 64 | + "method": "GET", |
| 65 | + "header": [], |
| 66 | + "url": { |
| 67 | + "raw": "{{host}}/api/customers", |
| 68 | + "host": ["{{host}}"], |
| 69 | + "path": ["api", "customers"] |
| 70 | + } |
| 71 | + }, |
| 72 | + "response": [] |
| 73 | + }, |
| 74 | + { |
| 75 | + "name": "Customer Login", |
| 76 | + "event": [ |
| 77 | + { |
| 78 | + "listen": "test", |
| 79 | + "script": { |
| 80 | + "exec": [ |
| 81 | + "var jsonData = JSON.parse(responseBody);", |
| 82 | + "postman.setEnvironmentVariable(\"accessToken\", jsonData.accessToken)" |
| 83 | + ], |
| 84 | + "type": "text/javascript" |
| 85 | + } |
| 86 | + } |
| 87 | + ], |
| 88 | + "request": { |
| 89 | + "method": "POST", |
| 90 | + "header": [], |
| 91 | + "body": { |
| 92 | + "mode": "raw", |
| 93 | + "raw": "{\n \"email\": \"{{email}}\",\n \"password\": \"{{password}}\"\n}", |
| 94 | + "options": { |
| 95 | + "raw": { |
| 96 | + "language": "json" |
| 97 | + } |
| 98 | + } |
| 99 | + }, |
| 100 | + "url": { |
| 101 | + "raw": "{{host}}/api/customers/login", |
| 102 | + "host": ["{{host}}"], |
| 103 | + "path": ["api", "customers", "login"] |
| 104 | + } |
| 105 | + }, |
| 106 | + "response": [] |
| 107 | + } |
| 108 | + ] |
| 109 | + }, |
| 110 | + { |
| 111 | + "name": "Product", |
| 112 | + "item": [ |
| 113 | + { |
| 114 | + "name": "Create product", |
| 115 | + "event": [ |
| 116 | + { |
| 117 | + "listen": "prerequest", |
| 118 | + "script": { |
| 119 | + "exec": [""], |
| 120 | + "type": "text/javascript" |
| 121 | + } |
| 122 | + } |
| 123 | + ], |
| 124 | + "request": { |
| 125 | + "auth": { |
| 126 | + "type": "bearer", |
| 127 | + "bearer": [ |
| 128 | + { |
| 129 | + "key": "token", |
| 130 | + "value": "{{accessToken}}", |
| 131 | + "type": "string" |
| 132 | + } |
| 133 | + ] |
| 134 | + }, |
| 135 | + "method": "POST", |
| 136 | + "header": [], |
| 137 | + "body": { |
| 138 | + "mode": "raw", |
| 139 | + "raw": "{\n \"title\": \"A cool product\",\n \"price\": 14.99,\n \"content\": \"This is actually an sick product\"\n}", |
| 140 | + "options": { |
| 141 | + "raw": { |
| 142 | + "language": "json" |
| 143 | + } |
| 144 | + } |
| 145 | + }, |
| 146 | + "url": { |
| 147 | + "raw": "{{host}}/api/products", |
| 148 | + "host": ["{{host}}"], |
| 149 | + "path": ["api", "products"] |
| 150 | + } |
| 151 | + }, |
| 152 | + "response": [] |
| 153 | + }, |
| 154 | + { |
| 155 | + "name": "Get products", |
| 156 | + "request": { |
| 157 | + "auth": { |
| 158 | + "type": "bearer", |
| 159 | + "bearer": [ |
| 160 | + { |
| 161 | + "key": "token", |
| 162 | + "value": "{{accessToken}}", |
| 163 | + "type": "string" |
| 164 | + } |
| 165 | + ] |
| 166 | + }, |
| 167 | + "method": "GET", |
| 168 | + "header": [], |
| 169 | + "url": { |
| 170 | + "raw": "{{host}}/api/products", |
| 171 | + "host": ["{{host}}"], |
| 172 | + "path": ["api", "products"] |
| 173 | + } |
| 174 | + }, |
| 175 | + "response": [] |
| 176 | + } |
| 177 | + ] |
| 178 | + }, |
| 179 | + { |
| 180 | + "name": "Healthcheck", |
| 181 | + "item": [ |
| 182 | + { |
| 183 | + "name": "App healthcheck", |
| 184 | + "request": { |
| 185 | + "method": "GET", |
| 186 | + "header": [], |
| 187 | + "url": { |
| 188 | + "raw": "{{host}}/healthcheck", |
| 189 | + "host": ["{{host}}"], |
| 190 | + "path": ["healthcheck"] |
| 191 | + } |
| 192 | + }, |
| 193 | + "response": [] |
| 194 | + } |
| 195 | + ] |
| 196 | + } |
| 197 | + ] |
| 198 | +} |
0 commit comments