From 12971f54d71f70c1c7f0f3ec99cf92e7b3324112 Mon Sep 17 00:00:00 2001 From: Manan Date: Fri, 4 Oct 2024 03:26:54 -0700 Subject: [PATCH] feat: GET /member/invite/list --- src/v2/spec.yaml | 134 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 107 insertions(+), 27 deletions(-) diff --git a/src/v2/spec.yaml b/src/v2/spec.yaml index 29d64d9..701274e 100644 --- a/src/v2/spec.yaml +++ b/src/v2/spec.yaml @@ -1854,6 +1854,22 @@ components: $ref: "#/components/schemas/Channel" next: $ref: "#/components/schemas/NextCursor" + ChannelMemberInvite: + type: object + required: + - channel_id + - role + - inviter + - invited + properties: + channel_id: + $ref: "#/components/schemas/ChannelId" + role: + $ref: "#/components/schemas/ChannelMemberRole" + inviter: + $ref: "#/components/schemas/User" + invited: + $ref: "#/components/schemas/User" ChannelMember: type: object required: @@ -1878,6 +1894,17 @@ components: $ref: "#/components/schemas/ChannelMember" next: $ref: "#/components/schemas/NextCursor" + ChannelMemberInviteListResponse: + type: object + required: + - invites + properties: + invites: + type: array + items: + $ref: "#/components/schemas/ChannelMemberInvite" + next: + $ref: "#/components/schemas/NextCursor" ChannelSearchResponse: type: object required: @@ -5925,13 +5952,13 @@ paths: application/json: schema: $ref: "#/components/schemas/ChannelListResponse" - /farcaster/channel/member/invite: - post: + /farcaster/channel/member: + delete: tags: - Channel - summary: Invite a user to a channel - description: Invite a user to a channel - operationId: invite-channel-member + summary: Remove a user from a channel + description: Remove a user from a channel or a user's invite to a channel role + operationId: remove-channel-member parameters: - $ref: "#/components/parameters/ApiKey" requestBody: @@ -5965,12 +5992,61 @@ paths: $ref: "#/components/responses/400Response" "500": $ref: "#/components/responses/500Response" - put: + /farcaster/channel/member/list: + get: tags: - Channel - summary: Accept or reject a channel invite - description: Accept or reject a channel invite - operationId: respond-channel-invite + summary: Retrieve a list of members in a channel + description: Retrieve a list of members in a channel + operationId: list-channel-members + parameters: + - $ref: "#/components/parameters/ApiKey" + - name: channel_id + in: query + required: true + schema: + $ref: "#/components/schemas/ChannelId" + example: "neynar" + description: Channel ID for the channel being queried + - name: fid + in: query + schema: + $ref: "#/components/schemas/Fid" + example: 194 + description: FID of the user being queried. Specify this to check if a user is a member of the channel without paginating through all members. + - name: limit + in: query + description: Number of results to retrieve + required: false + schema: + type: integer + default: 20 + minimum: 1 + maximum: 100 + - name: cursor + in: query + description: Pagination cursor. + required: false + schema: + type: string + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: "#/components/schemas/ChannelMemberListResponse" + "500": + $ref: "#/components/responses/500Response" + "400": + $ref: "#/components/responses/400Response" + /farcaster/channel/member/invite: + post: + tags: + - Channel + summary: Invite a user to a channel + description: Invite a user to a channel + operationId: invite-channel-member parameters: - $ref: "#/components/parameters/ApiKey" requestBody: @@ -5982,18 +6058,17 @@ paths: required: - signer_uuid - channel_id + - fid - role - - accept properties: signer_uuid: $ref: "#/components/schemas/SignerUUID" channel_id: $ref: "#/components/schemas/ChannelId" + fid: + $ref: "#/components/schemas/Fid" role: $ref: "#/components/schemas/ChannelMemberRole" - accept: - type: boolean - description: Accept or reject the invite responses: "200": description: Successful operation. @@ -6005,13 +6080,12 @@ paths: $ref: "#/components/responses/400Response" "500": $ref: "#/components/responses/500Response" - /farcaster/channel/member: - delete: + put: tags: - Channel - summary: Remove a user from a channel - description: Remove a user from a channel or a user's invite to a channel role - operationId: remove-channel-member + summary: Accept or reject a channel invite + description: Accept or reject a channel invite + operationId: respond-channel-invite parameters: - $ref: "#/components/parameters/ApiKey" requestBody: @@ -6023,17 +6097,18 @@ paths: required: - signer_uuid - channel_id - - fid - role + - accept properties: signer_uuid: $ref: "#/components/schemas/SignerUUID" channel_id: $ref: "#/components/schemas/ChannelId" - fid: - $ref: "#/components/schemas/Fid" role: $ref: "#/components/schemas/ChannelMemberRole" + accept: + type: boolean + description: Accept or reject the invite responses: "200": description: Successful operation. @@ -6045,22 +6120,27 @@ paths: $ref: "#/components/responses/400Response" "500": $ref: "#/components/responses/500Response" - /farcaster/channel/member/list: + /farcaster/channel/member/invite/list: get: tags: - Channel - summary: Retrieve a list of members in a channel - description: Retrieve a list of members in a channel - operationId: list-channel-members + summary: Retrieve a list of invites in a channel + description: Retrieve a list of invites in a channel + operationId: list-channel-invites parameters: - $ref: "#/components/parameters/ApiKey" - name: channel_id in: query - required: true schema: $ref: "#/components/schemas/ChannelId" example: "neynar" description: Channel ID for the channel being queried + - name: invited_fid + in: query + schema: + $ref: "#/components/schemas/Fid" + example: 194 + description: FID of the user being invited - name: limit in: query description: Number of results to retrieve @@ -6082,7 +6162,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ChannelMemberListResponse" + $ref: "#/components/schemas/ChannelMemberInviteListResponse" "500": $ref: "#/components/responses/500Response" "400":