From 457ca88d7630bfe0a7e7e226d5fb5d9f95cfbbab Mon Sep 17 00:00:00 2001 From: Lars Olzem Date: Tue, 17 Dec 2024 18:29:22 +0100 Subject: [PATCH] Add ageVerificationSlotsAvailable, Improve ageVerificationStatus (#420) * Add ageVerificationSlotsAvailable, Improve ageVerificationStatus * deduplicate schema * Add Group Permissions Enum * add ageVerificationBetaCode, add ageVerificationBetaSlots * Update openapi/components/schemas/AgeVerificationStatus.yaml Co-authored-by: Lars Olzem --------- Co-authored-by: Aries --- .../requests/CreateGroupRoleRequest.yaml | 4 +-- .../requests/UpdateGroupRoleRequest.yaml | 4 +-- .../schemas/AgeVerificationStatus.yaml | 10 +++++++ openapi/components/schemas/CurrentUser.yaml | 2 +- openapi/components/schemas/Group.yaml | 8 ++++++ openapi/components/schemas/GroupMyMember.yaml | 5 +--- .../components/schemas/GroupPermissions.yaml | 27 +++++++++++++++++++ openapi/components/schemas/GroupRole.yaml | 4 +-- openapi/components/schemas/User.yaml | 2 +- 9 files changed, 51 insertions(+), 15 deletions(-) create mode 100644 openapi/components/schemas/AgeVerificationStatus.yaml create mode 100644 openapi/components/schemas/GroupPermissions.yaml diff --git a/openapi/components/requests/CreateGroupRoleRequest.yaml b/openapi/components/requests/CreateGroupRoleRequest.yaml index 8877b22b..eb71ee07 100644 --- a/openapi/components/requests/CreateGroupRoleRequest.yaml +++ b/openapi/components/requests/CreateGroupRoleRequest.yaml @@ -11,8 +11,6 @@ properties: type: boolean default: false permissions: - type: array - items: - type: string + $ref: ../schemas/GroupPermissions.yaml diff --git a/openapi/components/requests/UpdateGroupRoleRequest.yaml b/openapi/components/requests/UpdateGroupRoleRequest.yaml index 0b3cc40f..3ee23118 100644 --- a/openapi/components/requests/UpdateGroupRoleRequest.yaml +++ b/openapi/components/requests/UpdateGroupRoleRequest.yaml @@ -9,8 +9,6 @@ properties: type: boolean default: false permissions: - type: array - items: - type: string + $ref: ../schemas/GroupPermissions.yaml order: type: integer diff --git a/openapi/components/schemas/AgeVerificationStatus.yaml b/openapi/components/schemas/AgeVerificationStatus.yaml new file mode 100644 index 00000000..ad57f7c9 --- /dev/null +++ b/openapi/components/schemas/AgeVerificationStatus.yaml @@ -0,0 +1,10 @@ +title: AgeVerificationStatus +type: string +enum: + - hidden + - verified + - 18+ +x-enum-varnames: + - hidden + - verified + - plus18 \ No newline at end of file diff --git a/openapi/components/schemas/CurrentUser.yaml b/openapi/components/schemas/CurrentUser.yaml index 3d5e6029..e87b4ee7 100644 --- a/openapi/components/schemas/CurrentUser.yaml +++ b/openapi/components/schemas/CurrentUser.yaml @@ -25,7 +25,7 @@ properties: items: $ref: ./UserID.yaml ageVerificationStatus: - type: string + $ref: ./AgeVerificationStatus.yaml ageVerified: type: boolean allowAvatarCopying: diff --git a/openapi/components/schemas/Group.yaml b/openapi/components/schemas/Group.yaml index ae7d325b..058e0fba 100644 --- a/openapi/components/schemas/Group.yaml +++ b/openapi/components/schemas/Group.yaml @@ -1,6 +1,14 @@ title: Group type: object properties: + ageVerificationSlotsAvailable: + type: boolean + ageVerificationBetaCode: + type: string + example: abc1234 + ageVerificationBetaSlots: + type: number + example: 500 badges: type: array items: diff --git a/openapi/components/schemas/GroupMyMember.yaml b/openapi/components/schemas/GroupMyMember.yaml index df26d5a7..bc6b0009 100644 --- a/openapi/components/schemas/GroupMyMember.yaml +++ b/openapi/components/schemas/GroupMyMember.yaml @@ -55,7 +55,4 @@ properties: items: type: string permissions: - type: array - items: - type: string - example: group-instance-join + $ref: ./GroupPermissions.yaml diff --git a/openapi/components/schemas/GroupPermissions.yaml b/openapi/components/schemas/GroupPermissions.yaml new file mode 100644 index 00000000..21242e91 --- /dev/null +++ b/openapi/components/schemas/GroupPermissions.yaml @@ -0,0 +1,27 @@ +type: array +items: + type: string + enum: + - group-announcement-manage + - group-audit-view + - group-bans-manage + - group-data-manage + - group-default-role-manage + - group-galleries-manage + - group-instance-age-gated-create + - group-instance-join + - group-instance-manage + - group-instance-moderate + - group-instance-open-create + - group-instance-plus-create + - group-instance-plus-portal + - group-instance-plus-portal-unlocked + - group-instance-public-create + - group-instance-queue-priority + - group-instance-restricted-create + - group-invites-manage + - group-members-manage + - group-members-remove + - group-members-viewall + - group-roles-assign + - group-roles-manage diff --git a/openapi/components/schemas/GroupRole.yaml b/openapi/components/schemas/GroupRole.yaml index d6d2359b..b798966a 100644 --- a/openapi/components/schemas/GroupRole.yaml +++ b/openapi/components/schemas/GroupRole.yaml @@ -13,9 +13,7 @@ properties: type: boolean default: false permissions: - type: array - items: - type: string + $ref: ./GroupPermissions.yaml isManagementRole: type: boolean default: false diff --git a/openapi/components/schemas/User.yaml b/openapi/components/schemas/User.yaml index c89ae0f2..bc574404 100644 --- a/openapi/components/schemas/User.yaml +++ b/openapi/components/schemas/User.yaml @@ -2,7 +2,7 @@ title: User type: object properties: ageVerificationStatus: - type: string + $ref: ./AgeVerificationStatus.yaml allowAvatarCopying: type: boolean default: true