aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-06-24 22:25:05 +0200
committerRigel Kent <sendmemail@rigelk.eu>2020-06-25 11:14:51 +0200
commitf4d5998127637a21ede6dde90fc2157cf55f224f (patch)
tree6abb4cca9fde9cecc62309ea2b5200fd72cb7ebb
parent6ee722111792a76aa5e1c8d42a28103cafc38e39 (diff)
downloadPeerTube-f4d5998127637a21ede6dde90fc2157cf55f224f.tar.gz
PeerTube-f4d5998127637a21ede6dde90fc2157cf55f224f.tar.zst
PeerTube-f4d5998127637a21ede6dde90fc2157cf55f224f.zip
add notifications to the openapi spec
-rw-r--r--support/doc/api/openapi.yaml309
1 files changed, 296 insertions, 13 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml
index ac44cf91d..0afa58709 100644
--- a/support/doc/api/openapi.yaml
+++ b/support/doc/api/openapi.yaml
@@ -109,6 +109,7 @@ x-tagGroups:
109 - Users 109 - Users
110 - My User 110 - My User
111 - My Subscriptions 111 - My Subscriptions
112 - My Notifications
112 - name: Videos 113 - name: Videos
113 tags: 114 tags:
114 - Video 115 - Video
@@ -362,8 +363,25 @@ paths:
362 get: 363 get:
363 tags: 364 tags:
364 - Instance Follows 365 - Instance Follows
365 summary: List instance followings 366 summary: List instances followed by the server
366 parameters: 367 parameters:
368 - name: state
369 in: query
370 schema:
371 type: string
372 enum:
373 - pending
374 - accepted
375 - name: actorType
376 in: query
377 schema:
378 type: string
379 enum:
380 - Person
381 - Application
382 - Group
383 - Service
384 - Organization
367 - $ref: '#/components/parameters/start' 385 - $ref: '#/components/parameters/start'
368 - $ref: '#/components/parameters/count' 386 - $ref: '#/components/parameters/count'
369 - $ref: '#/components/parameters/sort' 387 - $ref: '#/components/parameters/sort'
@@ -386,11 +404,19 @@ paths:
386 responses: 404 responses:
387 '204': 405 '204':
388 description: successful operation 406 description: successful operation
407 '500':
408 description: cannot follow a non-HTTPS server
389 requestBody: 409 requestBody:
390 content: 410 content:
391 application/json: 411 application/json:
392 schema: 412 schema:
393 $ref: '#/components/schemas/Follow' 413 type: object
414 properties:
415 hosts:
416 type: array
417 items:
418 type: string
419 uniqueItems: true
394 /users: 420 /users:
395 post: 421 post:
396 summary: Create a user 422 summary: Create a user
@@ -700,6 +726,102 @@ paths:
700 responses: 726 responses:
701 '200': 727 '200':
702 description: successful operation 728 description: successful operation
729 /users/me/notifications:
730 get:
731 summary: List my notifications
732 security:
733 - OAuth2: []
734 tags:
735 - My Notifications
736 parameters:
737 - name: unread
738 in: query
739 description: only list unread notifications
740 schema:
741 type: boolean
742 - $ref: '#/components/parameters/start'
743 - $ref: '#/components/parameters/count'
744 - $ref: '#/components/parameters/sort'
745 responses:
746 '200':
747 description: successful operation
748 content:
749 application/json:
750 schema:
751 $ref: '#/components/schemas/NotificationListResponse'
752 /users/me/notifications/read:
753 post:
754 summary: Mark notifications as read by their id
755 security:
756 - OAuth2: []
757 tags:
758 - My Notifications
759 requestBody:
760 content:
761 multipart/form-data:
762 schema:
763 type: object
764 properties:
765 ids:
766 type: array
767 description: ids of the notifications to mark as read
768 items:
769 type: integer
770 required:
771 - ids
772 responses:
773 '204':
774 description: successful operation
775 /users/me/notifications/read-all:
776 post:
777 summary: Mark all my notification as read
778 security:
779 - OAuth2: []
780 tags:
781 - My Notifications
782 responses:
783 '204':
784 description: successful operation
785 /users/me/notification-settings:
786 put:
787 summary: Update my notification settings
788 security:
789 - OAuth2: []
790 tags:
791 - My Notifications
792 requestBody:
793 content:
794 multipart/form-data:
795 schema:
796 type: object
797 properties:
798 newVideoFromSubscription:
799 $ref: '#/components/schemas/NotificationSettingValue'
800 newCommentOnMyVideo:
801 $ref: '#/components/schemas/NotificationSettingValue'
802 videoAbuseAsModerator:
803 $ref: '#/components/schemas/NotificationSettingValue'
804 videoAutoBlacklistAsModerator:
805 $ref: '#/components/schemas/NotificationSettingValue'
806 blacklistOnMyVideo:
807 $ref: '#/components/schemas/NotificationSettingValue'
808 myVideoPublished:
809 $ref: '#/components/schemas/NotificationSettingValue'
810 myVideoImportFinished:
811 $ref: '#/components/schemas/NotificationSettingValue'
812 newFollow:
813 $ref: '#/components/schemas/NotificationSettingValue'
814 newUserRegistration:
815 $ref: '#/components/schemas/NotificationSettingValue'
816 commentMention:
817 $ref: '#/components/schemas/NotificationSettingValue'
818 newInstanceFollower:
819 $ref: '#/components/schemas/NotificationSettingValue'
820 autoInstanceFollowing:
821 $ref: '#/components/schemas/NotificationSettingValue'
822 responses:
823 '204':
824 description: successful operation
703 /users/me/avatar/pick: 825 /users/me/avatar/pick:
704 post: 826 post:
705 summary: Update my user avatar 827 summary: Update my user avatar
@@ -1381,7 +1503,7 @@ paths:
1381 get: 1503 get:
1382 tags: 1504 tags:
1383 - Video Blocks 1505 - Video Blocks
1384 summary: List blocked videos 1506 summary: List video blocks
1385 security: 1507 security:
1386 - OAuth2: 1508 - OAuth2:
1387 - admin 1509 - admin
@@ -2244,12 +2366,12 @@ paths:
2244 - Feeds 2366 - Feeds
2245 summary: List comments on videos 2367 summary: List comments on videos
2246 servers: 2368 servers:
2247 - url: 'https://peertube.cpy.re'
2248 description: Live Test Server (live data - stable version)
2249 - url: 'https://peertube2.cpy.re' 2369 - url: 'https://peertube2.cpy.re'
2250 description: Live Test Server (live data - latest nighlty version) 2370 description: Live Test Server (live data - latest nightly version)
2251 - url: 'https://peertube3.cpy.re' 2371 - url: 'https://peertube3.cpy.re'
2252 description: Live Test Server (live data - latest RC version) 2372 description: Live Test Server (live data - latest RC version)
2373 - url: 'https://peertube.cpy.re'
2374 description: Live Test Server (live data - stable version)
2253 parameters: 2375 parameters:
2254 - name: format 2376 - name: format
2255 in: path 2377 in: path
@@ -2302,12 +2424,12 @@ paths:
2302 - Feeds 2424 - Feeds
2303 summary: List videos 2425 summary: List videos
2304 servers: 2426 servers:
2305 - url: 'https://peertube.cpy.re'
2306 description: Live Test Server (live data - stable version)
2307 - url: 'https://peertube2.cpy.re' 2427 - url: 'https://peertube2.cpy.re'
2308 description: Live Test Server (live data - latest nighlty version) 2428 description: Live Test Server (live data - latest nightly version)
2309 - url: 'https://peertube3.cpy.re' 2429 - url: 'https://peertube3.cpy.re'
2310 description: Live Test Server (live data - latest RC version) 2430 description: Live Test Server (live data - latest RC version)
2431 - url: 'https://peertube.cpy.re'
2432 description: Live Test Server (live data - stable version)
2311 parameters: 2433 parameters:
2312 - name: format 2434 - name: format
2313 in: path 2435 in: path
@@ -2370,12 +2492,12 @@ paths:
2370 '406': 2492 '406':
2371 description: accept header unsupported 2493 description: accept header unsupported
2372servers: 2494servers:
2373 - url: 'https://peertube.cpy.re/api/v1'
2374 description: Live Test Server (live data - stable version)
2375 - url: 'https://peertube2.cpy.re/api/v1' 2495 - url: 'https://peertube2.cpy.re/api/v1'
2376 description: Live Test Server (live data - latest nighlty version) 2496 description: Live Test Server (live data - latest nightly version)
2377 - url: 'https://peertube3.cpy.re/api/v1' 2497 - url: 'https://peertube3.cpy.re/api/v1'
2378 description: Live Test Server (live data - latest RC version) 2498 description: Live Test Server (live data - latest RC version)
2499 - url: 'https://peertube.cpy.re/api/v1'
2500 description: Live Test Server (live data - stable version)
2379components: 2501components:
2380 parameters: 2502 parameters:
2381 start: 2503 start:
@@ -2918,6 +3040,14 @@ components:
2918 properties: 3040 properties:
2919 baseUrl: 3041 baseUrl:
2920 type: string 3042 type: string
3043 VideoInfo:
3044 properties:
3045 id:
3046 type: integer
3047 uuid:
3048 type: string
3049 name:
3050 type: string
2921 Video: 3051 Video:
2922 properties: 3052 properties:
2923 id: 3053 id:
@@ -3196,6 +3326,22 @@ components:
3196 type: string 3326 type: string
3197 updatedAt: 3327 updatedAt:
3198 type: string 3328 type: string
3329 ActorInfo:
3330 properties:
3331 id:
3332 type: integer
3333 name:
3334 type: string
3335 displayName:
3336 type: string
3337 host:
3338 type: string
3339 avatar:
3340 nullable: true
3341 type: object
3342 properties:
3343 path:
3344 type: string
3199 Actor: 3345 Actor:
3200 properties: 3346 properties:
3201 id: 3347 id:
@@ -4049,4 +4195,141 @@ components:
4049 items: 4195 items:
4050 anyOf: 4196 anyOf:
4051 - $ref: '#/components/schemas/MRSSPeerLink' 4197 - $ref: '#/components/schemas/MRSSPeerLink'
4052 - $ref: '#/components/schemas/MRSSGroupContent' \ No newline at end of file 4198 - $ref: '#/components/schemas/MRSSGroupContent'
4199 NotificationSettingValue:
4200 type: integer
4201 description: >
4202 Notification type
4203 - `0` NONE
4204 - `1` WEB
4205 - `2` EMAIL
4206 enum:
4207 - 0
4208 - 1
4209 - 3
4210 Notification:
4211 properties:
4212 id:
4213 type: integer
4214 type:
4215 type: integer
4216 description: >
4217 Notification type, following the `UserNotificationType` enum:
4218 - `1` NEW_VIDEO_FROM_SUBSCRIPTION
4219 - `2` NEW_COMMENT_ON_MY_VIDEO
4220 - `3` NEW_VIDEO_ABUSE_FOR_MODERATORS
4221 - `4` BLACKLIST_ON_MY_VIDEO
4222 - `5` UNBLACKLIST_ON_MY_VIDEO
4223 - `6` MY_VIDEO_PUBLISHED
4224 - `7` MY_VIDEO_IMPORT_SUCCESS
4225 - `8` MY_VIDEO_IMPORT_ERROR
4226 - `9` NEW_USER_REGISTRATION
4227 - `10` NEW_FOLLOW
4228 - `11` COMMENT_MENTION
4229 - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS
4230 - `13` NEW_INSTANCE_FOLLOWER
4231 - `14` AUTO_INSTANCE_FOLLOWING
4232 read:
4233 type: boolean
4234 video:
4235 nullable: true
4236 allOf:
4237 - $ref: '#/components/schemas/VideoInfo'
4238 - type: object
4239 properties:
4240 channel:
4241 $ref: '#/components/schemas/ActorInfo'
4242 videoImport:
4243 nullable: true
4244 type: object
4245 properties:
4246 id:
4247 type: integer
4248 video:
4249 nullable: true
4250 $ref: '#/components/schemas/VideoInfo'
4251 torrentName:
4252 type: string
4253 nullable: true
4254 magnetUri:
4255 type: string
4256 nullable: true
4257 targetUri:
4258 type: string
4259 nullable: true
4260 comment:
4261 nullable: true
4262 type: object
4263 properties:
4264 id:
4265 type: integer
4266 threadId:
4267 type: integer
4268 video:
4269 $ref: '#/components/schemas/VideoInfo'
4270 account:
4271 $ref: '#/components/schemas/ActorInfo'
4272 videoAbuse:
4273 nullable: true
4274 type: object
4275 properties:
4276 id:
4277 type: integer
4278 video:
4279 allOf:
4280 - $ref: '#/components/schemas/VideoInfo'
4281 videoBlacklist:
4282 nullable: true
4283 type: object
4284 properties:
4285 id:
4286 type: integer
4287 video:
4288 allOf:
4289 - $ref: '#/components/schemas/VideoInfo'
4290 account:
4291 nullable: true
4292 allOf:
4293 - $ref: '#/components/schemas/ActorInfo'
4294 actorFollow:
4295 type: object
4296 nullable: true
4297 properties:
4298 id:
4299 type: integer
4300 follower:
4301 $ref: '#/components/schemas/ActorInfo'
4302 state:
4303 type: string
4304 enum:
4305 - pending
4306 - accepted
4307 following:
4308 type: object
4309 properties:
4310 type:
4311 type: string
4312 enum:
4313 - account
4314 - channel
4315 - instance
4316 name:
4317 type: string
4318 displayName:
4319 type: string
4320 host:
4321 type: string
4322 createdAt:
4323 type: string
4324 format: date-time
4325 updatedAt:
4326 type: string
4327 format: date-time
4328 NotificationListResponse:
4329 properties:
4330 total:
4331 type: integer
4332 data:
4333 type: array
4334 items:
4335 $ref: '#/components/schemas/Notification' \ No newline at end of file