diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2021-05-10 12:01:40 +0200 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2021-05-10 12:01:49 +0200 |
commit | fd5586b33748ecdef1d46af2a7d540ba8c8e55df (patch) | |
tree | 2e221d0c22297152e5a11a9597b97e5c794e72a0 /support/doc/api/openapi.yaml | |
parent | 6bd7f0978164d4c74e006619ac016fbbcd049cc9 (diff) | |
download | PeerTube-fd5586b33748ecdef1d46af2a7d540ba8c8e55df.tar.gz PeerTube-fd5586b33748ecdef1d46af2a7d540ba8c8e55df.tar.zst PeerTube-fd5586b33748ecdef1d46af2a7d540ba8c8e55df.zip |
specify getUserId variant in openapi spec
closes #4062
Diffstat (limited to 'support/doc/api/openapi.yaml')
-rw-r--r-- | support/doc/api/openapi.yaml | 122 |
1 files changed, 77 insertions, 45 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index 951d3886f..059434424 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml | |||
@@ -618,13 +618,24 @@ paths: | |||
618 | tags: | 618 | tags: |
619 | - Users | 619 | - Users |
620 | operationId: getUserId | 620 | operationId: getUserId |
621 | parameters: | ||
622 | - name: withStats | ||
623 | in: query | ||
624 | description: include statistics about the user (only available as a moderator/admin) | ||
625 | schema: | ||
626 | type: boolean | ||
621 | responses: | 627 | responses: |
622 | '200': | 628 | '200': |
623 | description: successful operation | 629 | x-summary: successful operation |
630 | description: | | ||
631 | As an admin/moderator, you can request a response augmented with statistics about the user's | ||
632 | moderation relations and videos usage, by using the `withStats` parameter. | ||
624 | content: | 633 | content: |
625 | application/json: | 634 | application/json: |
626 | schema: | 635 | schema: |
627 | $ref: '#/components/schemas/User' | 636 | oneOf: |
637 | - $ref: '#/components/schemas/User' | ||
638 | - $ref: '#/components/schemas/UserWithStats' | ||
628 | put: | 639 | put: |
629 | summary: Update a user | 640 | summary: Update a user |
630 | security: | 641 | security: |
@@ -5566,35 +5577,45 @@ components: | |||
5566 | $ref: '#/components/schemas/Video' | 5577 | $ref: '#/components/schemas/Video' |
5567 | User: | 5578 | User: |
5568 | properties: | 5579 | properties: |
5569 | id: | 5580 | account: |
5570 | type: integer | 5581 | $ref: '#/components/schemas/Account' |
5571 | readOnly: true | 5582 | autoPlayNextVideo: |
5572 | username: | 5583 | type: boolean |
5584 | description: Automatically start playing the upcoming video after the currently playing video | ||
5585 | autoPlayNextVideoPlaylist: | ||
5586 | type: boolean | ||
5587 | description: Automatically start playing the video on the playlist after the currently playing video | ||
5588 | autoPlayVideo: | ||
5589 | type: boolean | ||
5590 | description: Automatically start playing the video on the watch page | ||
5591 | blocked: | ||
5592 | type: boolean | ||
5593 | blockedReason: | ||
5594 | type: string | ||
5595 | createdAt: | ||
5573 | type: string | 5596 | type: string |
5574 | description: The user username | ||
5575 | minLength: 1 | ||
5576 | maxLength: 50 | ||
5577 | email: | 5597 | email: |
5578 | type: string | 5598 | type: string |
5579 | format: email | 5599 | format: email |
5580 | description: The user email | 5600 | description: The user email |
5601 | emailVerified: | ||
5602 | type: boolean | ||
5603 | description: Has the user confirmed their email address? | ||
5604 | id: | ||
5605 | type: integer | ||
5606 | readOnly: true | ||
5581 | pluginAuth: | 5607 | pluginAuth: |
5582 | type: string | 5608 | type: string |
5583 | description: Auth plugin to use to authenticate the user | 5609 | description: Auth plugin to use to authenticate the user |
5584 | theme: | 5610 | lastLoginDate: |
5585 | type: string | 5611 | type: string |
5586 | description: Theme enabled by this user | 5612 | format: date-time |
5587 | emailVerified: | 5613 | noInstanceConfigWarningModal: |
5614 | type: boolean | ||
5615 | noWelcomeModal: | ||
5588 | type: boolean | 5616 | type: boolean |
5589 | description: Has the user confirmed their email address? | ||
5590 | nsfwPolicy: | 5617 | nsfwPolicy: |
5591 | $ref: '#/components/schemas/NSFWPolicy' | 5618 | $ref: '#/components/schemas/NSFWPolicy' |
5592 | webtorrentEnabled: | ||
5593 | type: boolean | ||
5594 | description: Enable P2P in the player | ||
5595 | autoPlayVideo: | ||
5596 | type: boolean | ||
5597 | description: Automatically start playing the video on the watch page | ||
5598 | role: | 5619 | role: |
5599 | $ref: '#/components/schemas/UserRole' | 5620 | $ref: '#/components/schemas/UserRole' |
5600 | roleLabel: | 5621 | roleLabel: |
@@ -5603,38 +5624,49 @@ components: | |||
5603 | - User | 5624 | - User |
5604 | - Moderator | 5625 | - Moderator |
5605 | - Administrator | 5626 | - Administrator |
5606 | videoQuota: | 5627 | theme: |
5607 | type: integer | ||
5608 | description: The user video quota | ||
5609 | videoQuotaDaily: | ||
5610 | type: integer | ||
5611 | description: The user daily video quota | ||
5612 | videosCount: | ||
5613 | type: integer | ||
5614 | abusesCount: | ||
5615 | type: integer | ||
5616 | abusesAcceptedCount: | ||
5617 | type: integer | ||
5618 | abusesCreatedCount: | ||
5619 | type: integer | ||
5620 | videoCommentsCount: | ||
5621 | type: integer | ||
5622 | noInstanceConfigWarningModal: | ||
5623 | type: boolean | ||
5624 | noWelcomeModal: | ||
5625 | type: boolean | ||
5626 | blocked: | ||
5627 | type: boolean | ||
5628 | blockedReason: | ||
5629 | type: string | 5628 | type: string |
5630 | createdAt: | 5629 | description: Theme enabled by this user |
5630 | username: | ||
5631 | type: string | 5631 | type: string |
5632 | account: | 5632 | description: The user username |
5633 | $ref: '#/components/schemas/Account' | 5633 | minLength: 1 |
5634 | maxLength: 50 | ||
5634 | videoChannels: | 5635 | videoChannels: |
5635 | type: array | 5636 | type: array |
5636 | items: | 5637 | items: |
5637 | $ref: '#/components/schemas/VideoChannel' | 5638 | $ref: '#/components/schemas/VideoChannel' |
5639 | videoQuota: | ||
5640 | type: integer | ||
5641 | description: The user video quota in bytes | ||
5642 | example: -1 | ||
5643 | videoQuotaDaily: | ||
5644 | type: integer | ||
5645 | description: The user daily video quota in bytes | ||
5646 | example: -1 | ||
5647 | webtorrentEnabled: | ||
5648 | type: boolean | ||
5649 | description: Enable P2P in the player | ||
5650 | UserWithStats: | ||
5651 | allOf: | ||
5652 | - $ref: '#/components/schemas/User' | ||
5653 | - properties: | ||
5654 | # optionally present fields: they require WITH_STATS scope | ||
5655 | videosCount: | ||
5656 | type: integer | ||
5657 | description: Count of videos published | ||
5658 | abusesCount: | ||
5659 | type: integer | ||
5660 | description: Count of reports/abuses of which the user is a target | ||
5661 | abusesAcceptedCount: | ||
5662 | type: integer | ||
5663 | description: Count of reports/abuses created by the user and accepted/acted upon by the moderation team | ||
5664 | abusesCreatedCount: | ||
5665 | type: integer | ||
5666 | description: Count of reports/abuses created by the user | ||
5667 | videoCommentsCount: | ||
5668 | type: integer | ||
5669 | description: Count of comments published | ||
5638 | AddUser: | 5670 | AddUser: |
5639 | properties: | 5671 | properties: |
5640 | username: | 5672 | username: |