-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapi.yml
1366 lines (1366 loc) · 34.9 KB
/
api.yml
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
title: Cakemix Server API
description: Definition of Cakemix Server API
version: 1.4.0
contact:
name: Wonder Wonder
url: 'https://wonder-wonder.xyz'
email: [email protected]
servers:
- url: 'http://localhost:8081/v1'
description: Server URL for localhost development
paths:
/auth/login:
post:
summary: Login and get token
operationId: post-login
responses:
'200':
description: Authentication is success and logged in. Server returns JWT token.
content:
application/json:
schema:
$ref: '#/components/schemas/AuthLoginResModel'
'401':
description: The ID or password is incorrect.
tags:
- Auth
description: Request login with email and password and returns JWT token.
security: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AuthLoginReqModel'
description: Login request.
/auth/logout:
post:
summary: Logout and remove session key
operationId: post-logout
description: Request to logout. Server removes session key.
tags:
- Auth
responses:
'200':
description: Removed session and logout successfully.
'401':
description: Invalid token.
parameters: []
/auth/check/token:
get:
summary: Check token
tags:
- Auth
responses:
'200':
description: Token is valid.
'401':
description: Invalid token.
operationId: get-check-token
description: Checks JWT token is valid.
/auth/regist/gen/token:
get:
summary: Generate new key for registering new user
operationId: get-new-token-regist
tags:
- Auth
description: Request to generate new key for registering new user.
responses:
'200':
description: The request is accepted with no error.
content:
application/json:
schema:
$ref: '#/components/schemas/AuthRegistNewTokenResModel'
'403':
description: The user has not permission to generate token
'/auth/check/user/{user_name}/{token}':
parameters:
- schema:
type: string
name: token
in: path
required: true
- schema:
type: string
name: user_name
in: path
required: true
get:
summary: Check username
tags:
- Auth
responses:
'200':
description: No user
'401':
description: invalid token
'409':
description: username has already taken
operationId: get-auth-check-user-username
description: Check username is not taken by other
security: []
parameters: []
'/auth/regist/pre/{token}':
parameters:
- schema:
type: string
name: token
in: path
required: true
description: Verification token for registration.
post:
summary: Request to register new user
operationId: post-regist
tags:
- Auth
description: Request to register new user. Server sends verification email.
security: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AuthRegistReqModel'
description: Regist information
responses:
'200':
description: The request is accepted with no error.
'409':
description: The username or email is already used. Server cannot accept the request.
get:
summary: ''
operationId: get-auth-regist-pre-token
responses:
'200':
description: token is valid.
'401':
description: Invalid token.
description: Request to verify invitation link
tags:
- Auth
security: []
'/auth/regist/verify/{token}':
parameters:
- schema:
type: string
name: token
in: path
required: true
description: Verification token for registration.
post:
summary: Verify registration verification token
operationId: post-regist-verify
responses:
'200':
description: The token is accepted and user is registered successfully.
'404':
description: The token is invalid or expired.
tags:
- Auth
description: 'Verify registration verification token. After verification, the account is added to user data and activated.'
security: []
/auth/pass/change:
post:
summary: Request to change password
operationId: post-pass-change
responses:
'200':
description: The password is changed successfully.
'401':
description: Invalid token.
'403':
description: Old password is wrong.
tags:
- Auth
description: Request to change password.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AuthPassChangeReqModel'
description: Old and new password.
/auth/pass/reset:
post:
summary: Request to reset password
operationId: post-pass-reset
tags:
- Auth
description: Request to reset password. Server sends verification email.
security: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AuthPassResetReqModel'
description: Email address to reset password.
responses:
'200':
description: The request is accepted.
'400':
description: The request is invalid. (Email is invalid.)
'/auth/pass/reset/verify/{token}':
get:
summary: Check password reset token
tags:
- Auth
responses:
'200':
description: The token is valid.
'401':
description: Invalid token.
operationId: get-pass-reset-verify
description: 'Check verification token to reset password. To change password with token, use POST methods.'
security: []
post:
summary: Reset password
operationId: post-pass-reset-verify
responses:
'200':
description: The request is accepted.
'401':
description: Invalid token.
tags:
- Auth
description: Reset password with new one.
security: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AuthPassChangeReqModel'
description: New password.
parameters:
- schema:
type: string
name: token
in: path
required: true
/auth/session:
get:
summary: Get session list
tags:
- Auth
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/AuthSessionModel'
operationId: get-auth-session
description: Get session list
'/auth/session/{id}':
delete:
summary: Revoke session
operationId: delete-auth-session
responses:
'200':
description: OK
'404':
description: Not Found
tags:
- Auth
description: Revoke session
parameters:
- schema:
type: string
name: id
in: path
required: true
/auth/log:
get:
summary: Get logs
tags:
- Auth
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/AuthLogResModel'
operationId: get-auth-log
parameters:
- schema:
type: string
in: query
name: targetid
description: target team/userUUID
- schema:
type: integer
in: query
name: offset
description: Offset
- schema:
type: integer
in: query
name: limit
description: Limit
- schema:
type: string
in: query
name: type
description: target log type
description: Get log list
'/auth/lock/{uuid}':
get:
summary: Get user lock status
tags:
- Auth
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/AuthLockResModel'
'403':
description: Forbidden
operationId: get-auth-lock
description: Get user lock status
post:
summary: Lock user
operationId: post-auth-lock
responses:
'200':
description: OK
'403':
description: Forbidden
tags:
- Auth
description: Lock user
delete:
summary: Unlock user
operationId: delete-auth-lock
responses:
'200':
description: OK
'403':
description: Forbidden
tags:
- Auth
description: Unlock user
parameters:
- schema:
type: string
name: uuid
in: path
required: true
/team:
post:
summary: Create team
operationId: post-team
responses:
'200':
description: The new team is created successfully.
'401':
description: Invalid token.
'409':
description: The teamname is already used.
tags:
- Team
description: Create new team.
parameters:
- schema:
type: string
in: query
name: name
description: Teamname
required: true
parameters: []
'/team/{teamid}':
parameters:
- schema:
type: string
name: teamid
in: path
required: true
description: Team UUID
delete:
summary: Remove team
operationId: delete-team-teamid
responses:
'200':
description: The team is removed successfully.
'401':
description: Invalid token.
'403':
description: Removing team is not allowed.
'404':
description: The team is not found.
tags:
- Team
description: Remove the team.
'/team/{teamid}/member':
parameters:
- schema:
type: string
name: teamid
in: path
required: true
get:
summary: Get team member list
parameters:
- schema:
type: integer
in: query
name: limit
description: member limit
- schema:
type: integer
in: query
name: offset
description: member offset
- schema:
type: string
in: query
name: uuid
description: uuid
responses:
'200':
description: Got team member list
content:
application/json:
schema:
type: object
description: Member list
properties:
total:
type: integer
members:
type: array
items:
$ref: '#/components/schemas/MemberInfoModel'
'404':
description: The team is not found.
operationId: get-team-teamid-member
description: Get team member list.
tags:
- Team
post:
summary: Add the member into team
operationId: post-team-teamid-member
responses:
'200':
description: Added the member into the team.
'401':
description: Invalid token.
'403':
description: Adding member into the team is not allowed.
'404':
description: The team is not found.
description: Add the member into the team.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/MemberInfoModel'
description: Member info.
tags:
- Team
put:
summary: Modify member info in the team
operationId: put-team-teamid-member
responses:
'200':
description: Modified the member info.
'401':
description: Invalid token.
'403':
description: Modifying member info team is not allowed.
'404':
description: The team is not found.
description: Modify member info in the team.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/MemberInfoModel'
description: Member info.
tags:
- Team
delete:
summary: Remove the member from the team
operationId: delete-team-teamid-member
responses:
'200':
description: Removed the member from the tean.
'401':
description: Invalid token.
'403':
description: Removing member from the team is not allowed.
'404':
description: The team is not found.
description: Remove the member from the team.
parameters:
- schema:
type: string
in: query
name: uuid
description: Removing member UUID
required: true
tags:
- Team
'/profile/{uuid}':
parameters:
- schema:
type: string
name: uuid
in: path
required: true
description: Username or teamname
get:
summary: Get profile
responses:
'200':
description: Got the profile.
content:
application/json:
schema:
$ref: '#/components/schemas/ProfileModel'
'404':
description: The user/team is not found.
operationId: get-user-profile-uuid
tags:
- Profile
description: Get profile for user/team.
put:
summary: Edit profile
operationId: put-user-profile-uuid
responses:
'200':
description: The profile is updated successfully.
'401':
description: Invalid token.
'403':
description: Update of profile is not allowed.
'404':
description: The user/team is not found.
tags:
- Profile
description: Edit profile
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ProfileModel'
description: |-
Updated profile data. The parameters can be omitted if no update.
Some parameter cannot be changed because of readonly.
'/doc/{folder_id}':
parameters:
- schema:
type: string
name: folder_id
in: path
required: true
description: Folder ID
post:
summary: Make a new document
responses:
'200':
description: Create new a document.
content:
application/json:
schema:
$ref: '#/components/schemas/DocumentResModel'
'400':
description: Cannot create new document.
operationId: create-new-doc
tags:
- Document
description: Just create new document and will return document id
'/doc/{doc_id}':
parameters:
- schema:
type: string
name: doc_id
in: path
required: true
description: Document ID
delete:
summary: Delete a document
responses:
'200':
description: Delete the document.
'400':
description: Cannot delete the document.
operationId: delete-doc
tags:
- Document
description: Delete a document
put:
summary: Modify document property
operationId: put-doc-doc_id
responses:
'200':
description: Modified the document property.
'400':
description: Cannot modify the document property.
tags:
- Document
description: Modify document property
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DocumentModifyReqModel'
get:
summary: Get document information
operationId: get-doc-doc_id
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/DocumentModel'
tags:
- Document
description: Get document information
'/doc/{doc_id}/move/{folder_id}':
parameters:
- schema:
type: string
name: doc_id
in: path
description: Document ID
required: true
- schema:
type: string
name: folder_id
in: path
description: Folder ID
required: true
put:
summary: Move document to target folder
responses:
'200':
description: Move document to target folder.
'400':
description: Cannot move document.
operationId: move-doc
tags:
- Document
description: Move document to target folder
'/doc/{doc_id}/copy/{folder_id}':
parameters:
- schema:
type: string
name: doc_id
in: path
required: true
description: Document ID
- schema:
type: string
name: folder_id
in: path
required: true
description: Folder ID
post:
summary: Copy document to target folder
operationId: post-doc-doc_id-copy-folder_id
responses:
'200':
description: Document is duplicated.
content:
application/json:
schema:
$ref: '#/components/schemas/DocumentResModel'
'400':
description: Connot copy the document.
description: Copy document to target folder
tags:
- Document
'/doc/{doc_id}/ws':
parameters:
- schema:
type: string
name: doc_id
in: path
required: true
get:
summary: Open OT session
tags:
- Document
responses:
'101':
description: Switch to web socket protocol
operationId: get-doc-doc_id-ws
description: Open OT session for the document
parameters:
- schema:
type: string
in: query
name: token
description: security token
required: true
security: []
'/folder/{folder_id}':
parameters:
- schema:
type: string
name: folder_id
in: path
required: true
description: Folder ID
get:
summary: Get document and folder list in the target folder
responses:
'200':
description: Move items from target parent.
content:
application/json:
schema:
$ref: '#/components/schemas/FolderListModel'
'404':
description: Not found target folder.
operationId: get-list
tags:
- Folder
parameters:
- schema:
type: string
in: query
name: type
required: true
description: 'type that which list will be returned (all, folder, document)'
description: Get document and folder list in the target folder
post:
summary: Make a new folder
responses:
'200':
description: Create new a folder.
content:
application/json:
schema:
type: object
properties:
folder_id:
type: string
'400':
description: Cannot create new folder.
operationId: create-new-folder
tags:
- Folder
description: Make a new folder
parameters:
- schema:
type: string
in: query
name: name
required: true
description: Folder name
delete:
summary: Delete a folder
responses:
'200':
description: delete the folder.
'400':
description: Cannot delete the folder.
operationId: delete-folder
tags:
- Folder
description: Delete a folder
put:
summary: Modify folder property
responses:
'200':
description: Modified the folder property.
'400':
description: Cannot modify the folder property.
operationId: modify-folder
tags:
- Folder
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/FolderModifyReqModel'
application/javascript:
schema:
type: object
properties: {}
description: Modify folder property
'/folder/{folder_id}/move/{target_folder_id}':
parameters:
- schema:
type: string
name: folder_id
in: path
description: Folder ID
required: true
- schema:
type: string
name: target_folder_id
in: path
description: Target Folder ID
required: true
put:
summary: Move folder to target parent.
responses:
'200':
description: Moved folder to target parent.
'400':
description: Cannot move folder.
operationId: move-folder
tags:
- Folder
description: Move folder to target parent.
/search/team:
get:
summary: Get team list
tags:
- Search
description: Get team list
responses:
'200':
description: Got team list.
content:
application/json:
schema:
type: object
properties:
total:
type: integer
teams:
type: array
items:
$ref: '#/components/schemas/ProfileModel'
operationId: get-search-team
parameters:
- schema:
type: string
in: query
name: q
description: search filter
- schema:
type: integer
in: query
name: limit
description: search limit
- schema:
type: integer
in: query
name: offset
description: search offset
/search/user:
get:
summary: Get user list
tags:
- Search
description: Get user list
responses:
'200':
description: Got user list.
content:
application/json:
schema:
type: object
properties:
total:
type: integer
users:
type: array
items:
$ref: '#/components/schemas/ProfileModel'
operationId: get-search-user
parameters:
- schema:
type: string
in: query
name: q
description: search filter
- schema:
type: integer
in: query
name: limit
description: search limit
- schema:
type: integer
in: query
name: offset
description: search offset
- schema:
type: string
in: query
name: filter
description: search condition filter
/image:
post:
summary: Upload image
operationId: post-image
responses:
'200':
description: Image is uploaded successfully
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: Image ID
tags:
- Image
description: Upload image
requestBody:
content:
multipart/form-data:
schema:
description: ''
type: object
properties:
file:
type: string
format: binary
required:
- file
examples: {}
application/x-www-form-urlencoded:
schema:
type: object
properties: {}
description: ''
'/image/{imgid}':
parameters:
- schema:
type: string
name: imgid
in: path
required: true
description: Image ID
get:
summary: Get uploaded image
tags:
- Image
responses:
'200':
description: Got image
operationId: get-image-imgid
security: []
description: Get uploaded image
components:
schemas:
JWT:
title: JWT
type: object
description: |-
JSON Web Token(JWT) is used for authorization.
Geekers API uses only requred items.
properties:
iss:
type: string
description: Issuer Claim.
example: geekers
sub:
type: string
description: Subject Claim.
example: login
aud:
type: string
description: Audience Claim. It keeps UUID.
example: u123456
exp:
type: integer
description: Expiration Time Claim.
example: 1609426800
nbf:
type: integer
description: Not Before Claim.
iat:
type: integer
description: Issued At Claim.
jti:
type: string
description: JWT ID Claim. It keeps session ID.
example: sessionkey
required:
- aud
- exp
- jti
AuthRegistReqModel:
title: AuthRegistReqModel
type: object
description: Request model for /auth/regist
properties:
email:
type: string
description: Email address
format: email
username:
type: string
description: Username
password:
type: string
description: Password
required: