usman 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/usman/api/v1/docs_controller.rb +52 -22
- data/app/controllers/usman/api/v1/profile_controller.rb +1 -1
- data/app/controllers/usman/api/v1/profile_picture_controller.rb +1 -1
- data/app/views/kuppayam/api/docs/_navigation.html.erb +9 -9
- data/app/views/layouts/kuppayam/_sidebar.html.erb +8 -0
- data/app/views/usman/api/v1/docs/accept_tac/_neg_case_1.html.erb +6 -0
- data/app/views/usman/api/v1/docs/accept_tac/_neg_case_2.html.erb +5 -0
- data/app/views/usman/api/v1/docs/accept_tac/_neg_case_3.html.erb +5 -0
- data/app/views/usman/api/v1/docs/accept_tac/_pos_case_1.html.erb +6 -0
- data/app/views/usman/api/v1/docs/create_profile/_neg_case_1.html.erb +4 -0
- data/app/views/usman/api/v1/docs/create_profile/_neg_case_2.html.erb +4 -0
- data/app/views/usman/api/v1/docs/create_profile/_neg_case_3.html.erb +4 -0
- data/app/views/usman/api/v1/docs/create_profile/_pos_case_1.html.erb +4 -0
- data/app/views/usman/api/v1/docs/{base64_profile_picture → delete_profile_picture}/_neg_case_1.html.erb +4 -0
- data/app/views/usman/api/v1/docs/{destroy_profile_picture → delete_profile_picture}/_neg_case_2.html.erb +4 -0
- data/app/views/usman/api/v1/docs/{destroy_profile_picture → delete_profile_picture}/_pos_case_1.html.erb +4 -0
- data/app/views/usman/api/v1/docs/{profile → get_profile_info}/_neg_case_1.html.erb +4 -8
- data/app/views/usman/api/v1/docs/{profile → get_profile_info}/_neg_case_2.html.erb +4 -1
- data/app/views/usman/api/v1/docs/{profile → get_profile_info}/_pos_case_1.html.erb +4 -1
- data/app/views/usman/api/v1/docs/register/_neg_case_1.html.erb +3 -0
- data/app/views/usman/api/v1/docs/register/_neg_case_2.html.erb +3 -0
- data/app/views/usman/api/v1/docs/register/_neg_case_3.html.erb +3 -0
- data/app/views/usman/api/v1/docs/register/_neg_case_4.html.erb +3 -0
- data/app/views/usman/api/v1/docs/register/_pos_case_1.html.erb +3 -0
- data/app/views/usman/api/v1/docs/register/_pos_case_2.html.erb +3 -0
- data/app/views/usman/api/v1/docs/register/_pos_case_3.html.erb +3 -0
- data/app/views/usman/api/v1/docs/resend_otp/_neg_case_1.html.erb +3 -0
- data/app/views/usman/api/v1/docs/resend_otp/_neg_case_2.html.erb +3 -0
- data/app/views/usman/api/v1/docs/resend_otp/_neg_case_3.html.erb +3 -0
- data/app/views/usman/api/v1/docs/resend_otp/_neg_case_4.html.erb +3 -0
- data/app/views/usman/api/v1/docs/resend_otp/_pos_case_1.html.erb +3 -0
- data/app/views/usman/api/v1/docs/update_profile/_neg_case_1.html.erb +4 -0
- data/app/views/usman/api/v1/docs/update_profile/_neg_case_2.html.erb +4 -0
- data/app/views/usman/api/v1/docs/update_profile/_neg_case_3.html.erb +4 -0
- data/app/views/usman/api/v1/docs/update_profile/_pos_case_1.html.erb +4 -0
- data/app/views/usman/api/v1/docs/{profile_picture → upload_profile_picture}/_neg_case_1.html.erb +7 -1
- data/app/views/usman/api/v1/docs/{base64_profile_picture → upload_profile_picture}/_neg_case_2.html.erb +4 -0
- data/app/views/usman/api/v1/docs/{profile_picture → upload_profile_picture}/_neg_case_3.html.erb +6 -1
- data/app/views/usman/api/v1/docs/{profile_picture → upload_profile_picture}/_pos_case_1.html.erb +7 -1
- data/app/views/usman/api/v1/docs/{destroy_profile_picture → upload_profile_picture_base64}/_neg_case_1.html.erb +7 -1
- data/app/views/usman/api/v1/docs/{profile_picture → upload_profile_picture_base64}/_neg_case_2.html.erb +4 -0
- data/app/views/usman/api/v1/docs/{base64_profile_picture → upload_profile_picture_base64}/_pos_case_1.html.erb +7 -1
- data/app/views/usman/api/v1/docs/verify_otp/_neg_case_1.html.erb +3 -0
- data/app/views/usman/api/v1/docs/verify_otp/_neg_case_2.html.erb +3 -0
- data/app/views/usman/api/v1/docs/verify_otp/_neg_case_3.html.erb +3 -0
- data/app/views/usman/api/v1/docs/verify_otp/_neg_case_4.html.erb +3 -0
- data/app/views/usman/api/v1/docs/verify_otp/_pos_case_1.html.erb +3 -0
- data/app/views/usman/api/v1/docs/verify_otp/_pos_case_2.html.erb +3 -0
- data/config/routes.rb +7 -7
- data/lib/usman/version.rb +1 -1
- metadata +17 -17
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b328d5adedffe89ca1e6f3665b2ada43b96a3a9c
|
|
4
|
+
data.tar.gz: 1c712a7a5f0a5f3f730e8e42ac8e4cfd9838ebd2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b19106c8878d4b6455a8b540524134e75e472eb5f9960cc74ec8804580534ea57fbc7733b2ff93758f6d8baff57fb9fbca9daa2b105cc0a00e8ae28573fc9b5f
|
|
7
|
+
data.tar.gz: 29b01c733ecbd10d70204ca17c9b2975eb54eccc2a59db161c2f48242567b8a20f536e853598d6fa16bafd844c963325b07336de51b61910adc888c4e1522aa5
|
|
@@ -7,7 +7,11 @@ module Usman
|
|
|
7
7
|
set_title("Register API")
|
|
8
8
|
@request_type = "POST"
|
|
9
9
|
@end_point = "/api/v1/register"
|
|
10
|
-
@description =
|
|
10
|
+
@description = <<-eos
|
|
11
|
+
This API will register the user and the device and will send an OTP for verification. <br>
|
|
12
|
+
This API can also be used for user login. <br>
|
|
13
|
+
If the user is already registered, verifying the OTP will get the user logged in (return API token)
|
|
14
|
+
eos
|
|
11
15
|
|
|
12
16
|
@input_headers = {
|
|
13
17
|
"Content-Type" => { value: "application/json", description: "The MIME media type for JSON text is application/json. This is to make sure that a valid json is returned. The default encoding is UTF-8. " }
|
|
@@ -38,7 +42,9 @@ module Usman
|
|
|
38
42
|
set_title("Resend OTP API")
|
|
39
43
|
@request_type = "POST"
|
|
40
44
|
@end_point = "/api/v1/resend_otp"
|
|
41
|
-
@description =
|
|
45
|
+
@description = <<-eos
|
|
46
|
+
This API will resend the OTP for verification
|
|
47
|
+
eos
|
|
42
48
|
|
|
43
49
|
@warning = "A maximum of 3 attempt is allowed for resending the OTP. 6th request will block the device."
|
|
44
50
|
|
|
@@ -64,7 +70,11 @@ module Usman
|
|
|
64
70
|
set_title("Verify OTP API")
|
|
65
71
|
@request_type = "POST"
|
|
66
72
|
@end_point = "/api/v1/verify_otp"
|
|
67
|
-
@description =
|
|
73
|
+
@description = <<-eos
|
|
74
|
+
This API verify the OTP. <br>
|
|
75
|
+
It will return the API token for further communication if the user & device has already been registered. <br>
|
|
76
|
+
If not, API token is returned in the positive response of Accpet T&C API
|
|
77
|
+
eos
|
|
68
78
|
|
|
69
79
|
@input_headers = {
|
|
70
80
|
"Content-Type" => { value: "application/json", description: "The MIME media type for JSON text is application/json. This is to make sure that a valid json is returned. The default encoding is UTF-8. " }
|
|
@@ -89,7 +99,10 @@ module Usman
|
|
|
89
99
|
set_title("Accept T&C API")
|
|
90
100
|
@request_type = "POST"
|
|
91
101
|
@end_point = "/api/v1/accept_tac"
|
|
92
|
-
@description =
|
|
102
|
+
@description = <<-eos
|
|
103
|
+
This API record the acceptance of the terms and condition and will finish the registration of user & device. <br>
|
|
104
|
+
It will return API token which can be used for further communication.
|
|
105
|
+
eos
|
|
93
106
|
|
|
94
107
|
@info = "The user will have to accept terms and conditions everytime he registers a new device"
|
|
95
108
|
|
|
@@ -115,7 +128,9 @@ module Usman
|
|
|
115
128
|
set_title("Create Profile API")
|
|
116
129
|
@request_type = "POST"
|
|
117
130
|
@end_point = "/api/v1/create_profile"
|
|
118
|
-
@description =
|
|
131
|
+
@description = <<-eos
|
|
132
|
+
This API will create a profile for a newly registered user
|
|
133
|
+
eos
|
|
119
134
|
|
|
120
135
|
@input_headers = {
|
|
121
136
|
"Content-Type" => { value: "application/json", description: "The MIME media type for JSON text is application/json. This is to make sure that a valid json is returned. The default encoding is UTF-8. " },
|
|
@@ -140,7 +155,10 @@ module Usman
|
|
|
140
155
|
set_title("Update Profile API")
|
|
141
156
|
@request_type = "POST"
|
|
142
157
|
@end_point = "/api/v1/update_profile"
|
|
143
|
-
@description =
|
|
158
|
+
@description = <<-eos
|
|
159
|
+
This API will update the profile details. <br>
|
|
160
|
+
Note the the user id is not passed but the API token in header.
|
|
161
|
+
eos
|
|
144
162
|
|
|
145
163
|
@input_headers = {
|
|
146
164
|
"Content-Type" => { value: "application/json", description: "The MIME media type for JSON text is application/json. This is to make sure that a valid json is returned. The default encoding is UTF-8. " },
|
|
@@ -161,11 +179,13 @@ module Usman
|
|
|
161
179
|
render 'kuppayam/api/docs/show'
|
|
162
180
|
end
|
|
163
181
|
|
|
164
|
-
def
|
|
165
|
-
set_title("Profile API")
|
|
182
|
+
def get_profile_info
|
|
183
|
+
set_title("Get Profile Info API")
|
|
166
184
|
@request_type = "GET"
|
|
167
|
-
@end_point = "/api/v1/
|
|
168
|
-
@description =
|
|
185
|
+
@end_point = "/api/v1/profile_info"
|
|
186
|
+
@description = <<-eos
|
|
187
|
+
This API will return the details of the profile requested including profile picture urls
|
|
188
|
+
eos
|
|
169
189
|
|
|
170
190
|
@input_headers = {
|
|
171
191
|
"Content-Type" => { value: "application/json", description: "The MIME media type for JSON text is application/json. This is to make sure that a valid json is returned. The default encoding is UTF-8. " },
|
|
@@ -177,16 +197,21 @@ module Usman
|
|
|
177
197
|
@example_path = "usman/api/v1/docs/"
|
|
178
198
|
@examples = ["pos_case_1", "neg_case_1", "neg_case_2"]
|
|
179
199
|
|
|
180
|
-
set_nav("docs/
|
|
200
|
+
set_nav("docs/get_profile_info")
|
|
181
201
|
|
|
182
202
|
render 'kuppayam/api/docs/show'
|
|
183
203
|
end
|
|
184
204
|
|
|
185
|
-
def
|
|
205
|
+
def upload_profile_picture_base64
|
|
186
206
|
set_title("Upload Profile Picture API (base64)")
|
|
187
207
|
@request_type = "POST"
|
|
188
|
-
@end_point = "/api/v1/profile/
|
|
189
|
-
@description =
|
|
208
|
+
@end_point = "/api/v1/profile/profile_picture_base64"
|
|
209
|
+
@description = <<-eos
|
|
210
|
+
This APi will upload an image to a profile and will set it as the profile picture. <br>
|
|
211
|
+
It accept an image embeded in a json with base64 encoding.
|
|
212
|
+
eos
|
|
213
|
+
|
|
214
|
+
@warning = "The image has to be base64 encoded."
|
|
190
215
|
|
|
191
216
|
@input_headers = {
|
|
192
217
|
"Content-Type" => { value: "application/json", description: "The MIME media type for JSON text is application/json. This is to make sure that a valid json is returned. The default encoding is UTF-8. " },
|
|
@@ -198,16 +223,19 @@ module Usman
|
|
|
198
223
|
@example_path = "usman/api/v1/docs/"
|
|
199
224
|
@examples = ["pos_case_1", "neg_case_1", "neg_case_2"]
|
|
200
225
|
|
|
201
|
-
set_nav("docs/
|
|
226
|
+
set_nav("docs/upload_profile_picture_base64")
|
|
202
227
|
|
|
203
228
|
render 'kuppayam/api/docs/show'
|
|
204
229
|
end
|
|
205
230
|
|
|
206
|
-
def
|
|
231
|
+
def upload_profile_picture
|
|
207
232
|
set_title("Upload Profile Picture API")
|
|
208
233
|
@request_type = "POST"
|
|
209
|
-
@end_point = "/api/v1/profile/
|
|
210
|
-
@description =
|
|
234
|
+
@end_point = "/api/v1/profile/upload_profile_picture"
|
|
235
|
+
@description = <<-eos
|
|
236
|
+
This APi will upload an image to a profile and will set it as the profile picture. <br>
|
|
237
|
+
It accept an image in binary format
|
|
238
|
+
eos
|
|
211
239
|
|
|
212
240
|
@input_headers = {
|
|
213
241
|
"Content-Type" => { value: "application/json", description: "The MIME media type for JSON text is application/json. This is to make sure that a valid json is returned. The default encoding is UTF-8. " },
|
|
@@ -224,11 +252,13 @@ module Usman
|
|
|
224
252
|
render 'kuppayam/api/docs/show'
|
|
225
253
|
end
|
|
226
254
|
|
|
227
|
-
def
|
|
255
|
+
def delete_profile_picture
|
|
228
256
|
set_title("Delete Profile Picture API")
|
|
229
257
|
@request_type = "DELETE"
|
|
230
|
-
@end_point = "/api/v1/profile"
|
|
231
|
-
@description =
|
|
258
|
+
@end_point = "/api/v1/profile/profile_picture"
|
|
259
|
+
@description = <<-eos
|
|
260
|
+
This API will delete the profile picture
|
|
261
|
+
eos
|
|
232
262
|
|
|
233
263
|
@input_headers = {
|
|
234
264
|
"Content-Type" => { value: "application/json", description: "The MIME media type for JSON text is application/json. This is to make sure that a valid json is returned. The default encoding is UTF-8. " },
|
|
@@ -240,7 +270,7 @@ module Usman
|
|
|
240
270
|
@example_path = "usman/api/v1/docs/"
|
|
241
271
|
@examples = ["pos_case_1", "neg_case_1", "neg_case_2", "neg_case_3"]
|
|
242
272
|
|
|
243
|
-
set_nav("docs/
|
|
273
|
+
set_nav("docs/delete_profile_picture")
|
|
244
274
|
|
|
245
275
|
render 'kuppayam/api/docs/show'
|
|
246
276
|
end
|
|
@@ -35,26 +35,26 @@
|
|
|
35
35
|
<span class="hidden-xs">Update Profile</span>
|
|
36
36
|
</a>
|
|
37
37
|
</li>
|
|
38
|
-
<li class="<%= nav_active?('docs/
|
|
39
|
-
<a href="/docs/api/v1/
|
|
38
|
+
<li class="<%= nav_active?('docs/get_profile_info') ? 'active' : '' %>">
|
|
39
|
+
<a href="/docs/api/v1/get_profile_info">
|
|
40
40
|
<i class="fa-globe visible-xs"></i>
|
|
41
|
-
<span class="hidden-xs">Profile</span>
|
|
41
|
+
<span class="hidden-xs">Get Profile Info</span>
|
|
42
42
|
</a>
|
|
43
43
|
</li>
|
|
44
|
-
<li class="<%= nav_active?('docs/
|
|
45
|
-
<a href="/docs/api/v1/
|
|
44
|
+
<li class="<%= nav_active?('docs/upload_profile_picture_base64') ? 'active' : '' %>">
|
|
45
|
+
<a href="/docs/api/v1/upload_profile_picture_base64">
|
|
46
46
|
<i class="fa-globe visible-xs"></i>
|
|
47
47
|
<span class="hidden-xs">Upload Profile Picture (Base64)</span>
|
|
48
48
|
</a>
|
|
49
49
|
</li>
|
|
50
|
-
<li class="<%= nav_active?('docs/
|
|
51
|
-
<a href="/docs/api/v1/
|
|
50
|
+
<li class="<%= nav_active?('docs/upload_profile_picture') ? 'active' : '' %>">
|
|
51
|
+
<a href="/docs/api/v1/upload_profile_picture">
|
|
52
52
|
<i class="fa-globe visible-xs"></i>
|
|
53
53
|
<span class="hidden-xs">Upload Profile Picture</span>
|
|
54
54
|
</a>
|
|
55
55
|
</li>
|
|
56
|
-
<li class="<%= nav_active?('docs/
|
|
57
|
-
<a href="/docs/api/v1/
|
|
56
|
+
<li class="<%= nav_active?('docs/delete_profile_picture') ? 'active' : '' %>">
|
|
57
|
+
<a href="/docs/api/v1/delete_profile_picture">
|
|
58
58
|
<i class="fa-globe visible-xs"></i>
|
|
59
59
|
<span class="hidden-xs">Delete Profile Picture</span>
|
|
60
60
|
</a>
|
|
@@ -96,6 +96,14 @@
|
|
|
96
96
|
</li>
|
|
97
97
|
<% end %>
|
|
98
98
|
|
|
99
|
+
<!-- Documentation -->
|
|
100
|
+
<li class="<%= nav_active?('docs/index') ? 'active' : '' %>">
|
|
101
|
+
<a href="/docs/api/v1/register">
|
|
102
|
+
<i class="fa-file-code-o"></i>
|
|
103
|
+
<span class="title">Documentation</span>
|
|
104
|
+
</a>
|
|
105
|
+
</li>
|
|
106
|
+
|
|
99
107
|
</ul>
|
|
100
108
|
|
|
101
109
|
</div>
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
api_title = "Negative Case - 1 - should not accept the terms and conditions if the device is not verified"
|
|
4
4
|
|
|
5
5
|
api_input = <<-eos
|
|
6
|
+
Example:
|
|
7
|
+
|
|
8
|
+
POST #{request.base_url}/api/v1/accept_tac
|
|
9
|
+
|
|
10
|
+
In the request body, pass the following as raw json:
|
|
11
|
+
|
|
6
12
|
{
|
|
7
13
|
"terms_and_conditions": 1,
|
|
8
14
|
"uuid": "<PENDING UUID>",
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
api_title = "Negative Case - 3 - should respond with proper errors if T&C is not accepted"
|
|
4
4
|
|
|
5
5
|
api_input = <<-eos
|
|
6
|
+
Example:
|
|
7
|
+
|
|
8
|
+
POST #{request.base_url}/api/v1/accept_tac
|
|
9
|
+
|
|
10
|
+
In the request body, pass the following as raw json:
|
|
6
11
|
{
|
|
7
12
|
"terms_and_conditions": 0,
|
|
8
13
|
"uuid": "<VERIFIED UUID>",
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
api_title = "Positive Case - 1 - should accept the terms and conditions if the device is verified and all inputs are valid"
|
|
4
4
|
|
|
5
5
|
api_input = <<-eos
|
|
6
|
+
Example:
|
|
7
|
+
|
|
8
|
+
POST #{request.base_url}/api/v1/accept_tac
|
|
9
|
+
|
|
10
|
+
In the request body, pass the following as raw json:
|
|
11
|
+
|
|
6
12
|
{
|
|
7
13
|
"terms_and_conditions": 1,
|
|
8
14
|
"uuid": "<VERIFIED UUID>",
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
api_title = "Negative Case - 2 - should set proper errors if the profile already exists"
|
|
4
4
|
|
|
5
5
|
api_input = <<-eos
|
|
6
|
+
Example:
|
|
7
|
+
|
|
8
|
+
Authorization: Token token="87b01adbba90824b57add8cc06ad8738"
|
|
9
|
+
POST #{request.base_url}/api/v1/create_profile
|
|
6
10
|
{
|
|
7
11
|
"name": "Name",
|
|
8
12
|
"gender": "male",
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
api_title = "Negative Case - 2 - should set proper errors if the profile doesn't exists"
|
|
4
4
|
|
|
5
5
|
api_input = <<-eos
|
|
6
|
+
Example:
|
|
7
|
+
|
|
8
|
+
Authorization: Token token="87b01adbba90824b57add8cc06ad8738"
|
|
9
|
+
DELETE #{request.base_url}/api/v1/profile/profile_picture
|
|
6
10
|
{}
|
|
7
11
|
eos
|
|
8
12
|
|
|
@@ -3,14 +3,10 @@
|
|
|
3
3
|
api_title = "Negative Case - 1 - should set proper errors if api token is not present"
|
|
4
4
|
|
|
5
5
|
api_input = <<-eos
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"email": "name@domain.com",
|
|
11
|
-
"country_id": "1",
|
|
12
|
-
"city_id": "2"
|
|
13
|
-
}
|
|
6
|
+
Example:
|
|
7
|
+
|
|
8
|
+
Authorization: nil
|
|
9
|
+
GET #{request.base_url}/api/v1/profile/profile_picture
|
|
14
10
|
eos
|
|
15
11
|
|
|
16
12
|
api_output = <<-eos
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
api_title = "Negative Case - 2 - should set proper errors if the profile didn't exist"
|
|
4
4
|
|
|
5
5
|
api_input = <<-eos
|
|
6
|
-
|
|
6
|
+
Example:
|
|
7
|
+
|
|
8
|
+
Authorization: Token token="87b01adbba90824b57add8cc06ad8738"
|
|
9
|
+
GET #{request.base_url}/api/v1/profile/profile_picture
|
|
7
10
|
eos
|
|
8
11
|
|
|
9
12
|
api_output = <<-eos
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
api_title = "Positive Case - 1 - should return the profile details along with picture"
|
|
4
4
|
|
|
5
5
|
api_input = <<-eos
|
|
6
|
-
|
|
6
|
+
Example:
|
|
7
|
+
|
|
8
|
+
Authorization: Token token="87b01adbba90824b57add8cc06ad8738"
|
|
9
|
+
GET #{request.base_url}/api/v1/profile/profile_picture
|
|
7
10
|
eos
|
|
8
11
|
|
|
9
12
|
api_output = <<-eos
|
data/app/views/usman/api/v1/docs/{profile_picture → upload_profile_picture}/_neg_case_1.html.erb
RENAMED
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
api_title = "Negative Case - 1 - should set proper errors if no api token"
|
|
4
4
|
|
|
5
5
|
api_input = <<-eos
|
|
6
|
-
|
|
6
|
+
Example:
|
|
7
|
+
|
|
8
|
+
Authorization: nil
|
|
9
|
+
POST #{request.base_url}/api/v1/profile/profile_picture
|
|
10
|
+
{
|
|
11
|
+
"image": "<Uploaded File in Binary Format>"
|
|
12
|
+
}
|
|
7
13
|
eos
|
|
8
14
|
|
|
9
15
|
api_output = <<-eos
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
api_title = "Negative Case - 1 - should respond with proper errors for invalid arguments"
|
|
4
4
|
|
|
5
5
|
api_input = <<-eos
|
|
6
|
+
{}Example:
|
|
7
|
+
|
|
8
|
+
Authorization: Token token="87b01adbba90824b57add8cc06ad8738"
|
|
9
|
+
POST #{request.base_url}/api/v1/profile/profile_picture
|
|
6
10
|
{}
|
|
7
11
|
eos
|
|
8
12
|
|
data/app/views/usman/api/v1/docs/{profile_picture → upload_profile_picture}/_neg_case_3.html.erb
RENAMED
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
api_title = "Negative Case - 2 - should set proper errors if invalid image data is passed"
|
|
4
4
|
|
|
5
5
|
api_input = <<-eos
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
Authorization: Token token="87b01adbba90824b57add8cc06ad8738"
|
|
8
|
+
POST #{request.base_url}/api/v1/profile/profile_picture
|
|
9
|
+
{
|
|
10
|
+
"image": "<Uploaded File - Not Support. e.g: CSV>"
|
|
11
|
+
}
|
|
7
12
|
eos
|
|
8
13
|
|
|
9
14
|
api_output = <<-eos
|
data/app/views/usman/api/v1/docs/{profile_picture → upload_profile_picture}/_pos_case_1.html.erb
RENAMED
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
api_title = "Positive Case - 1 - should upload a profile picture"
|
|
4
4
|
|
|
5
5
|
api_input = <<-eos
|
|
6
|
-
|
|
6
|
+
Example:
|
|
7
|
+
|
|
8
|
+
Authorization: Token token="87b01adbba90824b57add8cc06ad8738"
|
|
9
|
+
POST #{request.base_url}/api/v1/profile/profile_picture
|
|
10
|
+
{
|
|
11
|
+
"image": "<Uploaded File in Binary Format>"
|
|
12
|
+
}
|
|
7
13
|
eos
|
|
8
14
|
|
|
9
15
|
api_output = <<-eos
|
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
api_title = "Negative Case - 1 - should set proper errors if no api token"
|
|
4
4
|
|
|
5
5
|
api_input = <<-eos
|
|
6
|
-
|
|
6
|
+
Example:
|
|
7
|
+
|
|
8
|
+
Authorization: nil
|
|
9
|
+
POST #{request.base_url}/api/v1/profile/profile_picture_base64
|
|
10
|
+
{
|
|
11
|
+
"image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCYAAACNbyblAAAAHElEQVQI12P4//8w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="
|
|
12
|
+
}
|
|
7
13
|
eos
|
|
8
14
|
|
|
9
15
|
api_output = <<-eos
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
api_title = "Negative Case - 1 - should respond with proper errors for invalid arguments"
|
|
4
4
|
|
|
5
5
|
api_input = <<-eos
|
|
6
|
+
Example:
|
|
7
|
+
|
|
8
|
+
Authorization: Token token="87b01adbba90824b57add8cc06ad8738"
|
|
9
|
+
POST #{request.base_url}/api/v1/profile/profile_picture_base64
|
|
6
10
|
{}
|
|
7
11
|
eos
|
|
8
12
|
|
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
api_title = "Positive Case - 1 - should upload a profile picture in base64 format"
|
|
4
4
|
|
|
5
5
|
api_input = <<-eos
|
|
6
|
-
|
|
6
|
+
Example:
|
|
7
|
+
|
|
8
|
+
Authorization: Token token="87b01adbba90824b57add8cc06ad8738"
|
|
9
|
+
POST #{request.base_url}/api/v1/profile/profile_picture_base64
|
|
10
|
+
{
|
|
11
|
+
"image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCYAAACNbyblAAAAHElEQVQI12P4//8w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="
|
|
12
|
+
}
|
|
7
13
|
eos
|
|
8
14
|
|
|
9
15
|
api_output = <<-eos
|
data/config/routes.rb
CHANGED
|
@@ -54,11 +54,11 @@ Usman::Engine.routes.draw do
|
|
|
54
54
|
|
|
55
55
|
# Profile
|
|
56
56
|
post :create_profile, :controller => "profile"
|
|
57
|
-
|
|
58
|
-
get :
|
|
57
|
+
put :update_profile, :controller => "profile"
|
|
58
|
+
get :profile_info, :controller => "profile"
|
|
59
59
|
|
|
60
60
|
# Profile Picture
|
|
61
|
-
post 'profile/
|
|
61
|
+
post 'profile/profile_picture_base64', :controller => "profile_picture", action: :profile_picture_base64
|
|
62
62
|
post 'profile/profile_picture', :controller => "profile_picture", action: :profile_picture
|
|
63
63
|
delete 'profile/profile_picture', :controller => "profile_picture", action: :destroy_profile_picture
|
|
64
64
|
end
|
|
@@ -75,11 +75,11 @@ Usman::Engine.routes.draw do
|
|
|
75
75
|
get 'create_profile', :controller => "docs"
|
|
76
76
|
get 'update_profile', :controller => "docs"
|
|
77
77
|
get 'update_profile', :controller => "docs"
|
|
78
|
-
get '
|
|
78
|
+
get 'get_profile_info', :controller => "docs"
|
|
79
79
|
|
|
80
|
-
get '
|
|
81
|
-
get '
|
|
82
|
-
get '
|
|
80
|
+
get 'upload_profile_picture_base64', :controller => "docs"
|
|
81
|
+
get 'upload_profile_picture', :controller => "docs"
|
|
82
|
+
get 'delete_profile_picture', :controller => "docs"
|
|
83
83
|
end
|
|
84
84
|
end
|
|
85
85
|
end
|
data/lib/usman/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: usman
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- kpvarma
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-09-
|
|
11
|
+
date: 2017-09-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -127,7 +127,7 @@ dependencies:
|
|
|
127
127
|
version: '0.1'
|
|
128
128
|
- - ">="
|
|
129
129
|
- !ruby/object:Gem::Version
|
|
130
|
-
version: 0.1.
|
|
130
|
+
version: 0.1.9
|
|
131
131
|
type: :runtime
|
|
132
132
|
prerelease: false
|
|
133
133
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -137,7 +137,7 @@ dependencies:
|
|
|
137
137
|
version: '0.1'
|
|
138
138
|
- - ">="
|
|
139
139
|
- !ruby/object:Gem::Version
|
|
140
|
-
version: 0.1.
|
|
140
|
+
version: 0.1.9
|
|
141
141
|
- !ruby/object:Gem::Dependency
|
|
142
142
|
name: bcrypt
|
|
143
143
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -420,23 +420,16 @@ files:
|
|
|
420
420
|
- app/views/usman/api/v1/docs/accept_tac/_neg_case_2.html.erb
|
|
421
421
|
- app/views/usman/api/v1/docs/accept_tac/_neg_case_3.html.erb
|
|
422
422
|
- app/views/usman/api/v1/docs/accept_tac/_pos_case_1.html.erb
|
|
423
|
-
- app/views/usman/api/v1/docs/base64_profile_picture/_neg_case_1.html.erb
|
|
424
|
-
- app/views/usman/api/v1/docs/base64_profile_picture/_neg_case_2.html.erb
|
|
425
|
-
- app/views/usman/api/v1/docs/base64_profile_picture/_pos_case_1.html.erb
|
|
426
423
|
- app/views/usman/api/v1/docs/create_profile/_neg_case_1.html.erb
|
|
427
424
|
- app/views/usman/api/v1/docs/create_profile/_neg_case_2.html.erb
|
|
428
425
|
- app/views/usman/api/v1/docs/create_profile/_neg_case_3.html.erb
|
|
429
426
|
- app/views/usman/api/v1/docs/create_profile/_pos_case_1.html.erb
|
|
430
|
-
- app/views/usman/api/v1/docs/
|
|
431
|
-
- app/views/usman/api/v1/docs/
|
|
432
|
-
- app/views/usman/api/v1/docs/
|
|
433
|
-
- app/views/usman/api/v1/docs/
|
|
434
|
-
- app/views/usman/api/v1/docs/
|
|
435
|
-
- app/views/usman/api/v1/docs/
|
|
436
|
-
- app/views/usman/api/v1/docs/profile_picture/_neg_case_1.html.erb
|
|
437
|
-
- app/views/usman/api/v1/docs/profile_picture/_neg_case_2.html.erb
|
|
438
|
-
- app/views/usman/api/v1/docs/profile_picture/_neg_case_3.html.erb
|
|
439
|
-
- app/views/usman/api/v1/docs/profile_picture/_pos_case_1.html.erb
|
|
427
|
+
- app/views/usman/api/v1/docs/delete_profile_picture/_neg_case_1.html.erb
|
|
428
|
+
- app/views/usman/api/v1/docs/delete_profile_picture/_neg_case_2.html.erb
|
|
429
|
+
- app/views/usman/api/v1/docs/delete_profile_picture/_pos_case_1.html.erb
|
|
430
|
+
- app/views/usman/api/v1/docs/get_profile_info/_neg_case_1.html.erb
|
|
431
|
+
- app/views/usman/api/v1/docs/get_profile_info/_neg_case_2.html.erb
|
|
432
|
+
- app/views/usman/api/v1/docs/get_profile_info/_pos_case_1.html.erb
|
|
440
433
|
- app/views/usman/api/v1/docs/register/_neg_case_1.html.erb
|
|
441
434
|
- app/views/usman/api/v1/docs/register/_neg_case_2.html.erb
|
|
442
435
|
- app/views/usman/api/v1/docs/register/_neg_case_3.html.erb
|
|
@@ -453,6 +446,13 @@ files:
|
|
|
453
446
|
- app/views/usman/api/v1/docs/update_profile/_neg_case_2.html.erb
|
|
454
447
|
- app/views/usman/api/v1/docs/update_profile/_neg_case_3.html.erb
|
|
455
448
|
- app/views/usman/api/v1/docs/update_profile/_pos_case_1.html.erb
|
|
449
|
+
- app/views/usman/api/v1/docs/upload_profile_picture/_neg_case_1.html.erb
|
|
450
|
+
- app/views/usman/api/v1/docs/upload_profile_picture/_neg_case_2.html.erb
|
|
451
|
+
- app/views/usman/api/v1/docs/upload_profile_picture/_neg_case_3.html.erb
|
|
452
|
+
- app/views/usman/api/v1/docs/upload_profile_picture/_pos_case_1.html.erb
|
|
453
|
+
- app/views/usman/api/v1/docs/upload_profile_picture_base64/_neg_case_1.html.erb
|
|
454
|
+
- app/views/usman/api/v1/docs/upload_profile_picture_base64/_neg_case_2.html.erb
|
|
455
|
+
- app/views/usman/api/v1/docs/upload_profile_picture_base64/_pos_case_1.html.erb
|
|
456
456
|
- app/views/usman/api/v1/docs/verify_otp/_neg_case_1.html.erb
|
|
457
457
|
- app/views/usman/api/v1/docs/verify_otp/_neg_case_2.html.erb
|
|
458
458
|
- app/views/usman/api/v1/docs/verify_otp/_neg_case_3.html.erb
|