doc bruno
This commit is contained in:
parent
973a1ce431
commit
08c52c332c
25
docs/bruno/Auth/Login.bru
Normal file
25
docs/bruno/Auth/Login.bru
Normal file
@ -0,0 +1,25 @@
|
||||
meta {
|
||||
name: Login
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/auth/login
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"email": "arthur@tipote.dev",
|
||||
"password": "password123"
|
||||
}
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
if (res.status === 201) {
|
||||
bru.setVar("accessToken", res.body.accessToken);
|
||||
bru.setVar("refreshToken", res.body.refreshToken);
|
||||
}
|
||||
}
|
||||
15
docs/bruno/Auth/Me.bru
Normal file
15
docs/bruno/Auth/Me.bru
Normal file
@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Me
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/auth/me
|
||||
body: none
|
||||
auth: bearer
|
||||
}
|
||||
|
||||
auth:bearer {
|
||||
token: {{accessToken}}
|
||||
}
|
||||
24
docs/bruno/Auth/Refresh Token.bru
Normal file
24
docs/bruno/Auth/Refresh Token.bru
Normal file
@ -0,0 +1,24 @@
|
||||
meta {
|
||||
name: Refresh Token
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/auth/refresh
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"refreshToken": "{{refreshToken}}"
|
||||
}
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
if (res.status === 201) {
|
||||
bru.setVar("accessToken", res.body.accessToken);
|
||||
bru.setVar("refreshToken", res.body.refreshToken);
|
||||
}
|
||||
}
|
||||
27
docs/bruno/Auth/Register.bru
Normal file
27
docs/bruno/Auth/Register.bru
Normal file
@ -0,0 +1,27 @@
|
||||
meta {
|
||||
name: Register
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/auth/register
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"email": "arthur@tipote.dev",
|
||||
"password": "password123",
|
||||
"displayName": "Arthur",
|
||||
"homeName": "Maison"
|
||||
}
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
if (res.status === 201) {
|
||||
bru.setVar("accessToken", res.body.accessToken);
|
||||
bru.setVar("refreshToken", res.body.refreshToken);
|
||||
}
|
||||
}
|
||||
15
docs/bruno/Devices/List Devices.bru
Normal file
15
docs/bruno/Devices/List Devices.bru
Normal file
@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: List Devices
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/devices
|
||||
body: none
|
||||
auth: bearer
|
||||
}
|
||||
|
||||
auth:bearer {
|
||||
token: {{accessToken}}
|
||||
}
|
||||
28
docs/bruno/Devices/Register Device.bru
Normal file
28
docs/bruno/Devices/Register Device.bru
Normal file
@ -0,0 +1,28 @@
|
||||
meta {
|
||||
name: Register Device
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/devices
|
||||
body: json
|
||||
auth: bearer
|
||||
}
|
||||
|
||||
auth:bearer {
|
||||
token: {{accessToken}}
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"name": "Ti-Pote Simulator"
|
||||
}
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
if (res.status === 201) {
|
||||
bru.setVar("deviceId", res.body.deviceId);
|
||||
bru.setVar("deviceToken", res.body.token);
|
||||
}
|
||||
}
|
||||
6
docs/bruno/bruno.json
Normal file
6
docs/bruno/bruno.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"version": "1",
|
||||
"name": "Ti-Pote API",
|
||||
"type": "collection",
|
||||
"ignore": ["node_modules", ".git"]
|
||||
}
|
||||
3
docs/bruno/collection.bru
Normal file
3
docs/bruno/collection.bru
Normal file
@ -0,0 +1,3 @@
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
}
|
||||
7
docs/bruno/environments/Local.bru
Normal file
7
docs/bruno/environments/Local.bru
Normal file
@ -0,0 +1,7 @@
|
||||
vars {
|
||||
baseUrl: http://localhost:3000/api
|
||||
accessToken:
|
||||
refreshToken:
|
||||
deviceToken:
|
||||
deviceId:
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user