-
Notifications
You must be signed in to change notification settings - Fork 1
/
endpoints.http
119 lines (91 loc) · 3.53 KB
/
endpoints.http
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@baseUrl = http://localhost:3001/v1
@testEmail = [email protected]
@authToken = Bearer eyJraWQiOiJuak04cjhkVFl1bHowTWxYTmFcL0paaXFVaVwvVU1EUXN1SjNaV3hxNGV1VzQ9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJlZDhmZTQ2Yi04ZmNkLTQxNDctOGZjZC03MjQ4ZTAxYzY0YzciLCJpc3MiOiJodHRwczpcL1wvY29nbml0by1pZHAudXMtd2VzdC0yLmFtYXpvbmF3cy5jb21cL3VzLXdlc3QtMl9ydWNwOU50SGoiLCJjbGllbnRfaWQiOiIzbzBibXQyMHJpcjJ1dTl1YXVsMzZyOWhqaSIsIm9yaWdpbl9qdGkiOiJjZDJhOGEwNC1kNGVhLTQ0YzgtOTZhMi0zZWFlYjQ3ZjY0MjciLCJldmVudF9pZCI6IjE5NDJiNzg0LWEzYmQtNGIzYS1iM2IzLWI4OTk1OTgxODZmOSIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoiYXdzLmNvZ25pdG8uc2lnbmluLnVzZXIuYWRtaW4iLCJhdXRoX3RpbWUiOjE2NTI0NzE4MjYsImV4cCI6MTY1MjQ3NTQyNiwiaWF0IjoxNjUyNDcxODI2LCJqdGkiOiI4ZWM5MDIxZS1lYzZiLTQ3NmYtOWZkOC00NzU2ZGMwYTg2YTgiLCJ1c2VybmFtZSI6ImVkOGZlNDZiLThmY2QtNDE0Ny04ZmNkLTcyNDhlMDFjNjRjNyJ9.h79Gd5Eagrst3sz6UiGjXEzk7m1vG92MeVga4LMB0a4p-y3QFumXrmjF8B5Oln-KO1Kfwzc1YsrXKEGBPDRj7-wgh589EjM5mlwqq48Rjd6x1_MTmxiYtbGZlj2Kx40-RHSAiWCkaswYNocjmoYH_fELnk-MENXqxPm0z9wNe2CrcbYFsDAs72C5QredzXMvD7E-ZiNE9VNnY7rktL7-A0tPCJAy93dDMqRgU5fKbtHdKDeaOh1Ec_mC3QZ_PV8r_GgIcbqsdDLhFp549fTTdP5Ytg_xWUy3w4IX2QSKvMWiHAqrCWNBv3i2Mo34zx2boUbJ3_719PqIDE3JdbqDNQ
## AUTH CALLS
###
POST {{baseUrl}}/login
Content-Type: application/json
{
"username": "{{testEmail}}",
"password": "Test(1234)"
}
###
POST {{baseUrl}}/register
Content-Type: application/json
{
"username": "{{testEmail}}",
"name": "Syler",
"password": "Test(1234)"
}
###
POST {{baseUrl}}/verify
Content-Type: application/json
{
"username": "{{testEmail}}",
"verificationCode": "106029"
}
###
POST {{baseUrl}}/logout
Content-Type: application/json
{
"username": "{{testEmail}}"
}
## ITEM CALLS
### get all items
POST {{baseUrl}}/graphql
Content-Type: application/json
Authorization: {{authToken}}
{
"query": "query {\n items(startDate:\"2022-03-01\", endDate: \"2022-04-01\") {\n item_uuid,\n item_name,\n item_price,\n create_dttm,\n cat_uuid\n }\n}"
}
### create item
POST {{baseUrl}}/graphql
Content-Type: application/json
Authorization: {{authToken}}
{
"query": "mutation {\n createItem(itemCreateInput: {name: \"chocolat cip\", price: 12.80, createDttm: \"2022-03-21T23:45:35.116Z\", catUuid: \"c0a79415-ecc5-40c5-bb9b-dc5ec70f32b6\" }) {\n item_name,\n item_uuid\n }\n}"
}
### edit item
POST {{baseUrl}}/graphql
Content-Type: application/json
Authorization: {{authToken}}
{
"query": "mutation {\n updateItem(itemEditInput: {uuid: \"76369ac4-0ac7-4181-8869-00f16c8c028d\", name: \"chocolate chip\"}) {\n item_name,\n item_uuid\n item_price\n }\n}"
}
## CATEGORY CALLS
### get all categories
POST {{baseUrl}}/graphql
Content-Type: application/json
Authorization: {{authToken}}
{
"query": "query {\n categories {\n cat_uuid,\n cat_name\n }\n}"
}
### create category
POST {{baseUrl}}/graphql
Content-Type: application/json
Authorization: {{authToken}}
{
"query": "mutation {\n createCategory(name:\"test\") {\n cat_uuid\n }\n}"
}
### delete category
POST {{baseUrl}}/graphql
Content-Type: application/json
Authorization: {{authToken}}
{
"query": "mutation {\n deleteCategory(cat_uuid:\"c0a79415-ecc5-40c5-bb9b-dc5ec70f32b6\") {\n cat_uuid\n }\n}"
}
## USER CALLS
### get user
POST {{baseUrl}}/graphql
Content-Type: application/json
Authorization: {{authToken}}
{
"query": "query {\n getUser {\n user_name,\n user_email\n }\n}"
}
### update currency
POST {{baseUrl}}/graphql
Content-Type: application/json
Authorization: {{authToken}}
{
"query": "mutation {\n updateCurrency(currency:\"$ - test\") {\n user_name\n }\n}"
}